@cloudflare/workers-types
4.20240821.14.20240903.0
2022-10-31/index.ts~
2022-10-31/index.tsModified+28−11
Index: package/2022-10-31/index.ts
===================================================================
--- package/2022-10-31/index.ts
+++ package/2022-10-31/index.ts
@@ -234,8 +234,9 @@
crypto: Crypto;
caches: CacheStorage;
scheduler: Scheduler;
performance: Performance;
+ Cloudflare: Cloudflare;
readonly origin: string;
Event: typeof Event;
ExtendableEvent: typeof ExtendableEvent;
CustomEvent: typeof CustomEvent;
@@ -387,8 +388,9 @@
*
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
*/
export declare const performance: Performance;
+export declare const Cloudflare: Cloudflare;
export declare const origin: string;
export declare const navigator: Navigator;
export interface TestController {}
export interface ExecutionContext {
@@ -480,8 +482,11 @@
export interface AlarmInvocationInfo {
readonly isRetry: boolean;
readonly retryCount: number;
}
+export interface Cloudflare {
+ readonly compatibilityFlags: Record<string, boolean>;
+}
export interface DurableObject {
fetch(request: Request): Response | Promise<Response>;
alarm?(): void | Promise<void>;
webSocketMessage?(
@@ -2271,17 +2276,17 @@
get writable(): WritableStream<I>;
}
export declare class FixedLengthStream extends IdentityTransformStream {
constructor(
- expectedLength: number | bigint,
- queuingStrategy?: IdentityTransformStreamQueuingStrategy,
+ param1: number | bigint,
+ param2?: IdentityTransformStreamQueuingStrategy,
);
}
export declare class IdentityTransformStream extends TransformStream<
ArrayBuffer | ArrayBufferView,
Uint8Array
> {
- constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
+ constructor(param1?: IdentityTransformStreamQueuingStrategy);
}
export interface IdentityTransformStreamQueuingStrategy {
highWaterMark?: number | bigint;
}
@@ -2314,9 +2319,9 @@
export declare class TextDecoderStream extends TransformStream<
ArrayBuffer | ArrayBufferView,
string
> {
- constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
+ constructor(param1?: string, param2?: TextDecoderStreamTextDecoderStreamInit);
get encoding(): string;
get fatal(): boolean;
get ignoreBOM(): boolean;
}
@@ -2528,24 +2533,24 @@
toJSON(): string;
/*function toString() { [native code] }*/
toString(): string;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
- static canParse(url: string, base?: string): boolean;
- static parse(url: string, base?: string): URL | null;
+ static canParse(param0: string, param1?: string): boolean;
+ static parse(param1: string, param2?: string): URL | null;
}
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
export declare class URLSearchParams {
constructor(
- init?: Iterable<Iterable<string>> | Record<string, string> | string,
+ param0?: Iterable<Iterable<string>> | Record<string, string> | string,
);
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
get size(): number;
/**
* Appends a specified key/value pair as a new search parameter.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
*/
- append(name: string, value: string): void;
+ append(param0: string, param1: string): void;
/**
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
@@ -2555,15 +2560,15 @@
* Returns the first value associated to the given search parameter.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
*/
- get(name: string): string | null;
+ get(param0: string): string | null;
/**
* Returns all the values association with a given search parameter.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
*/
- getAll(name: string): string[];
+ getAll(param0: string): string[];
/**
* Returns a Boolean indicating if such a search parameter exists.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
@@ -2573,9 +2578,9 @@
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
*/
- set(name: string, value: string): void;
+ set(param0: string, param1: string): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
sort(): void;
/* Returns an array of key, value pairs for every entry in the search params. */
entries(): IterableIterator<[key: string, value: string]>;
@@ -4946,8 +4951,20 @@
PluginArgs = unknown,
> = (
context: EventPluginContext<Env, Params, Data, PluginArgs>,
) => Response | Promise<Response>;
+// Copyright (c) 2022-2023 Cloudflare, Inc.
+// Licensed under the Apache 2.0 license found in the LICENSE file or at:
+// https://opensource.org/licenses/Apache-2.0
+export declare abstract class PipelineTransform {
+ /**
+ * transformJson recieves an array of javascript objects which can be
+ * mutated and returned to the pipeline
+ * @param data The data to be mutated
+ * @returns A promise containing the mutated data
+ */
+ public transformJson(data: object[]): Promise<object[]>;
+}
// PubSubMessage represents an incoming PubSub message.
// The message includes metadata about the broker, the client, and the payload
// itself.
// https://developers.cloudflare.com/pub-sub/