Skip to content

Commit

Permalink
fix: Referenced to dom lib
Browse files Browse the repository at this point in the history
  • Loading branch information
erayhanoglu committed Oct 30, 2024
1 parent b76f0e6 commit d9add8c
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions lib/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,4 @@
/**
* Declare ReadableStream and WritableStream in case dom.d.ts is not added to the tsconfig
* lib causing ReadableStream or WritableStream interface is not defined.
* For developers with dom.d.ts added, the ReadableStream and WritableStream
* interface will be merged correctly.
*
* This is also required for any clients with streaming interface where ReadableStream
* or WritableStream type is also referred.
*/
declare global {
export interface ReadableStream<R = any> {
readonly locked: boolean;

cancel(reason?: any): Promise<void>;

getReader(options: { mode: 'byob' }): ReadableStreamBYOBReader;

getReader(): ReadableStreamDefaultReader<R>;

getReader(
options?: ReadableStreamGetReaderOptions,
): ReadableStreamReader<R>;
}

export interface WritableStream<W = any> {
readonly locked: boolean;

abort(reason?: any): Promise<void>;

getWriter(): WritableStreamDefaultWriter<W>;
}
}
/// <reference lib="dom" />

/**
* BasicPrimitive
Expand Down

0 comments on commit d9add8c

Please sign in to comment.