From 3d6d113c3374a6e011d6dc0bbc3db9d9bfae8db0 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 8 Feb 2026 22:56:40 +0100 Subject: [PATCH] Add GPUCanvasContext --- baselines/dom.generated.d.ts | 63 +++++++++++++++++++- baselines/serviceworker.generated.d.ts | 61 ++++++++++++++++++- baselines/sharedworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.5/dom.generated.d.ts | 63 +++++++++++++++++++- baselines/ts5.5/serviceworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.5/sharedworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.5/webworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.6/dom.generated.d.ts | 63 +++++++++++++++++++- baselines/ts5.6/serviceworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.6/sharedworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.6/webworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.9/dom.generated.d.ts | 63 +++++++++++++++++++- baselines/ts5.9/serviceworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.9/sharedworker.generated.d.ts | 61 ++++++++++++++++++- baselines/ts5.9/webworker.generated.d.ts | 61 ++++++++++++++++++- baselines/webworker.generated.d.ts | 61 ++++++++++++++++++- inputfiles/overridingTypes.jsonc | 3 - 17 files changed, 964 insertions(+), 23 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index c77268be2..f58f18408 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -805,6 +805,19 @@ interface FullscreenOptions { navigationUI?: FullscreenNavigationUI; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -15003,6 +15016,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: HTMLCanvasElement | OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -43648,7 +43705,7 @@ type MediaProvider = MediaStream | MediaSource | Blob; type MessageEventSource = WindowProxy | MessagePort | ServiceWorker; type MutationRecordType = "attributes" | "characterData" | "childList"; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type OptionalPostfixToken = ` ${T}` | ""; @@ -43660,7 +43717,7 @@ type RTCRtpSenderTransform = RTCRtpScriptTransform; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; -type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type ReportList = Report[]; type RequestInfo = Request | string; type SanitizerAttribute = string | SanitizerAttributeNamespace; @@ -43741,6 +43798,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FullscreenNavigationUI = "auto" | "hide" | "show"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index 9a6ef6112..880b162e1 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -272,6 +272,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -4446,6 +4459,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -12839,7 +12896,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; @@ -12880,6 +12937,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 3b3533838..a4a1503d6 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -216,6 +216,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -4129,6 +4142,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -12509,7 +12566,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; @@ -12546,6 +12603,8 @@ type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap"; type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.5/dom.generated.d.ts b/baselines/ts5.5/dom.generated.d.ts index 60d3b0b15..67c99fd69 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -802,6 +802,19 @@ interface FullscreenOptions { navigationUI?: FullscreenNavigationUI; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -14989,6 +15002,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: HTMLCanvasElement | OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -43622,7 +43679,7 @@ type MediaProvider = MediaStream | MediaSource | Blob; type MessageEventSource = WindowProxy | MessagePort | ServiceWorker; type MutationRecordType = "attributes" | "characterData" | "childList"; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type OptionalPostfixToken = ` ${T}` | ""; @@ -43634,7 +43691,7 @@ type RTCRtpSenderTransform = RTCRtpScriptTransform; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; -type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type ReportList = Report[]; type RequestInfo = Request | string; type SanitizerAttribute = string | SanitizerAttributeNamespace; @@ -43715,6 +43772,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FullscreenNavigationUI = "auto" | "hide" | "show"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.5/serviceworker.generated.d.ts b/baselines/ts5.5/serviceworker.generated.d.ts index eca8a8dc9..d4ff29b39 100644 --- a/baselines/ts5.5/serviceworker.generated.d.ts +++ b/baselines/ts5.5/serviceworker.generated.d.ts @@ -269,6 +269,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -4443,6 +4456,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -12836,7 +12893,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; @@ -12877,6 +12934,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.5/sharedworker.generated.d.ts b/baselines/ts5.5/sharedworker.generated.d.ts index 567d8e718..ae862a7b6 100644 --- a/baselines/ts5.5/sharedworker.generated.d.ts +++ b/baselines/ts5.5/sharedworker.generated.d.ts @@ -213,6 +213,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -4126,6 +4139,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -12506,7 +12563,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; @@ -12543,6 +12600,8 @@ type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap"; type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.5/webworker.generated.d.ts b/baselines/ts5.5/webworker.generated.d.ts index 4c98368e1..3f7932fd1 100644 --- a/baselines/ts5.5/webworker.generated.d.ts +++ b/baselines/ts5.5/webworker.generated.d.ts @@ -359,6 +359,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -5145,6 +5158,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -14514,7 +14571,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; @@ -14563,6 +14620,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.6/dom.generated.d.ts b/baselines/ts5.6/dom.generated.d.ts index e7c1ba1e9..2004b28fc 100644 --- a/baselines/ts5.6/dom.generated.d.ts +++ b/baselines/ts5.6/dom.generated.d.ts @@ -802,6 +802,19 @@ interface FullscreenOptions { navigationUI?: FullscreenNavigationUI; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -15000,6 +15013,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: HTMLCanvasElement | OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -43645,7 +43702,7 @@ type MediaProvider = MediaStream | MediaSource | Blob; type MessageEventSource = WindowProxy | MessagePort | ServiceWorker; type MutationRecordType = "attributes" | "characterData" | "childList"; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type OptionalPostfixToken = ` ${T}` | ""; @@ -43657,7 +43714,7 @@ type RTCRtpSenderTransform = RTCRtpScriptTransform; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; -type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type ReportList = Report[]; type RequestInfo = Request | string; type SanitizerAttribute = string | SanitizerAttributeNamespace; @@ -43738,6 +43795,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FullscreenNavigationUI = "auto" | "hide" | "show"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.6/serviceworker.generated.d.ts b/baselines/ts5.6/serviceworker.generated.d.ts index eca8a8dc9..d4ff29b39 100644 --- a/baselines/ts5.6/serviceworker.generated.d.ts +++ b/baselines/ts5.6/serviceworker.generated.d.ts @@ -269,6 +269,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -4443,6 +4456,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -12836,7 +12893,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; @@ -12877,6 +12934,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.6/sharedworker.generated.d.ts b/baselines/ts5.6/sharedworker.generated.d.ts index 567d8e718..ae862a7b6 100644 --- a/baselines/ts5.6/sharedworker.generated.d.ts +++ b/baselines/ts5.6/sharedworker.generated.d.ts @@ -213,6 +213,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -4126,6 +4139,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -12506,7 +12563,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; @@ -12543,6 +12600,8 @@ type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap"; type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.6/webworker.generated.d.ts b/baselines/ts5.6/webworker.generated.d.ts index 4c98368e1..3f7932fd1 100644 --- a/baselines/ts5.6/webworker.generated.d.ts +++ b/baselines/ts5.6/webworker.generated.d.ts @@ -359,6 +359,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -5145,6 +5158,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -14514,7 +14571,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; @@ -14563,6 +14620,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.9/dom.generated.d.ts b/baselines/ts5.9/dom.generated.d.ts index 506edcaf8..61116c9ce 100644 --- a/baselines/ts5.9/dom.generated.d.ts +++ b/baselines/ts5.9/dom.generated.d.ts @@ -802,6 +802,19 @@ interface FullscreenOptions { navigationUI?: FullscreenNavigationUI; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -15000,6 +15013,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: HTMLCanvasElement | OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -43645,7 +43702,7 @@ type MediaProvider = MediaStream | MediaSource | Blob; type MessageEventSource = WindowProxy | MessagePort | ServiceWorker; type MutationRecordType = "attributes" | "characterData" | "childList"; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type OptionalPostfixToken = ` ${T}` | ""; @@ -43657,7 +43714,7 @@ type RTCRtpSenderTransform = RTCRtpScriptTransform; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; -type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type ReportList = Report[]; type RequestInfo = Request | string; type SanitizerAttribute = string | SanitizerAttributeNamespace; @@ -43738,6 +43795,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FullscreenNavigationUI = "auto" | "hide" | "show"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.9/serviceworker.generated.d.ts b/baselines/ts5.9/serviceworker.generated.d.ts index e8280f8de..d10dedce3 100644 --- a/baselines/ts5.9/serviceworker.generated.d.ts +++ b/baselines/ts5.9/serviceworker.generated.d.ts @@ -269,6 +269,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -4443,6 +4456,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -12836,7 +12893,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; @@ -12877,6 +12934,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.9/sharedworker.generated.d.ts b/baselines/ts5.9/sharedworker.generated.d.ts index b713bc4dd..29cf7850f 100644 --- a/baselines/ts5.9/sharedworker.generated.d.ts +++ b/baselines/ts5.9/sharedworker.generated.d.ts @@ -213,6 +213,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -4126,6 +4139,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -12506,7 +12563,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type ReadableStreamController = ReadableStreamDefaultController | ReadableByteStreamController; @@ -12543,6 +12600,8 @@ type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap"; type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/ts5.9/webworker.generated.d.ts b/baselines/ts5.9/webworker.generated.d.ts index f49eaccf2..f459832a5 100644 --- a/baselines/ts5.9/webworker.generated.d.ts +++ b/baselines/ts5.9/webworker.generated.d.ts @@ -359,6 +359,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -5145,6 +5158,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -14514,7 +14571,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; @@ -14563,6 +14620,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index e9c0ec4d1..6d059a93a 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -362,6 +362,19 @@ interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -5148,6 +5161,50 @@ declare var GPUBuffer: { new(): GPUBuffer; }; +/** + * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext) + */ +interface GPUCanvasContext { + /** + * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas) + */ + readonly canvas: OffscreenCanvas; + /** + * The **`configure()`** method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure) + */ + configure(configuration: GPUCanvasConfiguration): void; + /** + * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration) + */ + getConfiguration(): GPUCanvasConfiguration | null; + /** + * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture) + */ + getCurrentTexture(): GPUTexture; + /** + * The **`unconfigure()`** method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure) + */ + unconfigure(): void; +} + +declare var GPUCanvasContext: { + prototype: GPUCanvasContext; + new(): GPUCanvasContext; +}; + /** * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution. * Available only in secure contexts. @@ -14517,7 +14574,7 @@ type ImageDataArray = Uint8ClampedArray; type Int32List = Int32Array | GLint[]; type MessageEventSource = MessagePort | ServiceWorker; type NamedCurve = string; -type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; @@ -14566,6 +14623,8 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded"; type FontFaceSetLoadStatus = "loaded" | "loading"; type FrameType = "auxiliary" | "nested" | "none" | "top-level"; type GPUBufferMapState = "mapped" | "pending" | "unmapped"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasToneMappingMode = "extended" | "standard"; type GPUCompilationMessageType = "error" | "info" | "warning"; type GPUDeviceLostReason = "destroyed" | "unknown"; type GPUIndexFormat = "uint16" | "uint32"; diff --git a/inputfiles/overridingTypes.jsonc b/inputfiles/overridingTypes.jsonc index 8ae7cc082..66766e551 100644 --- a/inputfiles/overridingTypes.jsonc +++ b/inputfiles/overridingTypes.jsonc @@ -2877,9 +2877,6 @@ "GPUAdapter": { "exposed": "" }, - "GPUCanvasContext": { - "exposed": "" - }, "GPUDevice": { "exposed": "" },