@types/serviceworker 0.0.188 → 0.0.190

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.
package/README.md CHANGED
@@ -28,4 +28,4 @@ This project does not respect semantic versioning as almost every change could p
28
28
 
29
29
  ## Deploy Metadata
30
30
 
31
- You can read what changed in version 0.0.188 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.188.
31
+ You can read what changed in version 0.0.190 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.190.
package/index.d.ts CHANGED
@@ -285,6 +285,17 @@ interface GPUBindGroupEntry {
285
285
  resource: GPUBindingResource;
286
286
  }
287
287
 
288
+ interface GPUBlendComponent {
289
+ dstFactor?: GPUBlendFactor;
290
+ operation?: GPUBlendOperation;
291
+ srcFactor?: GPUBlendFactor;
292
+ }
293
+
294
+ interface GPUBlendState {
295
+ alpha: GPUBlendComponent;
296
+ color: GPUBlendComponent;
297
+ }
298
+
288
299
  interface GPUBufferBinding {
289
300
  buffer: GPUBuffer;
290
301
  offset?: GPUSize64;
@@ -318,6 +329,12 @@ interface GPUColorDict {
318
329
  r: number;
319
330
  }
320
331
 
332
+ interface GPUColorTargetState {
333
+ blend?: GPUBlendState;
334
+ format: GPUTextureFormat;
335
+ writeMask?: GPUColorWriteFlags;
336
+ }
337
+
321
338
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
322
339
  }
323
340
 
@@ -349,6 +366,19 @@ interface GPUCopyExternalImageSourceInfo {
349
366
  source: GPUCopyExternalImageSource;
350
367
  }
351
368
 
369
+ interface GPUDepthStencilState {
370
+ depthBias?: GPUDepthBias;
371
+ depthBiasClamp?: number;
372
+ depthBiasSlopeScale?: number;
373
+ depthCompare?: GPUCompareFunction;
374
+ depthWriteEnabled?: boolean;
375
+ format: GPUTextureFormat;
376
+ stencilBack?: GPUStencilFaceState;
377
+ stencilFront?: GPUStencilFaceState;
378
+ stencilReadMask?: GPUStencilValue;
379
+ stencilWriteMask?: GPUStencilValue;
380
+ }
381
+
352
382
  interface GPUExtent3DDict {
353
383
  depthOrArrayLayers?: GPUIntegerCoordinate;
354
384
  height?: GPUIntegerCoordinate;
@@ -359,6 +389,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
359
389
  colorSpace?: PredefinedColorSpace;
360
390
  }
361
391
 
392
+ interface GPUFragmentState extends GPUProgrammableStage {
393
+ targets: (GPUColorTargetState | null)[];
394
+ }
395
+
396
+ interface GPUMultisampleState {
397
+ alphaToCoverageEnabled?: boolean;
398
+ count?: GPUSize32;
399
+ mask?: GPUSampleMask;
400
+ }
401
+
362
402
  interface GPUObjectDescriptorBase {
363
403
  label?: string;
364
404
  }
@@ -386,6 +426,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
386
426
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
387
427
  }
388
428
 
429
+ interface GPUPrimitiveState {
430
+ cullMode?: GPUCullMode;
431
+ frontFace?: GPUFrontFace;
432
+ stripIndexFormat?: GPUIndexFormat;
433
+ topology?: GPUPrimitiveTopology;
434
+ unclippedDepth?: boolean;
435
+ }
436
+
389
437
  interface GPUProgrammableStage {
390
438
  constants?: Record<string, GPUPipelineConstantValue>;
391
439
  entryPoint?: string;
@@ -446,6 +494,14 @@ interface GPURenderPassTimestampWrites {
446
494
  querySet: GPUQuerySet;
447
495
  }
448
496
 
497
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
498
+ depthStencil?: GPUDepthStencilState;
499
+ fragment?: GPUFragmentState;
500
+ multisample?: GPUMultisampleState;
501
+ primitive?: GPUPrimitiveState;
502
+ vertex: GPUVertexState;
503
+ }
504
+
449
505
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
450
506
  addressModeU?: GPUAddressMode;
451
507
  addressModeV?: GPUAddressMode;
@@ -459,6 +515,17 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
459
515
  mipmapFilter?: GPUMipmapFilterMode;
460
516
  }
461
517
 
518
+ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
519
+ code: string;
520
+ }
521
+
522
+ interface GPUStencilFaceState {
523
+ compare?: GPUCompareFunction;
524
+ depthFailOp?: GPUStencilOperation;
525
+ failOp?: GPUStencilOperation;
526
+ passOp?: GPUStencilOperation;
527
+ }
528
+
462
529
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
463
530
  buffer: GPUBuffer;
464
531
  }
@@ -476,6 +543,16 @@ interface GPUTexelCopyTextureInfo {
476
543
  texture: GPUTexture;
477
544
  }
