From 0a8fd0544e6f8fb7f39730b904af3890e426b39e Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 31 Jan 2025 11:21:01 -0500 Subject: [PATCH] fix: make `TextEncoder.prototype.encode` return `Uint8Array` --- baselines/audioworklet.generated.d.ts | 2 +- baselines/dom.generated.d.ts | 2 +- baselines/serviceworker.generated.d.ts | 2 +- baselines/sharedworker.generated.d.ts | 2 +- baselines/ts5.5/audioworklet.generated.d.ts | 2 +- baselines/ts5.5/dom.generated.d.ts | 2 +- baselines/ts5.5/serviceworker.generated.d.ts | 2 +- baselines/ts5.5/sharedworker.generated.d.ts | 2 +- baselines/ts5.5/webworker.generated.d.ts | 2 +- baselines/webworker.generated.d.ts | 2 +- inputfiles/overridingTypes.jsonc | 13 +++++++++++++ 11 files changed, 23 insertions(+), 10 deletions(-) diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 4753a3267..9b41d97e3 100644 --- a/baselines/audioworklet.generated.d.ts +++ b/baselines/audioworklet.generated.d.ts @@ -934,7 +934,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 18729c1d6..7ae526b97 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -23199,7 +23199,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index f49cece56..5f6b039b9 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -5194,7 +5194,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 87eb1ac0a..f5f25cfb3 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -5001,7 +5001,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/ts5.5/audioworklet.generated.d.ts b/baselines/ts5.5/audioworklet.generated.d.ts index 4753a3267..9b41d97e3 100644 --- a/baselines/ts5.5/audioworklet.generated.d.ts +++ b/baselines/ts5.5/audioworklet.generated.d.ts @@ -934,7 +934,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/ts5.5/dom.generated.d.ts b/baselines/ts5.5/dom.generated.d.ts index 52a501f3c..a983531a1 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -23177,7 +23177,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/ts5.5/serviceworker.generated.d.ts b/baselines/ts5.5/serviceworker.generated.d.ts index f49cece56..5f6b039b9 100644 --- a/baselines/ts5.5/serviceworker.generated.d.ts +++ b/baselines/ts5.5/serviceworker.generated.d.ts @@ -5194,7 +5194,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/ts5.5/sharedworker.generated.d.ts b/baselines/ts5.5/sharedworker.generated.d.ts index 87eb1ac0a..f5f25cfb3 100644 --- a/baselines/ts5.5/sharedworker.generated.d.ts +++ b/baselines/ts5.5/sharedworker.generated.d.ts @@ -5001,7 +5001,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/ts5.5/webworker.generated.d.ts b/baselines/ts5.5/webworker.generated.d.ts index 231355afe..de3faa72d 100644 --- a/baselines/ts5.5/webworker.generated.d.ts +++ b/baselines/ts5.5/webworker.generated.d.ts @@ -5924,7 +5924,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 231355afe..de3faa72d 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -5924,7 +5924,7 @@ interface TextEncoder extends TextEncoderCommon { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) */ - encode(input?: string): Uint8Array; + encode(input?: string): Uint8Array; /** * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. * diff --git a/inputfiles/overridingTypes.jsonc b/inputfiles/overridingTypes.jsonc index 859ce6150..8d1332855 100644 --- a/inputfiles/overridingTypes.jsonc +++ b/inputfiles/overridingTypes.jsonc @@ -3209,6 +3209,19 @@ } } }, + "TextEncoder": { + "methods": { + "method": { + "encode": { + "signature": { + "0": { + "overrideType": "Uint8Array" + } + } + } + } + } + }, "TextEncoderStream": { "properties": { "property": {