@types/web 0.0.333 → 0.0.335

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
@@ -47,4 +47,4 @@ Prior to `@types/web` the web APIs were deployed with a version of TypeScript, a
47
47
 
48
48
  ## Deploy Metadata
49
49
 
50
- You can read what changed in version 0.0.333 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fweb%400.0.333.
50
+ You can read what changed in version 0.0.335 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fweb%400.0.335.
package/index.d.ts CHANGED
@@ -818,6 +818,17 @@ interface GPUBindGroupEntry {
818
818
  resource: GPUBindingResource;
819
819
  }
820
820
 
821
+ interface GPUBlendComponent {
822
+ dstFactor?: GPUBlendFactor;
823
+ operation?: GPUBlendOperation;
824
+ srcFactor?: GPUBlendFactor;
825
+ }
826
+
827
+ interface GPUBlendState {
828
+ alpha: GPUBlendComponent;
829
+ color: GPUBlendComponent;
830
+ }
831
+
821
832
  interface GPUBufferBinding {
822
833
  buffer: GPUBuffer;
823
834
  offset?: GPUSize64;
@@ -851,6 +862,12 @@ interface GPUColorDict {
851
862
  r: number;
852
863
  }
853
864
 
865
+ interface GPUColorTargetState {
866
+ blend?: GPUBlendState;
867
+ format: GPUTextureFormat;
868
+ writeMask?: GPUColorWriteFlags;
869
+ }
870
+
854
871
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
855
872
  }
856
873
 
@@ -882,6 +899,19 @@ interface GPUCopyExternalImageSourceInfo {
882
899
  source: GPUCopyExternalImageSource;
883
900
  }
884
901
 
902
+ interface GPUDepthStencilState {
903
+ depthBias?: GPUDepthBias;
904
+ depthBiasClamp?: number;
905
+ depthBiasSlopeScale?: number;
906
+ depthCompare?: GPUCompareFunction;
907
+ depthWriteEnabled?: boolean;
908
+ format: GPUTextureFormat;
909
+ stencilBack?: GPUStencilFaceState;
910
+ stencilFront?: GPUStencilFaceState;
911
+ stencilReadMask?: GPUStencilValue;
912
+ stencilWriteMask?: GPUStencilValue;
913
+ }
914
+
885
915
  interface GPUExtent3DDict {
886
916
  depthOrArrayLayers?: GPUIntegerCoordinate;
887
917
  height?: GPUIntegerCoordinate;
@@ -893,6 +923,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
893
923
  source: HTMLVideoElement | VideoFrame;
894
924
  }
895
925
 
926
+ interface GPUFragmentState extends GPUProgrammableStage {
927
+ targets: (GPUColorTargetState | null)[];
928
+ }
929
+
930
+ interface GPUMultisampleState {
931
+ alphaToCoverageEnabled?: boolean;
932
+ count?: GPUSize32;
933
+ mask?: GPUSampleMask;
934
+ }
935
+
896
936
  interface GPUObjectDescriptorBase {
897
937
  label?: string;
898
938
  }
@@ -920,6 +960,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
920
960
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
921
961
  }
922
962
 
963
+ interface GPUPrimitiveState {
964
+ cullMode?: GPUCullMode;
965
+ frontFace?: GPUFrontFace;
966
+ stripIndexFormat?: GPUIndexFormat;
967
+ topology?: GPUPrimitiveTopology;
968
+ unclippedDepth?: boolean;
969
+ }
970
+
923
971
  interface GPUProgrammableStage {
924
972
  constants?: Record<string, GPUPipelineConstantValue>;
925
973
  entryPoint?: string;
@@ -980,6 +1028,14 @@ interface GPURenderPassTimestampWrites {
980
1028
  querySet: GPUQuerySet;
981
1029
  }
982
1030
 
1031
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
1032
+ depthStencil?: GPUDepthStencilState;
1033
+ fragment?: GPUFragmentState;
1034
+ multisample?: GPUMultisampleState;
1035
+ primitive?: GPUPrimitiveState;
1036
+ vertex: GPUVertexState;
1037
+ }
1038
+
983
1039
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
984
1040
  addressModeU?: GPUAddressMode;
985
1041
  addressModeV?: GPUAddressMode;
@@ -993,6 +1049,17 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
993
1049
  mipmapFilter?: GPUMipmapFilterMode;
994
1050
  }
995
1051
 
1052
+ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
1053
+ code: string;
1054
+ }
1055
+
1056
+ interface GPUStencilFaceState {
1057
+ compare?: GPUCompareFunction;
1058
+ depthFailOp?: GPUStencilOperation;
1059
+ failOp?: GPUStencilOperation;
1060
+ passOp?: GPUStencilOperation;
1061
+ }
1062
+
996
1063
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
997
1064
  buffer: GPUBuffer;
