From 3ac538d1290af93733bd61a23846aa6590dc692b Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Mon, 29 Jul 2024 03:36:10 +0900 Subject: [PATCH] Improve some types from Deno (#1759) Co-authored-by: saschanaz --- baselines/audioworklet.generated.d.ts | 6 +++- baselines/dom.generated.d.ts | 6 +++- baselines/serviceworker.generated.d.ts | 6 +++- baselines/sharedworker.generated.d.ts | 6 +++- baselines/webworker.generated.d.ts | 6 +++- inputfiles/overridingTypes.jsonc | 44 ++++++++++++++++++++++++++ 6 files changed, 69 insertions(+), 5 deletions(-) diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 6c7ca221..48cea5cd 100644 --- a/baselines/audioworklet.generated.d.ts +++ b/baselines/audioworklet.generated.d.ts @@ -291,6 +291,8 @@ declare var ByteLengthQueuingStrategy: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */ interface CompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var CompressionStream: { @@ -411,6 +413,8 @@ declare var DOMException: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */ interface DecompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var DecompressionStream: { @@ -786,7 +790,7 @@ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { declare var ReadableStreamBYOBReader: { prototype: ReadableStreamBYOBReader; - new(stream: ReadableStream): ReadableStreamBYOBReader; + new(stream: ReadableStream): ReadableStreamBYOBReader; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */ diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index ce55651b..7aac39ee 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -5844,6 +5844,8 @@ declare var CompositionEvent: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */ interface CompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var CompressionStream: { @@ -6694,6 +6696,8 @@ declare var DataTransferItemList: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */ interface DecompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var DecompressionStream: { @@ -18266,7 +18270,7 @@ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { declare var ReadableStreamBYOBReader: { prototype: ReadableStreamBYOBReader; - new(stream: ReadableStream): ReadableStreamBYOBReader; + new(stream: ReadableStream): ReadableStreamBYOBReader; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */ diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index 5cdec894..e55b3bb5 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -1640,6 +1640,8 @@ declare var CloseEvent: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */ interface CompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var CompressionStream: { @@ -2044,6 +2046,8 @@ declare var DOMStringList: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */ interface DecompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var DecompressionStream: { @@ -4491,7 +4495,7 @@ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { declare var ReadableStreamBYOBReader: { prototype: ReadableStreamBYOBReader; - new(stream: ReadableStream): ReadableStreamBYOBReader; + new(stream: ReadableStream): ReadableStreamBYOBReader; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */ diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 9ad14b70..d51f2c45 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -1567,6 +1567,8 @@ declare var CloseEvent: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */ interface CompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var CompressionStream: { @@ -1971,6 +1973,8 @@ declare var DOMStringList: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */ interface DecompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var DecompressionStream: { @@ -4325,7 +4329,7 @@ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { declare var ReadableStreamBYOBReader: { prototype: ReadableStreamBYOBReader; - new(stream: ReadableStream): ReadableStreamBYOBReader; + new(stream: ReadableStream): ReadableStreamBYOBReader; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */ diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index fd3efc67..8b2354d8 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -1787,6 +1787,8 @@ declare var CloseEvent: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */ interface CompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var CompressionStream: { @@ -2191,6 +2193,8 @@ declare var DOMStringList: { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */ interface DecompressionStream extends GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; } declare var DecompressionStream: { @@ -4839,7 +4843,7 @@ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { declare var ReadableStreamBYOBReader: { prototype: ReadableStreamBYOBReader; - new(stream: ReadableStream): ReadableStreamBYOBReader; + new(stream: ReadableStream): ReadableStreamBYOBReader; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */ diff --git a/inputfiles/overridingTypes.jsonc b/inputfiles/overridingTypes.jsonc index b18dc06e..94d38d86 100644 --- a/inputfiles/overridingTypes.jsonc +++ b/inputfiles/overridingTypes.jsonc @@ -2697,6 +2697,18 @@ } }, "ReadableStreamBYOBReader": { + "constructor": { + "signature": { + "0": { + "param": [ + { + "name": "stream", + "overrideType": "ReadableStream" + } + ] + } + } + }, "methods": { "method": { "read": { @@ -2987,6 +2999,38 @@ } } }, + "CompressionStream": { + "properties": { + "property": { + "readable": { + "name": "readable", + "readonly": true, + "overrideType": "ReadableStream" + }, + "writable": { + "name": "writable", + "readonly": true, + "overrideType": "WritableStream" + } + } + } + }, + "DecompressionStream": { + "properties": { + "property": { + "readable": { + "name": "readable", + "readonly": true, + "overrideType": "ReadableStream" + }, + "writable": { + "name": "writable", + "readonly": true, + "overrideType": "WritableStream" + } + } + } + }, "TextDecoderStream": { "properties": { "property": {