// This file is auto-generated. DO NOT MODIFY. // Please refer to the Auto-Generation section of the README.md. export declare class AbortController { constructor(); readonly signal: AbortSignal; abort(reason?: any): void; } export declare class AbortSignal extends EventTarget { constructor(); static abort(reason?: any): AbortSignal; static timeout(delay: number): AbortSignal; readonly aborted: boolean; readonly reason: any; throwIfAborted(): void; } export interface BasicImageTransformations { /** * Maximum width in image pixels. The value must be an integer. */ width?: number; /** * Maximum height in image pixels. The value must be an integer. */ height?: number; /** * Resizing mode as a string. It affects interpretation of width and height * options: * - scale-down: Similar to contain, but the image is never enlarged. If * the image is larger than given width or height, it will be resized. * Otherwise its original size will be kept. * - contain: Resizes to maximum size that fits within the given width and * height. If only a single dimension is given (e.g. only width), the * image will be shrunk or enlarged to exactly match that dimension. * Aspect ratio is always preserved. * - cover: Resizes (shrinks or enlarges) to fill the entire area of width * and height. If the image has an aspect ratio different from the ratio * of width and height, it will be cropped to fit. * - crop: The image will be shrunk and cropped to fit within the area * specified by width and height. The image will not be enlarged. For images * smaller than the given dimensions it's the same as scale-down. For * images larger than the given dimensions, it's the same as cover. * See also trim. * - pad: Resizes to the maximum size that fits within the given width and * height, and then fills the remaining area with a background color * (white by default). Use of this mode is not recommended, as the same * effect can be more efficiently achieved with the contain mode and the * CSS object-fit: contain property. */ fit?: "scale-down" | "contain" | "cover" | "crop" | "pad"; /** * When cropping with fit: "cover", this defines the side or point that should * be left uncropped. The value is either a string * "left", "right", "top", "bottom", "auto", or "center" (the default), * or an object {x, y} containing focal point coordinates in the original * image expressed as fractions ranging from 0.0 (top or left) to 1.0 * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will * crop bottom or left and right sides as necessary, but won’t crop anything * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to * preserve as much as possible around a point at 20% of the height of the * source image. */ gravity?: "left" | "right" | "top" | "bottom" | "center" | "auto" | BasicImageTransformationsGravityCoordinates; /** * Background color to add underneath the image. Applies only to images with * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…), * hsl(…), etc.) */ background?: string; /** * Number of degrees (90, 180, 270) to rotate the image by. width and height * options refer to axes after rotation. */ rotate?: 0 | 90 | 180 | 270 | 360; } export interface BasicImageTransformationsGravityCoordinates { x: number; y: number; } export declare class Blob { constructor(bits?: BlobBits, options?: BlobOptions); readonly size: number; readonly type: string; slice(start?: number, end?: number, type?: string): Blob; arrayBuffer(): Promise; text(): Promise; stream(): ReadableStream; } export declare type BlobBits = (ArrayBuffer | string | Blob)[]; export interface BlobOptions { type?: string; } export declare abstract class Body { readonly body: ReadableStream | null; readonly bodyUsed: boolean; arrayBuffer(): Promise; text(): Promise; json(): Promise; formData(): Promise; blob(): Promise; } export declare type BodyInit = ReadableStream | string | ArrayBuffer | Blob | URLSearchParams | FormData; /** * Back compat for code migrating to older definitions. * @deprecated Use BodyInit instead. */ export declare type BodyInitializer = BodyInit; export declare class ByteLengthQueuingStrategy { constructor(init: QueuingStrategyInit); readonly highWaterMark: number; size(chunk?: any): number; } export declare abstract class Cache { delete(request: Request | string, options?: CacheQueryOptions): Promise; match(request: Request | string, options?: CacheQueryOptions): Promise; put(request: Request | string, response: Response): Promise; } export interface CacheQueryOptions { ignoreMethod?: boolean; } export declare abstract class CacheStorage { open(cacheName: string): Promise; readonly default: Cache; } export interface CfRequestInit extends Omit { cf?: RequestInitCfProperties; } /** * Back compat support with older types. * @deprecated Use CfRequestInit instead. */ export declare type CfRequestInitializerDict = CfRequestInit; export declare class CloseEvent extends Event { constructor(type: string, initializer: CloseEventInit); readonly code: number; readonly reason: string; readonly wasClean: boolean; } export interface CloseEventInit { code?: number; reason?: string; wasClean?: boolean; } /** * Back compat for code migrating from older definitions. * @deprecated Use CloseEventInit instead. */ export declare type CloseEventInitializer = CloseEventInit; export interface Comment { text: string; readonly removed: boolean; before(content: Content, options?: ContentOptions): Comment; after(content: Content, options?: ContentOptions): Comment; replace(content: Content, options?: ContentOptions): Comment; remove(): Comment; } export declare class CompressionStream extends TransformStream { constructor(format: "gzip" | "deflate"); } export interface Console { debug(...data: any[]): void; error(...data: any[]): void; info(...data: any[]): void; log(...data: any[]): void; warn(...data: any[]): void; } export declare type Content = string | ReadableStream | Response; export interface ContentOptions { html?: boolean; } export declare class CountQueuingStrategy { constructor(init: QueuingStrategyInit); readonly highWaterMark: number; size(chunk?: any): number; } export declare abstract class Crypto { readonly subtle: SubtleCrypto; getRandomValues(buffer: T): T; randomUUID(): string; DigestStream: typeof DigestStream; } export declare abstract class CryptoKey { readonly type: string; readonly extractable: boolean; readonly algorithm: CryptoKeyAlgorithmVariant; readonly usages: string[]; } export interface CryptoKeyAesKeyAlgorithm { name: string; length: number; } export declare type CryptoKeyAlgorithmVariant = CryptoKeyKeyAlgorithm | CryptoKeyAesKeyAlgorithm | CryptoKeyHmacKeyAlgorithm | CryptoKeyRsaKeyAlgorithm | CryptoKeyEllipticKeyAlgorithm | CryptoKeyVoprfKeyAlgorithm | CryptoKeyOprfKeyAlgorithm; export interface CryptoKeyEllipticKeyAlgorithm { name: string; namedCurve: string; } export interface CryptoKeyHmacKeyAlgorithm { name: string; hash: CryptoKeyKeyAlgorithm; length: number; } export interface CryptoKeyKeyAlgorithm { name: string; } export interface CryptoKeyOprfKeyAlgorithm { name: string; namedCurve: string; } export interface CryptoKeyPair { publicKey: CryptoKey; privateKey: CryptoKey; } export interface CryptoKeyRsaKeyAlgorithm { name: string; modulusLength: number; publicExponent: ArrayBuffer; hash?: CryptoKeyKeyAlgorithm; } export interface CryptoKeyVoprfKeyAlgorithm { name: string; hash: CryptoKeyKeyAlgorithm; namedCurve: string; } export interface D1Database { prepare(query: string): D1PreparedStatement; dump(): Promise; batch(statements: D1PreparedStatement[]): Promise[]>; exec(query: string): Promise>; } export interface D1PreparedStatement { bind(...values: any[]): D1PreparedStatement; first(colName?: string): Promise; run(): Promise>; all(): Promise>; raw(): Promise; } export declare type D1Result = { results?: T[]; lastRowId: number | null; changes: number; duration: number; error?: string; }; export declare class DOMException extends Error { constructor(message?: string, name?: string); readonly code: number; static readonly INDEX_SIZE_ERR: number; static readonly DOMSTRING_SIZE_ERR: number; static readonly HIERARCHY_REQUEST_ERR: number; static readonly WRONG_DOCUMENT_ERR: number; static readonly INVALID_CHARACTER_ERR: number; static readonly NO_DATA_ALLOWED_ERR: number; static readonly NO_MODIFICATION_ALLOWED_ERR: number; static readonly NOT_FOUND_ERR: number; static readonly NOT_SUPPORTED_ERR: number; static readonly INUSE_ATTRIBUTE_ERR: number; static readonly INVALID_STATE_ERR: number; static readonly SYNTAX_ERR: number; static readonly INVALID_MODIFICATION_ERR: number; static readonly NAMESPACE_ERR: number; static readonly INVALID_ACCESS_ERR: number; static readonly VALIDATION_ERR: number; static readonly TYPE_MISMATCH_ERR: number; static readonly SECURITY_ERR: number; static readonly NETWORK_ERR: number; static readonly ABORT_ERR: number; static readonly URL_MISMATCH_ERR: number; static readonly QUOTA_EXCEEDED_ERR: number; static readonly TIMEOUT_ERR: number; static readonly INVALID_NODE_TYPE_ERR: number; static readonly DATA_CLONE_ERR: number; } export declare class DecompressionStream extends TransformStream { constructor(format: "gzip" | "deflate"); } export declare class DigestStream extends WritableStream { constructor(algorithm: string | SubtleCryptoHashAlgorithm); readonly digest: Promise; } export interface Doctype { readonly name: string | null; readonly publicId: string | null; readonly systemId: string | null; } export interface DocumentEnd { append(content: Content, options?: ContentOptions): DocumentEnd; } export interface DurableObject { fetch(request: Request): Promise; alarm?(): Promise; } export interface DurableObjectGetAlarmOptions { allowConcurrency?: boolean; } export interface DurableObjectGetOptions { allowConcurrency?: boolean; noCache?: boolean; } export interface DurableObjectId { toString(): string; equals(other: DurableObjectId): boolean; readonly name?: string; } export interface DurableObjectListOptions { start?: string; startAfter?: string; end?: string; prefix?: string; reverse?: boolean; limit?: number; allowConcurrency?: boolean; noCache?: boolean; } export interface DurableObjectNamespace { newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId; idFromName(name: string): DurableObjectId; idFromString(id: string): DurableObjectId; get(id: DurableObjectId): DurableObjectStub; } export interface DurableObjectNamespaceNewUniqueIdOptions { jurisdiction?: string; } export interface DurableObjectPutOptions { allowConcurrency?: boolean; allowUnconfirmed?: boolean; noCache?: boolean; } export interface DurableObjectSetAlarmOptions { allowConcurrency?: boolean; allowUnconfirmed?: boolean; } export interface DurableObjectState { waitUntil(promise: Promise): void; id: DurableObjectId; readonly storage: DurableObjectStorage; blockConcurrencyWhile(callback: () => Promise): Promise; } export interface DurableObjectStorage { get(key: string, options?: DurableObjectGetOptions): Promise; get(keys: string[], options?: DurableObjectGetOptions): Promise>; list(options?: DurableObjectListOptions): Promise>; put(key: string, value: T, options?: DurableObjectPutOptions): Promise; put(entries: Record, options?: DurableObjectPutOptions): Promise; delete(key: string, options?: DurableObjectPutOptions): Promise; delete(keys: string[], options?: DurableObjectPutOptions): Promise; deleteAll(options?: DurableObjectPutOptions): Promise; transaction(closure: (txn: DurableObjectTransaction) => Promise): Promise; getAlarm(options?: DurableObjectGetAlarmOptions): Promise; setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise; deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise; } /** * * @deprecated Don't use. Introduced incidentally in workers-types 3.x. Scheduled for removal. */ export declare type DurableObjectStorageOperationsGetOptions = DurableObjectGetOptions; /** * * @deprecated Don't use. Introduced incidentally in workers-types 3.x. Scheduled for removal. */ export declare type DurableObjectStorageOperationsListOptions = DurableObjectListOptions; /** * * @deprecated Don't use. Introduced incidentally in workers-types 3.x. Scheduled for removal. */ export declare type DurableObjectStorageOperationsPutOptions = DurableObjectPutOptions; export interface DurableObjectStub extends Fetcher { readonly id: DurableObjectId; readonly name?: string; } export interface DurableObjectTransaction { get(key: string, options?: DurableObjectGetOptions): Promise; get(keys: string[], options?: DurableObjectGetOptions): Promise>; list(options?: DurableObjectListOptions): Promise>; put(key: string, value: T, options?: DurableObjectPutOptions): Promise; put(entries: Record, options?: DurableObjectPutOptions): Promise; delete(key: string, options?: DurableObjectPutOptions): Promise; delete(keys: string[], options?: DurableObjectPutOptions): Promise; rollback(): void; getAlarm(options?: DurableObjectGetAlarmOptions): Promise; setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise; deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise; } export interface Element { tagName: string; readonly attributes: IterableIterator; readonly removed: boolean; readonly namespaceURI: string; getAttribute(name: string): string | null; hasAttribute(name: string): boolean; setAttribute(name: string, value: string): Element; removeAttribute(name: string): Element; before(content: Content, options?: ContentOptions): Element; after(content: Content, options?: ContentOptions): Element; prepend(content: Content, options?: ContentOptions): Element; append(content: Content, options?: ContentOptions): Element; replace(content: Content, options?: ContentOptions): Element; remove(): Element; removeAndKeepContent(): Element; setInnerContent(content: Content, options?: ContentOptions): Element; onEndTag(handler: (tag: EndTag) => void | Promise): void; } export interface EndTag { name: string; before(content: Content, options?: ContentOptions): EndTag; after(content: Content, options?: ContentOptions): EndTag; remove(): EndTag; } export interface ErrorEvent extends Event { readonly filename: string; readonly message: string; readonly lineno: number; readonly colno: number; readonly error: any; } export declare class Event { constructor(type: string, init?: EventInit); readonly type: string; readonly eventPhase: number; readonly composed: boolean; readonly bubbles: boolean; readonly cancelable: boolean; readonly defaultPrevented: boolean; readonly returnValue: boolean; readonly currentTarget?: EventTarget; readonly srcElement?: EventTarget; readonly timeStamp: number; readonly isTrusted: boolean; cancelBubble: boolean; stopImmediatePropagation(): void; preventDefault(): void; stopPropagation(): void; composedPath(): EventTarget[]; static readonly NONE: number; static readonly CAPTURING_PHASE: number; static readonly AT_TARGET: number; static readonly BUBBLING_PHASE: number; } export interface EventInit { bubbles?: boolean; cancelable?: boolean; composed?: boolean; } export declare type EventListener = (event: EventType) => void; export interface EventListenerObject { handleEvent(event: EventType): void; } export declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; export declare class EventTarget = Record> { constructor(); addEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetAddEventListenerOptions | boolean): void; removeEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetEventListenerOptions | boolean): void; dispatchEvent(event: EventMap[keyof EventMap]): boolean; } export interface EventTargetAddEventListenerOptions { capture?: boolean; passive?: boolean; once?: boolean; signal?: AbortSignal; } export interface EventTargetEventListenerOptions { capture?: boolean; } export interface EventTargetHandlerObject { handleEvent(arg1: Event): any | undefined; } export interface ExecutionContext { waitUntil(promise: Promise): void; passThroughOnException(): void; } export interface ExportedHandler { fetch?: ExportedHandlerFetchHandler; scheduled?: ExportedHandlerScheduledHandler; } export declare type ExportedHandlerFetchHandler = (request: Request, env: Env, ctx: ExecutionContext) => Response | Promise; export declare type ExportedHandlerScheduledHandler = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise; export declare class ExtendableEvent extends Event { constructor(type: string, init?: EventInit); waitUntil(promise: Promise): void; } export declare abstract class FetchEvent extends ExtendableEvent { readonly request: Request; respondWith(promise: Response | Promise): void; passThroughOnException(): void; } export declare abstract class Fetcher { fetch(requestOrUrl: Request | string, requestInit?: RequestInit | Request): Promise; } export declare class File extends Blob { constructor(bits?: BlobBits, name?: string, options?: FileOptions); readonly name: string; readonly lastModified: number; } export interface FileOptions { type?: string; lastModified?: number; } export declare class FixedLengthStream extends IdentityTransformStream { constructor(expectedLength: number | bigint); } export declare class FormData { constructor(); append(name: string, value: string): void; append(name: string, value: Blob, filename?: string): void; delete(name: string): void; get(name: string): File | string | null; getAll(name: string): (File | string)[]; has(name: string): boolean; set(name: string, value: string): void; set(name: string, value: Blob, filename?: string): void; entries(): IterableIterator<[ key: string, value: File | string ]>; keys(): IterableIterator; values(): IterableIterator; forEach(callback: (this: This, key: string, value: File | string, parent: FormData) => void, thisArg?: This): void; [Symbol.iterator](): IterableIterator<[ key: string, value: File | string ]>; } export declare class HTMLRewriter { constructor(); on(selector: string, handlers: HTMLRewriterElementContentHandlers): HTMLRewriter; onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter; transform(response: Response): Response; } export interface HTMLRewriterDocumentContentHandlers { doctype?(doctype: Doctype): void | Promise; comments?(comment: Comment): void | Promise; text?(text: Text): void | Promise; end?(end: DocumentEnd): void | Promise; } export interface HTMLRewriterElementContentHandlers { element?(element: Element): void | Promise; comments?(comment: Comment): void | Promise; text?(text: Text): void | Promise; } export declare class Headers { constructor(init?: HeadersInit); get(name: string): string | null; getAll(name: string): string[]; has(name: string): boolean; set(name: string, value: string): void; append(name: string, value: string): void; delete(name: string): void; forEach(callback: (this: This, key: string, value: string, parent: Headers) => void, thisArg?: This): void; entries(): IterableIterator<[ key: string, value: string ]>; keys(): IterableIterator; values(): IterableIterator; [Symbol.iterator](): IterableIterator<[ key: string, value: string ]>; } export declare type HeadersInit = Headers | Record | [ key: string, value: string ][]; /** * Back compat for code migrating to older definitions. * @deprecated Use HeadersInit instead. */ export declare type HeadersInitializer = HeadersInit; export declare class IdentityTransformStream extends TransformStream { constructor(); } /** * In addition to the properties on the standard Request object, * the cf object contains extra information about the request provided * by Cloudflare's edge. * * Note: Currently, settings in the cf object cannot be accessed in the * playground. */ export interface IncomingRequestCfProperties { /** * (e.g. 395747) */ asn: number; /** * The organisation which owns the ASN of the incoming request. * (e.g. Google Cloud) */ asOrganization: string; botManagement?: IncomingRequestCfPropertiesBotManagement; city?: string; clientAcceptEncoding?: string; clientTcpRtt: number; clientTrustScore?: number; /** * The three-letter airport code of the data center that the request * hit. (e.g. "DFW") */ colo: string; continent?: string; /** * The two-letter country code in the request. This is the same value * as that provided in the CF-IPCountry header. (e.g. "US") */ country: string; httpProtocol: string; isEUCountry?: string; latitude?: string; longitude?: string; /** * DMA metro code from which the request was issued, e.g. "635" */ metroCode?: string; postalCode?: string; /** * e.g. "Texas" */ region?: string; /** * e.g. "TX" */ regionCode?: string; /** * e.g. "weight=256;exclusive=1" */ requestPriority: string; /** * e.g. "America/Chicago" */ timezone?: string; tlsVersion: string; tlsCipher: string; tlsClientAuth: IncomingRequestCfPropertiesTLSClientAuth; } export interface IncomingRequestCfPropertiesBotManagement { score: number; staticResource: boolean; verifiedBot: boolean; } export interface IncomingRequestCfPropertiesTLSClientAuth { certIssuerDNLegacy: string; certIssuerDN: string; certIssuerDNRFC2253: string; certIssuerSKI: string; certIssuerSerial: string; certPresented: "0" | "1"; certSubjectDNLegacy: string; certSubjectDN: string; certSubjectDNRFC2253: string; /** * In format "Dec 22 19:39:00 2018 GMT" */ certNotBefore: string; /** * In format "Dec 22 19:39:00 2018 GMT" */ certNotAfter: string; certSerial: string; certFingerprintSHA1: string; /** * "SUCCESS", "FAILED:reason", "NONE" */ certVerified: string; certRevoked: string; certSKI: string; } export interface JsonWebKey { kty: string; use?: string; key_ops?: string[]; alg?: string; ext?: boolean; crv?: string; x?: string; y?: string; d?: string; n?: string; e?: string; p?: string; q?: string; dp?: string; dq?: string; qi?: string; oth?: RsaOtherPrimesInfo[]; k?: string; } /** * Workers KV is a global, low-latency, key-value data store. It supports exceptionally high read volumes with low-latency, * making it possible to build highly dynamic APIs and websites which respond as quickly as a cached static file would. */ export interface KVNamespace { get(key: K, options?: Partial>): Promise; get(key: K, type: "text"): Promise; get(key: K, type: "json"): Promise; get(key: K, type: "arrayBuffer"): Promise; get(key: K, type: "stream"): Promise; get(key: K, options: KVNamespaceGetOptions<"text">): Promise; get(key: string, options: KVNamespaceGetOptions<"json">): Promise; get(key: K, options: KVNamespaceGetOptions<"arrayBuffer">): Promise; get(key: K, options: KVNamespaceGetOptions<"stream">): Promise; list(options?: KVNamespaceListOptions): Promise>; /** * Creates a new key-value pair, or updates the value for a particular key. * @param key key to associate with the value. A key cannot be empty, `.` or `..`. All other keys are valid. * @param value value to store. The type is inferred. The maximum size of a value is 25MB. * @returns Returns a `Promise` that you should `await` on in order to verify a successful update. * @example * await NAMESPACE.put(key, value); */ put(key: K, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: KVNamespacePutOptions): Promise; getWithMetadata(key: K, options?: Partial>): Promise>; getWithMetadata(key: K, type: "text"): Promise>; getWithMetadata(key: K, type: "json"): Promise>; getWithMetadata(key: K, type: "arrayBuffer"): Promise>; getWithMetadata(key: K, type: "stream"): Promise>; getWithMetadata(key: K, options: KVNamespaceGetOptions<"text">): Promise>; getWithMetadata(key: K, options: KVNamespaceGetOptions<"json">): Promise>; getWithMetadata(key: K, options: KVNamespaceGetOptions<"arrayBuffer">): Promise>; getWithMetadata(key: K, options: KVNamespaceGetOptions<"stream">): Promise>; delete(name: string): Promise; } export interface KVNamespaceGetOptions { type: Type; cacheTtl?: number; } export interface KVNamespaceGetWithMetadataResult { value: Value | null; metadata: Metadata | null; } export interface KVNamespaceListKey { name: string; expiration?: number; metadata?: Metadata; } export interface KVNamespaceListOptions { limit?: number; prefix?: string | null; cursor?: string | null; } export interface KVNamespaceListResult { keys: KVNamespaceListKey[]; list_complete: boolean; cursor?: string; } export interface KVNamespacePutOptions { expiration?: number; expirationTtl?: number; metadata?: any | null; } export declare class MessageEvent extends Event { constructor(type: string, initializer: MessageEventInit); readonly data: ArrayBuffer | string; } export interface MessageEventInit { data: ArrayBuffer | string; } /** * Back compat for code migrating from older definitions. * @deprecated Use MessageEventInit instead. */ export declare type MessageEventInitializer = MessageEventInit; export declare abstract class Navigator { readonly userAgent: string; } /** * Transitionary name. * @deprecated Use StreamPipeOptions */ export interface PipeToOptions { preventClose?: boolean; preventAbort?: boolean; preventCancel?: boolean; signal?: AbortSignal; } export declare abstract class PromiseRejectionEvent extends Event { readonly promise: Promise; readonly reason: any; } export interface QueuingStrategyInit { highWaterMark: number; } /** * An instance of the R2 bucket binding. */ export interface R2Bucket { head(key: string): Promise; get(key: string): Promise; /** * Returns R2Object on a failure of the conditional specified in onlyIf. */ get(key: string, options: R2GetOptions): Promise; get(key: string, options?: R2GetOptions): Promise; put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions): Promise; delete(key: string): Promise; list(options?: R2ListOptions): Promise; } /** * Perform the operation conditionally based on meeting the defined criteria. */ export interface R2Conditional { etagMatches?: string; etagDoesNotMatch?: string; uploadedBefore?: Date; uploadedAfter?: Date; secondsGranularity?: boolean; } /** * Options for retrieving the object metadata nad payload. */ export interface R2GetOptions { onlyIf?: R2Conditional | Headers; range?: R2Range | Headers; } /** * Metadata that's automatically rendered into R2 HTTP API endpoints. * ``` * * contentType -> content-type * * contentLanguage -> content-language * etc... * ``` * This data is echoed back on GET responses based on what was originally * assigned to the object (and can typically also be overriden when issuing * the GET request). */ export interface R2HTTPMetadata { contentType?: string; contentLanguage?: string; contentDisposition?: string; contentEncoding?: string; cacheControl?: string; cacheExpiry?: Date; } export interface R2ListOptions { limit?: number; prefix?: string; cursor?: string; delimiter?: string; startAfter?: string; /** * If you populate this array, then items returned will include this metadata. * A tradeoff is that fewer results may be returned depending on how big this * data is. For now the caps are TBD but expect the total memory usage for a list * operation may need to be <1MB or even <128kb depending on how many list operations * you are sending into one bucket. Make sure to look at `truncated` for the result * rather than having logic like * ``` * while (listed.length < limit) { * listed = myBucket.list({ limit, include: ['customMetadata'] }) * } * ``` */ include?: ("httpMetadata" | "customMetadata")[]; } /** * The metadata for the object. */ export declare abstract class R2Object { readonly key: string; readonly version: string; readonly size: number; readonly etag: string; readonly httpEtag: string; readonly uploaded: Date; readonly httpMetadata?: R2HTTPMetadata; readonly customMetadata?: Record; readonly range?: R2Range; writeHttpMetadata(headers: Headers): void; } /** * The metadata for the object and the body of the payload. */ export interface R2ObjectBody extends R2Object { readonly body: ReadableStream; readonly bodyUsed: boolean; arrayBuffer(): Promise; text(): Promise; json(): Promise; blob(): Promise; } export interface R2Objects { objects: R2Object[]; truncated: boolean; cursor?: string; delimitedPrefixes: string[]; } export interface R2PutOptions { httpMetadata?: R2HTTPMetadata | Headers; customMetadata?: Record; md5?: ArrayBuffer | string; } export declare type R2Range = { offset: number; length?: number; } | { offset?: number; length: number; } | { suffix: number; }; export interface ReadResult { value?: any; done: boolean; } export declare abstract class ReadableByteStreamController { readonly byobRequest: ReadableStreamBYOBRequest | null; readonly desiredSize: number | null; close(): void; enqueue(chunk: ArrayBuffer | ArrayBufferView): void; error(reason: any): void; } export declare class ReadableStream { constructor(underlyingSource?: UnderlyingSource, queuingStrategy?: StreamQueuingStrategy); readonly locked: boolean; cancel(reason?: any): Promise; getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader; getReader(): ReadableStreamDefaultReader; pipeThrough(transform: ReadableStreamTransform, options?: PipeToOptions): ReadableStream; pipeTo(destination: WritableStream, options?: PipeToOptions): Promise; tee(): [ ReadableStream, ReadableStream ]; values(options?: ReadableStreamValuesOptions): AsyncIterableIterator; [Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator; } export declare class ReadableStreamBYOBReader { constructor(stream: ReadableStream); readonly closed: Promise; cancel(reason?: any): Promise; read(view: T): Promise>; releaseLock(): void; readAtLeast(minBytes: number, view: Uint8Array): Promise>; } export declare abstract class ReadableStreamBYOBRequest { readonly view: Uint8Array | null; respond(bytesWritten: number): void; respondWithNewView(view: ArrayBuffer | ArrayBufferView): void; readonly atLeast: number | null; } export declare abstract class ReadableStreamDefaultController { readonly desiredSize: number | null; close(): void; enqueue(chunk?: any): void; error(reason: any): void; } export declare class ReadableStreamDefaultReader { constructor(stream: ReadableStream); readonly closed: Promise; cancel(reason?: any): Promise; read(): Promise>; releaseLock(): void; } export interface ReadableStreamGetReaderOptions { mode: string; } /** * Back-compat alias. * @deprecated Use StreamPipeOptions */ export declare type ReadableStreamPipeToOptions = PipeToOptions; export declare type ReadableStreamReadResult = { done: true; value: undefined; } | { done: false; value: T; }; /** * Back-compat alias. * @deprecated Use ReadableStreamBYOBReader */ export declare type ReadableStreamReadableStreamBYOBReader = ReadableStreamBYOBReader; /** * Back-compat alias. * @deprecated Use ReadableStreamDefaultReader */ export declare type ReadableStreamReadableStreamDefaultReader = ReadableStreamDefaultReader; export interface ReadableStreamTransform { writable: WritableStream; readable: ReadableStream; } export interface ReadableStreamValuesOptions { preventCancel?: boolean; } export declare class Request extends Body { constructor(input: Request | string, init?: RequestInit | Request); clone(): Request; readonly method: string; readonly url: string; readonly headers: Headers; readonly redirect: string; readonly fetcher: Fetcher | null; readonly signal: AbortSignal; readonly cf?: IncomingRequestCfProperties; } export interface RequestInit { method?: string; headers?: HeadersInit; body?: BodyInit | null; redirect?: string; fetcher?: Fetcher | null; /** * cf is a union of these two types because there are multiple * scenarios in which it might be one or the other. * * IncomingRequestCfProperties is required to allow * new Request(someUrl, event.request) * * RequestInitCfProperties is required to allow * new Request(event.request, {cf: { ... } }) * fetch(someUrl, {cf: { ... } }) */ cf?: IncomingRequestCfProperties | RequestInitCfProperties; signal?: AbortSignal | null; } /** * In addition to the properties you can set in the RequestInit dict * that you pass as an argument to the Request constructor, you can * set certain properties of a `cf` object to control how Cloudflare * features are applied to that new Request. * * Note: Currently, these properties cannot be tested in the * playground. */ export interface RequestInitCfProperties { cacheEverything?: boolean; /** * A request's cache key is what determines if two requests are * "the same" for caching purposes. If a request has the same cache key * as some previous request, then we can serve the same cached response for * both. (e.g. 'some-key') * * Only available for Enterprise customers. */ cacheKey?: string; /** * This allows you to append additional Cache-Tag response headers * to the origin response without modifications to the origin server. * This will allow for greater control over the Purge by Cache Tag feature * utilizing changes only in the Workers process. * * Only available for Enterprise customers. */ cacheTags?: string[]; /** * Force response to be cached for a given number of seconds. (e.g. 300) */ cacheTtl?: number; /** * Force response to be cached for a given number of seconds based on the Origin status code. * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 }) */ cacheTtlByStatus?: Record; scrapeShield?: boolean; apps?: boolean; image?: RequestInitCfPropertiesImage; minify?: RequestInitCfPropertiesImageMinify; mirage?: boolean; polish?: "lossy" | "lossless" | "off"; /** * Redirects the request to an alternate origin server. You can use this, * for example, to implement load balancing across several origins. * (e.g.us-east.example.com) * * Note - For security reasons, the hostname set in resolveOverride must * be proxied on the same Cloudflare zone of the incoming request. * Otherwise, the setting is ignored. CNAME hosts are allowed, so to * resolve to a host under a different domain or a DNS only domain first * declare a CNAME record within your own zone’s DNS mapping to the * external hostname, set proxy on Cloudflare, then set resolveOverride * to point to that CNAME record. */ resolveOverride?: string; } export interface RequestInitCfPropertiesImage extends BasicImageTransformations { /** * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it * easier to specify higher-DPI sizes in . */ dpr?: number; /** * An object with four properties {left, top, right, bottom} that specify * a number of pixels to cut off on each side. Allows removal of borders * or cutting out a specific fragment of an image. Trimming is performed * before resizing or rotation. Takes dpr into account. */ trim?: { left?: number; top?: number; right?: number; bottom?: number; }; /** * Quality setting from 1-100 (useful values are in 60-90 range). Lower values * make images look worse, but load faster. The default is 85. It applies only * to JPEG and WebP images. It doesn’t have any effect on PNG. */ quality?: number; /** * Output format to generate. It can be: * - avif: generate images in AVIF format. * - webp: generate images in Google WebP format. Set quality to 100 to get * the WebP-lossless format. * - json: instead of generating an image, outputs information about the * image, in JSON format. The JSON object will contain image size * (before and after resizing), source image’s MIME type, file size, etc. */ format?: "avif" | "webp" | "json"; /** * Whether to preserve animation frames from input files. Default is true. * Setting it to false reduces animations to still images. This setting is * recommended when enlarging images or processing arbitrary user content, * because large GIF animations can weigh tens or even hundreds of megabytes. * It is also useful to set anim:false when using format:"json" to get the * response quicker without the number of frames. */ anim?: boolean; /** * What EXIF data should be preserved in the output image. Note that EXIF * rotation and embedded color profiles are always applied ("baked in" into * the image), and aren't affected by this option. Note that if the Polish * feature is enabled, all metadata may have been removed already and this * option may have no effect. * - keep: Preserve most of EXIF metadata, including GPS location if there's * any. * - copyright: Only keep the copyright tag, and discard everything else. * This is the default behavior for JPEG files. * - none: Discard all invisible EXIF metadata. Currently WebP and PNG * output formats always discard metadata. */ metadata?: "keep" | "copyright" | "none"; /** * Strength of sharpening filter to apply to the image. Floating-point * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a * recommended value for downscaled images. */ sharpen?: number; /** * Radius of a blur filter (approximate gaussian). Maximum supported radius * is 250. */ blur?: number; /** * Overlays are drawn in the order they appear in the array (last array * entry is the topmost layer). */ draw?: RequestInitCfPropertiesImageDraw[]; } export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations { /** * Absolute URL of the image file to use for the drawing. It can be any of * the supported file formats. For drawing of watermarks or non-rectangular * overlays we recommend using PNG or WebP images. */ url: string; /** * Floating-point number between 0 (transparent) and 1 (opaque). * For example, opacity: 0.5 makes overlay semitransparent. */ opacity?: number; /** * - If set to true, the overlay image will be tiled to cover the entire * area. This is useful for stock-photo-like watermarks. * - If set to "x", the overlay image will be tiled horizontally only * (form a line). * - If set to "y", the overlay image will be tiled vertically only * (form a line). */ repeat?: true | "x" | "y"; /** * Position of the overlay image relative to a given edge. Each property is * an offset in pixels. 0 aligns exactly to the edge. For example, left: 10 * positions left side of the overlay 10 pixels from the left edge of the * image it's drawn over. bottom: 0 aligns bottom of the overlay with bottom * of the background image. * * Setting both left & right, or both top & bottom is an error. * * If no position is specified, the image will be centered. */ top?: number; left?: number; bottom?: number; right?: number; } export interface RequestInitCfPropertiesImageMinify { javascript?: boolean; css?: boolean; html?: boolean; } /** * Back compat for code migrating from older definitions. * @deprecated Use RequestInit instead. */ export declare type RequestInitializerDict = RequestInit; export declare class Response extends Body { constructor(bodyInit?: BodyInit | null, maybeInit?: ResponseInit | Response); static redirect(url: string, status?: number): Response; static json(any: any, maybeInit?: ResponseInit | Response): Response; clone(): Response; readonly status: number; readonly statusText: string; readonly headers: Headers; readonly ok: boolean; readonly redirected: boolean; readonly url: string; readonly webSocket: WebSocket | null; readonly cf?: Object; } export interface ResponseInit { status?: number; statusText?: string; headers?: HeadersInit; cf?: Object; webSocket?: WebSocket | null; encodeBody?: string; } /** * Back compat for code migrating from older definitions. * @deprecated Use ResponseInit instead. */ export declare type ResponseInitializerDict = ResponseInit; export interface RsaOtherPrimesInfo { r?: string; d?: string; t?: string; } export interface ScheduledController { readonly scheduledTime: number; readonly cron: string; noRetry(): void; } export declare abstract class ScheduledEvent extends ExtendableEvent { readonly scheduledTime: number; readonly cron: string; noRetry(): void; } export interface Scheduler { wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise; } export interface SchedulerWaitOptions { signal?: AbortSignal; } export interface ServiceWorkerGlobalScope extends WorkerGlobalScope { btoa(data: string): string; atob(data: string): string; setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number; clearTimeout(timeoutId: number | null): void; setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number; clearInterval(timeoutId: number | null): void; queueMicrotask(task: Function): void; structuredClone(value: any, options?: ServiceWorkerGlobalScopeStructuredCloneOptions): any; fetch(request: Request | string, requestInitr?: RequestInit | Request): Promise; self: ServiceWorkerGlobalScope; crypto: Crypto; caches: CacheStorage; scheduler: Scheduler; navigator: Navigator; readonly console: Console; origin: void; } export interface ServiceWorkerGlobalScopeStructuredCloneOptions { transfer?: any[]; } export declare type StreamPipeOptions = PipeToOptions; export interface StreamQueuingStrategy { highWaterMark?: number; size(chunk: any): number; } export declare abstract class SubtleCrypto { encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise; decrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, cipherText: ArrayBuffer | ArrayBufferView): Promise; sign(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, data: ArrayBuffer | ArrayBufferView): Promise; verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise; digest(algorithm: string | SubtleCryptoHashAlgorithm, data: ArrayBuffer | ArrayBufferView): Promise; generateKey(algorithm: string | SubtleCryptoGenerateKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise; deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise; deriveBits(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, length: number | null): Promise; importKey(format: string, keyData: ArrayBuffer | JsonWebKey, algorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise; exportKey(format: string, key: CryptoKey): Promise; wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise; unwrapKey(format: string, wrappedKey: ArrayBuffer | ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm, unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise; timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean; } export interface SubtleCryptoDeriveKeyAlgorithm { name: string; salt?: ArrayBuffer; iterations?: number; hash?: string | SubtleCryptoHashAlgorithm; public?: CryptoKey; info?: ArrayBuffer; } export interface SubtleCryptoEncryptAlgorithm { name: string; iv?: ArrayBuffer; additionalData?: ArrayBuffer; tagLength?: number; counter?: ArrayBuffer; length?: number; label?: ArrayBuffer; } export interface SubtleCryptoGenerateKeyAlgorithm { name: string; hash?: string | SubtleCryptoHashAlgorithm; modulusLength?: number; publicExponent?: ArrayBuffer; length?: number; namedCurve?: string; } export interface SubtleCryptoHashAlgorithm { name: string; } export interface SubtleCryptoImportKeyAlgorithm { name: string; hash?: string | SubtleCryptoHashAlgorithm; length?: number; namedCurve?: string; compressed?: boolean; } /** * * @deprecated Don't use. Introduced incidentally in 3.x. Scheduled for removal. */ export declare type SubtleCryptoJsonWebKey = JsonWebKey; /** * * @deprecated Don't use. Introduced incidentally in 3.x. Scheduled for removal. */ export declare type SubtleCryptoJsonWebKeyRsaOtherPrimesInfo = RsaOtherPrimesInfo; export interface SubtleCryptoSignAlgorithm { name: string; hash?: string | SubtleCryptoHashAlgorithm; dataLength?: number; saltLength?: number; } export interface Text { readonly text: string; readonly lastInTextNode: boolean; readonly removed: boolean; before(content: Content, options?: ContentOptions): Text; after(content: Content, options?: ContentOptions): Text; replace(content: Content, options?: ContentOptions): Text; remove(): Text; } export declare class TextDecoder { constructor(label?: "utf-8" | "utf8" | "unicode-1-1-utf-8", options?: TextDecoderConstructorOptions); decode(input?: ArrayBuffer | ArrayBufferView, options?: TextDecoderDecodeOptions): string; readonly encoding: string; readonly fatal: boolean; readonly ignoreBOM: boolean; } export interface TextDecoderConstructorOptions { fatal: boolean; ignoreBOM: boolean; } export interface TextDecoderDecodeOptions { stream: boolean; } export declare class TextDecoderStream extends TransformStream { constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit); } export interface TextDecoderStreamTextDecoderStreamInit { fatal?: boolean; } export declare class TextEncoder { constructor(); encode(input?: string): Uint8Array; encodeInto(input: string, buffer: Uint8Array): TextEncoderEncodeIntoResult; readonly encoding: string; } export interface TextEncoderEncodeIntoResult { read: number; written: number; } export declare class TextEncoderStream extends TransformStream { constructor(); } export declare class TransformStream { constructor(maybeTransformer?: Transformer, maybeWritableStrategy?: StreamQueuingStrategy, maybeReadableStrategy?: StreamQueuingStrategy); readonly readable: ReadableStream; readonly writable: WritableStream; } export interface TransformStreamDefaultController { readonly desiredSize: number | null; enqueue(chunk: any): void; error(reason: any): void; terminate(): void; } export interface Transformer { readableType?: string; writableType?: string; start?(controller: TransformStreamDefaultController): any; transform?(chunk: any, controller: TransformStreamDefaultController): any; flush?(controller: TransformStreamDefaultController): any; } export declare class URL { constructor(url: string, base?: string); href: string; readonly origin: string; protocol: string; username: string; password: string; host: string; hostname: string; port: string; pathname: string; search: string; readonly searchParams: URLSearchParams; hash: string; toString(): string; toJSON(): string; } export declare class URLPattern { constructor(input?: string | URLPatternURLPatternInit, baseURL?: string); readonly protocol: string; readonly username: string; readonly password: string; readonly hostname: string; readonly port: string; readonly pathname: string; readonly search: string; readonly hash: string; test(input?: string | URLPatternURLPatternInit, baseURL?: string): boolean; exec(input?: string | URLPatternURLPatternInit, baseURL?: string): URLPatternURLPatternResult | null; } export interface URLPatternURLPatternComponentResult { input: string; groups: Record; } export interface URLPatternURLPatternInit { protocol?: string; username?: string; password?: string; hostname?: string; port?: string; pathname?: string; search?: string; hash?: string; baseURL?: string; } export interface URLPatternURLPatternResult { inputs: (string | URLPatternURLPatternInit)[]; protocol: URLPatternURLPatternComponentResult; username: URLPatternURLPatternComponentResult; password: URLPatternURLPatternComponentResult; hostname: URLPatternURLPatternComponentResult; port: URLPatternURLPatternComponentResult; pathname: URLPatternURLPatternComponentResult; search: URLPatternURLPatternComponentResult; hash: URLPatternURLPatternComponentResult; } export declare class URLSearchParams { constructor(init?: URLSearchParamsInit); append(name: string, value: string): void; delete(name: string): void; get(name: string): string | null; getAll(name: string): string[]; has(name: string): boolean; set(name: string, value: string): void; sort(): void; entries(): IterableIterator<[ key: string, value: string ]>; keys(): IterableIterator; values(): IterableIterator; forEach(callback: (this: This, key: string, value: string, parent: URLSearchParams) => void, thisArg?: This): void; [Symbol.iterator](): IterableIterator<[ key: string, value: string ]>; toString(): string; } export declare type URLSearchParamsInit = URLSearchParams | string | Record | [ key: string, value: string ][]; /** * Back compat for code migrating to older definitions. * This technically isn't part of a standard either way, but the naming * is more consistent. * @deprecated Use URLSearchParamsInit instead. */ export declare type URLSearchParamsInitializer = URLSearchParamsInit; export interface UnderlyingSink { type?: string; start?(controller: WritableStreamDefaultController): any; write?(chunk: any, controller: WritableStreamDefaultController): any; abort?(reason: any): any; close?(): any; } export interface UnderlyingSource { type?: string; autoAllocateChunkSize?: number; start?(controller: ReadableStreamDefaultController | ReadableByteStreamController): any; pull?(controller: ReadableStreamDefaultController | ReadableByteStreamController): any; cancel?(reason?: any): any; } export declare class WebSocket extends EventTarget { constructor(url: string, protocols?: string[] | string); accept(): void; send(message: ArrayBuffer | ArrayBufferView | string): void; close(code?: number, reason?: string): void; static readonly READY_STATE_CONNECTING: number; static readonly READY_STATE_OPEN: number; static readonly READY_STATE_CLOSING: number; static readonly READY_STATE_CLOSED: number; readonly readyState: number; readonly url: string | null; readonly protocol: string | null; readonly extensions: string | null; } export declare type WebSocketEventMap = { close: CloseEvent; message: MessageEvent; open: Event; error: ErrorEvent; }; export declare const WebSocketPair: { new (): { 0: WebSocket; 1: WebSocket; }; }; export declare abstract class WorkerGlobalScope extends EventTarget { } export declare type WorkerGlobalScopeEventMap = { fetch: FetchEvent; scheduled: ScheduledEvent; unhandledrejection: PromiseRejectionEvent; rejectionhandled: PromiseRejectionEvent; }; export declare class WritableStream { constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: StreamQueuingStrategy); readonly locked: boolean; abort(reason: any): Promise; close(): Promise; getWriter(): WritableStreamDefaultWriter; } export declare abstract class WritableStreamDefaultController { readonly signal: AbortSignal; error(reason?: any): void; } export declare class WritableStreamDefaultWriter { constructor(stream: WritableStream); readonly closed: Promise; readonly ready: Promise; readonly desiredSize: number | null; abort(reason: any): Promise; close(): Promise; write(chunk: any): Promise; releaseLock(): void; } /** * Back-compat alias. * @deprecated Use WritableStreamDefaultWriter */ export declare type WritableStreamWritableStreamDefaultWriter = WritableStreamDefaultWriter; export declare function addEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetAddEventListenerOptions | boolean): void; export declare function atob(data: string): string; export declare function btoa(data: string): string; export declare const caches: CacheStorage; export declare function clearInterval(timeoutId: number | null): void; export declare function clearTimeout(timeoutId: number | null): void; export declare const console: Console; export declare const crypto: Crypto; export declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean; export declare function fetch(request: Request | string, requestInitr?: RequestInit | Request): Promise; export declare const navigator: Navigator; export declare const origin: void; export declare function queueMicrotask(task: Function): void; export declare function removeEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetEventListenerOptions | boolean): void; export declare const scheduler: Scheduler; export declare const self: ServiceWorkerGlobalScope; export declare function setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number; export declare function setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number; export declare function structuredClone(value: any, options?: ServiceWorkerGlobalScopeStructuredCloneOptions): any; /*** Injected pages.d.ts ***/ export type Params

= Record; export type EventContext = { request: Request; functionPath: string; waitUntil: (promise: Promise) => void; next: (input?: Request | string, init?: RequestInit) => Promise; env: Env & { ASSETS: { fetch: typeof fetch; }; }; params: Params

; data: Data; }; export declare type PagesFunction = Record> = (context: EventContext) => Response | Promise; export type EventPluginContext = { request: Request; functionPath: string; waitUntil: (promise: Promise) => void; next: (input?: Request | string, init?: RequestInit) => Promise; env: Env & { ASSETS: { fetch: typeof fetch; }; }; params: Params

; data: Data; pluginArgs: PluginArgs; }; export declare type PagesPluginFunction = Record, PluginArgs = unknown> = (context: EventPluginContext) => Response | Promise;