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 5 commits 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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
* text=auto eol=lf

###############################################################################
# Set default behavior for command prompt diff.
Expand Down
24 changes: 12 additions & 12 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 @@ -758,7 +758,7 @@ interface ReadableByteStreamController {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
close(): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
enqueue(chunk: ArrayBufferView): void;
enqueue(chunk: ArrayBufferView<ArrayBuffer>): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
error(e?: any): void;
}
Expand Down Expand Up @@ -792,7 +792,7 @@ interface ReadableStream<R = any> {

declare var ReadableStream: {
prototype: ReadableStream;
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream<Uint8Array>;
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream<Uint8Array<ArrayBuffer>>;
new<R = any>(underlyingSource: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
};
Expand All @@ -807,17 +807,17 @@ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {

declare var ReadableStreamBYOBReader: {
prototype: ReadableStreamBYOBReader;
new(stream: ReadableStream<Uint8Array>): ReadableStreamBYOBReader;
new(stream: ReadableStream<Uint8Array<ArrayBuffer>>): ReadableStreamBYOBReader;
};

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
interface ReadableStreamBYOBRequest {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
readonly view: ArrayBufferView | null;
readonly view: ArrayBufferView<ArrayBuffer> | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
respond(bytesWritten: number): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
respondWithNewView(view: ArrayBufferView): void;
respondWithNewView(view: ArrayBufferView<ArrayBuffer>): void;
}

declare var ReadableStreamBYOBRequest: {
Expand Down Expand Up @@ -934,13 +934,13 @@ 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.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
*/
encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
encodeInto(source: string, destination: Uint8Array<ArrayBufferLike>): TextEncoderEncodeIntoResult;
}

declare var TextEncoder: {
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 Expand Up @@ -1428,8 +1428,8 @@ declare var currentTime: number;
declare var sampleRate: number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/registerProcessor) */
declare function registerProcessor(name: string, processorCtor: AudioWorkletProcessorConstructor): void;
type AllowSharedBufferSource = ArrayBuffer | ArrayBufferView;
type BufferSource = ArrayBufferView | ArrayBuffer;
type AllowSharedBufferSource = ArrayBufferLike | ArrayBufferView<ArrayBufferLike>;
type BufferSource = ArrayBufferView<ArrayBuffer> | ArrayBuffer;
type DOMHighResTimeStamp = number;
type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
type MessageEventSource = MessagePort;
Expand Down
Loading
Loading