998
1065
  }
@@ -1010,6 +1077,16 @@ interface GPUTexelCopyTextureInfo {
1010
1077
  texture: GPUTexture;
1011
1078
  }
1012
1079
 
1080
+ interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
1081
+ dimension?: GPUTextureDimension;
1082
+ format: GPUTextureFormat;
1083
+ mipLevelCount?: GPUIntegerCoordinate;
1084
+ sampleCount?: GPUSize32;
1085
+ size: GPUExtent3D;
1086
+ usage: GPUTextureUsageFlags;
1087
+ viewFormats?: GPUTextureFormat[];
1088
+ }
1089
+
1013
1090
  interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
1014
1091
  arrayLayerCount?: GPUIntegerCoordinate;
1015
1092
  aspect?: GPUTextureAspect;
@@ -1025,6 +1102,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
1025
1102
  error: GPUError;
1026
1103
  }
1027
1104
 
1105
+ interface GPUVertexAttribute {
1106
+ format: GPUVertexFormat;
1107
+ offset: GPUSize64;
1108
+ shaderLocation: GPUIndex32;
1109
+ }
1110
+
1111
+ interface GPUVertexBufferLayout {
1112
+ arrayStride: GPUSize64;
1113
+ attributes: GPUVertexAttribute[];
1114
+ stepMode?: GPUVertexStepMode;
1115
+ }
1116
+
1117
+ interface GPUVertexState extends GPUProgrammableStage {
1118
+ buffers?: (GPUVertexBufferLayout | null)[];
1119
+ }
1120
+
1028
1121
  interface GainOptions extends AudioNodeOptions {
1029
1122
  gain?: number;
1030
1123
  }
@@ -15446,12 +15539,36 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
15446
15539
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
15447
15540
  */
15448
15541
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
15542
+ /**
15543
+ * 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.
15544
+ *
15545
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
15546
+ */
15547
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
15548
+ /**
15549
+ * 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.
15550
+ *
15551
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
15552
+ */
15553
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
15449
15554
  /**
15450
15555
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
15451
15556
  *
15452
15557
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
15453
15558
  */
15454
15559
  createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
