mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
fix(types): fix streams types (#24770)
This commit is contained in:
parent
41f8988dc7
commit
ad5cec27d3
3 changed files with 12 additions and 11 deletions
2
cli/tsc/dts/lib.dom.d.ts
vendored
2
cli/tsc/dts/lib.dom.d.ts
vendored
|
@ -18823,7 +18823,7 @@ interface ReadableStream<R = any> {
|
|||
|
||||
declare var ReadableStream: {
|
||||
prototype: ReadableStream;
|
||||
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number; size?: undefined }): ReadableStream<Uint8Array>;
|
||||
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream<Uint8Array>;
|
||||
new<R = any>(underlyingSource: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||
from<R>(asyncIterable: AsyncIterable<R> | Iterable<R | PromiseLike<R>>): ReadableStream<R>;
|
||||
|
|
2
cli/tsc/dts/lib.webworker.d.ts
vendored
2
cli/tsc/dts/lib.webworker.d.ts
vendored
|
@ -4882,7 +4882,7 @@ interface ReadableStream<R = any> {
|
|||
|
||||
declare var ReadableStream: {
|
||||
prototype: ReadableStream;
|
||||
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number; size?: undefined }): ReadableStream<Uint8Array>;
|
||||
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream<Uint8Array>;
|
||||
new<R = any>(underlyingSource: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||
from<R>(asyncIterable: AsyncIterable<R> | Iterable<R | PromiseLike<R>>): ReadableStream<R>;
|
||||
|
|
19
ext/web/lib.deno_web.d.ts
vendored
19
ext/web/lib.deno_web.d.ts
vendored
|
@ -731,14 +731,6 @@ declare interface UnderlyingSourceCancelCallback {
|
|||
(reason?: any): void | PromiseLike<void>;
|
||||
}
|
||||
|
||||
// TODO(petamoriken): Will be removed in v2.0.
|
||||
/**
|
||||
* @deprecated use `UnderlyingSourcePullCallback` instead.
|
||||
* @category Streams
|
||||
*/
|
||||
declare type ReadableStreamDefaultControllerCallback<R> =
|
||||
UnderlyingSourcePullCallback<R>;
|
||||
|
||||
/** @category Streams */
|
||||
declare interface UnderlyingSourcePullCallback<R> {
|
||||
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
|
||||
|
@ -749,6 +741,15 @@ declare interface UnderlyingSourceStartCallback<R> {
|
|||
(controller: ReadableStreamController<R>): any;
|
||||
}
|
||||
|
||||
// TODO(petamoriken): Will be removed in v2.0.
|
||||
/**
|
||||
* @deprecated use `(controller: ReadableStreamDefaultController<R>) => void | PromiseLike<void>` type instead.
|
||||
* @category Streams
|
||||
*/
|
||||
declare type ReadableStreamDefaultControllerCallback<R> = (
|
||||
controller: ReadableStreamDefaultController<R>,
|
||||
) => void | PromiseLike<void>;
|
||||
|
||||
/** @category Streams */
|
||||
declare interface ReadableStreamDefaultController<R = any> {
|
||||
readonly desiredSize: number | null;
|
||||
|
@ -877,7 +878,7 @@ declare var ReadableStream: {
|
|||
readonly prototype: ReadableStream;
|
||||
new (
|
||||
underlyingSource: UnderlyingByteSource,
|
||||
strategy?: { highWaterMark?: number; size?: undefined },
|
||||
strategy?: { highWaterMark?: number },
|
||||
): ReadableStream<Uint8Array>;
|
||||
new <R = any>(
|
||||
underlyingSource: UnderlyingDefaultSource<R>,
|
||||
|
|
Loading…
Reference in a new issue