From a66707386217dd5c6247d8378c5cf618786fb3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sun, 21 Jan 2024 19:59:39 +0100 Subject: [PATCH 1/4] Updating added types for ReadableStreamReadDoneResult --- inputfiles/addedTypes.jsonc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/inputfiles/addedTypes.jsonc b/inputfiles/addedTypes.jsonc index e0b8ae7c9..20d2f2d4a 100644 --- a/inputfiles/addedTypes.jsonc +++ b/inputfiles/addedTypes.jsonc @@ -1289,11 +1289,6 @@ }, "ReadableStreamReadDoneResult": { "name": "ReadableStreamReadDoneResult", - "typeParameters": [ - { - "name": "T" - } - ], "members": { "member": { "done": { @@ -1303,7 +1298,8 @@ }, "value": { "name": "value", - "overrideType": "T" + "overrideType": "undefined", + "required": true } } } @@ -1535,7 +1531,7 @@ "type": "ReadableStreamReadDoneResult" } ], - "overrideType": "ReadableStreamReadValueResult | ReadableStreamReadDoneResult" + "overrideType": "ReadableStreamReadValueResult | ReadableStreamReadDoneResult" }, { "name": "EventListenerOrEventListenerObject", From e138a7d058a1166e2be13a6341910ef625b42add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sun, 21 Jan 2024 20:40:25 +0100 Subject: [PATCH 2/4] Splitting "ReadableStreamReadResult" into "Default" and "BYOB" --- inputfiles/addedTypes.jsonc | 62 ++++++++++++++++++++++++++++++-- inputfiles/overridingTypes.jsonc | 4 +-- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/inputfiles/addedTypes.jsonc b/inputfiles/addedTypes.jsonc index 20d2f2d4a..82edd12f2 100644 --- a/inputfiles/addedTypes.jsonc +++ b/inputfiles/addedTypes.jsonc @@ -1304,6 +1304,28 @@ } } }, + "ReadableStreamBYOBReadDoneResult": { + "name": "ReadableStreamReadDoneResult", + "typeParameters": [ + { + "name": "T" + } + ], + "members": { + "member": { + "done": { + "name": "done", + "overrideType": "true", + "required": true + }, + "value": { + "name": "value", + "overrideType": "T", + "required": true + } + } + } + }, "ReadableStreamReadValueResult": { "name": "ReadableStreamReadValueResult", "typeParameters": [ @@ -1517,7 +1539,24 @@ ] }, { - "name": "ReadableStreamReadResult", + "name": "ReadableStreamDefaultReadResult", + "typeParameters": [ + { + "name": "T" + } + ], + "type": [ + { + "type": "ReadableStreamReadValueResult" + }, + { + "type": "ReadableStreamDefaultReadDoneResult" + } + ], + "overrideType": "ReadableStreamReadValueResult | ReadableStreamDefaultReadDoneResult" + }, + { + "name": "ReadableStreamBYOBReadResult", "typeParameters": [ { "name": "T" @@ -1528,10 +1567,27 @@ "type": "ReadableStreamReadValueResult" }, { - "type": "ReadableStreamReadDoneResult" + "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>" } } } From 94876a00badb0454bd90ebdfe98dca9c20b5a4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sun, 21 Jan 2024 20:50:04 +0100 Subject: [PATCH 3/4] Comitting baselines --- baselines/audioworklet.generated.d.ts | 13 +++++-------- baselines/dom.generated.d.ts | 13 +++++-------- baselines/serviceworker.generated.d.ts | 13 +++++-------- baselines/sharedworker.generated.d.ts | 13 +++++-------- baselines/webworker.generated.d.ts | 13 +++++-------- 5 files changed, 25 insertions(+), 40 deletions(-) diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 0536e0e2b..1a37d0e68 100644 --- a/baselines/audioworklet.generated.d.ts +++ b/baselines/audioworklet.generated.d.ts @@ -66,11 +66,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -775,7 +770,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 +815,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 +1403,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..aaf66b9da 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -1619,11 +1619,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -18633,7 +18628,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 +18673,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 +28198,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..5ebe2612f 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -488,11 +488,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -4524,7 +4519,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 +4564,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 +8570,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..c035573a7 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -454,11 +454,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -4358,7 +4353,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 +4398,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 +8576,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..ff9b85911 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -532,11 +532,6 @@ interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } -interface ReadableStreamReadDoneResult { - done: true; - value?: T; -} - interface ReadableStreamReadValueResult { done: false; value: T; @@ -4848,7 +4843,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 +4888,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 +9303,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; From cc39996ce43bfeb2a0acb47736f4a4bfd0086e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Mon, 22 Jan 2024 09:53:39 +0100 Subject: [PATCH 4/4] Incorporated feedback --- baselines/audioworklet.generated.d.ts | 10 ++++++++++ baselines/dom.generated.d.ts | 10 ++++++++++ baselines/serviceworker.generated.d.ts | 10 ++++++++++ baselines/sharedworker.generated.d.ts | 10 ++++++++++ baselines/webworker.generated.d.ts | 10 ++++++++++ inputfiles/addedTypes.jsonc | 8 ++++---- 6 files changed, 54 insertions(+), 4 deletions(-) diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 1a37d0e68..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. diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index aaf66b9da..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. diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index 5ebe2612f..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. diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index c035573a7..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. diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index ff9b85911..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. diff --git a/inputfiles/addedTypes.jsonc b/inputfiles/addedTypes.jsonc index 82edd12f2..b8124b7fd 100644 --- a/inputfiles/addedTypes.jsonc +++ b/inputfiles/addedTypes.jsonc @@ -1287,8 +1287,8 @@ } } }, - "ReadableStreamReadDoneResult": { - "name": "ReadableStreamReadDoneResult", + "ReadableStreamDefaultReadDoneResult": { + "name": "ReadableStreamDefaultReadDoneResult", "members": { "member": { "done": { @@ -1305,7 +1305,7 @@ } }, "ReadableStreamBYOBReadDoneResult": { - "name": "ReadableStreamReadDoneResult", + "name": "ReadableStreamBYOBReadDoneResult", "typeParameters": [ { "name": "T" @@ -1320,7 +1320,7 @@ }, "value": { "name": "value", - "overrideType": "T", + "overrideType": "T | undefined", "required": true } }