15560
+ /**
15561
+ * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
15562
+ *
15563
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
15564
+ */
15565
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
15566
+ /**
15567
+ * 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.
15568
+ *
15569
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
15570
+ */
15571
+ createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
15455
15572
  /**
15456
15573
  * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
15457
15574
  *
@@ -43896,7 +44013,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
43896
44013
  type GPUBufferDynamicOffset = number;
43897
44014
  type GPUBufferUsageFlags = number;
43898
44015
  type GPUColor = number[] | GPUColorDict;
44016
+ type GPUColorWriteFlags = number;
43899
44017
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas;
44018
+ type GPUDepthBias = number;
43900
44019
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
43901
44020
  type GPUFlagsConstant = number;
43902
44021
  type GPUIndex32 = number;
@@ -43906,6 +44025,7 @@ type GPUMapModeFlags = number;
43906
44025
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
43907
44026
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
43908
44027
  type GPUPipelineConstantValue = number;
44028
+ type GPUSampleMask = number;
43909
44029
  type GPUSignedOffset32 = number;
43910
44030
  type GPUSize32 = number;
43911
44031
  type GPUSize32Out = number;
@@ -44021,24 +44141,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
44021
44141
  type FullscreenNavigationUI = "auto" | "hide" | "show";
44022
44142
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
44023
44143
  type GPUAutoLayoutMode = "auto";
44144
+ 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";
44145
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
44024
44146
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
44025
44147
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
44026
44148
  type GPUCanvasToneMappingMode = "extended" | "standard";
44027
44149
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
44028
44150
  type GPUCompilationMessageType = "error" | "info" | "warning";
44151
+ type GPUCullMode = "back" | "front" | "none";
44029
44152
  type GPUDeviceLostReason = "destroyed" | "unknown";
44030
44153
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
44031
44154
  type GPUFilterMode = "linear" | "nearest";
44155
+ type GPUFrontFace = "ccw" | "cw";
44032
44156
  type GPUIndexFormat = "uint16" | "uint32";
44033
44157
  type GPULoadOp = "clear" | "load";
44034
44158
  type GPUMipmapFilterMode = "linear" | "nearest";
44035
44159
  type GPUPipelineErrorReason = "internal" | "validation";
44160
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
44036
44161
  type GPUQueryType = "occlusion" | "timestamp";
44162
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
44037
44163
  type GPUStoreOp = "discard" | "store";
44038
44164
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
44039
44165
  type GPUTextureDimension = "1d" | "2d" | "3d";
44040
44166
  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";
44041
44167
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
44168
+ 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";
44169
+ type GPUVertexStepMode = "instance" | "vertex";
44042
44170
  type GamepadHapticEffectType = "dual-rumble" | "trigger-rumble";
44043
44171
  type GamepadHapticsResult = "complete" | "preempted";
44044
44172
  type GamepadMappingType = "" | "standard" | "xr-standard";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/web",
3
- "version": "0.0.333",
3
+ "version": "0.0.335",
4
4
  "description": "Types for the DOM, and other web technologies in browsers",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [],
package/ts5.5/index.d.ts CHANGED
@@ -815,6 +815,17 @@ interface GPUBindGroupEntry {
815
815
  resource: GPUBindingResource;
816
816
  }
817
817
 
818
+ interface GPUBlendComponent {
819
+ dstFactor?: GPUBlendFactor;
820
+ operation?: GPUBlendOperation;
821
+ srcFactor?: GPUBlendFactor;
822
+ }
823
+
824
+ interface GPUBlendState {
825
+ alpha: GPUBlendComponent;
826
+ color: GPUBlendComponent;
827
+ }
828
+
818
829
  interface GPUBufferBinding {
819
830
  buffer: GPUBuffer;
820
831
  offset?: GPUSize64;
@@ -848,6 +859,12 @@ interface GPUColorDict {
848
859
  r: number;
849
860
  }
850
861
 
862
+ interface GPUColorTargetState {
863
+ blend?: GPUBlendState;
864
+ format: GPUTextureFormat;
865
+ writeMask?: GPUColorWriteFlags;
866
+ }
867
+
851
868
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
852
869
  }
853
870
 
@@ -879,6 +896,19 @@ interface GPUCopyExternalImageSourceInfo {
879
896
  source: GPUCopyExternalImageSource;
880
897
  }
881
898
 
899
+ interface GPUDepthStencilState {
900
+ depthBias?: GPUDepthBias;
901
+ depthBiasClamp?: number;
902
+ depthBiasSlopeScale?: number;
903
+ depthCompare?: GPUCompareFunction;
904
+ depthWriteEnabled?: boolean;
905
+ format: GPUTextureFormat;
906
+ stencilBack?: GPUStencilFaceState;
907
+ stencilFront?: GPUStencilFaceState;
908
+ stencilReadMask?: GPUStencilValue;
909
+ stencilWriteMask?: GPUStencilValue;
910
+ }
911
+
882
912
  interface GPUExtent3DDict {
883
913
  depthOrArrayLayers?: GPUIntegerCoordinate;
884
914
  height?: GPUIntegerCoordinate;
@@ -890,6 +920,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
890
920
  source: HTMLVideoElement | VideoFrame;
891
921
  }
892
922
 
923
+ interface GPUFragmentState extends GPUProgrammableStage {
924
+ targets: (GPUColorTargetState | null)[];
925
+ }
926
+
927
+ interface GPUMultisampleState {
928
+ alphaToCoverageEnabled?: boolean;
929
+ count?: GPUSize32;
930
+ mask?: GPUSampleMask;
931
+ }
932
+
893
933
  interface GPUObjectDescriptorBase {
894
934
  label?: string;
895
935
  }
@@ -917,6 +957,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
917
957
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
918
958
  }
919
959
 
960
+ interface GPUPrimitiveState {
961
+ cullMode?: GPUCullMode;
962
+ frontFace?: GPUFrontFace;
963
+ stripIndexFormat?: GPUIndexFormat;
964
+ topology?: GPUPrimitiveTopology;
965
+ unclippedDepth?: boolean;
966
+ }
967
+
920
968
  interface GPUProgrammableStage {
921
969
  constants?: Record<string, GPUPipelineConstantValue>;
922
970
  entryPoint?: string;
@@ -977,6 +1025,14 @@ interface GPURenderPassTimestampWrites {
977
1025
  querySet: GPUQuerySet;
978
1026
  }
979
1027
 
1028
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
1029
+ depthStencil?: GPUDepthStencilState;
1030
+ fragment?: GPUFragmentState;
1031
+ multisample?: GPUMultisampleState;
1032
+ primitive?: GPUPrimitiveState;
1033
+ vertex: GPUVertexState;
1034
+ }
1035
+
980
1036
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
981
1037
  addressModeU?: GPUAddressMode;
982
1038
  addressModeV?: GPUAddressMode;
@@ -990,6 +1046,17 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
990
1046
  mipmapFilter?: GPUMipmapFilterMode;
991
1047
  }
992
1048
 
1049
+ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
1050
+ code: string;
1051
+ }
1052
+
1053
+ interface GPUStencilFaceState {
1054
+ compare?: GPUCompareFunction;
1055
+ depthFailOp?: GPUStencilOperation;
1056
+ failOp?: GPUStencilOperation;
1057
+ passOp?: GPUStencilOperation;
1058
+ }
1059
+
993
1060
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
994
1061
  buffer: GPUBuffer;
995
1062
  }
@@ -1007,6 +1074,16 @@ interface GPUTexelCopyTextureInfo {
1007
1074
  texture: GPUTexture;
1008
1075
  }
1009
1076
 
1077
+ interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
1078
+ dimension?: GPUTextureDimension;
1079
+ format: GPUTextureFormat;
1080
+ mipLevelCount?: GPUIntegerCoordinate;
1081
+ sampleCount?: GPUSize32;
1082
+ size: GPUExtent3D;
1083
+ usage: GPUTextureUsageFlags;
1084
+ viewFormats?: GPUTextureFormat[];
1085
+ }
1086
+
1010
1087
  interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
1011
1088
  arrayLayerCount?: GPUIntegerCoordinate;
1012
1089
  aspect?: GPUTextureAspect;
@@ -1022,6 +1099,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
1022
1099
  error: GPUError;
1023
1100
  }
1024
1101
 
1102
+ interface GPUVertexAttribute {
1103
+ format: GPUVertexFormat;
1104
+ offset: GPUSize64;
1105
+ shaderLocation: GPUIndex32;
1106
+ }
1107
+
1108
+ interface GPUVertexBufferLayout {
1109
+ arrayStride: GPUSize64;
1110
+ attributes: GPUVertexAttribute[];
1111
+ stepMode?: GPUVertexStepMode;
1112
+ }
1113
+
1114
+ interface GPUVertexState extends GPUProgrammableStage {
1115
+ buffers?: (GPUVertexBufferLayout | null)[];
1116
+ }
1117
+
1025
1118
  interface GainOptions extends AudioNodeOptions {
1026
1119
  gain?: number;
1027
1120
  }
@@ -15432,12 +15525,36 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
15432
15525
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
15433
15526
  */
