You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2595,21 +2595,25 @@ Type: `object`
2595
2595
2596
2596
###### stdout
2597
2597
2598
-
Type: `stream.Writable`\
2598
+
Type: `InkOutputStream`\
2599
2599
Default: `process.stdout`
2600
2600
2601
2601
Output stream where the app will be rendered.
2602
2602
2603
+
Any object with a `write()` method can be passed, like a stream that captures output in memory, so it doesn't have to be a terminal stream. The `InkOutputStream` type is exported for typing your own streams.
2604
+
2603
2605
###### stdin
2604
2606
2605
-
Type: `stream.Readable`\
2607
+
Type: `InkInputStream`\
2606
2608
Default: `process.stdin`
2607
2609
2608
2610
Input stream where app will listen for input.
2609
2611
2612
+
Any object with `on()` and `read()` methods can be passed. The `InkInputStream` type is exported for typing your own streams.
Typed structurally, so any stream that captures output can be passed without a type assertion, not just a terminal stream. `process.stdout` satisfies this type.
12
+
13
+
Everything except `write()` is optional, because Ink checks for their presence at runtime.
14
+
*/
15
+
exporttypeInkOutputStream={
16
+
columns?: number;
17
+
rows?: number;
18
+
isTTY?: boolean;
19
+
destroyed?: boolean;
20
+
writable?: boolean;
21
+
writableEnded?: boolean;
22
+
writableLength?: number;
23
+
write(data: string, ...rest: unknown[]): unknown;
24
+
on?(event: unknown,listener: unknown): unknown;
25
+
off?(event: unknown,listener: unknown): unknown;
26
+
};
27
+
28
+
/**
29
+
Input stream that Ink can listen for input on.
30
+
31
+
Typed structurally, like `InkOutputStream`. `process.stdin` satisfies this type.
0 commit comments