@cloudflare/workers-types 4.20230904.0 → 4.20230922.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -232,6 +232,14 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
232
232
  FixedLengthStream: typeof FixedLengthStream;
233
233
  IdentityTransformStream: typeof IdentityTransformStream;
234
234
  HTMLRewriter: typeof HTMLRewriter;
235
+ GPUAdapter: typeof gpuGPUAdapter;
236
+ GPUOutOfMemoryError: typeof gpuGPUOutOfMemoryError;
237
+ GPUValidationError: typeof gpuGPUValidationError;
238
+ GPUInternalError: typeof gpuGPUInternalError;
239
+ GPUDeviceLostInfo: typeof gpuGPUDeviceLostInfo;
240
+ GPUBufferUsage: typeof gpuGPUBufferUsage;
241
+ GPUShaderStage: typeof gpuGPUShaderStage;
242
+ GPUMapMode: typeof gpuGPUMapMode;
235
243
  }
236
244
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
237
245
  type: Type,
@@ -878,7 +886,7 @@ declare class TextDecoder {
878
886
  }
879
887
  declare class TextEncoder {
880
888
  constructor();
881
- encode(input?: string): ArrayBuffer | ArrayBufferView;
889
+ encode(input?: string): Uint8Array;
882
890
  encodeInto(
883
891
  input: string,
884
892
  buffer: ArrayBuffer | ArrayBufferView
@@ -1929,6 +1937,296 @@ declare interface SocketAddress {
1929
1937
  declare interface TlsOptions {
1930
1938
  expectedServerHostname?: string;
1931
1939
  }
1940
+ declare abstract class gpuGPUAdapter {
1941
+ requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
1942
+ requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
1943
+ get features(): gpuGPUSupportedFeatures;
1944
+ get limits(): gpuGPUSupportedLimits;
1945
+ }
1946
+ declare interface gpuGPUDevice extends EventTarget {
1947
+ createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
1948
+ createBindGroupLayout(
1949
+ descriptor: gpuGPUBindGroupLayoutDescriptor
1950
+ ): gpuGPUBindGroupLayout;
1951
+ createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
1952
+ createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
1953
+ createShaderModule(
1954
+ descriptor: gpuGPUShaderModuleDescriptor
1955
+ ): gpuGPUShaderModule;
1956
+ createPipelineLayout(
1957
+ descriptor: gpuGPUPipelineLayoutDescriptor
1958
+ ): gpuGPUPipelineLayout;
1959
+ createComputePipeline(
1960
+ descriptor: gpuGPUComputePipelineDescriptor
1961
+ ): gpuGPUComputePipeline;
1962
+ createCommandEncoder(
1963
+ descriptor?: gpuGPUCommandEncoderDescriptor
1964
+ ): gpuGPUCommandEncoder;
1965
+ destroy(): void;
1966
+ createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
1967
+ pushErrorScope(filter: string): void;
1968
+ popErrorScope(): Promise<gpuGPUError | null>;
1969
+ get queue(): gpuGPUQueue;
1970
+ get lost(): Promise<gpuGPUDeviceLostInfo>;
1971
+ get features(): gpuGPUSupportedFeatures;
1972
+ get limits(): gpuGPUSupportedLimits;
1973
+ }
1974
+ declare interface gpuGPUDeviceDescriptor {
1975
+ label?: string;
1976
+ requiredFeatures?: string[];
1977
+ requiredLimits?: Record<string, number | bigint>;
1978
+ defaultQueue?: gpuGPUQueueDescriptor;
1979
+ }
1980
+ declare interface gpuGPUBufferDescriptor {
1981
+ label: string;
1982
+ size: number | bigint;
1983
+ usage: number;
1984
+ mappedAtCreation: boolean;
1985
+ }
1986
+ declare interface gpuGPUQueueDescriptor {
1987
+ label?: string;
1988
+ }
1989
+ declare abstract class gpuGPUBufferUsage {
1990
+ static readonly MAP_READ: number;
1991
+ static readonly MAP_WRITE: number;
1992
+ static readonly COPY_SRC: number;
1993
+ static readonly COPY_DST: number;
1994
+ static readonly INDEX: number;
1995
+ static readonly VERTEX: number;
1996
+ static readonly UNIFORM: number;
1997
+ static readonly STORAGE: number;
1998
+ static readonly INDIRECT: number;
1999
+ static readonly QUERY_RESOLVE: number;
2000
+ }
2001
+ declare interface gpuGPUBuffer {
2002
+ getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
2003
+ unmap(): void;
2004
+ destroy(): void;
2005
+ mapAsync(
2006
+ mode: number,
2007
+ offset?: number | bigint,
2008
+ size?: number | bigint
2009
+ ): Promise<void>;
2010
+ get size(): number | bigint;
2011
+ get usage(): number;
2012
+ get mapState(): string;
2013
+ }
2014
+ declare abstract class gpuGPUShaderStage {
2015
+ static readonly VERTEX: number;
2016
+ static readonly FRAGMENT: number;
2017
+ static readonly COMPUTE: number;
2018
+ }
2019
+ declare interface gpuGPUBindGroupLayoutDescriptor {
2020
+ label?: string;
2021
+ entries: gpuGPUBindGroupLayoutEntry[];
2022
+ }
2023
+ declare interface gpuGPUBindGroupLayoutEntry {
2024
+ binding: number;
2025
+ visibility: number;
2026
+ buffer?: gpuGPUBufferBindingLayout;
2027
+ sampler?: gpuGPUSamplerBindingLayout;
2028
+ texture?: gpuGPUTextureBindingLayout;
2029
+ storageTexture?: gpuGPUStorageTextureBindingLayout;
2030
+ }
2031
+ declare interface gpuGPUStorageTextureBindingLayout {
2032
+ access?: string;
2033
+ format: string;
2034
+ viewDimension?: string;
2035
+ }
2036
+ declare interface gpuGPUTextureBindingLayout {
2037
+ sampleType?: string;
2038
+ viewDimension?: string;
2039
+ multisampled?: boolean;
2040
+ }
2041
+ declare interface gpuGPUSamplerBindingLayout {
2042
+ type?: string;
2043
+ }
2044
+ declare interface gpuGPUBufferBindingLayout {
2045
+ type?: string;
2046
+ hasDynamicOffset?: boolean;
2047
+ minBindingSize?: number | bigint;
2048
+ }
2049
+ declare interface gpuGPUBindGroupLayout {}
2050
+ declare interface gpuGPUBindGroup {}
2051
+ declare interface gpuGPUBindGroupDescriptor {
2052
+ label?: string;
2053
+ layout: gpuGPUBindGroupLayout;
2054
+ entries: gpuGPUBindGroupEntry[];
2055
+ }
2056
+ declare interface gpuGPUBindGroupEntry {
2057
+ binding: number;
2058
+ resource: gpuGPUBufferBinding | gpuGPUSampler;
2059
+ }
2060
+ declare interface gpuGPUBufferBinding {
2061
+ buffer: gpuGPUBuffer;
2062
+ offset?: number | bigint;
2063
+ size?: number | bigint;
2064
+ }
2065
+ declare interface gpuGPUSampler {}
2066
+ declare interface gpuGPUSamplerDescriptor {
2067
+ label?: string;
2068
+ addressModeU?: string;
2069
+ addressModeV?: string;
2070
+ addressModeW?: string;
2071
+ magFilter?: string;
2072
+ minFilter?: string;
2073
+ mipmapFilter?: string;
2074
+ lodMinClamp?: number;
2075
+ lodMaxClamp?: number;
2076
+ compare: string;
2077
+ maxAnisotropy?: number;
2078
+ }
2079
+ declare interface gpuGPUShaderModule {
2080
+ getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
2081
+ }
2082
+ declare interface gpuGPUShaderModuleDescriptor {
2083
+ label?: string;
2084
+ code: string;
2085
+ }
2086
+ declare interface gpuGPUPipelineLayout {}
2087
+ declare interface gpuGPUPipelineLayoutDescriptor {
2088
+ label?: string;
2089
+ bindGroupLayouts: gpuGPUBindGroupLayout[];
2090
+ }
2091
+ declare interface gpuGPUComputePipeline {
2092
+ getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
2093
+ }
2094
+ declare interface gpuGPUComputePipelineDescriptor {
2095
+ label?: string;
2096
+ compute: gpuGPUProgrammableStage;
2097
+ layout: string | gpuGPUPipelineLayout;
2098
+ }
2099
+ declare interface gpuGPUProgrammableStage {
2100
+ module: gpuGPUShaderModule;
2101
+ entryPoint: string;
2102
+ constants?: Record<string, number>;
2103
+ }
2104
+ declare interface gpuGPUCommandEncoder {
2105
+ get label(): string;
2106
+ beginComputePass(
2107
+ descriptor?: gpuGPUComputePassDescriptor
2108
+ ): gpuGPUComputePassEncoder;
2109
+ copyBufferToBuffer(
2110
+ source: gpuGPUBuffer,
2111
+ sourceOffset: number | bigint,
2112
+ destination: gpuGPUBuffer,
2113
+ destinationOffset: number | bigint,
2114
+ size: number | bigint
2115
+ ): void;
2116
+ finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2117
+ }
2118
+ declare interface gpuGPUCommandEncoderDescriptor {
2119
+ label?: string;
2120
+ }
2121
+ declare interface gpuGPUComputePassEncoder {
2122
+ setPipeline(pipeline: gpuGPUComputePipeline): void;
2123
+ setBindGroup(
2124
+ index: number,
2125
+ bindGroup: gpuGPUBindGroup | null,
2126
+ dynamicOffsets?: Iterable<number>
2127
+ ): void;
2128
+ dispatchWorkgroups(
2129
+ workgroupCountX: number,
2130
+ workgroupCountY?: number,
2131
+ workgroupCountZ?: number
2132
+ ): void;
2133
+ end(): void;
2134
+ }
2135
+ declare interface gpuGPUComputePassDescriptor {
2136
+ label?: string;
2137
+ timestampWrites?: gpuGPUComputePassTimestampWrite[];
2138
+ }
2139
+ declare interface gpuGPUQuerySet {}
2140
+ declare interface gpuGPUQuerySetDescriptor {
2141
+ label?: string;
2142
+ }
2143
+ declare interface gpuGPUComputePassTimestampWrite {
2144
+ querySet: gpuGPUQuerySet;
2145
+ queryIndex: number;
2146
+ location: string;
2147
+ }
2148
+ declare interface gpuGPUCommandBufferDescriptor {
2149
+ label?: string;
2150
+ }
2151
+ declare interface gpuGPUCommandBuffer {}
2152
+ declare interface gpuGPUQueue {
2153
+ submit(commandBuffers: gpuGPUCommandBuffer[]): void;
2154
+ writeBuffer(
2155
+ buffer: gpuGPUBuffer,
2156
+ bufferOffset: number | bigint,
2157
+ data: ArrayBuffer | ArrayBufferView,
2158
+ dataOffset?: number | bigint,
2159
+ size?: number | bigint
2160
+ ): void;
2161
+ }
2162
+ declare abstract class gpuGPUMapMode {
2163
+ static readonly READ: number;
2164
+ static readonly WRITE: number;
2165
+ }
2166
+ declare interface gpuGPUAdapterInfo {
2167
+ get vendor(): string;
2168
+ get architecture(): string;
2169
+ get device(): string;
2170
+ get description(): string;
2171
+ }
2172
+ declare interface gpuGPUSupportedFeatures {
2173
+ has(name: string): boolean;
2174
+ keys(): string[];
2175
+ }
2176
+ declare interface gpuGPUSupportedLimits {
2177
+ get maxTextureDimension1D(): number;
2178
+ get maxTextureDimension2D(): number;
2179
+ get maxTextureDimension3D(): number;
2180
+ get maxTextureArrayLayers(): number;
2181
+ get maxBindGroups(): number;
2182
+ get maxBindingsPerBindGroup(): number;
2183
+ get maxDynamicUniformBuffersPerPipelineLayout(): number;
2184
+ get maxDynamicStorageBuffersPerPipelineLayout(): number;
2185
+ get maxSampledTexturesPerShaderStage(): number;
2186
+ get maxSamplersPerShaderStage(): number;
2187
+ get maxStorageBuffersPerShaderStage(): number;
2188
+ get maxStorageTexturesPerShaderStage(): number;
2189
+ get maxUniformBuffersPerShaderStage(): number;
2190
+ get maxUniformBufferBindingSize(): number | bigint;
2191
+ get maxStorageBufferBindingSize(): number | bigint;
2192
+ get minUniformBufferOffsetAlignment(): number;
2193
+ get minStorageBufferOffsetAlignment(): number;
2194
+ get maxVertexBuffers(): number;
2195
+ get maxBufferSize(): number | bigint;
2196
+ get maxVertexAttributes(): number;
2197
+ get maxVertexBufferArrayStride(): number;
2198
+ get maxInterStageShaderComponents(): number;
2199
+ get maxInterStageShaderVariables(): number;
2200
+ get maxColorAttachments(): number;
2201
+ get maxColorAttachmentBytesPerSample(): number;
2202
+ get maxComputeWorkgroupStorageSize(): number;
2203
+ get maxComputeInvocationsPerWorkgroup(): number;
2204
+ get maxComputeWorkgroupSizeX(): number;
2205
+ get maxComputeWorkgroupSizeY(): number;
2206
+ get maxComputeWorkgroupSizeZ(): number;
2207
+ get maxComputeWorkgroupsPerDimension(): number;
2208
+ }
2209
+ declare abstract class gpuGPUError {
2210
+ get message(): string;
2211
+ }
2212
+ declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
2213
+ declare abstract class gpuGPUInternalError extends gpuGPUError {}
2214
+ declare abstract class gpuGPUValidationError extends gpuGPUError {}
2215
+ declare abstract class gpuGPUDeviceLostInfo {
2216
+ get message(): string;
2217
+ get reason(): string;
2218
+ }
2219
+ declare interface gpuGPUCompilationMessage {
2220
+ get message(): string;
2221
+ get type(): string;
2222
+ get lineNum(): number;
2223
+ get linePos(): number;
2224
+ get offset(): number;
2225
+ get length(): number;
2226
+ }
2227
+ declare interface gpuGPUCompilationInfo {
2228
+ get messages(): gpuGPUCompilationMessage[];
2229
+ }
1932
2230
  declare interface BasicImageTransformations {
1933
2231
  /**
1934
2232
  * Maximum width in image pixels. The value must be an integer.
@@ -2900,9 +3198,6 @@ declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
2900
3198
  declare type CfProperties<HostMetadata = unknown> =
2901
3199
  | IncomingRequestCfProperties<HostMetadata>
2902
3200
  | RequestInitCfProperties;
2903
- // Copyright (c) 2022-2023 Cloudflare, Inc.
2904
- // Licensed under the Apache 2.0 license found in the LICENSE file or at:
2905
- // https://opensource.org/licenses/Apache-2.0
2906
3201
  declare interface D1Result<T = unknown> {
2907
3202
  results: T[];
2908
3203
  success: true;
@@ -2927,9 +3222,6 @@ declare abstract class D1PreparedStatement {
2927
3222
  all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
2928
3223
  raw<T = unknown[]>(): Promise<T[]>;
2929
3224
  }
2930
- // Copyright (c) 2023 Cloudflare, Inc.
2931
- // Licensed under the Apache 2.0 license found in the LICENSE file or at:
2932
- // https://opensource.org/licenses/Apache-2.0
2933
3225
  /**
2934
3226
  * An email message that can be sent from a Worker.
2935
3227
  */
@@ -2994,9 +3286,53 @@ declare module "cloudflare:email" {
2994
3286
  };
2995
3287
  export { _EmailMessage as EmailMessage };
2996
3288
  }
2997
- // Copyright (c) 2022-2023 Cloudflare, Inc.
2998
- // Licensed under the Apache 2.0 license found in the LICENSE file or at:
2999
- // https://opensource.org/licenses/Apache-2.0
3289
+ declare interface Hyperdrive {
3290
+ /**
3291
+ * Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
3292
+ *
3293
+ * Calling this method returns an idential socket to if you call
3294
+ * `connect("host:port")` using the `host` and `port` fields from this object.
3295
+ * Pick whichever approach works better with your preferred DB client library.
3296
+ *
3297
+ * Note that this socket is not yet authenticated -- it's expected that your
3298
+ * code (or preferably, the client library of your choice) will authenticate
3299
+ * using the information in this class's readonly fields.
3300
+ */
3301
+ connect(): Socket;
3302
+ /**
3303
+ * A valid DB connection string that can be passed straight into the typical
3304
+ * client library/driver/ORM. This will typically be the easiest way to use
3305
+ * Hyperdrive.
3306
+ */
3307
+ readonly connectionString: string;
3308
+ /*
3309
+ * A randomly generated hostname that is only valid within the context of the
3310
+ * currently running Worker which, when passed into `connect()` function from
3311
+ * the "cloudflare:sockets" module, will connect to the Hyperdrive instance
3312
+ * for your database.
3313
+ */
3314
+ readonly host: string;
3315
+ /*
3316
+ * The port that must be paired the the host field when connecting.
3317
+ */
3318
+ readonly port: string;
3319
+ /*
3320
+ * The username to use when authenticating to your database via Hyperdrive.
3321
+ * Unlike the host and password, this will be the same every time
3322
+ */
3323
+ readonly user: string;
3324
+ /*
3325
+ * The randomly generated password to use when authenticating to your
3326
+ * database via Hyperdrive. Like the host field, this password is only valid
3327
+ * within the context of the currently running Worker instance from which
3328
+ * it's read.
3329
+ */
3330
+ readonly password: string;
3331
+ /*
3332
+ * The name of the database to connect to.
3333
+ */
3334
+ readonly database: string;
3335
+ }
3000
3336
  declare type Params<P extends string = any> = Record<P, string | string[]>;
3001
3337
  declare type EventContext<Env, P extends string, Data> = {
3002
3338
  request: Request;
@@ -3043,13 +3379,10 @@ declare type PagesPluginFunction<
3043
3379
  declare module "assets:*" {
3044
3380
  export const onRequest: PagesFunction;
3045
3381
  }
3046
- // Copyright (c) 2023 Cloudflare, Inc.
3047
- // Licensed under the Apache 2.0 license found in the LICENSE file or at:
3048
- // https://opensource.org/licenses/Apache-2.0
3049
- // https://developers.cloudflare.com/pub-sub/
3050
3382
  // PubSubMessage represents an incoming PubSub message.
3051
3383
  // The message includes metadata about the broker, the client, and the payload
3052
3384
  // itself.
3385
+ // https://developers.cloudflare.com/pub-sub/
3053
3386
  declare interface PubSubMessage {
3054
3387
  // Message ID
3055
3388
  readonly mid: number;
@@ -3080,9 +3413,6 @@ declare interface JsonWebKeyWithKid extends JsonWebKey {
3080
3413
  // Key Identifier of the JWK
3081
3414
  readonly kid: string;
3082
3415
  }
3083
- // Copyright (c) 2023 Cloudflare, Inc.
3084
- // Licensed under the Apache 2.0 license found in the LICENSE file or at:
3085
- // https://opensource.org/licenses/Apache-2.0
3086
3416
  declare module "cloudflare:sockets" {
3087
3417
  function _connect(
3088
3418
  address: string | SocketAddress,
@@ -3090,10 +3420,141 @@ declare module "cloudflare:sockets" {
3090
3420
  ): Socket;
3091
3421
  export { _connect as connect };
3092
3422
  }
3093
- // Copyright (c) 2023 Cloudflare, Inc.
3423
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
3094
3424
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
3095
3425
  // https://opensource.org/licenses/Apache-2.0
3096
- // https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/
3426
+ /**
3427
+ * Additional information to associate with a vector.
3428
+ */
3429
+ declare type VectorizeVectorMetadata =
3430
+ | string
3431
+ | number
3432
+ | boolean
3433
+ | string[]
3434
+ | Record<string, string | number | boolean | string[]>;
3435
+ declare type VectorFloatArray = Float32Array | Float64Array;
3436
+ declare interface VectorizeError {
3437
+ code?: number;
3438
+ error: string;
3439
+ }
3440
+ /**
3441
+ * Supported distance metrics for an index.
3442
+ * Distance metrics determine how other "similar" vectors are determined.
3443
+ */
3444
+ declare type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
3445
+ declare interface VectorizeQueryOptions {
3446
+ topK?: number;
3447
+ namespace?: string;
3448
+ returnVectors?: boolean;
3449
+ }
3450
+ /**
3451
+ * Information about the configuration of an index.
3452
+ */
3453
+ declare type VectorizeIndexConfig =
3454
+ | {
3455
+ dimensions: number;
3456
+ metric: VectorizeDistanceMetric;
3457
+ }
3458
+ | {
3459
+ preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity
3460
+ };
3461
+ /**
3462
+ * Metadata about an existing index.
3463
+ */
3464
+ declare interface VectorizeIndexDetails {
3465
+ /** The unique ID of the index */
3466
+ readonly id: string;
3467
+ /** The name of the index. */
3468
+ name: string;
3469
+ /** (optional) A human readable description for the index. */
3470
+ description?: string;
3471
+ /** The index configuration, including the dimension size and distance metric. */
3472
+ config: VectorizeIndexConfig;
3473
+ /** The number of records containing vectors within the index. */
3474
+ vectorsCount: number;
3475
+ }
3476
+ /**
3477
+ * Represents a single vector value set along with its associated metadata.
3478
+ */
3479
+ declare interface VectorizeVector {
3480
+ /** 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. */
3481
+ id: string;
3482
+ /** The vector values */
3483
+ values: VectorFloatArray | number[];
3484
+ /** The namespace this vector belongs to. */
3485
+ namespace?: string;
3486
+ /** Metadata associated with the binding. Includes the values of the other fields and potentially additional details. */
3487
+ metadata?: Record<string, VectorizeVectorMetadata>;
3488
+ }
3489
+ /**
3490
+ * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
3491
+ */
3492
+ declare interface VectorizeMatch {
3493
+ /** 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. */
3494
+ vectorId: string;
3495
+ /** The score or rank for similarity, when returned as a result */
3496
+ score: number;
3497
+ /** Vector data for the match. Included only if the user specified they want it returned (via {@link VectorizeQueryOptions}). */
3498
+ vector?: VectorizeVector;
3499
+ }
3500
+ /**
3501
+ * A set of vector {@link VectorizeMatch} for a particular query.
3502
+ */
3503
+ declare interface VectorizeMatches {
3504
+ matches: VectorizeMatch[];
3505
+ count: number;
3506
+ }
3507
+ /**
3508
+ * Results of an operation that performed a mutation on a set of vectors.
3509
+ * Here, `ids` is a list of vectors that were successfully processed.
3510
+ */
3511
+ declare interface VectorizeVectorMutation {
3512
+ /* List of ids of vectors that were successfully processed. */
3513
+ ids: string[];
3514
+ /* Total count of the number of processed vectors. */
3515
+ count: number;
3516
+ }
3517
+ declare abstract class VectorizeIndex {
3518
+ /**
3519
+ * Get information about the currently bound index.
3520
+ * @returns A promise that resolves with information about the current index.
3521
+ */
3522
+ public describe(): Promise<VectorizeIndexDetails>;
3523
+ /**
3524
+ * Use the provided vector to perform a similarity search across the index.
3525
+ * @param vector Input vector that will be used to drive the similarity search.
3526
+ * @param options Configuration options to massage the returned data.
3527
+ * @returns A promise that resolves with matched and scored vectors.
3528
+ */
3529
+ public query(
3530
+ vector: VectorFloatArray | number[],
3531
+ options: VectorizeQueryOptions
3532
+ ): Promise<VectorizeMatches>;
3533
+ /**
3534
+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
3535
+ * @param vectors List of vectors that will be inserted.
3536
+ * @returns A promise that resolves with the ids & count of records that were successfully processed.
3537
+ */
3538
+ public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
3539
+ /**
3540
+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
3541
+ * @param vectors List of vectors that will be upserted.
3542
+ * @returns A promise that resolves with the ids & count of records that were successfully processed.
3543
+ */
3544
+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
3545
+ /**
3546
+ * Delete a list of vectors with a matching id.
3547
+ * @param ids List of vector ids that should be deleted.
3548
+ * @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted).
3549
+ */
3550
+ public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation>;
3551
+ /**
3552
+ * Get a list of vectors with a matching id.
3553
+ * @param ids List of vector ids that should be returned.
3554
+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
3555
+ */
3556
+ public getByIds(ids: string[]): Promise<VectorizeVector[]>;
3557
+ }
3097
3558
  declare interface DynamicDispatchLimits {
3098
3559
  /**
3099
3560
  * Limit CPU time in milliseconds.