@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/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
|
-
|
|
2252
|
-
|
|
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(
|
|
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(
|
|
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?:
|
|
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
|
|
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
|
|
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