15434
15527
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
15528
+ /**
15529
+ * 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.
15530
+ *
15531
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
15532
+ */
15533
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
15534
+ /**
15535
+ * 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.
15536
+ *
15537
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
15538
+ */
15539
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
15435
15540
  /**
15436
15541
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
15437
15542
  *
15438
15543
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
15439
15544
  */
15440
15545
  createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
15546
+ /**
15547
+ * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
15548
+ *
15549
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
15550
+ */
15551
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
15552
+ /**
15553
+ * 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.
15554
+ *
15555
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
15556
+ */
15557
+ createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
15441
15558
  /**
15442
15559
  * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
15443
15560
  *
@@ -43870,7 +43987,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
43870
43987
  type GPUBufferDynamicOffset = number;
43871
43988
  type GPUBufferUsageFlags = number;
43872
43989
  type GPUColor = number[] | GPUColorDict;
43990
+ type GPUColorWriteFlags = number;
43873
43991
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas;
43992
+ type GPUDepthBias = number;
43874
43993
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
43875
43994
  type GPUFlagsConstant = number;
43876
43995
  type GPUIndex32 = number;
@@ -43880,6 +43999,7 @@ type GPUMapModeFlags = number;
43880
43999
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
43881
44000
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
43882
44001
  type GPUPipelineConstantValue = number;
44002
+ type GPUSampleMask = number;
43883
44003
  type GPUSignedOffset32 = number;
43884
44004
  type GPUSize32 = number;
43885
44005
  type GPUSize32Out = number;
@@ -43995,24 +44115,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
43995
44115
  type FullscreenNavigationUI = "auto" | "hide" | "show";
43996
44116
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
43997
44117
  type GPUAutoLayoutMode = "auto";
44118
+ 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";
44119
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
43998
44120
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
43999
44121
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
44000
44122
  type GPUCanvasToneMappingMode = "extended" | "standard";
44001
44123
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
44002
44124
  type GPUCompilationMessageType = "error" | "info" | "warning";
44125
+ type GPUCullMode = "back" | "front" | "none";
44003
44126
  type GPUDeviceLostReason = "destroyed" | "unknown";
44004
44127
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
44005
44128
  type GPUFilterMode = "linear" | "nearest";
44129
+ type GPUFrontFace = "ccw" | "cw";
44006
44130
  type GPUIndexFormat = "uint16" | "uint32";
44007
44131
  type GPULoadOp = "clear" | "load";
44008
44132
  type GPUMipmapFilterMode = "linear" | "nearest";
44009
44133
  type GPUPipelineErrorReason = "internal" | "validation";
44134
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
44010
44135
  type GPUQueryType = "occlusion" | "timestamp";
44136
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
44011
44137
  type GPUStoreOp = "discard" | "store";
44012
44138
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
44013
44139
  type GPUTextureDimension = "1d" | "2d" | "3d";
44014
44140
  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";
44015
44141
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
44142
+ 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";
44143
+ type GPUVertexStepMode = "instance" | "vertex";
44016
44144
  type GamepadHapticEffectType = "dual-rumble" | "trigger-rumble";
44017
44145
  type GamepadHapticsResult = "complete" | "preempted";
44018
44146
  type GamepadMappingType = "" | "standard" | "xr-standard";
package/ts5.6/index.d.ts CHANGED
@@ -815,6 +815,17 @@ interface GPUBindGroupEntry {
815
815
  resource: GPUBindingResource;
816
816
  }
817
817
 
818
+ interface GPUBlendComponent {
819
+ dstFactor?: GPUBlendFactor;
820
+ operation?: GPUBlendOperation;
821
+ srcFactor?: GPUBlendFactor;
822
+ }
823
+
824
+ interface GPUBlendState {
825
+ alpha: GPUBlendComponent;
826
+ color: GPUBlendComponent;
827
+ }
828
+
818
829
  interface GPUBufferBinding {
819
830
  buffer: GPUBuffer;
820
831
  offset?: GPUSize64;
@@ -848,6 +859,12 @@ interface GPUColorDict {
848
859
  r: number;
849
860
  }
850
861
 
862
+ interface GPUColorTargetState {
863
+ blend?: GPUBlendState;
864
+ format: GPUTextureFormat;
865
+ writeMask?: GPUColorWriteFlags;
866
+ }
867
+
851
868
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
852
869
  }
853
870
 
@@ -879,6 +896,19 @@ interface GPUCopyExternalImageSourceInfo {
879
896
  source: GPUCopyExternalImageSource;
880
897
  }
881
898
 
899
+ interface GPUDepthStencilState {
900
+ depthBias?: GPUDepthBias;
901
+ depthBiasClamp?: number;
902
+ depthBiasSlopeScale?: number;
903
+ depthCompare?: GPUCompareFunction;
904
+ depthWriteEnabled?: boolean;
905
+ format: GPUTextureFormat;
906
+ stencilBack?: GPUStencilFaceState;
907
+ stencilFront?: GPUStencilFaceState;
908
+ stencilReadMask?: GPUStencilValue;
909
+ stencilWriteMask?: GPUStencilValue;
910
+ }
911
+
882
912
  interface GPUExtent3DDict {
883
913
  depthOrArrayLayers?: GPUIntegerCoordinate;
884
914
  height?: GPUIntegerCoordinate;
@@ -890,6 +920,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
890
920
  source: HTMLVideoElement | VideoFrame;
891
921
  }
892
922
 
923
+ interface GPUFragmentState extends GPUProgrammableStage {
924
+ targets: (GPUColorTargetState | null)[];
925
+ }
926
+
927
+ interface GPUMultisampleState {
928
+ alphaToCoverageEnabled?: boolean;
929
+ count?: GPUSize32;
930
+ mask?: GPUSampleMask;
931
+ }
932
+
893
933
  interface GPUObjectDescriptorBase {
894
934
  label?: string;
895
935
  }
@@ -917,6 +957,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
917
957
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
918
958
  }
919
959
 
960
+ interface GPUPrimitiveState {
961
+ cullMode?: GPUCullMode;
962
+ frontFace?: GPUFrontFace;
963
+ stripIndexFormat?: GPUIndexFormat;
964
+ topology?: GPUPrimitiveTopology;
965
+ unclippedDepth?: boolean;
966
+ }
967
+
920
968
  interface GPUProgrammableStage {
921
969
  constants?: Record<string, GPUPipelineConstantValue>;
922
970
  entryPoint?: string;
@@ -977,6 +1025,14 @@ interface GPURenderPassTimestampWrites {
977
1025
  querySet: GPUQuerySet;
978
1026
  }
979
1027
 
1028
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
1029
+ depthStencil?: GPUDepthStencilState;
1030
+ fragment?: GPUFragmentState;
1031
+ multisample?: GPUMultisampleState;
1032
+ primitive?: GPUPrimitiveState;
1033
+ vertex: GPUVertexState;
1034
+ }
1035
+
980
1036
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
981
1037
  addressModeU?: GPUAddressMode;
982
1038
  addressModeV?: GPUAddressMode;
@@ -990,6 +1046,17 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
990
1046
  mipmapFilter?: GPUMipmapFilterMode;
991
1047
  }
992
1048
 
1049
+ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
1050
+ code: string;
1051
+ }
1052
+
1053
+ interface GPUStencilFaceState {
1054
+ compare?: GPUCompareFunction;
1055
+ depthFailOp?: GPUStencilOperation;
1056
+ failOp?: GPUStencilOperation;
1057
+ passOp?: GPUStencilOperation;
1058
+ }
1059
+
993
1060
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
994
1061
  buffer: GPUBuffer;
995
1062
  }
@@ -1007,6 +1074,16 @@ interface GPUTexelCopyTextureInfo {
1007
1074
  texture: GPUTexture;
1008
1075
  }
1009
1076
 
1077
+ interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
1078
+ dimension?: GPUTextureDimension;
1079
+ format: GPUTextureFormat;
1080
+ mipLevelCount?: GPUIntegerCoordinate;
1081
+ sampleCount?: GPUSize32;
1082
+ size: GPUExtent3D;
1083
+ usage: GPUTextureUsageFlags;
1084
+ viewFormats?: GPUTextureFormat[];
1085
+ }
1086
+
1010
1087
  interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
1011
1088
  arrayLayerCount?: GPUIntegerCoordinate;
1012
1089
  aspect?: GPUTextureAspect;
@@ -1022,6 +1099,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
1022
1099
  error: GPUError;
1023
1100
  }
1024
1101
 
1102
+ interface GPUVertexAttribute {
1103
+ format: GPUVertexFormat;
1104
+ offset: GPUSize64;
1105
+ shaderLocation: GPUIndex32;
1106
+ }
1107
+
1108
+ interface GPUVertexBufferLayout {
1109
+ arrayStride: GPUSize64;
1110
+ attributes: GPUVertexAttribute[];
1111
+ stepMode?: GPUVertexStepMode;
1112
+ }
1113
+
1114
+ interface GPUVertexState extends GPUProgrammableStage {
1115
+ buffers?: (GPUVertexBufferLayout | null)[];
1116
+ }
1117
+
1025
1118
  interface GainOptions extends AudioNodeOptions {
1026
1119
  gain?: number;
1027
1120
  }
@@ -15443,12 +15536,36 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
15443
15536
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
15444
15537
  */
