diff --git a/src/ink.tsx b/src/ink.tsx index 00abe1ae..f59fa9f0 100644 --- a/src/ink.tsx +++ b/src/ink.tsx @@ -27,12 +27,10 @@ export type Options = { waitUntilExit?: () => Promise; }; -type ThrottledFunc void> = ReturnType>; - export default class Ink { private readonly options: Options; private readonly log: LogUpdate; - private readonly throttledLog: LogUpdate | ThrottledFunc; + private readonly throttledLog: LogUpdate; // Ignore last render after unmounting a tree to prevent empty output before exit private isUnmounted: boolean; private lastOutput: string; @@ -66,7 +64,7 @@ export default class Ink { : throttle(this.log, undefined, { leading: true, trailing: true, - }); + }) as unknown as LogUpdate; // Ignore last render after unmounting a tree to prevent empty output before exit this.isUnmounted = false;