@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.
package/oldest/index.ts CHANGED
@@ -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.
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20240815.0"
10
+ "version": "4.20240903.0"
11
11
  }