15445
15538
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
15539
+ /**
15540
+ * 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.
15541
+ *
15542
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
15543
+ */
15544
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
15545
+ /**
15546
+ * 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.
15547
+ *
15548
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
15549
+ */
15550
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
15446
15551
  /**
15447
15552
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
15448
15553
  *
15449
15554
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
15450
15555
  */
15451
15556
  createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
15557
+ /**
15558
+ * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
15559
+ *
15560
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
15561
+ */
15562
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
15563
+ /**
15564
+ * 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.
15565
+ *
15566
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
15567
+ */
15568
+ createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
15452
15569
  /**
15453
15570
  * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
15454
15571
  *
@@ -43893,7 +44010,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
43893
44010
  type GPUBufferDynamicOffset = number;
43894
44011
  type GPUBufferUsageFlags = number;
43895
44012
  type GPUColor = number[] | GPUColorDict;
44013
+ type GPUColorWriteFlags = number;
43896
44014
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas;
44015
+ type GPUDepthBias = number;
43897
44016
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
43898
44017
  type GPUFlagsConstant = number;
43899
44018
  type GPUIndex32 = number;
@@ -43903,6 +44022,7 @@ type GPUMapModeFlags = number;
43903
44022
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
43904
44023
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
43905
44024
  type GPUPipelineConstantValue = number;
44025
+ type GPUSampleMask = number;
43906
44026
  type GPUSignedOffset32 = number;
43907
44027
  type GPUSize32 = number;
43908
44028
  type GPUSize32Out = number;
@@ -44018,24 +44138,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
44018
44138
  type FullscreenNavigationUI = "auto" | "hide" | "show";
44019
44139
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
44020
44140
  type GPUAutoLayoutMode = "auto";
44141
+ 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";
44142
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
44021
44143
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
44022
44144
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
44023
44145
  type GPUCanvasToneMappingMode = "extended" | "standard";
44024
44146
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
44025
44147
  type GPUCompilationMessageType = "error" | "info" | "warning";
44148
+ type GPUCullMode = "back" | "front" | "none";
44026
44149
  type GPUDeviceLostReason = "destroyed" | "unknown";
44027
44150
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
44028
44151
  type GPUFilterMode = "linear" | "nearest";
44152
+ type GPUFrontFace = "ccw" | "cw";
44029
44153
  type GPUIndexFormat = "uint16" | "uint32";
44030
44154
  type GPULoadOp = "clear" | "load";
44031
44155
  type GPUMipmapFilterMode = "linear" | "nearest";
44032
44156
  type GPUPipelineErrorReason = "internal" | "validation";
44157
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
44033
44158
  type GPUQueryType = "occlusion" | "timestamp";
44159
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
44034
44160
  type GPUStoreOp = "discard" | "store";
44035
44161
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
44036
44162
  type GPUTextureDimension = "1d" | "2d" | "3d";
44037
44163
  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";
44038
44164
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
44165
+ 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";
44166
+ type GPUVertexStepMode = "instance" | "vertex";
44039
44167
  type GamepadHapticEffectType = "dual-rumble" | "trigger-rumble";
44040
44168
  type GamepadHapticsResult = "complete" | "preempted";
44041
44169
  type GamepadMappingType = "" | "standard" | "xr-standard";
package/ts5.9/index.d.ts CHANGED
@@ -815,6 +815,17 @@ interface GPUBindGroupEntry {
815
815
  resource: GPUBindingResource;
816
816
  }
817
817
 
818
+ interface GPUBlendComponent {
819
+ dstFactor?: GPUBlendFactor;
820
+ operation?: GPUBlendOperation;
821
+ srcFactor?: GPUBlendFactor;
822
+ }
823
+
824
+ interface GPUBlendState {
825
+ alpha: GPUBlendComponent;
826
+ color: GPUBlendComponent;
827
+ }
828
+
818
829
  interface GPUBufferBinding {
819
830
  buffer: GPUBuffer;
820
831
  offset?: GPUSize64;
@@ -848,6 +859,12 @@ interface GPUColorDict {
848
859
  r: number;
849
860
  }
850
861
 
862
+ interface GPUColorTargetState {
863
+ blend?: GPUBlendState;
864
+ format: GPUTextureFormat;
865
+ writeMask?: GPUColorWriteFlags;
866
+ }
867
+
851
868
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
852
869
  }
853
870
 
@@ -879,6 +896,19 @@ interface GPUCopyExternalImageSourceInfo {
879
896
  source: GPUCopyExternalImageSource;
880
897
  }
881
898
 
899
+ interface GPUDepthStencilState {
900
+ depthBias?: GPUDepthBias;
901
+ depthBiasClamp?: number;
902
+ depthBiasSlopeScale?: number;
903
+ depthCompare?: GPUCompareFunction;
904
+ depthWriteEnabled?: boolean;
905
+ format: GPUTextureFormat;
906
+ stencilBack?: GPUStencilFaceState;
907
+ stencilFront?: GPUStencilFaceState;
908
+ stencilReadMask?: GPUStencilValue;
909
+ stencilWriteMask?: GPUStencilValue;
910
+ }
911
+
882
912
  interface GPUExtent3DDict {
883
913
  depthOrArrayLayers?: GPUIntegerCoordinate;
884
914
  height?: GPUIntegerCoordinate;
@@ -890,6 +920,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
890
920
  source: HTMLVideoElement | VideoFrame;
891
921
  }
892
922
 
923
+ interface GPUFragmentState extends GPUProgrammableStage {
924
+ targets: (GPUColorTargetState | null)[];
925
+ }
926
+
927
+ interface GPUMultisampleState {
928
+ alphaToCoverageEnabled?: boolean;
929
+ count?: GPUSize32;
930
+ mask?: GPUSampleMask;
931
+ }
932
+
893
933
  interface GPUObjectDescriptorBase {
894
934
  label?: string;
895
935
  }
@@ -917,6 +957,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
917
957
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
918
958
  }
919
959
 
960
+ interface GPUPrimitiveState {
961
+ cullMode?: GPUCullMode;
962
+ frontFace?: GPUFrontFace;
963
+ stripIndexFormat?: GPUIndexFormat;
964
+ topology?: GPUPrimitiveTopology;
965
+ unclippedDepth?: boolean;
966
+ }
967
+
920
968
  interface GPUProgrammableStage {
921
969
  constants?: Record<string, GPUPipelineConstantValue>;
922
970
  entryPoint?: string;
@@ -977,6 +1025,14 @@ interface GPURenderPassTimestampWrites {
977
1025
  querySet: GPUQuerySet;
978
1026
  }
979
1027
 
1028
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
1029
+ depthStencil?: GPUDepthStencilState;
1030
+ fragment?: GPUFragmentState;
1031
+ multisample?: GPUMultisampleState;
1032
+ primitive?: GPUPrimitiveState;
1033
+ vertex: GPUVertexState;
1034
+ }
1035
+
980
1036
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
981
1037
  addressModeU?: GPUAddressMode;
982
1038
  addressModeV?: GPUAddressMode;
@@ -990,6 +1046,17 @@ interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
990
1046
  mipmapFilter?: GPUMipmapFilterMode;
991
1047
  }
992
1048
 
1049
+ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
1050
+ code: string;
1051
+ }
1052
+
1053
+ interface GPUStencilFaceState {
1054
+ compare?: GPUCompareFunction;
1055
+ depthFailOp?: GPUStencilOperation;
1056
+ failOp?: GPUStencilOperation;
1057
+ passOp?: GPUStencilOperation;
1058
+ }
1059
+
993
1060
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
994
1061
  buffer: GPUBuffer;
995
1062
  }
@@ -1007,6 +1074,16 @@ interface GPUTexelCopyTextureInfo {
1007
1074
  texture: GPUTexture;
1008
1075
  }
1009
1076
 
1077
+ interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
1078
+ dimension?: GPUTextureDimension;
1079
+ format: GPUTextureFormat;
1080
+ mipLevelCount?: GPUIntegerCoordinate;
1081
+ sampleCount?: GPUSize32;
1082
+ size: GPUExtent3D;
1083
+ usage: GPUTextureUsageFlags;
1084
+ viewFormats?: GPUTextureFormat[];
1085
+ }
1086
+
1010
1087
  interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
1011
1088
  arrayLayerCount?: GPUIntegerCoordinate;
1012
1089
  aspect?: GPUTextureAspect;
@@ -1022,6 +1099,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
1022
1099
  error: GPUError;
1023
1100
  }
1024
1101
 
1102
+ interface GPUVertexAttribute {
1103
+ format: GPUVertexFormat;
1104
+ offset: GPUSize64;
1105
+ shaderLocation: GPUIndex32;
1106
+ }
1107
+
1108
+ interface GPUVertexBufferLayout {
1109
+ arrayStride: GPUSize64;
1110
+ attributes: GPUVertexAttribute[];
1111
+ stepMode?: GPUVertexStepMode;
1112
+ }
1113
+
1114
+ interface GPUVertexState extends GPUProgrammableStage {
1115
+ buffers?: (GPUVertexBufferLayout | null)[];
1116
+ }
1117
+
1025
1118
  interface GainOptions extends AudioNodeOptions {
1026
1119
  gain?: number;
1027
1120
  }
@@ -15443,12 +15536,36 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
15443
15536
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
15444
15537
  */
