Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support generic Uint8Array<ArrayBuffer> #1944

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions baselines/audioworklet.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ declare var ByteLengthQueuingStrategy: {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
interface CompressionStream extends GenericTransformStream {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<BufferSource>;
}

Expand Down Expand Up @@ -413,7 +413,7 @@ declare var DOMException: {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
interface DecompressionStream extends GenericTransformStream {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<BufferSource>;
}

Expand Down Expand Up @@ -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<ArrayBuffer>;
/**
* 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.
*
Expand All @@ -959,7 +959,7 @@ interface TextEncoderCommon {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<string>;
}

Expand Down
16 changes: 8 additions & 8 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3553,11 +3553,11 @@ interface Blob {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */
bytes(): Promise<Uint8Array>;
bytes(): Promise<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
slice(start?: number, end?: number, contentType?: string): Blob;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
stream(): ReadableStream<Uint8Array>;
stream(): ReadableStream<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
text(): Promise<string>;
}
Expand All @@ -3582,15 +3582,15 @@ declare var BlobEvent: {

interface Body {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
readonly body: ReadableStream<Uint8Array> | null;
readonly body: ReadableStream<Uint8Array<ArrayBuffer>> | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
readonly bodyUsed: boolean;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
blob(): Promise<Blob>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */
bytes(): Promise<Uint8Array>;
bytes(): Promise<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
formData(): Promise<FormData>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
Expand Down Expand Up @@ -6381,7 +6381,7 @@ declare var CompositionEvent: {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
interface CompressionStream extends GenericTransformStream {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<BufferSource>;
}

Expand Down Expand Up @@ -7370,7 +7370,7 @@ declare var DataTransferItemList: {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
interface DecompressionStream extends GenericTransformStream {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<BufferSource>;
}

Expand Down Expand Up @@ -23492,7 +23492,7 @@ interface TextEncoder extends TextEncoderCommon {
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
*/
encode(input?: string): Uint8Array;
encode(input?: string): Uint8Array<ArrayBuffer>;
/**
* 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.
*
Expand All @@ -23517,7 +23517,7 @@ interface TextEncoderCommon {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<string>;
}

Expand Down
16 changes: 8 additions & 8 deletions baselines/serviceworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,11 +892,11 @@ interface Blob {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */
bytes(): Promise<Uint8Array>;
bytes(): Promise<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
slice(start?: number, end?: number, contentType?: string): Blob;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
stream(): ReadableStream<Uint8Array>;
stream(): ReadableStream<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
text(): Promise<string>;
}
Expand All @@ -908,15 +908,15 @@ declare var Blob: {

interface Body {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
readonly body: ReadableStream<Uint8Array> | null;
readonly body: ReadableStream<Uint8Array<ArrayBuffer>> | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
readonly bodyUsed: boolean;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
blob(): Promise<Blob>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */
bytes(): Promise<Uint8Array>;
bytes(): Promise<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
formData(): Promise<FormData>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
Expand Down Expand Up @@ -1680,7 +1680,7 @@ declare var CloseEvent: {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
interface CompressionStream extends GenericTransformStream {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<BufferSource>;
}

Expand Down Expand Up @@ -2192,7 +2192,7 @@ declare var DOMStringList: {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
interface DecompressionStream extends GenericTransformStream {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<BufferSource>;
}

Expand Down Expand Up @@ -5278,7 +5278,7 @@ interface TextEncoder extends TextEncoderCommon {
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
*/
encode(input?: string): Uint8Array;
encode(input?: string): Uint8Array<ArrayBuffer>;
/**
* 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.
*
Expand All @@ -5303,7 +5303,7 @@ interface TextEncoderCommon {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<string>;
}

Expand Down
16 changes: 8 additions & 8 deletions baselines/sharedworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,11 @@ interface Blob {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */
bytes(): Promise<Uint8Array>;
bytes(): Promise<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
slice(start?: number, end?: number, contentType?: string): Blob;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
stream(): ReadableStream<Uint8Array>;
stream(): ReadableStream<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
text(): Promise<string>;
}
Expand All @@ -848,15 +848,15 @@ declare var Blob: {

interface Body {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
readonly body: ReadableStream<Uint8Array> | null;
readonly body: ReadableStream<Uint8Array<ArrayBuffer>> | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
readonly bodyUsed: boolean;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
arrayBuffer(): Promise<ArrayBuffer>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
blob(): Promise<Blob>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */
bytes(): Promise<Uint8Array>;
bytes(): Promise<Uint8Array<ArrayBuffer>>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
formData(): Promise<FormData>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
Expand Down Expand Up @@ -1575,7 +1575,7 @@ declare var CloseEvent: {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
interface CompressionStream extends GenericTransformStream {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<BufferSource>;
}

Expand Down Expand Up @@ -2062,7 +2062,7 @@ declare var DOMStringList: {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
interface DecompressionStream extends GenericTransformStream {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<BufferSource>;
}

Expand Down Expand Up @@ -5013,7 +5013,7 @@ interface TextEncoder extends TextEncoderCommon {
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
*/
encode(input?: string): Uint8Array;
encode(input?: string): Uint8Array<ArrayBuffer>;
/**
* 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.
*
Expand All @@ -5038,7 +5038,7 @@ interface TextEncoderCommon {

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {
readonly readable: ReadableStream<Uint8Array>;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
readonly writable: WritableStream<string>;
}

Expand Down
12 changes: 12 additions & 0 deletions baselines/ts5.6/audioworklet.asynciterable.generated.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/////////////////////////////
/// AudioWorklet Async Iterable APIs
/////////////////////////////

interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
}

interface ReadableStream<R = any> {
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
}
Loading
Loading