Skip to content

Commit 061b5f5

Browse files
authored
fix(types): declare ReadableStream type without requiring dom (#3889)
1 parent 574507f commit 061b5f5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/types/src/serde.ts

+13
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ export interface ResponseDeserializer<OutputType, ResponseType = any, Context =
5353
(output: ResponseType, context: Context): Promise<OutputType>;
5454
}
5555

56+
/**
57+
* Declare ReadableStream in case dom.d.ts is not added to the tsconfig lib causing
58+
* ReadableStream interface is not defined. For developers with dom.d.ts added,
59+
* the ReadableStream interface will be merged correctly.
60+
*
61+
* This is also required for any clients with streaming interface where ReadableStream
62+
* type is also referred. The type is only declared here once since this @aws-sdk/types
63+
* is depended by all @aws-sdk packages.
64+
*/
65+
declare global {
66+
export interface ReadableStream {}
67+
}
68+
5669
/**
5770
* The interface contains mix-in utility functions to transfer the runtime-specific
5871
* stream implementation to specified format. Each stream can ONLY be transformed

0 commit comments

Comments
 (0)