15445
15538
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
15539
+ /**
15540
+ * 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.
15541
+ *
15542
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
15543
+ */
15544
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
15545
+ /**
15546
+ * 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.
15547
+ *
15548
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
15549
+ */
15550
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
15446
15551
  /**
15447
15552
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
15448
15553
  *
15449
15554
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createSampler)
15450
15555
  */
15451
15556
  createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
15557
+ /**
15558
+ * The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of WGSL source code.
15559
+ *
15560
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createShaderModule)
15561
+ */
15562
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
15563
+ /**
15564
+ * 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.
15565
+ *
15566
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createTexture)
15567
+ */
15568
+ createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
15452
15569
  /**
15453
15570
  * The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
15454
15571
  *
@@ -43893,7 +44010,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
43893
44010
  type GPUBufferDynamicOffset = number;
43894
44011
  type GPUBufferUsageFlags = number;
43895
44012
  type GPUColor = number[] | GPUColorDict;
44013
+ type GPUColorWriteFlags = number;
43896
44014
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas;
44015
+ type GPUDepthBias = number;
43897
44016
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
43898
44017
  type GPUFlagsConstant = number;
43899
44018
  type GPUIndex32 = number;
@@ -43903,6 +44022,7 @@ type GPUMapModeFlags = number;
43903
44022
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
43904
44023
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
43905
44024
  type GPUPipelineConstantValue = number;
44025
+ type GPUSampleMask = number;
43906
44026
  type GPUSignedOffset32 = number;
43907
44027
  type GPUSize32 = number;
43908
44028
  type GPUSize32Out = number;
@@ -44018,24 +44138,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
44018
44138
  type FullscreenNavigationUI = "auto" | "hide" | "show";
44019
44139
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
44020
44140
  type GPUAutoLayoutMode = "auto";
44141
+ 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";
44142
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
44021
44143
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
44022
44144
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
44023
44145
  type GPUCanvasToneMappingMode = "extended" | "standard";
44024
44146
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
44025
44147
  type GPUCompilationMessageType = "error" | "info" | "warning";
44148
+ type GPUCullMode = "back" | "front" | "none";
44026
44149
  type GPUDeviceLostReason = "destroyed" | "unknown";
44027
44150
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
44028
44151
  type GPUFilterMode = "linear" | "nearest";
44152
+ type GPUFrontFace = "ccw" | "cw";
44029
44153
  type GPUIndexFormat = "uint16" | "uint32";
44030
44154
  type GPULoadOp = "clear" | "load";
44031
44155
  type GPUMipmapFilterMode = "linear" | "nearest";
44032
44156
  type GPUPipelineErrorReason = "internal" | "validation";
44157
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
44033
44158
  type GPUQueryType = "occlusion" | "timestamp";
44159
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
44034
44160
  type GPUStoreOp = "discard" | "store";
44035
44161
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
44036
44162
  type GPUTextureDimension = "1d" | "2d" | "3d";
44037
44163
  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";
44038
44164
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
44165
+ 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";
44166
+ type GPUVertexStepMode = "instance" | "vertex";
44039
44167
  type GamepadHapticEffectType = "dual-rumble" | "trigger-rumble";
44040
44168
  type GamepadHapticsResult = "complete" | "preempted";
44041
44169
  type GamepadMappingType = "" | "standard" | "xr-standard";