478
545
 
546
+ interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
547
+ dimension?: GPUTextureDimension;
548
+ format: GPUTextureFormat;
549
+ mipLevelCount?: GPUIntegerCoordinate;
550
+ sampleCount?: GPUSize32;
551
+ size: GPUExtent3D;
552
+ usage: GPUTextureUsageFlags;
553
+ viewFormats?: GPUTextureFormat[];
554
+ }
555
+
479
556
  interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
480
557
  arrayLayerCount?: GPUIntegerCoordinate;
481
558
  aspect?: GPUTextureAspect;
@@ -491,6 +568,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
491
568
  error: GPUError;
492
569
  }
493
570
 
571
+ interface GPUVertexAttribute {
572
+ format: GPUVertexFormat;
573
+ offset: GPUSize64;
574
+ shaderLocation: GPUIndex32;
575
+ }
576
+
577
+ interface GPUVertexBufferLayout {
578
+ arrayStride: GPUSize64;
579
+ attributes: GPUVertexAttribute[];
580
+ stepMode?: GPUVertexStepMode;
581
+ }
582
+
583
+ interface GPUVertexState extends GPUProgrammableStage {
584
+ buffers?: (GPUVertexBufferLayout | null)[];
585
+ }
586
+
494
587
  interface GetNotificationOptions {
495
588
  tag?: string;
496
589
  }
@@ -4888,12 +4981,36 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
4888
4981
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
4889
4982
  */
4890
4983
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
4984
+ /**
4985
+ * 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.
4986
+ *
4987
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
4988
+ */
4989
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
4990
+ /**
4991
+ * 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.
4992
+ *
4993
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
4994
+ */
4995
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
4891
4996
  /**
4892
4997
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
4893
4998
  *
4894
4999
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
4895
5000
  */
4896
5001
  createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
