@types/serviceworker 0.0.184 → 0.0.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,6 +83,27 @@ interface GPUBindingCommandsMixin {
83
83
  setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: Iterable<GPUBufferDynamicOffset>): void;
84
84
  }
85
85
 
86
+ interface GPUCommandEncoder {
87
+ /**
88
+ * The **`copyBufferToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUBuffer to a GPUTexture.
89
+ *
90
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)
91
+ */
92
+ copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: Iterable<GPUIntegerCoordinate>): void;
93
+ /**
94
+ * The **`copyTextureToBuffer()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer.
95
+ *
96
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)
97
+ */
98
+ copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: Iterable<GPUIntegerCoordinate>): void;
99
+ /**
100
+ * The **`copyTextureToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from one GPUTexture to another.
101
+ *
102
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)
103
+ */
104
+ copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: Iterable<GPUIntegerCoordinate>): void;
105
+ }
106
+
86
107
  interface GPUQueue {
87
108
  /**
88
109
  * The **`copyExternalImageToTexture()`** method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.
package/ts5.6/index.d.ts CHANGED
@@ -272,6 +272,20 @@ interface FontFaceSetLoadEventInit extends EventInit {
272
272
  fontfaces?: FontFace[];
273
273
  }
274
274
 
275
+ interface GPUCanvasConfiguration {
276
+ alphaMode?: GPUCanvasAlphaMode;
277
+ colorSpace?: PredefinedColorSpace;
278
+ device: GPUDevice;
279
+ format: GPUTextureFormat;
280
+ toneMapping?: GPUCanvasToneMapping;
281
+ usage?: GPUTextureUsageFlags;
282
+ viewFormats?: GPUTextureFormat[];
283
+ }
284
+
285
+ interface GPUCanvasToneMapping {
286
+ mode?: GPUCanvasToneMappingMode;
287
+ }
288
+
275
289
  interface GPUColorDict {
276
290
  a: number;
277
291
  b: number;
@@ -279,6 +293,19 @@ interface GPUColorDict {
279
293
  r: number;
280
294
  }
281
295
 
296
+ interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
297
+ }
298
+
299
+ interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {
300
+ timestampWrites?: GPUComputePassTimestampWrites;
301
+ }
302
+
303
+ interface GPUComputePassTimestampWrites {
304
+ beginningOfPassWriteIndex?: GPUSize32;
305
+ endOfPassWriteIndex?: GPUSize32;
306
+ querySet: GPUQuerySet;
307
+ }
308
+
282
309
  interface GPUCopyExternalImageDestInfo extends GPUTexelCopyTextureInfo {
283
310
  colorSpace?: PredefinedColorSpace;
284
311
  premultipliedAlpha?: boolean;
@@ -318,6 +345,45 @@ interface GPUPipelineErrorInit {
318
345
  interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {
319
346
  }
320
347
 
348
+ interface GPURenderPassColorAttachment {
349
+ clearValue?: GPUColor;
350
+ depthSlice?: GPUIntegerCoordinate;
351
+ loadOp: GPULoadOp;
352
+ resolveTarget?: GPUTexture | GPUTextureView;
353
+ storeOp: GPUStoreOp;
354
+ view: GPUTexture | GPUTextureView;
355
+ }
356
+
357
+ interface GPURenderPassDepthStencilAttachment {
358
+ depthClearValue?: number;
359
+ depthLoadOp?: GPULoadOp;
360
+ depthReadOnly?: boolean;
361
+ depthStoreOp?: GPUStoreOp;
362
+ stencilClearValue?: GPUStencilValue;
363
+ stencilLoadOp?: GPULoadOp;
364
+ stencilReadOnly?: boolean;
365
+ stencilStoreOp?: GPUStoreOp;
366
+ view: GPUTexture | GPUTextureView;
367
+ }
368
+
369
+ interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
370
+ colorAttachments: (GPURenderPassColorAttachment | null)[];
371
+ depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
372
+ maxDrawCount?: GPUSize64;
373
+ occlusionQuerySet?: GPUQuerySet;
374
+ timestampWrites?: GPURenderPassTimestampWrites;
375
+ }
376
+
377
+ interface GPURenderPassTimestampWrites {
378
+ beginningOfPassWriteIndex?: GPUSize32;
379
+ endOfPassWriteIndex?: GPUSize32;
380
+ querySet: GPUQuerySet;
381
+ }
382
+
383
+ interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
384
+ buffer: GPUBuffer;
385
+ }
386
+
321
387
  interface GPUTexelCopyBufferLayout {
322
388
  bytesPerRow?: GPUSize32;
323
389
  offset?: GPUSize64;
@@ -4394,6 +4460,50 @@ declare var GPUBuffer: {
4394
4460
  new(): GPUBuffer;
4395
4461
  };
4396
4462
 
4463
+ /**
4464
+ * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a <canvas> element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu".
4465
+ * Available only in secure contexts.
4466
+ *
4467
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext)
4468
+ */
4469
+ interface GPUCanvasContext {
4470
+ /**
4471
+ * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from.
4472
+ *
4473
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas)
4474
+ */
4475
+ readonly canvas: OffscreenCanvas;
4476
+ /**
4477
+ * 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.
4478
+ *
4479
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure)
4480
+ */
4481
+ configure(configuration: GPUCanvasConfiguration): void;
4482
+ /**
4483
+ * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context.
4484
+ *
4485
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration)
4486
+ */
4487
+ getConfiguration(): GPUCanvasConfiguration | null;
4488
+ /**
4489
+ * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context.
4490
+ *
4491
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture)
4492
+ */
4493
+ getCurrentTexture(): GPUTexture;
4494
+ /**
4495
+ * 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.
4496
+ *
4497
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure)
4498
+ */
4499
+ unconfigure(): void;
4500
+ }
4501
+
4502
+ declare var GPUCanvasContext: {
4503
+ prototype: GPUCanvasContext;
4504
+ new(): GPUCanvasContext;
4505
+ };
4506
+
4397
4507
  /**
4398
4508
  * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution.
4399
4509
  * Available only in secure contexts.
@@ -4408,6 +4518,75 @@ declare var GPUCommandBuffer: {
4408
4518
  new(): GPUCommandBuffer;
4409
4519
  };
4410
4520
 
4521
+ /**
4522
+ * The **`GPUCommandEncoder`** interface of the WebGPU API represents an encoder that collects a sequence of GPU commands to be issued to the GPU.
4523
+ * Available only in secure contexts.
4524
+ *
4525
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder)
4526
+ */
4527
+ interface GPUCommandEncoder extends GPUDebugCommandsMixin, GPUObjectBase {
4528
+ /**
4529
+ * The **`beginComputePass()`** method of the GPUCommandEncoder interface starts encoding a compute pass, returning a GPUComputePassEncoder that can be used to control computation.
4530
+ *
4531
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/beginComputePass)
4532
+ */
4533
+ beginComputePass(descriptor?: GPUComputePassDescriptor): GPUComputePassEncoder;
4534
+ /**
4535
+ * The **`beginRenderPass()`** method of the GPUCommandEncoder interface starts encoding a render pass, returning a GPURenderPassEncoder that can be used to control rendering.
4536
+ *
4537
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/beginRenderPass)
4538
+ */
4539
+ beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
4540
+ /**
4541
+ * The **`clearBuffer()`** method of the GPUCommandEncoder interface encodes a command that fills a region of a GPUBuffer with zeroes.
4542
+ *
4543
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/clearBuffer)
4544
+ */
4545
+ clearBuffer(buffer: GPUBuffer, offset?: GPUSize64, size?: GPUSize64): void;
4546
+ /**
4547
+ * The **`copyBufferToBuffer()`** method of the GPUCommandEncoder interface encodes a command that copies data from one GPUBuffer to another.
4548
+ *
4549
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)
4550
+ */
4551
+ copyBufferToBuffer(source: GPUBuffer, destination: GPUBuffer, size?: GPUSize64): void;
4552
+ copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size?: GPUSize64): void;
4553
+ /**
4554
+ * The **`copyBufferToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUBuffer to a GPUTexture.
4555
+ *
4556
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)
4557
+ */
4558
+ copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void;
4559
+ /**
4560
+ * The **`copyTextureToBuffer()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer.
4561
+ *
4562
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)
4563
+ */
4564
+ copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D): void;
4565
+ /**
4566
+ * The **`copyTextureToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from one GPUTexture to another.
4567
+ *
4568
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)
4569
+ */
4570
+ copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void;
4571
+ /**
4572
+ * The **`finish()`** method of the GPUCommandEncoder interface completes recording of the command sequence encoded on this GPUCommandEncoder, returning a corresponding GPUCommandBuffer.
4573
+ *
4574
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/finish)
4575
+ */
4576
+ finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
4577
+ /**
4578
+ * The **`resolveQuerySet()`** method of the GPUCommandEncoder interface encodes a command that resolves a GPUQuerySet, copying the results into a specified GPUBuffer.
4579
+ *
4580
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/resolveQuerySet)
4581
+ */
4582
+ resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): void;
4583
+ }
4584
+
4585
+ declare var GPUCommandEncoder: {
4586
+ prototype: GPUCommandEncoder;
4587
+ new(): GPUCommandEncoder;
4588
+ };
4589
+
4411
4590
  /**
4412
4591
  * 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.
4413
4592
  * Available only in secure contexts.
@@ -4539,6 +4718,60 @@ interface GPUDebugCommandsMixin {
4539
4718
  pushDebugGroup(groupLabel: string): void;
4540
4719
  }
4541
4720
 
4721
+ interface GPUDeviceEventMap {
4722
+ "uncapturederror": GPUUncapturedErrorEvent;
4723
+ }
4724
+
4725
+ /**
4726
+ * 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.
4727
+ * Available only in secure contexts.
4728
+ *
4729
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice)
4730
+ */
4731
+ interface GPUDevice extends EventTarget, GPUObjectBase {
4732
+ /**
4733
+ * The **`adapterInfo`** read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter.
4734
+ *
4735
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/adapterInfo)
4736
+ */
4737
+ readonly adapterInfo: GPUAdapterInfo;
4738
+ /**
4739
+ * 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.
4740
+ *
4741
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/features)
4742
+ */
4743
+ readonly features: GPUSupportedFeatures;
4744
+ /**
4745
+ * 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.
4746
+ *
4747
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/limits)
4748
+ */
4749
+ readonly limits: GPUSupportedLimits;
4750
+ /**
4751
+ * 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.
4752
+ *
4753
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/lost)
4754
+ */
4755
+ readonly lost: Promise<GPUDeviceLostInfo>;
4756
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/uncapturederror_event) */
4757
+ onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
4758
+ /**
4759
+ * The **`queue`** read-only property of the GPUDevice interface returns the primary GPUQueue for the device.
4760
+ *
4761
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
4762
+ */
4763
+ readonly queue: GPUQueue;
4764
+ addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
4765
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
4766
+ removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
4767
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
4768
+ }
4769
+
4770
+ declare var GPUDevice: {
4771
+ prototype: GPUDevice;
4772
+ new(): GPUDevice;
4773
+ };
4774
+
4542
4775
  /**
4543
4776
  * 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.
4544
4777
  * Available only in secure contexts.
@@ -12718,7 +12951,7 @@ type ImageDataArray = Uint8ClampedArray;
12718
12951
  type Int32List = Int32Array | GLint[];
12719
12952
  type MessageEventSource = MessagePort | ServiceWorker;
12720
12953
  type NamedCurve = string;
12721
- type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
12954
+ type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext;
12722
12955
  type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
12723
12956
  type PerformanceEntryList = PerformanceEntry[];
12724
12957
  type PushMessageDataInit = BufferSource | string;
@@ -12759,11 +12992,15 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
12759
12992
  type FontFaceSetLoadStatus = "loaded" | "loading";
12760
12993
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
12761
12994
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
12995
+ type GPUCanvasAlphaMode = "opaque" | "premultiplied";
12996
+ type GPUCanvasToneMappingMode = "extended" | "standard";
12762
12997
  type GPUCompilationMessageType = "error" | "info" | "warning";
12763
12998
  type GPUDeviceLostReason = "destroyed" | "unknown";
12764
12999
  type GPUIndexFormat = "uint16" | "uint32";
13000
+ type GPULoadOp = "clear" | "load";
12765
13001
  type GPUPipelineErrorReason = "internal" | "validation";
12766
13002
  type GPUQueryType = "occlusion" | "timestamp";
13003
+ type GPUStoreOp = "discard" | "store";
12767
13004
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
12768
13005
  type GPUTextureDimension = "1d" | "2d" | "3d";
12769
13006
  type GPUTextureFormat = "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-snorm" | "bc4-r-unorm" | "bc5-rg-snorm" | "bc5-rg-unorm" | "bc6h-rgb-float" | "bc6h-rgb-ufloat" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "bgra8unorm" | "bgra8unorm-srgb" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "eac-r11snorm" | "eac-r11unorm" | "eac-rg11snorm" | "eac-rg11unorm" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "r16float" | "r16sint" | "r16snorm" | "r16uint" | "r16unorm" | "r32float" | "r32sint" | "r32uint" | "r8sint" | "r8snorm" | "r8uint" | "r8unorm" | "rg11b10ufloat" | "rg16float" | "rg16sint" | "rg16snorm" | "rg16uint" | "rg16unorm" | "rg32float" | "rg32sint" | "rg32uint" | "rg8sint" | "rg8snorm" | "rg8uint" | "rg8unorm" | "rgb10a2uint" | "rgb10a2unorm" | "rgb9e5ufloat" | "rgba16float" | "rgba16sint" | "rgba16snorm" | "rgba16uint" | "rgba16unorm" | "rgba32float" | "rgba32sint" | "rgba32uint" | "rgba8sint" | "rgba8snorm" | "rgba8uint" | "rgba8unorm" | "rgba8unorm-srgb" | "stencil8";
@@ -87,6 +87,27 @@ interface GPUBindingCommandsMixin {
87
87
  setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: Iterable<GPUBufferDynamicOffset>): void;
88
88
  }
89
89
 
90
+ interface GPUCommandEncoder {
91
+ /**
92
+ * The **`copyBufferToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUBuffer to a GPUTexture.
93
+ *
94
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)
95
+ */
96
+ copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: Iterable<GPUIntegerCoordinate>): void;
97
+ /**
98
+ * The **`copyTextureToBuffer()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer.
99
+ *
100
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)
101
+ */
102
+ copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: Iterable<GPUIntegerCoordinate>): void;
103
+ /**
104
+ * The **`copyTextureToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from one GPUTexture to another.
105
+ *
106
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)
107
+ */
108
+ copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: Iterable<GPUIntegerCoordinate>): void;
109
+ }
110
+
90
111
  interface GPUQueue {
91
112
  /**
92
113
  * The **`copyExternalImageToTexture()`** method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.
package/ts5.9/index.d.ts CHANGED
@@ -272,6 +272,20 @@ interface FontFaceSetLoadEventInit extends EventInit {
272
272
  fontfaces?: FontFace[];
273
273
  }
274
274
 
275
+ interface GPUCanvasConfiguration {
276
+ alphaMode?: GPUCanvasAlphaMode;
277
+ colorSpace?: PredefinedColorSpace;
278
+ device: GPUDevice;
279
+ format: GPUTextureFormat;
280
+ toneMapping?: GPUCanvasToneMapping;
281
+ usage?: GPUTextureUsageFlags;
282
+ viewFormats?: GPUTextureFormat[];
283
+ }
284
+
285
+ interface GPUCanvasToneMapping {
286
+ mode?: GPUCanvasToneMappingMode;
287
+ }
288
+
275
289
  interface GPUColorDict {
276
290
  a: number;
277
291
  b: number;
@@ -279,6 +293,19 @@ interface GPUColorDict {
279
293
  r: number;
280
294
  }
281
295
 
296
+ interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
297
+ }
298
+
299
+ interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {
300
+ timestampWrites?: GPUComputePassTimestampWrites;
301
+ }
302
+
303
+ interface GPUComputePassTimestampWrites {
304
+ beginningOfPassWriteIndex?: GPUSize32;
305
+ endOfPassWriteIndex?: GPUSize32;
306
+ querySet: GPUQuerySet;
307
+ }
308
+
282
309
  interface GPUCopyExternalImageDestInfo extends GPUTexelCopyTextureInfo {
283
310
  colorSpace?: PredefinedColorSpace;
284
311
  premultipliedAlpha?: boolean;
@@ -318,6 +345,45 @@ interface GPUPipelineErrorInit {
318
345
  interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {
319
346
  }
320
347
 
348
+ interface GPURenderPassColorAttachment {
349
+ clearValue?: GPUColor;
350
+ depthSlice?: GPUIntegerCoordinate;
351
+ loadOp: GPULoadOp;
352
+ resolveTarget?: GPUTexture | GPUTextureView;
353
+ storeOp: GPUStoreOp;
354
+ view: GPUTexture | GPUTextureView;
355
+ }
356
+
357
+ interface GPURenderPassDepthStencilAttachment {
358
+ depthClearValue?: number;
359
+ depthLoadOp?: GPULoadOp;
360
+ depthReadOnly?: boolean;
361
+ depthStoreOp?: GPUStoreOp;
362
+ stencilClearValue?: GPUStencilValue;
363
+ stencilLoadOp?: GPULoadOp;
364
+ stencilReadOnly?: boolean;
365
+ stencilStoreOp?: GPUStoreOp;
366
+ view: GPUTexture | GPUTextureView;
367
+ }
368
+
369
+ interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
370
+ colorAttachments: (GPURenderPassColorAttachment | null)[];
371
+ depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
372
+ maxDrawCount?: GPUSize64;
373
+ occlusionQuerySet?: GPUQuerySet;
374
+ timestampWrites?: GPURenderPassTimestampWrites;
375
+ }
376
+
377
+ interface GPURenderPassTimestampWrites {
378
+ beginningOfPassWriteIndex?: GPUSize32;
379
+ endOfPassWriteIndex?: GPUSize32;
380
+ querySet: GPUQuerySet;
381
+ }
382
+
383
+ interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
384
+ buffer: GPUBuffer;
385
+ }
386
+
321
387
  interface GPUTexelCopyBufferLayout {
322
388
  bytesPerRow?: GPUSize32;
323
389
  offset?: GPUSize64;
@@ -4394,6 +4460,50 @@ declare var GPUBuffer: {
4394
4460
  new(): GPUBuffer;
4395
4461
  };
4396
4462
 
4463
+ /**
4464
+ * The **`GPUCanvasContext`** interface of the WebGPU API represents the WebGPU rendering context of a <canvas> element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu".
4465
+ * Available only in secure contexts.
4466
+ *
4467
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext)
4468
+ */
4469
+ interface GPUCanvasContext {
4470
+ /**
4471
+ * The **`canvas`** read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from.
4472
+ *
4473
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/canvas)
4474
+ */
4475
+ readonly canvas: OffscreenCanvas;
4476
+ /**
4477
+ * 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.
4478
+ *
4479
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/configure)
4480
+ */
4481
+ configure(configuration: GPUCanvasConfiguration): void;
4482
+ /**
4483
+ * The **`getConfiguration()`** method of the GPUCanvasContext interface returns the current configuration set for the context.
4484
+ *
4485
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getConfiguration)
4486
+ */
4487
+ getConfiguration(): GPUCanvasConfiguration | null;
4488
+ /**
4489
+ * The **`getCurrentTexture()`** method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context.
4490
+ *
4491
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/getCurrentTexture)
4492
+ */
4493
+ getCurrentTexture(): GPUTexture;
4494
+ /**
4495
+ * 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.
4496
+ *
4497
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCanvasContext/unconfigure)
4498
+ */
4499
+ unconfigure(): void;
4500
+ }
4501
+
4502
+ declare var GPUCanvasContext: {
4503
+ prototype: GPUCanvasContext;
4504
+ new(): GPUCanvasContext;
4505
+ };
4506
+
4397
4507
  /**
4398
4508
  * The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution.
4399
4509
  * Available only in secure contexts.
@@ -4408,6 +4518,75 @@ declare var GPUCommandBuffer: {
4408
4518
  new(): GPUCommandBuffer;
4409
4519
  };
4410
4520
 
4521
+ /**
4522
+ * The **`GPUCommandEncoder`** interface of the WebGPU API represents an encoder that collects a sequence of GPU commands to be issued to the GPU.
4523
+ * Available only in secure contexts.
4524
+ *
4525
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder)
4526
+ */
4527
+ interface GPUCommandEncoder extends GPUDebugCommandsMixin, GPUObjectBase {
4528
+ /**
4529
+ * The **`beginComputePass()`** method of the GPUCommandEncoder interface starts encoding a compute pass, returning a GPUComputePassEncoder that can be used to control computation.
4530
+ *
4531
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/beginComputePass)
4532
+ */
4533
+ beginComputePass(descriptor?: GPUComputePassDescriptor): GPUComputePassEncoder;
4534
+ /**
4535
+ * The **`beginRenderPass()`** method of the GPUCommandEncoder interface starts encoding a render pass, returning a GPURenderPassEncoder that can be used to control rendering.
4536
+ *
4537
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/beginRenderPass)
4538
+ */
4539
+ beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
4540
+ /**
4541
+ * The **`clearBuffer()`** method of the GPUCommandEncoder interface encodes a command that fills a region of a GPUBuffer with zeroes.
4542
+ *
4543
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/clearBuffer)
4544
+ */
4545
+ clearBuffer(buffer: GPUBuffer, offset?: GPUSize64, size?: GPUSize64): void;
4546
+ /**
4547
+ * The **`copyBufferToBuffer()`** method of the GPUCommandEncoder interface encodes a command that copies data from one GPUBuffer to another.
4548
+ *
4549
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)
4550
+ */
4551
+ copyBufferToBuffer(source: GPUBuffer, destination: GPUBuffer, size?: GPUSize64): void;
4552
+ copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size?: GPUSize64): void;
4553
+ /**
4554
+ * The **`copyBufferToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUBuffer to a GPUTexture.
4555
+ *
4556
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)
4557
+ */
4558
+ copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void;
4559
+ /**
4560
+ * The **`copyTextureToBuffer()`** method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer.
4561
+ *
4562
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)
4563
+ */
4564
+ copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D): void;
4565
+ /**
4566
+ * The **`copyTextureToTexture()`** method of the GPUCommandEncoder interface encodes a command that copies data from one GPUTexture to another.
4567
+ *
4568
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)
4569
+ */
4570
+ copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void;
4571
+ /**
4572
+ * The **`finish()`** method of the GPUCommandEncoder interface completes recording of the command sequence encoded on this GPUCommandEncoder, returning a corresponding GPUCommandBuffer.
4573
+ *
4574
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/finish)
4575
+ */
4576
+ finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
4577
+ /**
4578
+ * The **`resolveQuerySet()`** method of the GPUCommandEncoder interface encodes a command that resolves a GPUQuerySet, copying the results into a specified GPUBuffer.
4579
+ *
4580
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUCommandEncoder/resolveQuerySet)
4581
+ */
4582
+ resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): void;
4583
+ }
4584
+
4585
+ declare var GPUCommandEncoder: {
4586
+ prototype: GPUCommandEncoder;
4587
+ new(): GPUCommandEncoder;
4588
+ };
4589
+
4411
4590
  /**
4412
4591
  * 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.
4413
4592
  * Available only in secure contexts.
@@ -4539,6 +4718,60 @@ interface GPUDebugCommandsMixin {
4539
4718
  pushDebugGroup(groupLabel: string): void;
4540
4719
  }
4541
4720
 
4721
+ interface GPUDeviceEventMap {
4722
+ "uncapturederror": GPUUncapturedErrorEvent;
4723
+ }
4724
+
4725
+ /**
4726
+ * 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.
4727
+ * Available only in secure contexts.
4728
+ *
4729
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice)
4730
+ */
4731
+ interface GPUDevice extends EventTarget, GPUObjectBase {
4732
+ /**
4733
+ * The **`adapterInfo`** read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter.
4734
+ *
4735
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/adapterInfo)
4736
+ */
4737
+ readonly adapterInfo: GPUAdapterInfo;
4738
+ /**
4739
+ * 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.
4740
+ *
4741
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/features)
4742
+ */
4743
+ readonly features: GPUSupportedFeatures;
4744
+ /**
4745
+ * 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.
4746
+ *
4747
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/limits)
4748
+ */
4749
+ readonly limits: GPUSupportedLimits;
4750
+ /**
4751
+ * 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.
4752
+ *
4753
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/lost)
4754
+ */
4755
+ readonly lost: Promise<GPUDeviceLostInfo>;
4756
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/uncapturederror_event) */
4757
+ onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
4758
+ /**
4759
+ * The **`queue`** read-only property of the GPUDevice interface returns the primary GPUQueue for the device.
4760
+ *
4761
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
4762
+ */
4763
+ readonly queue: GPUQueue;
4764
+ addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
4765
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
4766
+ removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
4767
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
4768
+ }
4769
+
4770
+ declare var GPUDevice: {
4771
+ prototype: GPUDevice;
4772
+ new(): GPUDevice;
4773
+ };
4774
+
4542
4775
  /**
4543
4776
  * 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.
4544
4777
  * Available only in secure contexts.
@@ -12718,7 +12951,7 @@ type ImageDataArray = Uint8ClampedArray<ArrayBuffer>;
12718
12951
  type Int32List = Int32Array<ArrayBufferLike> | GLint[];
12719
12952
  type MessageEventSource = MessagePort | ServiceWorker;
12720
12953
  type NamedCurve = string;
12721
- type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
12954
+ type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext | GPUCanvasContext;
12722
12955
  type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
12723
12956
  type PerformanceEntryList = PerformanceEntry[];
12724
12957
  type PushMessageDataInit = BufferSource | string;
@@ -12759,11 +12992,15 @@ type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
12759
12992
  type FontFaceSetLoadStatus = "loaded" | "loading";
12760
12993
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
12761
12994
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
12995
+ type GPUCanvasAlphaMode = "opaque" | "premultiplied";
12996
+ type GPUCanvasToneMappingMode = "extended" | "standard";
12762
12997
  type GPUCompilationMessageType = "error" | "info" | "warning";
12763
12998
  type GPUDeviceLostReason = "destroyed" | "unknown";
12764
12999
  type GPUIndexFormat = "uint16" | "uint32";
13000
+ type GPULoadOp = "clear" | "load";
12765
13001
  type GPUPipelineErrorReason = "internal" | "validation";
12766
13002
  type GPUQueryType = "occlusion" | "timestamp";
13003
+ type GPUStoreOp = "discard" | "store";
12767
13004
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
12768
13005
  type GPUTextureDimension = "1d" | "2d" | "3d";
12769
13006
  type GPUTextureFormat = "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-snorm" | "bc4-r-unorm" | "bc5-rg-snorm" | "bc5-rg-unorm" | "bc6h-rgb-float" | "bc6h-rgb-ufloat" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "bgra8unorm" | "bgra8unorm-srgb" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "eac-r11snorm" | "eac-r11unorm" | "eac-rg11snorm" | "eac-rg11unorm" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "r16float" | "r16sint" | "r16snorm" | "r16uint" | "r16unorm" | "r32float" | "r32sint" | "r32uint" | "r8sint" | "r8snorm" | "r8uint" | "r8unorm" | "rg11b10ufloat" | "rg16float" | "rg16sint" | "rg16snorm" | "rg16uint" | "rg16unorm" | "rg32float" | "rg32sint" | "rg32uint" | "rg8sint" | "rg8snorm" | "rg8uint" | "rg8unorm" | "rgb10a2uint" | "rgb10a2unorm" | "rgb9e5ufloat" | "rgba16float" | "rgba16sint" | "rgba16snorm" | "rgba16uint" | "rgba16unorm" | "rgba32float" | "rgba32sint" | "rgba32uint" | "rgba8sint" | "rgba8snorm" | "rgba8uint" | "rgba8unorm" | "rgba8unorm-srgb" | "stencil8";