@cloudflare/workers-types 4.20231016.0 → 4.20231121.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.
@@ -247,6 +247,8 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
247
247
  GPUBufferUsage: typeof gpuGPUBufferUsage;
248
248
  GPUShaderStage: typeof gpuGPUShaderStage;
249
249
  GPUMapMode: typeof gpuGPUMapMode;
250
+ GPUTextureUsage: typeof gpuGPUTextureUsage;
251
+ GPUColorWrite: typeof gpuGPUColorWrite;
250
252
  }
251
253
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
252
254
  type: Type,
@@ -361,6 +363,16 @@ declare abstract class PromiseRejectionEvent extends Event {
361
363
  readonly reason: any;
362
364
  }
363
365
  declare abstract class Navigator {
366
+ sendBeacon(
367
+ url: string,
368
+ body?:
369
+ | ReadableStream
370
+ | string
371
+ | (ArrayBuffer | ArrayBufferView)
372
+ | Blob
373
+ | URLSearchParams
374
+ | FormData
375
+ ): boolean;
364
376
  readonly userAgent: string;
365
377
  readonly gpu: gpuGPU;
366
378
  }
@@ -1977,9 +1989,13 @@ declare interface gpuGPUDevice extends EventTarget {
1977
1989
  createComputePipeline(
1978
1990
  descriptor: gpuGPUComputePipelineDescriptor
1979
1991
  ): gpuGPUComputePipeline;
1992
+ createRenderPipeline(
1993
+ descriptor: gpuGPURenderPipelineDescriptor
1994
+ ): gpuGPURenderPipeline;
1980
1995
  createCommandEncoder(
1981
1996
  descriptor?: gpuGPUCommandEncoderDescriptor
1982
1997
  ): gpuGPUCommandEncoder;
1998
+ createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
1983
1999
  destroy(): void;
1984
2000
  createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1985
2001
  pushErrorScope(filter: string): void;
@@ -2124,6 +2140,9 @@ declare interface gpuGPUCommandEncoder {
2124
2140
  beginComputePass(
2125
2141
  descriptor?: gpuGPUComputePassDescriptor
2126
2142
  ): gpuGPUComputePassEncoder;
2143
+ beginRenderPass(
2144
+ descriptor: gpuGPURenderPassDescriptor
2145
+ ): gpuGPURenderPassEncoder;
2127
2146
  copyBufferToBuffer(
2128
2147
  source: gpuGPUBuffer,
2129
2148
  sourceOffset: number | bigint,
@@ -2132,6 +2151,11 @@ declare interface gpuGPUCommandEncoder {
2132
2151
  size: number | bigint
2133
2152
  ): void;
2134
2153
  finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2154
+ copyTextureToBuffer(
2155
+ source: gpuGPUImageCopyTexture,
2156
+ destination: gpuGPUImageCopyBuffer,
2157
+ copySize: Iterable<number> | gpuGPUExtent3DDict
2158
+ ): void;
2135
2159
  }
2136
2160
  declare interface gpuGPUCommandEncoderDescriptor {
2137
2161
  label?: string;
@@ -2249,6 +2273,198 @@ declare interface gpuGPUCompilationMessage {
2249
2273
  declare interface gpuGPUCompilationInfo {
2250
2274
  get messages(): gpuGPUCompilationMessage[];
2251
2275
  }
2276
+ declare abstract class gpuGPUTextureUsage {
2277
+ static readonly COPY_SRC: number;
2278
+ static readonly COPY_DST: number;
2279
+ static readonly TEXTURE_BINDING: number;
2280
+ static readonly STORAGE_BINDING: number;
2281
+ static readonly RENDER_ATTACHMENT: number;
2282
+ }
2283
+ declare interface gpuGPUTextureDescriptor {
2284
+ label: string;
2285
+ size: number[] | gpuGPUExtent3DDict;
2286
+ mipLevelCount?: number;
2287
+ sampleCount?: number;
2288
+ dimension?: string;
2289
+ format: string;
2290
+ usage: number;
2291
+ viewFormats?: string[];
2292
+ }
2293
+ declare interface gpuGPUExtent3DDict {
2294
+ width: number;
2295
+ height?: number;
2296
+ depthOrArrayLayers?: number;
2297
+ }
2298
+ declare interface gpuGPUTexture {
2299
+ createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
2300
+ destroy(): void;
2301
+ get width(): number;
2302
+ get height(): number;
2303
+ get depthOrArrayLayers(): number;
2304
+ get mipLevelCount(): number;
2305
+ get dimension(): string;
2306
+ get format(): string;
2307
+ get usage(): number;
2308
+ }
2309
+ declare interface gpuGPUTextureView {}
2310
+ declare interface gpuGPUTextureViewDescriptor {
2311
+ label: string;
2312
+ format: string;
2313
+ dimension: string;
2314
+ aspect?: string;
2315
+ baseMipLevel?: number;
2316
+ mipLevelCount: number;
2317
+ baseArrayLayer?: number;
2318
+ arrayLayerCount: number;
2319
+ }
2320
+ declare abstract class gpuGPUColorWrite {
2321
+ static readonly RED: number;
2322
+ static readonly GREEN: number;
2323
+ static readonly BLUE: number;
2324
+ static readonly ALPHA: number;
2325
+ static readonly ALL: number;
2326
+ }
2327
+ declare interface gpuGPURenderPipeline {}
2328
+ declare interface gpuGPURenderPipelineDescriptor {
2329
+ label?: string;
2330
+ layout: string | gpuGPUPipelineLayout;
2331
+ vertex: gpuGPUVertexState;
2332
+ primitive?: gpuGPUPrimitiveState;
2333
+ depthStencil?: gpuGPUDepthStencilState;
2334
+ multisample?: gpuGPUMultisampleState;
2335
+ fragment?: gpuGPUFragmentState;
2336
+ }
2337
+ declare interface gpuGPUVertexState {
2338
+ module: gpuGPUShaderModule;
2339
+ entryPoint: string;
2340
+ constants?: Record<string, number>;
2341
+ buffers?: gpuGPUVertexBufferLayout[];
2342
+ }
2343
+ declare interface gpuGPUVertexBufferLayout {
2344
+ arrayStride: number | bigint;
2345
+ stepMode?: string;
2346
+ attributes: gpuGPUVertexAttribute[];
2347
+ }
2348
+ declare interface gpuGPUVertexAttribute {
2349
+ format: string;
2350
+ offset: number | bigint;
2351
+ shaderLocation: number;
2352
+ }
2353
+ declare interface gpuGPUPrimitiveState {
2354
+ topology?: string;
2355
+ stripIndexFormat?: string;
2356
+ frontFace?: string;
2357
+ cullMode?: string;
2358
+ unclippedDepth?: boolean;
2359
+ }
2360
+ declare interface gpuGPUStencilFaceState {
2361
+ compare?: string;
2362
+ failOp?: string;
2363
+ depthFailOp?: string;
2364
+ passOp?: string;
2365
+ }
2366
+ declare interface gpuGPUDepthStencilState {
2367
+ format: string;
2368
+ depthWriteEnabled: boolean;
2369
+ depthCompare: string;
2370
+ stencilFront?: gpuGPUStencilFaceState;
2371
+ stencilBack?: gpuGPUStencilFaceState;
2372
+ stencilReadMask?: number;
2373
+ stencilWriteMask?: number;
2374
+ depthBias?: number;
2375
+ depthBiasSlopeScale?: number;
2376
+ depthBiasClamp?: number;
2377
+ }
2378
+ declare interface gpuGPUMultisampleState {
2379
+ count?: number;
2380
+ mask?: number;
2381
+ alphaToCoverageEnabled?: boolean;
2382
+ }
2383
+ declare interface gpuGPUFragmentState {
2384
+ module: gpuGPUShaderModule;
2385
+ entryPoint: string;
2386
+ constants?: Record<string, number>;
2387
+ targets: gpuGPUColorTargetState[];
2388
+ }
2389
+ declare interface gpuGPUColorTargetState {
2390
+ format: string;
2391
+ blend: gpuGPUBlendState;
2392
+ writeMask?: number;
2393
+ }
2394
+ declare interface gpuGPUBlendState {
2395
+ color: gpuGPUBlendComponent;
2396
+ alpha: gpuGPUBlendComponent;
2397
+ }
2398
+ declare interface gpuGPUBlendComponent {
2399
+ operation?: string;
2400
+ srcFactor?: string;
2401
+ dstFactor?: string;
2402
+ }
2403
+ declare interface gpuGPURenderPassEncoder {
2404
+ setPipeline(pipeline: gpuGPURenderPipeline): void;
2405
+ draw(
2406
+ vertexCount: number,
2407
+ instanceCount?: number,
2408
+ firstVertex?: number,
2409
+ firstInstance?: number
2410
+ ): void;
2411
+ end(): void;
2412
+ }
2413
+ declare interface gpuGPURenderPassDescriptor {
2414
+ label?: string;
2415
+ colorAttachments: gpuGPURenderPassColorAttachment[];
2416
+ depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2417
+ occlusionQuerySet?: gpuGPUQuerySet;
2418
+ timestampWrites?: gpuGPURenderPassTimestampWrite[];
2419
+ maxDrawCount?: number | bigint;
2420
+ }
2421
+ declare interface gpuGPURenderPassColorAttachment {
2422
+ view: gpuGPUTextureView;
2423
+ depthSlice?: number;
2424
+ resolveTarget?: gpuGPUTextureView;
2425
+ clearValue?: number[] | gpuGPUColorDict;
2426
+ loadOp: string;
2427
+ storeOp: string;
2428
+ }
2429
+ declare interface gpuGPUColorDict {
2430
+ r: number;
2431
+ g: number;
2432
+ b: number;
2433
+ a: number;
2434
+ }
2435
+ declare interface gpuGPURenderPassDepthStencilAttachment {
2436
+ view: gpuGPUTextureView;
2437
+ depthClearValue?: number;
2438
+ depthLoadOp?: string;
2439
+ depthStoreOp?: string;
2440
+ depthReadOnly?: boolean;
2441
+ stencilClearValue?: number;
2442
+ stencilLoadOp?: string;
2443
+ stencilStoreOp?: string;
2444
+ stencilReadOnly?: boolean;
2445
+ }
2446
+ declare interface gpuGPURenderPassTimestampWrite {
2447
+ querySet: gpuGPUQuerySet;
2448
+ queryIndex: number;
2449
+ location: string;
2450
+ }
2451
+ declare interface gpuGPUImageCopyTexture {
2452
+ texture: gpuGPUTexture;
2453
+ mipLevel?: number;
2454
+ origin?: number[] | gpuGPUOrigin3DDict;
2455
+ aspect?: string;
2456
+ }
2457
+ declare interface gpuGPUImageCopyBuffer {
2458
+ buffer: gpuGPUBuffer;
2459
+ offset?: number | bigint;
2460
+ bytesPerRow?: number;
2461
+ rowsPerImage?: number;
2462
+ }
2463
+ declare interface gpuGPUOrigin3DDict {
2464
+ x?: number;
2465
+ y?: number;
2466
+ z?: number;
2467
+ }
2252
2468
  declare interface BasicImageTransformations {
2253
2469
  /**
2254
2470
  * Maximum width in image pixels. The value must be an integer.
@@ -3220,10 +3436,19 @@ declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
3220
3436
  declare type CfProperties<HostMetadata = unknown> =
3221
3437
  | IncomingRequestCfProperties<HostMetadata>
3222
3438
  | RequestInitCfProperties;
3439
+ declare interface D1Meta {
3440
+ duration: number;
3441
+ size_after: number;
3442
+ rows_read: number;
3443
+ rows_written: number;
3444
+ last_row_id: number;
3445
+ changed_db: boolean;
3446
+ changes: number;
3447
+ }
3223
3448
  declare interface D1Result<T = unknown> {
3224
3449
  results: T[];
3225
3450
  success: true;
3226
- meta: any;
3451
+ meta: D1Meta & Record<string, unknown>;
3227
3452
  error?: never;
3228
3453
  }
3229
3454
  declare interface D1ExecResult {
@@ -3467,7 +3692,8 @@ declare type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
3467
3692
  declare interface VectorizeQueryOptions {
3468
3693
  topK?: number;
3469
3694
  namespace?: string;
3470
- returnVectors?: boolean;
3695
+ returnValues?: boolean;
3696
+ returnMetadata?: boolean;
3471
3697
  }
3472
3698
  /**
3473
3699
  * Information about the configuration of an index.
@@ -3505,20 +3731,17 @@ declare interface VectorizeVector {
3505
3731
  values: VectorFloatArray | number[];
3506
3732
  /** The namespace this vector belongs to. */
3507
3733
  namespace?: string;
3508
- /** Metadata associated with the binding. Includes the values of the other fields and potentially additional details. */
3734
+ /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
3509
3735
  metadata?: Record<string, VectorizeVectorMetadata>;
3510
3736
  }
3511
3737
  /**
3512
3738
  * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
3513
3739
  */
3514
- declare interface VectorizeMatch {
3515
- /** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */
3516
- vectorId: string;
3517
- /** The score or rank for similarity, when returned as a result */
3518
- score: number;
3519
- /** Vector data for the match. Included only if the user specified they want it returned (via {@link VectorizeQueryOptions}). */
3520
- vector?: VectorizeVector;
3521
- }
3740
+ declare type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
3741
+ Omit<VectorizeVector, "values"> & {
3742
+ /** The score or rank for similarity, when returned as a result */
3743
+ score: number;
3744
+ };
3522
3745
  /**
3523
3746
  * A set of vector {@link VectorizeMatch} for a particular query.
3524
3747
  */
@@ -247,6 +247,8 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
247
247
  GPUBufferUsage: typeof gpuGPUBufferUsage;
248
248
  GPUShaderStage: typeof gpuGPUShaderStage;
249
249
  GPUMapMode: typeof gpuGPUMapMode;
250
+ GPUTextureUsage: typeof gpuGPUTextureUsage;
251
+ GPUColorWrite: typeof gpuGPUColorWrite;
250
252
  }
251
253
  export declare function addEventListener<
252
254
  Type extends keyof WorkerGlobalScopeEventMap
@@ -363,6 +365,16 @@ export declare abstract class PromiseRejectionEvent extends Event {
363
365
  readonly reason: any;
364
366
  }
365
367
  export declare abstract class Navigator {
368
+ sendBeacon(
369
+ url: string,
370
+ body?:
371
+ | ReadableStream
372
+ | string
373
+ | (ArrayBuffer | ArrayBufferView)
374
+ | Blob
375
+ | URLSearchParams
376
+ | FormData
377
+ ): boolean;
366
378
  readonly userAgent: string;
367
379
  readonly gpu: gpuGPU;
368
380
  }
@@ -1982,9 +1994,13 @@ export interface gpuGPUDevice extends EventTarget {
1982
1994
  createComputePipeline(
1983
1995
  descriptor: gpuGPUComputePipelineDescriptor
1984
1996
  ): gpuGPUComputePipeline;
1997
+ createRenderPipeline(
1998
+ descriptor: gpuGPURenderPipelineDescriptor
1999
+ ): gpuGPURenderPipeline;
1985
2000
  createCommandEncoder(
1986
2001
  descriptor?: gpuGPUCommandEncoderDescriptor
1987
2002
  ): gpuGPUCommandEncoder;
2003
+ createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
1988
2004
  destroy(): void;
1989
2005
  createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1990
2006
  pushErrorScope(filter: string): void;
@@ -2129,6 +2145,9 @@ export interface gpuGPUCommandEncoder {
2129
2145
  beginComputePass(
2130
2146
  descriptor?: gpuGPUComputePassDescriptor
2131
2147
  ): gpuGPUComputePassEncoder;
2148
+ beginRenderPass(
2149
+ descriptor: gpuGPURenderPassDescriptor
2150
+ ): gpuGPURenderPassEncoder;
2132
2151
  copyBufferToBuffer(
2133
2152
  source: gpuGPUBuffer,
2134
2153
  sourceOffset: number | bigint,
@@ -2137,6 +2156,11 @@ export interface gpuGPUCommandEncoder {
2137
2156
  size: number | bigint
2138
2157
  ): void;
2139
2158
  finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2159
+ copyTextureToBuffer(
2160
+ source: gpuGPUImageCopyTexture,
2161
+ destination: gpuGPUImageCopyBuffer,
2162
+ copySize: Iterable<number> | gpuGPUExtent3DDict
2163
+ ): void;
2140
2164
  }
2141
2165
  export interface gpuGPUCommandEncoderDescriptor {
2142
2166
  label?: string;
@@ -2254,6 +2278,198 @@ export interface gpuGPUCompilationMessage {
2254
2278
  export interface gpuGPUCompilationInfo {
2255
2279
  get messages(): gpuGPUCompilationMessage[];
2256
2280
  }
2281
+ export declare abstract class gpuGPUTextureUsage {
2282
+ static readonly COPY_SRC: number;
2283
+ static readonly COPY_DST: number;
2284
+ static readonly TEXTURE_BINDING: number;
2285
+ static readonly STORAGE_BINDING: number;
2286
+ static readonly RENDER_ATTACHMENT: number;
2287
+ }
2288
+ export interface gpuGPUTextureDescriptor {
2289
+ label: string;
2290
+ size: number[] | gpuGPUExtent3DDict;
2291
+ mipLevelCount?: number;
2292
+ sampleCount?: number;
2293
+ dimension?: string;
2294
+ format: string;
2295
+ usage: number;
2296
+ viewFormats?: string[];
2297
+ }
2298
+ export interface gpuGPUExtent3DDict {
2299
+ width: number;
2300
+ height?: number;
2301
+ depthOrArrayLayers?: number;
2302
+ }
2303
+ export interface gpuGPUTexture {
2304
+ createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
2305
+ destroy(): void;
2306
+ get width(): number;
2307
+ get height(): number;
2308
+ get depthOrArrayLayers(): number;
2309
+ get mipLevelCount(): number;
2310
+ get dimension(): string;
2311
+ get format(): string;
2312
+ get usage(): number;
2313
+ }
2314
+ export interface gpuGPUTextureView {}
2315
+ export interface gpuGPUTextureViewDescriptor {
2316
+ label: string;
2317
+ format: string;
2318
+ dimension: string;
2319
+ aspect?: string;
2320
+ baseMipLevel?: number;
2321
+ mipLevelCount: number;
2322
+ baseArrayLayer?: number;
2323
+ arrayLayerCount: number;
2324
+ }
2325
+ export declare abstract class gpuGPUColorWrite {
2326
+ static readonly RED: number;
2327
+ static readonly GREEN: number;
2328
+ static readonly BLUE: number;
2329
+ static readonly ALPHA: number;
2330
+ static readonly ALL: number;
2331
+ }
2332
+ export interface gpuGPURenderPipeline {}
2333
+ export interface gpuGPURenderPipelineDescriptor {
2334
+ label?: string;
2335
+ layout: string | gpuGPUPipelineLayout;
2336
+ vertex: gpuGPUVertexState;
2337
+ primitive?: gpuGPUPrimitiveState;
2338
+ depthStencil?: gpuGPUDepthStencilState;
2339
+ multisample?: gpuGPUMultisampleState;
2340
+ fragment?: gpuGPUFragmentState;
2341
+ }
2342
+ export interface gpuGPUVertexState {
2343
+ module: gpuGPUShaderModule;
2344
+ entryPoint: string;
2345
+ constants?: Record<string, number>;
2346
+ buffers?: gpuGPUVertexBufferLayout[];
2347
+ }
2348
+ export interface gpuGPUVertexBufferLayout {
2349
+ arrayStride: number | bigint;
2350
+ stepMode?: string;
2351
+ attributes: gpuGPUVertexAttribute[];
2352
+ }
2353
+ export interface gpuGPUVertexAttribute {
2354
+ format: string;
2355
+ offset: number | bigint;
2356
+ shaderLocation: number;
2357
+ }
2358
+ export interface gpuGPUPrimitiveState {
2359
+ topology?: string;
2360
+ stripIndexFormat?: string;
2361
+ frontFace?: string;
2362
+ cullMode?: string;
2363
+ unclippedDepth?: boolean;
2364
+ }
2365
+ export interface gpuGPUStencilFaceState {
2366
+ compare?: string;
2367
+ failOp?: string;
2368
+ depthFailOp?: string;
2369
+ passOp?: string;
2370
+ }
2371
+ export interface gpuGPUDepthStencilState {
2372
+ format: string;
2373
+ depthWriteEnabled: boolean;
2374
+ depthCompare: string;
2375
+ stencilFront?: gpuGPUStencilFaceState;
2376
+ stencilBack?: gpuGPUStencilFaceState;
2377
+ stencilReadMask?: number;
2378
+ stencilWriteMask?: number;
2379
+ depthBias?: number;
2380
+ depthBiasSlopeScale?: number;
2381
+ depthBiasClamp?: number;
2382
+ }
2383
+ export interface gpuGPUMultisampleState {
2384
+ count?: number;
2385
+ mask?: number;
2386
+ alphaToCoverageEnabled?: boolean;
2387
+ }
2388
+ export interface gpuGPUFragmentState {
2389
+ module: gpuGPUShaderModule;
2390
+ entryPoint: string;
2391
+ constants?: Record<string, number>;
2392
+ targets: gpuGPUColorTargetState[];
2393
+ }
2394
+ export interface gpuGPUColorTargetState {
2395
+ format: string;
2396
+ blend: gpuGPUBlendState;
2397
+ writeMask?: number;
2398
+ }
2399
+ export interface gpuGPUBlendState {
2400
+ color: gpuGPUBlendComponent;
2401
+ alpha: gpuGPUBlendComponent;
2402
+ }
2403
+ export interface gpuGPUBlendComponent {
2404
+ operation?: string;
2405
+ srcFactor?: string;
2406
+ dstFactor?: string;
2407
+ }
2408
+ export interface gpuGPURenderPassEncoder {
2409
+ setPipeline(pipeline: gpuGPURenderPipeline): void;
2410
+ draw(
2411
+ vertexCount: number,
2412
+ instanceCount?: number,
2413
+ firstVertex?: number,
2414
+ firstInstance?: number
2415
+ ): void;
2416
+ end(): void;
2417
+ }
2418
+ export interface gpuGPURenderPassDescriptor {
2419
+ label?: string;
2420
+ colorAttachments: gpuGPURenderPassColorAttachment[];
2421
+ depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2422
+ occlusionQuerySet?: gpuGPUQuerySet;
2423
+ timestampWrites?: gpuGPURenderPassTimestampWrite[];
2424
+ maxDrawCount?: number | bigint;
2425
+ }
2426
+ export interface gpuGPURenderPassColorAttachment {
2427
+ view: gpuGPUTextureView;
2428
+ depthSlice?: number;
2429
+ resolveTarget?: gpuGPUTextureView;
2430
+ clearValue?: number[] | gpuGPUColorDict;
2431
+ loadOp: string;
2432
+ storeOp: string;
2433
+ }
2434
+ export interface gpuGPUColorDict {
2435
+ r: number;
2436
+ g: number;
2437
+ b: number;
2438
+ a: number;
2439
+ }
2440
+ export interface gpuGPURenderPassDepthStencilAttachment {
2441
+ view: gpuGPUTextureView;
2442
+ depthClearValue?: number;
2443
+ depthLoadOp?: string;
2444
+ depthStoreOp?: string;
2445
+ depthReadOnly?: boolean;
2446
+ stencilClearValue?: number;
2447
+ stencilLoadOp?: string;
2448
+ stencilStoreOp?: string;
2449
+ stencilReadOnly?: boolean;
2450
+ }
2451
+ export interface gpuGPURenderPassTimestampWrite {
2452
+ querySet: gpuGPUQuerySet;
2453
+ queryIndex: number;
2454
+ location: string;
2455
+ }
2456
+ export interface gpuGPUImageCopyTexture {
2457
+ texture: gpuGPUTexture;
2458
+ mipLevel?: number;
2459
+ origin?: number[] | gpuGPUOrigin3DDict;
2460
+ aspect?: string;
2461
+ }
2462
+ export interface gpuGPUImageCopyBuffer {
2463
+ buffer: gpuGPUBuffer;
2464
+ offset?: number | bigint;
2465
+ bytesPerRow?: number;
2466
+ rowsPerImage?: number;
2467
+ }
2468
+ export interface gpuGPUOrigin3DDict {
2469
+ x?: number;
2470
+ y?: number;
2471
+ z?: number;
2472
+ }
2257
2473
  export interface BasicImageTransformations {
2258
2474
  /**
2259
2475
  * Maximum width in image pixels. The value must be an integer.
@@ -3225,10 +3441,19 @@ export type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
3225
3441
  export type CfProperties<HostMetadata = unknown> =
3226
3442
  | IncomingRequestCfProperties<HostMetadata>
3227
3443
  | RequestInitCfProperties;
3444
+ export interface D1Meta {
3445
+ duration: number;
3446
+ size_after: number;
3447
+ rows_read: number;
3448
+ rows_written: number;
3449
+ last_row_id: number;
3450
+ changed_db: boolean;
3451
+ changes: number;
3452
+ }
3228
3453
  export interface D1Result<T = unknown> {
3229
3454
  results: T[];
3230
3455
  success: true;
3231
- meta: any;
3456
+ meta: D1Meta & Record<string, unknown>;
3232
3457
  error?: never;
3233
3458
  }
3234
3459
  export interface D1ExecResult {
@@ -3455,7 +3680,8 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
3455
3680
  export interface VectorizeQueryOptions {
3456
3681
  topK?: number;
3457
3682
  namespace?: string;
3458
- returnVectors?: boolean;
3683
+ returnValues?: boolean;
3684
+ returnMetadata?: boolean;
3459
3685
  }
3460
3686
  /**
3461
3687
  * Information about the configuration of an index.
@@ -3493,20 +3719,17 @@ export interface VectorizeVector {
3493
3719
  values: VectorFloatArray | number[];
3494
3720
  /** The namespace this vector belongs to. */
3495
3721
  namespace?: string;
3496
- /** Metadata associated with the binding. Includes the values of the other fields and potentially additional details. */
3722
+ /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
3497
3723
  metadata?: Record<string, VectorizeVectorMetadata>;
3498
3724
  }
3499
3725
  /**
3500
3726
  * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
3501
3727
  */
3502
- export interface VectorizeMatch {
3503
- /** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */
3504
- vectorId: string;
3505
- /** The score or rank for similarity, when returned as a result */
3506
- score: number;
3507
- /** Vector data for the match. Included only if the user specified they want it returned (via {@link VectorizeQueryOptions}). */
3508
- vector?: VectorizeVector;
3509
- }
3728
+ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
3729
+ Omit<VectorizeVector, "values"> & {
3730
+ /** The score or rank for similarity, when returned as a result */
3731
+ score: number;
3732
+ };
3510
3733
  /**
3511
3734
  * A set of vector {@link VectorizeMatch} for a particular query.
3512
3735
  */