5002
+ /**
5003
+ * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
5004
+ *
5005
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
5006
+ */
5007
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
5008
+ /**
5009
+ * 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.
5010
+ *
5011
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
5012
+ */
5013
+ createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
4897
5014
  /**
4898
5015
  * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
4899
5016
  *
@@ -13086,7 +13203,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
13086
13203
  type GPUBufferDynamicOffset = number;
13087
13204
  type GPUBufferUsageFlags = number;
13088
13205
  type GPUColor = number[] | GPUColorDict;
13206
+ type GPUColorWriteFlags = number;
13089
13207
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
13208
+ type GPUDepthBias = number;
13090
13209
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
13091
13210
  type GPUFlagsConstant = number;
13092
13211
  type GPUIndex32 = number;
@@ -13096,6 +13215,7 @@ type GPUMapModeFlags = number;
13096
13215
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
13097
13216
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
13098
13217
  type GPUPipelineConstantValue = number;
13218
+ type GPUSampleMask = number;
13099
13219
  type GPUSignedOffset32 = number;
13100
13220
  type GPUSize32 = number;
13101
13221
  type GPUSize32Out = number;
@@ -13153,24 +13273,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
13153
13273
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
13154
13274
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
13155
13275
  type GPUAutoLayoutMode = "auto";
13276
+ type GPUBlendFactor = "constant" | "dst" | "dst-alpha" | "one" | "one-minus-constant" | "one-minus-dst" | "one-minus-dst-alpha" | "one-minus-src" | "one-minus-src-alpha" | "src" | "src-alpha" | "src-alpha-saturated" | "zero";
13277
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
13156
13278
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
13157
13279
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
13158
13280
  type GPUCanvasToneMappingMode = "extended" | "standard";
13159
13281
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
13160
13282
  type GPUCompilationMessageType = "error" | "info" | "warning";
13283
+ type GPUCullMode = "back" | "front" | "none";
13161
13284
  type GPUDeviceLostReason = "destroyed" | "unknown";
13162
13285
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
13163
13286
  type GPUFilterMode = "linear" | "nearest";
13287
+ type GPUFrontFace = "ccw" | "cw";
13164
13288
  type GPUIndexFormat = "uint16" | "uint32";
13165
13289
  type GPULoadOp = "clear" | "load";
13166
13290
  type GPUMipmapFilterMode = "linear" | "nearest";
13167
13291
  type GPUPipelineErrorReason = "internal" | "validation";
13292
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
13168
13293
  type GPUQueryType = "occlusion" | "timestamp";
13294
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
13169
13295
  type GPUStoreOp = "discard" | "store";
13170
13296
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
13171
13297
  type GPUTextureDimension = "1d" | "2d" | "3d";
13172
13298
  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";
13173
13299
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
13300
+ type GPUVertexFormat = "float16" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "sint16" | "sint16x2" | "sint16x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "sint8" | "sint8x2" | "sint8x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "uint8" | "uint8x2" | "uint8x4" | "unorm10-10-10-2" | "unorm16" | "unorm16x2" | "unorm16x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "unorm8x4-bgra";
13301
+ type GPUVertexStepMode = "instance" | "vertex";
13174
13302
  type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
13175
13303
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
13176
13304
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/serviceworker",
3
- "version": "0.0.188",
3
+ "version": "0.0.190",
4
4
  "description": "Types for the global scope of Service Workers",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [],
package/ts5.5/index.d.ts CHANGED
@@ -282,6 +282,17 @@ interface GPUBindGroupEntry {
282
282
  resource: GPUBindingResource;
283
283
  }
284
284
 
285
+ interface GPUBlendComponent {
286
+ dstFactor?: GPUBlendFactor;
287
+ operation?: GPUBlendOperation;
288
+ srcFactor?: GPUBlendFactor;
289
+ }
290
+
291
+ interface GPUBlendState {
292
+ alpha: GPUBlendComponent;
293
+ color: GPUBlendComponent;
294
+ }
295
+
285
296
  interface GPUBufferBinding {
286
297
  buffer: GPUBuffer;
287
298
  offset?: GPUSize64;
@@ -315,6 +326,12 @@ interface GPUColorDict {
315
326
  r: number;
316
327
  }
317
328
 
329
+ interface GPUColorTargetState {
330
+ blend?: GPUBlendState;
331
+ format: GPUTextureFormat;
332
+ writeMask?: GPUColorWriteFlags;
333
+ }
334
+
318
335
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
319
336
  }
320
337
 
@@ -346,6 +363,19 @@ interface GPUCopyExternalImageSourceInfo {
346
363
  source: GPUCopyExternalImageSource;
347
364
  }
348
365
 
366
+ interface GPUDepthStencilState {
367
+ depthBias?: GPUDepthBias;
368
+ depthBiasClamp?: number;
369
+ depthBiasSlopeScale?: number;
370
+ depthCompare?: GPUCompareFunction;
371
+ depthWriteEnabled?: boolean;
372
+ format: GPUTextureFormat;
373
+ stencilBack?: GPUStencilFaceState;
374
+ stencilFront?: GPUStencilFaceState;
375
+ stencilReadMask?: GPUStencilValue;
376
+ stencilWriteMask?: GPUStencilValue;
377
+ }
378
+
349
379
  interface GPUExtent3DDict {
350
380
  depthOrArrayLayers?: GPUIntegerCoordinate;
351
381
  height?: GPUIntegerCoordinate;
@@ -356,6 +386,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
356
386
  colorSpace?: PredefinedColorSpace;
357
387
  }
358
388
 
389
+ interface GPUFragmentState extends GPUProgrammableStage {
390
+ targets: (GPUColorTargetState | null)[];
391
+ }
392
+
393
+ interface GPUMultisampleState {
394
+ alphaToCoverageEnabled?: boolean;
395
+ count?: GPUSize32;
396
+ mask?: GPUSampleMask;
397
+ }
398
+
359
399
  interface GPUObjectDescriptorBase {
360
400
  label?: string;
361
401
  }
@@ -383,6 +423,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
383
423
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
384
424
  }
385
425
 
426
+ interface GPUPrimitiveState {
427
+ cullMode?: GPUCullMode;
428
+ frontFace?: GPUFrontFace;
429
+ stripIndexFormat?: GPUIndexFormat;
430
+ topology?: GPUPrimitiveTopology;
431
+ unclippedDepth?: boolean;
432
+ }
433
+
386
434
  interface GPUProgrammableStage {
387
435
  constants?: Record<string, GPUPipelineConstantValue>;
388
436
  entryPoint?: string;
@@ -443,6 +491,14 @@ interface GPURenderPassTimestampWrites {
443
491
  querySet: GPUQuerySet;
444
492
  }
445
493
 
494
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
495
+ depthStencil?: GPUDepthStencilState;
496
+ fragment?: GPUFragmentState;
497
+ multisample?: GPUMultisampleState;
498
+ primitive?: GPUPrimitiveState;
499
+ vertex: GPUVertexState;
500
+ }
501
+
446
502
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
447
503
  addressModeU?: GPUAddressMode;
448
504
  addressModeV?: GPUAddressMode;
@@ -456,6 +512,17 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
456
512
  mipmapFilter?: GPUMipmapFilterMode;
457
513
  }
458
514
 
515
+ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
516
+ code: string;
517
+ }
518
+
519
+ interface GPUStencilFaceState {
520
+ compare?: GPUCompareFunction;
521
+ depthFailOp?: GPUStencilOperation;
522
+ failOp?: GPUStencilOperation;
523
+ passOp?: GPUStencilOperation;
524
+ }
525
+
459
526
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
460
527
  buffer: GPUBuffer;
461
528
  }
@@ -473,6 +540,16 @@ interface GPUTexelCopyTextureInfo {
473
540
  texture: GPUTexture;
474
541
  }
475
542
 
543
+ interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
544
+ dimension?: GPUTextureDimension;
545
+ format: GPUTextureFormat;
546
+ mipLevelCount?: GPUIntegerCoordinate;
547
+ sampleCount?: GPUSize32;
548
+ size: GPUExtent3D;
549
+ usage: GPUTextureUsageFlags;
550
+ viewFormats?: GPUTextureFormat[];
551
+ }
552
+
476
553
  interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
477
554
  arrayLayerCount?: GPUIntegerCoordinate;
478
555
  aspect?: GPUTextureAspect;
@@ -488,6 +565,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
488
565
  error: GPUError;
489
566
  }
490
567
 
568
+ interface GPUVertexAttribute {
569
+ format: GPUVertexFormat;
570
+ offset: GPUSize64;
571
+ shaderLocation: GPUIndex32;
572
+ }
573
+
574
+ interface GPUVertexBufferLayout {
575
+ arrayStride: GPUSize64;
576
+ attributes: GPUVertexAttribute[];
577
+ stepMode?: GPUVertexStepMode;
578
+ }
579
+
580
+ interface GPUVertexState extends GPUProgrammableStage {
581
+ buffers?: (GPUVertexBufferLayout | null)[];
582
+ }
583
+
491
584
  interface GetNotificationOptions {
492
585
  tag?: string;
493
586
  }
@@ -4885,12 +4978,36 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
4885
4978
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
4886
4979
  */
