@cloudflare/workers-types 4.20240815.0 → 4.20240903.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.
@@ -235,6 +235,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
235
235
  caches: CacheStorage;
236
236
  scheduler: Scheduler;
237
237
  performance: Performance;
238
+ Cloudflare: Cloudflare;
238
239
  readonly origin: string;
239
240
  Event: typeof Event;
240
241
  ExtendableEvent: typeof ExtendableEvent;
@@ -384,6 +385,7 @@ declare const scheduler: Scheduler;
384
385
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
385
386
  */
386
387
  declare const performance: Performance;
388
+ declare const Cloudflare: Cloudflare;
387
389
  declare const origin: string;
388
390
  interface TestController {}
389
391
  interface ExecutionContext {
@@ -459,6 +461,9 @@ interface AlarmInvocationInfo {
459
461
  readonly isRetry: boolean;
460
462
  readonly retryCount: number;
461
463
  }
464
+ interface Cloudflare {
465
+ readonly compatibilityFlags: Record<string, boolean>;
466
+ }
462
467
  interface DurableObject {
463
468
  fetch(request: Request): Response | Promise<Response>;
464
469
  alarm?(): void | Promise<void>;
@@ -2242,15 +2247,15 @@ declare class TransformStream<I = any, O = any> {
2242
2247
  }
2243
2248
  declare class FixedLengthStream extends IdentityTransformStream {
2244
2249
  constructor(
2245
- expectedLength: number | bigint,
2246
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2250
+ param1: number | bigint,
2251
+ param2?: IdentityTransformStreamQueuingStrategy,
2247
2252
  );
2248
2253
  }
2249
2254
  declare class IdentityTransformStream extends TransformStream<
2250
2255
  ArrayBuffer | ArrayBufferView,
2251
2256
  Uint8Array
2252
2257
  > {
2253
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2258
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
2254
2259
  }
2255
2260
  interface IdentityTransformStreamQueuingStrategy {
2256
2261
  highWaterMark?: number | bigint;
@@ -2282,7 +2287,7 @@ declare class TextDecoderStream extends TransformStream<
2282
2287
  ArrayBuffer | ArrayBufferView,
2283
2288
  string
2284
2289
  > {
2285
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2290
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2286
2291
  get encoding(): string;
2287
2292
  get fatal(): boolean;
2288
2293
  get ignoreBOM(): boolean;
@@ -4885,6 +4890,18 @@ type PagesPluginFunction<
4885
4890
  declare module "assets:*" {
4886
4891
  export const onRequest: PagesFunction;
4887
4892
  }
4893
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4894
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4895
+ // https://opensource.org/licenses/Apache-2.0
4896
+ declare abstract class PipelineTransform {
4897
+ /**
4898
+ * transformJson recieves an array of javascript objects which can be
4899
+ * mutated and returned to the pipeline
4900
+ * @param data The data to be mutated
4901
+ * @returns A promise containing the mutated data
4902
+ */
4903
+ public transformJson(data: object[]): Promise<object[]>;
4904
+ }
4888
4905
  // PubSubMessage represents an incoming PubSub message.
4889
4906
  // The message includes metadata about the broker, the client, and the payload
4890
4907
  // itself.
@@ -5131,7 +5148,7 @@ declare module "cloudflare:workers" {
5131
5148
  ): void | Promise<void>;
5132
5149
  webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
5133
5150
  }
5134
- export type DurationLabel =
5151
+ export type WorkflowDurationLabel =
5135
5152
  | "second"
5136
5153
  | "minute"
5137
5154
  | "hour"
@@ -5139,13 +5156,32 @@ declare module "cloudflare:workers" {
5139
5156
  | "week"
5140
5157
  | "month"
5141
5158
  | "year";
5142
- export type SleepDuration = `${number} ${DurationLabel}${"s" | ""}` | number;
5143
- type WorkflowStep = {
5159
+ export type WorkflowSleepDuration =
5160
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
5161
+ | number;
5162
+ export type WorkflowBackoff = "constant" | "linear" | "exponential";
5163
+ export type WorkflowStepConfig = {
5164
+ retries?: {
5165
+ limit: number;
5166
+ delay: string | number;
5167
+ backoff?: WorkflowBackoff;
5168
+ };
5169
+ timeout?: string | number;
5170
+ };
5171
+ export type WorkflowEvent<T> = {
5172
+ payload: T;
5173
+ timestamp: Date;
5174
+ };
5175
+ export type WorkflowStep = {
5144
5176
  do: <T extends Rpc.Serializable>(
5145
5177
  name: string,
5146
- callback: () => T,
5147
- ) => T | Promise<T>;
5148
- sleep: (name: string, duration: SleepDuration) => void | Promise<void>;
5178
+ callback: () => Promise<T>,
5179
+ config?: WorkflowStepConfig,
5180
+ ) => Promise<T>;
5181
+ sleep: (
5182
+ name: string,
5183
+ duration: WorkflowSleepDuration,
5184
+ ) => void | Promise<void>;
5149
5185
  };
5150
5186
  export abstract class Workflow<
5151
5187
  Env = unknown,
@@ -5155,13 +5191,7 @@ declare module "cloudflare:workers" {
5155
5191
  [Rpc.__WORKFLOW_BRAND]: never;
5156
5192
  protected ctx: ExecutionContext;
5157
5193
  protected env: Env;
5158
- run(
5159
- events: Array<{
5160
- payload: T;
5161
- timestamp: Date;
5162
- }>,
5163
- step: WorkflowStep,
5164
- ): unknown | Promise<unknown>;
5194
+ run(events: Array<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>;
5165
5195
  }
5166
5196
  }
5167
5197
  declare module "cloudflare:sockets" {
@@ -5224,13 +5254,11 @@ type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5224
5254
  * @property none No indexed metadata will be returned.
5225
5255
  */
5226
5256
  type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5227
- interface VectorizeQueryOptions<
5228
- MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5229
- > {
5257
+ interface VectorizeQueryOptions {
5230
5258
  topK?: number;
5231
5259
  namespace?: string;
5232
5260
  returnValues?: boolean;
5233
- returnMetadata?: MetadataReturn;
5261
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
5234
5262
  filter?: VectorizeVectorMetadataFilter;
5235
5263
  }
5236
5264
  /**
@@ -5344,7 +5372,7 @@ declare abstract class VectorizeIndex {
5344
5372
  */
5345
5373
  public query(
5346
5374
  vector: VectorFloatArray | number[],
5347
- options: VectorizeQueryOptions,
5375
+ options?: VectorizeQueryOptions,
5348
5376
  ): Promise<VectorizeMatches>;
5349
5377
  /**
5350
5378
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -5390,7 +5418,7 @@ declare abstract class Vectorize {
5390
5418
  */
5391
5419
  public query(
5392
5420
  vector: VectorFloatArray | number[],
5393
- options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5421
+ options?: VectorizeQueryOptions,
5394
5422
  ): Promise<VectorizeMatches>;
5395
5423
  /**
5396
5424
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -235,6 +235,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
235
235
  caches: CacheStorage;
236
236
  scheduler: Scheduler;
237
237
  performance: Performance;
238
+ Cloudflare: Cloudflare;
238
239
  readonly origin: string;
239
240
  Event: typeof Event;
240
241
  ExtendableEvent: typeof ExtendableEvent;
@@ -386,6 +387,7 @@ export declare const scheduler: Scheduler;
386
387
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
387
388
  */
388
389
  export declare const performance: Performance;
390
+ export declare const Cloudflare: Cloudflare;
389
391
  export declare const origin: string;
390
392
  export interface TestController {}
391
393
  export interface ExecutionContext {
@@ -464,6 +466,9 @@ export interface AlarmInvocationInfo {
464
466
  readonly isRetry: boolean;
465
467
  readonly retryCount: number;
466
468
  }
469
+ export interface Cloudflare {
470
+ readonly compatibilityFlags: Record<string, boolean>;
471
+ }
467
472
  export interface DurableObject {
468
473
  fetch(request: Request): Response | Promise<Response>;
469
474
  alarm?(): void | Promise<void>;
@@ -2248,15 +2253,15 @@ export declare class TransformStream<I = any, O = any> {
2248
2253
  }
2249
2254
  export declare class FixedLengthStream extends IdentityTransformStream {
2250
2255
  constructor(
2251
- expectedLength: number | bigint,
2252
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2256
+ param1: number | bigint,
2257
+ param2?: IdentityTransformStreamQueuingStrategy,
2253
2258
  );
2254
2259
  }
2255
2260
  export declare class IdentityTransformStream extends TransformStream<
2256
2261
  ArrayBuffer | ArrayBufferView,
2257
2262
  Uint8Array
2258
2263
  > {
2259
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2264
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
2260
2265
  }
2261
2266
  export interface IdentityTransformStreamQueuingStrategy {
2262
2267
  highWaterMark?: number | bigint;
@@ -2291,7 +2296,7 @@ export declare class TextDecoderStream extends TransformStream<
2291
2296
  ArrayBuffer | ArrayBufferView,
2292
2297
  string
2293
2298
  > {
2294
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2299
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2295
2300
  get encoding(): string;
2296
2301
  get fatal(): boolean;
2297
2302
  get ignoreBOM(): boolean;
@@ -4897,6 +4902,18 @@ export type PagesPluginFunction<
4897
4902
  > = (
4898
4903
  context: EventPluginContext<Env, Params, Data, PluginArgs>,
4899
4904
  ) => Response | Promise<Response>;
4905
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4906
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4907
+ // https://opensource.org/licenses/Apache-2.0
4908
+ export declare abstract class PipelineTransform {
4909
+ /**
4910
+ * transformJson recieves an array of javascript objects which can be
4911
+ * mutated and returned to the pipeline
4912
+ * @param data The data to be mutated
4913
+ * @returns A promise containing the mutated data
4914
+ */
4915
+ public transformJson(data: object[]): Promise<object[]>;
4916
+ }
4900
4917
  // PubSubMessage represents an incoming PubSub message.
4901
4918
  // The message includes metadata about the broker, the client, and the payload
4902
4919
  // itself.
@@ -5152,13 +5169,11 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5152
5169
  * @property none No indexed metadata will be returned.
5153
5170
  */
5154
5171
  export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5155
- export interface VectorizeQueryOptions<
5156
- MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5157
- > {
5172
+ export interface VectorizeQueryOptions {
5158
5173
  topK?: number;
5159
5174
  namespace?: string;
5160
5175
  returnValues?: boolean;
5161
- returnMetadata?: MetadataReturn;
5176
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
5162
5177
  filter?: VectorizeVectorMetadataFilter;
5163
5178
  }
5164
5179
  /**
@@ -5272,7 +5287,7 @@ export declare abstract class VectorizeIndex {
5272
5287
  */
5273
5288
  public query(
5274
5289
  vector: VectorFloatArray | number[],
5275
- options: VectorizeQueryOptions,
5290
+ options?: VectorizeQueryOptions,
5276
5291
  ): Promise<VectorizeMatches>;
5277
5292
  /**
5278
5293
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -5318,7 +5333,7 @@ export declare abstract class Vectorize {
5318
5333
  */
5319
5334
  public query(
5320
5335
  vector: VectorFloatArray | number[],
5321
- options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5336
+ options?: VectorizeQueryOptions,
5322
5337
  ): Promise<VectorizeMatches>;
5323
5338
  /**
5324
5339
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -235,6 +235,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
235
235
  caches: CacheStorage;
236
236
  scheduler: Scheduler;
237
237
  performance: Performance;
238
+ Cloudflare: Cloudflare;
238
239
  readonly origin: string;
239
240
  Event: typeof Event;
240
241
  ExtendableEvent: typeof ExtendableEvent;
@@ -384,6 +385,7 @@ declare const scheduler: Scheduler;
384
385
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
385
386
  */
386
387
  declare const performance: Performance;
388
+ declare const Cloudflare: Cloudflare;
387
389
  declare const origin: string;
388
390
  interface TestController {}
389
391
  interface ExecutionContext {
@@ -459,6 +461,9 @@ interface AlarmInvocationInfo {
459
461
  readonly isRetry: boolean;
460
462
  readonly retryCount: number;
461
463
  }
464
+ interface Cloudflare {
465
+ readonly compatibilityFlags: Record<string, boolean>;
466
+ }
462
467
  interface DurableObject {
463
468
  fetch(request: Request): Response | Promise<Response>;
464
469
  alarm?(): void | Promise<void>;
@@ -2248,15 +2253,15 @@ declare class TransformStream<I = any, O = any> {
2248
2253
  }
2249
2254
  declare class FixedLengthStream extends IdentityTransformStream {
2250
2255
  constructor(
2251
- expectedLength: number | bigint,
2252
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2256
+ param1: number | bigint,
2257
+ param2?: IdentityTransformStreamQueuingStrategy,
2253
2258
  );
2254
2259
  }
2255
2260
  declare class IdentityTransformStream extends TransformStream<
2256
2261
  ArrayBuffer | ArrayBufferView,
2257
2262
  Uint8Array
2258
2263
  > {
2259
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2264
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
2260
2265
  }
2261
2266
  interface IdentityTransformStreamQueuingStrategy {
2262
2267
  highWaterMark?: number | bigint;
@@ -2288,7 +2293,7 @@ declare class TextDecoderStream extends TransformStream<
2288
2293
  ArrayBuffer | ArrayBufferView,
2289
2294
  string
2290
2295
  > {
2291
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2296
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2292
2297
  get encoding(): string;
2293
2298
  get fatal(): boolean;
2294
2299
  get ignoreBOM(): boolean;
@@ -4911,6 +4916,18 @@ type PagesPluginFunction<
4911
4916
  declare module "assets:*" {
4912
4917
  export const onRequest: PagesFunction;
4913
4918
  }
4919
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4920
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4921
+ // https://opensource.org/licenses/Apache-2.0
4922
+ declare abstract class PipelineTransform {
4923
+ /**
4924
+ * transformJson recieves an array of javascript objects which can be
4925
+ * mutated and returned to the pipeline
4926
+ * @param data The data to be mutated
4927
+ * @returns A promise containing the mutated data
4928
+ */
4929
+ public transformJson(data: object[]): Promise<object[]>;
4930
+ }
4914
4931
  // PubSubMessage represents an incoming PubSub message.
4915
4932
  // The message includes metadata about the broker, the client, and the payload
4916
4933
  // itself.
@@ -5157,7 +5174,7 @@ declare module "cloudflare:workers" {
5157
5174
  ): void | Promise<void>;
5158
5175
  webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
5159
5176
  }
5160
- export type DurationLabel =
5177
+ export type WorkflowDurationLabel =
5161
5178
  | "second"
5162
5179
  | "minute"
5163
5180
  | "hour"
@@ -5165,13 +5182,32 @@ declare module "cloudflare:workers" {
5165
5182
  | "week"
5166
5183
  | "month"
5167
5184
  | "year";
5168
- export type SleepDuration = `${number} ${DurationLabel}${"s" | ""}` | number;
5169
- type WorkflowStep = {
5185
+ export type WorkflowSleepDuration =
5186
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
5187
+ | number;
5188
+ export type WorkflowBackoff = "constant" | "linear" | "exponential";
5189
+ export type WorkflowStepConfig = {
5190
+ retries?: {
5191
+ limit: number;
5192
+ delay: string | number;
5193
+ backoff?: WorkflowBackoff;
5194
+ };
5195
+ timeout?: string | number;
5196
+ };
5197
+ export type WorkflowEvent<T> = {
5198
+ payload: T;
5199
+ timestamp: Date;
5200
+ };
5201
+ export type WorkflowStep = {
5170
5202
  do: <T extends Rpc.Serializable>(
5171
5203
  name: string,
5172
- callback: () => T,
5173
- ) => T | Promise<T>;
5174
- sleep: (name: string, duration: SleepDuration) => void | Promise<void>;
5204
+ callback: () => Promise<T>,
5205
+ config?: WorkflowStepConfig,
5206
+ ) => Promise<T>;
5207
+ sleep: (
5208
+ name: string,
5209
+ duration: WorkflowSleepDuration,
5210
+ ) => void | Promise<void>;
5175
5211
  };
5176
5212
  export abstract class Workflow<
5177
5213
  Env = unknown,
@@ -5181,13 +5217,7 @@ declare module "cloudflare:workers" {
5181
5217
  [Rpc.__WORKFLOW_BRAND]: never;
5182
5218
  protected ctx: ExecutionContext;
5183
5219
  protected env: Env;
5184
- run(
5185
- events: Array<{
5186
- payload: T;
5187
- timestamp: Date;
5188
- }>,
5189
- step: WorkflowStep,
5190
- ): unknown | Promise<unknown>;
5220
+ run(events: Array<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>;
5191
5221
  }
5192
5222
  }
5193
5223
  declare module "cloudflare:sockets" {
@@ -5250,13 +5280,11 @@ type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5250
5280
  * @property none No indexed metadata will be returned.
5251
5281
  */
5252
5282
  type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5253
- interface VectorizeQueryOptions<
5254
- MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5255
- > {
5283
+ interface VectorizeQueryOptions {
5256
5284
  topK?: number;
5257
5285
  namespace?: string;
5258
5286
  returnValues?: boolean;
5259
- returnMetadata?: MetadataReturn;
5287
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
5260
5288
  filter?: VectorizeVectorMetadataFilter;
5261
5289
  }
5262
5290
  /**
@@ -5370,7 +5398,7 @@ declare abstract class VectorizeIndex {
5370
5398
  */
5371
5399
  public query(
5372
5400
  vector: VectorFloatArray | number[],
5373
- options: VectorizeQueryOptions,
5401
+ options?: VectorizeQueryOptions,
5374
5402
  ): Promise<VectorizeMatches>;
5375
5403
  /**
5376
5404
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -5416,7 +5444,7 @@ declare abstract class Vectorize {
5416
5444
  */
5417
5445
  public query(
5418
5446
  vector: VectorFloatArray | number[],
5419
- options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5447
+ options?: VectorizeQueryOptions,
5420
5448
  ): Promise<VectorizeMatches>;
5421
5449
  /**
5422
5450
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -235,6 +235,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
235
235
  caches: CacheStorage;
236
236
  scheduler: Scheduler;
237
237
  performance: Performance;
238
+ Cloudflare: Cloudflare;
238
239
  readonly origin: string;
239
240
  Event: typeof Event;
240
241
  ExtendableEvent: typeof ExtendableEvent;
@@ -386,6 +387,7 @@ export declare const scheduler: Scheduler;
386
387
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
387
388
  */
388
389
  export declare const performance: Performance;
390
+ export declare const Cloudflare: Cloudflare;
389
391
  export declare const origin: string;
390
392
  export interface TestController {}
391
393
  export interface ExecutionContext {
@@ -464,6 +466,9 @@ export interface AlarmInvocationInfo {
464
466
  readonly isRetry: boolean;
465
467
  readonly retryCount: number;
466
468
  }
469
+ export interface Cloudflare {
470
+ readonly compatibilityFlags: Record<string, boolean>;
471
+ }
467
472
  export interface DurableObject {
468
473
  fetch(request: Request): Response | Promise<Response>;
469
474
  alarm?(): void | Promise<void>;
@@ -2254,15 +2259,15 @@ export declare class TransformStream<I = any, O = any> {
2254
2259
  }
2255
2260
  export declare class FixedLengthStream extends IdentityTransformStream {
2256
2261
  constructor(
2257
- expectedLength: number | bigint,
2258
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2262
+ param1: number | bigint,
2263
+ param2?: IdentityTransformStreamQueuingStrategy,
2259
2264
  );
2260
2265
  }
2261
2266
  export declare class IdentityTransformStream extends TransformStream<
2262
2267
  ArrayBuffer | ArrayBufferView,
2263
2268
  Uint8Array
2264
2269
  > {
2265
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2270
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
2266
2271
  }
2267
2272
  export interface IdentityTransformStreamQueuingStrategy {
2268
2273
  highWaterMark?: number | bigint;
@@ -2297,7 +2302,7 @@ export declare class TextDecoderStream extends TransformStream<
2297
2302
  ArrayBuffer | ArrayBufferView,
2298
2303
  string
2299
2304
  > {
2300
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2305
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2301
2306
  get encoding(): string;
2302
2307
  get fatal(): boolean;
2303
2308
  get ignoreBOM(): boolean;
@@ -4923,6 +4928,18 @@ export type PagesPluginFunction<
4923
4928
  > = (
4924
4929
  context: EventPluginContext<Env, Params, Data, PluginArgs>,
4925
4930
  ) => Response | Promise<Response>;
4931
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4932
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4933
+ // https://opensource.org/licenses/Apache-2.0
4934
+ export declare abstract class PipelineTransform {
4935
+ /**
4936
+ * transformJson recieves an array of javascript objects which can be
4937
+ * mutated and returned to the pipeline
4938
+ * @param data The data to be mutated
4939
+ * @returns A promise containing the mutated data
4940
+ */
4941
+ public transformJson(data: object[]): Promise<object[]>;
4942
+ }
4926
4943
  // PubSubMessage represents an incoming PubSub message.
4927
4944
  // The message includes metadata about the broker, the client, and the payload
4928
4945
  // itself.
@@ -5178,13 +5195,11 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5178
5195
  * @property none No indexed metadata will be returned.
5179
5196
  */
5180
5197
  export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5181
- export interface VectorizeQueryOptions<
5182
- MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5183
- > {
5198
+ export interface VectorizeQueryOptions {
5184
5199
  topK?: number;
5185
5200
  namespace?: string;
5186
5201
  returnValues?: boolean;
5187
- returnMetadata?: MetadataReturn;
5202
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
5188
5203
  filter?: VectorizeVectorMetadataFilter;
5189
5204
  }
5190
5205
  /**
@@ -5298,7 +5313,7 @@ export declare abstract class VectorizeIndex {
5298
5313
  */
5299
5314
  public query(
5300
5315
  vector: VectorFloatArray | number[],
5301
- options: VectorizeQueryOptions,
5316
+ options?: VectorizeQueryOptions,
5302
5317
  ): Promise<VectorizeMatches>;
5303
5318
  /**
5304
5319
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -5344,7 +5359,7 @@ export declare abstract class Vectorize {
5344
5359
  */
5345
5360
  public query(
5346
5361
  vector: VectorFloatArray | number[],
5347
- options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5362
+ options?: VectorizeQueryOptions,
5348
5363
  ): Promise<VectorizeMatches>;
5349
5364
  /**
5350
5365
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.