mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(types): specify ArrayBuffer
as a backing buffer type for TextEncoder.encode()
(#30434)
This commit is contained in:
parent
9c197682f9
commit
6523e3f49b
1 changed files with 5 additions and 8 deletions
13
cli/tsc/dts/lib.deno_web.d.ts
vendored
13
cli/tsc/dts/lib.deno_web.d.ts
vendored
|
@ -452,12 +452,6 @@ interface TextEncoderEncodeIntoResult {
|
||||||
written: number;
|
written: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @category Encoding */
|
|
||||||
interface TextEncoder extends TextEncoderCommon {
|
|
||||||
/** Returns the result of running UTF-8's encoder. */
|
|
||||||
encode(input?: string): Uint8Array;
|
|
||||||
encodeInto(input: string, dest: Uint8Array): TextEncoderEncodeIntoResult;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Allows you to convert a string into binary data (in the form of a Uint8Array)
|
* Allows you to convert a string into binary data (in the form of a Uint8Array)
|
||||||
* given the encoding.
|
* given the encoding.
|
||||||
|
@ -474,10 +468,13 @@ interface TextEncoder extends TextEncoderCommon {
|
||||||
*/
|
*/
|
||||||
interface TextEncoder extends TextEncoderCommon {
|
interface TextEncoder extends TextEncoderCommon {
|
||||||
/** Turns a string into binary data (in the form of a Uint8Array) using UTF-8 encoding. */
|
/** Turns a string into binary data (in the form of a Uint8Array) using UTF-8 encoding. */
|
||||||
encode(input?: string): Uint8Array;
|
encode(input?: string): Uint8Array<ArrayBuffer>;
|
||||||
|
|
||||||
/** Encodes a string into the destination Uint8Array and returns the result of the encoding. */
|
/** Encodes a string into the destination Uint8Array and returns the result of the encoding. */
|
||||||
encodeInto(input: string, dest: Uint8Array): TextEncoderEncodeIntoResult;
|
encodeInto(
|
||||||
|
input: string,
|
||||||
|
dest: Uint8Array<ArrayBufferLike>,
|
||||||
|
): TextEncoderEncodeIntoResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @category Encoding */
|
/** @category Encoding */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue