Skip to content

Commit 4a9092d

Browse files
GTFalcaojs07
andauthored
Types: replacing ReadableStream and WritableStream (#18666)
* Replacing ReadableStream and WritableStream * Update types/src/index.ts Co-authored-by: js07 <[email protected]> --------- Co-authored-by: js07 <[email protected]>
1 parent 3f1fc3e commit 4a9092d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/types",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"description": "Pipedream TypeScript types",
55
"keywords": [
66
"pipedream",

types/src/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import {
2+
Readable, Writable,
3+
} from "stream";
4+
15
/* eslint-disable @typescript-eslint/no-explicit-any */
26
export type JSONValue =
37
| string
@@ -69,7 +73,7 @@ export interface HTTPResponse {
6973
/**
7074
* Http Body
7175
*/
72-
body: string | Buffer | ReadableStream;
76+
body: string | Buffer | Readable;
7377
/**
7478
* If true, issue the response when the promise returned is resolved, otherwise issue
7579
* the response at the end of the workflow execution
@@ -114,13 +118,13 @@ export interface IApi {
114118

115119
export interface IFile {
116120
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>;
119123
toEncodedString(encoding?: string, start?: number, end?: number): Promise<string>;
120124
toUrl(): Promise<string>;
121125
toFile(localFilePath: string): Promise<void>;
122126
toBuffer(): Promise<Buffer>;
123-
fromReadableStream(readableStream: ReadableStream, contentType?: string, contentSize?: number): Promise<IFile>;
127+
fromReadableStream(readableStream: Readable, contentType?: string, contentSize?: number): Promise<IFile>;
124128
fromFile(localFilePath: string, contentType?: string): Promise<IFile>;
125129
fromUrl(url: string, options?: any): Promise<IFile>;
126130
toJSON(): any;

0 commit comments

Comments
 (0)