diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 0ed90a2f19ae9..4529183fb399a 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -805,6 +805,73 @@ interface FullscreenOptions { navigationUI?: FullscreenNavigationUI; } +interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase { + entries: GPUBindGroupEntry[]; + layout: GPUBindGroupLayout; +} + +interface GPUBindGroupEntry { + binding: GPUIndex32; + resource: GPUBindingResource; +} + +interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase { + entries: GPUBindGroupLayoutEntry[]; +} + +interface GPUBindGroupLayoutEntry { + binding: GPUIndex32; + buffer?: GPUBufferBindingLayout; + externalTexture?: GPUExternalTextureBindingLayout; + sampler?: GPUSamplerBindingLayout; + storageTexture?: GPUStorageTextureBindingLayout; + texture?: GPUTextureBindingLayout; + visibility: GPUShaderStageFlags; +} + +interface GPUBlendComponent { + dstFactor?: GPUBlendFactor; + operation?: GPUBlendOperation; + srcFactor?: GPUBlendFactor; +} + +interface GPUBlendState { + alpha: GPUBlendComponent; + color: GPUBlendComponent; +} + +interface GPUBufferBinding { + buffer: GPUBuffer; + offset?: GPUSize64; + size?: GPUSize64; +} + +interface GPUBufferBindingLayout { + hasDynamicOffset?: boolean; + minBindingSize?: GPUSize64; + type?: GPUBufferBindingType; +} + +interface GPUBufferDescriptor extends GPUObjectDescriptorBase { + mappedAtCreation?: boolean; + size: GPUSize64; + usage: GPUBufferUsageFlags; +} + +interface GPUCanvasConfiguration { + alphaMode?: GPUCanvasAlphaMode; + colorSpace?: PredefinedColorSpace; + device: GPUDevice; + format: GPUTextureFormat; + toneMapping?: GPUCanvasToneMapping; + usage?: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + +interface GPUCanvasToneMapping { + mode?: GPUCanvasToneMappingMode; +} + interface GPUColorDict { a: number; b: number; @@ -812,17 +879,264 @@ interface GPUColorDict { r: number; } +interface GPUColorTargetState { + blend?: GPUBlendState; + format: GPUTextureFormat; + writeMask?: GPUColorWriteFlags; +} + +interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase { +} + +interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase { +} + +interface GPUComputePassDescriptor extends GPUObjectDescriptorBase { + timestampWrites?: GPUComputePassTimestampWrites; +} + +interface GPUComputePassTimestampWrites { + beginningOfPassWriteIndex?: GPUSize32; + endOfPassWriteIndex?: GPUSize32; + querySet: GPUQuerySet; +} + +interface GPUComputePipelineDescriptor extends GPUPipelineDescriptorBase { + compute: GPUProgrammableStage; +} + +interface GPUCopyExternalImageDestInfo extends GPUTexelCopyTextureInfo { + colorSpace?: PredefinedColorSpace; + premultipliedAlpha?: boolean; +} + +interface GPUCopyExternalImageSourceInfo { + flipY?: boolean; + origin?: GPUOrigin2D; + source: GPUCopyExternalImageSource; +} + +interface GPUDepthStencilState { + depthBias?: GPUDepthBias; + depthBiasClamp?: number; + depthBiasSlopeScale?: number; + depthCompare?: GPUCompareFunction; + depthWriteEnabled?: boolean; + format: GPUTextureFormat; + stencilBack?: GPUStencilFaceState; + stencilFront?: GPUStencilFaceState; + stencilReadMask?: GPUStencilValue; + stencilWriteMask?: GPUStencilValue; +} + +interface GPUDeviceDescriptor extends GPUObjectDescriptorBase { + defaultQueue?: GPUQueueDescriptor; + requiredFeatures?: GPUFeatureName[]; + requiredLimits?: Record; +} + +interface GPUExtent3DDict { + depthOrArrayLayers?: GPUIntegerCoordinate; + height?: GPUIntegerCoordinate; + width: GPUIntegerCoordinate; +} + +interface GPUExternalTextureBindingLayout { +} + +interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase { + colorSpace?: PredefinedColorSpace; + source: HTMLVideoElement | VideoFrame; +} + +interface GPUFragmentState extends GPUProgrammableStage { + targets: (GPUColorTargetState | null)[]; +} + +interface GPUMultisampleState { + alphaToCoverageEnabled?: boolean; + count?: GPUSize32; + mask?: GPUSampleMask; +} + interface GPUObjectDescriptorBase { label?: string; } +interface GPUOrigin2DDict { + x?: GPUIntegerCoordinate; + y?: GPUIntegerCoordinate; +} + +interface GPUOrigin3DDict { + x?: GPUIntegerCoordinate; + y?: GPUIntegerCoordinate; + z?: GPUIntegerCoordinate; +} + +interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase { + layout: GPUPipelineLayout | GPUAutoLayoutMode; +} + interface GPUPipelineErrorInit { reason: GPUPipelineErrorReason; } +interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase { + bindGroupLayouts: (GPUBindGroupLayout | null)[]; +} + +interface GPUPrimitiveState { + cullMode?: GPUCullMode; + frontFace?: GPUFrontFace; + stripIndexFormat?: GPUIndexFormat; + topology?: GPUPrimitiveTopology; + unclippedDepth?: boolean; +} + +interface GPUProgrammableStage { + constants?: Record; + entryPoint?: string; + module: GPUShaderModule; +} + +interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase { + count: GPUSize32; + type: GPUQueryType; +} + +interface GPUQueueDescriptor extends GPUObjectDescriptorBase { +} + interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase { } +interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout { + depthReadOnly?: boolean; + stencilReadOnly?: boolean; +} + +interface GPURenderPassColorAttachment { + clearValue?: GPUColor; + depthSlice?: GPUIntegerCoordinate; + loadOp: GPULoadOp; + resolveTarget?: GPUTexture | GPUTextureView; + storeOp: GPUStoreOp; + view: GPUTexture | GPUTextureView; +} + +interface GPURenderPassDepthStencilAttachment { + depthClearValue?: number; + depthLoadOp?: GPULoadOp; + depthReadOnly?: boolean; + depthStoreOp?: GPUStoreOp; + stencilClearValue?: GPUStencilValue; + stencilLoadOp?: GPULoadOp; + stencilReadOnly?: boolean; + stencilStoreOp?: GPUStoreOp; + view: GPUTexture | GPUTextureView; +} + +interface GPURenderPassDescriptor extends GPUObjectDescriptorBase { + colorAttachments: (GPURenderPassColorAttachment | null)[]; + depthStencilAttachment?: GPURenderPassDepthStencilAttachment; + maxDrawCount?: GPUSize64; + occlusionQuerySet?: GPUQuerySet; + timestampWrites?: GPURenderPassTimestampWrites; +} + +interface GPURenderPassLayout extends GPUObjectDescriptorBase { + colorFormats: (GPUTextureFormat | null)[]; + depthStencilFormat?: GPUTextureFormat; + sampleCount?: GPUSize32; +} + +interface GPURenderPassTimestampWrites { + beginningOfPassWriteIndex?: GPUSize32; + endOfPassWriteIndex?: GPUSize32; + querySet: GPUQuerySet; +} + +interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase { + depthStencil?: GPUDepthStencilState; + fragment?: GPUFragmentState; + multisample?: GPUMultisampleState; + primitive?: GPUPrimitiveState; + vertex: GPUVertexState; +} + +interface GPURequestAdapterOptions { + forceFallbackAdapter?: boolean; + powerPreference?: GPUPowerPreference; +} + +interface GPUSamplerBindingLayout { + type?: GPUSamplerBindingType; +} + +interface GPUSamplerDescriptor extends GPUObjectDescriptorBase { + addressModeU?: GPUAddressMode; + addressModeV?: GPUAddressMode; + addressModeW?: GPUAddressMode; + compare?: GPUCompareFunction; + lodMaxClamp?: number; + lodMinClamp?: number; + magFilter?: GPUFilterMode; + maxAnisotropy?: number; + minFilter?: GPUFilterMode; + mipmapFilter?: GPUMipmapFilterMode; +} + +interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase { + code: string; +} + +interface GPUStencilFaceState { + compare?: GPUCompareFunction; + depthFailOp?: GPUStencilOperation; + failOp?: GPUStencilOperation; + passOp?: GPUStencilOperation; +} + +interface GPUStorageTextureBindingLayout { + access?: GPUStorageTextureAccess; + format: GPUTextureFormat; + viewDimension?: GPUTextureViewDimension; +} + +interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout { + buffer: GPUBuffer; +} + +interface GPUTexelCopyBufferLayout { + bytesPerRow?: GPUSize32; + offset?: GPUSize64; + rowsPerImage?: GPUSize32; +} + +interface GPUTexelCopyTextureInfo { + aspect?: GPUTextureAspect; + mipLevel?: GPUIntegerCoordinate; + origin?: GPUOrigin3D; + texture: GPUTexture; +} + +interface GPUTextureBindingLayout { + multisampled?: boolean; + sampleType?: GPUTextureSampleType; + viewDimension?: GPUTextureViewDimension; +} + +interface GPUTextureDescriptor extends GPUObjectDescriptorBase { + dimension?: GPUTextureDimension; + format: GPUTextureFormat; + mipLevelCount?: GPUIntegerCoordinate; + sampleCount?: GPUSize32; + size: GPUExtent3D; + usage: GPUTextureUsageFlags; + viewFormats?: GPUTextureFormat[]; +} + interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase { arrayLayerCount?: GPUIntegerCoordinate; aspect?: GPUTextureAspect; @@ -838,6 +1152,22 @@ interface GPUUncapturedErrorEventInit extends EventInit { error: GPUError; } +interface GPUVertexAttribute { + format: GPUVertexFormat; + offset: GPUSize64; + shaderLocation: GPUIndex32; +} + +interface GPUVertexBufferLayout { + arrayStride: GPUSize64; + attributes: GPUVertexAttribute[]; + stepMode?: GPUVertexStepMode; +} + +interface GPUVertexState extends GPUProgrammableStage { + buffers?: (GPUVertexBufferLayout | null)[]; +} + interface GainOptions extends AudioNodeOptions { gain?: number; } @@ -10900,6 +11230,7 @@ interface CustomElementRegistry { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/getName) */ getName(constructor: CustomElementConstructor): string | null; + initialize(root: Node): void; /** * The **`upgrade()`** method of the CustomElementRegistry interface upgrades all shadow-containing custom elements in a Node subtree, even before they are connected to the main document. * @@ -12897,6 +13228,7 @@ interface DocumentOrShadowRoot { readonly activeElement: Element | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/adoptedStyleSheets) */ adoptedStyleSheets: CSSStyleSheet[]; + readonly customElementRegistry: CustomElementRegistry | null; /** * Returns document's fullscreen element. * @@ -13206,6 +13538,7 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/currentCSSZoom) */ readonly currentCSSZoom: number; + readonly customElementRegistry: CustomElementRegistry | null; /** * The **`id`** property of the Element interface represents the element's identifier, reflecting the id global attribute. * @@ -14764,6 +15097,76 @@ declare var FragmentDirective: { new(): FragmentDirective; }; +/** + * The **`GPU`** interface of the WebGPU API is the starting point for using WebGPU. It can be used to return a GPUAdapter from which you can request devices, configure features and limits, and more. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU) + */ +interface GPU { + /** + * The **`wgslLanguageFeatures`** read-only property of the GPU interface returns a WGSLLanguageFeatures object that reports the WGSL language extensions supported by the WebGPU implementation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/wgslLanguageFeatures) + */ + readonly wgslLanguageFeatures: WGSLLanguageFeatures; + /** + * The **`getPreferredCanvasFormat()`** method of the GPU interface returns the optimal canvas texture format for displaying 8-bit depth, standard dynamic range content on the current system. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/getPreferredCanvasFormat) + */ + getPreferredCanvasFormat(): GPUTextureFormat; + /** + * The **`requestAdapter()`** method of the GPU interface returns a Promise that fulfills with a GPUAdapter object instance. From this you can request a GPUDevice, adapter info, features, and limits. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/requestAdapter) + */ + requestAdapter(options?: GPURequestAdapterOptions): Promise; +} + +declare var GPU: { + prototype: GPU; + new(): GPU; +}; + +/** + * The **`GPUAdapter`** interface of the WebGPU API represents a GPU adapter. From this you can request a GPUDevice, adapter info, features, and limits. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter) + */ +interface GPUAdapter { + /** + * The **`features`** read-only property of the GPUAdapter interface returns a GPUSupportedFeatures object that describes additional functionality supported by the adapter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/features) + */ + readonly features: GPUSupportedFeatures; + /** + * The **`info`** read-only property of the GPUAdapter interface returns a GPUAdapterInfo object containing identifying information about the adapter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/info) + */ + readonly info: GPUAdapterInfo; + /** + * The **`limits`** read-only property of the GPUAdapter interface returns a GPUSupportedLimits object that describes the limits supported by the adapter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/limits) + */ + readonly limits: GPUSupportedLimits; + /** + * The **`requestDevice()`** method of the GPUAdapter interface returns a Promise that fulfills with a GPUDevice object, which is the primary interface for communicating with the GPU. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/requestDevice) + */ + requestDevice(descriptor?: GPUDeviceDescriptor): Promise; +} + +declare var GPUAdapter: { + prototype: GPUAdapter; + new(): GPUAdapter; +}; + /** * The **`GPUAdapterInfo`** interface of the WebGPU API contains identifying information about a GPUAdapter. * Available only in secure contexts. @@ -14910,6 +15313,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. @@ -14924,6 +15371,75 @@ declare var GPUCommandBuffer: { new(): GPUCommandBuffer; }; +/** + * The **`GPUCommandEncoder`** interface of the WebGPU API represents an encoder that collects a sequence of GPU commands to be issued to the GPU. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder) + */ +interface GPUCommandEncoder extends GPUDebugCommandsMixin, GPUObjectBase { + /** + * The **`beginComputePass()`** method of the GPUCommandEncoder interface starts encoding a compute pass, returning a GPUComputePassEncoder that can be used to control computation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/beginComputePass) + */ + beginComputePass(descriptor?: GPUComputePassDescriptor): GPUComputePassEncoder; + /** + * The **`beginRenderPass()`** method of the GPUCommandEncoder interface starts encoding a render pass, returning a GPURenderPassEncoder that can be used to control rendering. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/beginRenderPass) + */ + beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder; + /** + * The **`clearBuffer()`** method of the GPUCommandEncoder interface encodes a command that fills a region of a GPUBuffer with zeroes. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/clearBuffer) + */ + clearBuffer(buffer: GPUBuffer, offset?: GPUSize64, size?: GPUSize64): void; + /** + * The **`copyBufferToBuffer()`** method of the GPUCommandEncoder interface encodes a command that copies data from one GPUBuffer to another. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer) + */ + copyBufferToBuffer(source: GPUBuffer, destination: GPUBuffer, size?: GPUSize64): void; + copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size?: GPUSize64): void; + /** + * The **`copyBufferToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUBuffer to a GPUTexture. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyBufferToTexture) + */ + copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void; + /** + * The **`copyTextureToBuffer()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer) + */ + copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D): void; + /** + * The **`copyTextureToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from one GPUTexture to another. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToTexture) + */ + copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void; + /** + * The **`finish()`** method of the GPUCommandEncoder interface completes recording of the command sequence encoded on this GPUCommandEncoder, returning a corresponding GPUCommandBuffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/finish) + */ + finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer; + /** + * The **`resolveQuerySet()`** method of the GPUCommandEncoder interface encodes a command that resolves a GPUQuerySet, copying the results into a specified GPUBuffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/resolveQuerySet) + */ + resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): void; +} + +declare var GPUCommandEncoder: { + prototype: GPUCommandEncoder; + new(): GPUCommandEncoder; +}; + /** * The **`GPUCompilationInfo`** interface of the WebGPU API represents an array of GPUCompilationMessage objects generated by the GPU shader module compiler to help diagnose problems with shader code. * Available only in secure contexts. @@ -15055,6 +15571,168 @@ interface GPUDebugCommandsMixin { pushDebugGroup(groupLabel: string): void; } +interface GPUDeviceEventMap { + "uncapturederror": GPUUncapturedErrorEvent; +} + +/** + * The **`GPUDevice`** interface of the WebGPU API represents a logical GPU device. This is the main interface through which the majority of WebGPU functionality is accessed. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice) + */ +interface GPUDevice extends EventTarget, GPUObjectBase { + /** + * The **`adapterInfo`** read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/adapterInfo) + */ + readonly adapterInfo: GPUAdapterInfo; + /** + * The **`features`** read-only property of the GPUDevice interface returns a GPUSupportedFeatures object that describes additional functionality supported by the device. Only features requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) are included. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/features) + */ + readonly features: GPUSupportedFeatures; + /** + * The **`limits`** read-only property of the GPUDevice interface returns a GPUSupportedLimits object that describes the limits supported by the device. All limit values will be included, and the limits requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) will be reflected in those values. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/limits) + */ + readonly limits: GPUSupportedLimits; + /** + * The **`lost`** read-only property of the GPUDevice interface contains a Promise that remains pending throughout the device's lifetime and resolves with a GPUDeviceLostInfo object when the device is lost. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/lost) + */ + readonly lost: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/uncapturederror_event) */ + onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null; + /** + * The **`queue`** read-only property of the GPUDevice interface returns the primary GPUQueue for the device. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue) + */ + readonly queue: GPUQueue; + /** + * The **`createBindGroup()`** method of the GPUDevice interface creates a GPUBindGroup based on a GPUBindGroupLayout that defines a set of resources to be bound together in a group and how those resources are used in shader stages. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroup) + */ + createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup; + /** + * The **`createBindGroupLayout()`** method of the GPUDevice interface creates a GPUBindGroupLayout that defines the structure and purpose of related GPU resources such as buffers that will be used in a pipeline, and is used as a template when creating GPUBindGroups. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroupLayout) + */ + createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout; + /** + * The **`createBuffer()`** method of the GPUDevice interface creates a GPUBuffer in which to store raw data to use in GPU operations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBuffer) + */ + createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer; + /** + * The **`createCommandEncoder()`** method of the GPUDevice interface creates a GPUCommandEncoder, used to encode commands to be issued to the GPU. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createCommandEncoder) + */ + createCommandEncoder(descriptor?: GPUCommandEncoderDescriptor): GPUCommandEncoder; + /** + * The **`createComputePipeline()`** method of the GPUDevice interface creates a GPUComputePipeline that can control the compute shader stage and be used in a GPUComputePassEncoder. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createComputePipeline) + */ + createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline; + /** + * The **`createComputePipelineAsync()`** method of the GPUDevice interface returns a Promise that fulfills with a GPUComputePipeline, which can control the compute shader stage and be used in a GPUComputePassEncoder, once the pipeline can be used without any stalling. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createComputePipelineAsync) + */ + createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise; + /** + * The **`createPipelineLayout()`** method of the GPUDevice interface creates a GPUPipelineLayout that defines the GPUBindGroupLayouts used by a pipeline. GPUBindGroups used with the pipeline during command encoding must have compatible GPUBindGroupLayouts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createPipelineLayout) + */ + createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor): GPUPipelineLayout; + /** + * The **`createQuerySet()`** method of the GPUDevice interface creates a GPUQuerySet that can be used to record the results of queries on passes, such as occlusion or timestamp queries. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createQuerySet) + */ + createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet; + /** + * The **`createRenderBundleEncoder()`** method of the GPUDevice interface creates a GPURenderBundleEncoder that can be used to pre-record bundles of commands. These can be reused in GPURenderPassEncoders via the executeBundles() method, as many times as required. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder) + */ + createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder; + /** + * The **`createRenderPipeline()`** method of the GPUDevice interface creates a GPURenderPipeline that can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline) + */ + createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline; + /** + * The **`createRenderPipelineAsync()`** method of the GPUDevice interface returns a Promise that fulfills with a GPURenderPipeline, which can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder, once the pipeline can be used without any stalling. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync) + */ + createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise; + /** + * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler) + */ + createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler; + /** + * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule) + */ + createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule; + /** + * The **`createTexture()`** method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture) + */ + createTexture(descriptor: GPUTextureDescriptor): GPUTexture; + /** + * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/destroy) + */ + destroy(): void; + /** + * The **`importExternalTexture()`** method of the GPUDevice interface takes an HTMLVideoElement or a VideoFrame object as an input and returns a GPUExternalTexture wrapper object containing a snapshot of the video that can be used as a frame in GPU rendering operations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/importExternalTexture) + */ + importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture; + /** + * The **`popErrorScope()`** method of the GPUDevice interface pops an existing GPU error scope from the error scope stack (originally pushed using GPUDevice.pushErrorScope()) and returns a Promise that resolves to an object describing the first error captured in the scope, or null if no error occurred. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/popErrorScope) + */ + popErrorScope(): Promise; + /** + * The **`pushErrorScope()`** method of the GPUDevice interface pushes a new GPU error scope onto the device's error scope stack, allowing you to capture errors of a particular type. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/pushErrorScope) + */ + pushErrorScope(filter: GPUErrorFilter): void; + addEventListener(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var GPUDevice: { + prototype: GPUDevice; + new(): GPUDevice; +}; + /** * The **`GPUDeviceLostInfo`** interface of the WebGPU API represents the object returned when the GPUDevice.lost Promise resolves. This provides information as to why a device has been lost. * Available only in secure contexts. @@ -15219,6 +15897,50 @@ declare var GPUQuerySet: { new(): GPUQuerySet; }; +/** + * The **`GPUQueue`** interface of the WebGPU API controls execution of encoded commands on the GPU. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue) + */ +interface GPUQueue extends GPUObjectBase { + /** + * The **`copyExternalImageToTexture()`** method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/copyExternalImageToTexture) + */ + copyExternalImageToTexture(source: GPUCopyExternalImageSourceInfo, destination: GPUCopyExternalImageDestInfo, copySize: GPUExtent3D): void; + /** + * The **`onSubmittedWorkDone()`** method of the GPUQueue interface returns a Promise that resolves when all the work submitted to the GPU via this GPUQueue at the point the method is called has been processed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/onSubmittedWorkDone) + */ + onSubmittedWorkDone(): Promise; + /** + * The **`submit()`** method of the GPUQueue interface schedules the execution of command buffers represented by one or more GPUCommandBuffer objects by the GPU. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/submit) + */ + submit(commandBuffers: GPUCommandBuffer[]): void; + /** + * The **`writeBuffer()`** method of the GPUQueue interface writes a provided data source into a given GPUBuffer. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/writeBuffer) + */ + writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: AllowSharedBufferSource, dataOffset?: GPUSize64, size?: GPUSize64): void; + /** + * The **`writeTexture()`** method of the GPUQueue interface writes a provided data source into a given GPUTexture. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/writeTexture) + */ + writeTexture(destination: GPUTexelCopyTextureInfo, data: AllowSharedBufferSource, dataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3D): void; +} + +declare var GPUQueue: { + prototype: GPUQueue; + new(): GPUQueue; +}; + /** * The **`GPURenderBundle`** interface of the WebGPU API represents a container for pre-recorded bundles of commands. * Available only in secure contexts. @@ -20581,6 +21303,7 @@ interface HTMLTemplateElement extends HTMLElement { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTemplateElement/shadowRootClonable) */ shadowRootClonable: boolean; + shadowRootCustomElementRegistry: string; /** * The **`shadowRootDelegatesFocus`** property of the HTMLTemplateElement interface reflects the value of the shadowrootdelegatesfocus attribute of the associated