@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/2021-11-03/index.d.ts +51 -23
- package/2021-11-03/index.ts +25 -10
- package/2022-01-31/index.d.ts +51 -23
- package/2022-01-31/index.ts +25 -10
- package/2022-03-21/index.d.ts +51 -23
- package/2022-03-21/index.ts +25 -10
- package/2022-08-04/index.d.ts +51 -23
- package/2022-08-04/index.ts +25 -10
- package/2022-10-31/index.d.ts +58 -30
- package/2022-10-31/index.ts +32 -17
- package/2022-11-30/index.d.ts +58 -30
- package/2022-11-30/index.ts +32 -17
- package/2023-03-01/index.d.ts +58 -30
- package/2023-03-01/index.ts +32 -17
- package/2023-07-01/index.d.ts +60 -32
- package/2023-07-01/index.ts +34 -19
- package/experimental/index.d.ts +68 -32
- package/experimental/index.ts +42 -19
- package/index.d.ts +51 -23
- package/index.ts +25 -10
- package/oldest/index.d.ts +51 -23
- package/oldest/index.ts +25 -10
- package/package.json +1 -1
package/2022-11-30/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;
|
|
@@ -393,6 +394,7 @@ export declare const scheduler: Scheduler;
|
|
|
393
394
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
394
395
|
*/
|
|
395
396
|
export declare const performance: Performance;
|
|
397
|
+
export declare const Cloudflare: Cloudflare;
|
|
396
398
|
export declare const origin: string;
|
|
397
399
|
export declare const navigator: Navigator;
|
|
398
400
|
export interface TestController {}
|
|
@@ -486,6 +488,9 @@ export interface AlarmInvocationInfo {
|
|
|
486
488
|
readonly isRetry: boolean;
|
|
487
489
|
readonly retryCount: number;
|
|
488
490
|
}
|
|
491
|
+
export interface Cloudflare {
|
|
492
|
+
readonly compatibilityFlags: Record<string, boolean>;
|
|
493
|
+
}
|
|
489
494
|
export interface DurableObject {
|
|
490
495
|
fetch(request: Request): Response | Promise<Response>;
|
|
491
496
|
alarm?(): void | Promise<void>;
|
|
@@ -2277,15 +2282,15 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
2277
2282
|
}
|
|
2278
2283
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
2279
2284
|
constructor(
|
|
2280
|
-
|
|
2281
|
-
|
|
2285
|
+
param1: number | bigint,
|
|
2286
|
+
param2?: IdentityTransformStreamQueuingStrategy,
|
|
2282
2287
|
);
|
|
2283
2288
|
}
|
|
2284
2289
|
export declare class IdentityTransformStream extends TransformStream<
|
|
2285
2290
|
ArrayBuffer | ArrayBufferView,
|
|
2286
2291
|
Uint8Array
|
|
2287
2292
|
> {
|
|
2288
|
-
constructor(
|
|
2293
|
+
constructor(param1?: IdentityTransformStreamQueuingStrategy);
|
|
2289
2294
|
}
|
|
2290
2295
|
export interface IdentityTransformStreamQueuingStrategy {
|
|
2291
2296
|
highWaterMark?: number | bigint;
|
|
@@ -2320,7 +2325,7 @@ export declare class TextDecoderStream extends TransformStream<
|
|
|
2320
2325
|
ArrayBuffer | ArrayBufferView,
|
|
2321
2326
|
string
|
|
2322
2327
|
> {
|
|
2323
|
-
constructor(
|
|
2328
|
+
constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
|
|
2324
2329
|
get encoding(): string;
|
|
2325
2330
|
get fatal(): boolean;
|
|
2326
2331
|
get ignoreBOM(): boolean;
|
|
@@ -2534,13 +2539,13 @@ export declare class URL {
|
|
|
2534
2539
|
/*function toString() { [native code] }*/
|
|
2535
2540
|
toString(): string;
|
|
2536
2541
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2537
|
-
static canParse(
|
|
2538
|
-
static parse(
|
|
2542
|
+
static canParse(param0: string, param1?: string): boolean;
|
|
2543
|
+
static parse(param1: string, param2?: string): URL | null;
|
|
2539
2544
|
}
|
|
2540
2545
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2541
2546
|
export declare class URLSearchParams {
|
|
2542
2547
|
constructor(
|
|
2543
|
-
|
|
2548
|
+
param0?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
2544
2549
|
);
|
|
2545
2550
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2546
2551
|
get size(): number;
|
|
@@ -2549,7 +2554,7 @@ export declare class URLSearchParams {
|
|
|
2549
2554
|
*
|
|
2550
2555
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2551
2556
|
*/
|
|
2552
|
-
append(
|
|
2557
|
+
append(param0: string, param1: string): void;
|
|
2553
2558
|
/**
|
|
2554
2559
|
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2555
2560
|
*
|
|
@@ -2561,13 +2566,13 @@ export declare class URLSearchParams {
|
|
|
2561
2566
|
*
|
|
2562
2567
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2563
2568
|
*/
|
|
2564
|
-
get(
|
|
2569
|
+
get(param0: string): string | null;
|
|
2565
2570
|
/**
|
|
2566
2571
|
* Returns all the values association with a given search parameter.
|
|
2567
2572
|
*
|
|
2568
2573
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2569
2574
|
*/
|
|
2570
|
-
getAll(
|
|
2575
|
+
getAll(param0: string): string[];
|
|
2571
2576
|
/**
|
|
2572
2577
|
* Returns a Boolean indicating if such a search parameter exists.
|
|
2573
2578
|
*
|
|
@@ -2579,7 +2584,7 @@ export declare class URLSearchParams {
|
|
|
2579
2584
|
*
|
|
2580
2585
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2581
2586
|
*/
|
|
2582
|
-
set(
|
|
2587
|
+
set(param0: string, param1: string): void;
|
|
2583
2588
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2584
2589
|
sort(): void;
|
|
2585
2590
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
@@ -4952,6 +4957,18 @@ export type PagesPluginFunction<
|
|
|
4952
4957
|
> = (
|
|
4953
4958
|
context: EventPluginContext<Env, Params, Data, PluginArgs>,
|
|
4954
4959
|
) => Response | Promise<Response>;
|
|
4960
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
4961
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4962
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4963
|
+
export declare abstract class PipelineTransform {
|
|
4964
|
+
/**
|
|
4965
|
+
* transformJson recieves an array of javascript objects which can be
|
|
4966
|
+
* mutated and returned to the pipeline
|
|
4967
|
+
* @param data The data to be mutated
|
|
4968
|
+
* @returns A promise containing the mutated data
|
|
4969
|
+
*/
|
|
4970
|
+
public transformJson(data: object[]): Promise<object[]>;
|
|
4971
|
+
}
|
|
4955
4972
|
// PubSubMessage represents an incoming PubSub message.
|
|
4956
4973
|
// The message includes metadata about the broker, the client, and the payload
|
|
4957
4974
|
// itself.
|
|
@@ -5207,13 +5224,11 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
|
5207
5224
|
* @property none No indexed metadata will be returned.
|
|
5208
5225
|
*/
|
|
5209
5226
|
export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
|
|
5210
|
-
export interface VectorizeQueryOptions
|
|
5211
|
-
MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
|
|
5212
|
-
> {
|
|
5227
|
+
export interface VectorizeQueryOptions {
|
|
5213
5228
|
topK?: number;
|
|
5214
5229
|
namespace?: string;
|
|
5215
5230
|
returnValues?: boolean;
|
|
5216
|
-
returnMetadata?:
|
|
5231
|
+
returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
|
|
5217
5232
|
filter?: VectorizeVectorMetadataFilter;
|
|
5218
5233
|
}
|
|
5219
5234
|
/**
|
|
@@ -5327,7 +5342,7 @@ export declare abstract class VectorizeIndex {
|
|
|
5327
5342
|
*/
|
|
5328
5343
|
public query(
|
|
5329
5344
|
vector: VectorFloatArray | number[],
|
|
5330
|
-
options
|
|
5345
|
+
options?: VectorizeQueryOptions,
|
|
5331
5346
|
): Promise<VectorizeMatches>;
|
|
5332
5347
|
/**
|
|
5333
5348
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
@@ -5373,7 +5388,7 @@ export declare abstract class Vectorize {
|
|
|
5373
5388
|
*/
|
|
5374
5389
|
public query(
|
|
5375
5390
|
vector: VectorFloatArray | number[],
|
|
5376
|
-
options
|
|
5391
|
+
options?: VectorizeQueryOptions,
|
|
5377
5392
|
): Promise<VectorizeMatches>;
|
|
5378
5393
|
/**
|
|
5379
5394
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
package/2023-03-01/index.d.ts
CHANGED
|
@@ -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;
|
|
@@ -391,6 +392,7 @@ declare const scheduler: Scheduler;
|
|
|
391
392
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
392
393
|
*/
|
|
393
394
|
declare const performance: Performance;
|
|
395
|
+
declare const Cloudflare: Cloudflare;
|
|
394
396
|
declare const origin: string;
|
|
395
397
|
declare const navigator: Navigator;
|
|
396
398
|
interface TestController {}
|
|
@@ -481,6 +483,9 @@ interface AlarmInvocationInfo {
|
|
|
481
483
|
readonly isRetry: boolean;
|
|
482
484
|
readonly retryCount: number;
|
|
483
485
|
}
|
|
486
|
+
interface Cloudflare {
|
|
487
|
+
readonly compatibilityFlags: Record<string, boolean>;
|
|
488
|
+
}
|
|
484
489
|
interface DurableObject {
|
|
485
490
|
fetch(request: Request): Response | Promise<Response>;
|
|
486
491
|
alarm?(): void | Promise<void>;
|
|
@@ -2273,15 +2278,15 @@ declare class TransformStream<I = any, O = any> {
|
|
|
2273
2278
|
}
|
|
2274
2279
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
2275
2280
|
constructor(
|
|
2276
|
-
|
|
2277
|
-
|
|
2281
|
+
param1: number | bigint,
|
|
2282
|
+
param2?: IdentityTransformStreamQueuingStrategy,
|
|
2278
2283
|
);
|
|
2279
2284
|
}
|
|
2280
2285
|
declare class IdentityTransformStream extends TransformStream<
|
|
2281
2286
|
ArrayBuffer | ArrayBufferView,
|
|
2282
2287
|
Uint8Array
|
|
2283
2288
|
> {
|
|
2284
|
-
constructor(
|
|
2289
|
+
constructor(param1?: IdentityTransformStreamQueuingStrategy);
|
|
2285
2290
|
}
|
|
2286
2291
|
interface IdentityTransformStreamQueuingStrategy {
|
|
2287
2292
|
highWaterMark?: number | bigint;
|
|
@@ -2313,7 +2318,7 @@ declare class TextDecoderStream extends TransformStream<
|
|
|
2313
2318
|
ArrayBuffer | ArrayBufferView,
|
|
2314
2319
|
string
|
|
2315
2320
|
> {
|
|
2316
|
-
constructor(
|
|
2321
|
+
constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
|
|
2317
2322
|
get encoding(): string;
|
|
2318
2323
|
get fatal(): boolean;
|
|
2319
2324
|
get ignoreBOM(): boolean;
|
|
@@ -2527,13 +2532,13 @@ declare class URL {
|
|
|
2527
2532
|
/*function toString() { [native code] }*/
|
|
2528
2533
|
toString(): string;
|
|
2529
2534
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2530
|
-
static canParse(
|
|
2531
|
-
static parse(
|
|
2535
|
+
static canParse(param0: string, param1?: string): boolean;
|
|
2536
|
+
static parse(param1: string, param2?: string): URL | null;
|
|
2532
2537
|
}
|
|
2533
2538
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2534
2539
|
declare class URLSearchParams {
|
|
2535
2540
|
constructor(
|
|
2536
|
-
|
|
2541
|
+
param0?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
2537
2542
|
);
|
|
2538
2543
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2539
2544
|
get size(): number;
|
|
@@ -2542,7 +2547,7 @@ declare class URLSearchParams {
|
|
|
2542
2547
|
*
|
|
2543
2548
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2544
2549
|
*/
|
|
2545
|
-
append(
|
|
2550
|
+
append(param0: string, param1: string): void;
|
|
2546
2551
|
/**
|
|
2547
2552
|
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2548
2553
|
*
|
|
@@ -2554,13 +2559,13 @@ declare class URLSearchParams {
|
|
|
2554
2559
|
*
|
|
2555
2560
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2556
2561
|
*/
|
|
2557
|
-
get(
|
|
2562
|
+
get(param0: string): string | null;
|
|
2558
2563
|
/**
|
|
2559
2564
|
* Returns all the values association with a given search parameter.
|
|
2560
2565
|
*
|
|
2561
2566
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2562
2567
|
*/
|
|
2563
|
-
getAll(
|
|
2568
|
+
getAll(param0: string): string[];
|
|
2564
2569
|
/**
|
|
2565
2570
|
* Returns a Boolean indicating if such a search parameter exists.
|
|
2566
2571
|
*
|
|
@@ -2572,7 +2577,7 @@ declare class URLSearchParams {
|
|
|
2572
2577
|
*
|
|
2573
2578
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2574
2579
|
*/
|
|
2575
|
-
set(
|
|
2580
|
+
set(param0: string, param1: string): void;
|
|
2576
2581
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2577
2582
|
sort(): void;
|
|
2578
2583
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
@@ -4942,6 +4947,18 @@ type PagesPluginFunction<
|
|
|
4942
4947
|
declare module "assets:*" {
|
|
4943
4948
|
export const onRequest: PagesFunction;
|
|
4944
4949
|
}
|
|
4950
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
4951
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4952
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4953
|
+
declare abstract class PipelineTransform {
|
|
4954
|
+
/**
|
|
4955
|
+
* transformJson recieves an array of javascript objects which can be
|
|
4956
|
+
* mutated and returned to the pipeline
|
|
4957
|
+
* @param data The data to be mutated
|
|
4958
|
+
* @returns A promise containing the mutated data
|
|
4959
|
+
*/
|
|
4960
|
+
public transformJson(data: object[]): Promise<object[]>;
|
|
4961
|
+
}
|
|
4945
4962
|
// PubSubMessage represents an incoming PubSub message.
|
|
4946
4963
|
// The message includes metadata about the broker, the client, and the payload
|
|
4947
4964
|
// itself.
|
|
@@ -5188,7 +5205,7 @@ declare module "cloudflare:workers" {
|
|
|
5188
5205
|
): void | Promise<void>;
|
|
5189
5206
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
5190
5207
|
}
|
|
5191
|
-
export type
|
|
5208
|
+
export type WorkflowDurationLabel =
|
|
5192
5209
|
| "second"
|
|
5193
5210
|
| "minute"
|
|
5194
5211
|
| "hour"
|
|
@@ -5196,13 +5213,32 @@ declare module "cloudflare:workers" {
|
|
|
5196
5213
|
| "week"
|
|
5197
5214
|
| "month"
|
|
5198
5215
|
| "year";
|
|
5199
|
-
export type
|
|
5200
|
-
|
|
5216
|
+
export type WorkflowSleepDuration =
|
|
5217
|
+
| `${number} ${WorkflowDurationLabel}${"s" | ""}`
|
|
5218
|
+
| number;
|
|
5219
|
+
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
5220
|
+
export type WorkflowStepConfig = {
|
|
5221
|
+
retries?: {
|
|
5222
|
+
limit: number;
|
|
5223
|
+
delay: string | number;
|
|
5224
|
+
backoff?: WorkflowBackoff;
|
|
5225
|
+
};
|
|
5226
|
+
timeout?: string | number;
|
|
5227
|
+
};
|
|
5228
|
+
export type WorkflowEvent<T> = {
|
|
5229
|
+
payload: T;
|
|
5230
|
+
timestamp: Date;
|
|
5231
|
+
};
|
|
5232
|
+
export type WorkflowStep = {
|
|
5201
5233
|
do: <T extends Rpc.Serializable>(
|
|
5202
5234
|
name: string,
|
|
5203
|
-
callback: () => T
|
|
5204
|
-
|
|
5205
|
-
|
|
5235
|
+
callback: () => Promise<T>,
|
|
5236
|
+
config?: WorkflowStepConfig,
|
|
5237
|
+
) => Promise<T>;
|
|
5238
|
+
sleep: (
|
|
5239
|
+
name: string,
|
|
5240
|
+
duration: WorkflowSleepDuration,
|
|
5241
|
+
) => void | Promise<void>;
|
|
5206
5242
|
};
|
|
5207
5243
|
export abstract class Workflow<
|
|
5208
5244
|
Env = unknown,
|
|
@@ -5212,13 +5248,7 @@ declare module "cloudflare:workers" {
|
|
|
5212
5248
|
[Rpc.__WORKFLOW_BRAND]: never;
|
|
5213
5249
|
protected ctx: ExecutionContext;
|
|
5214
5250
|
protected env: Env;
|
|
5215
|
-
run(
|
|
5216
|
-
events: Array<{
|
|
5217
|
-
payload: T;
|
|
5218
|
-
timestamp: Date;
|
|
5219
|
-
}>,
|
|
5220
|
-
step: WorkflowStep,
|
|
5221
|
-
): unknown | Promise<unknown>;
|
|
5251
|
+
run(events: Array<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>;
|
|
5222
5252
|
}
|
|
5223
5253
|
}
|
|
5224
5254
|
declare module "cloudflare:sockets" {
|
|
@@ -5281,13 +5311,11 @@ type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
|
5281
5311
|
* @property none No indexed metadata will be returned.
|
|
5282
5312
|
*/
|
|
5283
5313
|
type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
|
|
5284
|
-
interface VectorizeQueryOptions
|
|
5285
|
-
MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
|
|
5286
|
-
> {
|
|
5314
|
+
interface VectorizeQueryOptions {
|
|
5287
5315
|
topK?: number;
|
|
5288
5316
|
namespace?: string;
|
|
5289
5317
|
returnValues?: boolean;
|
|
5290
|
-
returnMetadata?:
|
|
5318
|
+
returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
|
|
5291
5319
|
filter?: VectorizeVectorMetadataFilter;
|
|
5292
5320
|
}
|
|
5293
5321
|
/**
|
|
@@ -5401,7 +5429,7 @@ declare abstract class VectorizeIndex {
|
|
|
5401
5429
|
*/
|
|
5402
5430
|
public query(
|
|
5403
5431
|
vector: VectorFloatArray | number[],
|
|
5404
|
-
options
|
|
5432
|
+
options?: VectorizeQueryOptions,
|
|
5405
5433
|
): Promise<VectorizeMatches>;
|
|
5406
5434
|
/**
|
|
5407
5435
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
@@ -5447,7 +5475,7 @@ declare abstract class Vectorize {
|
|
|
5447
5475
|
*/
|
|
5448
5476
|
public query(
|
|
5449
5477
|
vector: VectorFloatArray | number[],
|
|
5450
|
-
options
|
|
5478
|
+
options?: VectorizeQueryOptions,
|
|
5451
5479
|
): Promise<VectorizeMatches>;
|
|
5452
5480
|
/**
|
|
5453
5481
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
package/2023-03-01/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;
|
|
@@ -393,6 +394,7 @@ export declare const scheduler: Scheduler;
|
|
|
393
394
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
394
395
|
*/
|
|
395
396
|
export declare const performance: Performance;
|
|
397
|
+
export declare const Cloudflare: Cloudflare;
|
|
396
398
|
export declare const origin: string;
|
|
397
399
|
export declare const navigator: Navigator;
|
|
398
400
|
export interface TestController {}
|
|
@@ -486,6 +488,9 @@ export interface AlarmInvocationInfo {
|
|
|
486
488
|
readonly isRetry: boolean;
|
|
487
489
|
readonly retryCount: number;
|
|
488
490
|
}
|
|
491
|
+
export interface Cloudflare {
|
|
492
|
+
readonly compatibilityFlags: Record<string, boolean>;
|
|
493
|
+
}
|
|
489
494
|
export interface DurableObject {
|
|
490
495
|
fetch(request: Request): Response | Promise<Response>;
|
|
491
496
|
alarm?(): void | Promise<void>;
|
|
@@ -2279,15 +2284,15 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
2279
2284
|
}
|
|
2280
2285
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
2281
2286
|
constructor(
|
|
2282
|
-
|
|
2283
|
-
|
|
2287
|
+
param1: number | bigint,
|
|
2288
|
+
param2?: IdentityTransformStreamQueuingStrategy,
|
|
2284
2289
|
);
|
|
2285
2290
|
}
|
|
2286
2291
|
export declare class IdentityTransformStream extends TransformStream<
|
|
2287
2292
|
ArrayBuffer | ArrayBufferView,
|
|
2288
2293
|
Uint8Array
|
|
2289
2294
|
> {
|
|
2290
|
-
constructor(
|
|
2295
|
+
constructor(param1?: IdentityTransformStreamQueuingStrategy);
|
|
2291
2296
|
}
|
|
2292
2297
|
export interface IdentityTransformStreamQueuingStrategy {
|
|
2293
2298
|
highWaterMark?: number | bigint;
|
|
@@ -2322,7 +2327,7 @@ export declare class TextDecoderStream extends TransformStream<
|
|
|
2322
2327
|
ArrayBuffer | ArrayBufferView,
|
|
2323
2328
|
string
|
|
2324
2329
|
> {
|
|
2325
|
-
constructor(
|
|
2330
|
+
constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
|
|
2326
2331
|
get encoding(): string;
|
|
2327
2332
|
get fatal(): boolean;
|
|
2328
2333
|
get ignoreBOM(): boolean;
|
|
@@ -2536,13 +2541,13 @@ export declare class URL {
|
|
|
2536
2541
|
/*function toString() { [native code] }*/
|
|
2537
2542
|
toString(): string;
|
|
2538
2543
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2539
|
-
static canParse(
|
|
2540
|
-
static parse(
|
|
2544
|
+
static canParse(param0: string, param1?: string): boolean;
|
|
2545
|
+
static parse(param1: string, param2?: string): URL | null;
|
|
2541
2546
|
}
|
|
2542
2547
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2543
2548
|
export declare class URLSearchParams {
|
|
2544
2549
|
constructor(
|
|
2545
|
-
|
|
2550
|
+
param0?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
2546
2551
|
);
|
|
2547
2552
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2548
2553
|
get size(): number;
|
|
@@ -2551,7 +2556,7 @@ export declare class URLSearchParams {
|
|
|
2551
2556
|
*
|
|
2552
2557
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2553
2558
|
*/
|
|
2554
|
-
append(
|
|
2559
|
+
append(param0: string, param1: string): void;
|
|
2555
2560
|
/**
|
|
2556
2561
|
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2557
2562
|
*
|
|
@@ -2563,13 +2568,13 @@ export declare class URLSearchParams {
|
|
|
2563
2568
|
*
|
|
2564
2569
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2565
2570
|
*/
|
|
2566
|
-
get(
|
|
2571
|
+
get(param0: string): string | null;
|
|
2567
2572
|
/**
|
|
2568
2573
|
* Returns all the values association with a given search parameter.
|
|
2569
2574
|
*
|
|
2570
2575
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2571
2576
|
*/
|
|
2572
|
-
getAll(
|
|
2577
|
+
getAll(param0: string): string[];
|
|
2573
2578
|
/**
|
|
2574
2579
|
* Returns a Boolean indicating if such a search parameter exists.
|
|
2575
2580
|
*
|
|
@@ -2581,7 +2586,7 @@ export declare class URLSearchParams {
|
|
|
2581
2586
|
*
|
|
2582
2587
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2583
2588
|
*/
|
|
2584
|
-
set(
|
|
2589
|
+
set(param0: string, param1: string): void;
|
|
2585
2590
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2586
2591
|
sort(): void;
|
|
2587
2592
|
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
@@ -4954,6 +4959,18 @@ export type PagesPluginFunction<
|
|
|
4954
4959
|
> = (
|
|
4955
4960
|
context: EventPluginContext<Env, Params, Data, PluginArgs>,
|
|
4956
4961
|
) => Response | Promise<Response>;
|
|
4962
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
4963
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4964
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
4965
|
+
export declare abstract class PipelineTransform {
|
|
4966
|
+
/**
|
|
4967
|
+
* transformJson recieves an array of javascript objects which can be
|
|
4968
|
+
* mutated and returned to the pipeline
|
|
4969
|
+
* @param data The data to be mutated
|
|
4970
|
+
* @returns A promise containing the mutated data
|
|
4971
|
+
*/
|
|
4972
|
+
public transformJson(data: object[]): Promise<object[]>;
|
|
4973
|
+
}
|
|
4957
4974
|
// PubSubMessage represents an incoming PubSub message.
|
|
4958
4975
|
// The message includes metadata about the broker, the client, and the payload
|
|
4959
4976
|
// itself.
|
|
@@ -5209,13 +5226,11 @@ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
|
5209
5226
|
* @property none No indexed metadata will be returned.
|
|
5210
5227
|
*/
|
|
5211
5228
|
export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
|
|
5212
|
-
export interface VectorizeQueryOptions
|
|
5213
|
-
MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
|
|
5214
|
-
> {
|
|
5229
|
+
export interface VectorizeQueryOptions {
|
|
5215
5230
|
topK?: number;
|
|
5216
5231
|
namespace?: string;
|
|
5217
5232
|
returnValues?: boolean;
|
|
5218
|
-
returnMetadata?:
|
|
5233
|
+
returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
|
|
5219
5234
|
filter?: VectorizeVectorMetadataFilter;
|
|
5220
5235
|
}
|
|
5221
5236
|
/**
|
|
@@ -5329,7 +5344,7 @@ export declare abstract class VectorizeIndex {
|
|
|
5329
5344
|
*/
|
|
5330
5345
|
public query(
|
|
5331
5346
|
vector: VectorFloatArray | number[],
|
|
5332
|
-
options
|
|
5347
|
+
options?: VectorizeQueryOptions,
|
|
5333
5348
|
): Promise<VectorizeMatches>;
|
|
5334
5349
|
/**
|
|
5335
5350
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
@@ -5375,7 +5390,7 @@ export declare abstract class Vectorize {
|
|
|
5375
5390
|
*/
|
|
5376
5391
|
public query(
|
|
5377
5392
|
vector: VectorFloatArray | number[],
|
|
5378
|
-
options
|
|
5393
|
+
options?: VectorizeQueryOptions,
|
|
5379
5394
|
): Promise<VectorizeMatches>;
|
|
5380
5395
|
/**
|
|
5381
5396
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|