@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.
@@ -241,6 +241,8 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
241
241
  GPUBufferUsage: typeof gpuGPUBufferUsage;
242
242
  GPUShaderStage: typeof gpuGPUShaderStage;
243
243
  GPUMapMode: typeof gpuGPUMapMode;
244
+ GPUTextureUsage: typeof gpuGPUTextureUsage;
245
+ GPUColorWrite: typeof gpuGPUColorWrite;
244
246
  }
245
247
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
246
248
  type: Type,
@@ -1977,9 +1979,13 @@ declare interface gpuGPUDevice extends EventTarget {
1977
1979
  createComputePipeline(
1978
1980
  descriptor: gpuGPUComputePipelineDescriptor
1979
1981
  ): gpuGPUComputePipeline;
1982
+ createRenderPipeline(
1983
+ descriptor: gpuGPURenderPipelineDescriptor
1984
+ ): gpuGPURenderPipeline;
1980
1985
  createCommandEncoder(
1981
1986
  descriptor?: gpuGPUCommandEncoderDescriptor
1982
1987
  ): gpuGPUCommandEncoder;
1988
+ createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
1983
1989
  destroy(): void;
1984
1990
  createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1985
1991
  pushErrorScope(filter: string): void;
@@ -2124,6 +2130,9 @@ declare interface gpuGPUCommandEncoder {
2124
2130
  beginComputePass(
2125
2131
  descriptor?: gpuGPUComputePassDescriptor
2126
2132
  ): gpuGPUComputePassEncoder;
2133
+ beginRenderPass(
2134
+ descriptor: gpuGPURenderPassDescriptor
2135
+ ): gpuGPURenderPassEncoder;
2127
2136
  copyBufferToBuffer(
2128
2137
  source: gpuGPUBuffer,
2129
2138
  sourceOffset: number | bigint,
@@ -2132,6 +2141,11 @@ declare interface gpuGPUCommandEncoder {
2132
2141
  size: number | bigint
2133
2142
  ): void;
2134
2143
  finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2144
+ copyTextureToBuffer(
2145
+ source: gpuGPUImageCopyTexture,
2146
+ destination: gpuGPUImageCopyBuffer,
2147
+ copySize: Iterable<number> | gpuGPUExtent3DDict
2148
+ ): void;
2135
2149
  }
2136
2150
  declare interface gpuGPUCommandEncoderDescriptor {
2137
2151
  label?: string;
@@ -2245,6 +2259,198 @@ declare interface gpuGPUCompilationMessage {
2245
2259
  declare interface gpuGPUCompilationInfo {
2246
2260
  get messages(): gpuGPUCompilationMessage[];
2247
2261
  }
2262
+ declare abstract class gpuGPUTextureUsage {
2263
+ static readonly COPY_SRC: number;
2264
+ static readonly COPY_DST: number;
2265
+ static readonly TEXTURE_BINDING: number;
2266
+ static readonly STORAGE_BINDING: number;
2267
+ static readonly RENDER_ATTACHMENT: number;
2268
+ }
2269
+ declare interface gpuGPUTextureDescriptor {
2270
+ label: string;
2271
+ size: number[] | gpuGPUExtent3DDict;
2272
+ mipLevelCount?: number;
2273
+ sampleCount?: number;
2274
+ dimension?: string;
2275
+ format: string;
2276
+ usage: number;
2277
+ viewFormats?: string[];
2278
+ }
2279
+ declare interface gpuGPUExtent3DDict {
2280
+ width: number;
2281
+ height?: number;
2282
+ depthOrArrayLayers?: number;
2283
+ }
2284
+ declare interface gpuGPUTexture {
2285
+ createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
2286
+ destroy(): void;
2287
+ get width(): number;
2288
+ get height(): number;
2289
+ get depthOrArrayLayers(): number;
2290
+ get mipLevelCount(): number;
2291
+ get dimension(): string;
2292
+ get format(): string;
2293
+ get usage(): number;
2294
+ }
2295
+ declare interface gpuGPUTextureView {}
2296
+ declare interface gpuGPUTextureViewDescriptor {
2297
+ label: string;
2298
+ format: string;
2299
+ dimension: string;
2300
+ aspect?: string;
2301
+ baseMipLevel?: number;
2302
+ mipLevelCount: number;
2303
+ baseArrayLayer?: number;
2304
+ arrayLayerCount: number;
2305
+ }
2306
+ declare abstract class gpuGPUColorWrite {
2307
+ static readonly RED: number;
2308
+ static readonly GREEN: number;
2309
+ static readonly BLUE: number;
2310
+ static readonly ALPHA: number;
2311
+ static readonly ALL: number;
2312
+ }
2313
+ declare interface gpuGPURenderPipeline {}
2314
+ declare interface gpuGPURenderPipelineDescriptor {
2315
+ label?: string;
2316
+ layout: string | gpuGPUPipelineLayout;
2317
+ vertex: gpuGPUVertexState;
2318
+ primitive?: gpuGPUPrimitiveState;
2319
+ depthStencil?: gpuGPUDepthStencilState;
2320
+ multisample?: gpuGPUMultisampleState;
2321
+ fragment?: gpuGPUFragmentState;
2322
+ }
2323
+ declare interface gpuGPUVertexState {
2324
+ module: gpuGPUShaderModule;
2325
+ entryPoint: string;
2326
+ constants?: Record<string, number>;
2327
+ buffers?: gpuGPUVertexBufferLayout[];
2328
+ }
2329
+ declare interface gpuGPUVertexBufferLayout {
2330
+ arrayStride: number | bigint;
2331
+ stepMode?: string;
2332
+ attributes: gpuGPUVertexAttribute[];
2333
+ }
2334
+ declare interface gpuGPUVertexAttribute {
2335
+ format: string;
2336
+ offset: number | bigint;
2337
+ shaderLocation: number;
2338
+ }
2339
+ declare interface gpuGPUPrimitiveState {
2340
+ topology?: string;
2341
+ stripIndexFormat?: string;
2342
+ frontFace?: string;
2343
+ cullMode?: string;
2344
+ unclippedDepth?: boolean;
2345
+ }
2346
+ declare interface gpuGPUStencilFaceState {
2347
+ compare?: string;
2348
+ failOp?: string;
2349
+ depthFailOp?: string;
2350
+ passOp?: string;
2351
+ }
2352
+ declare interface gpuGPUDepthStencilState {
2353
+ format: string;
2354
+ depthWriteEnabled: boolean;
2355
+ depthCompare: string;
2356
+ stencilFront?: gpuGPUStencilFaceState;
2357
+ stencilBack?: gpuGPUStencilFaceState;
2358
+ stencilReadMask?: number;
2359
+ stencilWriteMask?: number;
2360
+ depthBias?: number;
2361
+ depthBiasSlopeScale?: number;
2362
+ depthBiasClamp?: number;
2363
+ }
2364
+ declare interface gpuGPUMultisampleState {
2365
+ count?: number;
2366
+ mask?: number;
2367
+ alphaToCoverageEnabled?: boolean;
2368
+ }
2369
+ declare interface gpuGPUFragmentState {
2370
+ module: gpuGPUShaderModule;
2371
+ entryPoint: string;
2372
+ constants?: Record<string, number>;
2373
+ targets: gpuGPUColorTargetState[];
2374
+ }
2375
+ declare interface gpuGPUColorTargetState {
2376
+ format: string;
2377
+ blend: gpuGPUBlendState;
2378
+ writeMask?: number;
2379
+ }
2380
+ declare interface gpuGPUBlendState {
2381
+ color: gpuGPUBlendComponent;
2382
+ alpha: gpuGPUBlendComponent;
2383
+ }
2384
+ declare interface gpuGPUBlendComponent {
2385
+ operation?: string;
2386
+ srcFactor?: string;
2387
+ dstFactor?: string;
2388
+ }
2389
+ declare interface gpuGPURenderPassEncoder {
2390
+ setPipeline(pipeline: gpuGPURenderPipeline): void;
2391
+ draw(
2392
+ vertexCount: number,
2393
+ instanceCount?: number,
2394
+ firstVertex?: number,
2395
+ firstInstance?: number
2396
+ ): void;
2397
+ end(): void;
2398
+ }
2399
+ declare interface gpuGPURenderPassDescriptor {
2400
+ label?: string;
2401
+ colorAttachments: gpuGPURenderPassColorAttachment[];
2402
+ depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2403
+ occlusionQuerySet?: gpuGPUQuerySet;
2404
+ timestampWrites?: gpuGPURenderPassTimestampWrite[];
2405
+ maxDrawCount?: number | bigint;
2406
+ }
2407
+ declare interface gpuGPURenderPassColorAttachment {
2408
+ view: gpuGPUTextureView;
2409
+ depthSlice?: number;
2410
+ resolveTarget?: gpuGPUTextureView;
2411
+ clearValue?: number[] | gpuGPUColorDict;
2412
+ loadOp: string;
2413
+ storeOp: string;
2414
+ }
2415
+ declare interface gpuGPUColorDict {
2416
+ r: number;
2417
+ g: number;
2418
+ b: number;
2419
+ a: number;
2420
+ }
2421
+ declare interface gpuGPURenderPassDepthStencilAttachment {
2422
+ view: gpuGPUTextureView;
2423
+ depthClearValue?: number;
2424
+ depthLoadOp?: string;
2425
+ depthStoreOp?: string;
2426
+ depthReadOnly?: boolean;
2427
+ stencilClearValue?: number;
2428
+ stencilLoadOp?: string;
2429
+ stencilStoreOp?: string;
2430
+ stencilReadOnly?: boolean;
2431
+ }
2432
+ declare interface gpuGPURenderPassTimestampWrite {
2433
+ querySet: gpuGPUQuerySet;
2434
+ queryIndex: number;
2435
+ location: string;
2436
+ }
2437
+ declare interface gpuGPUImageCopyTexture {
2438
+ texture: gpuGPUTexture;
2439
+ mipLevel?: number;
2440
+ origin?: number[] | gpuGPUOrigin3DDict;
2441
+ aspect?: string;
2442
+ }
2443
+ declare interface gpuGPUImageCopyBuffer {
2444
+ buffer: gpuGPUBuffer;
2445
+ offset?: number | bigint;
2446
+ bytesPerRow?: number;
2447
+ rowsPerImage?: number;
2448
+ }
2449
+ declare interface gpuGPUOrigin3DDict {
2450
+ x?: number;
2451
+ y?: number;
2452
+ z?: number;
2453
+ }
2248
2454
  declare interface BasicImageTransformations {
2249
2455
  /**
2250
2456
  * Maximum width in image pixels. The value must be an integer.
@@ -3216,10 +3422,19 @@ declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
3216
3422
  declare type CfProperties<HostMetadata = unknown> =
3217
3423
  | IncomingRequestCfProperties<HostMetadata>
3218
3424
  | RequestInitCfProperties;
3425
+ declare interface D1Meta {
3426
+ duration: number;
3427
+ size_after: number;
3428
+ rows_read: number;
3429
+ rows_written: number;
3430
+ last_row_id: number;
3431
+ changed_db: boolean;
3432
+ changes: number;
3433
+ }
3219
3434
  declare interface D1Result<T = unknown> {
3220
3435
  results: T[];
3221
3436
  success: true;
3222
- meta: any;
3437
+ meta: D1Meta & Record<string, unknown>;
3223
3438
  error?: never;
3224
3439
  }
3225
3440
  declare interface D1ExecResult {
@@ -3463,7 +3678,8 @@ declare type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
3463
3678
  declare interface VectorizeQueryOptions {
3464
3679
  topK?: number;
3465
3680
  namespace?: string;
3466
- returnVectors?: boolean;
3681
+ returnValues?: boolean;
3682
+ returnMetadata?: boolean;
3467
3683
  }
3468
3684
  /**
3469
3685
  * Information about the configuration of an index.
@@ -3501,20 +3717,17 @@ declare interface VectorizeVector {
3501
3717
  values: VectorFloatArray | number[];
3502
3718
  /** The namespace this vector belongs to. */
3503
3719
  namespace?: string;
3504
- /** Metadata associated with the binding. Includes the values of the other fields and potentially additional details. */
3720
+ /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
3505
3721
  metadata?: Record<string, VectorizeVectorMetadata>;
3506
3722
  }
3507
3723
  /**
3508
3724
  * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
3509
3725
  */
3510
- declare interface VectorizeMatch {
3511
- /** 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. */
3512
- vectorId: string;
3513
- /** The score or rank for similarity, when returned as a result */
3514
- score: number;
3515
- /** Vector data for the match. Included only if the user specified they want it returned (via {@link VectorizeQueryOptions}). */
3516
- vector?: VectorizeVector;
3517
- }
3726
+ declare type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
3727
+ Omit<VectorizeVector, "values"> & {
3728
+ /** The score or rank for similarity, when returned as a result */
3729
+ score: number;
3730
+ };
3518
3731
  /**
3519
3732
  * A set of vector {@link VectorizeMatch} for a particular query.
3520
3733
  */
@@ -241,6 +241,8 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
241
241
  GPUBufferUsage: typeof gpuGPUBufferUsage;
242
242
  GPUShaderStage: typeof gpuGPUShaderStage;
243
243
  GPUMapMode: typeof gpuGPUMapMode;
244
+ GPUTextureUsage: typeof gpuGPUTextureUsage;
245
+ GPUColorWrite: typeof gpuGPUColorWrite;
244
246
  }
245
247
  export declare function addEventListener<
246
248
  Type extends keyof WorkerGlobalScopeEventMap
@@ -1982,9 +1984,13 @@ export interface gpuGPUDevice extends EventTarget {
1982
1984
  createComputePipeline(
1983
1985
  descriptor: gpuGPUComputePipelineDescriptor
1984
1986
  ): gpuGPUComputePipeline;
1987
+ createRenderPipeline(
1988
+ descriptor: gpuGPURenderPipelineDescriptor
1989
+ ): gpuGPURenderPipeline;
1985
1990
  createCommandEncoder(
1986
1991
  descriptor?: gpuGPUCommandEncoderDescriptor
1987
1992
  ): gpuGPUCommandEncoder;
1993
+ createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
1988
1994
  destroy(): void;
1989
1995
  createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1990
1996
  pushErrorScope(filter: string): void;
@@ -2129,6 +2135,9 @@ export interface gpuGPUCommandEncoder {
2129
2135
  beginComputePass(
2130
2136
  descriptor?: gpuGPUComputePassDescriptor
2131
2137
  ): gpuGPUComputePassEncoder;
2138
+ beginRenderPass(
2139
+ descriptor: gpuGPURenderPassDescriptor
2140
+ ): gpuGPURenderPassEncoder;
2132
2141
  copyBufferToBuffer(
2133
2142
  source: gpuGPUBuffer,
2134
2143
  sourceOffset: number | bigint,
@@ -2137,6 +2146,11 @@ export interface gpuGPUCommandEncoder {
2137
2146
  size: number | bigint
2138
2147
  ): void;
2139
2148
  finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2149
+ copyTextureToBuffer(
2150
+ source: gpuGPUImageCopyTexture,
2151
+ destination: gpuGPUImageCopyBuffer,
2152
+ copySize: Iterable<number> | gpuGPUExtent3DDict
2153
+ ): void;
2140
2154
  }
2141
2155
  export interface gpuGPUCommandEncoderDescriptor {
2142
2156
  label?: string;
@@ -2250,6 +2264,198 @@ export interface gpuGPUCompilationMessage {
2250
2264
  export interface gpuGPUCompilationInfo {
2251
2265
  get messages(): gpuGPUCompilationMessage[];
2252
2266
  }
2267
+ export declare abstract class gpuGPUTextureUsage {
2268
+ static readonly COPY_SRC: number;
2269
+ static readonly COPY_DST: number;
2270
+ static readonly TEXTURE_BINDING: number;
2271
+ static readonly STORAGE_BINDING: number;
2272
+ static readonly RENDER_ATTACHMENT: number;
2273
+ }
2274
+ export interface gpuGPUTextureDescriptor {
2275
+ label: string;
2276
+ size: number[] | gpuGPUExtent3DDict;
2277
+ mipLevelCount?: number;
2278
+ sampleCount?: number;
2279
+ dimension?: string;
2280
+ format: string;
2281
+ usage: number;
2282
+ viewFormats?: string[];
2283
+ }
2284
+ export interface gpuGPUExtent3DDict {
2285
+ width: number;
2286
+ height?: number;
2287
+ depthOrArrayLayers?: number;
2288
+ }
2289
+ export interface gpuGPUTexture {
2290
+ createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
2291
+ destroy(): void;
2292
+ get width(): number;
2293
+ get height(): number;
2294
+ get depthOrArrayLayers(): number;
2295
+ get mipLevelCount(): number;
2296
+ get dimension(): string;
2297
+ get format(): string;
2298
+ get usage(): number;
2299
+ }
2300
+ export interface gpuGPUTextureView {}
2301
+ export interface gpuGPUTextureViewDescriptor {
2302
+ label: string;
2303
+ format: string;
2304
+ dimension: string;
2305
+ aspect?: string;
2306
+ baseMipLevel?: number;
2307
+ mipLevelCount: number;
2308
+ baseArrayLayer?: number;
2309
+ arrayLayerCount: number;
2310
+ }
2311
+ export declare abstract class gpuGPUColorWrite {
2312
+ static readonly RED: number;
2313
+ static readonly GREEN: number;
2314
+ static readonly BLUE: number;
2315
+ static readonly ALPHA: number;
2316
+ static readonly ALL: number;
2317
+ }
2318
+ export interface gpuGPURenderPipeline {}
2319
+ export interface gpuGPURenderPipelineDescriptor {
2320
+ label?: string;
2321
+ layout: string | gpuGPUPipelineLayout;
2322
+ vertex: gpuGPUVertexState;
2323
+ primitive?: gpuGPUPrimitiveState;
2324
+ depthStencil?: gpuGPUDepthStencilState;
2325
+ multisample?: gpuGPUMultisampleState;
2326
+ fragment?: gpuGPUFragmentState;
2327
+ }
2328
+ export interface gpuGPUVertexState {
2329
+ module: gpuGPUShaderModule;
2330
+ entryPoint: string;
2331
+ constants?: Record<string, number>;
2332
+ buffers?: gpuGPUVertexBufferLayout[];
2333
+ }
2334
+ export interface gpuGPUVertexBufferLayout {
2335
+ arrayStride: number | bigint;
2336
+ stepMode?: string;
2337
+ attributes: gpuGPUVertexAttribute[];
2338
+ }
2339
+ export interface gpuGPUVertexAttribute {
2340
+ format: string;
2341
+ offset: number | bigint;
2342
+ shaderLocation: number;
2343
+ }
2344
+ export interface gpuGPUPrimitiveState {
2345
+ topology?: string;
2346
+ stripIndexFormat?: string;
2347
+ frontFace?: string;
2348
+ cullMode?: string;
2349
+ unclippedDepth?: boolean;
2350
+ }
2351
+ export interface gpuGPUStencilFaceState {
2352
+ compare?: string;
2353
+ failOp?: string;
2354
+ depthFailOp?: string;
2355
+ passOp?: string;
2356
+ }
2357
+ export interface gpuGPUDepthStencilState {
2358
+ format: string;
2359
+ depthWriteEnabled: boolean;
2360
+ depthCompare: string;
2361
+ stencilFront?: gpuGPUStencilFaceState;
2362
+ stencilBack?: gpuGPUStencilFaceState;
2363
+ stencilReadMask?: number;
2364
+ stencilWriteMask?: number;
2365
+ depthBias?: number;
2366
+ depthBiasSlopeScale?: number;
2367
+ depthBiasClamp?: number;
2368
+ }
2369
+ export interface gpuGPUMultisampleState {
2370
+ count?: number;
2371
+ mask?: number;
2372
+ alphaToCoverageEnabled?: boolean;
2373
+ }
2374
+ export interface gpuGPUFragmentState {
2375
+ module: gpuGPUShaderModule;
2376
+ entryPoint: string;
2377
+ constants?: Record<string, number>;
2378
+ targets: gpuGPUColorTargetState[];
2379
+ }
2380
+ export interface gpuGPUColorTargetState {
2381
+ format: string;
2382
+ blend: gpuGPUBlendState;
2383
+ writeMask?: number;
2384
+ }
2385
+ export interface gpuGPUBlendState {
2386
+ color: gpuGPUBlendComponent;
2387
+ alpha: gpuGPUBlendComponent;
2388
+ }
2389
+ export interface gpuGPUBlendComponent {
2390
+ operation?: string;
2391
+ srcFactor?: string;
2392
+ dstFactor?: string;
2393
+ }
2394
+ export interface gpuGPURenderPassEncoder {
2395
+ setPipeline(pipeline: gpuGPURenderPipeline): void;
2396
+ draw(
2397
+ vertexCount: number,
2398
+ instanceCount?: number,
2399
+ firstVertex?: number,
2400
+ firstInstance?: number
2401
+ ): void;
2402
+ end(): void;
2403
+ }
2404
+ export interface gpuGPURenderPassDescriptor {
2405
+ label?: string;
2406
+ colorAttachments: gpuGPURenderPassColorAttachment[];
2407
+ depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2408
+ occlusionQuerySet?: gpuGPUQuerySet;
2409
+ timestampWrites?: gpuGPURenderPassTimestampWrite[];
2410
+ maxDrawCount?: number | bigint;
2411
+ }
2412
+ export interface gpuGPURenderPassColorAttachment {
2413
+ view: gpuGPUTextureView;
2414
+ depthSlice?: number;
2415
+ resolveTarget?: gpuGPUTextureView;
2416
+ clearValue?: number[] | gpuGPUColorDict;
2417
+ loadOp: string;
2418
+ storeOp: string;
2419
+ }
2420
+ export interface gpuGPUColorDict {
2421
+ r: number;
2422
+ g: number;
2423
+ b: number;
2424
+ a: number;
2425
+ }
2426
+ export interface gpuGPURenderPassDepthStencilAttachment {
2427
+ view: gpuGPUTextureView;
2428
+ depthClearValue?: number;
2429
+ depthLoadOp?: string;
2430
+ depthStoreOp?: string;
2431
+ depthReadOnly?: boolean;
2432
+ stencilClearValue?: number;
2433
+ stencilLoadOp?: string;
2434
+ stencilStoreOp?: string;
2435
+ stencilReadOnly?: boolean;
2436
+ }
2437
+ export interface gpuGPURenderPassTimestampWrite {
2438
+ querySet: gpuGPUQuerySet;
2439
+ queryIndex: number;
2440
+ location: string;
2441
+ }
2442
+ export interface gpuGPUImageCopyTexture {
2443
+ texture: gpuGPUTexture;
2444
+ mipLevel?: number;
2445
+ origin?: number[] | gpuGPUOrigin3DDict;
2446
+ aspect?: string;
2447
+ }
2448
+ export interface gpuGPUImageCopyBuffer {
2449
+ buffer: gpuGPUBuffer;
2450
+ offset?: number | bigint;
2451
+ bytesPerRow?: number;
2452
+ rowsPerImage?: number;
2453
+ }
2454
+ export interface gpuGPUOrigin3DDict {
2455
+ x?: number;
2456
+ y?: number;
2457
+ z?: number;
2458
+ }
2253
2459
  export interface BasicImageTransformations {
2254
2460
  /**
2255
2461
  * Maximum width in image pixels. The value must be an integer.
@@ -3221,10 +3427,19 @@ export type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
3221
3427
  export type CfProperties<HostMetadata = unknown> =
3222
3428
  | IncomingRequestCfProperties<HostMetadata>
3223
3429
  | RequestInitCfProperties;
3430
+ export interface D1Meta {
3431
+ duration: number;
3432
+ size_after: number;
3433
+ rows_read: number;
3434
+ rows_written: number;
3435
+ last_row_id: number;
3436
+ changed_db: boolean;
3437
+ changes: number;
3438
+ }
3224
3439
  export interface D1Result<T = unknown> {
3225
3440
  results: T[];
3226
3441
  success: true;
3227
- meta: any;
3442
+ meta: D1Meta & Record<string, unknown>;
3228
3443
  error?: never;
3229
3444
  }
3230
3445
  export interface D1ExecResult {
@@ -3451,7 +3666,8 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
3451
3666
  export interface VectorizeQueryOptions {
3452
3667
  topK?: number;
3453
3668
  namespace?: string;
3454
- returnVectors?: boolean;
3669
+ returnValues?: boolean;
3670
+ returnMetadata?: boolean;
3455
3671
  }
3456
3672
  /**
3457
3673
  * Information about the configuration of an index.
@@ -3489,20 +3705,17 @@ export interface VectorizeVector {
3489
3705
  values: VectorFloatArray | number[];
3490
3706
  /** The namespace this vector belongs to. */
3491
3707
  namespace?: string;
3492
- /** Metadata associated with the binding. Includes the values of the other fields and potentially additional details. */
3708
+ /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
3493
3709
  metadata?: Record<string, VectorizeVectorMetadata>;
3494
3710
  }
3495
3711
  /**
3496
3712
  * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
3497
3713
  */
3498
- export interface VectorizeMatch {
3499
- /** 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. */
3500
- vectorId: string;
3501
- /** The score or rank for similarity, when returned as a result */
3502
- score: number;
3503
- /** Vector data for the match. Included only if the user specified they want it returned (via {@link VectorizeQueryOptions}). */
3504
- vector?: VectorizeVector;
3505
- }
3714
+ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
3715
+ Omit<VectorizeVector, "values"> & {
3716
+ /** The score or rank for similarity, when returned as a result */
3717
+ score: number;
3718
+ };
3506
3719
  /**
3507
3720
  * A set of vector {@link VectorizeMatch} for a particular query.
3508
3721
  */