1 | import { type ReactNode } from 'react';
|
2 | export type Options = {
|
3 | stdout: NodeJS.WriteStream;
|
4 | stdin: NodeJS.ReadStream;
|
5 | stderr: NodeJS.WriteStream;
|
6 | debug: boolean;
|
7 | exitOnCtrlC: boolean;
|
8 | patchConsole: boolean;
|
9 | waitUntilExit?: () => Promise<void>;
|
10 | };
|
11 | export default class Ink {
|
12 | private readonly options;
|
13 | private readonly log;
|
14 | private readonly throttledLog;
|
15 | private isUnmounted;
|
16 | private lastOutput;
|
17 | private readonly container;
|
18 | private readonly rootNode;
|
19 | private fullStaticOutput;
|
20 | private exitPromise?;
|
21 | private restoreConsole?;
|
22 | private readonly unsubscribeResize?;
|
23 | constructor(options: Options);
|
24 | resized: () => void;
|
25 | resolveExitPromise: () => void;
|
26 | rejectExitPromise: (reason?: Error) => void;
|
27 | unsubscribeExit: () => void;
|
28 | calculateLayout: () => void;
|
29 | onRender: () => void;
|
30 | render(node: ReactNode): void;
|
31 | writeToStdout(data: string): void;
|
32 | writeToStderr(data: string): void;
|
33 | unmount(error?: Error | number | null): void;
|
34 | waitUntilExit(): Promise<void>;
|
35 | clear(): void;
|
36 | patchConsole(): void;
|
37 | }
|