@cloudflare/workers-types 4.20230914.0 → 4.20231002.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.
@@ -234,6 +234,14 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
234
234
  FixedLengthStream: typeof FixedLengthStream;
235
235
  IdentityTransformStream: typeof IdentityTransformStream;
236
236
  HTMLRewriter: typeof HTMLRewriter;
237
+ GPUAdapter: typeof gpuGPUAdapter;
238
+ GPUOutOfMemoryError: typeof gpuGPUOutOfMemoryError;
239
+ GPUValidationError: typeof gpuGPUValidationError;
240
+ GPUInternalError: typeof gpuGPUInternalError;
241
+ GPUDeviceLostInfo: typeof gpuGPUDeviceLostInfo;
242
+ GPUBufferUsage: typeof gpuGPUBufferUsage;
243
+ GPUShaderStage: typeof gpuGPUShaderStage;
244
+ GPUMapMode: typeof gpuGPUMapMode;
237
245
  }
238
246
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
239
247
  type: Type,
@@ -349,6 +357,7 @@ declare abstract class PromiseRejectionEvent extends Event {
349
357
  }
350
358
  declare abstract class Navigator {
351
359
  readonly userAgent: string;
360
+ readonly gpu: gpuGPU;
352
361
  }
353
362
  /** Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */
354
363
  declare interface Performance {
@@ -1919,6 +1928,305 @@ declare interface SocketAddress {
1919
1928
  declare interface TlsOptions {
1920
1929
  expectedServerHostname?: string;
1921
1930
  }
1931
+ declare interface gpuGPU {
1932
+ requestAdapter(
1933
+ param1?: gpuGPURequestAdapterOptions
1934
+ ): Promise<gpuGPUAdapter | null>;
1935
+ }
1936
+ declare abstract class gpuGPUAdapter {
1937
+ requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
1938
+ requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
1939
+ get features(): gpuGPUSupportedFeatures;
1940
+ get limits(): gpuGPUSupportedLimits;
1941
+ }
1942
+ declare interface gpuGPUDevice extends EventTarget {
1943
+ createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
1944
+ createBindGroupLayout(
1945
+ descriptor: gpuGPUBindGroupLayoutDescriptor
1946
+ ): gpuGPUBindGroupLayout;
1947
+ createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
1948
+ createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
1949
+ createShaderModule(
1950
+ descriptor: gpuGPUShaderModuleDescriptor
1951
+ ): gpuGPUShaderModule;
1952
+ createPipelineLayout(
1953
+ descriptor: gpuGPUPipelineLayoutDescriptor
1954
+ ): gpuGPUPipelineLayout;
1955
+ createComputePipeline(
1956
+ descriptor: gpuGPUComputePipelineDescriptor
1957
+ ): gpuGPUComputePipeline;
1958
+ createCommandEncoder(
1959
+ descriptor?: gpuGPUCommandEncoderDescriptor
1960
+ ): gpuGPUCommandEncoder;
1961
+ destroy(): void;
1962
+ createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1963
+ pushErrorScope(filter: string): void;
1964
+ popErrorScope(): Promise<gpuGPUError | null>;
1965
+ get queue(): gpuGPUQueue;
1966
+ get lost(): Promise<gpuGPUDeviceLostInfo>;
1967
+ get features(): gpuGPUSupportedFeatures;
1968
+ get limits(): gpuGPUSupportedLimits;
1969
+ }
1970
+ declare interface gpuGPUDeviceDescriptor {
1971
+ label?: string;
1972
+ requiredFeatures?: string[];
1973
+ requiredLimits?: Record<string, number | bigint>;
1974
+ defaultQueue?: gpuGPUQueueDescriptor;
1975
+ }
1976
+ declare interface gpuGPUBufferDescriptor {
1977
+ label: string;
1978
+ size: number | bigint;
1979
+ usage: number;
1980
+ mappedAtCreation: boolean;
1981
+ }
1982
+ declare interface gpuGPUQueueDescriptor {
1983
+ label?: string;
1984
+ }
1985
+ declare abstract class gpuGPUBufferUsage {
1986
+ static readonly MAP_READ: number;
1987
+ static readonly MAP_WRITE: number;
1988
+ static readonly COPY_SRC: number;
1989
+ static readonly COPY_DST: number;
1990
+ static readonly INDEX: number;
1991
+ static readonly VERTEX: number;
1992
+ static readonly UNIFORM: number;
1993
+ static readonly STORAGE: number;
1994
+ static readonly INDIRECT: number;
1995
+ static readonly QUERY_RESOLVE: number;
1996
+ }
1997
+ declare interface gpuGPUBuffer {
1998
+ getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
1999
+ unmap(): void;
2000
+ destroy(): void;
2001
+ mapAsync(
2002
+ mode: number,
2003
+ offset?: number | bigint,
2004
+ size?: number | bigint
2005
+ ): Promise<void>;
2006
+ get size(): number | bigint;
2007
+ get usage(): number;
2008
+ get mapState(): string;
2009
+ }
2010
+ declare abstract class gpuGPUShaderStage {
2011
+ static readonly VERTEX: number;
2012
+ static readonly FRAGMENT: number;
2013
+ static readonly COMPUTE: number;
2014
+ }
2015
+ declare interface gpuGPUBindGroupLayoutDescriptor {
2016
+ label?: string;
2017
+ entries: gpuGPUBindGroupLayoutEntry[];
2018
+ }
2019
+ declare interface gpuGPUBindGroupLayoutEntry {
2020
+ binding: number;
2021
+ visibility: number;
2022
+ buffer?: gpuGPUBufferBindingLayout;
2023
+ sampler?: gpuGPUSamplerBindingLayout;
2024
+ texture?: gpuGPUTextureBindingLayout;
2025
+ storageTexture?: gpuGPUStorageTextureBindingLayout;
2026
+ }
2027
+ declare interface gpuGPUStorageTextureBindingLayout {
2028
+ access?: string;
2029
+ format: string;
2030
+ viewDimension?: string;
2031
+ }
2032
+ declare interface gpuGPUTextureBindingLayout {
2033
+ sampleType?: string;
2034
+ viewDimension?: string;
2035
+ multisampled?: boolean;
2036
+ }
2037
+ declare interface gpuGPUSamplerBindingLayout {
2038
+ type?: string;
2039
+ }
2040
+ declare interface gpuGPUBufferBindingLayout {
2041
+ type?: string;
2042
+ hasDynamicOffset?: boolean;
2043
+ minBindingSize?: number | bigint;
2044
+ }
2045
+ declare interface gpuGPUBindGroupLayout {}
2046
+ declare interface gpuGPUBindGroup {}
2047
+ declare interface gpuGPUBindGroupDescriptor {
2048
+ label?: string;
2049
+ layout: gpuGPUBindGroupLayout;
2050
+ entries: gpuGPUBindGroupEntry[];
2051
+ }
2052
+ declare interface gpuGPUBindGroupEntry {
2053
+ binding: number;
2054
+ resource: gpuGPUBufferBinding | gpuGPUSampler;
2055
+ }
2056
+ declare interface gpuGPUBufferBinding {
2057
+ buffer: gpuGPUBuffer;
2058
+ offset?: number | bigint;
2059
+ size?: number | bigint;
2060
+ }
2061
+ declare interface gpuGPUSampler {}
2062
+ declare interface gpuGPUSamplerDescriptor {
2063
+ label?: string;
2064
+ addressModeU?: string;
2065
+ addressModeV?: string;
2066
+ addressModeW?: string;
2067
+ magFilter?: string;
2068
+ minFilter?: string;
2069
+ mipmapFilter?: string;
2070
+ lodMinClamp?: number;
2071
+ lodMaxClamp?: number;
2072
+ compare: string;
2073
+ maxAnisotropy?: number;
2074
+ }
2075
+ declare interface gpuGPUShaderModule {
2076
+ getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
2077
+ }
2078
+ declare interface gpuGPUShaderModuleDescriptor {
2079
+ label?: string;
2080
+ code: string;
2081
+ }
2082
+ declare interface gpuGPUPipelineLayout {}
2083
+ declare interface gpuGPUPipelineLayoutDescriptor {
2084
+ label?: string;
2085
+ bindGroupLayouts: gpuGPUBindGroupLayout[];
2086
+ }
2087
+ declare interface gpuGPUComputePipeline {
2088
+ getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
2089
+ }
2090
+ declare interface gpuGPUComputePipelineDescriptor {
2091
+ label?: string;
2092
+ compute: gpuGPUProgrammableStage;
2093
+ layout: string | gpuGPUPipelineLayout;
2094
+ }
2095
+ declare interface gpuGPUProgrammableStage {
2096
+ module: gpuGPUShaderModule;
2097
+ entryPoint: string;
2098
+ constants?: Record<string, number>;
2099
+ }
2100
+ declare interface gpuGPUCommandEncoder {
2101
+ get label(): string;
2102
+ beginComputePass(
2103
+ descriptor?: gpuGPUComputePassDescriptor
2104
+ ): gpuGPUComputePassEncoder;
2105
+ copyBufferToBuffer(
2106
+ source: gpuGPUBuffer,
2107
+ sourceOffset: number | bigint,
2108
+ destination: gpuGPUBuffer,
2109
+ destinationOffset: number | bigint,
2110
+ size: number | bigint
2111
+ ): void;
2112
+ finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2113
+ }
2114
+ declare interface gpuGPUCommandEncoderDescriptor {
2115
+ label?: string;
2116
+ }
2117
+ declare interface gpuGPUComputePassEncoder {
2118
+ setPipeline(pipeline: gpuGPUComputePipeline): void;
2119
+ setBindGroup(
2120
+ index: number,
2121
+ bindGroup: gpuGPUBindGroup | null,
2122
+ dynamicOffsets?: Iterable<number>
2123
+ ): void;
2124
+ dispatchWorkgroups(
2125
+ workgroupCountX: number,
2126
+ workgroupCountY?: number,
2127
+ workgroupCountZ?: number
2128
+ ): void;
2129
+ end(): void;
2130
+ }
2131
+ declare interface gpuGPUComputePassDescriptor {
2132
+ label?: string;
2133
+ timestampWrites?: gpuGPUComputePassTimestampWrite[];
2134
+ }
2135
+ declare interface gpuGPUQuerySet {}
2136
+ declare interface gpuGPUQuerySetDescriptor {
2137
+ label?: string;
2138
+ }
2139
+ declare interface gpuGPUComputePassTimestampWrite {
2140
+ querySet: gpuGPUQuerySet;
2141
+ queryIndex: number;
2142
+ location: string;
2143
+ }
2144
+ declare interface gpuGPUCommandBufferDescriptor {
2145
+ label?: string;
2146
+ }
2147
+ declare interface gpuGPUCommandBuffer {}
2148
+ declare interface gpuGPUQueue {
2149
+ submit(commandBuffers: gpuGPUCommandBuffer[]): void;
2150
+ writeBuffer(
2151
+ buffer: gpuGPUBuffer,
2152
+ bufferOffset: number | bigint,
2153
+ data: ArrayBuffer | ArrayBufferView,
2154
+ dataOffset?: number | bigint,
2155
+ size?: number | bigint
2156
+ ): void;
2157
+ }
2158
+ declare abstract class gpuGPUMapMode {
2159
+ static readonly READ: number;
2160
+ static readonly WRITE: number;
2161
+ }
2162
+ declare interface gpuGPURequestAdapterOptions {
2163
+ powerPreference: string;
2164
+ forceFallbackAdapter?: boolean;
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
+ }
1922
2230
  declare interface BasicImageTransformations {
1923
2231
  /**
1924
2232
  * Maximum width in image pixels. The value must be an integer.
@@ -3129,14 +3437,6 @@ declare interface VectorizeError {
3129
3437
  code?: number;
3130
3438
  error: string;
3131
3439
  }
3132
- /**
3133
- * A pre-configured list of known models.
3134
- * These can be supplied in place of configuring explicit dimensions.
3135
- */
3136
- declare type VectorizePreset =
3137
- | "openapi-text-embedding-ada-002"
3138
- | "workers-ai/bge-small-en"
3139
- | "cohere/embed-multilingual-v2.0";
3140
3440
  /**
3141
3441
  * Supported distance metrics for an index.
3142
3442
  * Distance metrics determine how other "similar" vectors are determined.
@@ -3156,7 +3456,7 @@ declare type VectorizeIndexConfig =
3156
3456
  metric: VectorizeDistanceMetric;
3157
3457
  }
3158
3458
  | {
3159
- 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
3160
3460
  };
3161
3461
  /**
3162
3462
  * Metadata about an existing index.
@@ -234,6 +234,14 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
234
234
  FixedLengthStream: typeof FixedLengthStream;
235
235
  IdentityTransformStream: typeof IdentityTransformStream;
236
236
  HTMLRewriter: typeof HTMLRewriter;
237
+ GPUAdapter: typeof gpuGPUAdapter;
238
+ GPUOutOfMemoryError: typeof gpuGPUOutOfMemoryError;
239
+ GPUValidationError: typeof gpuGPUValidationError;
240
+ GPUInternalError: typeof gpuGPUInternalError;
241
+ GPUDeviceLostInfo: typeof gpuGPUDeviceLostInfo;
242
+ GPUBufferUsage: typeof gpuGPUBufferUsage;
243
+ GPUShaderStage: typeof gpuGPUShaderStage;
244
+ GPUMapMode: typeof gpuGPUMapMode;
237
245
  }
238
246
  export declare function addEventListener<
239
247
  Type extends keyof WorkerGlobalScopeEventMap
@@ -351,6 +359,7 @@ export declare abstract class PromiseRejectionEvent extends Event {
351
359
  }
352
360
  export declare abstract class Navigator {
353
361
  readonly userAgent: string;
362
+ readonly gpu: gpuGPU;
354
363
  }
355
364
  /** Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */
356
365
  export interface Performance {
@@ -1924,6 +1933,305 @@ export interface SocketAddress {
1924
1933
  export interface TlsOptions {
1925
1934
  expectedServerHostname?: string;
1926
1935
  }
1936
+ export interface gpuGPU {
1937
+ requestAdapter(
1938
+ param1?: gpuGPURequestAdapterOptions
1939
+ ): Promise<gpuGPUAdapter | null>;
1940
+ }
1941
+ export declare abstract class gpuGPUAdapter {
1942
+ requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
1943
+ requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
1944
+ get features(): gpuGPUSupportedFeatures;
1945
+ get limits(): gpuGPUSupportedLimits;
1946
+ }
1947
+ export interface gpuGPUDevice extends EventTarget {
1948
+ createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
1949
+ createBindGroupLayout(
1950
+ descriptor: gpuGPUBindGroupLayoutDescriptor
1951
+ ): gpuGPUBindGroupLayout;
1952
+ createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
1953
+ createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
1954
+ createShaderModule(
1955
+ descriptor: gpuGPUShaderModuleDescriptor
1956
+ ): gpuGPUShaderModule;
1957
+ createPipelineLayout(
1958
+ descriptor: gpuGPUPipelineLayoutDescriptor
1959
+ ): gpuGPUPipelineLayout;
1960
+ createComputePipeline(
1961
+ descriptor: gpuGPUComputePipelineDescriptor
1962
+ ): gpuGPUComputePipeline;
1963
+ createCommandEncoder(
1964
+ descriptor?: gpuGPUCommandEncoderDescriptor
1965
+ ): gpuGPUCommandEncoder;
1966
+ destroy(): void;
1967
+ createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1968
+ pushErrorScope(filter: string): void;
1969
+ popErrorScope(): Promise<gpuGPUError | null>;
1970
+ get queue(): gpuGPUQueue;
1971
+ get lost(): Promise<gpuGPUDeviceLostInfo>;
1972
+ get features(): gpuGPUSupportedFeatures;
1973
+ get limits(): gpuGPUSupportedLimits;
1974
+ }
1975
+ export interface gpuGPUDeviceDescriptor {
1976
+ label?: string;
1977
+ requiredFeatures?: string[];
1978
+ requiredLimits?: Record<string, number | bigint>;
1979
+ defaultQueue?: gpuGPUQueueDescriptor;
1980
+ }
1981
+ export interface gpuGPUBufferDescriptor {
1982
+ label: string;
1983
+ size: number | bigint;
1984
+ usage: number;
1985
+ mappedAtCreation: boolean;
1986
+ }
1987
+ export interface gpuGPUQueueDescriptor {
1988
+ label?: string;
1989
+ }
1990
+ export declare abstract class gpuGPUBufferUsage {
1991
+ static readonly MAP_READ: number;
1992
+ static readonly MAP_WRITE: number;
1993
+ static readonly COPY_SRC: number;
1994
+ static readonly COPY_DST: number;
1995
+ static readonly INDEX: number;
1996
+ static readonly VERTEX: number;
1997
+ static readonly UNIFORM: number;
1998
+ static readonly STORAGE: number;
1999
+ static readonly INDIRECT: number;
2000
+ static readonly QUERY_RESOLVE: number;
2001
+ }
2002
+ export interface gpuGPUBuffer {
2003
+ getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
2004
+ unmap(): void;
2005
+ destroy(): void;
2006
+ mapAsync(
2007
+ mode: number,
2008
+ offset?: number | bigint,
2009
+ size?: number | bigint
2010
+ ): Promise<void>;
2011
+ get size(): number | bigint;
2012
+ get usage(): number;
2013
+ get mapState(): string;
2014
+ }
2015
+ export declare abstract class gpuGPUShaderStage {
2016
+ static readonly VERTEX: number;
2017
+ static readonly FRAGMENT: number;
2018
+ static readonly COMPUTE: number;
2019
+ }
2020
+ export interface gpuGPUBindGroupLayoutDescriptor {
2021
+ label?: string;
2022
+ entries: gpuGPUBindGroupLayoutEntry[];
2023
+ }
2024
+ export interface gpuGPUBindGroupLayoutEntry {
2025
+ binding: number;
2026
+ visibility: number;
2027
+ buffer?: gpuGPUBufferBindingLayout;
2028
+ sampler?: gpuGPUSamplerBindingLayout;
2029
+ texture?: gpuGPUTextureBindingLayout;
2030
+ storageTexture?: gpuGPUStorageTextureBindingLayout;
2031
+ }
2032
+ export interface gpuGPUStorageTextureBindingLayout {
2033
+ access?: string;
2034
+ format: string;
2035
+ viewDimension?: string;
2036
+ }
2037
+ export interface gpuGPUTextureBindingLayout {
2038
+ sampleType?: string;
2039
+ viewDimension?: string;
2040
+ multisampled?: boolean;
2041
+ }
2042
+ export interface gpuGPUSamplerBindingLayout {
2043
+ type?: string;
2044
+ }
2045
+ export interface gpuGPUBufferBindingLayout {
2046
+ type?: string;
2047
+ hasDynamicOffset?: boolean;
2048
+ minBindingSize?: number | bigint;
2049
+ }
2050
+ export interface gpuGPUBindGroupLayout {}
2051
+ export interface gpuGPUBindGroup {}
2052
+ export interface gpuGPUBindGroupDescriptor {
2053
+ label?: string;
2054
+ layout: gpuGPUBindGroupLayout;
2055
+ entries: gpuGPUBindGroupEntry[];
2056
+ }
2057
+ export interface gpuGPUBindGroupEntry {
2058
+ binding: number;
2059
+ resource: gpuGPUBufferBinding | gpuGPUSampler;
2060
+ }
2061
+ export interface gpuGPUBufferBinding {
2062
+ buffer: gpuGPUBuffer;
2063
+ offset?: number | bigint;
2064
+ size?: number | bigint;
2065
+ }
2066
+ export interface gpuGPUSampler {}
2067
+ export interface gpuGPUSamplerDescriptor {
2068
+ label?: string;
2069
+ addressModeU?: string;
2070
+ addressModeV?: string;
2071
+ addressModeW?: string;
2072
+ magFilter?: string;
2073
+ minFilter?: string;
2074
+ mipmapFilter?: string;
2075
+ lodMinClamp?: number;
2076
+ lodMaxClamp?: number;
2077
+ compare: string;
2078
+ maxAnisotropy?: number;
2079
+ }
2080
+ export interface gpuGPUShaderModule {
2081
+ getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
2082
+ }
2083
+ export interface gpuGPUShaderModuleDescriptor {
2084
+ label?: string;
2085
+ code: string;
2086
+ }
2087
+ export interface gpuGPUPipelineLayout {}
2088
+ export interface gpuGPUPipelineLayoutDescriptor {
2089
+ label?: string;
2090
+ bindGroupLayouts: gpuGPUBindGroupLayout[];
2091
+ }
2092
+ export interface gpuGPUComputePipeline {
2093
+ getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
2094
+ }
2095
+ export interface gpuGPUComputePipelineDescriptor {
2096
+ label?: string;
2097
+ compute: gpuGPUProgrammableStage;
2098
+ layout: string | gpuGPUPipelineLayout;
2099
+ }
2100
+ export interface gpuGPUProgrammableStage {
2101
+ module: gpuGPUShaderModule;
2102
+ entryPoint: string;
2103
+ constants?: Record<string, number>;
2104
+ }
2105
+ export interface gpuGPUCommandEncoder {
2106
+ get label(): string;
2107
+ beginComputePass(
2108
+ descriptor?: gpuGPUComputePassDescriptor
2109
+ ): gpuGPUComputePassEncoder;
2110
+ copyBufferToBuffer(
2111
+ source: gpuGPUBuffer,
2112
+ sourceOffset: number | bigint,
2113
+ destination: gpuGPUBuffer,
2114
+ destinationOffset: number | bigint,
2115
+ size: number | bigint
2116
+ ): void;
2117
+ finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2118
+ }
2119
+ export interface gpuGPUCommandEncoderDescriptor {
2120
+ label?: string;
2121
+ }
2122
+ export interface gpuGPUComputePassEncoder {
2123
+ setPipeline(pipeline: gpuGPUComputePipeline): void;
2124
+ setBindGroup(
2125
+ index: number,
2126
+ bindGroup: gpuGPUBindGroup | null,
2127
+ dynamicOffsets?: Iterable<number>
2128
+ ): void;
2129
+ dispatchWorkgroups(
2130
+ workgroupCountX: number,
2131
+ workgroupCountY?: number,
2132
+ workgroupCountZ?: number
2133
+ ): void;
2134
+ end(): void;
2135
+ }
2136
+ export interface gpuGPUComputePassDescriptor {
2137
+ label?: string;
2138
+ timestampWrites?: gpuGPUComputePassTimestampWrite[];
2139
+ }
2140
+ export interface gpuGPUQuerySet {}
2141
+ export interface gpuGPUQuerySetDescriptor {
2142
+ label?: string;
2143
+ }
2144
+ export interface gpuGPUComputePassTimestampWrite {
2145
+ querySet: gpuGPUQuerySet;
2146
+ queryIndex: number;
2147
+ location: string;
2148
+ }
2149
+ export interface gpuGPUCommandBufferDescriptor {
2150
+ label?: string;
2151
+ }
2152
+ export interface gpuGPUCommandBuffer {}
2153
+ export interface gpuGPUQueue {
2154
+ submit(commandBuffers: gpuGPUCommandBuffer[]): void;
2155
+ writeBuffer(
2156
+ buffer: gpuGPUBuffer,
2157
+ bufferOffset: number | bigint,
2158
+ data: ArrayBuffer | ArrayBufferView,
2159
+ dataOffset?: number | bigint,
2160
+ size?: number | bigint
2161
+ ): void;
2162
+ }
2163
+ export declare abstract class gpuGPUMapMode {
2164
+ static readonly READ: number;
2165
+ static readonly WRITE: number;
2166
+ }
2167
+ export interface gpuGPURequestAdapterOptions {
2168
+ powerPreference: string;
2169
+ forceFallbackAdapter?: boolean;
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
+ }
1927
2235
  export interface BasicImageTransformations {
1928
2236
  /**
1929
2237
  * Maximum width in image pixels. The value must be an integer.
@@ -3117,14 +3425,6 @@ export interface VectorizeError {
3117
3425
  code?: number;
3118
3426
  error: string;
3119
3427
  }
3120
- /**
3121
- * A pre-configured list of known models.
3122
- * These can be supplied in place of configuring explicit dimensions.
3123
- */
3124
- export type VectorizePreset =
3125
- | "openapi-text-embedding-ada-002"
3126
- | "workers-ai/bge-small-en"
3127
- | "cohere/embed-multilingual-v2.0";
3128
3428
  /**
3129
3429
  * Supported distance metrics for an index.
3130
3430
  * Distance metrics determine how other "similar" vectors are determined.
@@ -3144,7 +3444,7 @@ export type VectorizeIndexConfig =
3144
3444
  metric: VectorizeDistanceMetric;
3145
3445
  }
3146
3446
  | {
3147
- 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
3148
3448
  };
3149
3449
  /**
3150
3450
  * Metadata about an existing index.