Skip to content

Commit

Permalink
Add [Symbol.toStringTag] property to all interfaces
Browse files Browse the repository at this point in the history
Fixes #1641
  • Loading branch information
jdufresne committed Mar 20, 2024
1 parent 6621974 commit 0fbe49c
Show file tree
Hide file tree
Showing 6 changed files with 5,059 additions and 1 deletion.
162 changes: 162 additions & 0 deletions baselines/audioworklet.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ interface AbortController {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
*/
readonly signal: AbortSignal;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/**
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
*
Expand Down Expand Up @@ -250,6 +256,12 @@ declare var AudioWorkletGlobalScope: {
interface AudioWorkletProcessor {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletProcessor/port) */
readonly port: MessagePort;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
}

declare var AudioWorkletProcessor: {
Expand Down Expand Up @@ -514,6 +526,12 @@ interface Event {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
*/
readonly type: string;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/**
* Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
*
Expand Down Expand Up @@ -560,10 +578,22 @@ declare var Event: {
};

interface EventListener {
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
(evt: Event): void;
}

interface EventListenerObject {
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
handleEvent(object: Event): void;
}

Expand All @@ -573,6 +603,12 @@ interface EventListenerObject {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
*/
interface EventTarget {
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/**
* Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
*
Expand Down Expand Up @@ -615,6 +651,12 @@ interface GenericTransformStream {
readonly readable: ReadableStream;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream/writable) */
readonly writable: WritableStream;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
}

/**
Expand Down Expand Up @@ -732,6 +774,12 @@ interface ReadableByteStreamController {
readonly byobRequest: ReadableStreamBYOBRequest | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
readonly desiredSize: number | null;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
close(): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
Expand All @@ -753,6 +801,12 @@ declare var ReadableByteStreamController: {
interface ReadableStream<R = any> {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
readonly locked: boolean;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
cancel(reason?: any): Promise<void>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
Expand Down Expand Up @@ -791,6 +845,12 @@ declare var ReadableStreamBYOBReader: {
interface ReadableStreamBYOBRequest {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
readonly view: ArrayBufferView | null;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [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) */
Expand All @@ -806,6 +866,12 @@ declare var ReadableStreamBYOBRequest: {
interface ReadableStreamDefaultController<R = any> {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
readonly desiredSize: number | null;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
close(): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
Expand Down Expand Up @@ -835,6 +901,12 @@ declare var ReadableStreamDefaultReader: {
interface ReadableStreamGenericReader {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */
readonly closed: Promise<undefined>;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */
cancel(reason?: any): Promise<void>;
}
Expand Down Expand Up @@ -887,6 +959,12 @@ interface TextDecoderCommon {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/ignoreBOM)
*/
readonly ignoreBOM: boolean;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
}

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
Expand Down Expand Up @@ -932,6 +1010,12 @@ interface TextEncoderCommon {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encoding)
*/
readonly encoding: string;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
}

/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
Expand All @@ -951,6 +1035,12 @@ interface TransformStream<I = any, O = any> {
readonly readable: ReadableStream<O>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
readonly writable: WritableStream<I>;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
}

declare var TransformStream: {
Expand All @@ -962,6 +1052,12 @@ declare var TransformStream: {
interface TransformStreamDefaultController<O = any> {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
readonly desiredSize: number | null;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
enqueue(chunk?: O): void;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
Expand Down Expand Up @@ -1006,6 +1102,12 @@ interface URL {
readonly searchParams: URLSearchParams;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
username: string;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
toJSON(): string;
}
Expand All @@ -1021,6 +1123,12 @@ declare var URL: {
interface URLSearchParams {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
readonly size: number;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/**
* Appends a specified key/value pair as a new search parameter.
*
Expand Down Expand Up @@ -1075,6 +1183,12 @@ declare var URLSearchParams: {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkletGlobalScope)
*/
interface WorkletGlobalScope {
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
}

declare var WorkletGlobalScope: {
Expand All @@ -1090,6 +1204,12 @@ declare var WorkletGlobalScope: {
interface WritableStream<W = any> {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
readonly locked: boolean;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
abort(reason?: any): Promise<void>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
Expand All @@ -1111,6 +1231,12 @@ declare var WritableStream: {
interface WritableStreamDefaultController {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
readonly signal: AbortSignal;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
error(e?: any): void;
}
Expand All @@ -1132,6 +1258,12 @@ interface WritableStreamDefaultWriter<W = any> {
readonly desiredSize: number | null;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
readonly ready: Promise<undefined>;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
abort(reason?: any): Promise<void>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
Expand Down Expand Up @@ -1206,6 +1338,12 @@ declare namespace WebAssembly {
interface Global<T extends ValueType = ValueType> {
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Global/value) */
value: ValueTypeMap[T];
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Global/valueOf) */
valueOf(): ValueTypeMap[T];
}
Expand All @@ -1219,6 +1357,12 @@ declare namespace WebAssembly {
interface Instance {
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Instance/exports) */
readonly exports: Exports;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
}

var Instance: {
Expand All @@ -1239,6 +1383,12 @@ declare namespace WebAssembly {
interface Memory {
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Memory/buffer) */
readonly buffer: ArrayBuffer;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Memory/grow) */
grow(delta: number): number;
}
Expand All @@ -1250,6 +1400,12 @@ declare namespace WebAssembly {

/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Module) */
interface Module {
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
}

var Module: {
Expand All @@ -1276,6 +1432,12 @@ declare namespace WebAssembly {
interface Table {
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Table/length) */
readonly length: number;
/**
* The well-known symbol @@toStringTag.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag)
*/
readonly [Symbol.toStringTag]: string;
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Table/get) */
get(index: number): any;
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Table/grow) */
Expand Down
Loading

0 comments on commit 0fbe49c

Please sign in to comment.