diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 607b0fa56..307953319 100644 --- a/baselines/audioworklet.generated.d.ts +++ b/baselines/audioworklet.generated.d.ts @@ -832,7 +832,7 @@ declare var ReadableStreamDefaultReader: { interface ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */ cancel(reason?: any): Promise; } @@ -1121,11 +1121,11 @@ declare var WritableStreamDefaultController: { */ interface WritableStreamDefaultWriter { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */ readonly desiredSize: number | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */ abort(reason?: any): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */ diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 3666a2eb3..73cff89db 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -18564,7 +18564,7 @@ declare var ReadableStreamDefaultReader: { interface ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */ cancel(reason?: any): Promise; } @@ -25448,7 +25448,7 @@ interface WebTransport { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/incomingUnidirectionalStreams) */ readonly incomingUnidirectionalStreams: ReadableStream; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/close) */ close(closeInfo?: WebTransportCloseInfo): void; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/createBidirectionalStream) */ @@ -26055,11 +26055,11 @@ declare var WritableStreamDefaultController: { */ interface WritableStreamDefaultWriter { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */ readonly desiredSize: number | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */ abort(reason?: any): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */ diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index 50e5a6b4a..e72bc5e2c 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -194,7 +194,7 @@ interface ExtendableMessageEventInit extends ExtendableEventInit { interface FetchEventInit extends ExtendableEventInit { clientId?: string; - handled?: Promise; + handled?: Promise; preloadResponse?: Promise; replacesClientId?: string; request: Request; @@ -2475,7 +2475,7 @@ interface FetchEvent extends ExtendableEvent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/clientId) */ readonly clientId: string; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/handled) */ - readonly handled: Promise; + readonly handled: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/preloadResponse) */ readonly preloadResponse: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */ @@ -4576,7 +4576,7 @@ declare var ReadableStreamDefaultReader: { interface ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */ cancel(reason?: any): Promise; } @@ -7793,7 +7793,7 @@ interface WebTransport { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/incomingUnidirectionalStreams) */ readonly incomingUnidirectionalStreams: ReadableStream; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/close) */ close(closeInfo?: WebTransportCloseInfo): void; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/createBidirectionalStream) */ @@ -8087,11 +8087,11 @@ declare var WritableStreamDefaultController: { */ interface WritableStreamDefaultWriter { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */ readonly desiredSize: number | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */ abort(reason?: any): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */ diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 56f1d33a9..6f7abfe96 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -4410,7 +4410,7 @@ declare var ReadableStreamDefaultReader: { interface ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */ cancel(reason?: any): Promise; } @@ -7608,7 +7608,7 @@ interface WebTransport { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/incomingUnidirectionalStreams) */ readonly incomingUnidirectionalStreams: ReadableStream; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/close) */ close(closeInfo?: WebTransportCloseInfo): void; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/createBidirectionalStream) */ @@ -7920,11 +7920,11 @@ declare var WritableStreamDefaultController: { */ interface WritableStreamDefaultWriter { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */ readonly desiredSize: number | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */ abort(reason?: any): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */ diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 584d440f7..70b61e36f 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -209,7 +209,7 @@ interface ExtendableMessageEventInit extends ExtendableEventInit { interface FetchEventInit extends ExtendableEventInit { clientId?: string; - handled?: Promise; + handled?: Promise; preloadResponse?: Promise; replacesClientId?: string; request: Request; @@ -958,7 +958,7 @@ declare var AbortSignal: { prototype: AbortSignal; new(): AbortSignal; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */ - abort(reason?: any): AbortSignal; + // abort(reason?: any): AbortSignal; - To be re-added in the future /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */ timeout(milliseconds: number): AbortSignal; }; @@ -2675,7 +2675,7 @@ interface FetchEvent extends ExtendableEvent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/clientId) */ readonly clientId: string; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/handled) */ - readonly handled: Promise; + readonly handled: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/preloadResponse) */ readonly preloadResponse: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */ @@ -4851,7 +4851,7 @@ declare var ReadableStreamDefaultReader: { interface ReadableStreamGenericReader { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/cancel) */ cancel(reason?: any): Promise; } @@ -8232,7 +8232,7 @@ interface WebTransport { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/incomingUnidirectionalStreams) */ readonly incomingUnidirectionalStreams: ReadableStream; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/close) */ close(closeInfo?: WebTransportCloseInfo): void; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebTransport/createBidirectionalStream) */ @@ -8565,11 +8565,11 @@ declare var WritableStreamDefaultController: { */ interface WritableStreamDefaultWriter { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */ - readonly closed: Promise; + readonly closed: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */ readonly desiredSize: number | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */ - readonly ready: Promise; + readonly ready: Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */ abort(reason?: any): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */ diff --git a/src/build/emitter.ts b/src/build/emitter.ts index 141b35843..3b54bd151 100644 --- a/src/build/emitter.ts +++ b/src/build/emitter.ts @@ -347,7 +347,10 @@ export function emitWebIdl( } if (!obj.type) throw new Error("Missing 'type' field in " + JSON.stringify(obj)); - const type = convertDomTypeToTsTypeWorker(obj); + let type = convertDomTypeToTsTypeWorker(obj); + if (type === "Promise") { + type = "Promise"; + } return obj.nullable ? makeNullable(type) : type; } @@ -356,9 +359,6 @@ export function emitWebIdl( if (type === "undefined") { return "void"; } - if (type === "Promise") { - return "Promise"; - } if (type === "undefined | PromiseLike") { return "void | PromiseLike"; }