-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex.d.ts
45 lines (36 loc) · 1.17 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {type Readable as ReadableStream} from 'node:stream';
import {type Buffer} from 'node:buffer';
export type Input =
| Buffer
| NodeJS.TypedArray
| ArrayBuffer
| string
| Iterable<Buffer | string>
| AsyncIterable<Buffer | string>;
/* eslint-disable @typescript-eslint/ban-types */
export type ObjectInput =
| object
| Iterable<object>
| AsyncIterable<object>;
/* eslint-enable @typescript-eslint/ban-types */
declare const intoStream: {
/**
Convert `input` into a stream. Adheres to the requested chunk size, except for `array` where each element will be a chunk.
@param input - The input to convert to a stream.
@returns A [readable stream](https://nodejs.org/api/stream.html#class-streamreadable).
@example
```
import intoStream from 'into-stream';
intoStream('unicorn').pipe(process.stdout);
//=> 'unicorn'
```
*/
(input: Input | Promise<Input>): ReadableStream;
/**
Convert object `input` into a stream.
@param input - The object input to convert to a stream.
@returns A [readable object stream](https://nodejs.org/api/stream.html#object-mode).
*/
object: (input: ObjectInput | Promise<ObjectInput>) => ReadableStream;
};
export default intoStream;