mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -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: {
|
declare var ReadableStream: {
|
||||||
prototype: 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: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||||
new<R = any>(underlyingSource?: UnderlyingSource<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>;
|
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: {
|
declare var ReadableStream: {
|
||||||
prototype: 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: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||||
new<R = any>(underlyingSource?: UnderlyingSource<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>;
|
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>;
|
(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 */
|
/** @category Streams */
|
||||||
declare interface UnderlyingSourcePullCallback<R> {
|
declare interface UnderlyingSourcePullCallback<R> {
|
||||||
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
|
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
|
||||||
|
@ -749,6 +741,15 @@ declare interface UnderlyingSourceStartCallback<R> {
|
||||||
(controller: ReadableStreamController<R>): any;
|
(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 */
|
/** @category Streams */
|
||||||
declare interface ReadableStreamDefaultController<R = any> {
|
declare interface ReadableStreamDefaultController<R = any> {
|
||||||
readonly desiredSize: number | null;
|
readonly desiredSize: number | null;
|
||||||
|
@ -877,7 +878,7 @@ declare var ReadableStream: {
|
||||||
readonly prototype: ReadableStream;
|
readonly prototype: ReadableStream;
|
||||||
new (
|
new (
|
||||||
underlyingSource: UnderlyingByteSource,
|
underlyingSource: UnderlyingByteSource,
|
||||||
strategy?: { highWaterMark?: number; size?: undefined },
|
strategy?: { highWaterMark?: number },
|
||||||
): ReadableStream<Uint8Array>;
|
): ReadableStream<Uint8Array>;
|
||||||
new <R = any>(
|
new <R = any>(
|
||||||
underlyingSource: UnderlyingDefaultSource<R>,
|
underlyingSource: UnderlyingDefaultSource<R>,
|
||||||
|
|
Loading…
Reference in a new issue