4887
4980
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
4981
+ /**
4982
+ * 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.
4983
+ *
4984
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
4985
+ */
4986
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
4987
+ /**
4988
+ * 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.
4989
+ *
4990
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
4991
+ */
4992
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
4888
4993
  /**
4889
4994
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
4890
4995
  *
4891
4996
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
4892
4997
  */
4893
4998
  createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
4999
+ /**
5000
+ * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
5001
+ *
5002
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
5003
+ */
5004
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
5005
+ /**
5006
+ * 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.
5007
+ *
5008
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
5009
+ */
5010
+ createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
4894
5011
  /**
4895
5012
  * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
4896
5013
  *
@@ -13083,7 +13200,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
13083
13200
  type GPUBufferDynamicOffset = number;
13084
13201
  type GPUBufferUsageFlags = number;
13085
13202
  type GPUColor = number[] | GPUColorDict;
13203
+ type GPUColorWriteFlags = number;
13086
13204
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
13205
+ type GPUDepthBias = number;
13087
13206
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
13088
13207
  type GPUFlagsConstant = number;
13089
13208
  type GPUIndex32 = number;
@@ -13093,6 +13212,7 @@ type GPUMapModeFlags = number;
13093
13212
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
13094
13213
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
13095
13214
  type GPUPipelineConstantValue = number;
13215
+ type GPUSampleMask = number;
13096
13216
  type GPUSignedOffset32 = number;
13097
13217
  type GPUSize32 = number;
13098
13218
  type GPUSize32Out = number;
@@ -13150,24 +13270,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
13150
13270
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
13151
13271
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
13152
13272
  type GPUAutoLayoutMode = "auto";
13273
+ type GPUBlendFactor = "constant" | "dst" | "dst-alpha" | "one" | "one-minus-constant" | "one-minus-dst" | "one-minus-dst-alpha" | "one-minus-src" | "one-minus-src-alpha" | "src" | "src-alpha" | "src-alpha-saturated" | "zero";
13274
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
13153
13275
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
13154
13276
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
13155
13277
  type GPUCanvasToneMappingMode = "extended" | "standard";
13156
13278
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
13157
13279
  type GPUCompilationMessageType = "error" | "info" | "warning";
13280
+ type GPUCullMode = "back" | "front" | "none";
13158
13281
  type GPUDeviceLostReason = "destroyed" | "unknown";
13159
13282
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
13160
13283
  type GPUFilterMode = "linear" | "nearest";
13284
+ type GPUFrontFace = "ccw" | "cw";
13161
13285
  type GPUIndexFormat = "uint16" | "uint32";
13162
13286
  type GPULoadOp = "clear" | "load";
13163
13287
  type GPUMipmapFilterMode = "linear" | "nearest";
13164
13288
  type GPUPipelineErrorReason = "internal" | "validation";
13289
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
13165
13290
  type GPUQueryType = "occlusion" | "timestamp";
13291
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
13166
13292
  type GPUStoreOp = "discard" | "store";
13167
13293
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
13168
13294
  type GPUTextureDimension = "1d" | "2d" | "3d";
13169
13295
  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";
13170
13296
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
13297
+ type GPUVertexFormat = "float16" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "sint16" | "sint16x2" | "sint16x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "sint8" | "sint8x2" | "sint8x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "uint8" | "uint8x2" | "uint8x4" | "unorm10-10-10-2" | "unorm16" | "unorm16x2" | "unorm16x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "unorm8x4-bgra";
13298
+ type GPUVertexStepMode = "instance" | "vertex";
13171
13299
  type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
13172
13300
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
13173
13301
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
package/ts5.6/index.d.ts CHANGED
@@ -282,6 +282,17 @@ interface GPUBindGroupEntry {
282
282
  resource: GPUBindingResource;
283
283
  }
284
284
 
285
+ interface GPUBlendComponent {
286
+ dstFactor?: GPUBlendFactor;
287
+ operation?: GPUBlendOperation;
288
+ srcFactor?: GPUBlendFactor;
289
+ }
290
+
291
+ interface GPUBlendState {
292
+ alpha: GPUBlendComponent;
293
+ color: GPUBlendComponent;
294
+ }
295
+
285
296
  interface GPUBufferBinding {
286
297
  buffer: GPUBuffer;
287
298
  offset?: GPUSize64;
@@ -315,6 +326,12 @@ interface GPUColorDict {
315
326
  r: number;
316
327
  }
317
328
 
329
+ interface GPUColorTargetState {
330
+ blend?: GPUBlendState;
331
+ format: GPUTextureFormat;
332
+ writeMask?: GPUColorWriteFlags;
333
+ }
334
+
318
335
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
319
336
  }
320
337
 
@@ -346,6 +363,19 @@ interface GPUCopyExternalImageSourceInfo {
346
363
  source: GPUCopyExternalImageSource;
347
364
  }
348
365
 
366
+ interface GPUDepthStencilState {
367
+ depthBias?: GPUDepthBias;
368
+ depthBiasClamp?: number;
369
+ depthBiasSlopeScale?: number;
370
+ depthCompare?: GPUCompareFunction;
371
+ depthWriteEnabled?: boolean;
372
+ format: GPUTextureFormat;
373
+ stencilBack?: GPUStencilFaceState;
374
+ stencilFront?: GPUStencilFaceState;
375
+ stencilReadMask?: GPUStencilValue;
376
+ stencilWriteMask?: GPUStencilValue;
377
+ }
378
+
349
379
  interface GPUExtent3DDict {
350
380
  depthOrArrayLayers?: GPUIntegerCoordinate;
351
381
  height?: GPUIntegerCoordinate;
@@ -356,6 +386,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
356
386
  colorSpace?: PredefinedColorSpace;
357
387
  }
358
388
 
389
+ interface GPUFragmentState extends GPUProgrammableStage {
390
+ targets: (GPUColorTargetState | null)[];
391
+ }
392
+
393
+ interface GPUMultisampleState {
394
+ alphaToCoverageEnabled?: boolean;
395
+ count?: GPUSize32;
396
+ mask?: GPUSampleMask;
397
+ }
398
+
359
399
  interface GPUObjectDescriptorBase {
360
400
  label?: string;
361
401
  }
@@ -383,6 +423,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
383
423
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
384
424
  }
385
425
 
426
+ interface GPUPrimitiveState {
427
+ cullMode?: GPUCullMode;
428
+ frontFace?: GPUFrontFace;
429
+ stripIndexFormat?: GPUIndexFormat;
430
+ topology?: GPUPrimitiveTopology;
431
+ unclippedDepth?: boolean;
432
+ }
433
+
386
434
  interface GPUProgrammableStage {
387
435
  constants?: Record<string, GPUPipelineConstantValue>;
388
436
  entryPoint?: string;
@@ -443,6 +491,14 @@ interface GPURenderPassTimestampWrites {
443
491
  querySet: GPUQuerySet;
444
492
  }
445
493
 
494
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
495
+ depthStencil?: GPUDepthStencilState;
496
+ fragment?: GPUFragmentState;
497
+ multisample?: GPUMultisampleState;
498
+ primitive?: GPUPrimitiveState;
499
+ vertex: GPUVertexState;
500
+ }
501
+
446
502
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
447
503
  addressModeU?: GPUAddressMode;
448
504
  addressModeV?: GPUAddressMode;
@@ -456,6 +512,17 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
456
512
  mipmapFilter?: GPUMipmapFilterMode;
457
513
  }
458
514
 
515
+ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
516
+ code: string;
517
+ }
518
+
519
+ interface GPUStencilFaceState {
520
+ compare?: GPUCompareFunction;
521
+ depthFailOp?: GPUStencilOperation;
522
+ failOp?: GPUStencilOperation;
523
+ passOp?: GPUStencilOperation;
524
+ }
525
+
459
526
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
460
527
  buffer: GPUBuffer;
461
528
  }
@@ -473,6 +540,16 @@ interface GPUTexelCopyTextureInfo {
473
540
  texture: GPUTexture;
474
541
  }
475
542
 
543
+ interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
544
+ dimension?: GPUTextureDimension;
545
+ format: GPUTextureFormat;
546
+ mipLevelCount?: GPUIntegerCoordinate;
547
+ sampleCount?: GPUSize32;
548
+ size: GPUExtent3D;
549
+ usage: GPUTextureUsageFlags;
550
+ viewFormats?: GPUTextureFormat[];
551
+ }
552
+
476
553
  interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
477
554
  arrayLayerCount?: GPUIntegerCoordinate;
478
555
  aspect?: GPUTextureAspect;
@@ -488,6 +565,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
488
565
  error: GPUError;
489
566
  }
490
567
 
568
+ interface GPUVertexAttribute {
569
+ format: GPUVertexFormat;
570
+ offset: GPUSize64;
571
+ shaderLocation: GPUIndex32;
572
+ }
573
+
574
+ interface GPUVertexBufferLayout {
575
+ arrayStride: GPUSize64;
576
+ attributes: GPUVertexAttribute[];
577
+ stepMode?: GPUVertexStepMode;
578
+ }
579
+
580
+ interface GPUVertexState extends GPUProgrammableStage {
581
+ buffers?: (GPUVertexBufferLayout | null)[];
582
+ }
583
+
491
584
  interface GetNotificationOptions {
492
585
  tag?: string;
493
586
  }
@@ -4885,12 +4978,36 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
4885
4978
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
4886
4979
  */
