summaryrefslogtreecommitdiff
path: root/cli/dts/lib.deno_webgpu.d.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2022-08-17 13:12:24 +1000
committerGitHub <noreply@github.com>2022-08-17 13:12:24 +1000
commita2ab5eee015b1dafc1a18cd2bc5f5c5756123d74 (patch)
tree1efd7d79208fee44cc05c71c18c7d9e6759ed8c3 /cli/dts/lib.deno_webgpu.d.ts
parent868c7e38bfc9a09b5cfeae30ea5a2345a6d700d7 (diff)
docs: add category tag for built-in APIs (#15480)
Diffstat (limited to 'cli/dts/lib.deno_webgpu.d.ts')
-rw-r--r--cli/dts/lib.deno_webgpu.d.ts135
1 files changed, 135 insertions, 0 deletions
diff --git a/cli/dts/lib.deno_webgpu.d.ts b/cli/dts/lib.deno_webgpu.d.ts
index 8d1c9919f..bf3185ca4 100644
--- a/cli/dts/lib.deno_webgpu.d.ts
+++ b/cli/dts/lib.deno_webgpu.d.ts
@@ -5,14 +5,17 @@
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
+/** @category WebGPU */
interface GPUObjectBase {
label: string;
}
+/** @category WebGPU */
declare interface GPUObjectDescriptorBase {
label?: string;
}
+/** @category WebGPU */
declare class GPUSupportedLimits {
maxTextureDimension1D?: number;
maxTextureDimension2D?: number;
@@ -42,6 +45,7 @@ declare class GPUSupportedLimits {
maxComputeWorkgroupsPerDimension?: number;
}
+/** @category WebGPU */
declare class GPUSupportedFeatures {
forEach(
callbackfn: (
@@ -62,6 +66,7 @@ declare class GPUSupportedFeatures {
values(): IterableIterator<GPUFeatureName>;
}
+/** @category WebGPU */
declare class GPUAdapterInfo {
readonly vendor: string;
readonly architecture: string;
@@ -69,6 +74,7 @@ declare class GPUAdapterInfo {
readonly description: string;
}
+/** @category WebGPU */
declare class GPU {
requestAdapter(
options?: GPURequestAdapterOptions,
@@ -80,8 +86,10 @@ declare interface GPURequestAdapterOptions {
forceFallbackAdapter?: boolean;
}
+/** @category WebGPU */
declare type GPUPowerPreference = "low-power" | "high-performance";
+/** @category WebGPU */
declare class GPUAdapter {
readonly features: GPUSupportedFeatures;
readonly limits: GPUSupportedLimits;
@@ -91,11 +99,13 @@ declare class GPUAdapter {
requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
}
+/** @category WebGPU */
declare interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
requiredFeatures?: GPUFeatureName[];
requiredLimits?: Record<string, number>;
}
+/** @category WebGPU */
declare type GPUFeatureName =
| "depth-clip-control"
| "depth24unorm-stencil8"
@@ -121,6 +131,7 @@ declare type GPUFeatureName =
| "shader-float64"
| "vertex-attribute-64bit";
+/** @category WebGPU */
declare class GPUDevice extends EventTarget implements GPUObjectBase {
label: string;
@@ -173,6 +184,7 @@ declare class GPUDevice extends EventTarget implements GPUObjectBase {
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
}
+/** @category WebGPU */
declare class GPUBuffer implements GPUObjectBase {
label: string;
@@ -187,13 +199,17 @@ declare class GPUBuffer implements GPUObjectBase {
destroy(): undefined;
}
+/** @category WebGPU */
declare interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
size: number;
usage: GPUBufferUsageFlags;
mappedAtCreation?: boolean;
}
+/** @category WebGPU */
declare type GPUBufferUsageFlags = number;
+
+/** @category WebGPU */
declare class GPUBufferUsage {
static MAP_READ: 0x0001;
static MAP_WRITE: 0x0002;
@@ -207,12 +223,16 @@ declare class GPUBufferUsage {
static QUERY_RESOLVE: 0x0200;
}
+/** @category WebGPU */
declare type GPUMapModeFlags = number;
+
+/** @category WebGPU */
declare class GPUMapMode {
static READ: 0x0001;
static WRITE: 0x0002;
}
+/** @category WebGPU */
declare class GPUTexture implements GPUObjectBase {
label: string;
@@ -220,6 +240,7 @@ declare class GPUTexture implements GPUObjectBase {
destroy(): undefined;
}
+/** @category WebGPU */
declare interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
size: GPUExtent3D;
mipLevelCount?: number;
@@ -229,9 +250,13 @@ declare interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
usage: GPUTextureUsageFlags;
}
+/** @category WebGPU */
declare type GPUTextureDimension = "1d" | "2d" | "3d";
+/** @category WebGPU */
declare type GPUTextureUsageFlags = number;
+
+/** @category WebGPU */
declare class GPUTextureUsage {
static COPY_SRC: 0x01;
static COPY_DST: 0x02;
@@ -240,10 +265,12 @@ declare class GPUTextureUsage {
static RENDER_ATTACHMENT: 0x10;
}
+/** @category WebGPU */
declare class GPUTextureView implements GPUObjectBase {
label: string;
}
+/** @category WebGPU */
declare interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
format?: GPUTextureFormat;
dimension?: GPUTextureViewDimension;
@@ -254,6 +281,7 @@ declare interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
arrayLayerCount?: number;
}
+/** @category WebGPU */
declare type GPUTextureViewDimension =
| "1d"
| "2d"
@@ -262,8 +290,10 @@ declare type GPUTextureViewDimension =
| "cube-array"
| "3d";
+/** @category WebGPU */
declare type GPUTextureAspect = "all" | "stencil-only" | "depth-only";
+/** @category WebGPU */
declare type GPUTextureFormat =
| "r8unorm"
| "r8snorm"
@@ -361,10 +391,12 @@ declare type GPUTextureFormat =
| "astc-12x12-unorm"
| "astc-12x12-unorm-srgb";
+/** @category WebGPU */
declare class GPUSampler implements GPUObjectBase {
label: string;
}
+/** @category WebGPU */
declare interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
addressModeU?: GPUAddressMode;
addressModeV?: GPUAddressMode;
@@ -378,12 +410,16 @@ declare interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
maxAnisotropy?: number;
}
+/** @category WebGPU */
declare type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat";
+/** @category WebGPU */
declare type GPUFilterMode = "nearest" | "linear";
+/** @category WebGPU */
declare type GPUMipmapFilterMode = "nearest" | "linear";
+/** @category WebGPU */
declare type GPUCompareFunction =
| "never"
| "less"
@@ -394,14 +430,17 @@ declare type GPUCompareFunction =
| "greater-equal"
| "always";
+/** @category WebGPU */
declare class GPUBindGroupLayout implements GPUObjectBase {
label: string;
}
+/** @category WebGPU */
declare interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
entries: GPUBindGroupLayoutEntry[];
}
+/** @category WebGPU */
declare interface GPUBindGroupLayoutEntry {
binding: number;
visibility: GPUShaderStageFlags;
@@ -412,36 +451,45 @@ declare interface GPUBindGroupLayoutEntry {
storageTexture?: GPUStorageTextureBindingLayout;
}
+/** @category WebGPU */
declare type GPUShaderStageFlags = number;
+
+/** @category WebGPU */
declare class GPUShaderStage {
static VERTEX: 0x1;
static FRAGMENT: 0x2;
static COMPUTE: 0x4;
}
+/** @category WebGPU */
declare interface GPUBufferBindingLayout {
type?: GPUBufferBindingType;
hasDynamicOffset?: boolean;
minBindingSize?: number;
}
+/** @category WebGPU */
declare type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage";
+/** @category WebGPU */
declare interface GPUSamplerBindingLayout {
type?: GPUSamplerBindingType;
}
+/** @category WebGPU */
declare type GPUSamplerBindingType =
| "filtering"
| "non-filtering"
| "comparison";
+/** @category WebGPU */
declare interface GPUTextureBindingLayout {
sampleType?: GPUTextureSampleType;
viewDimension?: GPUTextureViewDimension;
multisampled?: boolean;
}
+/** @category WebGPU */
declare type GPUTextureSampleType =
| "float"
| "unfilterable-float"
@@ -449,49 +497,60 @@ declare type GPUTextureSampleType =
| "sint"
| "uint";
+/** @category WebGPU */
declare type GPUStorageTextureAccess = "write-only";
+/** @category WebGPU */
declare interface GPUStorageTextureBindingLayout {
access: GPUStorageTextureAccess;
format: GPUTextureFormat;
viewDimension?: GPUTextureViewDimension;
}
+/** @category WebGPU */
declare class GPUBindGroup implements GPUObjectBase {
label: string;
}
+/** @category WebGPU */
declare interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase {
layout: GPUBindGroupLayout;
entries: GPUBindGroupEntry[];
}
+/** @category WebGPU */
declare type GPUBindingResource =
| GPUSampler
| GPUTextureView
| GPUBufferBinding;
+/** @category WebGPU */
declare interface GPUBindGroupEntry {
binding: number;
resource: GPUBindingResource;
}
+/** @category WebGPU */
declare interface GPUBufferBinding {
buffer: GPUBuffer;
offset?: number;
size?: number;
}
+/** @category WebGPU */
declare class GPUPipelineLayout implements GPUObjectBase {
label: string;
}
+/** @category WebGPU */
declare interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
bindGroupLayouts: GPUBindGroupLayout[];
}
+/** @category WebGPU */
declare type GPUCompilationMessageType = "error" | "warning" | "info";
+/** @category WebGPU */
declare interface GPUCompilationMessage {
readonly message: string;
readonly type: GPUCompilationMessageType;
@@ -499,53 +558,64 @@ declare interface GPUCompilationMessage {
readonly linePos: number;
}
+/** @category WebGPU */
declare interface GPUCompilationInfo {
readonly messages: ReadonlyArray<GPUCompilationMessage>;
}
+/** @category WebGPU */
declare class GPUShaderModule implements GPUObjectBase {
label: string;
compilationInfo(): Promise<GPUCompilationInfo>;
}
+/** @category WebGPU */
declare interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
code: string;
sourceMap?: any;
}
+/** @category WebGPU */
declare type GPUAutoLayoutMode = "auto";
+/** @category WebGPU */
declare interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase {
layout: GPUPipelineLayout | GPUAutoLayoutMode;
}
+/** @category WebGPU */
declare interface GPUPipelineBase {
getBindGroupLayout(index: number): GPUBindGroupLayout;
}
+/** @category WebGPU */
declare interface GPUProgrammableStage {
module: GPUShaderModule;
entryPoint: string;
}
+/** @category WebGPU */
declare class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase {
label: string;
getBindGroupLayout(index: number): GPUBindGroupLayout;
}
+/** @category WebGPU */
declare interface GPUComputePipelineDescriptor
extends GPUPipelineDescriptorBase {
compute: GPUProgrammableStage;
}
+/** @category WebGPU */
declare class GPURenderPipeline implements GPUObjectBase, GPUPipelineBase {
label: string;
getBindGroupLayout(index: number): GPUBindGroupLayout;
}
+/** @category WebGPU */
declare interface GPURenderPipelineDescriptor
extends GPUPipelineDescriptorBase {
vertex: GPUVertexState;
@@ -555,6 +625,7 @@ declare interface GPURenderPipelineDescriptor
fragment?: GPUFragmentState;
}
+/** @category WebGPU */
declare interface GPUPrimitiveState {
topology?: GPUPrimitiveTopology;
stripIndexFormat?: GPUIndexFormat;
@@ -563,6 +634,7 @@ declare interface GPUPrimitiveState {
unclippedDepth?: boolean;
}
+/** @category WebGPU */
declare type GPUPrimitiveTopology =
| "point-list"
| "line-list"
@@ -570,20 +642,25 @@ declare type GPUPrimitiveTopology =
| "triangle-list"
| "triangle-strip";
+/** @category WebGPU */
declare type GPUFrontFace = "ccw" | "cw";
+/** @category WebGPU */
declare type GPUCullMode = "none" | "front" | "back";
+/** @category WebGPU */
declare interface GPUMultisampleState {
count?: number;
mask?: number;
alphaToCoverageEnabled?: boolean;
}
+/** @category WebGPU */
declare interface GPUFragmentState extends GPUProgrammableStage {
targets: (GPUColorTargetState | null)[];
}
+/** @category WebGPU */
declare interface GPUColorTargetState {
format: GPUTextureFormat;
@@ -591,12 +668,16 @@ declare interface GPUColorTargetState {
writeMask?: GPUColorWriteFlags;
}
+/** @category WebGPU */
declare interface GPUBlendState {
color: GPUBlendComponent;
alpha: GPUBlendComponent;
}
+/** @category WebGPU */
declare type GPUColorWriteFlags = number;
+
+/** @category WebGPU */
declare class GPUColorWrite {
static RED: 0x1;
static GREEN: 0x2;
@@ -605,12 +686,14 @@ declare class GPUColorWrite {
static ALL: 0xF;
}
+/** @category WebGPU */
declare interface GPUBlendComponent {
operation?: GPUBlendOperation;
srcFactor?: GPUBlendFactor;
dstFactor?: GPUBlendFactor;
}
+/** @category WebGPU */
declare type GPUBlendFactor =
| "zero"
| "one"
@@ -626,6 +709,7 @@ declare type GPUBlendFactor =
| "constant"
| "one-minus-constant";
+/** @category WebGPU */
declare type GPUBlendOperation =
| "add"
| "subtract"
@@ -633,6 +717,7 @@ declare type GPUBlendOperation =
| "min"
| "max";
+/** @category WebGPU */
declare interface GPUDepthStencilState {
format: GPUTextureFormat;
@@ -650,6 +735,7 @@ declare interface GPUDepthStencilState {
depthBiasClamp?: number;
}
+/** @category WebGPU */
declare interface GPUStencilFaceState {
compare?: GPUCompareFunction;
failOp?: GPUStencilOperation;
@@ -657,6 +743,7 @@ declare interface GPUStencilFaceState {
passOp?: GPUStencilOperation;
}
+/** @category WebGPU */
declare type GPUStencilOperation =
| "keep"
| "zero"
@@ -667,8 +754,10 @@ declare type GPUStencilOperation =
| "increment-wrap"
| "decrement-wrap";
+/** @category WebGPU */
declare type GPUIndexFormat = "uint16" | "uint32";
+/** @category WebGPU */
declare type GPUVertexFormat =
| "uint8x2"
| "uint8x4"
@@ -700,18 +789,23 @@ declare type GPUVertexFormat =
| "sint32x2"
| "sint32x3"
| "sint32x4";
+
+/** @category WebGPU */
declare type GPUVertexStepMode = "vertex" | "instance";
+/** @category WebGPU */
declare interface GPUVertexState extends GPUProgrammableStage {
buffers?: (GPUVertexBufferLayout | null)[];
}
+/** @category WebGPU */
declare interface GPUVertexBufferLayout {
arrayStride: number;
stepMode?: GPUVertexStepMode;
attributes: GPUVertexAttribute[];
}
+/** @category WebGPU */
declare interface GPUVertexAttribute {
format: GPUVertexFormat;
offset: number;
@@ -719,12 +813,15 @@ declare interface GPUVertexAttribute {
shaderLocation: number;
}
+/** @category WebGPU */
declare class GPUCommandBuffer implements GPUObjectBase {
label: string;
}
+/** @category WebGPU */
declare interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {}
+/** @category WebGPU */
declare class GPUCommandEncoder implements GPUObjectBase {
label: string;
@@ -782,18 +879,22 @@ declare class GPUCommandEncoder implements GPUObjectBase {
finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
}
+/** @category WebGPU */
declare interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {}
+/** @category WebGPU */
declare interface GPUImageDataLayout {
offset?: number;
bytesPerRow?: number;
rowsPerImage?: number;
}
+/** @category WebGPU */
declare interface GPUImageCopyBuffer extends GPUImageDataLayout {
buffer: GPUBuffer;
}
+/** @category WebGPU */
declare interface GPUImageCopyTexture {
texture: GPUTexture;
mipLevel?: number;
@@ -801,6 +902,7 @@ declare interface GPUImageCopyTexture {
aspect?: GPUTextureAspect;
}
+/** @category WebGPU */
interface GPUProgrammablePassEncoder {
setBindGroup(
index: number,
@@ -821,6 +923,7 @@ interface GPUProgrammablePassEncoder {
insertDebugMarker(markerLabel: string): undefined;
}
+/** @category WebGPU */
declare class GPUComputePassEncoder
implements GPUObjectBase, GPUProgrammablePassEncoder {
label: string;
@@ -857,8 +960,10 @@ declare class GPUComputePassEncoder
end(): undefined;
}
+/** @category WebGPU */
declare interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {}
+/** @category WebGPU */
interface GPURenderEncoderBase {
setPipeline(pipeline: GPURenderPipeline): undefined;
@@ -896,6 +1001,7 @@ interface GPURenderEncoderBase {
): undefined;
}
+/** @category WebGPU */
declare class GPURenderPassEncoder
implements GPUObjectBase, GPUProgrammablePassEncoder, GPURenderEncoderBase {
label: string;
@@ -980,12 +1086,14 @@ declare class GPURenderPassEncoder
end(): undefined;
}
+/** @category WebGPU */
declare interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
colorAttachments: (GPURenderPassColorAttachment | null)[];
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
occlusionQuerySet?: GPUQuerySet;
}
+/** @category WebGPU */
declare interface GPURenderPassColorAttachment {
view: GPUTextureView;
resolveTarget?: GPUTextureView;
@@ -995,6 +1103,7 @@ declare interface GPURenderPassColorAttachment {
storeOp: GPUStoreOp;
}
+/** @category WebGPU */
declare interface GPURenderPassDepthStencilAttachment {
view: GPUTextureView;
@@ -1009,16 +1118,21 @@ declare interface GPURenderPassDepthStencilAttachment {
stencilReadOnly?: boolean;
}
+/** @category WebGPU */
declare type GPULoadOp = "load" | "clear";
+/** @category WebGPU */
declare type GPUStoreOp = "store" | "discard";
+/** @category WebGPU */
declare class GPURenderBundle implements GPUObjectBase {
label: string;
}
+/** @category WebGPU */
declare interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {}
+/** @category WebGPU */
declare class GPURenderBundleEncoder
implements GPUObjectBase, GPUProgrammablePassEncoder, GPURenderEncoderBase {
label: string;
@@ -1072,17 +1186,20 @@ declare class GPURenderBundleEncoder
finish(descriptor?: GPURenderBundleDescriptor): GPURenderBundle;
}
+/** @category WebGPU */
declare interface GPURenderPassLayout extends GPUObjectDescriptorBase {
colorFormats: (GPUTextureFormat | null)[];
depthStencilFormat?: GPUTextureFormat;
sampleCount?: number;
}
+/** @category WebGPU */
declare interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout {
depthReadOnly?: boolean;
stencilReadOnly?: boolean;
}
+/** @category WebGPU */
declare class GPUQueue implements GPUObjectBase {
label: string;
@@ -1106,20 +1223,24 @@ declare class GPUQueue implements GPUObjectBase {
): undefined;
}
+/** @category WebGPU */
declare class GPUQuerySet implements GPUObjectBase {
label: string;
destroy(): undefined;
}
+/** @category WebGPU */
declare interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
type: GPUQueryType;
count: number;
pipelineStatistics?: GPUPipelineStatisticName[];
}
+/** @category WebGPU */
declare type GPUQueryType = "occlusion" | "pipeline-statistics" | "timestamp";
+/** @category WebGPU */
declare type GPUPipelineStatisticName =
| "vertex-shader-invocations"
| "clipper-invocations"
@@ -1127,27 +1248,34 @@ declare type GPUPipelineStatisticName =
| "fragment-shader-invocations"
| "compute-shader-invocations";
+/** @category WebGPU */
declare type GPUDeviceLostReason = "destroyed";
+/** @category WebGPU */
declare interface GPUDeviceLostInfo {
readonly reason: GPUDeviceLostReason | undefined;
readonly message: string;
}
+/** @category WebGPU */
declare class GPUError {
readonly message: string;
}
+/** @category WebGPU */
declare type GPUErrorFilter = "out-of-memory" | "validation";
+/** @category WebGPU */
declare class GPUOutOfMemoryError extends GPUError {
constructor(message: string);
}
+/** @category WebGPU */
declare class GPUValidationError extends GPUError {
constructor(message: string);
}
+/** @category WebGPU */
declare class GPUUncapturedErrorEvent extends Event {
constructor(
type: string,
@@ -1156,10 +1284,12 @@ declare class GPUUncapturedErrorEvent extends Event {
readonly error: GPUError;
}
+/** @category WebGPU */
declare interface GPUUncapturedErrorEventInit extends EventInit {
error?: GPUError;
}
+/** @category WebGPU */
declare interface GPUColorDict {
r: number;
g: number;
@@ -1167,20 +1297,25 @@ declare interface GPUColorDict {
a: number;
}
+/** @category WebGPU */
declare type GPUColor = number[] | GPUColorDict;
+/** @category WebGPU */
declare interface GPUOrigin3DDict {
x?: number;
y?: number;
z?: number;
}
+/** @category WebGPU */
declare type GPUOrigin3D = number[] | GPUOrigin3DDict;
+/** @category WebGPU */
declare interface GPUExtent3DDict {
width: number;
height?: number;
depthOrArrayLayers?: number;
}
+/** @category WebGPU */
declare type GPUExtent3D = number[] | GPUExtent3DDict;