diff --git a/types/whatwg-streams/index.d.ts b/types/whatwg-streams/index.d.ts index e2487d438d..cadcf346ca 100644 --- a/types/whatwg-streams/index.d.ts +++ b/types/whatwg-streams/index.d.ts @@ -71,7 +71,7 @@ declare class ReadableStreamBYOBReader { } declare class ReadableStreamDefaultController { - readonly desiredSize: number; + readonly desiredSize: number | null; close(): void; enqueue(chunk: R): void; @@ -80,7 +80,7 @@ declare class ReadableStreamDefaultController { declare class ReadableByteStreamController { readonly byobRequest: ReadableStreamBYOBRequest; - readonly desiredSize: number; + readonly desiredSize: number | null; close(): void; enqueue(chunk: R): void; @@ -157,5 +157,5 @@ declare class TransformStreamDefaultController { error(reason: any): void; terminate(): void; - readonly desiredSize: number; + readonly desiredSize: number | null; } diff --git a/types/whatwg-streams/whatwg-streams-tests.ts b/types/whatwg-streams/whatwg-streams-tests.ts index 56246e0d97..c6e83a89d3 100644 --- a/types/whatwg-streams/whatwg-streams-tests.ts +++ b/types/whatwg-streams/whatwg-streams-tests.ts @@ -48,7 +48,7 @@ function makeReadableBackpressureSocketStream(host: string, port: number) { socket.ondata = (event: any) => { controller.enqueue(event.data); - if (controller.desiredSize <= 0) { + if (controller.desiredSize! <= 0) { // The internal queue is full, so propagate // the backpressure signal to the underlying source. socket.readStop();