@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,
@@ -1963,9 +1965,13 @@ declare interface gpuGPUDevice extends EventTarget {
1963
1965
  createComputePipeline(
1964
1966
  descriptor: gpuGPUComputePipelineDescriptor
1965
1967
  ): gpuGPUComputePipeline;
1968
+ createRenderPipeline(
1969
+ descriptor: gpuGPURenderPipelineDescriptor
1970
+ ): gpuGPURenderPipeline;
1966
1971
  createCommandEncoder(
1967
1972
  descriptor?: gpuGPUCommandEncoderDescriptor
1968
1973
  ): gpuGPUCommandEncoder;
1974
+ createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
1969
1975
  destroy(): void;
1970
1976
  createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1971
1977
  pushErrorScope(filter: string): void;
@@ -2110,6 +2116,9 @@ declare interface gpuGPUCommandEncoder {
2110
2116
  beginComputePass(
2111
2117
  descriptor?: gpuGPUComputePassDescriptor
2112
2118
  ): gpuGPUComputePassEncoder;
2119
+ beginRenderPass(
2120
+ descriptor: gpuGPURenderPassDescriptor
2121
+ ): gpuGPURenderPassEncoder;
2113
2122
  copyBufferToBuffer(
2114
2123
  source: gpuGPUBuffer,
2115
2124
  sourceOffset: number | bigint,
@@ -2118,6 +2127,11 @@ declare interface gpuGPUCommandEncoder {
2118
2127
  size: number | bigint
2119
2128
  ): void;
2120
2129
  finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2130
+ copyTextureToBuffer(
2131
+ source: gpuGPUImageCopyTexture,
2132
+ destination: gpuGPUImageCopyBuffer,
2133
+ copySize: Iterable<number> | gpuGPUExtent3DDict
2134
+ ): void;
2121
2135
  }
2122
2136
  declare interface gpuGPUCommandEncoderDescriptor {
2123
2137
  label?: string;
@@ -2231,6 +2245,198 @@ declare interface gpuGPUCompilationMessage {
2231
2245
  declare interface gpuGPUCompilationInfo {
2232
2246
  get messages(): gpuGPUCompilationMessage[];
2233
2247
  }
2248
+ declare abstract class gpuGPUTextureUsage {
2249
+ static readonly COPY_SRC: number;
2250
+ static readonly COPY_DST: number;
2251
+ static readonly TEXTURE_BINDING: number;
2252
+ static readonly STORAGE_BINDING: number;
2253
+ static readonly RENDER_ATTACHMENT: number;
2254
+ }
2255
+ declare interface gpuGPUTextureDescriptor {
2256
+ label: string;
2257
+ size: number[] | gpuGPUExtent3DDict;
2258
+ mipLevelCount?: number;
2259
+ sampleCount?: number;
2260
+ dimension?: string;
2261
+ format: string;
2262
+ usage: number;
2263
+ viewFormats?: string[];
2264
+ }
2265
+ declare interface gpuGPUExtent3DDict {
2266
+ width: number;
2267
+ height?: number;
2268
+ depthOrArrayLayers?: number;
2269
+ }
2270
+ declare interface gpuGPUTexture {
2271
+ createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
2272
+ destroy(): void;
2273
+ get width(): number;
2274
+ get height(): number;
2275
+ get depthOrArrayLayers(): number;
2276
+ get mipLevelCount(): number;
2277
+ get dimension(): string;
2278
+ get format(): string;
2279
+ get usage(): number;
2280
+ }
2281
+ declare interface gpuGPUTextureView {}
2282
+ declare interface gpuGPUTextureViewDescriptor {
2283
+ label: string;
2284
+ format: string;
2285
+ dimension: string;
2286
+ aspect?: string;
2287
+ baseMipLevel?: number;
2288
+ mipLevelCount: number;
2289
+ baseArrayLayer?: number;
2290
+ arrayLayerCount: number;
2291
+ }
2292
+ declare abstract class gpuGPUColorWrite {
2293
+ static readonly RED: number;
2294
+ static readonly GREEN: number;
2295
+ static readonly BLUE: number;
2296
+ static readonly ALPHA: number;
2297
+ static readonly ALL: number;
2298
+ }
2299
+ declare interface gpuGPURenderPipeline {}
2300
+ declare interface gpuGPURenderPipelineDescriptor {
2301
+ label?: string;
2302
+ layout: string | gpuGPUPipelineLayout;
2303
+ vertex: gpuGPUVertexState;
2304
+ primitive?: gpuGPUPrimitiveState;
2305
+ depthStencil?: gpuGPUDepthStencilState;
2306
+ multisample?: gpuGPUMultisampleState;
2307
+ fragment?: gpuGPUFragmentState;
2308
+ }
2309
+ declare interface gpuGPUVertexState {
2310
+ module: gpuGPUShaderModule;
2311
+ entryPoint: string;
2312
+ constants?: Record<string, number>;
2313
+ buffers?: gpuGPUVertexBufferLayout[];
2314
+ }
2315
+ declare interface gpuGPUVertexBufferLayout {
2316
+ arrayStride: number | bigint;
2317
+ stepMode?: string;
2318
+ attributes: gpuGPUVertexAttribute[];
2319
+ }
2320
+ declare interface gpuGPUVertexAttribute {
2321
+ format: string;
2322
+ offset: number | bigint;
2323
+ shaderLocation: number;
2324
+ }
2325
+ declare interface gpuGPUPrimitiveState {
2326
+ topology?: string;
2327
+ stripIndexFormat?: string;
2328
+ frontFace?: string;
2329
+ cullMode?: string;
2330
+ unclippedDepth?: boolean;
2331
+ }
2332
+ declare interface gpuGPUStencilFaceState {
2333
+ compare?: string;
2334
+ failOp?: string;
2335
+ depthFailOp?: string;
2336
+ passOp?: string;
2337
+ }
2338
+ declare interface gpuGPUDepthStencilState {
2339
+ format: string;
2340
+ depthWriteEnabled: boolean;
2341
+ depthCompare: string;
2342
+ stencilFront?: gpuGPUStencilFaceState;
2343
+ stencilBack?: gpuGPUStencilFaceState;
2344
+ stencilReadMask?: number;
2345
+ stencilWriteMask?: number;
2346
+ depthBias?: number;
2347
+ depthBiasSlopeScale?: number;
2348
+ depthBiasClamp?: number;
2349
+ }
2350
+ declare interface gpuGPUMultisampleState {
2351
+ count?: number;
2352
+ mask?: number;
2353
+ alphaToCoverageEnabled?: boolean;
2354
+ }
2355
+ declare interface gpuGPUFragmentState {
2356
+ module: gpuGPUShaderModule;
2357
+ entryPoint: string;
2358
+ constants?: Record<string, number>;
2359
+ targets: gpuGPUColorTargetState[];
2360
+ }
2361
+ declare interface gpuGPUColorTargetState {
2362
+ format: string;
2363
+ blend: gpuGPUBlendState;
2364
+ writeMask?: number;
2365
+ }
2366
+ declare interface gpuGPUBlendState {
2367
+ color: gpuGPUBlendComponent;
2368
+ alpha: gpuGPUBlendComponent;
2369
+ }
2370
+ declare interface gpuGPUBlendComponent {
2371
+ operation?: string;
2372
+ srcFactor?: string;
2373
+ dstFactor?: string;
2374
+ }
2375
+ declare interface gpuGPURenderPassEncoder {
2376
+ setPipeline(pipeline: gpuGPURenderPipeline): void;
2377
+ draw(
2378
+ vertexCount: number,
2379
+ instanceCount?: number,
2380
+ firstVertex?: number,
2381
+ firstInstance?: number
2382
+ ): void;
2383
+ end(): void;
2384
+ }
2385
+ declare interface gpuGPURenderPassDescriptor {
2386
+ label?: string;
2387
+ colorAttachments: gpuGPURenderPassColorAttachment[];
2388
+ depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2389
+ occlusionQuerySet?: gpuGPUQuerySet;
2390
+ timestampWrites?: gpuGPURenderPassTimestampWrite[];
2391
+ maxDrawCount?: number | bigint;
2392
+ }
2393
+ declare interface gpuGPURenderPassColorAttachment {
2394
+ view: gpuGPUTextureView;
2395
+ depthSlice?: number;
2396
+ resolveTarget?: gpuGPUTextureView;
2397
+ clearValue?: number[] | gpuGPUColorDict;
2398
+ loadOp: string;
2399
+ storeOp: string;
2400
+ }
2401
+ declare interface gpuGPUColorDict {
2402
+ r: number;
2403
+ g: number;
2404
+ b: number;
2405
+ a: number;
2406
+ }
2407
+ declare interface gpuGPURenderPassDepthStencilAttachment {
2408
+ view: gpuGPUTextureView;
2409
+ depthClearValue?: number;
2410
+ depthLoadOp?: string;
2411
+ depthStoreOp?: string;
2412
+ depthReadOnly?: boolean;
2413
+ stencilClearValue?: number;
2414
+ stencilLoadOp?: string;
2415
+ stencilStoreOp?: string;
2416
+ stencilReadOnly?: boolean;
2417
+ }
2418
+ declare interface gpuGPURenderPassTimestampWrite {
2419
+ querySet: gpuGPUQuerySet;
2420
+ queryIndex: number;
2421
+ location: string;
2422
+ }
2423
+ declare interface gpuGPUImageCopyTexture {
2424
+ texture: gpuGPUTexture;
2425
+ mipLevel?: number;
2426
+ origin?: number[] | gpuGPUOrigin3DDict;
2427
+ aspect?: string;
2428
+ }
2429
+ declare interface gpuGPUImageCopyBuffer {
2430
+ buffer: gpuGPUBuffer;
2431
+ offset?: number | bigint;
2432
+ bytesPerRow?: number;
2433
+ rowsPerImage?: number;
2434
+ }
2435
+ declare interface gpuGPUOrigin3DDict {
2436
+ x?: number;
2437
+ y?: number;
2438
+ z?: number;
2439
+ }
2234
2440
  declare interface BasicImageTransformations {
2235
2441
  /**
2236
2442
  * Maximum width in image pixels. The value must be an integer.
@@ -3202,10 +3408,19 @@ declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
3202
3408
  declare type CfProperties<HostMetadata = unknown> =
3203
3409
  | IncomingRequestCfProperties<HostMetadata>
3204
3410
  | RequestInitCfProperties;
3411
+ declare interface D1Meta {
3412
+ duration: number;
3413
+ size_after: number;
3414
+ rows_read: number;
3415
+ rows_written: number;
3416
+ last_row_id: number;
3417
+ changed_db: boolean;
3418
+ changes: number;
3419
+ }
3205
3420
  declare interface D1Result<T = unknown> {
3206
3421
  results: T[];
3207
3422
  success: true;
3208
- meta: any;
3423
+ meta: D1Meta & Record<string, unknown>;
3209
3424
  error?: never;
3210
3425
  }
3211
3426
  declare interface D1ExecResult {
@@ -3449,7 +3664,8 @@ declare type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
3449
3664
  declare interface VectorizeQueryOptions {
3450
3665
  topK?: number;
3451
3666
  namespace?: string;
3452
- returnVectors?: boolean;
3667
+ returnValues?: boolean;
3668
+ returnMetadata?: boolean;
3453
3669
  }
3454
3670
  /**
3455
3671
  * Information about the configuration of an index.
@@ -3487,20 +3703,17 @@ declare interface VectorizeVector {
3487
3703
  values: VectorFloatArray | number[];
3488
3704
  /** The namespace this vector belongs to. */
3489
3705
  namespace?: string;
3490
- /** Metadata associated with the binding. Includes the values of the other fields and potentially additional details. */
3706
+ /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
3491
3707
  metadata?: Record<string, VectorizeVectorMetadata>;
3492
3708
  }
3493
3709
  /**
3494
3710
  * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
3495
3711
  */
3496
- declare interface VectorizeMatch {
3497
- /** 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. */
3498
- vectorId: string;
3499
- /** The score or rank for similarity, when returned as a result */
3500
- score: number;
3501
- /** Vector data for the match. Included only if the user specified they want it returned (via {@link VectorizeQueryOptions}). */
3502
- vector?: VectorizeVector;
3503
- }
3712
+ declare type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
3713
+ Omit<VectorizeVector, "values"> & {
3714
+ /** The score or rank for similarity, when returned as a result */
3715
+ score: number;
3716
+ };
3504
3717
  /**
3505
3718
  * A set of vector {@link VectorizeMatch} for a particular query.
3506
3719
  */
@@ -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
@@ -1968,9 +1970,13 @@ export interface gpuGPUDevice extends EventTarget {
1968
1970
  createComputePipeline(
1969
1971
  descriptor: gpuGPUComputePipelineDescriptor
1970
1972
  ): gpuGPUComputePipeline;
1973
+ createRenderPipeline(
1974
+ descriptor: gpuGPURenderPipelineDescriptor
1975
+ ): gpuGPURenderPipeline;
1971
1976
  createCommandEncoder(
1972
1977
  descriptor?: gpuGPUCommandEncoderDescriptor
1973
1978
  ): gpuGPUCommandEncoder;
1979
+ createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
1974
1980
  destroy(): void;
1975
1981
  createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1976
1982
  pushErrorScope(filter: string): void;
@@ -2115,6 +2121,9 @@ export interface gpuGPUCommandEncoder {
2115
2121
  beginComputePass(
2116
2122
  descriptor?: gpuGPUComputePassDescriptor
2117
2123
  ): gpuGPUComputePassEncoder;
2124
+ beginRenderPass(
2125
+ descriptor: gpuGPURenderPassDescriptor
2126
+ ): gpuGPURenderPassEncoder;
2118
2127
  copyBufferToBuffer(
2119
2128
  source: gpuGPUBuffer,
2120
2129
  sourceOffset: number | bigint,
@@ -2123,6 +2132,11 @@ export interface gpuGPUCommandEncoder {
2123
2132
  size: number | bigint
2124
2133
  ): void;
2125
2134
  finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2135
+ copyTextureToBuffer(
2136
+ source: gpuGPUImageCopyTexture,
2137
+ destination: gpuGPUImageCopyBuffer,
2138
+ copySize: Iterable<number> | gpuGPUExtent3DDict
2139
+ ): void;
2126
2140
  }
2127
2141
  export interface gpuGPUCommandEncoderDescriptor {
2128
2142
  label?: string;
@@ -2236,6 +2250,198 @@ export interface gpuGPUCompilationMessage {
2236
2250
  export interface gpuGPUCompilationInfo {
2237
2251
  get messages(): gpuGPUCompilationMessage[];
2238
2252
  }
2253
+ export declare abstract class gpuGPUTextureUsage {
2254
+ static readonly COPY_SRC: number;
2255
+ static readonly COPY_DST: number;
2256
+ static readonly TEXTURE_BINDING: number;
2257
+ static readonly STORAGE_BINDING: number;
2258
+ static readonly RENDER_ATTACHMENT: number;
2259
+ }
2260
+ export interface gpuGPUTextureDescriptor {
2261
+ label: string;
2262
+ size: number[] | gpuGPUExtent3DDict;
2263
+ mipLevelCount?: number;
2264
+ sampleCount?: number;
2265
+ dimension?: string;
2266
+ format: string;
2267
+ usage: number;
2268
+ viewFormats?: string[];
2269
+ }
2270
+ export interface gpuGPUExtent3DDict {
2271
+ width: number;
2272
+ height?: number;
2273
+ depthOrArrayLayers?: number;
2274
+ }
2275
+ export interface gpuGPUTexture {
2276
+ createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
2277
+ destroy(): void;
2278
+ get width(): number;
2279
+ get height(): number;
2280
+ get depthOrArrayLayers(): number;
2281
+ get mipLevelCount(): number;
2282
+ get dimension(): string;
2283
+ get format(): string;
2284
+ get usage(): number;
2285
+ }
2286
+ export interface gpuGPUTextureView {}
2287
+ export interface gpuGPUTextureViewDescriptor {
2288
+ label: string;
2289
+ format: string;
2290
+ dimension: string;
2291
+ aspect?: string;
2292
+ baseMipLevel?: number;
2293
+ mipLevelCount: number;
2294
+ baseArrayLayer?: number;
2295
+ arrayLayerCount: number;
2296
+ }
2297
+ export declare abstract class gpuGPUColorWrite {
2298
+ static readonly RED: number;
2299
+ static readonly GREEN: number;
2300
+ static readonly BLUE: number;
2301
+ static readonly ALPHA: number;
2302
+ static readonly ALL: number;
2303
+ }
2304
+ export interface gpuGPURenderPipeline {}
2305
+ export interface gpuGPURenderPipelineDescriptor {
2306
+ label?: string;
2307
+ layout: string | gpuGPUPipelineLayout;
2308
+ vertex: gpuGPUVertexState;
2309
+ primitive?: gpuGPUPrimitiveState;
2310
+ depthStencil?: gpuGPUDepthStencilState;
2311
+ multisample?: gpuGPUMultisampleState;
2312
+ fragment?: gpuGPUFragmentState;
2313
+ }
2314
+ export interface gpuGPUVertexState {
2315
+ module: gpuGPUShaderModule;
2316
+ entryPoint: string;
2317
+ constants?: Record<string, number>;
2318
+ buffers?: gpuGPUVertexBufferLayout[];
2319
+ }
2320
+ export interface gpuGPUVertexBufferLayout {
2321
+ arrayStride: number | bigint;
2322
+ stepMode?: string;
2323
+ attributes: gpuGPUVertexAttribute[];
2324
+ }
2325
+ export interface gpuGPUVertexAttribute {
2326
+ format: string;
2327
+ offset: number | bigint;
2328
+ shaderLocation: number;
2329
+ }
2330
+ export interface gpuGPUPrimitiveState {
2331
+ topology?: string;
2332
+ stripIndexFormat?: string;
2333
+ frontFace?: string;
2334
+ cullMode?: string;
2335
+ unclippedDepth?: boolean;
2336
+ }
2337
+ export interface gpuGPUStencilFaceState {
2338
+ compare?: string;
2339
+ failOp?: string;
2340
+ depthFailOp?: string;
2341
+ passOp?: string;
2342
+ }
2343
+ export interface gpuGPUDepthStencilState {
2344
+ format: string;
2345
+ depthWriteEnabled: boolean;
2346
+ depthCompare: string;
2347
+ stencilFront?: gpuGPUStencilFaceState;
2348
+ stencilBack?: gpuGPUStencilFaceState;
2349
+ stencilReadMask?: number;
2350
+ stencilWriteMask?: number;
2351
+ depthBias?: number;
2352
+ depthBiasSlopeScale?: number;
2353
+ depthBiasClamp?: number;
2354
+ }
2355
+ export interface gpuGPUMultisampleState {
2356
+ count?: number;
2357
+ mask?: number;
2358
+ alphaToCoverageEnabled?: boolean;
2359
+ }
2360
+ export interface gpuGPUFragmentState {
2361
+ module: gpuGPUShaderModule;
2362
+ entryPoint: string;
2363
+ constants?: Record<string, number>;
2364
+ targets: gpuGPUColorTargetState[];
2365
+ }
2366
+ export interface gpuGPUColorTargetState {
2367
+ format: string;
2368
+ blend: gpuGPUBlendState;
2369
+ writeMask?: number;
2370
+ }
2371
+ export interface gpuGPUBlendState {
2372
+ color: gpuGPUBlendComponent;
2373
+ alpha: gpuGPUBlendComponent;
2374
+ }
2375
+ export interface gpuGPUBlendComponent {
2376
+ operation?: string;
2377
+ srcFactor?: string;
2378
+ dstFactor?: string;
2379
+ }
2380
+ export interface gpuGPURenderPassEncoder {
2381
+ setPipeline(pipeline: gpuGPURenderPipeline): void;
2382
+ draw(
2383
+ vertexCount: number,
2384
+ instanceCount?: number,
2385
+ firstVertex?: number,
2386
+ firstInstance?: number
2387
+ ): void;
2388
+ end(): void;
2389
+ }
2390
+ export interface gpuGPURenderPassDescriptor {
2391
+ label?: string;
2392
+ colorAttachments: gpuGPURenderPassColorAttachment[];
2393
+ depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2394
+ occlusionQuerySet?: gpuGPUQuerySet;
2395
+ timestampWrites?: gpuGPURenderPassTimestampWrite[];
2396
+ maxDrawCount?: number | bigint;
2397
+ }
2398
+ export interface gpuGPURenderPassColorAttachment {
2399
+ view: gpuGPUTextureView;
2400
+ depthSlice?: number;
2401
+ resolveTarget?: gpuGPUTextureView;
2402
+ clearValue?: number[] | gpuGPUColorDict;
2403
+ loadOp: string;
2404
+ storeOp: string;
2405
+ }
2406
+ export interface gpuGPUColorDict {
2407
+ r: number;
2408
+ g: number;
2409
+ b: number;
2410
+ a: number;
2411
+ }
2412
+ export interface gpuGPURenderPassDepthStencilAttachment {
2413
+ view: gpuGPUTextureView;
2414
+ depthClearValue?: number;
2415
+ depthLoadOp?: string;
2416
+ depthStoreOp?: string;
2417
+ depthReadOnly?: boolean;
2418
+ stencilClearValue?: number;
2419
+ stencilLoadOp?: string;
2420
+ stencilStoreOp?: string;
2421
+ stencilReadOnly?: boolean;
2422
+ }
2423
+ export interface gpuGPURenderPassTimestampWrite {
2424
+ querySet: gpuGPUQuerySet;
2425
+ queryIndex: number;
2426
+ location: string;
2427
+ }
2428
+ export interface gpuGPUImageCopyTexture {
2429
+ texture: gpuGPUTexture;
2430
+ mipLevel?: number;
2431
+ origin?: number[] | gpuGPUOrigin3DDict;
2432
+ aspect?: string;
2433
+ }
2434
+ export interface gpuGPUImageCopyBuffer {
2435
+ buffer: gpuGPUBuffer;
2436
+ offset?: number | bigint;
2437
+ bytesPerRow?: number;
2438
+ rowsPerImage?: number;
2439
+ }
2440
+ export interface gpuGPUOrigin3DDict {
2441
+ x?: number;
2442
+ y?: number;
2443
+ z?: number;
2444
+ }
2239
2445
  export interface BasicImageTransformations {
2240
2446
  /**
2241
2447
  * Maximum width in image pixels. The value must be an integer.
@@ -3207,10 +3413,19 @@ export type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
3207
3413
  export type CfProperties<HostMetadata = unknown> =
3208
3414
  | IncomingRequestCfProperties<HostMetadata>
3209
3415
  | RequestInitCfProperties;
3416
+ export interface D1Meta {
3417
+ duration: number;
3418
+ size_after: number;
3419
+ rows_read: number;
3420
+ rows_written: number;
3421
+ last_row_id: number;
3422
+ changed_db: boolean;
3423
+ changes: number;
3424
+ }
3210
3425
  export interface D1Result<T = unknown> {
3211
3426
  results: T[];
3212
3427
  success: true;
3213
- meta: any;
3428
+ meta: D1Meta & Record<string, unknown>;
3214
3429
  error?: never;
3215
3430
  }
3216
3431
  export interface D1ExecResult {
@@ -3437,7 +3652,8 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
3437
3652
  export interface VectorizeQueryOptions {
3438
3653
  topK?: number;
3439
3654
  namespace?: string;
3440
- returnVectors?: boolean;
3655
+ returnValues?: boolean;
3656
+ returnMetadata?: boolean;
3441
3657
  }
3442
3658
  /**
3443
3659
  * Information about the configuration of an index.
@@ -3475,20 +3691,17 @@ export interface VectorizeVector {
3475
3691
  values: VectorFloatArray | number[];
3476
3692
  /** The namespace this vector belongs to. */
3477
3693
  namespace?: string;
3478
- /** Metadata associated with the binding. Includes the values of the other fields and potentially additional details. */
3694
+ /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
3479
3695
  metadata?: Record<string, VectorizeVectorMetadata>;
3480
3696
  }
3481
3697
  /**
3482
3698
  * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
3483
3699
  */
3484
- export interface VectorizeMatch {
3485
- /** 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. */
3486
- vectorId: string;
3487
- /** The score or rank for similarity, when returned as a result */
3488
- score: number;
3489
- /** Vector data for the match. Included only if the user specified they want it returned (via {@link VectorizeQueryOptions}). */
3490
- vector?: VectorizeVector;
3491
- }
3700
+ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
3701
+ Omit<VectorizeVector, "values"> & {
3702
+ /** The score or rank for similarity, when returned as a result */
3703
+ score: number;
3704
+ };
3492
3705
  /**
3493
3706
  * A set of vector {@link VectorizeMatch} for a particular query.
3494
3707
  */