4887
4980
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
4981
+ /**
4982
+ * 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.
4983
+ *
4984
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
4985
+ */
4986
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
4987
+ /**
4988
+ * 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.
4989
+ *
4990
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
4991
+ */
4992
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
4888
4993
  /**
4889
4994
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
4890
4995
  *
4891
4996
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
4892
4997
  */
4893
4998
  createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
4999
+ /**
5000
+ * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
5001
+ *
5002
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
5003
+ */
5004
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
5005
+ /**
5006
+ * 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.
5007
+ *
5008
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
5009
+ */
5010
+ createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
4894
5011
  /**
4895
5012
  * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
4896
5013
  *
@@ -13083,7 +13200,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
13083
13200
  type GPUBufferDynamicOffset = number;
13084
13201
  type GPUBufferUsageFlags = number;
13085
13202
  type GPUColor = number[] | GPUColorDict;
13203
+ type GPUColorWriteFlags = number;
13086
13204
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
13205
+ type GPUDepthBias = number;
13087
13206
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
13088
13207
  type GPUFlagsConstant = number;
13089
13208
  type GPUIndex32 = number;
@@ -13093,6 +13212,7 @@ type GPUMapModeFlags = number;
13093
13212
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
13094
13213
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
13095
13214
  type GPUPipelineConstantValue = number;
13215
+ type GPUSampleMask = number;
13096
13216
  type GPUSignedOffset32 = number;
13097
13217
  type GPUSize32 = number;
13098
13218
  type GPUSize32Out = number;
@@ -13150,24 +13270,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
13150
13270
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
13151
13271
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
13152
13272
  type GPUAutoLayoutMode = "auto";
13273
+ type GPUBlendFactor = "constant" | "dst" | "dst-alpha" | "one" | "one-minus-constant" | "one-minus-dst" | "one-minus-dst-alpha" | "one-minus-src" | "one-minus-src-alpha" | "src" | "src-alpha" | "src-alpha-saturated" | "zero";
13274
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
13153
13275
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
13154
13276
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
13155
13277
  type GPUCanvasToneMappingMode = "extended" | "standard";
13156
13278
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
13157
13279
  type GPUCompilationMessageType = "error" | "info" | "warning";
13280
+ type GPUCullMode = "back" | "front" | "none";
13158
13281
  type GPUDeviceLostReason = "destroyed" | "unknown";
13159
13282
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
13160
13283
  type GPUFilterMode = "linear" | "nearest";
13284
+ type GPUFrontFace = "ccw" | "cw";
13161
13285
  type GPUIndexFormat = "uint16" | "uint32";
13162
13286
  type GPULoadOp = "clear" | "load";
13163
13287
  type GPUMipmapFilterMode = "linear" | "nearest";
13164
13288
  type GPUPipelineErrorReason = "internal" | "validation";
13289
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
13165
13290
  type GPUQueryType = "occlusion" | "timestamp";
13291
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
13166
13292
  type GPUStoreOp = "discard" | "store";
13167
13293
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
13168
13294
  type GPUTextureDimension = "1d" | "2d" | "3d";
13169
13295
  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";
13170
13296
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
13297
+ type GPUVertexFormat = "float16" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "sint16" | "sint16x2" | "sint16x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "sint8" | "sint8x2" | "sint8x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "uint8" | "uint8x2" | "uint8x4" | "unorm10-10-10-2" | "unorm16" | "unorm16x2" | "unorm16x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "unorm8x4-bgra";
13298
+ type GPUVertexStepMode = "instance" | "vertex";
13171
13299
  type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
13172
13300
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
13173
13301
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
package/ts5.9/index.d.ts CHANGED
@@ -282,6 +282,17 @@ interface GPUBindGroupEntry {
282
282
  resource: GPUBindingResource;
283
283
  }
284
284
 
285
+ interface GPUBlendComponent {
286
+ dstFactor?: GPUBlendFactor;
287
+ operation?: GPUBlendOperation;
288
+ srcFactor?: GPUBlendFactor;
289
+ }
290
+
291
+ interface GPUBlendState {
292
+ alpha: GPUBlendComponent;
293
+ color: GPUBlendComponent;
294
+ }
295
+
285
296
  interface GPUBufferBinding {
286
297
  buffer: GPUBuffer;
287
298
  offset?: GPUSize64;
@@ -315,6 +326,12 @@ interface GPUColorDict {
315
326
  r: number;
316
327
  }
317
328
 
329
+ interface GPUColorTargetState {
330
+ blend?: GPUBlendState;
331
+ format: GPUTextureFormat;
332
+ writeMask?: GPUColorWriteFlags;
333
+ }
334
+
318
335
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
319
336
  }
320
337
 
@@ -346,6 +363,19 @@ interface GPUCopyExternalImageSourceInfo {
346
363
  source: GPUCopyExternalImageSource;
347
364
  }
348
365
 
366
+ interface GPUDepthStencilState {
367
+ depthBias?: GPUDepthBias;
368
+ depthBiasClamp?: number;
369
+ depthBiasSlopeScale?: number;
370
+ depthCompare?: GPUCompareFunction;
371
+ depthWriteEnabled?: boolean;
372
+ format: GPUTextureFormat;
373
+ stencilBack?: GPUStencilFaceState;
374
+ stencilFront?: GPUStencilFaceState;
375
+ stencilReadMask?: GPUStencilValue;
376
+ stencilWriteMask?: GPUStencilValue;
377
+ }
378
+
349
379
  interface GPUExtent3DDict {
350
380
  depthOrArrayLayers?: GPUIntegerCoordinate;
351
381
  height?: GPUIntegerCoordinate;
@@ -356,6 +386,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
356
386
  colorSpace?: PredefinedColorSpace;
357
387
  }
358
388
 
389
+ interface GPUFragmentState extends GPUProgrammableStage {
390
+ targets: (GPUColorTargetState | null)[];
391
+ }
392
+
393
+ interface GPUMultisampleState {
394
+ alphaToCoverageEnabled?: boolean;
395
+ count?: GPUSize32;
396
+ mask?: GPUSampleMask;
397
+ }
398
+
359
399
  interface GPUObjectDescriptorBase {
360
400
  label?: string;
361
401
  }
@@ -383,6 +423,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
383
423
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
384
424
  }
385
425
 
426
+ interface GPUPrimitiveState {
427
+ cullMode?: GPUCullMode;
428
+ frontFace?: GPUFrontFace;
429
+ stripIndexFormat?: GPUIndexFormat;
430
+ topology?: GPUPrimitiveTopology;
431
+ unclippedDepth?: boolean;
432
+ }
433
+
386
434
  interface GPUProgrammableStage {
387
435
  constants?: Record<string, GPUPipelineConstantValue>;
388
436
  entryPoint?: string;
@@ -443,6 +491,14 @@ interface GPURenderPassTimestampWrites {
443
491
  querySet: GPUQuerySet;
444
492
  }
445
493
 
494
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
495
+ depthStencil?: GPUDepthStencilState;
496
+ fragment?: GPUFragmentState;
497
+ multisample?: GPUMultisampleState;
498
+ primitive?: GPUPrimitiveState;
499
+ vertex: GPUVertexState;
500
+ }
501
+
446
502
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
447
503
  addressModeU?: GPUAddressMode;
448
504
  addressModeV?: GPUAddressMode;
@@ -456,6 +512,17 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
456
512
  mipmapFilter?: GPUMipmapFilterMode;
457
513
  }
458
514
 
515
+ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
516
+ code: string;
517
+ }
518
+
519
+ interface GPUStencilFaceState {
520
+ compare?: GPUCompareFunction;
521
+ depthFailOp?: GPUStencilOperation;
522
+ failOp?: GPUStencilOperation;
523
+ passOp?: GPUStencilOperation;
524
+ }
525
+
459
526
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
460
527
  buffer: GPUBuffer;
461
528
  }
@@ -473,6 +540,16 @@ interface GPUTexelCopyTextureInfo {
473
540
  texture: GPUTexture;
474
541
  }
475
542
 
543
+ interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
544
+ dimension?: GPUTextureDimension;
545
+ format: GPUTextureFormat;
546
+ mipLevelCount?: GPUIntegerCoordinate;
547
+ sampleCount?: GPUSize32;
548
+ size: GPUExtent3D;
549
+ usage: GPUTextureUsageFlags;
550
+ viewFormats?: GPUTextureFormat[];
551
+ }
552
+
476
553
  interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
477
554
  arrayLayerCount?: GPUIntegerCoordinate;
478
555
  aspect?: GPUTextureAspect;
@@ -488,6 +565,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
488
565
  error: GPUError;
489
566
  }
490
567
 
568
+ interface GPUVertexAttribute {
569
+ format: GPUVertexFormat;
570
+ offset: GPUSize64;
571
+ shaderLocation: GPUIndex32;
572
+ }
573
+
574
+ interface GPUVertexBufferLayout {
575
+ arrayStride: GPUSize64;
576
+ attributes: GPUVertexAttribute[];
577
+ stepMode?: GPUVertexStepMode;
578
+ }
579
+
580
+ interface GPUVertexState extends GPUProgrammableStage {
581
+ buffers?: (GPUVertexBufferLayout | null)[];
582
+ }
583
+
491
584
  interface GetNotificationOptions {
492
585
  tag?: string;
493
586
  }
@@ -4885,12 +4978,36 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
4885
4978
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
4886
4979
  */
