diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 0536e0e2b..f2e5107d0 100644 --- a/baselines/audioworklet.generated.d.ts +++ b/baselines/audioworklet.generated.d.ts @@ -57,6 +57,16 @@ interface QueuingStrategyInit { highWaterMark: number; } +interface ReadableStreamBYOBReadDoneResult { + done: true; + value: T | undefined; +} + +interface ReadableStreamDefaultReadDoneResult { + done: true; + value: undefined; +} + interface ReadableStreamGetReaderOptions { /** * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. @@ -66,11 +76,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -775,7 +780,7 @@ declare var ReadableStream: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read(view: T): Promise>; + read(view: T): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ releaseLock(): void; } @@ -820,7 +825,7 @@ declare var ReadableStreamDefaultController: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */ interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */ - read(): Promise>; + read(): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */ releaseLock(): void; } @@ -1408,8 +1413,10 @@ type BufferSource = ArrayBufferView | ArrayBuffer; type DOMHighResTimeStamp = number; type EventListenerOrEventListenerObject = EventListener | EventListenerObject; type MessageEventSource = MessagePort; +type ReadableStreamBYOBReadResult = ReadableStreamReadValueResult | ReadableStreamBYOBReadDoneResult; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; -type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; +type ReadableStreamDefaultReadResult = ReadableStreamReadValueResult | ReadableStreamDefaultReadDoneResult; +type ReadableStreamReadResult = ReadableStreamDefaultReadResult | ReadableStreamBYOBReadResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; type Transferable = MessagePort | ReadableStream | WritableStream | TransformStream | ArrayBuffer; type CompressionFormat = "deflate" | "deflate-raw" | "gzip"; diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 471cf5b24..44be8b6a7 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -1610,6 +1610,16 @@ interface RTCTransportStats extends RTCStats { tlsVersion?: string; } +interface ReadableStreamBYOBReadDoneResult { + done: true; + value: T | undefined; +} + +interface ReadableStreamDefaultReadDoneResult { + done: true; + value: undefined; +} + interface ReadableStreamGetReaderOptions { /** * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. @@ -1619,11 +1629,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -18633,7 +18638,7 @@ declare var ReadableStream: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read(view: T): Promise>; + read(view: T): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ releaseLock(): void; } @@ -18678,7 +18683,7 @@ declare var ReadableStreamDefaultController: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */ interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */ - read(): Promise>; + read(): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */ releaseLock(): void; } @@ -28203,8 +28208,10 @@ type OptionalPostfixToken = ` ${T}` | ""; type OptionalPrefixToken = `${T} ` | ""; type PerformanceEntryList = PerformanceEntry[]; type RTCRtpTransform = RTCRtpScriptTransform; +type ReadableStreamBYOBReadResult = ReadableStreamReadValueResult | ReadableStreamBYOBReadDoneResult; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; -type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; +type ReadableStreamDefaultReadResult = ReadableStreamReadValueResult | ReadableStreamDefaultReadDoneResult; +type ReadableStreamReadResult = ReadableStreamDefaultReadResult | ReadableStreamBYOBReadResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; type ReportList = Report[]; diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index a1ef2b447..e1ea7f3fd 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -479,6 +479,16 @@ interface QueuingStrategyInit { highWaterMark: number; } +interface ReadableStreamBYOBReadDoneResult { + done: true; + value: T | undefined; +} + +interface ReadableStreamDefaultReadDoneResult { + done: true; + value: undefined; +} + interface ReadableStreamGetReaderOptions { /** * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. @@ -488,11 +498,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -4524,7 +4529,7 @@ declare var ReadableStream: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read(view: T): Promise>; + read(view: T): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ releaseLock(): void; } @@ -4569,7 +4574,7 @@ declare var ReadableStreamDefaultController: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */ interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */ - read(): Promise>; + read(): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */ releaseLock(): void; } @@ -8575,8 +8580,10 @@ type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmap type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; +type ReadableStreamBYOBReadResult = ReadableStreamReadValueResult | ReadableStreamBYOBReadDoneResult; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; -type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; +type ReadableStreamDefaultReadResult = ReadableStreamReadValueResult | ReadableStreamDefaultReadDoneResult; +type ReadableStreamReadResult = ReadableStreamDefaultReadResult | ReadableStreamBYOBReadResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; type ReportList = Report[]; type RequestInfo = Request | string; diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 533adff76..396148d3e 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -445,6 +445,16 @@ interface QueuingStrategyInit { highWaterMark: number; } +interface ReadableStreamBYOBReadDoneResult { + done: true; + value: T | undefined; +} + +interface ReadableStreamDefaultReadDoneResult { + done: true; + value: undefined; +} + interface ReadableStreamGetReaderOptions { /** * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. @@ -454,11 +464,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -4358,7 +4363,7 @@ declare var ReadableStream: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read(view: T): Promise>; + read(view: T): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ releaseLock(): void; } @@ -4403,7 +4408,7 @@ declare var ReadableStreamDefaultController: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */ interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */ - read(): Promise>; + read(): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */ releaseLock(): void; } @@ -8581,8 +8586,10 @@ type NamedCurve = string; type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; +type ReadableStreamBYOBReadResult = ReadableStreamReadValueResult | ReadableStreamBYOBReadDoneResult; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; -type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; +type ReadableStreamDefaultReadResult = ReadableStreamReadValueResult | ReadableStreamDefaultReadDoneResult; +type ReadableStreamReadResult = ReadableStreamDefaultReadResult | ReadableStreamBYOBReadResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; type ReportList = Report[]; type RequestInfo = Request | string; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index b488068f4..5734d8c50 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -523,6 +523,16 @@ interface RTCEncodedVideoFrameMetadata { width?: number; } +interface ReadableStreamBYOBReadDoneResult { + done: true; + value: T | undefined; +} + +interface ReadableStreamDefaultReadDoneResult { + done: true; + value: undefined; +} + interface ReadableStreamGetReaderOptions { /** * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. @@ -532,11 +542,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -4848,7 +4853,7 @@ declare var ReadableStream: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read(view: T): Promise>; + read(view: T): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ releaseLock(): void; } @@ -4893,7 +4898,7 @@ declare var ReadableStreamDefaultController: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */ interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */ - read(): Promise>; + read(): Promise>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */ releaseLock(): void; } @@ -9308,8 +9313,10 @@ type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmap type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; +type ReadableStreamBYOBReadResult = ReadableStreamReadValueResult | ReadableStreamBYOBReadDoneResult; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; -type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; +type ReadableStreamDefaultReadResult = ReadableStreamReadValueResult | ReadableStreamDefaultReadDoneResult; +type ReadableStreamReadResult = ReadableStreamDefaultReadResult | ReadableStreamBYOBReadResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; type ReportList = Report[]; type RequestInfo = Request | string; diff --git a/inputfiles/addedTypes.jsonc b/inputfiles/addedTypes.jsonc index e0b8ae7c9..b8124b7fd 100644 --- a/inputfiles/addedTypes.jsonc +++ b/inputfiles/addedTypes.jsonc @@ -1287,8 +1287,25 @@ } } }, - "ReadableStreamReadDoneResult": { - "name": "ReadableStreamReadDoneResult", + "ReadableStreamDefaultReadDoneResult": { + "name": "ReadableStreamDefaultReadDoneResult", + "members": { + "member": { + "done": { + "name": "done", + "overrideType": "true", + "required": true + }, + "value": { + "name": "value", + "overrideType": "undefined", + "required": true + } + } + } + }, + "ReadableStreamBYOBReadDoneResult": { + "name": "ReadableStreamBYOBReadDoneResult", "typeParameters": [ { "name": "T" @@ -1303,7 +1320,8 @@ }, "value": { "name": "value", - "overrideType": "T" + "overrideType": "T | undefined", + "required": true } } } @@ -1521,7 +1539,7 @@ ] }, { - "name": "ReadableStreamReadResult", + "name": "ReadableStreamDefaultReadResult", "typeParameters": [ { "name": "T" @@ -1532,10 +1550,44 @@ "type": "ReadableStreamReadValueResult" }, { - "type": "ReadableStreamReadDoneResult" + "type": "ReadableStreamDefaultReadDoneResult" + } + ], + "overrideType": "ReadableStreamReadValueResult | ReadableStreamDefaultReadDoneResult" + }, + { + "name": "ReadableStreamBYOBReadResult", + "typeParameters": [ + { + "name": "T" + } + ], + "type": [ + { + "type": "ReadableStreamReadValueResult" + }, + { + "type": "ReadableStreamBYOBReadDoneResult" + } + ], + "overrideType": "ReadableStreamReadValueResult | ReadableStreamBYOBReadDoneResult" + }, + { + "name": "ReadableStreamReadResult", + "typeParameters": [ + { + "name": "T" + } + ], + "type": [ + { + "type": "ReadableStreamDefaultReadResult" + }, + { + "type": "ReadableStreamBYOBReadResult" } ], - "overrideType": "ReadableStreamReadValueResult | ReadableStreamReadDoneResult" + "overrideType": "ReadableStreamDefaultReadResult | ReadableStreamBYOBReadResult" }, { "name": "EventListenerOrEventListenerObject", diff --git a/inputfiles/overridingTypes.jsonc b/inputfiles/overridingTypes.jsonc index 21924841b..e4eba9822 100644 --- a/inputfiles/overridingTypes.jsonc +++ b/inputfiles/overridingTypes.jsonc @@ -2652,7 +2652,7 @@ "overrideType": "T" } ], - "overrideType": "Promise>" + "overrideType": "Promise>" } } } @@ -2690,7 +2690,7 @@ "read": { "signature": { "0": { - "overrideType": "Promise>" + "overrideType": "Promise>" } } }