|
| 1 | +import { |
| 2 | + Readable, Writable, |
| 3 | +} from "stream"; |
| 4 | + |
1 | 5 | /* eslint-disable @typescript-eslint/no-explicit-any */
|
2 | 6 | export type JSONValue =
|
3 | 7 | | string
|
@@ -69,7 +73,7 @@ export interface HTTPResponse {
|
69 | 73 | /**
|
70 | 74 | * Http Body
|
71 | 75 | */
|
72 |
| - body: string | Buffer | ReadableStream; |
| 76 | + body: string | Buffer | Readable; |
73 | 77 | /**
|
74 | 78 | * If true, issue the response when the promise returned is resolved, otherwise issue
|
75 | 79 | * the response at the end of the workflow execution
|
@@ -114,13 +118,13 @@ export interface IApi {
|
114 | 118 |
|
115 | 119 | export interface IFile {
|
116 | 120 | delete(): Promise<void>;
|
117 |
| - createReadStream(): Promise<ReadableStream>; |
118 |
| - createWriteStream(contentType?: string, contentLength?: number): Promise<WritableStream>; |
| 121 | + createReadStream(): Promise<Readable>; |
| 122 | + createWriteStream(contentType?: string, contentLength?: number): Promise<Writable>; |
119 | 123 | toEncodedString(encoding?: string, start?: number, end?: number): Promise<string>;
|
120 | 124 | toUrl(): Promise<string>;
|
121 | 125 | toFile(localFilePath: string): Promise<void>;
|
122 | 126 | toBuffer(): Promise<Buffer>;
|
123 |
| - fromReadableStream(readableStream: ReadableStream, contentType?: string, contentSize?: number): Promise<IFile>; |
| 127 | + fromReadableStream(readableStream: Readable, contentType?: string, contentSize?: number): Promise<IFile>; |
124 | 128 | fromFile(localFilePath: string, contentType?: string): Promise<IFile>;
|
125 | 129 | fromUrl(url: string, options?: any): Promise<IFile>;
|
126 | 130 | toJSON(): any;
|
|
0 commit comments