4887
4980
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
4981
+ /**
4982
+ * 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.
4983
+ *
4984
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
4985
+ */
4986
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
4987
+ /**
4988
+ * 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.
4989
+ *
4990
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
4991
+ */
4992
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
4888
4993
  /**
4889
4994
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
4890
4995
  *
4891
4996
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
4892
4997
  */
4893
4998
  createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
4999
+ /**
5000
+ * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
5001
+ *
5002
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
5003
+ */
5004
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
5005
+ /**
5006
+ * 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.
5007
+ *
5008
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
5009
+ */
5010
+ createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
4894
5011
  /**
4895
5012
  * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
4896
5013
  *
@@ -13083,7 +13200,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
13083
13200
  type GPUBufferDynamicOffset = number;
13084
13201
  type GPUBufferUsageFlags = number;
13085
13202
  type GPUColor = number[] | GPUColorDict;
13203
+ type GPUColorWriteFlags = number;
13086
13204
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
13205
+ type GPUDepthBias = number;
13087
13206
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
13088
13207
  type GPUFlagsConstant = number;
13089
13208
  type GPUIndex32 = number;
@@ -13093,6 +13212,7 @@ type GPUMapModeFlags = number;
13093
13212
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
13094
13213
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
13095
13214
  type GPUPipelineConstantValue = number;
13215
+ type GPUSampleMask = number;
13096
13216
  type GPUSignedOffset32 = number;
13097
13217
  type GPUSize32 = number;
13098
13218
  type GPUSize32Out = number;
@@ -13150,24 +13270,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
13150
13270
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
13151
13271
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
13152
13272
  type GPUAutoLayoutMode = "auto";
13273
+ type GPUBlendFactor = "constant" | "dst" | "dst-alpha" | "one" | "one-minus-constant" | "one-minus-dst" | "one-minus-dst-alpha" | "one-minus-src" | "one-minus-src-alpha" | "src" | "src-alpha" | "src-alpha-saturated" | "zero";
13274
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
13153
13275
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
13154
13276
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
13155
13277
  type GPUCanvasToneMappingMode = "extended" | "standard";
13156
13278
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
13157
13279
  type GPUCompilationMessageType = "error" | "info" | "warning";
13280
+ type GPUCullMode = "back" | "front" | "none";
13158
13281
  type GPUDeviceLostReason = "destroyed" | "unknown";
13159
13282
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
13160
13283
  type GPUFilterMode = "linear" | "nearest";
13284
+ type GPUFrontFace = "ccw" | "cw";
13161
13285
  type GPUIndexFormat = "uint16" | "uint32";
13162
13286
  type GPULoadOp = "clear" | "load";
13163
13287
  type GPUMipmapFilterMode = "linear" | "nearest";
13164
13288
  type GPUPipelineErrorReason = "internal" | "validation";
13289
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
13165
13290
  type GPUQueryType = "occlusion" | "timestamp";
13291
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
13166
13292
  type GPUStoreOp = "discard" | "store";
13167
13293
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
13168
13294
  type GPUTextureDimension = "1d" | "2d" | "3d";
13169
13295
  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";
13170
13296
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
13297
+ type GPUVertexFormat = "float16" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "sint16" | "sint16x2" | "sint16x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "sint8" | "sint8x2" | "sint8x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "uint8" | "uint8x2" | "uint8x4" | "unorm10-10-10-2" | "unorm16" | "unorm16x2" | "unorm16x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "unorm8x4-bgra";
13298
+ type GPUVertexStepMode = "instance" | "vertex";
13171
13299
  type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
13172
13300
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
13173
13301
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";