Skip to content

Commit

Permalink
Replace ThrottledFunc with type assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Sep 29, 2024
1 parent e0cbe03 commit d760f43
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ export type Options = {
waitUntilExit?: () => Promise<void>;
};

type ThrottledFunc<T extends (...args: any[]) => void> = ReturnType<typeof throttle<T>>;

export default class Ink {
private readonly options: Options;
private readonly log: LogUpdate;
private readonly throttledLog: LogUpdate | ThrottledFunc<LogUpdate>;
private readonly throttledLog: LogUpdate;
// Ignore last render after unmounting a tree to prevent empty output before exit
private isUnmounted: boolean;
private lastOutput: string;
Expand Down Expand Up @@ -66,7 +64,7 @@ export default class Ink {
: throttle(this.log, undefined, {

Check failure on line 64 in src/ink.tsx

View workflow job for this annotation

GitHub Actions / Node.js 18

Insert `(`

Check failure on line 64 in src/ink.tsx

View workflow job for this annotation

GitHub Actions / Node.js 20

Insert `(`
leading: true,
trailing: true,
});
}) as unknown as LogUpdate;

Check failure on line 67 in src/ink.tsx

View workflow job for this annotation

GitHub Actions / Node.js 18

Insert `)`

Check failure on line 67 in src/ink.tsx

View workflow job for this annotation

GitHub Actions / Node.js 20

Insert `)`

// Ignore last render after unmounting a tree to prevent empty output before exit
this.isUnmounted = false;
Expand Down

0 comments on commit d760f43

Please sign in to comment.