@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;
@@ -386,6 +387,7 @@ declare const scheduler: Scheduler;
386
387
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
387
388
  */
388
389
  declare const performance: Performance;
390
+ declare const Cloudflare: Cloudflare;
389
391
  declare const origin: string;
390
392
  declare const navigator: Navigator;
391
393
  interface TestController {}
@@ -476,6 +478,9 @@ interface AlarmInvocationInfo {
476
478
  readonly isRetry: boolean;
477
479
  readonly retryCount: number;
478
480
  }
481
+ interface Cloudflare {
482
+ readonly compatibilityFlags: Record<string, boolean>;
483
+ }
479
484
  interface DurableObject {
480
485
  fetch(request: Request): Response | Promise<Response>;
481
486
  alarm?(): void | Promise<void>;
@@ -2265,15 +2270,15 @@ declare class TransformStream<I = any, O = any> {
2265
2270
  }
2266
2271
  declare class FixedLengthStream extends IdentityTransformStream {
2267
2272
  constructor(
2268
- expectedLength: number | bigint,
2269
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2273
+ param1: number | bigint,
2274
+ param2?: IdentityTransformStreamQueuingStrategy,
2270
2275
  );
2271
2276
  }
2272
2277
  declare class IdentityTransformStream extends TransformStream<
2273
2278
  ArrayBuffer | ArrayBufferView,
2274
2279
  Uint8Array
2275
2280
  > {
2276
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2281
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
2277
2282
  }
2278
2283
  interface IdentityTransformStreamQueuingStrategy {
2279
2284
  highWaterMark?: number | bigint;
@@ -2305,7 +2310,7 @@ declare class TextDecoderStream extends TransformStream<
2305
2310
  ArrayBuffer | ArrayBufferView,
2306
2311
  string
2307
2312
  > {
2308
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2313
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2309
2314
  get encoding(): string;
2310
2315
  get fatal(): boolean;
2311
2316
  get ignoreBOM(): boolean;
@@ -4935,6 +4940,18 @@ type PagesPluginFunction<
4935
4940
  declare module "assets:*" {
4936
4941
  export const onRequest: PagesFunction;
4937
4942
  }
4943
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4944
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4945
+ // https://opensource.org/licenses/Apache-2.0
4946
+ declare abstract class PipelineTransform {
4947
+ /**
4948
+ * transformJson recieves an array of javascript objects which can be
4949
+ * mutated and returned to the pipeline
4950
+ * @param data The data to be mutated
4951
+ * @returns A promise containing the mutated data
4952
+ */
4953
+ public transformJson(data: object[]): Promise<object[]>;
4954
+ }
4938
4955
  // PubSubMessage represents an incoming PubSub message.
4939
4956
  // The message includes metadata about the broker, the client, and the payload
4940
4957
  // itself.
@@ -5181,7 +5198,7 @@ declare module "cloudflare:workers" {
5181
5198
  ): void | Promise<void>;
5182
5199
  webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
5183
5200
  }
5184
- export type DurationLabel =
5201
+ export type WorkflowDurationLabel =
5185
5202
  | "second"
5186
5203
  | "minute"
5187
5204
  | "hour"
@@ -5189,13 +5206,32 @@ declare module "cloudflare:workers" {
5189
5206
  | "week"
5190
5207
  | "month"
5191
5208
  | "year";
5192
- export type SleepDuration = `${number} ${DurationLabel}${"s" | ""}` | number;
5193
- type WorkflowStep = {
5209
+ export type WorkflowSleepDuration =
5210
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
5211
+ | number;
5212
+ export type WorkflowBackoff = "constant" | "linear" | "exponential";
5213
+ export type WorkflowStepConfig = {
5214
+ retries?: {
5215
+ limit: number;
5216
+ delay: string | number;
5217
+ backoff?: WorkflowBackoff;
5218
+ };
5219
+ timeout?: string | number;
5220
+ };
5221
+ export type WorkflowEvent<T> = {
5222
+ payload: T;
5223
+ timestamp: Date;
5224
+ };
5225
+ export type WorkflowStep = {
5194
5226
  do: <T extends Rpc.Serializable>(
5195
5227
  name: string,
5196
- callback: () => T,
5197
- ) => T | Promise<T>;
5198
- sleep: (name: string, duration: SleepDuration) => void | Promise<void>;
5228
+ callback: () => Promise<T>,
5229
+ config?: WorkflowStepConfig,
5230
+ ) => Promise<T>;
5231
+ sleep: (
5232
+ name: string,
5233
+ duration: WorkflowSleepDuration,
5234
+ ) => void | Promise<void>;
5199
5235
  };
5200
5236
  export abstract class Workflow<
5201
5237
  Env = unknown,
@@ -5205,13 +5241,7 @@ declare module "cloudflare:workers" {
5205
5241
  [Rpc.__WORKFLOW_BRAND]: never;
5206
5242
  protected ctx: ExecutionContext;
5207
5243
  protected env: Env;
5208
- run(
5209
- events: Array<{
5210
- payload: T;
5211
- timestamp: Date;
5212
- }>,
5213
- step: WorkflowStep,
5214
- ): unknown | Promise<unknown>;
5244
+ run(events: Array<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>;
5215
5245
  }
5216
5246
  }
5217
5247
  declare module "cloudflare:sockets" {
@@ -5274,13 +5304,11 @@ type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5274
5304
  * @property none No indexed metadata will be returned.
5275
5305
  */
5276
5306
  type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5277
- interface VectorizeQueryOptions<
5278
- MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5279
- > {
5307
+ interface VectorizeQueryOptions {
5280
5308
  topK?: number;
5281
5309
  namespace?: string;
5282
5310
  returnValues?: boolean;
5283
- returnMetadata?: MetadataReturn;
5311
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
5284
5312
  filter?: VectorizeVectorMetadataFilter;
5285
5313
  }
5286
5314
  /**
@@ -5394,7 +5422,7 @@ declare abstract class VectorizeIndex {
5394
5422
  */
5395
5423
  public query(
5396
5424
  vector: VectorFloatArray | number[],
5397
- options: VectorizeQueryOptions,
5425
+ options?: VectorizeQueryOptions,
5398
5426
  ): Promise<VectorizeMatches>;
5399
5427
  /**
5400
5428
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -5440,7 +5468,7 @@ declare abstract class Vectorize {
5440
5468
  */
5441
5469
  public query(
5442
5470
  vector: VectorFloatArray | number[],
5443
- options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5471
+ options?: VectorizeQueryOptions,
5444
5472
  ): Promise<VectorizeMatches>;
5445
5473
  /**
5446
5474
  * 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;
@@ -388,6 +389,7 @@ export declare const scheduler: Scheduler;
388
389
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
389
390
  */
390
391
  export declare const performance: Performance;
392
+ export declare const Cloudflare: Cloudflare;
391
393
  export declare const origin: string;
392
394
  export declare const navigator: Navigator;
393
395
  export interface TestController {}
@@ -481,6 +483,9 @@ export interface AlarmInvocationInfo {
481
483
  readonly isRetry: boolean;
482
484
  readonly retryCount: number;
483
485
  }
486
+ export interface Cloudflare {
487
+ readonly compatibilityFlags: Record<string, boolean>;
488
+ }
484
489
  export interface DurableObject {
485
490
  fetch(request: Request): Response | Promise<Response>;
486
491
  alarm?(): void | Promise<void>;
@@ -2271,15 +2276,15 @@ export declare class TransformStream<I = any, O = any> {
2271
2276
  }
2272
2277
  export declare class FixedLengthStream extends IdentityTransformStream {
2273
2278
  constructor(
2274
- expectedLength: number | bigint,
2275
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2279
+ param1: number | bigint,
2280
+ param2?: IdentityTransformStreamQueuingStrategy,
2276
2281
  );
2277
2282
  }
2278
2283
  export declare class IdentityTransformStream extends TransformStream<
2279
2284
  ArrayBuffer | ArrayBufferView,
2280
2285
  Uint8Array
2281
2286
  > {
2282
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2287
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
2283
2288
  }
2284
2289
  export interface IdentityTransformStreamQueuingStrategy {
2285
2290
  highWaterMark?: number | bigint;
@@ -2314,7 +2319,7 @@ export declare class TextDecoderStream extends TransformStream<
2314
2319
  ArrayBuffer | ArrayBufferView,
2315
2320
  string
2316
2321
  > {
2317
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2322
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2318
2323
  get encoding(): string;
2319
2324
  get fatal(): boolean;
2320
2325
  get ignoreBOM(): boolean;
@@ -4947,6 +4952,18 @@ export type PagesPluginFunction<
4947
4952
  > = (
4948
4953
  context: EventPluginContext<Env, Params, Data, PluginArgs>,
4949
4954
  ) => Response | Promise<Response>;
4955
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4956
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4957
+ // https://opensource.org/licenses/Apache-2.0
4958
+ export declare abstract class PipelineTransform {
4959
+ /**
4960
+ * transformJson recieves an array of javascript objects which can be
4961
+ * mutated and returned to the pipeline
4962
+ * @param data The data to be mutated
4963
+ * @returns A promise containing the mutated data
4964
+ */
4965
+ public transformJson(data: object[]): Promise<object[]>;
4966
+ }
4950
4967
  // PubSubMessage represents an incoming PubSub message.
4951
4968
  // The message includes metadata about the broker, the client, and the payload
4952
4969
  // itself.
@@ -5202,13 +5219,11 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5202
5219
  * @property none No indexed metadata will be returned.
5203
5220
  */
5204
5221
  export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5205
- export interface VectorizeQueryOptions<
5206
- MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5207
- > {
5222
+ export interface VectorizeQueryOptions {
5208
5223
  topK?: number;
5209
5224
  namespace?: string;
5210
5225
  returnValues?: boolean;
5211
- returnMetadata?: MetadataReturn;
5226
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
5212
5227
  filter?: VectorizeVectorMetadataFilter;
5213
5228
  }
5214
5229
  /**
@@ -5322,7 +5337,7 @@ export declare abstract class VectorizeIndex {
5322
5337
  */
5323
5338
  public query(
5324
5339
  vector: VectorFloatArray | number[],
5325
- options: VectorizeQueryOptions,
5340
+ options?: VectorizeQueryOptions,
5326
5341
  ): Promise<VectorizeMatches>;
5327
5342
  /**
5328
5343
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -5368,7 +5383,7 @@ export declare abstract class Vectorize {
5368
5383
  */
5369
5384
  public query(
5370
5385
  vector: VectorFloatArray | number[],
5371
- options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5386
+ options?: VectorizeQueryOptions,
5372
5387
  ): Promise<VectorizeMatches>;
5373
5388
  /**
5374
5389
  * 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;
@@ -386,6 +387,7 @@ declare const scheduler: Scheduler;
386
387
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
387
388
  */
388
389
  declare const performance: Performance;
390
+ declare const Cloudflare: Cloudflare;
389
391
  declare const origin: string;
390
392
  declare const navigator: Navigator;
391
393
  interface TestController {}
@@ -476,6 +478,9 @@ interface AlarmInvocationInfo {
476
478
  readonly isRetry: boolean;
477
479
  readonly retryCount: number;
478
480
  }
481
+ interface Cloudflare {
482
+ readonly compatibilityFlags: Record<string, boolean>;
483
+ }
479
484
  interface DurableObject {
480
485
  fetch(request: Request): Response | Promise<Response>;
481
486
  alarm?(): void | Promise<void>;
@@ -2266,15 +2271,15 @@ declare class TransformStream<I = any, O = any> {
2266
2271
  }
2267
2272
  declare class FixedLengthStream extends IdentityTransformStream {
2268
2273
  constructor(
2269
- expectedLength: number | bigint,
2270
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2274
+ param1: number | bigint,
2275
+ param2?: IdentityTransformStreamQueuingStrategy,
2271
2276
  );
2272
2277
  }
2273
2278
  declare class IdentityTransformStream extends TransformStream<
2274
2279
  ArrayBuffer | ArrayBufferView,
2275
2280
  Uint8Array
2276
2281
  > {
2277
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2282
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
2278
2283
  }
2279
2284
  interface IdentityTransformStreamQueuingStrategy {
2280
2285
  highWaterMark?: number | bigint;
@@ -2306,7 +2311,7 @@ declare class TextDecoderStream extends TransformStream<
2306
2311
  ArrayBuffer | ArrayBufferView,
2307
2312
  string
2308
2313
  > {
2309
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2314
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2310
2315
  get encoding(): string;
2311
2316
  get fatal(): boolean;
2312
2317
  get ignoreBOM(): boolean;
@@ -4936,6 +4941,18 @@ type PagesPluginFunction<
4936
4941
  declare module "assets:*" {
4937
4942
  export const onRequest: PagesFunction;
4938
4943
  }
4944
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4945
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4946
+ // https://opensource.org/licenses/Apache-2.0
4947
+ declare abstract class PipelineTransform {
4948
+ /**
4949
+ * transformJson recieves an array of javascript objects which can be
4950
+ * mutated and returned to the pipeline
4951
+ * @param data The data to be mutated
4952
+ * @returns A promise containing the mutated data
4953
+ */
4954
+ public transformJson(data: object[]): Promise<object[]>;
4955
+ }
4939
4956
  // PubSubMessage represents an incoming PubSub message.
4940
4957
  // The message includes metadata about the broker, the client, and the payload
4941
4958
  // itself.
@@ -5182,7 +5199,7 @@ declare module "cloudflare:workers" {
5182
5199
  ): void | Promise<void>;
5183
5200
  webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
5184
5201
  }
5185
- export type DurationLabel =
5202
+ export type WorkflowDurationLabel =
5186
5203
  | "second"
5187
5204
  | "minute"
5188
5205
  | "hour"
@@ -5190,13 +5207,32 @@ declare module "cloudflare:workers" {
5190
5207
  | "week"
5191
5208
  | "month"
5192
5209
  | "year";
5193
- export type SleepDuration = `${number} ${DurationLabel}${"s" | ""}` | number;
5194
- type WorkflowStep = {
5210
+ export type WorkflowSleepDuration =
5211
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
5212
+ | number;
5213
+ export type WorkflowBackoff = "constant" | "linear" | "exponential";
5214
+ export type WorkflowStepConfig = {
5215
+ retries?: {
5216
+ limit: number;
5217
+ delay: string | number;
5218
+ backoff?: WorkflowBackoff;
5219
+ };
5220
+ timeout?: string | number;
5221
+ };
5222
+ export type WorkflowEvent<T> = {
5223
+ payload: T;
5224
+ timestamp: Date;
5225
+ };
5226
+ export type WorkflowStep = {
5195
5227
  do: <T extends Rpc.Serializable>(
5196
5228
  name: string,
5197
- callback: () => T,
5198
- ) => T | Promise<T>;
5199
- sleep: (name: string, duration: SleepDuration) => void | Promise<void>;
5229
+ callback: () => Promise<T>,
5230
+ config?: WorkflowStepConfig,
5231
+ ) => Promise<T>;
5232
+ sleep: (
5233
+ name: string,
5234
+ duration: WorkflowSleepDuration,
5235
+ ) => void | Promise<void>;
5200
5236
  };
5201
5237
  export abstract class Workflow<
5202
5238
  Env = unknown,
@@ -5206,13 +5242,7 @@ declare module "cloudflare:workers" {
5206
5242
  [Rpc.__WORKFLOW_BRAND]: never;
5207
5243
  protected ctx: ExecutionContext;
5208
5244
  protected env: Env;
5209
- run(
5210
- events: Array<{
5211
- payload: T;
5212
- timestamp: Date;
5213
- }>,
5214
- step: WorkflowStep,
5215
- ): unknown | Promise<unknown>;
5245
+ run(events: Array<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>;
5216
5246
  }
5217
5247
  }
5218
5248
  declare module "cloudflare:sockets" {
@@ -5275,13 +5305,11 @@ type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5275
5305
  * @property none No indexed metadata will be returned.
5276
5306
  */
5277
5307
  type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5278
- interface VectorizeQueryOptions<
5279
- MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5280
- > {
5308
+ interface VectorizeQueryOptions {
5281
5309
  topK?: number;
5282
5310
  namespace?: string;
5283
5311
  returnValues?: boolean;
5284
- returnMetadata?: MetadataReturn;
5312
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
5285
5313
  filter?: VectorizeVectorMetadataFilter;
5286
5314
  }
5287
5315
  /**
@@ -5395,7 +5423,7 @@ declare abstract class VectorizeIndex {
5395
5423
  */
5396
5424
  public query(
5397
5425
  vector: VectorFloatArray | number[],
5398
- options: VectorizeQueryOptions,
5426
+ options?: VectorizeQueryOptions,
5399
5427
  ): Promise<VectorizeMatches>;
5400
5428
  /**
5401
5429
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -5441,7 +5469,7 @@ declare abstract class Vectorize {
5441
5469
  */
5442
5470
  public query(
5443
5471
  vector: VectorFloatArray | number[],
5444
- options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5472
+ options?: VectorizeQueryOptions,
5445
5473
  ): Promise<VectorizeMatches>;
5446
5474
  /**
5447
5475
  * 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;
@@ -388,6 +389,7 @@ export declare const scheduler: Scheduler;
388
389
  * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
389
390
  */
390
391
  export declare const performance: Performance;
392
+ export declare const Cloudflare: Cloudflare;
391
393
  export declare const origin: string;
392
394
  export declare const navigator: Navigator;
393
395
  export interface TestController {}
@@ -481,6 +483,9 @@ export interface AlarmInvocationInfo {
481
483
  readonly isRetry: boolean;
482
484
  readonly retryCount: number;
483
485
  }
486
+ export interface Cloudflare {
487
+ readonly compatibilityFlags: Record<string, boolean>;
488
+ }
484
489
  export interface DurableObject {
485
490
  fetch(request: Request): Response | Promise<Response>;
486
491
  alarm?(): void | Promise<void>;
@@ -2272,15 +2277,15 @@ export declare class TransformStream<I = any, O = any> {
2272
2277
  }
2273
2278
  export declare class FixedLengthStream extends IdentityTransformStream {
2274
2279
  constructor(
2275
- expectedLength: number | bigint,
2276
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
2280
+ param1: number | bigint,
2281
+ param2?: IdentityTransformStreamQueuingStrategy,
2277
2282
  );
2278
2283
  }
2279
2284
  export declare class IdentityTransformStream extends TransformStream<
2280
2285
  ArrayBuffer | ArrayBufferView,
2281
2286
  Uint8Array
2282
2287
  > {
2283
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
2288
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
2284
2289
  }
2285
2290
  export interface IdentityTransformStreamQueuingStrategy {
2286
2291
  highWaterMark?: number | bigint;
@@ -2315,7 +2320,7 @@ export declare class TextDecoderStream extends TransformStream<
2315
2320
  ArrayBuffer | ArrayBufferView,
2316
2321
  string
2317
2322
  > {
2318
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2323
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
2319
2324
  get encoding(): string;
2320
2325
  get fatal(): boolean;
2321
2326
  get ignoreBOM(): boolean;
@@ -4948,6 +4953,18 @@ export type PagesPluginFunction<
4948
4953
  > = (
4949
4954
  context: EventPluginContext<Env, Params, Data, PluginArgs>,
4950
4955
  ) => Response | Promise<Response>;
4956
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4957
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4958
+ // https://opensource.org/licenses/Apache-2.0
4959
+ export declare abstract class PipelineTransform {
4960
+ /**
4961
+ * transformJson recieves an array of javascript objects which can be
4962
+ * mutated and returned to the pipeline
4963
+ * @param data The data to be mutated
4964
+ * @returns A promise containing the mutated data
4965
+ */
4966
+ public transformJson(data: object[]): Promise<object[]>;
4967
+ }
4951
4968
  // PubSubMessage represents an incoming PubSub message.
4952
4969
  // The message includes metadata about the broker, the client, and the payload
4953
4970
  // itself.
@@ -5203,13 +5220,11 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5203
5220
  * @property none No indexed metadata will be returned.
5204
5221
  */
5205
5222
  export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5206
- export interface VectorizeQueryOptions<
5207
- MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5208
- > {
5223
+ export interface VectorizeQueryOptions {
5209
5224
  topK?: number;
5210
5225
  namespace?: string;
5211
5226
  returnValues?: boolean;
5212
- returnMetadata?: MetadataReturn;
5227
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
5213
5228
  filter?: VectorizeVectorMetadataFilter;
5214
5229
  }
5215
5230
  /**
@@ -5323,7 +5338,7 @@ export declare abstract class VectorizeIndex {
5323
5338
  */
5324
5339
  public query(
5325
5340
  vector: VectorFloatArray | number[],
5326
- options: VectorizeQueryOptions,
5341
+ options?: VectorizeQueryOptions,
5327
5342
  ): Promise<VectorizeMatches>;
5328
5343
  /**
5329
5344
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -5369,7 +5384,7 @@ export declare abstract class Vectorize {
5369
5384
  */
5370
5385
  public query(
5371
5386
  vector: VectorFloatArray | number[],
5372
- options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5387
+ options?: VectorizeQueryOptions,
5373
5388
  ): Promise<VectorizeMatches>;
5374
5389
  /**
5375
5390
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.