@cloudflare/workers-types 4.20230914.0 → 4.20230922.0

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.
@@ -232,6 +232,14 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
232
232
  FixedLengthStream: typeof FixedLengthStream;
233
233
  IdentityTransformStream: typeof IdentityTransformStream;
234
234
  HTMLRewriter: typeof HTMLRewriter;
235
+ GPUAdapter: typeof gpuGPUAdapter;
236
+ GPUOutOfMemoryError: typeof gpuGPUOutOfMemoryError;
237
+ GPUValidationError: typeof gpuGPUValidationError;
238
+ GPUInternalError: typeof gpuGPUInternalError;
239
+ GPUDeviceLostInfo: typeof gpuGPUDeviceLostInfo;
240
+ GPUBufferUsage: typeof gpuGPUBufferUsage;
241
+ GPUShaderStage: typeof gpuGPUShaderStage;
242
+ GPUMapMode: typeof gpuGPUMapMode;
235
243
  }
236
244
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
237
245
  type: Type,
@@ -1929,6 +1937,296 @@ declare interface SocketAddress {
1929
1937
  declare interface TlsOptions {
1930
1938
  expectedServerHostname?: string;
1931
1939
  }
1940
+ declare abstract class gpuGPUAdapter {
1941
+ requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
1942
+ requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
1943
+ get features(): gpuGPUSupportedFeatures;
1944
+ get limits(): gpuGPUSupportedLimits;
1945
+ }
1946
+ declare interface gpuGPUDevice extends EventTarget {
1947
+ createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
1948
+ createBindGroupLayout(
1949
+ descriptor: gpuGPUBindGroupLayoutDescriptor
1950
+ ): gpuGPUBindGroupLayout;
1951
+ createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
1952
+ createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
1953
+ createShaderModule(
1954
+ descriptor: gpuGPUShaderModuleDescriptor
1955
+ ): gpuGPUShaderModule;
1956
+ createPipelineLayout(
1957
+ descriptor: gpuGPUPipelineLayoutDescriptor
1958
+ ): gpuGPUPipelineLayout;
1959
+ createComputePipeline(
1960
+ descriptor: gpuGPUComputePipelineDescriptor
1961
+ ): gpuGPUComputePipeline;
1962
+ createCommandEncoder(
1963
+ descriptor?: gpuGPUCommandEncoderDescriptor
1964
+ ): gpuGPUCommandEncoder;
1965
+ destroy(): void;
1966
+ createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1967
+ pushErrorScope(filter: string): void;
1968
+ popErrorScope(): Promise<gpuGPUError | null>;
1969
+ get queue(): gpuGPUQueue;
1970
+ get lost(): Promise<gpuGPUDeviceLostInfo>;
1971
+ get features(): gpuGPUSupportedFeatures;
1972
+ get limits(): gpuGPUSupportedLimits;
1973
+ }
1974
+ declare interface gpuGPUDeviceDescriptor {
1975
+ label?: string;
1976
+ requiredFeatures?: string[];
1977
+ requiredLimits?: Record<string, number | bigint>;
1978
+ defaultQueue?: gpuGPUQueueDescriptor;
1979
+ }
1980
+ declare interface gpuGPUBufferDescriptor {
1981
+ label: string;
1982
+ size: number | bigint;
1983
+ usage: number;
1984
+ mappedAtCreation: boolean;
1985
+ }
1986
+ declare interface gpuGPUQueueDescriptor {
1987
+ label?: string;
1988
+ }
1989
+ declare abstract class gpuGPUBufferUsage {
1990
+ static readonly MAP_READ: number;
1991
+ static readonly MAP_WRITE: number;
1992
+ static readonly COPY_SRC: number;
1993
+ static readonly COPY_DST: number;
1994
+ static readonly INDEX: number;
1995
+ static readonly VERTEX: number;
1996
+ static readonly UNIFORM: number;
1997
+ static readonly STORAGE: number;
1998
+ static readonly INDIRECT: number;
1999
+ static readonly QUERY_RESOLVE: number;
2000
+ }
2001
+ declare interface gpuGPUBuffer {
2002
+ getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
2003
+ unmap(): void;
2004
+ destroy(): void;
2005
+ mapAsync(
2006
+ mode: number,
2007
+ offset?: number | bigint,
2008
+ size?: number | bigint
2009
+ ): Promise<void>;
2010
+ get size(): number | bigint;
2011
+ get usage(): number;
2012
+ get mapState(): string;
2013
+ }
2014
+ declare abstract class gpuGPUShaderStage {
2015
+ static readonly VERTEX: number;
2016
+ static readonly FRAGMENT: number;
2017
+ static readonly COMPUTE: number;
2018
+ }
2019
+ declare interface gpuGPUBindGroupLayoutDescriptor {
2020
+ label?: string;
2021
+ entries: gpuGPUBindGroupLayoutEntry[];
2022
+ }
2023
+ declare interface gpuGPUBindGroupLayoutEntry {
2024
+ binding: number;
2025
+ visibility: number;
2026
+ buffer?: gpuGPUBufferBindingLayout;
2027
+ sampler?: gpuGPUSamplerBindingLayout;
2028
+ texture?: gpuGPUTextureBindingLayout;
2029
+ storageTexture?: gpuGPUStorageTextureBindingLayout;
2030
+ }
2031
+ declare interface gpuGPUStorageTextureBindingLayout {
2032
+ access?: string;
2033
+ format: string;
2034
+ viewDimension?: string;
2035
+ }
2036
+ declare interface gpuGPUTextureBindingLayout {
2037
+ sampleType?: string;
2038
+ viewDimension?: string;
2039
+ multisampled?: boolean;
2040
+ }
2041
+ declare interface gpuGPUSamplerBindingLayout {
2042
+ type?: string;
2043
+ }
2044
+ declare interface gpuGPUBufferBindingLayout {
2045
+ type?: string;
2046
+ hasDynamicOffset?: boolean;
2047
+ minBindingSize?: number | bigint;
2048
+ }
2049
+ declare interface gpuGPUBindGroupLayout {}
2050
+ declare interface gpuGPUBindGroup {}
2051
+ declare interface gpuGPUBindGroupDescriptor {
2052
+ label?: string;
2053
+ layout: gpuGPUBindGroupLayout;
2054
+ entries: gpuGPUBindGroupEntry[];
2055
+ }
2056
+ declare interface gpuGPUBindGroupEntry {
2057
+ binding: number;
2058
+ resource: gpuGPUBufferBinding | gpuGPUSampler;
2059
+ }
2060
+ declare interface gpuGPUBufferBinding {
2061
+ buffer: gpuGPUBuffer;
2062
+ offset?: number | bigint;
2063
+ size?: number | bigint;
2064
+ }
2065
+ declare interface gpuGPUSampler {}
2066
+ declare interface gpuGPUSamplerDescriptor {
2067
+ label?: string;
2068
+ addressModeU?: string;
2069
+ addressModeV?: string;
2070
+ addressModeW?: string;
2071
+ magFilter?: string;
2072
+ minFilter?: string;
2073
+ mipmapFilter?: string;
2074
+ lodMinClamp?: number;
2075
+ lodMaxClamp?: number;
2076
+ compare: string;
2077
+ maxAnisotropy?: number;
2078
+ }
2079
+ declare interface gpuGPUShaderModule {
2080
+ getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
2081
+ }
2082
+ declare interface gpuGPUShaderModuleDescriptor {
2083
+ label?: string;
2084
+ code: string;
2085
+ }
2086
+ declare interface gpuGPUPipelineLayout {}
2087
+ declare interface gpuGPUPipelineLayoutDescriptor {
2088
+ label?: string;
2089
+ bindGroupLayouts: gpuGPUBindGroupLayout[];
2090
+ }
2091
+ declare interface gpuGPUComputePipeline {
2092
+ getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
2093
+ }
2094
+ declare interface gpuGPUComputePipelineDescriptor {
2095
+ label?: string;
2096
+ compute: gpuGPUProgrammableStage;
2097
+ layout: string | gpuGPUPipelineLayout;
2098
+ }
2099
+ declare interface gpuGPUProgrammableStage {
2100
+ module: gpuGPUShaderModule;
2101
+ entryPoint: string;
2102
+ constants?: Record<string, number>;
2103
+ }
2104
+ declare interface gpuGPUCommandEncoder {
2105
+ get label(): string;
2106
+ beginComputePass(
2107
+ descriptor?: gpuGPUComputePassDescriptor
2108
+ ): gpuGPUComputePassEncoder;
2109
+ copyBufferToBuffer(
2110
+ source: gpuGPUBuffer,
2111
+ sourceOffset: number | bigint,
2112
+ destination: gpuGPUBuffer,
2113
+ destinationOffset: number | bigint,
2114
+ size: number | bigint
2115
+ ): void;
2116
+ finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2117
+ }
2118
+ declare interface gpuGPUCommandEncoderDescriptor {
2119
+ label?: string;
2120
+ }
2121
+ declare interface gpuGPUComputePassEncoder {
2122
+ setPipeline(pipeline: gpuGPUComputePipeline): void;
2123
+ setBindGroup(
2124
+ index: number,
2125
+ bindGroup: gpuGPUBindGroup | null,
2126
+ dynamicOffsets?: Iterable<number>
2127
+ ): void;
2128
+ dispatchWorkgroups(
2129
+ workgroupCountX: number,
2130
+ workgroupCountY?: number,
2131
+ workgroupCountZ?: number
2132
+ ): void;
2133
+ end(): void;
2134
+ }
2135
+ declare interface gpuGPUComputePassDescriptor {
2136
+ label?: string;
2137
+ timestampWrites?: gpuGPUComputePassTimestampWrite[];
2138
+ }
2139
+ declare interface gpuGPUQuerySet {}
2140
+ declare interface gpuGPUQuerySetDescriptor {
2141
+ label?: string;
2142
+ }
2143
+ declare interface gpuGPUComputePassTimestampWrite {
2144
+ querySet: gpuGPUQuerySet;
2145
+ queryIndex: number;
2146
+ location: string;
2147
+ }
2148
+ declare interface gpuGPUCommandBufferDescriptor {
2149
+ label?: string;
2150
+ }
2151
+ declare interface gpuGPUCommandBuffer {}
2152
+ declare interface gpuGPUQueue {
2153
+ submit(commandBuffers: gpuGPUCommandBuffer[]): void;
2154
+ writeBuffer(
2155
+ buffer: gpuGPUBuffer,
2156
+ bufferOffset: number | bigint,
2157
+ data: ArrayBuffer | ArrayBufferView,
2158
+ dataOffset?: number | bigint,
2159
+ size?: number | bigint
2160
+ ): void;
2161
+ }
2162
+ declare abstract class gpuGPUMapMode {
2163
+ static readonly READ: number;
2164
+ static readonly WRITE: number;
2165
+ }
2166
+ declare interface gpuGPUAdapterInfo {
2167
+ get vendor(): string;
2168
+ get architecture(): string;
2169
+ get device(): string;
2170
+ get description(): string;
2171
+ }
2172
+ declare interface gpuGPUSupportedFeatures {
2173
+ has(name: string): boolean;
2174
+ keys(): string[];
2175
+ }
2176
+ declare interface gpuGPUSupportedLimits {
2177
+ get maxTextureDimension1D(): number;
2178
+ get maxTextureDimension2D(): number;
2179
+ get maxTextureDimension3D(): number;
2180
+ get maxTextureArrayLayers(): number;
2181
+ get maxBindGroups(): number;
2182
+ get maxBindingsPerBindGroup(): number;
2183
+ get maxDynamicUniformBuffersPerPipelineLayout(): number;
2184
+ get maxDynamicStorageBuffersPerPipelineLayout(): number;
2185
+ get maxSampledTexturesPerShaderStage(): number;
2186
+ get maxSamplersPerShaderStage(): number;
2187
+ get maxStorageBuffersPerShaderStage(): number;
2188
+ get maxStorageTexturesPerShaderStage(): number;
2189
+ get maxUniformBuffersPerShaderStage(): number;
2190
+ get maxUniformBufferBindingSize(): number | bigint;
2191
+ get maxStorageBufferBindingSize(): number | bigint;
2192
+ get minUniformBufferOffsetAlignment(): number;
2193
+ get minStorageBufferOffsetAlignment(): number;
2194
+ get maxVertexBuffers(): number;
2195
+ get maxBufferSize(): number | bigint;
2196
+ get maxVertexAttributes(): number;
2197
+ get maxVertexBufferArrayStride(): number;
2198
+ get maxInterStageShaderComponents(): number;
2199
+ get maxInterStageShaderVariables(): number;
2200
+ get maxColorAttachments(): number;
2201
+ get maxColorAttachmentBytesPerSample(): number;
2202
+ get maxComputeWorkgroupStorageSize(): number;
2203
+ get maxComputeInvocationsPerWorkgroup(): number;
2204
+ get maxComputeWorkgroupSizeX(): number;
2205
+ get maxComputeWorkgroupSizeY(): number;
2206
+ get maxComputeWorkgroupSizeZ(): number;
2207
+ get maxComputeWorkgroupsPerDimension(): number;
2208
+ }
2209
+ declare abstract class gpuGPUError {
2210
+ get message(): string;
2211
+ }
2212
+ declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
2213
+ declare abstract class gpuGPUInternalError extends gpuGPUError {}
2214
+ declare abstract class gpuGPUValidationError extends gpuGPUError {}
2215
+ declare abstract class gpuGPUDeviceLostInfo {
2216
+ get message(): string;
2217
+ get reason(): string;
2218
+ }
2219
+ declare interface gpuGPUCompilationMessage {
2220
+ get message(): string;
2221
+ get type(): string;
2222
+ get lineNum(): number;
2223
+ get linePos(): number;
2224
+ get offset(): number;
2225
+ get length(): number;
2226
+ }
2227
+ declare interface gpuGPUCompilationInfo {
2228
+ get messages(): gpuGPUCompilationMessage[];
2229
+ }
1932
2230
  declare interface BasicImageTransformations {
1933
2231
  /**
1934
2232
  * Maximum width in image pixels. The value must be an integer.
@@ -3139,14 +3437,6 @@ declare interface VectorizeError {
3139
3437
  code?: number;
3140
3438
  error: string;
3141
3439
  }
3142
- /**
3143
- * A pre-configured list of known models.
3144
- * These can be supplied in place of configuring explicit dimensions.
3145
- */
3146
- declare type VectorizePreset =
3147
- | "openapi-text-embedding-ada-002"
3148
- | "workers-ai/bge-small-en"
3149
- | "cohere/embed-multilingual-v2.0";
3150
3440
  /**
3151
3441
  * Supported distance metrics for an index.
3152
3442
  * Distance metrics determine how other "similar" vectors are determined.
@@ -3166,7 +3456,7 @@ declare type VectorizeIndexConfig =
3166
3456
  metric: VectorizeDistanceMetric;
3167
3457
  }
3168
3458
  | {
3169
- preset: VectorizePreset;
3459
+ preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity
3170
3460
  };
3171
3461
  /**
3172
3462
  * Metadata about an existing index.
@@ -232,6 +232,14 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
232
232
  FixedLengthStream: typeof FixedLengthStream;
233
233
  IdentityTransformStream: typeof IdentityTransformStream;
234
234
  HTMLRewriter: typeof HTMLRewriter;
235
+ GPUAdapter: typeof gpuGPUAdapter;
236
+ GPUOutOfMemoryError: typeof gpuGPUOutOfMemoryError;
237
+ GPUValidationError: typeof gpuGPUValidationError;
238
+ GPUInternalError: typeof gpuGPUInternalError;
239
+ GPUDeviceLostInfo: typeof gpuGPUDeviceLostInfo;
240
+ GPUBufferUsage: typeof gpuGPUBufferUsage;
241
+ GPUShaderStage: typeof gpuGPUShaderStage;
242
+ GPUMapMode: typeof gpuGPUMapMode;
235
243
  }
236
244
  export declare function addEventListener<
237
245
  Type extends keyof WorkerGlobalScopeEventMap
@@ -1934,6 +1942,296 @@ export interface SocketAddress {
1934
1942
  export interface TlsOptions {
1935
1943
  expectedServerHostname?: string;
1936
1944
  }
1945
+ export declare abstract class gpuGPUAdapter {
1946
+ requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
1947
+ requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
1948
+ get features(): gpuGPUSupportedFeatures;
1949
+ get limits(): gpuGPUSupportedLimits;
1950
+ }
1951
+ export interface gpuGPUDevice extends EventTarget {
1952
+ createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
1953
+ createBindGroupLayout(
1954
+ descriptor: gpuGPUBindGroupLayoutDescriptor
1955
+ ): gpuGPUBindGroupLayout;
1956
+ createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
1957
+ createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
1958
+ createShaderModule(
1959
+ descriptor: gpuGPUShaderModuleDescriptor
1960
+ ): gpuGPUShaderModule;
1961
+ createPipelineLayout(
1962
+ descriptor: gpuGPUPipelineLayoutDescriptor
1963
+ ): gpuGPUPipelineLayout;
1964
+ createComputePipeline(
1965
+ descriptor: gpuGPUComputePipelineDescriptor
1966
+ ): gpuGPUComputePipeline;
1967
+ createCommandEncoder(
1968
+ descriptor?: gpuGPUCommandEncoderDescriptor
1969
+ ): gpuGPUCommandEncoder;
1970
+ destroy(): void;
1971
+ createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1972
+ pushErrorScope(filter: string): void;
1973
+ popErrorScope(): Promise<gpuGPUError | null>;
1974
+ get queue(): gpuGPUQueue;
1975
+ get lost(): Promise<gpuGPUDeviceLostInfo>;
1976
+ get features(): gpuGPUSupportedFeatures;
1977
+ get limits(): gpuGPUSupportedLimits;
1978
+ }
1979
+ export interface gpuGPUDeviceDescriptor {
1980
+ label?: string;
1981
+ requiredFeatures?: string[];
1982
+ requiredLimits?: Record<string, number | bigint>;
1983
+ defaultQueue?: gpuGPUQueueDescriptor;
1984
+ }
1985
+ export interface gpuGPUBufferDescriptor {
1986
+ label: string;
1987
+ size: number | bigint;
1988
+ usage: number;
1989
+ mappedAtCreation: boolean;
1990
+ }
1991
+ export interface gpuGPUQueueDescriptor {
1992
+ label?: string;
1993
+ }
1994
+ export declare abstract class gpuGPUBufferUsage {
1995
+ static readonly MAP_READ: number;
1996
+ static readonly MAP_WRITE: number;
1997
+ static readonly COPY_SRC: number;
1998
+ static readonly COPY_DST: number;
1999
+ static readonly INDEX: number;
2000
+ static readonly VERTEX: number;
2001
+ static readonly UNIFORM: number;
2002
+ static readonly STORAGE: number;
2003
+ static readonly INDIRECT: number;
2004
+ static readonly QUERY_RESOLVE: number;
2005
+ }
2006
+ export interface gpuGPUBuffer {
2007
+ getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
2008
+ unmap(): void;
2009
+ destroy(): void;
2010
+ mapAsync(
2011
+ mode: number,
2012
+ offset?: number | bigint,
2013
+ size?: number | bigint
2014
+ ): Promise<void>;
2015
+ get size(): number | bigint;
2016
+ get usage(): number;
2017
+ get mapState(): string;
2018
+ }
2019
+ export declare abstract class gpuGPUShaderStage {
2020
+ static readonly VERTEX: number;
2021
+ static readonly FRAGMENT: number;
2022
+ static readonly COMPUTE: number;
2023
+ }
2024
+ export interface gpuGPUBindGroupLayoutDescriptor {
2025
+ label?: string;
2026
+ entries: gpuGPUBindGroupLayoutEntry[];
2027
+ }
2028
+ export interface gpuGPUBindGroupLayoutEntry {
2029
+ binding: number;
2030
+ visibility: number;
2031
+ buffer?: gpuGPUBufferBindingLayout;
2032
+ sampler?: gpuGPUSamplerBindingLayout;
2033
+ texture?: gpuGPUTextureBindingLayout;
2034
+ storageTexture?: gpuGPUStorageTextureBindingLayout;
2035
+ }
2036
+ export interface gpuGPUStorageTextureBindingLayout {
2037
+ access?: string;
2038
+ format: string;
2039
+ viewDimension?: string;
2040
+ }
2041
+ export interface gpuGPUTextureBindingLayout {
2042
+ sampleType?: string;
2043
+ viewDimension?: string;
2044
+ multisampled?: boolean;
2045
+ }
2046
+ export interface gpuGPUSamplerBindingLayout {
2047
+ type?: string;
2048
+ }
2049
+ export interface gpuGPUBufferBindingLayout {
2050
+ type?: string;
2051
+ hasDynamicOffset?: boolean;
2052
+ minBindingSize?: number | bigint;
2053
+ }
2054
+ export interface gpuGPUBindGroupLayout {}
2055
+ export interface gpuGPUBindGroup {}
2056
+ export interface gpuGPUBindGroupDescriptor {
2057
+ label?: string;
2058
+ layout: gpuGPUBindGroupLayout;
2059
+ entries: gpuGPUBindGroupEntry[];
2060
+ }
2061
+ export interface gpuGPUBindGroupEntry {
2062
+ binding: number;
2063
+ resource: gpuGPUBufferBinding | gpuGPUSampler;
2064
+ }
2065
+ export interface gpuGPUBufferBinding {
2066
+ buffer: gpuGPUBuffer;
2067
+ offset?: number | bigint;
2068
+ size?: number | bigint;
2069
+ }
2070
+ export interface gpuGPUSampler {}
2071
+ export interface gpuGPUSamplerDescriptor {
2072
+ label?: string;
2073
+ addressModeU?: string;
2074
+ addressModeV?: string;
2075
+ addressModeW?: string;
2076
+ magFilter?: string;
2077
+ minFilter?: string;
2078
+ mipmapFilter?: string;
2079
+ lodMinClamp?: number;
2080
+ lodMaxClamp?: number;
2081
+ compare: string;
2082
+ maxAnisotropy?: number;
2083
+ }
2084
+ export interface gpuGPUShaderModule {
2085
+ getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
2086
+ }
2087
+ export interface gpuGPUShaderModuleDescriptor {
2088
+ label?: string;
2089
+ code: string;
2090
+ }
2091
+ export interface gpuGPUPipelineLayout {}
2092
+ export interface gpuGPUPipelineLayoutDescriptor {
2093
+ label?: string;
2094
+ bindGroupLayouts: gpuGPUBindGroupLayout[];
2095
+ }
2096
+ export interface gpuGPUComputePipeline {
2097
+ getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
2098
+ }
2099
+ export interface gpuGPUComputePipelineDescriptor {
2100
+ label?: string;
2101
+ compute: gpuGPUProgrammableStage;
2102
+ layout: string | gpuGPUPipelineLayout;
2103
+ }
2104
+ export interface gpuGPUProgrammableStage {
2105
+ module: gpuGPUShaderModule;
2106
+ entryPoint: string;
2107
+ constants?: Record<string, number>;
2108
+ }
2109
+ export interface gpuGPUCommandEncoder {
2110
+ get label(): string;
2111
+ beginComputePass(
2112
+ descriptor?: gpuGPUComputePassDescriptor
2113
+ ): gpuGPUComputePassEncoder;
2114
+ copyBufferToBuffer(
2115
+ source: gpuGPUBuffer,
2116
+ sourceOffset: number | bigint,
2117
+ destination: gpuGPUBuffer,
2118
+ destinationOffset: number | bigint,
2119
+ size: number | bigint
2120
+ ): void;
2121
+ finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2122
+ }
2123
+ export interface gpuGPUCommandEncoderDescriptor {
2124
+ label?: string;
2125
+ }
2126
+ export interface gpuGPUComputePassEncoder {
2127
+ setPipeline(pipeline: gpuGPUComputePipeline): void;
2128
+ setBindGroup(
2129
+ index: number,
2130
+ bindGroup: gpuGPUBindGroup | null,
2131
+ dynamicOffsets?: Iterable<number>
2132
+ ): void;
2133
+ dispatchWorkgroups(
2134
+ workgroupCountX: number,
2135
+ workgroupCountY?: number,
2136
+ workgroupCountZ?: number
2137
+ ): void;
2138
+ end(): void;
2139
+ }
2140
+ export interface gpuGPUComputePassDescriptor {
2141
+ label?: string;
2142
+ timestampWrites?: gpuGPUComputePassTimestampWrite[];
2143
+ }
2144
+ export interface gpuGPUQuerySet {}
2145
+ export interface gpuGPUQuerySetDescriptor {
2146
+ label?: string;
2147
+ }
2148
+ export interface gpuGPUComputePassTimestampWrite {
2149
+ querySet: gpuGPUQuerySet;
2150
+ queryIndex: number;
2151
+ location: string;
2152
+ }
2153
+ export interface gpuGPUCommandBufferDescriptor {
2154
+ label?: string;
2155
+ }
2156
+ export interface gpuGPUCommandBuffer {}
2157
+ export interface gpuGPUQueue {
2158
+ submit(commandBuffers: gpuGPUCommandBuffer[]): void;
2159
+ writeBuffer(
2160
+ buffer: gpuGPUBuffer,
2161
+ bufferOffset: number | bigint,
2162
+ data: ArrayBuffer | ArrayBufferView,
2163
+ dataOffset?: number | bigint,
2164
+ size?: number | bigint
2165
+ ): void;
2166
+ }
2167
+ export declare abstract class gpuGPUMapMode {
2168
+ static readonly READ: number;
2169
+ static readonly WRITE: number;
2170
+ }
2171
+ export interface gpuGPUAdapterInfo {
2172
+ get vendor(): string;
2173
+ get architecture(): string;
2174
+ get device(): string;
2175
+ get description(): string;
2176
+ }
2177
+ export interface gpuGPUSupportedFeatures {
2178
+ has(name: string): boolean;
2179
+ keys(): string[];
2180
+ }
2181
+ export interface gpuGPUSupportedLimits {
2182
+ get maxTextureDimension1D(): number;
2183
+ get maxTextureDimension2D(): number;
2184
+ get maxTextureDimension3D(): number;
2185
+ get maxTextureArrayLayers(): number;
2186
+ get maxBindGroups(): number;
2187
+ get maxBindingsPerBindGroup(): number;
2188
+ get maxDynamicUniformBuffersPerPipelineLayout(): number;
2189
+ get maxDynamicStorageBuffersPerPipelineLayout(): number;
2190
+ get maxSampledTexturesPerShaderStage(): number;
2191
+ get maxSamplersPerShaderStage(): number;
2192
+ get maxStorageBuffersPerShaderStage(): number;
2193
+ get maxStorageTexturesPerShaderStage(): number;
2194
+ get maxUniformBuffersPerShaderStage(): number;
2195
+ get maxUniformBufferBindingSize(): number | bigint;
2196
+ get maxStorageBufferBindingSize(): number | bigint;
2197
+ get minUniformBufferOffsetAlignment(): number;
2198
+ get minStorageBufferOffsetAlignment(): number;
2199
+ get maxVertexBuffers(): number;
2200
+ get maxBufferSize(): number | bigint;
2201
+ get maxVertexAttributes(): number;
2202
+ get maxVertexBufferArrayStride(): number;
2203
+ get maxInterStageShaderComponents(): number;
2204
+ get maxInterStageShaderVariables(): number;
2205
+ get maxColorAttachments(): number;
2206
+ get maxColorAttachmentBytesPerSample(): number;
2207
+ get maxComputeWorkgroupStorageSize(): number;
2208
+ get maxComputeInvocationsPerWorkgroup(): number;
2209
+ get maxComputeWorkgroupSizeX(): number;
2210
+ get maxComputeWorkgroupSizeY(): number;
2211
+ get maxComputeWorkgroupSizeZ(): number;
2212
+ get maxComputeWorkgroupsPerDimension(): number;
2213
+ }
2214
+ export declare abstract class gpuGPUError {
2215
+ get message(): string;
2216
+ }
2217
+ export declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
2218
+ export declare abstract class gpuGPUInternalError extends gpuGPUError {}
2219
+ export declare abstract class gpuGPUValidationError extends gpuGPUError {}
2220
+ export declare abstract class gpuGPUDeviceLostInfo {
2221
+ get message(): string;
2222
+ get reason(): string;
2223
+ }
2224
+ export interface gpuGPUCompilationMessage {
2225
+ get message(): string;
2226
+ get type(): string;
2227
+ get lineNum(): number;
2228
+ get linePos(): number;
2229
+ get offset(): number;
2230
+ get length(): number;
2231
+ }
2232
+ export interface gpuGPUCompilationInfo {
2233
+ get messages(): gpuGPUCompilationMessage[];
2234
+ }
1937
2235
  export interface BasicImageTransformations {
1938
2236
  /**
1939
2237
  * Maximum width in image pixels. The value must be an integer.
@@ -3127,14 +3425,6 @@ export interface VectorizeError {
3127
3425
  code?: number;
3128
3426
  error: string;
3129
3427
  }
3130
- /**
3131
- * A pre-configured list of known models.
3132
- * These can be supplied in place of configuring explicit dimensions.
3133
- */
3134
- export type VectorizePreset =
3135
- | "openapi-text-embedding-ada-002"
3136
- | "workers-ai/bge-small-en"
3137
- | "cohere/embed-multilingual-v2.0";
3138
3428
  /**
3139
3429
  * Supported distance metrics for an index.
3140
3430
  * Distance metrics determine how other "similar" vectors are determined.
@@ -3154,7 +3444,7 @@ export type VectorizeIndexConfig =
3154
3444
  metric: VectorizeDistanceMetric;
3155
3445
  }
3156
3446
  | {
3157
- preset: VectorizePreset;
3447
+ preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity
3158
3448
  };
3159
3449
  /**
3160
3450
  * Metadata about an existing index.