Path: blob/master/webhooks/stream-parkpow-webhook-worker/worker-configuration.d.ts
1093 views
/* eslint-disable */1// Generated by Wrangler by running `wrangler types` (hash: f0149d2b77774d1b4a0b0913415378e4)2// Runtime types generated with [email protected] 2025-11-043declare namespace Cloudflare {4interface GlobalProps {5mainModule: typeof import("./src/index");6}7interface Env {8PARKPOW_ENDPOINT: "https://app.parkpow.com/api/v1/webhook-receiver/";9}10}11interface Env extends Cloudflare.Env {}1213// Begin runtime types14/*! *****************************************************************************15Copyright (c) Cloudflare. All rights reserved.16Copyright (c) Microsoft Corporation. All rights reserved.1718Licensed under the Apache License, Version 2.0 (the "License"); you may not use19this file except in compliance with the License. You may obtain a copy of the20License at http://www.apache.org/licenses/LICENSE-2.021THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY22KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED23WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,24MERCHANTABLITY OR NON-INFRINGEMENT.25See the Apache Version 2.0 License for specific language governing permissions26and limitations under the License.27***************************************************************************** */28/* eslint-disable */29// noinspection JSUnusedGlobalSymbols30declare var onmessage: never;31/**32* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.33*34* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)35*/36declare class DOMException extends Error {37constructor(message?: string, name?: string);38/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */39readonly message: string;40/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */41readonly name: string;42/**43* @deprecated44*45* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)46*/47readonly code: number;48static readonly INDEX_SIZE_ERR: number;49static readonly DOMSTRING_SIZE_ERR: number;50static readonly HIERARCHY_REQUEST_ERR: number;51static readonly WRONG_DOCUMENT_ERR: number;52static readonly INVALID_CHARACTER_ERR: number;53static readonly NO_DATA_ALLOWED_ERR: number;54static readonly NO_MODIFICATION_ALLOWED_ERR: number;55static readonly NOT_FOUND_ERR: number;56static readonly NOT_SUPPORTED_ERR: number;57static readonly INUSE_ATTRIBUTE_ERR: number;58static readonly INVALID_STATE_ERR: number;59static readonly SYNTAX_ERR: number;60static readonly INVALID_MODIFICATION_ERR: number;61static readonly NAMESPACE_ERR: number;62static readonly INVALID_ACCESS_ERR: number;63static readonly VALIDATION_ERR: number;64static readonly TYPE_MISMATCH_ERR: number;65static readonly SECURITY_ERR: number;66static readonly NETWORK_ERR: number;67static readonly ABORT_ERR: number;68static readonly URL_MISMATCH_ERR: number;69static readonly QUOTA_EXCEEDED_ERR: number;70static readonly TIMEOUT_ERR: number;71static readonly INVALID_NODE_TYPE_ERR: number;72static readonly DATA_CLONE_ERR: number;73get stack(): any;74set stack(value: any);75}76type WorkerGlobalScopeEventMap = {77fetch: FetchEvent;78scheduled: ScheduledEvent;79queue: QueueEvent;80unhandledrejection: PromiseRejectionEvent;81rejectionhandled: PromiseRejectionEvent;82};83declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {84EventTarget: typeof EventTarget;85}86/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */87interface Console {88"assert"(condition?: boolean, ...data: any[]): void;89/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */90clear(): void;91/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */92count(label?: string): void;93/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */94countReset(label?: string): void;95/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */96debug(...data: any[]): void;97/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */98dir(item?: any, options?: any): void;99/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */100dirxml(...data: any[]): void;101/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */102error(...data: any[]): void;103/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */104group(...data: any[]): void;105/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */106groupCollapsed(...data: any[]): void;107/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */108groupEnd(): void;109/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */110info(...data: any[]): void;111/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */112log(...data: any[]): void;113/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */114table(tabularData?: any, properties?: string[]): void;115/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */116time(label?: string): void;117/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */118timeEnd(label?: string): void;119/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */120timeLog(label?: string, ...data: any[]): void;121timeStamp(label?: string): void;122/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */123trace(...data: any[]): void;124/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */125warn(...data: any[]): void;126}127declare const console: Console;128type BufferSource = ArrayBufferView | ArrayBuffer;129type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;130declare namespace WebAssembly {131class CompileError extends Error {132constructor(message?: string);133}134class RuntimeError extends Error {135constructor(message?: string);136}137type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";138interface GlobalDescriptor {139value: ValueType;140mutable?: boolean;141}142class Global {143constructor(descriptor: GlobalDescriptor, value?: any);144value: any;145valueOf(): any;146}147type ImportValue = ExportValue | number;148type ModuleImports = Record<string, ImportValue>;149type Imports = Record<string, ModuleImports>;150type ExportValue = Function | Global | Memory | Table;151type Exports = Record<string, ExportValue>;152class Instance {153constructor(module: Module, imports?: Imports);154readonly exports: Exports;155}156interface MemoryDescriptor {157initial: number;158maximum?: number;159shared?: boolean;160}161class Memory {162constructor(descriptor: MemoryDescriptor);163readonly buffer: ArrayBuffer;164grow(delta: number): number;165}166type ImportExportKind = "function" | "global" | "memory" | "table";167interface ModuleExportDescriptor {168kind: ImportExportKind;169name: string;170}171interface ModuleImportDescriptor {172kind: ImportExportKind;173module: string;174name: string;175}176abstract class Module {177static customSections(module: Module, sectionName: string): ArrayBuffer[];178static exports(module: Module): ModuleExportDescriptor[];179static imports(module: Module): ModuleImportDescriptor[];180}181type TableKind = "anyfunc" | "externref";182interface TableDescriptor {183element: TableKind;184initial: number;185maximum?: number;186}187class Table {188constructor(descriptor: TableDescriptor, value?: any);189readonly length: number;190get(index: number): any;191grow(delta: number, value?: any): number;192set(index: number, value?: any): void;193}194function instantiate(module: Module, imports?: Imports): Promise<Instance>;195function validate(bytes: BufferSource): boolean;196}197/**198* This ServiceWorker API interface represents the global execution context of a service worker.199* Available only in secure contexts.200*201* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)202*/203interface ServiceWorkerGlobalScope extends WorkerGlobalScope {204DOMException: typeof DOMException;205WorkerGlobalScope: typeof WorkerGlobalScope;206btoa(data: string): string;207atob(data: string): string;208setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;209setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;210clearTimeout(timeoutId: number | null): void;211setInterval(callback: (...args: any[]) => void, msDelay?: number): number;212setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;213clearInterval(timeoutId: number | null): void;214queueMicrotask(task: Function): void;215structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;216reportError(error: any): void;217fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;218self: ServiceWorkerGlobalScope;219crypto: Crypto;220caches: CacheStorage;221scheduler: Scheduler;222performance: Performance;223Cloudflare: Cloudflare;224readonly origin: string;225Event: typeof Event;226ExtendableEvent: typeof ExtendableEvent;227CustomEvent: typeof CustomEvent;228PromiseRejectionEvent: typeof PromiseRejectionEvent;229FetchEvent: typeof FetchEvent;230TailEvent: typeof TailEvent;231TraceEvent: typeof TailEvent;232ScheduledEvent: typeof ScheduledEvent;233MessageEvent: typeof MessageEvent;234CloseEvent: typeof CloseEvent;235ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;236ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;237ReadableStream: typeof ReadableStream;238WritableStream: typeof WritableStream;239WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;240TransformStream: typeof TransformStream;241ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;242CountQueuingStrategy: typeof CountQueuingStrategy;243ErrorEvent: typeof ErrorEvent;244MessageChannel: typeof MessageChannel;245MessagePort: typeof MessagePort;246EventSource: typeof EventSource;247ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;248ReadableStreamDefaultController: typeof ReadableStreamDefaultController;249ReadableByteStreamController: typeof ReadableByteStreamController;250WritableStreamDefaultController: typeof WritableStreamDefaultController;251TransformStreamDefaultController: typeof TransformStreamDefaultController;252CompressionStream: typeof CompressionStream;253DecompressionStream: typeof DecompressionStream;254TextEncoderStream: typeof TextEncoderStream;255TextDecoderStream: typeof TextDecoderStream;256Headers: typeof Headers;257Body: typeof Body;258Request: typeof Request;259Response: typeof Response;260WebSocket: typeof WebSocket;261WebSocketPair: typeof WebSocketPair;262WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;263AbortController: typeof AbortController;264AbortSignal: typeof AbortSignal;265TextDecoder: typeof TextDecoder;266TextEncoder: typeof TextEncoder;267navigator: Navigator;268Navigator: typeof Navigator;269URL: typeof URL;270URLSearchParams: typeof URLSearchParams;271URLPattern: typeof URLPattern;272Blob: typeof Blob;273File: typeof File;274FormData: typeof FormData;275Crypto: typeof Crypto;276SubtleCrypto: typeof SubtleCrypto;277CryptoKey: typeof CryptoKey;278CacheStorage: typeof CacheStorage;279Cache: typeof Cache;280FixedLengthStream: typeof FixedLengthStream;281IdentityTransformStream: typeof IdentityTransformStream;282HTMLRewriter: typeof HTMLRewriter;283}284declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;285declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;286/**287* Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.288*289* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)290*/291declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean;292/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */293declare function btoa(data: string): string;294/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */295declare function atob(data: string): string;296/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */297declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;298/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */299declare function setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;300/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */301declare function clearTimeout(timeoutId: number | null): void;302/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */303declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;304/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */305declare function setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;306/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */307declare function clearInterval(timeoutId: number | null): void;308/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */309declare function queueMicrotask(task: Function): void;310/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */311declare function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;312/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */313declare function reportError(error: any): void;314/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */315declare function fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;316declare const self: ServiceWorkerGlobalScope;317/**318* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.319* The Workers runtime implements the full surface of this API, but with some differences in320* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)321* compared to those implemented in most browsers.322*323* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)324*/325declare const crypto: Crypto;326/**327* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.328*329* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)330*/331declare const caches: CacheStorage;332declare const scheduler: Scheduler;333/**334* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,335* as well as timing of subrequests and other operations.336*337* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)338*/339declare const performance: Performance;340declare const Cloudflare: Cloudflare;341declare const origin: string;342declare const navigator: Navigator;343interface TestController {344}345interface ExecutionContext<Props = unknown> {346waitUntil(promise: Promise<any>): void;347passThroughOnException(): void;348readonly props: Props;349}350type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Response | Promise<Response>;351type ExportedHandlerTailHandler<Env = unknown> = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;352type ExportedHandlerTraceHandler<Env = unknown> = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;353type ExportedHandlerTailStreamHandler<Env = unknown> = (event: TailStream.TailEvent<TailStream.Onset>, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;354type ExportedHandlerScheduledHandler<Env = unknown> = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise<void>;355type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (batch: MessageBatch<Message>, env: Env, ctx: ExecutionContext) => void | Promise<void>;356type ExportedHandlerTestHandler<Env = unknown> = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise<void>;357interface ExportedHandler<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown> {358fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;359tail?: ExportedHandlerTailHandler<Env>;360trace?: ExportedHandlerTraceHandler<Env>;361tailStream?: ExportedHandlerTailStreamHandler<Env>;362scheduled?: ExportedHandlerScheduledHandler<Env>;363test?: ExportedHandlerTestHandler<Env>;364email?: EmailExportedHandler<Env>;365queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;366}367interface StructuredSerializeOptions {368transfer?: any[];369}370/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */371declare abstract class PromiseRejectionEvent extends Event {372/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */373readonly promise: Promise<any>;374/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */375readonly reason: any;376}377declare abstract class Navigator {378sendBeacon(url: string, body?: (ReadableStream | string | (ArrayBuffer | ArrayBufferView) | Blob | FormData | URLSearchParams | URLSearchParams)): boolean;379readonly userAgent: string;380readonly hardwareConcurrency: number;381readonly language: string;382readonly languages: string[];383}384interface AlarmInvocationInfo {385readonly isRetry: boolean;386readonly retryCount: number;387}388interface Cloudflare {389readonly compatibilityFlags: Record<string, boolean>;390}391interface DurableObject {392fetch(request: Request): Response | Promise<Response>;393alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;394webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>;395webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>;396webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;397}398type DurableObjectStub<T extends Rpc.DurableObjectBranded | undefined = undefined> = Fetcher<T, "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"> & {399readonly id: DurableObjectId;400readonly name?: string;401};402interface DurableObjectId {403toString(): string;404equals(other: DurableObjectId): boolean;405readonly name?: string;406}407declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {408newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;409idFromName(name: string): DurableObjectId;410idFromString(id: string): DurableObjectId;411get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;412getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;413jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;414}415type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";416interface DurableObjectNamespaceNewUniqueIdOptions {417jurisdiction?: DurableObjectJurisdiction;418}419type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";420interface DurableObjectNamespaceGetDurableObjectOptions {421locationHint?: DurableObjectLocationHint;422}423interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {424}425interface DurableObjectState<Props = unknown> {426waitUntil(promise: Promise<any>): void;427readonly props: Props;428readonly id: DurableObjectId;429readonly storage: DurableObjectStorage;430container?: Container;431blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;432acceptWebSocket(ws: WebSocket, tags?: string[]): void;433getWebSockets(tag?: string): WebSocket[];434setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;435getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;436getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;437setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;438getHibernatableWebSocketEventTimeout(): number | null;439getTags(ws: WebSocket): string[];440abort(reason?: string): void;441}442interface DurableObjectTransaction {443get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;444get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>;445list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>;446put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>;447put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>;448delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;449delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;450rollback(): void;451getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;452setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>;453deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;454}455interface DurableObjectStorage {456get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;457get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>;458list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>;459put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>;460put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>;461delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;462delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;463deleteAll(options?: DurableObjectPutOptions): Promise<void>;464transaction<T>(closure: (txn: DurableObjectTransaction) => Promise<T>): Promise<T>;465getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;466setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>;467deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;468sync(): Promise<void>;469sql: SqlStorage;470kv: SyncKvStorage;471transactionSync<T>(closure: () => T): T;472getCurrentBookmark(): Promise<string>;473getBookmarkForTime(timestamp: number | Date): Promise<string>;474onNextSessionRestoreBookmark(bookmark: string): Promise<string>;475}476interface DurableObjectListOptions {477start?: string;478startAfter?: string;479end?: string;480prefix?: string;481reverse?: boolean;482limit?: number;483allowConcurrency?: boolean;484noCache?: boolean;485}486interface DurableObjectGetOptions {487allowConcurrency?: boolean;488noCache?: boolean;489}490interface DurableObjectGetAlarmOptions {491allowConcurrency?: boolean;492}493interface DurableObjectPutOptions {494allowConcurrency?: boolean;495allowUnconfirmed?: boolean;496noCache?: boolean;497}498interface DurableObjectSetAlarmOptions {499allowConcurrency?: boolean;500allowUnconfirmed?: boolean;501}502declare class WebSocketRequestResponsePair {503constructor(request: string, response: string);504get request(): string;505get response(): string;506}507interface AnalyticsEngineDataset {508writeDataPoint(event?: AnalyticsEngineDataPoint): void;509}510interface AnalyticsEngineDataPoint {511indexes?: ((ArrayBuffer | string) | null)[];512doubles?: number[];513blobs?: ((ArrayBuffer | string) | null)[];514}515/**516* An event which takes place in the DOM.517*518* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)519*/520declare class Event {521constructor(type: string, init?: EventInit);522/**523* Returns the type of event, e.g. "click", "hashchange", or "submit".524*525* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)526*/527get type(): string;528/**529* Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.530*531* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)532*/533get eventPhase(): number;534/**535* Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.536*537* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)538*/539get composed(): boolean;540/**541* Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.542*543* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)544*/545get bubbles(): boolean;546/**547* Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.548*549* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)550*/551get cancelable(): boolean;552/**553* Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.554*555* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)556*/557get defaultPrevented(): boolean;558/**559* @deprecated560*561* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)562*/563get returnValue(): boolean;564/**565* Returns the object whose event listener's callback is currently being invoked.566*567* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)568*/569get currentTarget(): EventTarget | undefined;570/**571* Returns the object to which event is dispatched (its target).572*573* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)574*/575get target(): EventTarget | undefined;576/**577* @deprecated578*579* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)580*/581get srcElement(): EventTarget | undefined;582/**583* Returns the event's timestamp as the number of milliseconds measured relative to the time origin.584*585* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)586*/587get timeStamp(): number;588/**589* Returns true if event was dispatched by the user agent, and false otherwise.590*591* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)592*/593get isTrusted(): boolean;594/**595* @deprecated596*597* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)598*/599get cancelBubble(): boolean;600/**601* @deprecated602*603* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)604*/605set cancelBubble(value: boolean);606/**607* Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.608*609* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)610*/611stopImmediatePropagation(): void;612/**613* If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.614*615* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)616*/617preventDefault(): void;618/**619* When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.620*621* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)622*/623stopPropagation(): void;624/**625* Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.626*627* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)628*/629composedPath(): EventTarget[];630static readonly NONE: number;631static readonly CAPTURING_PHASE: number;632static readonly AT_TARGET: number;633static readonly BUBBLING_PHASE: number;634}635interface EventInit {636bubbles?: boolean;637cancelable?: boolean;638composed?: boolean;639}640type EventListener<EventType extends Event = Event> = (event: EventType) => void;641interface EventListenerObject<EventType extends Event = Event> {642handleEvent(event: EventType): void;643}644type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;645/**646* EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.647*648* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)649*/650declare class EventTarget<EventMap extends Record<string, Event> = Record<string, Event>> {651constructor();652/**653* Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.654*655* The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.656*657* When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.658*659* When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.660*661* When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.662*663* If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.664*665* The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.666*667* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)668*/669addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;670/**671* Removes the event listener in target's event listener list with the same type, callback, and options.672*673* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)674*/675removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;676/**677* Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.678*679* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)680*/681dispatchEvent(event: EventMap[keyof EventMap]): boolean;682}683interface EventTargetEventListenerOptions {684capture?: boolean;685}686interface EventTargetAddEventListenerOptions {687capture?: boolean;688passive?: boolean;689once?: boolean;690signal?: AbortSignal;691}692interface EventTargetHandlerObject {693handleEvent: (event: Event) => any | undefined;694}695/**696* A controller object that allows you to abort one or more DOM requests as and when desired.697*698* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)699*/700declare class AbortController {701constructor();702/**703* Returns the AbortSignal object associated with this object.704*705* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)706*/707get signal(): AbortSignal;708/**709* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.710*711* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)712*/713abort(reason?: any): void;714}715/**716* A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.717*718* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)719*/720declare abstract class AbortSignal extends EventTarget {721/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */722static abort(reason?: any): AbortSignal;723/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */724static timeout(delay: number): AbortSignal;725/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */726static any(signals: AbortSignal[]): AbortSignal;727/**728* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.729*730* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)731*/732get aborted(): boolean;733/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */734get reason(): any;735/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */736get onabort(): any | null;737/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */738set onabort(value: any | null);739/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */740throwIfAborted(): void;741}742interface Scheduler {743wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;744}745interface SchedulerWaitOptions {746signal?: AbortSignal;747}748/**749* Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.750*751* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)752*/753declare abstract class ExtendableEvent extends Event {754/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */755waitUntil(promise: Promise<any>): void;756}757/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */758declare class CustomEvent<T = any> extends Event {759constructor(type: string, init?: CustomEventCustomEventInit);760/**761* Returns any custom data event was created with. Typically used for synthetic events.762*763* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)764*/765get detail(): T;766}767interface CustomEventCustomEventInit {768bubbles?: boolean;769cancelable?: boolean;770composed?: boolean;771detail?: any;772}773/**774* A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.775*776* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)777*/778declare class Blob {779constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);780/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */781get size(): number;782/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */783get type(): string;784/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */785slice(start?: number, end?: number, type?: string): Blob;786/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */787arrayBuffer(): Promise<ArrayBuffer>;788/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */789bytes(): Promise<Uint8Array>;790/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */791text(): Promise<string>;792/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */793stream(): ReadableStream;794}795interface BlobOptions {796type?: string;797}798/**799* Provides information about files and allows JavaScript in a web page to access their content.800*801* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)802*/803declare class File extends Blob {804constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);805/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */806get name(): string;807/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */808get lastModified(): number;809}810interface FileOptions {811type?: string;812lastModified?: number;813}814/**815* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.816*817* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)818*/819declare abstract class CacheStorage {820/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */821open(cacheName: string): Promise<Cache>;822readonly default: Cache;823}824/**825* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.826*827* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)828*/829declare abstract class Cache {830/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */831delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>;832/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */833match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>;834/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */835put(request: RequestInfo | URL, response: Response): Promise<void>;836}837interface CacheQueryOptions {838ignoreMethod?: boolean;839}840/**841* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.842* The Workers runtime implements the full surface of this API, but with some differences in843* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)844* compared to those implemented in most browsers.845*846* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)847*/848declare abstract class Crypto {849/**850* Available only in secure contexts.851*852* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)853*/854get subtle(): SubtleCrypto;855/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */856getRandomValues<T extends Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array>(buffer: T): T;857/**858* Available only in secure contexts.859*860* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)861*/862randomUUID(): string;863DigestStream: typeof DigestStream;864}865/**866* This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).867* Available only in secure contexts.868*869* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)870*/871declare abstract class SubtleCrypto {872/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */873encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;874/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */875decrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, cipherText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;876/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */877sign(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;878/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */879verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;880/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */881digest(algorithm: string | SubtleCryptoHashAlgorithm, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;882/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */883generateKey(algorithm: string | SubtleCryptoGenerateKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey | CryptoKeyPair>;884/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */885deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;886/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */887deriveBits(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;888/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */889importKey(format: string, keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey, algorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;890/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */891exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;892/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */893wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;894/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */895unwrapKey(format: string, wrappedKey: ArrayBuffer | ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm, unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;896timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;897}898/**899* The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.900* Available only in secure contexts.901*902* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)903*/904declare abstract class CryptoKey {905/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */906readonly type: string;907/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */908readonly extractable: boolean;909/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */910readonly algorithm: CryptoKeyKeyAlgorithm | CryptoKeyAesKeyAlgorithm | CryptoKeyHmacKeyAlgorithm | CryptoKeyRsaKeyAlgorithm | CryptoKeyEllipticKeyAlgorithm | CryptoKeyArbitraryKeyAlgorithm;911/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */912readonly usages: string[];913}914interface CryptoKeyPair {915publicKey: CryptoKey;916privateKey: CryptoKey;917}918interface JsonWebKey {919kty: string;920use?: string;921key_ops?: string[];922alg?: string;923ext?: boolean;924crv?: string;925x?: string;926y?: string;927d?: string;928n?: string;929e?: string;930p?: string;931q?: string;932dp?: string;933dq?: string;934qi?: string;935oth?: RsaOtherPrimesInfo[];936k?: string;937}938interface RsaOtherPrimesInfo {939r?: string;940d?: string;941t?: string;942}943interface SubtleCryptoDeriveKeyAlgorithm {944name: string;945salt?: (ArrayBuffer | ArrayBufferView);946iterations?: number;947hash?: (string | SubtleCryptoHashAlgorithm);948$public?: CryptoKey;949info?: (ArrayBuffer | ArrayBufferView);950}951interface SubtleCryptoEncryptAlgorithm {952name: string;953iv?: (ArrayBuffer | ArrayBufferView);954additionalData?: (ArrayBuffer | ArrayBufferView);955tagLength?: number;956counter?: (ArrayBuffer | ArrayBufferView);957length?: number;958label?: (ArrayBuffer | ArrayBufferView);959}960interface SubtleCryptoGenerateKeyAlgorithm {961name: string;962hash?: (string | SubtleCryptoHashAlgorithm);963modulusLength?: number;964publicExponent?: (ArrayBuffer | ArrayBufferView);965length?: number;966namedCurve?: string;967}968interface SubtleCryptoHashAlgorithm {969name: string;970}971interface SubtleCryptoImportKeyAlgorithm {972name: string;973hash?: (string | SubtleCryptoHashAlgorithm);974length?: number;975namedCurve?: string;976compressed?: boolean;977}978interface SubtleCryptoSignAlgorithm {979name: string;980hash?: (string | SubtleCryptoHashAlgorithm);981dataLength?: number;982saltLength?: number;983}984interface CryptoKeyKeyAlgorithm {985name: string;986}987interface CryptoKeyAesKeyAlgorithm {988name: string;989length: number;990}991interface CryptoKeyHmacKeyAlgorithm {992name: string;993hash: CryptoKeyKeyAlgorithm;994length: number;995}996interface CryptoKeyRsaKeyAlgorithm {997name: string;998modulusLength: number;999publicExponent: ArrayBuffer | ArrayBufferView;1000hash?: CryptoKeyKeyAlgorithm;1001}1002interface CryptoKeyEllipticKeyAlgorithm {1003name: string;1004namedCurve: string;1005}1006interface CryptoKeyArbitraryKeyAlgorithm {1007name: string;1008hash?: CryptoKeyKeyAlgorithm;1009namedCurve?: string;1010length?: number;1011}1012declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {1013constructor(algorithm: string | SubtleCryptoHashAlgorithm);1014readonly digest: Promise<ArrayBuffer>;1015get bytesWritten(): number | bigint;1016}1017/**1018* A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.1019*1020* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)1021*/1022declare class TextDecoder {1023constructor(label?: string, options?: TextDecoderConstructorOptions);1024/**1025* Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.1026*1027* ```1028* var string = "", decoder = new TextDecoder(encoding), buffer;1029* while(buffer = next_chunk()) {1030* string += decoder.decode(buffer, {stream:true});1031* }1032* string += decoder.decode(); // end-of-queue1033* ```1034*1035* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.1036*1037* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)1038*/1039decode(input?: (ArrayBuffer | ArrayBufferView), options?: TextDecoderDecodeOptions): string;1040get encoding(): string;1041get fatal(): boolean;1042get ignoreBOM(): boolean;1043}1044/**1045* TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.1046*1047* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)1048*/1049declare class TextEncoder {1050constructor();1051/**1052* Returns the result of running UTF-8's encoder.1053*1054* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)1055*/1056encode(input?: string): Uint8Array;1057/**1058* Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.1059*1060* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)1061*/1062encodeInto(input: string, buffer: ArrayBuffer | ArrayBufferView): TextEncoderEncodeIntoResult;1063get encoding(): string;1064}1065interface TextDecoderConstructorOptions {1066fatal: boolean;1067ignoreBOM: boolean;1068}1069interface TextDecoderDecodeOptions {1070stream: boolean;1071}1072interface TextEncoderEncodeIntoResult {1073read: number;1074written: number;1075}1076/**1077* Events providing information related to errors in scripts or in files.1078*1079* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)1080*/1081declare class ErrorEvent extends Event {1082constructor(type: string, init?: ErrorEventErrorEventInit);1083/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */1084get filename(): string;1085/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */1086get message(): string;1087/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */1088get lineno(): number;1089/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */1090get colno(): number;1091/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */1092get error(): any;1093}1094interface ErrorEventErrorEventInit {1095message?: string;1096filename?: string;1097lineno?: number;1098colno?: number;1099error?: any;1100}1101/**1102* A message received by a target object.1103*1104* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)1105*/1106declare class MessageEvent extends Event {1107constructor(type: string, initializer: MessageEventInit);1108/**1109* Returns the data of the message.1110*1111* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)1112*/1113readonly data: any;1114/**1115* Returns the origin of the message, for server-sent events and cross-document messaging.1116*1117* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)1118*/1119readonly origin: string | null;1120/**1121* Returns the last event ID string, for server-sent events.1122*1123* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)1124*/1125readonly lastEventId: string;1126/**1127* Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.1128*1129* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)1130*/1131readonly source: MessagePort | null;1132/**1133* Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.1134*1135* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)1136*/1137readonly ports: MessagePort[];1138}1139interface MessageEventInit {1140data: ArrayBuffer | string;1141}1142/**1143* Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".1144*1145* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)1146*/1147declare class FormData {1148constructor();1149/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */1150append(name: string, value: string): void;1151/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */1152append(name: string, value: Blob, filename?: string): void;1153/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */1154delete(name: string): void;1155/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */1156get(name: string): (File | string) | null;1157/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */1158getAll(name: string): (File | string)[];1159/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */1160has(name: string): boolean;1161/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */1162set(name: string, value: string): void;1163/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */1164set(name: string, value: Blob, filename?: string): void;1165/* Returns an array of key, value pairs for every entry in the list. */1166entries(): IterableIterator<[1167key: string,1168value: File | string1169]>;1170/* Returns a list of keys in the list. */1171keys(): IterableIterator<string>;1172/* Returns a list of values in the list. */1173values(): IterableIterator<(File | string)>;1174forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;1175[Symbol.iterator](): IterableIterator<[1176key: string,1177value: File | string1178]>;1179}1180interface ContentOptions {1181html?: boolean;1182}1183declare class HTMLRewriter {1184constructor();1185on(selector: string, handlers: HTMLRewriterElementContentHandlers): HTMLRewriter;1186onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;1187transform(response: Response): Response;1188}1189interface HTMLRewriterElementContentHandlers {1190element?(element: Element): void | Promise<void>;1191comments?(comment: Comment): void | Promise<void>;1192text?(element: Text): void | Promise<void>;1193}1194interface HTMLRewriterDocumentContentHandlers {1195doctype?(doctype: Doctype): void | Promise<void>;1196comments?(comment: Comment): void | Promise<void>;1197text?(text: Text): void | Promise<void>;1198end?(end: DocumentEnd): void | Promise<void>;1199}1200interface Doctype {1201readonly name: string | null;1202readonly publicId: string | null;1203readonly systemId: string | null;1204}1205interface Element {1206tagName: string;1207readonly attributes: IterableIterator<string[]>;1208readonly removed: boolean;1209readonly namespaceURI: string;1210getAttribute(name: string): string | null;1211hasAttribute(name: string): boolean;1212setAttribute(name: string, value: string): Element;1213removeAttribute(name: string): Element;1214before(content: string | ReadableStream | Response, options?: ContentOptions): Element;1215after(content: string | ReadableStream | Response, options?: ContentOptions): Element;1216prepend(content: string | ReadableStream | Response, options?: ContentOptions): Element;1217append(content: string | ReadableStream | Response, options?: ContentOptions): Element;1218replace(content: string | ReadableStream | Response, options?: ContentOptions): Element;1219remove(): Element;1220removeAndKeepContent(): Element;1221setInnerContent(content: string | ReadableStream | Response, options?: ContentOptions): Element;1222onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;1223}1224interface EndTag {1225name: string;1226before(content: string | ReadableStream | Response, options?: ContentOptions): EndTag;1227after(content: string | ReadableStream | Response, options?: ContentOptions): EndTag;1228remove(): EndTag;1229}1230interface Comment {1231text: string;1232readonly removed: boolean;1233before(content: string, options?: ContentOptions): Comment;1234after(content: string, options?: ContentOptions): Comment;1235replace(content: string, options?: ContentOptions): Comment;1236remove(): Comment;1237}1238interface Text {1239readonly text: string;1240readonly lastInTextNode: boolean;1241readonly removed: boolean;1242before(content: string | ReadableStream | Response, options?: ContentOptions): Text;1243after(content: string | ReadableStream | Response, options?: ContentOptions): Text;1244replace(content: string | ReadableStream | Response, options?: ContentOptions): Text;1245remove(): Text;1246}1247interface DocumentEnd {1248append(content: string, options?: ContentOptions): DocumentEnd;1249}1250/**1251* This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.1252*1253* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)1254*/1255declare abstract class FetchEvent extends ExtendableEvent {1256/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */1257readonly request: Request;1258/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */1259respondWith(promise: Response | Promise<Response>): void;1260passThroughOnException(): void;1261}1262type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;1263/**1264* This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.1265*1266* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)1267*/1268declare class Headers {1269constructor(init?: HeadersInit);1270/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */1271get(name: string): string | null;1272getAll(name: string): string[];1273/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */1274getSetCookie(): string[];1275/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */1276has(name: string): boolean;1277/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */1278set(name: string, value: string): void;1279/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */1280append(name: string, value: string): void;1281/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */1282delete(name: string): void;1283forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;1284/* Returns an iterator allowing to go through all key/value pairs contained in this object. */1285entries(): IterableIterator<[1286key: string,1287value: string1288]>;1289/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */1290keys(): IterableIterator<string>;1291/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */1292values(): IterableIterator<string>;1293[Symbol.iterator](): IterableIterator<[1294key: string,1295value: string1296]>;1297}1298type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData;1299declare abstract class Body {1300/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */1301get body(): ReadableStream | null;1302/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */1303get bodyUsed(): boolean;1304/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */1305arrayBuffer(): Promise<ArrayBuffer>;1306/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */1307bytes(): Promise<Uint8Array>;1308/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */1309text(): Promise<string>;1310/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */1311json<T>(): Promise<T>;1312/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */1313formData(): Promise<FormData>;1314/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */1315blob(): Promise<Blob>;1316}1317/**1318* This Fetch API interface represents the response to a request.1319*1320* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)1321*/1322declare var Response: {1323prototype: Response;1324new (body?: BodyInit | null, init?: ResponseInit): Response;1325error(): Response;1326redirect(url: string, status?: number): Response;1327json(any: any, maybeInit?: (ResponseInit | Response)): Response;1328};1329/**1330* This Fetch API interface represents the response to a request.1331*1332* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)1333*/1334interface Response extends Body {1335/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */1336clone(): Response;1337/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */1338status: number;1339/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */1340statusText: string;1341/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */1342headers: Headers;1343/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */1344ok: boolean;1345/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */1346redirected: boolean;1347/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */1348url: string;1349webSocket: WebSocket | null;1350cf: any | undefined;1351/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type) */1352type: "default" | "error";1353}1354interface ResponseInit {1355status?: number;1356statusText?: string;1357headers?: HeadersInit;1358cf?: any;1359webSocket?: (WebSocket | null);1360encodeBody?: "automatic" | "manual";1361}1362type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> = Request<CfHostMetadata, Cf> | string;1363/**1364* This Fetch API interface represents a resource request.1365*1366* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)1367*/1368declare var Request: {1369prototype: Request;1370new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(input: RequestInfo<CfProperties> | URL, init?: RequestInit<Cf>): Request<CfHostMetadata, Cf>;1371};1372/**1373* This Fetch API interface represents a resource request.1374*1375* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)1376*/1377interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {1378/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */1379clone(): Request<CfHostMetadata, Cf>;1380/**1381* Returns request's HTTP method, which is "GET" by default.1382*1383* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)1384*/1385method: string;1386/**1387* Returns the URL of request as a string.1388*1389* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)1390*/1391url: string;1392/**1393* Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.1394*1395* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)1396*/1397headers: Headers;1398/**1399* Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.1400*1401* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)1402*/1403redirect: string;1404fetcher: Fetcher | null;1405/**1406* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.1407*1408* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)1409*/1410signal: AbortSignal;1411cf: Cf | undefined;1412/**1413* Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]1414*1415* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)1416*/1417integrity: string;1418/**1419* Returns a boolean indicating whether or not request can outlive the global in which it was created.1420*1421* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)1422*/1423keepalive: boolean;1424/**1425* Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.1426*1427* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)1428*/1429cache?: "no-store" | "no-cache";1430}1431interface RequestInit<Cf = CfProperties> {1432/* A string to set request's method. */1433method?: string;1434/* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */1435headers?: HeadersInit;1436/* A BodyInit object or null to set request's body. */1437body?: BodyInit | null;1438/* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */1439redirect?: string;1440fetcher?: (Fetcher | null);1441cf?: Cf;1442/* A string indicating how the request will interact with the browser's cache to set request's cache. */1443cache?: "no-store" | "no-cache";1444/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */1445integrity?: string;1446/* An AbortSignal to set request's signal. */1447signal?: (AbortSignal | null);1448encodeResponseBody?: "automatic" | "manual";1449}1450type Service<T extends (new (...args: any[]) => Rpc.WorkerEntrypointBranded) | Rpc.WorkerEntrypointBranded | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? Fetcher<InstanceType<T>> : T extends Rpc.WorkerEntrypointBranded ? Fetcher<T> : T extends Exclude<Rpc.EntrypointBranded, Rpc.WorkerEntrypointBranded> ? never : Fetcher<undefined>;1451type Fetcher<T extends Rpc.EntrypointBranded | undefined = undefined, Reserved extends string = never> = (T extends Rpc.EntrypointBranded ? Rpc.Provider<T, Reserved | "fetch" | "connect"> : unknown) & {1452fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;1453connect(address: SocketAddress | string, options?: SocketOptions): Socket;1454};1455interface KVNamespaceListKey<Metadata, Key extends string = string> {1456name: Key;1457expiration?: number;1458metadata?: Metadata;1459}1460type KVNamespaceListResult<Metadata, Key extends string = string> = {1461list_complete: false;1462keys: KVNamespaceListKey<Metadata, Key>[];1463cursor: string;1464cacheStatus: string | null;1465} | {1466list_complete: true;1467keys: KVNamespaceListKey<Metadata, Key>[];1468cacheStatus: string | null;1469};1470interface KVNamespace<Key extends string = string> {1471get(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<string | null>;1472get(key: Key, type: "text"): Promise<string | null>;1473get<ExpectedValue = unknown>(key: Key, type: "json"): Promise<ExpectedValue | null>;1474get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;1475get(key: Key, type: "stream"): Promise<ReadableStream | null>;1476get(key: Key, options?: KVNamespaceGetOptions<"text">): Promise<string | null>;1477get<ExpectedValue = unknown>(key: Key, options?: KVNamespaceGetOptions<"json">): Promise<ExpectedValue | null>;1478get(key: Key, options?: KVNamespaceGetOptions<"arrayBuffer">): Promise<ArrayBuffer | null>;1479get(key: Key, options?: KVNamespaceGetOptions<"stream">): Promise<ReadableStream | null>;1480get(key: Array<Key>, type: "text"): Promise<Map<string, string | null>>;1481get<ExpectedValue = unknown>(key: Array<Key>, type: "json"): Promise<Map<string, ExpectedValue | null>>;1482get(key: Array<Key>, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<Map<string, string | null>>;1483get(key: Array<Key>, options?: KVNamespaceGetOptions<"text">): Promise<Map<string, string | null>>;1484get<ExpectedValue = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"json">): Promise<Map<string, ExpectedValue | null>>;1485list<Metadata = unknown>(options?: KVNamespaceListOptions): Promise<KVNamespaceListResult<Metadata, Key>>;1486put(key: Key, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: KVNamespacePutOptions): Promise<void>;1487getWithMetadata<Metadata = unknown>(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;1488getWithMetadata<Metadata = unknown>(key: Key, type: "text"): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;1489getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, type: "json"): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;1490getWithMetadata<Metadata = unknown>(key: Key, type: "arrayBuffer"): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;1491getWithMetadata<Metadata = unknown>(key: Key, type: "stream"): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;1492getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"text">): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;1493getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"json">): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;1494getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"arrayBuffer">): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;1495getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"stream">): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;1496getWithMetadata<Metadata = unknown>(key: Array<Key>, type: "text"): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;1497getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Array<Key>, type: "json"): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>;1498getWithMetadata<Metadata = unknown>(key: Array<Key>, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;1499getWithMetadata<Metadata = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"text">): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;1500getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"json">): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>;1501delete(key: Key): Promise<void>;1502}1503interface KVNamespaceListOptions {1504limit?: number;1505prefix?: (string | null);1506cursor?: (string | null);1507}1508interface KVNamespaceGetOptions<Type> {1509type: Type;1510cacheTtl?: number;1511}1512interface KVNamespacePutOptions {1513expiration?: number;1514expirationTtl?: number;1515metadata?: (any | null);1516}1517interface KVNamespaceGetWithMetadataResult<Value, Metadata> {1518value: Value | null;1519metadata: Metadata | null;1520cacheStatus: string | null;1521}1522type QueueContentType = "text" | "bytes" | "json" | "v8";1523interface Queue<Body = unknown> {1524send(message: Body, options?: QueueSendOptions): Promise<void>;1525sendBatch(messages: Iterable<MessageSendRequest<Body>>, options?: QueueSendBatchOptions): Promise<void>;1526}1527interface QueueSendOptions {1528contentType?: QueueContentType;1529delaySeconds?: number;1530}1531interface QueueSendBatchOptions {1532delaySeconds?: number;1533}1534interface MessageSendRequest<Body = unknown> {1535body: Body;1536contentType?: QueueContentType;1537delaySeconds?: number;1538}1539interface QueueRetryOptions {1540delaySeconds?: number;1541}1542interface Message<Body = unknown> {1543readonly id: string;1544readonly timestamp: Date;1545readonly body: Body;1546readonly attempts: number;1547retry(options?: QueueRetryOptions): void;1548ack(): void;1549}1550interface QueueEvent<Body = unknown> extends ExtendableEvent {1551readonly messages: readonly Message<Body>[];1552readonly queue: string;1553retryAll(options?: QueueRetryOptions): void;1554ackAll(): void;1555}1556interface MessageBatch<Body = unknown> {1557readonly messages: readonly Message<Body>[];1558readonly queue: string;1559retryAll(options?: QueueRetryOptions): void;1560ackAll(): void;1561}1562interface R2Error extends Error {1563readonly name: string;1564readonly code: number;1565readonly message: string;1566readonly action: string;1567readonly stack: any;1568}1569interface R2ListOptions {1570limit?: number;1571prefix?: string;1572cursor?: string;1573delimiter?: string;1574startAfter?: string;1575include?: ("httpMetadata" | "customMetadata")[];1576}1577declare abstract class R2Bucket {1578head(key: string): Promise<R2Object | null>;1579get(key: string, options: R2GetOptions & {1580onlyIf: R2Conditional | Headers;1581}): Promise<R2ObjectBody | R2Object | null>;1582get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;1583put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions & {1584onlyIf: R2Conditional | Headers;1585}): Promise<R2Object | null>;1586put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions): Promise<R2Object>;1587createMultipartUpload(key: string, options?: R2MultipartOptions): Promise<R2MultipartUpload>;1588resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;1589delete(keys: string | string[]): Promise<void>;1590list(options?: R2ListOptions): Promise<R2Objects>;1591}1592interface R2MultipartUpload {1593readonly key: string;1594readonly uploadId: string;1595uploadPart(partNumber: number, value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob, options?: R2UploadPartOptions): Promise<R2UploadedPart>;1596abort(): Promise<void>;1597complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;1598}1599interface R2UploadedPart {1600partNumber: number;1601etag: string;1602}1603declare abstract class R2Object {1604readonly key: string;1605readonly version: string;1606readonly size: number;1607readonly etag: string;1608readonly httpEtag: string;1609readonly checksums: R2Checksums;1610readonly uploaded: Date;1611readonly httpMetadata?: R2HTTPMetadata;1612readonly customMetadata?: Record<string, string>;1613readonly range?: R2Range;1614readonly storageClass: string;1615readonly ssecKeyMd5?: string;1616writeHttpMetadata(headers: Headers): void;1617}1618interface R2ObjectBody extends R2Object {1619get body(): ReadableStream;1620get bodyUsed(): boolean;1621arrayBuffer(): Promise<ArrayBuffer>;1622bytes(): Promise<Uint8Array>;1623text(): Promise<string>;1624json<T>(): Promise<T>;1625blob(): Promise<Blob>;1626}1627type R2Range = {1628offset: number;1629length?: number;1630} | {1631offset?: number;1632length: number;1633} | {1634suffix: number;1635};1636interface R2Conditional {1637etagMatches?: string;1638etagDoesNotMatch?: string;1639uploadedBefore?: Date;1640uploadedAfter?: Date;1641secondsGranularity?: boolean;1642}1643interface R2GetOptions {1644onlyIf?: (R2Conditional | Headers);1645range?: (R2Range | Headers);1646ssecKey?: (ArrayBuffer | string);1647}1648interface R2PutOptions {1649onlyIf?: (R2Conditional | Headers);1650httpMetadata?: (R2HTTPMetadata | Headers);1651customMetadata?: Record<string, string>;1652md5?: ((ArrayBuffer | ArrayBufferView) | string);1653sha1?: ((ArrayBuffer | ArrayBufferView) | string);1654sha256?: ((ArrayBuffer | ArrayBufferView) | string);1655sha384?: ((ArrayBuffer | ArrayBufferView) | string);1656sha512?: ((ArrayBuffer | ArrayBufferView) | string);1657storageClass?: string;1658ssecKey?: (ArrayBuffer | string);1659}1660interface R2MultipartOptions {1661httpMetadata?: (R2HTTPMetadata | Headers);1662customMetadata?: Record<string, string>;1663storageClass?: string;1664ssecKey?: (ArrayBuffer | string);1665}1666interface R2Checksums {1667readonly md5?: ArrayBuffer;1668readonly sha1?: ArrayBuffer;1669readonly sha256?: ArrayBuffer;1670readonly sha384?: ArrayBuffer;1671readonly sha512?: ArrayBuffer;1672toJSON(): R2StringChecksums;1673}1674interface R2StringChecksums {1675md5?: string;1676sha1?: string;1677sha256?: string;1678sha384?: string;1679sha512?: string;1680}1681interface R2HTTPMetadata {1682contentType?: string;1683contentLanguage?: string;1684contentDisposition?: string;1685contentEncoding?: string;1686cacheControl?: string;1687cacheExpiry?: Date;1688}1689type R2Objects = {1690objects: R2Object[];1691delimitedPrefixes: string[];1692} & ({1693truncated: true;1694cursor: string;1695} | {1696truncated: false;1697});1698interface R2UploadPartOptions {1699ssecKey?: (ArrayBuffer | string);1700}1701declare abstract class ScheduledEvent extends ExtendableEvent {1702readonly scheduledTime: number;1703readonly cron: string;1704noRetry(): void;1705}1706interface ScheduledController {1707readonly scheduledTime: number;1708readonly cron: string;1709noRetry(): void;1710}1711interface QueuingStrategy<T = any> {1712highWaterMark?: (number | bigint);1713size?: (chunk: T) => number | bigint;1714}1715interface UnderlyingSink<W = any> {1716type?: string;1717start?: (controller: WritableStreamDefaultController) => void | Promise<void>;1718write?: (chunk: W, controller: WritableStreamDefaultController) => void | Promise<void>;1719abort?: (reason: any) => void | Promise<void>;1720close?: () => void | Promise<void>;1721}1722interface UnderlyingByteSource {1723type: "bytes";1724autoAllocateChunkSize?: number;1725start?: (controller: ReadableByteStreamController) => void | Promise<void>;1726pull?: (controller: ReadableByteStreamController) => void | Promise<void>;1727cancel?: (reason: any) => void | Promise<void>;1728}1729interface UnderlyingSource<R = any> {1730type?: "" | undefined;1731start?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>;1732pull?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>;1733cancel?: (reason: any) => void | Promise<void>;1734expectedLength?: (number | bigint);1735}1736interface Transformer<I = any, O = any> {1737readableType?: string;1738writableType?: string;1739start?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>;1740transform?: (chunk: I, controller: TransformStreamDefaultController<O>) => void | Promise<void>;1741flush?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>;1742cancel?: (reason: any) => void | Promise<void>;1743expectedLength?: number;1744}1745interface StreamPipeOptions {1746/**1747* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.1748*1749* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.1750*1751* Errors and closures of the source and destination streams propagate as follows:1752*1753* An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.1754*1755* An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.1756*1757* When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.1758*1759* If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.1760*1761* The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.1762*/1763preventClose?: boolean;1764preventAbort?: boolean;1765preventCancel?: boolean;1766signal?: AbortSignal;1767}1768type ReadableStreamReadResult<R = any> = {1769done: false;1770value: R;1771} | {1772done: true;1773value?: undefined;1774};1775/**1776* This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.1777*1778* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)1779*/1780interface ReadableStream<R = any> {1781/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */1782get locked(): boolean;1783/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */1784cancel(reason?: any): Promise<void>;1785/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */1786getReader(): ReadableStreamDefaultReader<R>;1787/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */1788getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;1789/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */1790pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;1791/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */1792pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;1793/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */1794tee(): [1795ReadableStream<R>,1796ReadableStream<R>1797];1798values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;1799[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;1800}1801/**1802* This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.1803*1804* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)1805*/1806declare const ReadableStream: {1807prototype: ReadableStream;1808new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;1809new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;1810};1811/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */1812declare class ReadableStreamDefaultReader<R = any> {1813constructor(stream: ReadableStream);1814get closed(): Promise<void>;1815cancel(reason?: any): Promise<void>;1816/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */1817read(): Promise<ReadableStreamReadResult<R>>;1818/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */1819releaseLock(): void;1820}1821/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */1822declare class ReadableStreamBYOBReader {1823constructor(stream: ReadableStream);1824get closed(): Promise<void>;1825cancel(reason?: any): Promise<void>;1826/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */1827read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;1828/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */1829releaseLock(): void;1830readAtLeast<T extends ArrayBufferView>(minElements: number, view: T): Promise<ReadableStreamReadResult<T>>;1831}1832interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {1833min?: number;1834}1835interface ReadableStreamGetReaderOptions {1836/**1837* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.1838*1839* This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.1840*/1841mode: "byob";1842}1843/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */1844declare abstract class ReadableStreamBYOBRequest {1845/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */1846get view(): Uint8Array | null;1847/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */1848respond(bytesWritten: number): void;1849/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */1850respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;1851get atLeast(): number | null;1852}1853/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */1854declare abstract class ReadableStreamDefaultController<R = any> {1855/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */1856get desiredSize(): number | null;1857/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */1858close(): void;1859/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */1860enqueue(chunk?: R): void;1861/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */1862error(reason: any): void;1863}1864/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */1865declare abstract class ReadableByteStreamController {1866/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */1867get byobRequest(): ReadableStreamBYOBRequest | null;1868/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */1869get desiredSize(): number | null;1870/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */1871close(): void;1872/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */1873enqueue(chunk: ArrayBuffer | ArrayBufferView): void;1874/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */1875error(reason: any): void;1876}1877/**1878* This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.1879*1880* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)1881*/1882declare abstract class WritableStreamDefaultController {1883/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */1884get signal(): AbortSignal;1885/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */1886error(reason?: any): void;1887}1888/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */1889declare abstract class TransformStreamDefaultController<O = any> {1890/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */1891get desiredSize(): number | null;1892/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */1893enqueue(chunk?: O): void;1894/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */1895error(reason: any): void;1896/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */1897terminate(): void;1898}1899interface ReadableWritablePair<R = any, W = any> {1900/**1901* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.1902*1903* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.1904*/1905writable: WritableStream<W>;1906readable: ReadableStream<R>;1907}1908/**1909* This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.1910*1911* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)1912*/1913declare class WritableStream<W = any> {1914constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);1915/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */1916get locked(): boolean;1917/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */1918abort(reason?: any): Promise<void>;1919/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */1920close(): Promise<void>;1921/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */1922getWriter(): WritableStreamDefaultWriter<W>;1923}1924/**1925* This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink.1926*1927* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)1928*/1929declare class WritableStreamDefaultWriter<W = any> {1930constructor(stream: WritableStream);1931/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */1932get closed(): Promise<void>;1933/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */1934get ready(): Promise<void>;1935/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */1936get desiredSize(): number | null;1937/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */1938abort(reason?: any): Promise<void>;1939/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */1940close(): Promise<void>;1941/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */1942write(chunk?: W): Promise<void>;1943/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */1944releaseLock(): void;1945}1946/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */1947declare class TransformStream<I = any, O = any> {1948constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);1949/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */1950get readable(): ReadableStream<O>;1951/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */1952get writable(): WritableStream<I>;1953}1954declare class FixedLengthStream extends IdentityTransformStream {1955constructor(expectedLength: number | bigint, queuingStrategy?: IdentityTransformStreamQueuingStrategy);1956}1957declare class IdentityTransformStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {1958constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);1959}1960interface IdentityTransformStreamQueuingStrategy {1961highWaterMark?: (number | bigint);1962}1963interface ReadableStreamValuesOptions {1964preventCancel?: boolean;1965}1966/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */1967declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {1968constructor(format: "gzip" | "deflate" | "deflate-raw");1969}1970/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */1971declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {1972constructor(format: "gzip" | "deflate" | "deflate-raw");1973}1974/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */1975declare class TextEncoderStream extends TransformStream<string, Uint8Array> {1976constructor();1977get encoding(): string;1978}1979/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */1980declare class TextDecoderStream extends TransformStream<ArrayBuffer | ArrayBufferView, string> {1981constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);1982get encoding(): string;1983get fatal(): boolean;1984get ignoreBOM(): boolean;1985}1986interface TextDecoderStreamTextDecoderStreamInit {1987fatal?: boolean;1988ignoreBOM?: boolean;1989}1990/**1991* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.1992*1993* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)1994*/1995declare class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> {1996constructor(init: QueuingStrategyInit);1997/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */1998get highWaterMark(): number;1999/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */2000get size(): (chunk?: any) => number;2001}2002/**2003* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.2004*2005* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)2006*/2007declare class CountQueuingStrategy implements QueuingStrategy {2008constructor(init: QueuingStrategyInit);2009/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */2010get highWaterMark(): number;2011/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */2012get size(): (chunk?: any) => number;2013}2014interface QueuingStrategyInit {2015/**2016* Creates a new ByteLengthQueuingStrategy with the provided high water mark.2017*2018* Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.2019*/2020highWaterMark: number;2021}2022interface ScriptVersion {2023id?: string;2024tag?: string;2025message?: string;2026}2027declare abstract class TailEvent extends ExtendableEvent {2028readonly events: TraceItem[];2029readonly traces: TraceItem[];2030}2031interface TraceItem {2032readonly event: (TraceItemFetchEventInfo | TraceItemJsRpcEventInfo | TraceItemScheduledEventInfo | TraceItemAlarmEventInfo | TraceItemQueueEventInfo | TraceItemEmailEventInfo | TraceItemTailEventInfo | TraceItemCustomEventInfo | TraceItemHibernatableWebSocketEventInfo) | null;2033readonly eventTimestamp: number | null;2034readonly logs: TraceLog[];2035readonly exceptions: TraceException[];2036readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];2037readonly scriptName: string | null;2038readonly entrypoint?: string;2039readonly scriptVersion?: ScriptVersion;2040readonly dispatchNamespace?: string;2041readonly scriptTags?: string[];2042readonly durableObjectId?: string;2043readonly outcome: string;2044readonly executionModel: string;2045readonly truncated: boolean;2046readonly cpuTime: number;2047readonly wallTime: number;2048}2049interface TraceItemAlarmEventInfo {2050readonly scheduledTime: Date;2051}2052interface TraceItemCustomEventInfo {2053}2054interface TraceItemScheduledEventInfo {2055readonly scheduledTime: number;2056readonly cron: string;2057}2058interface TraceItemQueueEventInfo {2059readonly queue: string;2060readonly batchSize: number;2061}2062interface TraceItemEmailEventInfo {2063readonly mailFrom: string;2064readonly rcptTo: string;2065readonly rawSize: number;2066}2067interface TraceItemTailEventInfo {2068readonly consumedEvents: TraceItemTailEventInfoTailItem[];2069}2070interface TraceItemTailEventInfoTailItem {2071readonly scriptName: string | null;2072}2073interface TraceItemFetchEventInfo {2074readonly response?: TraceItemFetchEventInfoResponse;2075readonly request: TraceItemFetchEventInfoRequest;2076}2077interface TraceItemFetchEventInfoRequest {2078readonly cf?: any;2079readonly headers: Record<string, string>;2080readonly method: string;2081readonly url: string;2082getUnredacted(): TraceItemFetchEventInfoRequest;2083}2084interface TraceItemFetchEventInfoResponse {2085readonly status: number;2086}2087interface TraceItemJsRpcEventInfo {2088readonly rpcMethod: string;2089}2090interface TraceItemHibernatableWebSocketEventInfo {2091readonly getWebSocketEvent: TraceItemHibernatableWebSocketEventInfoMessage | TraceItemHibernatableWebSocketEventInfoClose | TraceItemHibernatableWebSocketEventInfoError;2092}2093interface TraceItemHibernatableWebSocketEventInfoMessage {2094readonly webSocketEventType: string;2095}2096interface TraceItemHibernatableWebSocketEventInfoClose {2097readonly webSocketEventType: string;2098readonly code: number;2099readonly wasClean: boolean;2100}2101interface TraceItemHibernatableWebSocketEventInfoError {2102readonly webSocketEventType: string;2103}2104interface TraceLog {2105readonly timestamp: number;2106readonly level: string;2107readonly message: any;2108}2109interface TraceException {2110readonly timestamp: number;2111readonly message: string;2112readonly name: string;2113readonly stack?: string;2114}2115interface TraceDiagnosticChannelEvent {2116readonly timestamp: number;2117readonly channel: string;2118readonly message: any;2119}2120interface TraceMetrics {2121readonly cpuTime: number;2122readonly wallTime: number;2123}2124interface UnsafeTraceMetrics {2125fromTrace(item: TraceItem): TraceMetrics;2126}2127/**2128* The URL interface represents an object providing static methods used for creating object URLs.2129*2130* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)2131*/2132declare class URL {2133constructor(url: string | URL, base?: string | URL);2134/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */2135get origin(): string;2136/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */2137get href(): string;2138/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */2139set href(value: string);2140/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */2141get protocol(): string;2142/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */2143set protocol(value: string);2144/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */2145get username(): string;2146/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */2147set username(value: string);2148/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */2149get password(): string;2150/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */2151set password(value: string);2152/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */2153get host(): string;2154/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */2155set host(value: string);2156/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */2157get hostname(): string;2158/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */2159set hostname(value: string);2160/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */2161get port(): string;2162/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */2163set port(value: string);2164/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */2165get pathname(): string;2166/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */2167set pathname(value: string);2168/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */2169get search(): string;2170/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */2171set search(value: string);2172/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */2173get hash(): string;2174/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */2175set hash(value: string);2176/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */2177get searchParams(): URLSearchParams;2178/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */2179toJSON(): string;2180/*function toString() { [native code] }*/2181toString(): string;2182/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */2183static canParse(url: string, base?: string): boolean;2184/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */2185static parse(url: string, base?: string): URL | null;2186/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */2187static createObjectURL(object: File | Blob): string;2188/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */2189static revokeObjectURL(object_url: string): void;2190}2191/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */2192declare class URLSearchParams {2193constructor(init?: (Iterable<Iterable<string>> | Record<string, string> | string));2194/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */2195get size(): number;2196/**2197* Appends a specified key/value pair as a new search parameter.2198*2199* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)2200*/2201append(name: string, value: string): void;2202/**2203* Deletes the given search parameter, and its associated value, from the list of all search parameters.2204*2205* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)2206*/2207delete(name: string, value?: string): void;2208/**2209* Returns the first value associated to the given search parameter.2210*2211* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)2212*/2213get(name: string): string | null;2214/**2215* Returns all the values association with a given search parameter.2216*2217* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)2218*/2219getAll(name: string): string[];2220/**2221* Returns a Boolean indicating if such a search parameter exists.2222*2223* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)2224*/2225has(name: string, value?: string): boolean;2226/**2227* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.2228*2229* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)2230*/2231set(name: string, value: string): void;2232/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */2233sort(): void;2234/* Returns an array of key, value pairs for every entry in the search params. */2235entries(): IterableIterator<[2236key: string,2237value: string2238]>;2239/* Returns a list of keys in the search params. */2240keys(): IterableIterator<string>;2241/* Returns a list of values in the search params. */2242values(): IterableIterator<string>;2243forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;2244/*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */2245toString(): string;2246[Symbol.iterator](): IterableIterator<[2247key: string,2248value: string2249]>;2250}2251declare class URLPattern {2252constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);2253get protocol(): string;2254get username(): string;2255get password(): string;2256get hostname(): string;2257get port(): string;2258get pathname(): string;2259get search(): string;2260get hash(): string;2261get hasRegExpGroups(): boolean;2262test(input?: (string | URLPatternInit), baseURL?: string): boolean;2263exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;2264}2265interface URLPatternInit {2266protocol?: string;2267username?: string;2268password?: string;2269hostname?: string;2270port?: string;2271pathname?: string;2272search?: string;2273hash?: string;2274baseURL?: string;2275}2276interface URLPatternComponentResult {2277input: string;2278groups: Record<string, string>;2279}2280interface URLPatternResult {2281inputs: (string | URLPatternInit)[];2282protocol: URLPatternComponentResult;2283username: URLPatternComponentResult;2284password: URLPatternComponentResult;2285hostname: URLPatternComponentResult;2286port: URLPatternComponentResult;2287pathname: URLPatternComponentResult;2288search: URLPatternComponentResult;2289hash: URLPatternComponentResult;2290}2291interface URLPatternOptions {2292ignoreCase?: boolean;2293}2294/**2295* A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.2296*2297* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)2298*/2299declare class CloseEvent extends Event {2300constructor(type: string, initializer?: CloseEventInit);2301/**2302* Returns the WebSocket connection close code provided by the server.2303*2304* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)2305*/2306readonly code: number;2307/**2308* Returns the WebSocket connection close reason provided by the server.2309*2310* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)2311*/2312readonly reason: string;2313/**2314* Returns true if the connection closed cleanly; false otherwise.2315*2316* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)2317*/2318readonly wasClean: boolean;2319}2320interface CloseEventInit {2321code?: number;2322reason?: string;2323wasClean?: boolean;2324}2325type WebSocketEventMap = {2326close: CloseEvent;2327message: MessageEvent;2328open: Event;2329error: ErrorEvent;2330};2331/**2332* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.2333*2334* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)2335*/2336declare var WebSocket: {2337prototype: WebSocket;2338new (url: string, protocols?: (string[] | string)): WebSocket;2339readonly READY_STATE_CONNECTING: number;2340readonly CONNECTING: number;2341readonly READY_STATE_OPEN: number;2342readonly OPEN: number;2343readonly READY_STATE_CLOSING: number;2344readonly CLOSING: number;2345readonly READY_STATE_CLOSED: number;2346readonly CLOSED: number;2347};2348/**2349* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.2350*2351* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)2352*/2353interface WebSocket extends EventTarget<WebSocketEventMap> {2354accept(): void;2355/**2356* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.2357*2358* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)2359*/2360send(message: (ArrayBuffer | ArrayBufferView) | string): void;2361/**2362* Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.2363*2364* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)2365*/2366close(code?: number, reason?: string): void;2367serializeAttachment(attachment: any): void;2368deserializeAttachment(): any | null;2369/**2370* Returns the state of the WebSocket object's connection. It can have the values described below.2371*2372* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)2373*/2374readyState: number;2375/**2376* Returns the URL that was used to establish the WebSocket connection.2377*2378* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)2379*/2380url: string | null;2381/**2382* Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.2383*2384* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)2385*/2386protocol: string | null;2387/**2388* Returns the extensions selected by the server, if any.2389*2390* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)2391*/2392extensions: string | null;2393}2394declare const WebSocketPair: {2395new (): {23960: WebSocket;23971: WebSocket;2398};2399};2400interface SqlStorage {2401exec<T extends Record<string, SqlStorageValue>>(query: string, ...bindings: any[]): SqlStorageCursor<T>;2402get databaseSize(): number;2403Cursor: typeof SqlStorageCursor;2404Statement: typeof SqlStorageStatement;2405}2406declare abstract class SqlStorageStatement {2407}2408type SqlStorageValue = ArrayBuffer | string | number | null;2409declare abstract class SqlStorageCursor<T extends Record<string, SqlStorageValue>> {2410next(): {2411done?: false;2412value: T;2413} | {2414done: true;2415value?: never;2416};2417toArray(): T[];2418one(): T;2419raw<U extends SqlStorageValue[]>(): IterableIterator<U>;2420columnNames: string[];2421get rowsRead(): number;2422get rowsWritten(): number;2423[Symbol.iterator](): IterableIterator<T>;2424}2425interface Socket {2426get readable(): ReadableStream;2427get writable(): WritableStream;2428get closed(): Promise<void>;2429get opened(): Promise<SocketInfo>;2430get upgraded(): boolean;2431get secureTransport(): "on" | "off" | "starttls";2432close(): Promise<void>;2433startTls(options?: TlsOptions): Socket;2434}2435interface SocketOptions {2436secureTransport?: string;2437allowHalfOpen: boolean;2438highWaterMark?: (number | bigint);2439}2440interface SocketAddress {2441hostname: string;2442port: number;2443}2444interface TlsOptions {2445expectedServerHostname?: string;2446}2447interface SocketInfo {2448remoteAddress?: string;2449localAddress?: string;2450}2451/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */2452declare class EventSource extends EventTarget {2453constructor(url: string, init?: EventSourceEventSourceInit);2454/**2455* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.2456*2457* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)2458*/2459close(): void;2460/**2461* Returns the URL providing the event stream.2462*2463* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)2464*/2465get url(): string;2466/**2467* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.2468*2469* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)2470*/2471get withCredentials(): boolean;2472/**2473* Returns the state of this EventSource object's connection. It can have the values described below.2474*2475* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)2476*/2477get readyState(): number;2478/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */2479get onopen(): any | null;2480/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */2481set onopen(value: any | null);2482/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */2483get onmessage(): any | null;2484/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */2485set onmessage(value: any | null);2486/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */2487get onerror(): any | null;2488/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */2489set onerror(value: any | null);2490static readonly CONNECTING: number;2491static readonly OPEN: number;2492static readonly CLOSED: number;2493static from(stream: ReadableStream): EventSource;2494}2495interface EventSourceEventSourceInit {2496withCredentials?: boolean;2497fetcher?: Fetcher;2498}2499interface Container {2500get running(): boolean;2501start(options?: ContainerStartupOptions): void;2502monitor(): Promise<void>;2503destroy(error?: any): Promise<void>;2504signal(signo: number): void;2505getTcpPort(port: number): Fetcher;2506}2507interface ContainerStartupOptions {2508entrypoint?: string[];2509enableInternet: boolean;2510env?: Record<string, string>;2511}2512/**2513* This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.2514*2515* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort)2516*/2517declare abstract class MessagePort extends EventTarget {2518/**2519* Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.2520*2521* Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.2522*2523* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)2524*/2525postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;2526/**2527* Disconnects the port, so that it is no longer active.2528*2529* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)2530*/2531close(): void;2532/**2533* Begins dispatching messages received on the port.2534*2535* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)2536*/2537start(): void;2538get onmessage(): any | null;2539set onmessage(value: any | null);2540}2541/**2542* This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties.2543*2544* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel)2545*/2546declare class MessageChannel {2547constructor();2548/**2549* Returns the first MessagePort object.2550*2551* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)2552*/2553readonly port1: MessagePort;2554/**2555* Returns the second MessagePort object.2556*2557* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)2558*/2559readonly port2: MessagePort;2560}2561interface MessagePortPostMessageOptions {2562transfer?: any[];2563}2564type LoopbackForExport<T extends (new (...args: any[]) => Rpc.EntrypointBranded) | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? LoopbackServiceStub<InstanceType<T>> : T extends new (...args: any[]) => Rpc.DurableObjectBranded ? LoopbackDurableObjectClass<InstanceType<T>> : T extends ExportedHandler<any, any, any> ? LoopbackServiceStub<undefined> : undefined;2565type LoopbackServiceStub<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = Fetcher<T> & (T extends CloudflareWorkersModule.WorkerEntrypoint<any, infer Props> ? (opts: {2566props?: Props;2567}) => Fetcher<T> : (opts: {2568props?: any;2569}) => Fetcher<T>);2570type LoopbackDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined = undefined> = DurableObjectClass<T> & (T extends CloudflareWorkersModule.DurableObject<any, infer Props> ? (opts: {2571props?: Props;2572}) => DurableObjectClass<T> : (opts: {2573props?: any;2574}) => DurableObjectClass<T>);2575interface SyncKvStorage {2576get<T = unknown>(key: string): T | undefined;2577list<T = unknown>(options?: SyncKvListOptions): Iterable<[2578string,2579T2580]>;2581put<T>(key: string, value: T): void;2582delete(key: string): boolean;2583}2584interface SyncKvListOptions {2585start?: string;2586startAfter?: string;2587end?: string;2588prefix?: string;2589reverse?: boolean;2590limit?: number;2591}2592interface WorkerStub {2593getEntrypoint<T extends Rpc.WorkerEntrypointBranded | undefined>(name?: string, options?: WorkerStubEntrypointOptions): Fetcher<T>;2594}2595interface WorkerStubEntrypointOptions {2596props?: any;2597}2598interface WorkerLoader {2599get(name: string, getCode: () => WorkerLoaderWorkerCode | Promise<WorkerLoaderWorkerCode>): WorkerStub;2600}2601interface WorkerLoaderModule {2602js?: string;2603cjs?: string;2604text?: string;2605data?: ArrayBuffer;2606json?: any;2607py?: string;2608}2609interface WorkerLoaderWorkerCode {2610compatibilityDate: string;2611compatibilityFlags?: string[];2612allowExperimental?: boolean;2613mainModule: string;2614modules: Record<string, WorkerLoaderModule | string>;2615env?: any;2616globalOutbound?: (Fetcher | null);2617tails?: Fetcher[];2618streamingTails?: Fetcher[];2619}2620/**2621* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,2622* as well as timing of subrequests and other operations.2623*2624* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)2625*/2626declare abstract class Performance {2627/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */2628get timeOrigin(): number;2629/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */2630now(): number;2631}2632type AiImageClassificationInput = {2633image: number[];2634};2635type AiImageClassificationOutput = {2636score?: number;2637label?: string;2638}[];2639declare abstract class BaseAiImageClassification {2640inputs: AiImageClassificationInput;2641postProcessedOutputs: AiImageClassificationOutput;2642}2643type AiImageToTextInput = {2644image: number[];2645prompt?: string;2646max_tokens?: number;2647temperature?: number;2648top_p?: number;2649top_k?: number;2650seed?: number;2651repetition_penalty?: number;2652frequency_penalty?: number;2653presence_penalty?: number;2654raw?: boolean;2655messages?: RoleScopedChatInput[];2656};2657type AiImageToTextOutput = {2658description: string;2659};2660declare abstract class BaseAiImageToText {2661inputs: AiImageToTextInput;2662postProcessedOutputs: AiImageToTextOutput;2663}2664type AiImageTextToTextInput = {2665image: string;2666prompt?: string;2667max_tokens?: number;2668temperature?: number;2669ignore_eos?: boolean;2670top_p?: number;2671top_k?: number;2672seed?: number;2673repetition_penalty?: number;2674frequency_penalty?: number;2675presence_penalty?: number;2676raw?: boolean;2677messages?: RoleScopedChatInput[];2678};2679type AiImageTextToTextOutput = {2680description: string;2681};2682declare abstract class BaseAiImageTextToText {2683inputs: AiImageTextToTextInput;2684postProcessedOutputs: AiImageTextToTextOutput;2685}2686type AiMultimodalEmbeddingsInput = {2687image: string;2688text: string[];2689};2690type AiIMultimodalEmbeddingsOutput = {2691data: number[][];2692shape: number[];2693};2694declare abstract class BaseAiMultimodalEmbeddings {2695inputs: AiImageTextToTextInput;2696postProcessedOutputs: AiImageTextToTextOutput;2697}2698type AiObjectDetectionInput = {2699image: number[];2700};2701type AiObjectDetectionOutput = {2702score?: number;2703label?: string;2704}[];2705declare abstract class BaseAiObjectDetection {2706inputs: AiObjectDetectionInput;2707postProcessedOutputs: AiObjectDetectionOutput;2708}2709type AiSentenceSimilarityInput = {2710source: string;2711sentences: string[];2712};2713type AiSentenceSimilarityOutput = number[];2714declare abstract class BaseAiSentenceSimilarity {2715inputs: AiSentenceSimilarityInput;2716postProcessedOutputs: AiSentenceSimilarityOutput;2717}2718type AiAutomaticSpeechRecognitionInput = {2719audio: number[];2720};2721type AiAutomaticSpeechRecognitionOutput = {2722text?: string;2723words?: {2724word: string;2725start: number;2726end: number;2727}[];2728vtt?: string;2729};2730declare abstract class BaseAiAutomaticSpeechRecognition {2731inputs: AiAutomaticSpeechRecognitionInput;2732postProcessedOutputs: AiAutomaticSpeechRecognitionOutput;2733}2734type AiSummarizationInput = {2735input_text: string;2736max_length?: number;2737};2738type AiSummarizationOutput = {2739summary: string;2740};2741declare abstract class BaseAiSummarization {2742inputs: AiSummarizationInput;2743postProcessedOutputs: AiSummarizationOutput;2744}2745type AiTextClassificationInput = {2746text: string;2747};2748type AiTextClassificationOutput = {2749score?: number;2750label?: string;2751}[];2752declare abstract class BaseAiTextClassification {2753inputs: AiTextClassificationInput;2754postProcessedOutputs: AiTextClassificationOutput;2755}2756type AiTextEmbeddingsInput = {2757text: string | string[];2758};2759type AiTextEmbeddingsOutput = {2760shape: number[];2761data: number[][];2762};2763declare abstract class BaseAiTextEmbeddings {2764inputs: AiTextEmbeddingsInput;2765postProcessedOutputs: AiTextEmbeddingsOutput;2766}2767type RoleScopedChatInput = {2768role: "user" | "assistant" | "system" | "tool" | (string & NonNullable<unknown>);2769content: string;2770name?: string;2771};2772type AiTextGenerationToolLegacyInput = {2773name: string;2774description: string;2775parameters?: {2776type: "object" | (string & NonNullable<unknown>);2777properties: {2778[key: string]: {2779type: string;2780description?: string;2781};2782};2783required: string[];2784};2785};2786type AiTextGenerationToolInput = {2787type: "function" | (string & NonNullable<unknown>);2788function: {2789name: string;2790description: string;2791parameters?: {2792type: "object" | (string & NonNullable<unknown>);2793properties: {2794[key: string]: {2795type: string;2796description?: string;2797};2798};2799required: string[];2800};2801};2802};2803type AiTextGenerationFunctionsInput = {2804name: string;2805code: string;2806};2807type AiTextGenerationResponseFormat = {2808type: string;2809json_schema?: any;2810};2811type AiTextGenerationInput = {2812prompt?: string;2813raw?: boolean;2814stream?: boolean;2815max_tokens?: number;2816temperature?: number;2817top_p?: number;2818top_k?: number;2819seed?: number;2820repetition_penalty?: number;2821frequency_penalty?: number;2822presence_penalty?: number;2823messages?: RoleScopedChatInput[];2824response_format?: AiTextGenerationResponseFormat;2825tools?: AiTextGenerationToolInput[] | AiTextGenerationToolLegacyInput[] | (object & NonNullable<unknown>);2826functions?: AiTextGenerationFunctionsInput[];2827};2828type AiTextGenerationToolLegacyOutput = {2829name: string;2830arguments: unknown;2831};2832type AiTextGenerationToolOutput = {2833id: string;2834type: "function";2835function: {2836name: string;2837arguments: string;2838};2839};2840type UsageTags = {2841prompt_tokens: number;2842completion_tokens: number;2843total_tokens: number;2844};2845type AiTextGenerationOutput = {2846response?: string;2847tool_calls?: AiTextGenerationToolLegacyOutput[] & AiTextGenerationToolOutput[];2848usage?: UsageTags;2849};2850declare abstract class BaseAiTextGeneration {2851inputs: AiTextGenerationInput;2852postProcessedOutputs: AiTextGenerationOutput;2853}2854type AiTextToSpeechInput = {2855prompt: string;2856lang?: string;2857};2858type AiTextToSpeechOutput = Uint8Array | {2859audio: string;2860};2861declare abstract class BaseAiTextToSpeech {2862inputs: AiTextToSpeechInput;2863postProcessedOutputs: AiTextToSpeechOutput;2864}2865type AiTextToImageInput = {2866prompt: string;2867negative_prompt?: string;2868height?: number;2869width?: number;2870image?: number[];2871image_b64?: string;2872mask?: number[];2873num_steps?: number;2874strength?: number;2875guidance?: number;2876seed?: number;2877};2878type AiTextToImageOutput = ReadableStream<Uint8Array>;2879declare abstract class BaseAiTextToImage {2880inputs: AiTextToImageInput;2881postProcessedOutputs: AiTextToImageOutput;2882}2883type AiTranslationInput = {2884text: string;2885target_lang: string;2886source_lang?: string;2887};2888type AiTranslationOutput = {2889translated_text?: string;2890};2891declare abstract class BaseAiTranslation {2892inputs: AiTranslationInput;2893postProcessedOutputs: AiTranslationOutput;2894}2895type Ai_Cf_Baai_Bge_Base_En_V1_5_Input = {2896text: string | string[];2897/**2898* The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.2899*/2900pooling?: "mean" | "cls";2901} | {2902/**2903* Batch of the embeddings requests to run using async-queue2904*/2905requests: {2906text: string | string[];2907/**2908* The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.2909*/2910pooling?: "mean" | "cls";2911}[];2912};2913type Ai_Cf_Baai_Bge_Base_En_V1_5_Output = {2914shape?: number[];2915/**2916* Embeddings of the requested text values2917*/2918data?: number[][];2919/**2920* The pooling method used in the embedding process.2921*/2922pooling?: "mean" | "cls";2923} | AsyncResponse;2924interface AsyncResponse {2925/**2926* The async request id that can be used to obtain the results.2927*/2928request_id?: string;2929}2930declare abstract class Base_Ai_Cf_Baai_Bge_Base_En_V1_5 {2931inputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Input;2932postProcessedOutputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Output;2933}2934type Ai_Cf_Openai_Whisper_Input = string | {2935/**2936* An array of integers that represent the audio data constrained to 8-bit unsigned integer values2937*/2938audio: number[];2939};2940interface Ai_Cf_Openai_Whisper_Output {2941/**2942* The transcription2943*/2944text: string;2945word_count?: number;2946words?: {2947word?: string;2948/**2949* The second this word begins in the recording2950*/2951start?: number;2952/**2953* The ending second when the word completes2954*/2955end?: number;2956}[];2957vtt?: string;2958}2959declare abstract class Base_Ai_Cf_Openai_Whisper {2960inputs: Ai_Cf_Openai_Whisper_Input;2961postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;2962}2963type Ai_Cf_Meta_M2M100_1_2B_Input = {2964/**2965* The text to be translated2966*/2967text: string;2968/**2969* The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified2970*/2971source_lang?: string;2972/**2973* The language code to translate the text into (e.g., 'es' for Spanish)2974*/2975target_lang: string;2976} | {2977/**2978* Batch of the embeddings requests to run using async-queue2979*/2980requests: {2981/**2982* The text to be translated2983*/2984text: string;2985/**2986* The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified2987*/2988source_lang?: string;2989/**2990* The language code to translate the text into (e.g., 'es' for Spanish)2991*/2992target_lang: string;2993}[];2994};2995type Ai_Cf_Meta_M2M100_1_2B_Output = {2996/**2997* The translated text in the target language2998*/2999translated_text?: string;3000} | AsyncResponse;3001declare abstract class Base_Ai_Cf_Meta_M2M100_1_2B {3002inputs: Ai_Cf_Meta_M2M100_1_2B_Input;3003postProcessedOutputs: Ai_Cf_Meta_M2M100_1_2B_Output;3004}3005type Ai_Cf_Baai_Bge_Small_En_V1_5_Input = {3006text: string | string[];3007/**3008* The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.3009*/3010pooling?: "mean" | "cls";3011} | {3012/**3013* Batch of the embeddings requests to run using async-queue3014*/3015requests: {3016text: string | string[];3017/**3018* The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.3019*/3020pooling?: "mean" | "cls";3021}[];3022};3023type Ai_Cf_Baai_Bge_Small_En_V1_5_Output = {3024shape?: number[];3025/**3026* Embeddings of the requested text values3027*/3028data?: number[][];3029/**3030* The pooling method used in the embedding process.3031*/3032pooling?: "mean" | "cls";3033} | AsyncResponse;3034declare abstract class Base_Ai_Cf_Baai_Bge_Small_En_V1_5 {3035inputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Input;3036postProcessedOutputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Output;3037}3038type Ai_Cf_Baai_Bge_Large_En_V1_5_Input = {3039text: string | string[];3040/**3041* The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.3042*/3043pooling?: "mean" | "cls";3044} | {3045/**3046* Batch of the embeddings requests to run using async-queue3047*/3048requests: {3049text: string | string[];3050/**3051* The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.3052*/3053pooling?: "mean" | "cls";3054}[];3055};3056type Ai_Cf_Baai_Bge_Large_En_V1_5_Output = {3057shape?: number[];3058/**3059* Embeddings of the requested text values3060*/3061data?: number[][];3062/**3063* The pooling method used in the embedding process.3064*/3065pooling?: "mean" | "cls";3066} | AsyncResponse;3067declare abstract class Base_Ai_Cf_Baai_Bge_Large_En_V1_5 {3068inputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Input;3069postProcessedOutputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Output;3070}3071type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input = string | {3072/**3073* The input text prompt for the model to generate a response.3074*/3075prompt?: string;3076/**3077* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.3078*/3079raw?: boolean;3080/**3081* Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.3082*/3083top_p?: number;3084/**3085* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.3086*/3087top_k?: number;3088/**3089* Random seed for reproducibility of the generation.3090*/3091seed?: number;3092/**3093* Penalty for repeated tokens; higher values discourage repetition.3094*/3095repetition_penalty?: number;3096/**3097* Decreases the likelihood of the model repeating the same lines verbatim.3098*/3099frequency_penalty?: number;3100/**3101* Increases the likelihood of the model introducing new topics.3102*/3103presence_penalty?: number;3104image: number[] | (string & NonNullable<unknown>);3105/**3106* The maximum number of tokens to generate in the response.3107*/3108max_tokens?: number;3109};3110interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {3111description?: string;3112}3113declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {3114inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input;3115postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output;3116}3117type Ai_Cf_Openai_Whisper_Tiny_En_Input = string | {3118/**3119* An array of integers that represent the audio data constrained to 8-bit unsigned integer values3120*/3121audio: number[];3122};3123interface Ai_Cf_Openai_Whisper_Tiny_En_Output {3124/**3125* The transcription3126*/3127text: string;3128word_count?: number;3129words?: {3130word?: string;3131/**3132* The second this word begins in the recording3133*/3134start?: number;3135/**3136* The ending second when the word completes3137*/3138end?: number;3139}[];3140vtt?: string;3141}3142declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {3143inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input;3144postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;3145}3146interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {3147/**3148* Base64 encoded value of the audio data.3149*/3150audio: string;3151/**3152* Supported tasks are 'translate' or 'transcribe'.3153*/3154task?: string;3155/**3156* The language of the audio being transcribed or translated.3157*/3158language?: string;3159/**3160* Preprocess the audio with a voice activity detection model.3161*/3162vad_filter?: boolean;3163/**3164* A text prompt to help provide context to the model on the contents of the audio.3165*/3166initial_prompt?: string;3167/**3168* The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.3169*/3170prefix?: string;3171}3172interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {3173transcription_info?: {3174/**3175* The language of the audio being transcribed or translated.3176*/3177language?: string;3178/**3179* The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1.3180*/3181language_probability?: number;3182/**3183* The total duration of the original audio file, in seconds.3184*/3185duration?: number;3186/**3187* The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds.3188*/3189duration_after_vad?: number;3190};3191/**3192* The complete transcription of the audio.3193*/3194text: string;3195/**3196* The total number of words in the transcription.3197*/3198word_count?: number;3199segments?: {3200/**3201* The starting time of the segment within the audio, in seconds.3202*/3203start?: number;3204/**3205* The ending time of the segment within the audio, in seconds.3206*/3207end?: number;3208/**3209* The transcription of the segment.3210*/3211text?: string;3212/**3213* The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs.3214*/3215temperature?: number;3216/**3217* The average log probability of the predictions for the words in this segment, indicating overall confidence.3218*/3219avg_logprob?: number;3220/**3221* The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process.3222*/3223compression_ratio?: number;3224/**3225* The probability that the segment contains no speech, represented as a decimal between 0 and 1.3226*/3227no_speech_prob?: number;3228words?: {3229/**3230* The individual word transcribed from the audio.3231*/3232word?: string;3233/**3234* The starting time of the word within the audio, in seconds.3235*/3236start?: number;3237/**3238* The ending time of the word within the audio, in seconds.3239*/3240end?: number;3241}[];3242}[];3243/**3244* The transcription in WebVTT format, which includes timing and text information for use in subtitles.3245*/3246vtt?: string;3247}3248declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {3249inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;3250postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;3251}3252type Ai_Cf_Baai_Bge_M3_Input = BGEM3InputQueryAndContexts | BGEM3InputEmbedding | {3253/**3254* Batch of the embeddings requests to run using async-queue3255*/3256requests: (BGEM3InputQueryAndContexts1 | BGEM3InputEmbedding1)[];3257};3258interface BGEM3InputQueryAndContexts {3259/**3260* A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts3261*/3262query?: string;3263/**3264* List of provided contexts. Note that the index in this array is important, as the response will refer to it.3265*/3266contexts: {3267/**3268* One of the provided context content3269*/3270text?: string;3271}[];3272/**3273* When provided with too long context should the model error out or truncate the context to fit?3274*/3275truncate_inputs?: boolean;3276}3277interface BGEM3InputEmbedding {3278text: string | string[];3279/**3280* When provided with too long context should the model error out or truncate the context to fit?3281*/3282truncate_inputs?: boolean;3283}3284interface BGEM3InputQueryAndContexts1 {3285/**3286* A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts3287*/3288query?: string;3289/**3290* List of provided contexts. Note that the index in this array is important, as the response will refer to it.3291*/3292contexts: {3293/**3294* One of the provided context content3295*/3296text?: string;3297}[];3298/**3299* When provided with too long context should the model error out or truncate the context to fit?3300*/3301truncate_inputs?: boolean;3302}3303interface BGEM3InputEmbedding1 {3304text: string | string[];3305/**3306* When provided with too long context should the model error out or truncate the context to fit?3307*/3308truncate_inputs?: boolean;3309}3310type Ai_Cf_Baai_Bge_M3_Output = BGEM3OuputQuery | BGEM3OutputEmbeddingForContexts | BGEM3OuputEmbedding | AsyncResponse;3311interface BGEM3OuputQuery {3312response?: {3313/**3314* Index of the context in the request3315*/3316id?: number;3317/**3318* Score of the context under the index.3319*/3320score?: number;3321}[];3322}3323interface BGEM3OutputEmbeddingForContexts {3324response?: number[][];3325shape?: number[];3326/**3327* The pooling method used in the embedding process.3328*/3329pooling?: "mean" | "cls";3330}3331interface BGEM3OuputEmbedding {3332shape?: number[];3333/**3334* Embeddings of the requested text values3335*/3336data?: number[][];3337/**3338* The pooling method used in the embedding process.3339*/3340pooling?: "mean" | "cls";3341}3342declare abstract class Base_Ai_Cf_Baai_Bge_M3 {3343inputs: Ai_Cf_Baai_Bge_M3_Input;3344postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output;3345}3346interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {3347/**3348* A text description of the image you want to generate.3349*/3350prompt: string;3351/**3352* The number of diffusion steps; higher values can improve quality but take longer.3353*/3354steps?: number;3355}3356interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output {3357/**3358* The generated image in Base64 format.3359*/3360image?: string;3361}3362declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell {3363inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input;3364postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output;3365}3366type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Prompt | Messages;3367interface Prompt {3368/**3369* The input text prompt for the model to generate a response.3370*/3371prompt: string;3372image?: number[] | (string & NonNullable<unknown>);3373/**3374* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.3375*/3376raw?: boolean;3377/**3378* If true, the response will be streamed back incrementally using SSE, Server Sent Events.3379*/3380stream?: boolean;3381/**3382* The maximum number of tokens to generate in the response.3383*/3384max_tokens?: number;3385/**3386* Controls the randomness of the output; higher values produce more random results.3387*/3388temperature?: number;3389/**3390* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.3391*/3392top_p?: number;3393/**3394* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.3395*/3396top_k?: number;3397/**3398* Random seed for reproducibility of the generation.3399*/3400seed?: number;3401/**3402* Penalty for repeated tokens; higher values discourage repetition.3403*/3404repetition_penalty?: number;3405/**3406* Decreases the likelihood of the model repeating the same lines verbatim.3407*/3408frequency_penalty?: number;3409/**3410* Increases the likelihood of the model introducing new topics.3411*/3412presence_penalty?: number;3413/**3414* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.3415*/3416lora?: string;3417}3418interface Messages {3419/**3420* An array of message objects representing the conversation history.3421*/3422messages: {3423/**3424* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').3425*/3426role?: string;3427/**3428* The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 0000000013429*/3430tool_call_id?: string;3431content?: string | {3432/**3433* Type of the content provided3434*/3435type?: string;3436text?: string;3437image_url?: {3438/**3439* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted3440*/3441url?: string;3442};3443}[] | {3444/**3445* Type of the content provided3446*/3447type?: string;3448text?: string;3449image_url?: {3450/**3451* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted3452*/3453url?: string;3454};3455};3456}[];3457image?: number[] | (string & NonNullable<unknown>);3458functions?: {3459name: string;3460code: string;3461}[];3462/**3463* A list of tools available for the assistant to use.3464*/3465tools?: ({3466/**3467* The name of the tool. More descriptive the better.3468*/3469name: string;3470/**3471* A brief description of what the tool does.3472*/3473description: string;3474/**3475* Schema defining the parameters accepted by the tool.3476*/3477parameters: {3478/**3479* The type of the parameters object (usually 'object').3480*/3481type: string;3482/**3483* List of required parameter names.3484*/3485required?: string[];3486/**3487* Definitions of each parameter.3488*/3489properties: {3490[k: string]: {3491/**3492* The data type of the parameter.3493*/3494type: string;3495/**3496* A description of the expected parameter.3497*/3498description: string;3499};3500};3501};3502} | {3503/**3504* Specifies the type of tool (e.g., 'function').3505*/3506type: string;3507/**3508* Details of the function tool.3509*/3510function: {3511/**3512* The name of the function.3513*/3514name: string;3515/**3516* A brief description of what the function does.3517*/3518description: string;3519/**3520* Schema defining the parameters accepted by the function.3521*/3522parameters: {3523/**3524* The type of the parameters object (usually 'object').3525*/3526type: string;3527/**3528* List of required parameter names.3529*/3530required?: string[];3531/**3532* Definitions of each parameter.3533*/3534properties: {3535[k: string]: {3536/**3537* The data type of the parameter.3538*/3539type: string;3540/**3541* A description of the expected parameter.3542*/3543description: string;3544};3545};3546};3547};3548})[];3549/**3550* If true, the response will be streamed back incrementally.3551*/3552stream?: boolean;3553/**3554* The maximum number of tokens to generate in the response.3555*/3556max_tokens?: number;3557/**3558* Controls the randomness of the output; higher values produce more random results.3559*/3560temperature?: number;3561/**3562* Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.3563*/3564top_p?: number;3565/**3566* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.3567*/3568top_k?: number;3569/**3570* Random seed for reproducibility of the generation.3571*/3572seed?: number;3573/**3574* Penalty for repeated tokens; higher values discourage repetition.3575*/3576repetition_penalty?: number;3577/**3578* Decreases the likelihood of the model repeating the same lines verbatim.3579*/3580frequency_penalty?: number;3581/**3582* Increases the likelihood of the model introducing new topics.3583*/3584presence_penalty?: number;3585}3586type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output = {3587/**3588* The generated text response from the model3589*/3590response?: string;3591/**3592* An array of tool calls requests made during the response generation3593*/3594tool_calls?: {3595/**3596* The arguments passed to be passed to the tool call request3597*/3598arguments?: object;3599/**3600* The name of the tool to be called3601*/3602name?: string;3603}[];3604};3605declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct {3606inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input;3607postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output;3608}3609type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input = Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt | Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages | AsyncBatch;3610interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt {3611/**3612* The input text prompt for the model to generate a response.3613*/3614prompt: string;3615/**3616* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.3617*/3618lora?: string;3619response_format?: JSONMode;3620/**3621* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.3622*/3623raw?: boolean;3624/**3625* If true, the response will be streamed back incrementally using SSE, Server Sent Events.3626*/3627stream?: boolean;3628/**3629* The maximum number of tokens to generate in the response.3630*/3631max_tokens?: number;3632/**3633* Controls the randomness of the output; higher values produce more random results.3634*/3635temperature?: number;3636/**3637* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.3638*/3639top_p?: number;3640/**3641* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.3642*/3643top_k?: number;3644/**3645* Random seed for reproducibility of the generation.3646*/3647seed?: number;3648/**3649* Penalty for repeated tokens; higher values discourage repetition.3650*/3651repetition_penalty?: number;3652/**3653* Decreases the likelihood of the model repeating the same lines verbatim.3654*/3655frequency_penalty?: number;3656/**3657* Increases the likelihood of the model introducing new topics.3658*/3659presence_penalty?: number;3660}3661interface JSONMode {3662type?: "json_object" | "json_schema";3663json_schema?: unknown;3664}3665interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {3666/**3667* An array of message objects representing the conversation history.3668*/3669messages: {3670/**3671* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').3672*/3673role: string;3674/**3675* The content of the message as a string.3676*/3677content: string;3678}[];3679functions?: {3680name: string;3681code: string;3682}[];3683/**3684* A list of tools available for the assistant to use.3685*/3686tools?: ({3687/**3688* The name of the tool. More descriptive the better.3689*/3690name: string;3691/**3692* A brief description of what the tool does.3693*/3694description: string;3695/**3696* Schema defining the parameters accepted by the tool.3697*/3698parameters: {3699/**3700* The type of the parameters object (usually 'object').3701*/3702type: string;3703/**3704* List of required parameter names.3705*/3706required?: string[];3707/**3708* Definitions of each parameter.3709*/3710properties: {3711[k: string]: {3712/**3713* The data type of the parameter.3714*/3715type: string;3716/**3717* A description of the expected parameter.3718*/3719description: string;3720};3721};3722};3723} | {3724/**3725* Specifies the type of tool (e.g., 'function').3726*/3727type: string;3728/**3729* Details of the function tool.3730*/3731function: {3732/**3733* The name of the function.3734*/3735name: string;3736/**3737* A brief description of what the function does.3738*/3739description: string;3740/**3741* Schema defining the parameters accepted by the function.3742*/3743parameters: {3744/**3745* The type of the parameters object (usually 'object').3746*/3747type: string;3748/**3749* List of required parameter names.3750*/3751required?: string[];3752/**3753* Definitions of each parameter.3754*/3755properties: {3756[k: string]: {3757/**3758* The data type of the parameter.3759*/3760type: string;3761/**3762* A description of the expected parameter.3763*/3764description: string;3765};3766};3767};3768};3769})[];3770response_format?: JSONMode;3771/**3772* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.3773*/3774raw?: boolean;3775/**3776* If true, the response will be streamed back incrementally using SSE, Server Sent Events.3777*/3778stream?: boolean;3779/**3780* The maximum number of tokens to generate in the response.3781*/3782max_tokens?: number;3783/**3784* Controls the randomness of the output; higher values produce more random results.3785*/3786temperature?: number;3787/**3788* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.3789*/3790top_p?: number;3791/**3792* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.3793*/3794top_k?: number;3795/**3796* Random seed for reproducibility of the generation.3797*/3798seed?: number;3799/**3800* Penalty for repeated tokens; higher values discourage repetition.3801*/3802repetition_penalty?: number;3803/**3804* Decreases the likelihood of the model repeating the same lines verbatim.3805*/3806frequency_penalty?: number;3807/**3808* Increases the likelihood of the model introducing new topics.3809*/3810presence_penalty?: number;3811}3812interface AsyncBatch {3813requests?: {3814/**3815* User-supplied reference. This field will be present in the response as well it can be used to reference the request and response. It's NOT validated to be unique.3816*/3817external_reference?: string;3818/**3819* Prompt for the text generation model3820*/3821prompt?: string;3822/**3823* If true, the response will be streamed back incrementally using SSE, Server Sent Events.3824*/3825stream?: boolean;3826/**3827* The maximum number of tokens to generate in the response.3828*/3829max_tokens?: number;3830/**3831* Controls the randomness of the output; higher values produce more random results.3832*/3833temperature?: number;3834/**3835* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.3836*/3837top_p?: number;3838/**3839* Random seed for reproducibility of the generation.3840*/3841seed?: number;3842/**3843* Penalty for repeated tokens; higher values discourage repetition.3844*/3845repetition_penalty?: number;3846/**3847* Decreases the likelihood of the model repeating the same lines verbatim.3848*/3849frequency_penalty?: number;3850/**3851* Increases the likelihood of the model introducing new topics.3852*/3853presence_penalty?: number;3854response_format?: JSONMode;3855}[];3856}3857type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output = {3858/**3859* The generated text response from the model3860*/3861response: string;3862/**3863* Usage statistics for the inference request3864*/3865usage?: {3866/**3867* Total number of tokens in input3868*/3869prompt_tokens?: number;3870/**3871* Total number of tokens in output3872*/3873completion_tokens?: number;3874/**3875* Total number of input and output tokens3876*/3877total_tokens?: number;3878};3879/**3880* An array of tool calls requests made during the response generation3881*/3882tool_calls?: {3883/**3884* The arguments passed to be passed to the tool call request3885*/3886arguments?: object;3887/**3888* The name of the tool to be called3889*/3890name?: string;3891}[];3892} | string | AsyncResponse;3893declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {3894inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;3895postProcessedOutputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output;3896}3897interface Ai_Cf_Meta_Llama_Guard_3_8B_Input {3898/**3899* An array of message objects representing the conversation history.3900*/3901messages: {3902/**3903* The role of the message sender must alternate between 'user' and 'assistant'.3904*/3905role: "user" | "assistant";3906/**3907* The content of the message as a string.3908*/3909content: string;3910}[];3911/**3912* The maximum number of tokens to generate in the response.3913*/3914max_tokens?: number;3915/**3916* Controls the randomness of the output; higher values produce more random results.3917*/3918temperature?: number;3919/**3920* Dictate the output format of the generated response.3921*/3922response_format?: {3923/**3924* Set to json_object to process and output generated text as JSON.3925*/3926type?: string;3927};3928}3929interface Ai_Cf_Meta_Llama_Guard_3_8B_Output {3930response?: string | {3931/**3932* Whether the conversation is safe or not.3933*/3934safe?: boolean;3935/**3936* A list of what hazard categories predicted for the conversation, if the conversation is deemed unsafe.3937*/3938categories?: string[];3939};3940/**3941* Usage statistics for the inference request3942*/3943usage?: {3944/**3945* Total number of tokens in input3946*/3947prompt_tokens?: number;3948/**3949* Total number of tokens in output3950*/3951completion_tokens?: number;3952/**3953* Total number of input and output tokens3954*/3955total_tokens?: number;3956};3957}3958declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B {3959inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input;3960postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output;3961}3962interface Ai_Cf_Baai_Bge_Reranker_Base_Input {3963/**3964* A query you wish to perform against the provided contexts.3965*/3966/**3967* Number of returned results starting with the best score.3968*/3969top_k?: number;3970/**3971* List of provided contexts. Note that the index in this array is important, as the response will refer to it.3972*/3973contexts: {3974/**3975* One of the provided context content3976*/3977text?: string;3978}[];3979}3980interface Ai_Cf_Baai_Bge_Reranker_Base_Output {3981response?: {3982/**3983* Index of the context in the request3984*/3985id?: number;3986/**3987* Score of the context under the index.3988*/3989score?: number;3990}[];3991}3992declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {3993inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;3994postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;3995}3996type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input = Qwen2_5_Coder_32B_Instruct_Prompt | Qwen2_5_Coder_32B_Instruct_Messages;3997interface Qwen2_5_Coder_32B_Instruct_Prompt {3998/**3999* The input text prompt for the model to generate a response.4000*/4001prompt: string;4002/**4003* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.4004*/4005lora?: string;4006response_format?: JSONMode;4007/**4008* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.4009*/4010raw?: boolean;4011/**4012* If true, the response will be streamed back incrementally using SSE, Server Sent Events.4013*/4014stream?: boolean;4015/**4016* The maximum number of tokens to generate in the response.4017*/4018max_tokens?: number;4019/**4020* Controls the randomness of the output; higher values produce more random results.4021*/4022temperature?: number;4023/**4024* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.4025*/4026top_p?: number;4027/**4028* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.4029*/4030top_k?: number;4031/**4032* Random seed for reproducibility of the generation.4033*/4034seed?: number;4035/**4036* Penalty for repeated tokens; higher values discourage repetition.4037*/4038repetition_penalty?: number;4039/**4040* Decreases the likelihood of the model repeating the same lines verbatim.4041*/4042frequency_penalty?: number;4043/**4044* Increases the likelihood of the model introducing new topics.4045*/4046presence_penalty?: number;4047}4048interface Qwen2_5_Coder_32B_Instruct_Messages {4049/**4050* An array of message objects representing the conversation history.4051*/4052messages: {4053/**4054* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').4055*/4056role: string;4057/**4058* The content of the message as a string.4059*/4060content: string;4061}[];4062functions?: {4063name: string;4064code: string;4065}[];4066/**4067* A list of tools available for the assistant to use.4068*/4069tools?: ({4070/**4071* The name of the tool. More descriptive the better.4072*/4073name: string;4074/**4075* A brief description of what the tool does.4076*/4077description: string;4078/**4079* Schema defining the parameters accepted by the tool.4080*/4081parameters: {4082/**4083* The type of the parameters object (usually 'object').4084*/4085type: string;4086/**4087* List of required parameter names.4088*/4089required?: string[];4090/**4091* Definitions of each parameter.4092*/4093properties: {4094[k: string]: {4095/**4096* The data type of the parameter.4097*/4098type: string;4099/**4100* A description of the expected parameter.4101*/4102description: string;4103};4104};4105};4106} | {4107/**4108* Specifies the type of tool (e.g., 'function').4109*/4110type: string;4111/**4112* Details of the function tool.4113*/4114function: {4115/**4116* The name of the function.4117*/4118name: string;4119/**4120* A brief description of what the function does.4121*/4122description: string;4123/**4124* Schema defining the parameters accepted by the function.4125*/4126parameters: {4127/**4128* The type of the parameters object (usually 'object').4129*/4130type: string;4131/**4132* List of required parameter names.4133*/4134required?: string[];4135/**4136* Definitions of each parameter.4137*/4138properties: {4139[k: string]: {4140/**4141* The data type of the parameter.4142*/4143type: string;4144/**4145* A description of the expected parameter.4146*/4147description: string;4148};4149};4150};4151};4152})[];4153response_format?: JSONMode;4154/**4155* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.4156*/4157raw?: boolean;4158/**4159* If true, the response will be streamed back incrementally using SSE, Server Sent Events.4160*/4161stream?: boolean;4162/**4163* The maximum number of tokens to generate in the response.4164*/4165max_tokens?: number;4166/**4167* Controls the randomness of the output; higher values produce more random results.4168*/4169temperature?: number;4170/**4171* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.4172*/4173top_p?: number;4174/**4175* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.4176*/4177top_k?: number;4178/**4179* Random seed for reproducibility of the generation.4180*/4181seed?: number;4182/**4183* Penalty for repeated tokens; higher values discourage repetition.4184*/4185repetition_penalty?: number;4186/**4187* Decreases the likelihood of the model repeating the same lines verbatim.4188*/4189frequency_penalty?: number;4190/**4191* Increases the likelihood of the model introducing new topics.4192*/4193presence_penalty?: number;4194}4195type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output = {4196/**4197* The generated text response from the model4198*/4199response: string;4200/**4201* Usage statistics for the inference request4202*/4203usage?: {4204/**4205* Total number of tokens in input4206*/4207prompt_tokens?: number;4208/**4209* Total number of tokens in output4210*/4211completion_tokens?: number;4212/**4213* Total number of input and output tokens4214*/4215total_tokens?: number;4216};4217/**4218* An array of tool calls requests made during the response generation4219*/4220tool_calls?: {4221/**4222* The arguments passed to be passed to the tool call request4223*/4224arguments?: object;4225/**4226* The name of the tool to be called4227*/4228name?: string;4229}[];4230};4231declare abstract class Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct {4232inputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input;4233postProcessedOutputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output;4234}4235type Ai_Cf_Qwen_Qwq_32B_Input = Qwen_Qwq_32B_Prompt | Qwen_Qwq_32B_Messages;4236interface Qwen_Qwq_32B_Prompt {4237/**4238* The input text prompt for the model to generate a response.4239*/4240prompt: string;4241/**4242* JSON schema that should be fulfilled for the response.4243*/4244guided_json?: object;4245/**4246* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.4247*/4248raw?: boolean;4249/**4250* If true, the response will be streamed back incrementally using SSE, Server Sent Events.4251*/4252stream?: boolean;4253/**4254* The maximum number of tokens to generate in the response.4255*/4256max_tokens?: number;4257/**4258* Controls the randomness of the output; higher values produce more random results.4259*/4260temperature?: number;4261/**4262* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.4263*/4264top_p?: number;4265/**4266* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.4267*/4268top_k?: number;4269/**4270* Random seed for reproducibility of the generation.4271*/4272seed?: number;4273/**4274* Penalty for repeated tokens; higher values discourage repetition.4275*/4276repetition_penalty?: number;4277/**4278* Decreases the likelihood of the model repeating the same lines verbatim.4279*/4280frequency_penalty?: number;4281/**4282* Increases the likelihood of the model introducing new topics.4283*/4284presence_penalty?: number;4285}4286interface Qwen_Qwq_32B_Messages {4287/**4288* An array of message objects representing the conversation history.4289*/4290messages: {4291/**4292* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').4293*/4294role?: string;4295/**4296* The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 0000000014297*/4298tool_call_id?: string;4299content?: string | {4300/**4301* Type of the content provided4302*/4303type?: string;4304text?: string;4305image_url?: {4306/**4307* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted4308*/4309url?: string;4310};4311}[] | {4312/**4313* Type of the content provided4314*/4315type?: string;4316text?: string;4317image_url?: {4318/**4319* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted4320*/4321url?: string;4322};4323};4324}[];4325functions?: {4326name: string;4327code: string;4328}[];4329/**4330* A list of tools available for the assistant to use.4331*/4332tools?: ({4333/**4334* The name of the tool. More descriptive the better.4335*/4336name: string;4337/**4338* A brief description of what the tool does.4339*/4340description: string;4341/**4342* Schema defining the parameters accepted by the tool.4343*/4344parameters: {4345/**4346* The type of the parameters object (usually 'object').4347*/4348type: string;4349/**4350* List of required parameter names.4351*/4352required?: string[];4353/**4354* Definitions of each parameter.4355*/4356properties: {4357[k: string]: {4358/**4359* The data type of the parameter.4360*/4361type: string;4362/**4363* A description of the expected parameter.4364*/4365description: string;4366};4367};4368};4369} | {4370/**4371* Specifies the type of tool (e.g., 'function').4372*/4373type: string;4374/**4375* Details of the function tool.4376*/4377function: {4378/**4379* The name of the function.4380*/4381name: string;4382/**4383* A brief description of what the function does.4384*/4385description: string;4386/**4387* Schema defining the parameters accepted by the function.4388*/4389parameters: {4390/**4391* The type of the parameters object (usually 'object').4392*/4393type: string;4394/**4395* List of required parameter names.4396*/4397required?: string[];4398/**4399* Definitions of each parameter.4400*/4401properties: {4402[k: string]: {4403/**4404* The data type of the parameter.4405*/4406type: string;4407/**4408* A description of the expected parameter.4409*/4410description: string;4411};4412};4413};4414};4415})[];4416/**4417* JSON schema that should be fufilled for the response.4418*/4419guided_json?: object;4420/**4421* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.4422*/4423raw?: boolean;4424/**4425* If true, the response will be streamed back incrementally using SSE, Server Sent Events.4426*/4427stream?: boolean;4428/**4429* The maximum number of tokens to generate in the response.4430*/4431max_tokens?: number;4432/**4433* Controls the randomness of the output; higher values produce more random results.4434*/4435temperature?: number;4436/**4437* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.4438*/4439top_p?: number;4440/**4441* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.4442*/4443top_k?: number;4444/**4445* Random seed for reproducibility of the generation.4446*/4447seed?: number;4448/**4449* Penalty for repeated tokens; higher values discourage repetition.4450*/4451repetition_penalty?: number;4452/**4453* Decreases the likelihood of the model repeating the same lines verbatim.4454*/4455frequency_penalty?: number;4456/**4457* Increases the likelihood of the model introducing new topics.4458*/4459presence_penalty?: number;4460}4461type Ai_Cf_Qwen_Qwq_32B_Output = {4462/**4463* The generated text response from the model4464*/4465response: string;4466/**4467* Usage statistics for the inference request4468*/4469usage?: {4470/**4471* Total number of tokens in input4472*/4473prompt_tokens?: number;4474/**4475* Total number of tokens in output4476*/4477completion_tokens?: number;4478/**4479* Total number of input and output tokens4480*/4481total_tokens?: number;4482};4483/**4484* An array of tool calls requests made during the response generation4485*/4486tool_calls?: {4487/**4488* The arguments passed to be passed to the tool call request4489*/4490arguments?: object;4491/**4492* The name of the tool to be called4493*/4494name?: string;4495}[];4496};4497declare abstract class Base_Ai_Cf_Qwen_Qwq_32B {4498inputs: Ai_Cf_Qwen_Qwq_32B_Input;4499postProcessedOutputs: Ai_Cf_Qwen_Qwq_32B_Output;4500}4501type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input = Mistral_Small_3_1_24B_Instruct_Prompt | Mistral_Small_3_1_24B_Instruct_Messages;4502interface Mistral_Small_3_1_24B_Instruct_Prompt {4503/**4504* The input text prompt for the model to generate a response.4505*/4506prompt: string;4507/**4508* JSON schema that should be fulfilled for the response.4509*/4510guided_json?: object;4511/**4512* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.4513*/4514raw?: boolean;4515/**4516* If true, the response will be streamed back incrementally using SSE, Server Sent Events.4517*/4518stream?: boolean;4519/**4520* The maximum number of tokens to generate in the response.4521*/4522max_tokens?: number;4523/**4524* Controls the randomness of the output; higher values produce more random results.4525*/4526temperature?: number;4527/**4528* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.4529*/4530top_p?: number;4531/**4532* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.4533*/4534top_k?: number;4535/**4536* Random seed for reproducibility of the generation.4537*/4538seed?: number;4539/**4540* Penalty for repeated tokens; higher values discourage repetition.4541*/4542repetition_penalty?: number;4543/**4544* Decreases the likelihood of the model repeating the same lines verbatim.4545*/4546frequency_penalty?: number;4547/**4548* Increases the likelihood of the model introducing new topics.4549*/4550presence_penalty?: number;4551}4552interface Mistral_Small_3_1_24B_Instruct_Messages {4553/**4554* An array of message objects representing the conversation history.4555*/4556messages: {4557/**4558* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').4559*/4560role?: string;4561/**4562* The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 0000000014563*/4564tool_call_id?: string;4565content?: string | {4566/**4567* Type of the content provided4568*/4569type?: string;4570text?: string;4571image_url?: {4572/**4573* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted4574*/4575url?: string;4576};4577}[] | {4578/**4579* Type of the content provided4580*/4581type?: string;4582text?: string;4583image_url?: {4584/**4585* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted4586*/4587url?: string;4588};4589};4590}[];4591functions?: {4592name: string;4593code: string;4594}[];4595/**4596* A list of tools available for the assistant to use.4597*/4598tools?: ({4599/**4600* The name of the tool. More descriptive the better.4601*/4602name: string;4603/**4604* A brief description of what the tool does.4605*/4606description: string;4607/**4608* Schema defining the parameters accepted by the tool.4609*/4610parameters: {4611/**4612* The type of the parameters object (usually 'object').4613*/4614type: string;4615/**4616* List of required parameter names.4617*/4618required?: string[];4619/**4620* Definitions of each parameter.4621*/4622properties: {4623[k: string]: {4624/**4625* The data type of the parameter.4626*/4627type: string;4628/**4629* A description of the expected parameter.4630*/4631description: string;4632};4633};4634};4635} | {4636/**4637* Specifies the type of tool (e.g., 'function').4638*/4639type: string;4640/**4641* Details of the function tool.4642*/4643function: {4644/**4645* The name of the function.4646*/4647name: string;4648/**4649* A brief description of what the function does.4650*/4651description: string;4652/**4653* Schema defining the parameters accepted by the function.4654*/4655parameters: {4656/**4657* The type of the parameters object (usually 'object').4658*/4659type: string;4660/**4661* List of required parameter names.4662*/4663required?: string[];4664/**4665* Definitions of each parameter.4666*/4667properties: {4668[k: string]: {4669/**4670* The data type of the parameter.4671*/4672type: string;4673/**4674* A description of the expected parameter.4675*/4676description: string;4677};4678};4679};4680};4681})[];4682/**4683* JSON schema that should be fufilled for the response.4684*/4685guided_json?: object;4686/**4687* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.4688*/4689raw?: boolean;4690/**4691* If true, the response will be streamed back incrementally using SSE, Server Sent Events.4692*/4693stream?: boolean;4694/**4695* The maximum number of tokens to generate in the response.4696*/4697max_tokens?: number;4698/**4699* Controls the randomness of the output; higher values produce more random results.4700*/4701temperature?: number;4702/**4703* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.4704*/4705top_p?: number;4706/**4707* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.4708*/4709top_k?: number;4710/**4711* Random seed for reproducibility of the generation.4712*/4713seed?: number;4714/**4715* Penalty for repeated tokens; higher values discourage repetition.4716*/4717repetition_penalty?: number;4718/**4719* Decreases the likelihood of the model repeating the same lines verbatim.4720*/4721frequency_penalty?: number;4722/**4723* Increases the likelihood of the model introducing new topics.4724*/4725presence_penalty?: number;4726}4727type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output = {4728/**4729* The generated text response from the model4730*/4731response: string;4732/**4733* Usage statistics for the inference request4734*/4735usage?: {4736/**4737* Total number of tokens in input4738*/4739prompt_tokens?: number;4740/**4741* Total number of tokens in output4742*/4743completion_tokens?: number;4744/**4745* Total number of input and output tokens4746*/4747total_tokens?: number;4748};4749/**4750* An array of tool calls requests made during the response generation4751*/4752tool_calls?: {4753/**4754* The arguments passed to be passed to the tool call request4755*/4756arguments?: object;4757/**4758* The name of the tool to be called4759*/4760name?: string;4761}[];4762};4763declare abstract class Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct {4764inputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input;4765postProcessedOutputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output;4766}4767type Ai_Cf_Google_Gemma_3_12B_It_Input = Google_Gemma_3_12B_It_Prompt | Google_Gemma_3_12B_It_Messages;4768interface Google_Gemma_3_12B_It_Prompt {4769/**4770* The input text prompt for the model to generate a response.4771*/4772prompt: string;4773/**4774* JSON schema that should be fufilled for the response.4775*/4776guided_json?: object;4777/**4778* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.4779*/4780raw?: boolean;4781/**4782* If true, the response will be streamed back incrementally using SSE, Server Sent Events.4783*/4784stream?: boolean;4785/**4786* The maximum number of tokens to generate in the response.4787*/4788max_tokens?: number;4789/**4790* Controls the randomness of the output; higher values produce more random results.4791*/4792temperature?: number;4793/**4794* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.4795*/4796top_p?: number;4797/**4798* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.4799*/4800top_k?: number;4801/**4802* Random seed for reproducibility of the generation.4803*/4804seed?: number;4805/**4806* Penalty for repeated tokens; higher values discourage repetition.4807*/4808repetition_penalty?: number;4809/**4810* Decreases the likelihood of the model repeating the same lines verbatim.4811*/4812frequency_penalty?: number;4813/**4814* Increases the likelihood of the model introducing new topics.4815*/4816presence_penalty?: number;4817}4818interface Google_Gemma_3_12B_It_Messages {4819/**4820* An array of message objects representing the conversation history.4821*/4822messages: {4823/**4824* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').4825*/4826role?: string;4827content?: string | {4828/**4829* Type of the content provided4830*/4831type?: string;4832text?: string;4833image_url?: {4834/**4835* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted4836*/4837url?: string;4838};4839}[] | {4840/**4841* Type of the content provided4842*/4843type?: string;4844text?: string;4845image_url?: {4846/**4847* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted4848*/4849url?: string;4850};4851};4852}[];4853functions?: {4854name: string;4855code: string;4856}[];4857/**4858* A list of tools available for the assistant to use.4859*/4860tools?: ({4861/**4862* The name of the tool. More descriptive the better.4863*/4864name: string;4865/**4866* A brief description of what the tool does.4867*/4868description: string;4869/**4870* Schema defining the parameters accepted by the tool.4871*/4872parameters: {4873/**4874* The type of the parameters object (usually 'object').4875*/4876type: string;4877/**4878* List of required parameter names.4879*/4880required?: string[];4881/**4882* Definitions of each parameter.4883*/4884properties: {4885[k: string]: {4886/**4887* The data type of the parameter.4888*/4889type: string;4890/**4891* A description of the expected parameter.4892*/4893description: string;4894};4895};4896};4897} | {4898/**4899* Specifies the type of tool (e.g., 'function').4900*/4901type: string;4902/**4903* Details of the function tool.4904*/4905function: {4906/**4907* The name of the function.4908*/4909name: string;4910/**4911* A brief description of what the function does.4912*/4913description: string;4914/**4915* Schema defining the parameters accepted by the function.4916*/4917parameters: {4918/**4919* The type of the parameters object (usually 'object').4920*/4921type: string;4922/**4923* List of required parameter names.4924*/4925required?: string[];4926/**4927* Definitions of each parameter.4928*/4929properties: {4930[k: string]: {4931/**4932* The data type of the parameter.4933*/4934type: string;4935/**4936* A description of the expected parameter.4937*/4938description: string;4939};4940};4941};4942};4943})[];4944/**4945* JSON schema that should be fufilled for the response.4946*/4947guided_json?: object;4948/**4949* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.4950*/4951raw?: boolean;4952/**4953* If true, the response will be streamed back incrementally using SSE, Server Sent Events.4954*/4955stream?: boolean;4956/**4957* The maximum number of tokens to generate in the response.4958*/4959max_tokens?: number;4960/**4961* Controls the randomness of the output; higher values produce more random results.4962*/4963temperature?: number;4964/**4965* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.4966*/4967top_p?: number;4968/**4969* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.4970*/4971top_k?: number;4972/**4973* Random seed for reproducibility of the generation.4974*/4975seed?: number;4976/**4977* Penalty for repeated tokens; higher values discourage repetition.4978*/4979repetition_penalty?: number;4980/**4981* Decreases the likelihood of the model repeating the same lines verbatim.4982*/4983frequency_penalty?: number;4984/**4985* Increases the likelihood of the model introducing new topics.4986*/4987presence_penalty?: number;4988}4989type Ai_Cf_Google_Gemma_3_12B_It_Output = {4990/**4991* The generated text response from the model4992*/4993response: string;4994/**4995* Usage statistics for the inference request4996*/4997usage?: {4998/**4999* Total number of tokens in input5000*/5001prompt_tokens?: number;5002/**5003* Total number of tokens in output5004*/5005completion_tokens?: number;5006/**5007* Total number of input and output tokens5008*/5009total_tokens?: number;5010};5011/**5012* An array of tool calls requests made during the response generation5013*/5014tool_calls?: {5015/**5016* The arguments passed to be passed to the tool call request5017*/5018arguments?: object;5019/**5020* The name of the tool to be called5021*/5022name?: string;5023}[];5024};5025declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {5026inputs: Ai_Cf_Google_Gemma_3_12B_It_Input;5027postProcessedOutputs: Ai_Cf_Google_Gemma_3_12B_It_Output;5028}5029type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input = Ai_Cf_Meta_Llama_4_Prompt | Ai_Cf_Meta_Llama_4_Messages | Ai_Cf_Meta_Llama_4_Async_Batch;5030interface Ai_Cf_Meta_Llama_4_Prompt {5031/**5032* The input text prompt for the model to generate a response.5033*/5034prompt: string;5035/**5036* JSON schema that should be fulfilled for the response.5037*/5038guided_json?: object;5039response_format?: JSONMode;5040/**5041* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.5042*/5043raw?: boolean;5044/**5045* If true, the response will be streamed back incrementally using SSE, Server Sent Events.5046*/5047stream?: boolean;5048/**5049* The maximum number of tokens to generate in the response.5050*/5051max_tokens?: number;5052/**5053* Controls the randomness of the output; higher values produce more random results.5054*/5055temperature?: number;5056/**5057* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.5058*/5059top_p?: number;5060/**5061* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.5062*/5063top_k?: number;5064/**5065* Random seed for reproducibility of the generation.5066*/5067seed?: number;5068/**5069* Penalty for repeated tokens; higher values discourage repetition.5070*/5071repetition_penalty?: number;5072/**5073* Decreases the likelihood of the model repeating the same lines verbatim.5074*/5075frequency_penalty?: number;5076/**5077* Increases the likelihood of the model introducing new topics.5078*/5079presence_penalty?: number;5080}5081interface Ai_Cf_Meta_Llama_4_Messages {5082/**5083* An array of message objects representing the conversation history.5084*/5085messages: {5086/**5087* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').5088*/5089role?: string;5090/**5091* The tool call id. If you don't know what to put here you can fall back to 0000000015092*/5093tool_call_id?: string;5094content?: string | {5095/**5096* Type of the content provided5097*/5098type?: string;5099text?: string;5100image_url?: {5101/**5102* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted5103*/5104url?: string;5105};5106}[] | {5107/**5108* Type of the content provided5109*/5110type?: string;5111text?: string;5112image_url?: {5113/**5114* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted5115*/5116url?: string;5117};5118};5119}[];5120functions?: {5121name: string;5122code: string;5123}[];5124/**5125* A list of tools available for the assistant to use.5126*/5127tools?: ({5128/**5129* The name of the tool. More descriptive the better.5130*/5131name: string;5132/**5133* A brief description of what the tool does.5134*/5135description: string;5136/**5137* Schema defining the parameters accepted by the tool.5138*/5139parameters: {5140/**5141* The type of the parameters object (usually 'object').5142*/5143type: string;5144/**5145* List of required parameter names.5146*/5147required?: string[];5148/**5149* Definitions of each parameter.5150*/5151properties: {5152[k: string]: {5153/**5154* The data type of the parameter.5155*/5156type: string;5157/**5158* A description of the expected parameter.5159*/5160description: string;5161};5162};5163};5164} | {5165/**5166* Specifies the type of tool (e.g., 'function').5167*/5168type: string;5169/**5170* Details of the function tool.5171*/5172function: {5173/**5174* The name of the function.5175*/5176name: string;5177/**5178* A brief description of what the function does.5179*/5180description: string;5181/**5182* Schema defining the parameters accepted by the function.5183*/5184parameters: {5185/**5186* The type of the parameters object (usually 'object').5187*/5188type: string;5189/**5190* List of required parameter names.5191*/5192required?: string[];5193/**5194* Definitions of each parameter.5195*/5196properties: {5197[k: string]: {5198/**5199* The data type of the parameter.5200*/5201type: string;5202/**5203* A description of the expected parameter.5204*/5205description: string;5206};5207};5208};5209};5210})[];5211response_format?: JSONMode;5212/**5213* JSON schema that should be fufilled for the response.5214*/5215guided_json?: object;5216/**5217* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.5218*/5219raw?: boolean;5220/**5221* If true, the response will be streamed back incrementally using SSE, Server Sent Events.5222*/5223stream?: boolean;5224/**5225* The maximum number of tokens to generate in the response.5226*/5227max_tokens?: number;5228/**5229* Controls the randomness of the output; higher values produce more random results.5230*/5231temperature?: number;5232/**5233* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.5234*/5235top_p?: number;5236/**5237* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.5238*/5239top_k?: number;5240/**5241* Random seed for reproducibility of the generation.5242*/5243seed?: number;5244/**5245* Penalty for repeated tokens; higher values discourage repetition.5246*/5247repetition_penalty?: number;5248/**5249* Decreases the likelihood of the model repeating the same lines verbatim.5250*/5251frequency_penalty?: number;5252/**5253* Increases the likelihood of the model introducing new topics.5254*/5255presence_penalty?: number;5256}5257interface Ai_Cf_Meta_Llama_4_Async_Batch {5258requests: (Ai_Cf_Meta_Llama_4_Prompt_Inner | Ai_Cf_Meta_Llama_4_Messages_Inner)[];5259}5260interface Ai_Cf_Meta_Llama_4_Prompt_Inner {5261/**5262* The input text prompt for the model to generate a response.5263*/5264prompt: string;5265/**5266* JSON schema that should be fulfilled for the response.5267*/5268guided_json?: object;5269response_format?: JSONMode;5270/**5271* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.5272*/5273raw?: boolean;5274/**5275* If true, the response will be streamed back incrementally using SSE, Server Sent Events.5276*/5277stream?: boolean;5278/**5279* The maximum number of tokens to generate in the response.5280*/5281max_tokens?: number;5282/**5283* Controls the randomness of the output; higher values produce more random results.5284*/5285temperature?: number;5286/**5287* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.5288*/5289top_p?: number;5290/**5291* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.5292*/5293top_k?: number;5294/**5295* Random seed for reproducibility of the generation.5296*/5297seed?: number;5298/**5299* Penalty for repeated tokens; higher values discourage repetition.5300*/5301repetition_penalty?: number;5302/**5303* Decreases the likelihood of the model repeating the same lines verbatim.5304*/5305frequency_penalty?: number;5306/**5307* Increases the likelihood of the model introducing new topics.5308*/5309presence_penalty?: number;5310}5311interface Ai_Cf_Meta_Llama_4_Messages_Inner {5312/**5313* An array of message objects representing the conversation history.5314*/5315messages: {5316/**5317* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').5318*/5319role?: string;5320/**5321* The tool call id. If you don't know what to put here you can fall back to 0000000015322*/5323tool_call_id?: string;5324content?: string | {5325/**5326* Type of the content provided5327*/5328type?: string;5329text?: string;5330image_url?: {5331/**5332* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted5333*/5334url?: string;5335};5336}[] | {5337/**5338* Type of the content provided5339*/5340type?: string;5341text?: string;5342image_url?: {5343/**5344* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted5345*/5346url?: string;5347};5348};5349}[];5350functions?: {5351name: string;5352code: string;5353}[];5354/**5355* A list of tools available for the assistant to use.5356*/5357tools?: ({5358/**5359* The name of the tool. More descriptive the better.5360*/5361name: string;5362/**5363* A brief description of what the tool does.5364*/5365description: string;5366/**5367* Schema defining the parameters accepted by the tool.5368*/5369parameters: {5370/**5371* The type of the parameters object (usually 'object').5372*/5373type: string;5374/**5375* List of required parameter names.5376*/5377required?: string[];5378/**5379* Definitions of each parameter.5380*/5381properties: {5382[k: string]: {5383/**5384* The data type of the parameter.5385*/5386type: string;5387/**5388* A description of the expected parameter.5389*/5390description: string;5391};5392};5393};5394} | {5395/**5396* Specifies the type of tool (e.g., 'function').5397*/5398type: string;5399/**5400* Details of the function tool.5401*/5402function: {5403/**5404* The name of the function.5405*/5406name: string;5407/**5408* A brief description of what the function does.5409*/5410description: string;5411/**5412* Schema defining the parameters accepted by the function.5413*/5414parameters: {5415/**5416* The type of the parameters object (usually 'object').5417*/5418type: string;5419/**5420* List of required parameter names.5421*/5422required?: string[];5423/**5424* Definitions of each parameter.5425*/5426properties: {5427[k: string]: {5428/**5429* The data type of the parameter.5430*/5431type: string;5432/**5433* A description of the expected parameter.5434*/5435description: string;5436};5437};5438};5439};5440})[];5441response_format?: JSONMode;5442/**5443* JSON schema that should be fufilled for the response.5444*/5445guided_json?: object;5446/**5447* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.5448*/5449raw?: boolean;5450/**5451* If true, the response will be streamed back incrementally using SSE, Server Sent Events.5452*/5453stream?: boolean;5454/**5455* The maximum number of tokens to generate in the response.5456*/5457max_tokens?: number;5458/**5459* Controls the randomness of the output; higher values produce more random results.5460*/5461temperature?: number;5462/**5463* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.5464*/5465top_p?: number;5466/**5467* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.5468*/5469top_k?: number;5470/**5471* Random seed for reproducibility of the generation.5472*/5473seed?: number;5474/**5475* Penalty for repeated tokens; higher values discourage repetition.5476*/5477repetition_penalty?: number;5478/**5479* Decreases the likelihood of the model repeating the same lines verbatim.5480*/5481frequency_penalty?: number;5482/**5483* Increases the likelihood of the model introducing new topics.5484*/5485presence_penalty?: number;5486}5487type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {5488/**5489* The generated text response from the model5490*/5491response: string;5492/**5493* Usage statistics for the inference request5494*/5495usage?: {5496/**5497* Total number of tokens in input5498*/5499prompt_tokens?: number;5500/**5501* Total number of tokens in output5502*/5503completion_tokens?: number;5504/**5505* Total number of input and output tokens5506*/5507total_tokens?: number;5508};5509/**5510* An array of tool calls requests made during the response generation5511*/5512tool_calls?: {5513/**5514* The tool call id.5515*/5516id?: string;5517/**5518* Specifies the type of tool (e.g., 'function').5519*/5520type?: string;5521/**5522* Details of the function tool.5523*/5524function?: {5525/**5526* The name of the tool to be called5527*/5528name?: string;5529/**5530* The arguments passed to be passed to the tool call request5531*/5532arguments?: object;5533};5534}[];5535};5536declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {5537inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;5538postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;5539}5540interface Ai_Cf_Deepgram_Nova_3_Input {5541audio: {5542body: object;5543contentType: string;5544};5545/**5546* Sets how the model will interpret strings submitted to the custom_topic param. When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param.5547*/5548custom_topic_mode?: "extended" | "strict";5549/**5550* Custom topics you want the model to detect within your input audio or text if present Submit up to 1005551*/5552custom_topic?: string;5553/**5554* Sets how the model will interpret intents submitted to the custom_intent param. When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition those submitted using the custom_intents param5555*/5556custom_intent_mode?: "extended" | "strict";5557/**5558* Custom intents you want the model to detect within your input audio if present5559*/5560custom_intent?: string;5561/**5562* Identifies and extracts key entities from content in submitted audio5563*/5564detect_entities?: boolean;5565/**5566* Identifies the dominant language spoken in submitted audio5567*/5568detect_language?: boolean;5569/**5570* Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 05571*/5572diarize?: boolean;5573/**5574* Identify and extract key entities from content in submitted audio5575*/5576dictation?: boolean;5577/**5578* Specify the expected encoding of your submitted audio5579*/5580encoding?: "linear16" | "flac" | "mulaw" | "amr-nb" | "amr-wb" | "opus" | "speex" | "g729";5581/**5582* Arbitrary key-value pairs that are attached to the API response for usage in downstream processing5583*/5584extra?: string;5585/**5586* Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'5587*/5588filler_words?: boolean;5589/**5590* Key term prompting can boost or suppress specialized terminology and brands.5591*/5592keyterm?: string;5593/**5594* Keywords can boost or suppress specialized terminology and brands.5595*/5596keywords?: string;5597/**5598* The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available.5599*/5600language?: string;5601/**5602* Spoken measurements will be converted to their corresponding abbreviations.5603*/5604measurements?: boolean;5605/**5606* Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip.5607*/5608mip_opt_out?: boolean;5609/**5610* Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio5611*/5612mode?: "general" | "medical" | "finance";5613/**5614* Transcribe each audio channel independently.5615*/5616multichannel?: boolean;5617/**5618* Numerals converts numbers from written format to numerical format.5619*/5620numerals?: boolean;5621/**5622* Splits audio into paragraphs to improve transcript readability.5623*/5624paragraphs?: boolean;5625/**5626* Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.5627*/5628profanity_filter?: boolean;5629/**5630* Add punctuation and capitalization to the transcript.5631*/5632punctuate?: boolean;5633/**5634* Redaction removes sensitive information from your transcripts.5635*/5636redact?: string;5637/**5638* Search for terms or phrases in submitted audio and replaces them.5639*/5640replace?: string;5641/**5642* Search for terms or phrases in submitted audio.5643*/5644search?: string;5645/**5646* Recognizes the sentiment throughout a transcript or text.5647*/5648sentiment?: boolean;5649/**5650* Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.5651*/5652smart_format?: boolean;5653/**5654* Detect topics throughout a transcript or text.5655*/5656topics?: boolean;5657/**5658* Segments speech into meaningful semantic units.5659*/5660utterances?: boolean;5661/**5662* Seconds to wait before detecting a pause between words in submitted audio.5663*/5664utt_split?: number;5665/**5666* The number of channels in the submitted audio5667*/5668channels?: number;5669/**5670* Specifies whether the streaming endpoint should provide ongoing transcription updates as more audio is received. When set to true, the endpoint sends continuous updates, meaning transcription results may evolve over time. Note: Supported only for webosockets.5671*/5672interim_results?: boolean;5673/**5674* Indicates how long model will wait to detect whether a speaker has finished speaking or pauses for a significant period of time. When set to a value, the streaming endpoint immediately finalizes the transcription for the processed time range and returns the transcript with a speech_final parameter set to true. Can also be set to false to disable endpointing5675*/5676endpointing?: string;5677/**5678* Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.5679*/5680vad_events?: boolean;5681/**5682* Indicates how long model will wait to send an UtteranceEnd message after a word has been transcribed. Use with interim_results. Note: Supported only for webosockets.5683*/5684utterance_end_ms?: boolean;5685}5686interface Ai_Cf_Deepgram_Nova_3_Output {5687results?: {5688channels?: {5689alternatives?: {5690confidence?: number;5691transcript?: string;5692words?: {5693confidence?: number;5694end?: number;5695start?: number;5696word?: string;5697}[];5698}[];5699}[];5700summary?: {5701result?: string;5702short?: string;5703};5704sentiments?: {5705segments?: {5706text?: string;5707start_word?: number;5708end_word?: number;5709sentiment?: string;5710sentiment_score?: number;5711}[];5712average?: {5713sentiment?: string;5714sentiment_score?: number;5715};5716};5717};5718}5719declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {5720inputs: Ai_Cf_Deepgram_Nova_3_Input;5721postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;5722}5723type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input = {5724/**5725* readable stream with audio data and content-type specified for that data5726*/5727audio: {5728body: object;5729contentType: string;5730};5731/**5732* type of data PCM data that's sent to the inference server as raw array5733*/5734dtype?: "uint8" | "float32" | "float64";5735} | {5736/**5737* base64 encoded audio data5738*/5739audio: string;5740/**5741* type of data PCM data that's sent to the inference server as raw array5742*/5743dtype?: "uint8" | "float32" | "float64";5744};5745interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {5746/**5747* if true, end-of-turn was detected5748*/5749is_complete?: boolean;5750/**5751* probability of the end-of-turn detection5752*/5753probability?: number;5754}5755declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {5756inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;5757postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;5758}5759type Ai_Cf_Openai_Gpt_Oss_120B_Input = GPT_OSS_120B_Responses | GPT_OSS_120B_Responses_Async;5760interface GPT_OSS_120B_Responses {5761/**5762* Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types5763*/5764input: string | unknown[];5765reasoning?: {5766/**5767* Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.5768*/5769effort?: "low" | "medium" | "high";5770/**5771* A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.5772*/5773summary?: "auto" | "concise" | "detailed";5774};5775}5776interface GPT_OSS_120B_Responses_Async {5777requests: {5778/**5779* Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types5780*/5781input: string | unknown[];5782reasoning?: {5783/**5784* Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.5785*/5786effort?: "low" | "medium" | "high";5787/**5788* A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.5789*/5790summary?: "auto" | "concise" | "detailed";5791};5792}[];5793}5794type Ai_Cf_Openai_Gpt_Oss_120B_Output = {} | (string & NonNullable<unknown>);5795declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {5796inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;5797postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;5798}5799type Ai_Cf_Openai_Gpt_Oss_20B_Input = GPT_OSS_20B_Responses | GPT_OSS_20B_Responses_Async;5800interface GPT_OSS_20B_Responses {5801/**5802* Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types5803*/5804input: string | unknown[];5805reasoning?: {5806/**5807* Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.5808*/5809effort?: "low" | "medium" | "high";5810/**5811* A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.5812*/5813summary?: "auto" | "concise" | "detailed";5814};5815}5816interface GPT_OSS_20B_Responses_Async {5817requests: {5818/**5819* Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types5820*/5821input: string | unknown[];5822reasoning?: {5823/**5824* Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.5825*/5826effort?: "low" | "medium" | "high";5827/**5828* A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.5829*/5830summary?: "auto" | "concise" | "detailed";5831};5832}[];5833}5834type Ai_Cf_Openai_Gpt_Oss_20B_Output = {} | (string & NonNullable<unknown>);5835declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {5836inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;5837postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;5838}5839interface Ai_Cf_Leonardo_Phoenix_1_0_Input {5840/**5841* A text description of the image you want to generate.5842*/5843prompt: string;5844/**5845* Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt5846*/5847guidance?: number;5848/**5849* Random seed for reproducibility of the image generation5850*/5851seed?: number;5852/**5853* The height of the generated image in pixels5854*/5855height?: number;5856/**5857* The width of the generated image in pixels5858*/5859width?: number;5860/**5861* The number of diffusion steps; higher values can improve quality but take longer5862*/5863num_steps?: number;5864/**5865* Specify what to exclude from the generated images5866*/5867negative_prompt?: string;5868}5869/**5870* The generated image in JPEG format5871*/5872type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;5873declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {5874inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;5875postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;5876}5877interface Ai_Cf_Leonardo_Lucid_Origin_Input {5878/**5879* A text description of the image you want to generate.5880*/5881prompt: string;5882/**5883* Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt5884*/5885guidance?: number;5886/**5887* Random seed for reproducibility of the image generation5888*/5889seed?: number;5890/**5891* The height of the generated image in pixels5892*/5893height?: number;5894/**5895* The width of the generated image in pixels5896*/5897width?: number;5898/**5899* The number of diffusion steps; higher values can improve quality but take longer5900*/5901num_steps?: number;5902/**5903* The number of diffusion steps; higher values can improve quality but take longer5904*/5905steps?: number;5906}5907interface Ai_Cf_Leonardo_Lucid_Origin_Output {5908/**5909* The generated image in Base64 format.5910*/5911image?: string;5912}5913declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {5914inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;5915postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;5916}5917interface Ai_Cf_Deepgram_Aura_1_Input {5918/**5919* Speaker used to produce the audio.5920*/5921speaker?: "angus" | "asteria" | "arcas" | "orion" | "orpheus" | "athena" | "luna" | "zeus" | "perseus" | "helios" | "hera" | "stella";5922/**5923* Encoding of the output audio.5924*/5925encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";5926/**5927* Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..5928*/5929container?: "none" | "wav" | "ogg";5930/**5931* The text content to be converted to speech5932*/5933text: string;5934/**5935* Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable5936*/5937sample_rate?: number;5938/**5939* The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.5940*/5941bit_rate?: number;5942}5943/**5944* The generated audio in MP3 format5945*/5946type Ai_Cf_Deepgram_Aura_1_Output = string;5947declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {5948inputs: Ai_Cf_Deepgram_Aura_1_Input;5949postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;5950}5951interface AiModels {5952"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;5953"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;5954"@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;5955"@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;5956"@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;5957"@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;5958"@cf/myshell-ai/melotts": BaseAiTextToSpeech;5959"@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;5960"@cf/microsoft/resnet-50": BaseAiImageClassification;5961"@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;5962"@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;5963"@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;5964"@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;5965"@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;5966"@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;5967"@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;5968"@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;5969"@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;5970"@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;5971"@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;5972"@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;5973"@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;5974"@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;5975"@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;5976"@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;5977"@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;5978"@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;5979"@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;5980"@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;5981"@cf/microsoft/phi-2": BaseAiTextGeneration;5982"@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;5983"@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;5984"@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;5985"@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;5986"@hf/google/gemma-7b-it": BaseAiTextGeneration;5987"@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;5988"@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;5989"@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;5990"@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;5991"@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;5992"@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;5993"@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;5994"@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;5995"@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;5996"@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;5997"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;5998"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;5999"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;6000"@cf/facebook/bart-large-cnn": BaseAiSummarization;6001"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;6002"@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;6003"@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;6004"@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B;6005"@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5;6006"@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5;6007"@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;6008"@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;6009"@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;6010"@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;6011"@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;6012"@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;6013"@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast;6014"@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;6015"@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;6016"@cf/qwen/qwen2.5-coder-32b-instruct": Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct;6017"@cf/qwen/qwq-32b": Base_Ai_Cf_Qwen_Qwq_32B;6018"@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;6019"@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;6020"@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;6021"@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;6022"@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;6023"@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;6024"@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;6025"@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;6026"@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;6027"@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;6028}6029type AiOptions = {6030/**6031* Send requests as an asynchronous batch job, only works for supported models6032* https://developers.cloudflare.com/workers-ai/features/batch-api6033*/6034queueRequest?: boolean;6035/**6036* Establish websocket connections, only works for supported models6037*/6038websocket?: boolean;6039gateway?: GatewayOptions;6040returnRawResponse?: boolean;6041prefix?: string;6042extraHeaders?: object;6043};6044type AiModelsSearchParams = {6045author?: string;6046hide_experimental?: boolean;6047page?: number;6048per_page?: number;6049search?: string;6050source?: number;6051task?: string;6052};6053type AiModelsSearchObject = {6054id: string;6055source: number;6056name: string;6057description: string;6058task: {6059id: string;6060name: string;6061description: string;6062};6063tags: string[];6064properties: {6065property_id: string;6066value: string;6067}[];6068};6069interface InferenceUpstreamError extends Error {6070}6071interface AiInternalError extends Error {6072}6073type AiModelListType = Record<string, any>;6074declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {6075aiGatewayLogId: string | null;6076gateway(gatewayId: string): AiGateway;6077autorag(autoragId: string): AutoRAG;6078run<Name extends keyof AiModelList, Options extends AiOptions, InputOptions extends AiModelList[Name]["inputs"]>(model: Name, inputs: InputOptions, options?: Options): Promise<Options extends {6079returnRawResponse: true;6080} | {6081websocket: true;6082} ? Response : InputOptions extends {6083stream: true;6084} ? ReadableStream : AiModelList[Name]["postProcessedOutputs"]>;6085models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;6086toMarkdown(): ToMarkdownService;6087toMarkdown(files: {6088name: string;6089blob: Blob;6090}[], options?: {6091gateway?: GatewayOptions;6092extraHeaders?: object;6093}): Promise<ConversionResponse[]>;6094toMarkdown(files: {6095name: string;6096blob: Blob;6097}, options?: {6098gateway?: GatewayOptions;6099extraHeaders?: object;6100}): Promise<ConversionResponse>;6101}6102type GatewayRetries = {6103maxAttempts?: 1 | 2 | 3 | 4 | 5;6104retryDelayMs?: number;6105backoff?: 'constant' | 'linear' | 'exponential';6106};6107type GatewayOptions = {6108id: string;6109cacheKey?: string;6110cacheTtl?: number;6111skipCache?: boolean;6112metadata?: Record<string, number | string | boolean | null | bigint>;6113collectLog?: boolean;6114eventId?: string;6115requestTimeoutMs?: number;6116retries?: GatewayRetries;6117};6118type UniversalGatewayOptions = Exclude<GatewayOptions, 'id'> & {6119/**6120** @deprecated6121*/6122id?: string;6123};6124type AiGatewayPatchLog = {6125score?: number | null;6126feedback?: -1 | 1 | null;6127metadata?: Record<string, number | string | boolean | null | bigint> | null;6128};6129type AiGatewayLog = {6130id: string;6131provider: string;6132model: string;6133model_type?: string;6134path: string;6135duration: number;6136request_type?: string;6137request_content_type?: string;6138status_code: number;6139response_content_type?: string;6140success: boolean;6141cached: boolean;6142tokens_in?: number;6143tokens_out?: number;6144metadata?: Record<string, number | string | boolean | null | bigint>;6145step?: number;6146cost?: number;6147custom_cost?: boolean;6148request_size: number;6149request_head?: string;6150request_head_complete: boolean;6151response_size: number;6152response_head?: string;6153response_head_complete: boolean;6154created_at: Date;6155};6156type AIGatewayProviders = 'workers-ai' | 'anthropic' | 'aws-bedrock' | 'azure-openai' | 'google-vertex-ai' | 'huggingface' | 'openai' | 'perplexity-ai' | 'replicate' | 'groq' | 'cohere' | 'google-ai-studio' | 'mistral' | 'grok' | 'openrouter' | 'deepseek' | 'cerebras' | 'cartesia' | 'elevenlabs' | 'adobe-firefly';6157type AIGatewayHeaders = {6158'cf-aig-metadata': Record<string, number | string | boolean | null | bigint> | string;6159'cf-aig-custom-cost': {6160per_token_in?: number;6161per_token_out?: number;6162} | {6163total_cost?: number;6164} | string;6165'cf-aig-cache-ttl': number | string;6166'cf-aig-skip-cache': boolean | string;6167'cf-aig-cache-key': string;6168'cf-aig-event-id': string;6169'cf-aig-request-timeout': number | string;6170'cf-aig-max-attempts': number | string;6171'cf-aig-retry-delay': number | string;6172'cf-aig-backoff': string;6173'cf-aig-collect-log': boolean | string;6174Authorization: string;6175'Content-Type': string;6176[key: string]: string | number | boolean | object;6177};6178type AIGatewayUniversalRequest = {6179provider: AIGatewayProviders | string; // eslint-disable-line6180endpoint: string;6181headers: Partial<AIGatewayHeaders>;6182query: unknown;6183};6184interface AiGatewayInternalError extends Error {6185}6186interface AiGatewayLogNotFound extends Error {6187}6188declare abstract class AiGateway {6189patchLog(logId: string, data: AiGatewayPatchLog): Promise<void>;6190getLog(logId: string): Promise<AiGatewayLog>;6191run(data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[], options?: {6192gateway?: UniversalGatewayOptions;6193extraHeaders?: object;6194}): Promise<Response>;6195getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line6196}6197interface AutoRAGInternalError extends Error {6198}6199interface AutoRAGNotFoundError extends Error {6200}6201interface AutoRAGUnauthorizedError extends Error {6202}6203interface AutoRAGNameNotSetError extends Error {6204}6205type ComparisonFilter = {6206key: string;6207type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';6208value: string | number | boolean;6209};6210type CompoundFilter = {6211type: 'and' | 'or';6212filters: ComparisonFilter[];6213};6214type AutoRagSearchRequest = {6215query: string;6216filters?: CompoundFilter | ComparisonFilter;6217max_num_results?: number;6218ranking_options?: {6219ranker?: string;6220score_threshold?: number;6221};6222rewrite_query?: boolean;6223};6224type AutoRagAiSearchRequest = AutoRagSearchRequest & {6225stream?: boolean;6226system_prompt?: string;6227};6228type AutoRagAiSearchRequestStreaming = Omit<AutoRagAiSearchRequest, 'stream'> & {6229stream: true;6230};6231type AutoRagSearchResponse = {6232object: 'vector_store.search_results.page';6233search_query: string;6234data: {6235file_id: string;6236filename: string;6237score: number;6238attributes: Record<string, string | number | boolean | null>;6239content: {6240type: 'text';6241text: string;6242}[];6243}[];6244has_more: boolean;6245next_page: string | null;6246};6247type AutoRagListResponse = {6248id: string;6249enable: boolean;6250type: string;6251source: string;6252vectorize_name: string;6253paused: boolean;6254status: string;6255}[];6256type AutoRagAiSearchResponse = AutoRagSearchResponse & {6257response: string;6258};6259declare abstract class AutoRAG {6260list(): Promise<AutoRagListResponse>;6261search(params: AutoRagSearchRequest): Promise<AutoRagSearchResponse>;6262aiSearch(params: AutoRagAiSearchRequestStreaming): Promise<Response>;6263aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse>;6264aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse | Response>;6265}6266interface BasicImageTransformations {6267/**6268* Maximum width in image pixels. The value must be an integer.6269*/6270width?: number;6271/**6272* Maximum height in image pixels. The value must be an integer.6273*/6274height?: number;6275/**6276* Resizing mode as a string. It affects interpretation of width and height6277* options:6278* - scale-down: Similar to contain, but the image is never enlarged. If6279* the image is larger than given width or height, it will be resized.6280* Otherwise its original size will be kept.6281* - contain: Resizes to maximum size that fits within the given width and6282* height. If only a single dimension is given (e.g. only width), the6283* image will be shrunk or enlarged to exactly match that dimension.6284* Aspect ratio is always preserved.6285* - cover: Resizes (shrinks or enlarges) to fill the entire area of width6286* and height. If the image has an aspect ratio different from the ratio6287* of width and height, it will be cropped to fit.6288* - crop: The image will be shrunk and cropped to fit within the area6289* specified by width and height. The image will not be enlarged. For images6290* smaller than the given dimensions it's the same as scale-down. For6291* images larger than the given dimensions, it's the same as cover.6292* See also trim.6293* - pad: Resizes to the maximum size that fits within the given width and6294* height, and then fills the remaining area with a background color6295* (white by default). Use of this mode is not recommended, as the same6296* effect can be more efficiently achieved with the contain mode and the6297* CSS object-fit: contain property.6298* - squeeze: Stretches and deforms to the width and height given, even if it6299* breaks aspect ratio6300*/6301fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";6302/**6303* Image segmentation using artificial intelligence models. Sets pixels not6304* within selected segment area to transparent e.g "foreground" sets every6305* background pixel as transparent.6306*/6307segment?: "foreground";6308/**6309* When cropping with fit: "cover", this defines the side or point that should6310* be left uncropped. The value is either a string6311* "left", "right", "top", "bottom", "auto", or "center" (the default),6312* or an object {x, y} containing focal point coordinates in the original6313* image expressed as fractions ranging from 0.0 (top or left) to 1.06314* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will6315* crop bottom or left and right sides as necessary, but won’t crop anything6316* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to6317* preserve as much as possible around a point at 20% of the height of the6318* source image.6319*/6320gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | BasicImageTransformationsGravityCoordinates;6321/**6322* Background color to add underneath the image. Applies only to images with6323* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),6324* hsl(…), etc.)6325*/6326background?: string;6327/**6328* Number of degrees (90, 180, 270) to rotate the image by. width and height6329* options refer to axes after rotation.6330*/6331rotate?: 0 | 90 | 180 | 270 | 360;6332}6333interface BasicImageTransformationsGravityCoordinates {6334x?: number;6335y?: number;6336mode?: 'remainder' | 'box-center';6337}6338/**6339* In addition to the properties you can set in the RequestInit dict6340* that you pass as an argument to the Request constructor, you can6341* set certain properties of a `cf` object to control how Cloudflare6342* features are applied to that new Request.6343*6344* Note: Currently, these properties cannot be tested in the6345* playground.6346*/6347interface RequestInitCfProperties extends Record<string, unknown> {6348cacheEverything?: boolean;6349/**6350* A request's cache key is what determines if two requests are6351* "the same" for caching purposes. If a request has the same cache key6352* as some previous request, then we can serve the same cached response for6353* both. (e.g. 'some-key')6354*6355* Only available for Enterprise customers.6356*/6357cacheKey?: string;6358/**6359* This allows you to append additional Cache-Tag response headers6360* to the origin response without modifications to the origin server.6361* This will allow for greater control over the Purge by Cache Tag feature6362* utilizing changes only in the Workers process.6363*6364* Only available for Enterprise customers.6365*/6366cacheTags?: string[];6367/**6368* Force response to be cached for a given number of seconds. (e.g. 300)6369*/6370cacheTtl?: number;6371/**6372* Force response to be cached for a given number of seconds based on the Origin status code.6373* (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })6374*/6375cacheTtlByStatus?: Record<string, number>;6376scrapeShield?: boolean;6377apps?: boolean;6378image?: RequestInitCfPropertiesImage;6379minify?: RequestInitCfPropertiesImageMinify;6380mirage?: boolean;6381polish?: "lossy" | "lossless" | "off";6382r2?: RequestInitCfPropertiesR2;6383/**6384* Redirects the request to an alternate origin server. You can use this,6385* for example, to implement load balancing across several origins.6386* (e.g.us-east.example.com)6387*6388* Note - For security reasons, the hostname set in resolveOverride must6389* be proxied on the same Cloudflare zone of the incoming request.6390* Otherwise, the setting is ignored. CNAME hosts are allowed, so to6391* resolve to a host under a different domain or a DNS only domain first6392* declare a CNAME record within your own zone’s DNS mapping to the6393* external hostname, set proxy on Cloudflare, then set resolveOverride6394* to point to that CNAME record.6395*/6396resolveOverride?: string;6397}6398interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {6399/**6400* Absolute URL of the image file to use for the drawing. It can be any of6401* the supported file formats. For drawing of watermarks or non-rectangular6402* overlays we recommend using PNG or WebP images.6403*/6404url: string;6405/**6406* Floating-point number between 0 (transparent) and 1 (opaque).6407* For example, opacity: 0.5 makes overlay semitransparent.6408*/6409opacity?: number;6410/**6411* - If set to true, the overlay image will be tiled to cover the entire6412* area. This is useful for stock-photo-like watermarks.6413* - If set to "x", the overlay image will be tiled horizontally only6414* (form a line).6415* - If set to "y", the overlay image will be tiled vertically only6416* (form a line).6417*/6418repeat?: true | "x" | "y";6419/**6420* Position of the overlay image relative to a given edge. Each property is6421* an offset in pixels. 0 aligns exactly to the edge. For example, left: 106422* positions left side of the overlay 10 pixels from the left edge of the6423* image it's drawn over. bottom: 0 aligns bottom of the overlay with bottom6424* of the background image.6425*6426* Setting both left & right, or both top & bottom is an error.6427*6428* If no position is specified, the image will be centered.6429*/6430top?: number;6431left?: number;6432bottom?: number;6433right?: number;6434}6435interface RequestInitCfPropertiesImage extends BasicImageTransformations {6436/**6437* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it6438* easier to specify higher-DPI sizes in <img srcset>.6439*/6440dpr?: number;6441/**6442* Allows you to trim your image. Takes dpr into account and is performed before6443* resizing or rotation.6444*6445* It can be used as:6446* - left, top, right, bottom - it will specify the number of pixels to cut6447* off each side6448* - width, height - the width/height you'd like to end up with - can be used6449* in combination with the properties above6450* - border - this will automatically trim the surroundings of an image based on6451* it's color. It consists of three properties:6452* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)6453* - tolerance: difference from color to treat as color6454* - keep: the number of pixels of border to keep6455*/6456trim?: "border" | {6457top?: number;6458bottom?: number;6459left?: number;6460right?: number;6461width?: number;6462height?: number;6463border?: boolean | {6464color?: string;6465tolerance?: number;6466keep?: number;6467};6468};6469/**6470* Quality setting from 1-100 (useful values are in 60-90 range). Lower values6471* make images look worse, but load faster. The default is 85. It applies only6472* to JPEG and WebP images. It doesn’t have any effect on PNG.6473*/6474quality?: number | "low" | "medium-low" | "medium-high" | "high";6475/**6476* Output format to generate. It can be:6477* - avif: generate images in AVIF format.6478* - webp: generate images in Google WebP format. Set quality to 100 to get6479* the WebP-lossless format.6480* - json: instead of generating an image, outputs information about the6481* image, in JSON format. The JSON object will contain image size6482* (before and after resizing), source image’s MIME type, file size, etc.6483* - jpeg: generate images in JPEG format.6484* - png: generate images in PNG format.6485*/6486format?: "avif" | "webp" | "json" | "jpeg" | "png" | "baseline-jpeg" | "png-force" | "svg";6487/**6488* Whether to preserve animation frames from input files. Default is true.6489* Setting it to false reduces animations to still images. This setting is6490* recommended when enlarging images or processing arbitrary user content,6491* because large GIF animations can weigh tens or even hundreds of megabytes.6492* It is also useful to set anim:false when using format:"json" to get the6493* response quicker without the number of frames.6494*/6495anim?: boolean;6496/**6497* What EXIF data should be preserved in the output image. Note that EXIF6498* rotation and embedded color profiles are always applied ("baked in" into6499* the image), and aren't affected by this option. Note that if the Polish6500* feature is enabled, all metadata may have been removed already and this6501* option may have no effect.6502* - keep: Preserve most of EXIF metadata, including GPS location if there's6503* any.6504* - copyright: Only keep the copyright tag, and discard everything else.6505* This is the default behavior for JPEG files.6506* - none: Discard all invisible EXIF metadata. Currently WebP and PNG6507* output formats always discard metadata.6508*/6509metadata?: "keep" | "copyright" | "none";6510/**6511* Strength of sharpening filter to apply to the image. Floating-point6512* number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a6513* recommended value for downscaled images.6514*/6515sharpen?: number;6516/**6517* Radius of a blur filter (approximate gaussian). Maximum supported radius6518* is 250.6519*/6520blur?: number;6521/**6522* Overlays are drawn in the order they appear in the array (last array6523* entry is the topmost layer).6524*/6525draw?: RequestInitCfPropertiesImageDraw[];6526/**6527* Fetching image from authenticated origin. Setting this property will6528* pass authentication headers (Authorization, Cookie, etc.) through to6529* the origin.6530*/6531"origin-auth"?: "share-publicly";6532/**6533* Adds a border around the image. The border is added after resizing. Border6534* width takes dpr into account, and can be specified either using a single6535* width property, or individually for each side.6536*/6537border?: {6538color: string;6539width: number;6540} | {6541color: string;6542top: number;6543right: number;6544bottom: number;6545left: number;6546};6547/**6548* Increase brightness by a factor. A value of 1.0 equals no change, a value6549* of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.6550* 0 is ignored.6551*/6552brightness?: number;6553/**6554* Increase contrast by a factor. A value of 1.0 equals no change, a value of6555* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is6556* ignored.6557*/6558contrast?: number;6559/**6560* Increase exposure by a factor. A value of 1.0 equals no change, a value of6561* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.6562*/6563gamma?: number;6564/**6565* Increase contrast by a factor. A value of 1.0 equals no change, a value of6566* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is6567* ignored.6568*/6569saturation?: number;6570/**6571* Flips the images horizontally, vertically, or both. Flipping is applied before6572* rotation, so if you apply flip=h,rotate=90 then the image will be flipped6573* horizontally, then rotated by 90 degrees.6574*/6575flip?: 'h' | 'v' | 'hv';6576/**6577* Slightly reduces latency on a cache miss by selecting a6578* quickest-to-compress file format, at a cost of increased file size and6579* lower image quality. It will usually override the format option and choose6580* JPEG over WebP or AVIF. We do not recommend using this option, except in6581* unusual circumstances like resizing uncacheable dynamically-generated6582* images.6583*/6584compression?: "fast";6585}6586interface RequestInitCfPropertiesImageMinify {6587javascript?: boolean;6588css?: boolean;6589html?: boolean;6590}6591interface RequestInitCfPropertiesR2 {6592/**6593* Colo id of bucket that an object is stored in6594*/6595bucketColoId?: number;6596}6597/**6598* Request metadata provided by Cloudflare's edge.6599*/6600type IncomingRequestCfProperties<HostMetadata = unknown> = IncomingRequestCfPropertiesBase & IncomingRequestCfPropertiesBotManagementEnterprise & IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> & IncomingRequestCfPropertiesGeographicInformation & IncomingRequestCfPropertiesCloudflareAccessOrApiShield;6601interface IncomingRequestCfPropertiesBase extends Record<string, unknown> {6602/**6603* [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request.6604*6605* @example 3957476606*/6607asn?: number;6608/**6609* The organization which owns the ASN of the incoming request.6610*6611* @example "Google Cloud"6612*/6613asOrganization?: string;6614/**6615* The original value of the `Accept-Encoding` header if Cloudflare modified it.6616*6617* @example "gzip, deflate, br"6618*/6619clientAcceptEncoding?: string;6620/**6621* The number of milliseconds it took for the request to reach your worker.6622*6623* @example 226624*/6625clientTcpRtt?: number;6626/**6627* The three-letter [IATA](https://en.wikipedia.org/wiki/IATA_airport_code)6628* airport code of the data center that the request hit.6629*6630* @example "DFW"6631*/6632colo: string;6633/**6634* Represents the upstream's response to a6635* [TCP `keepalive` message](https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)6636* from cloudflare.6637*6638* For workers with no upstream, this will always be `1`.6639*6640* @example 36641*/6642edgeRequestKeepAliveStatus: IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus;6643/**6644* The HTTP Protocol the request used.6645*6646* @example "HTTP/2"6647*/6648httpProtocol: string;6649/**6650* The browser-requested prioritization information in the request object.6651*6652* If no information was set, defaults to the empty string `""`6653*6654* @example "weight=192;exclusive=0;group=3;group-weight=127"6655* @default ""6656*/6657requestPriority: string;6658/**6659* The TLS version of the connection to Cloudflare.6660* In requests served over plaintext (without TLS), this property is the empty string `""`.6661*6662* @example "TLSv1.3"6663*/6664tlsVersion: string;6665/**6666* The cipher for the connection to Cloudflare.6667* In requests served over plaintext (without TLS), this property is the empty string `""`.6668*6669* @example "AEAD-AES128-GCM-SHA256"6670*/6671tlsCipher: string;6672/**6673* Metadata containing the [`HELLO`](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2) and [`FINISHED`](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9) messages from this request's TLS handshake.6674*6675* If the incoming request was served over plaintext (without TLS) this field is undefined.6676*/6677tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata;6678}6679interface IncomingRequestCfPropertiesBotManagementBase {6680/**6681* Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot,6682* represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human).6683*6684* @example 546685*/6686score: number;6687/**6688* A boolean value that is true if the request comes from a good bot, like Google or Bing.6689* Most customers choose to allow this traffic. For more details, see [Traffic from known bots](https://developers.cloudflare.com/firewall/known-issues-and-faq/#how-does-firewall-rules-handle-traffic-from-known-bots).6690*/6691verifiedBot: boolean;6692/**6693* A boolean value that is true if the request originates from a6694* Cloudflare-verified proxy service.6695*/6696corporateProxy: boolean;6697/**6698* A boolean value that's true if the request matches [file extensions](https://developers.cloudflare.com/bots/reference/static-resources/) for many types of static resources.6699*/6700staticResource: boolean;6701/**6702* List of IDs that correlate to the Bot Management heuristic detections made on a request (you can have multiple heuristic detections on the same request).6703*/6704detectionIds: number[];6705}6706interface IncomingRequestCfPropertiesBotManagement {6707/**6708* Results of Cloudflare's Bot Management analysis6709*/6710botManagement: IncomingRequestCfPropertiesBotManagementBase;6711/**6712* Duplicate of `botManagement.score`.6713*6714* @deprecated6715*/6716clientTrustScore: number;6717}6718interface IncomingRequestCfPropertiesBotManagementEnterprise extends IncomingRequestCfPropertiesBotManagement {6719/**6720* Results of Cloudflare's Bot Management analysis6721*/6722botManagement: IncomingRequestCfPropertiesBotManagementBase & {6723/**6724* A [JA3 Fingerprint](https://developers.cloudflare.com/bots/concepts/ja3-fingerprint/) to help profile specific SSL/TLS clients6725* across different destination IPs, Ports, and X509 certificates.6726*/6727ja3Hash: string;6728};6729}6730interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> {6731/**6732* Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).6733*6734* This field is only present if you have Cloudflare for SaaS enabled on your account6735* and you have followed the [required steps to enable it]((https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/)).6736*/6737hostMetadata?: HostMetadata;6738}6739interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {6740/**6741* Information about the client certificate presented to Cloudflare.6742*6743* This is populated when the incoming request is served over TLS using6744* either Cloudflare Access or API Shield (mTLS)6745* and the presented SSL certificate has a valid6746* [Certificate Serial Number](https://ldapwiki.com/wiki/Certificate%20Serial%20Number)6747* (i.e., not `null` or `""`).6748*6749* Otherwise, a set of placeholder values are used.6750*6751* The property `certPresented` will be set to `"1"` when6752* the object is populated (i.e. the above conditions were met).6753*/6754tlsClientAuth: IncomingRequestCfPropertiesTLSClientAuth | IncomingRequestCfPropertiesTLSClientAuthPlaceholder;6755}6756/**6757* Metadata about the request's TLS handshake6758*/6759interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {6760/**6761* The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal6762*6763* @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d"6764*/6765clientHandshake: string;6766/**6767* The server's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal6768*6769* @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d"6770*/6771serverHandshake: string;6772/**6773* The client's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal6774*6775* @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b"6776*/6777clientFinished: string;6778/**6779* The server's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal6780*6781* @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b"6782*/6783serverFinished: string;6784}6785/**6786* Geographic data about the request's origin.6787*/6788interface IncomingRequestCfPropertiesGeographicInformation {6789/**6790* The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.6791*6792* If your worker is [configured to accept TOR connections](https://support.cloudflare.com/hc/en-us/articles/203306930-Understanding-Cloudflare-Tor-support-and-Onion-Routing), this may also be `"T1"`, indicating a request that originated over TOR.6793*6794* If Cloudflare is unable to determine where the request originated this property is omitted.6795*6796* The country code `"T1"` is used for requests originating on TOR.6797*6798* @example "GB"6799*/6800country?: Iso3166Alpha2Code | "T1";6801/**6802* If present, this property indicates that the request originated in the EU6803*6804* @example "1"6805*/6806isEUCountry?: "1";6807/**6808* A two-letter code indicating the continent the request originated from.6809*6810* @example "AN"6811*/6812continent?: ContinentCode;6813/**6814* The city the request originated from6815*6816* @example "Austin"6817*/6818city?: string;6819/**6820* Postal code of the incoming request6821*6822* @example "78701"6823*/6824postalCode?: string;6825/**6826* Latitude of the incoming request6827*6828* @example "30.27130"6829*/6830latitude?: string;6831/**6832* Longitude of the incoming request6833*6834* @example "-97.74260"6835*/6836longitude?: string;6837/**6838* Timezone of the incoming request6839*6840* @example "America/Chicago"6841*/6842timezone?: string;6843/**6844* If known, the ISO 3166-2 name for the first level region associated with6845* the IP address of the incoming request6846*6847* @example "Texas"6848*/6849region?: string;6850/**6851* If known, the ISO 3166-2 code for the first-level region associated with6852* the IP address of the incoming request6853*6854* @example "TX"6855*/6856regionCode?: string;6857/**6858* Metro code (DMA) of the incoming request6859*6860* @example "635"6861*/6862metroCode?: string;6863}6864/** Data about the incoming request's TLS certificate */6865interface IncomingRequestCfPropertiesTLSClientAuth {6866/** Always `"1"`, indicating that the certificate was presented */6867certPresented: "1";6868/**6869* Result of certificate verification.6870*6871* @example "FAILED:self signed certificate"6872*/6873certVerified: Exclude<CertVerificationStatus, "NONE">;6874/** The presented certificate's revokation status.6875*6876* - A value of `"1"` indicates the certificate has been revoked6877* - A value of `"0"` indicates the certificate has not been revoked6878*/6879certRevoked: "1" | "0";6880/**6881* The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html)6882*6883* @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"6884*/6885certIssuerDN: string;6886/**6887* The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html)6888*6889* @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"6890*/6891certSubjectDN: string;6892/**6893* The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted)6894*6895* @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"6896*/6897certIssuerDNRFC2253: string;6898/**6899* The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted)6900*6901* @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"6902*/6903certSubjectDNRFC2253: string;6904/** The certificate issuer's distinguished name (legacy policies) */6905certIssuerDNLegacy: string;6906/** The certificate subject's distinguished name (legacy policies) */6907certSubjectDNLegacy: string;6908/**6909* The certificate's serial number6910*6911* @example "00936EACBE07F201DF"6912*/6913certSerial: string;6914/**6915* The certificate issuer's serial number6916*6917* @example "2489002934BDFEA34"6918*/6919certIssuerSerial: string;6920/**6921* The certificate's Subject Key Identifier6922*6923* @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4"6924*/6925certSKI: string;6926/**6927* The certificate issuer's Subject Key Identifier6928*6929* @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4"6930*/6931certIssuerSKI: string;6932/**6933* The certificate's SHA-1 fingerprint6934*6935* @example "6b9109f323999e52259cda7373ff0b4d26bd232e"6936*/6937certFingerprintSHA1: string;6938/**6939* The certificate's SHA-256 fingerprint6940*6941* @example "acf77cf37b4156a2708e34c4eb755f9b5dbbe5ebb55adfec8f11493438d19e6ad3f157f81fa3b98278453d5652b0c1fd1d71e5695ae4d709803a4d3f39de9dea"6942*/6943certFingerprintSHA256: string;6944/**6945* The effective starting date of the certificate6946*6947* @example "Dec 22 19:39:00 2018 GMT"6948*/6949certNotBefore: string;6950/**6951* The effective expiration date of the certificate6952*6953* @example "Dec 22 19:39:00 2018 GMT"6954*/6955certNotAfter: string;6956}6957/** Placeholder values for TLS Client Authorization */6958interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {6959certPresented: "0";6960certVerified: "NONE";6961certRevoked: "0";6962certIssuerDN: "";6963certSubjectDN: "";6964certIssuerDNRFC2253: "";6965certSubjectDNRFC2253: "";6966certIssuerDNLegacy: "";6967certSubjectDNLegacy: "";6968certSerial: "";6969certIssuerSerial: "";6970certSKI: "";6971certIssuerSKI: "";6972certFingerprintSHA1: "";6973certFingerprintSHA256: "";6974certNotBefore: "";6975certNotAfter: "";6976}6977/** Possible outcomes of TLS verification */6978declare type CertVerificationStatus =6979/** Authentication succeeded */6980"SUCCESS"6981/** No certificate was presented */6982| "NONE"6983/** Failed because the certificate was self-signed */6984| "FAILED:self signed certificate"6985/** Failed because the certificate failed a trust chain check */6986| "FAILED:unable to verify the first certificate"6987/** Failed because the certificate not yet valid */6988| "FAILED:certificate is not yet valid"6989/** Failed because the certificate is expired */6990| "FAILED:certificate has expired"6991/** Failed for another unspecified reason */6992| "FAILED";6993/**6994* An upstream endpoint's response to a TCP `keepalive` message from Cloudflare.6995*/6996declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus = 0 /** Unknown */ | 1 /** no keepalives (not found) */ | 2 /** no connection re-use, opening keepalive connection failed */ | 3 /** no connection re-use, keepalive accepted and saved */ | 4 /** connection re-use, refused by the origin server (`TCP FIN`) */ | 5; /** connection re-use, accepted by the origin server */6997/** ISO 3166-1 Alpha-2 codes */6998declare type Iso3166Alpha2Code = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";6999/** The 2-letter continent codes Cloudflare uses */7000declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";7001type CfProperties<HostMetadata = unknown> = IncomingRequestCfProperties<HostMetadata> | RequestInitCfProperties;7002interface D1Meta {7003duration: number;7004size_after: number;7005rows_read: number;7006rows_written: number;7007last_row_id: number;7008changed_db: boolean;7009changes: number;7010/**7011* The region of the database instance that executed the query.7012*/7013served_by_region?: string;7014/**7015* True if-and-only-if the database instance that executed the query was the primary.7016*/7017served_by_primary?: boolean;7018timings?: {7019/**7020* The duration of the SQL query execution by the database instance. It doesn't include any network time.7021*/7022sql_duration_ms: number;7023};7024/**7025* Number of total attempts to execute the query, due to automatic retries.7026* Note: All other fields in the response like `timings` only apply to the last attempt.7027*/7028total_attempts?: number;7029}7030interface D1Response {7031success: true;7032meta: D1Meta & Record<string, unknown>;7033error?: never;7034}7035type D1Result<T = unknown> = D1Response & {7036results: T[];7037};7038interface D1ExecResult {7039count: number;7040duration: number;7041}7042type D1SessionConstraint =7043// Indicates that the first query should go to the primary, and the rest queries7044// using the same D1DatabaseSession will go to any replica that is consistent with7045// the bookmark maintained by the session (returned by the first query).7046'first-primary'7047// Indicates that the first query can go anywhere (primary or replica), and the rest queries7048// using the same D1DatabaseSession will go to any replica that is consistent with7049// the bookmark maintained by the session (returned by the first query).7050| 'first-unconstrained';7051type D1SessionBookmark = string;7052declare abstract class D1Database {7053prepare(query: string): D1PreparedStatement;7054batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;7055exec(query: string): Promise<D1ExecResult>;7056/**7057* Creates a new D1 Session anchored at the given constraint or the bookmark.7058* All queries executed using the created session will have sequential consistency,7059* meaning that all writes done through the session will be visible in subsequent reads.7060*7061* @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.7062*/7063withSession(constraintOrBookmark?: D1SessionBookmark | D1SessionConstraint): D1DatabaseSession;7064/**7065* @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.7066*/7067dump(): Promise<ArrayBuffer>;7068}7069declare abstract class D1DatabaseSession {7070prepare(query: string): D1PreparedStatement;7071batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;7072/**7073* @returns The latest session bookmark across all executed queries on the session.7074* If no query has been executed yet, `null` is returned.7075*/7076getBookmark(): D1SessionBookmark | null;7077}7078declare abstract class D1PreparedStatement {7079bind(...values: unknown[]): D1PreparedStatement;7080first<T = unknown>(colName: string): Promise<T | null>;7081first<T = Record<string, unknown>>(): Promise<T | null>;7082run<T = Record<string, unknown>>(): Promise<D1Result<T>>;7083all<T = Record<string, unknown>>(): Promise<D1Result<T>>;7084raw<T = unknown[]>(options: {7085columnNames: true;7086}): Promise<[7087string[],7088...T[]7089]>;7090raw<T = unknown[]>(options?: {7091columnNames?: false;7092}): Promise<T[]>;7093}7094// `Disposable` was added to TypeScript's standard lib types in version 5.2.7095// To support older TypeScript versions, define an empty `Disposable` interface.7096// Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,7097// but this will ensure type checking on older versions still passes.7098// TypeScript's interface merging will ensure our empty interface is effectively7099// ignored when `Disposable` is included in the standard lib.7100interface Disposable {7101}7102/**7103* An email message that can be sent from a Worker.7104*/7105interface EmailMessage {7106/**7107* Envelope From attribute of the email message.7108*/7109readonly from: string;7110/**7111* Envelope To attribute of the email message.7112*/7113readonly to: string;7114}7115/**7116* An email message that is sent to a consumer Worker and can be rejected/forwarded.7117*/7118interface ForwardableEmailMessage extends EmailMessage {7119/**7120* Stream of the email message content.7121*/7122readonly raw: ReadableStream<Uint8Array>;7123/**7124* An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).7125*/7126readonly headers: Headers;7127/**7128* Size of the email message content.7129*/7130readonly rawSize: number;7131/**7132* Reject this email message by returning a permanent SMTP error back to the connecting client including the given reason.7133* @param reason The reject reason.7134* @returns void7135*/7136setReject(reason: string): void;7137/**7138* Forward this email message to a verified destination address of the account.7139* @param rcptTo Verified destination address.7140* @param headers A [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).7141* @returns A promise that resolves when the email message is forwarded.7142*/7143forward(rcptTo: string, headers?: Headers): Promise<void>;7144/**7145* Reply to the sender of this email message with a new EmailMessage object.7146* @param message The reply message.7147* @returns A promise that resolves when the email message is replied.7148*/7149reply(message: EmailMessage): Promise<void>;7150}7151/**7152* A binding that allows a Worker to send email messages.7153*/7154interface SendEmail {7155send(message: EmailMessage): Promise<void>;7156}7157declare abstract class EmailEvent extends ExtendableEvent {7158readonly message: ForwardableEmailMessage;7159}7160declare type EmailExportedHandler<Env = unknown> = (message: ForwardableEmailMessage, env: Env, ctx: ExecutionContext) => void | Promise<void>;7161declare module "cloudflare:email" {7162let _EmailMessage: {7163prototype: EmailMessage;7164new (from: string, to: string, raw: ReadableStream | string): EmailMessage;7165};7166export { _EmailMessage as EmailMessage };7167}7168/**7169* Hello World binding to serve as an explanatory example. DO NOT USE7170*/7171interface HelloWorldBinding {7172/**7173* Retrieve the current stored value7174*/7175get(): Promise<{7176value: string;7177ms?: number;7178}>;7179/**7180* Set a new stored value7181*/7182set(value: string): Promise<void>;7183}7184interface Hyperdrive {7185/**7186* Connect directly to Hyperdrive as if it's your database, returning a TCP socket.7187*7188* Calling this method returns an idential socket to if you call7189* `connect("host:port")` using the `host` and `port` fields from this object.7190* Pick whichever approach works better with your preferred DB client library.7191*7192* Note that this socket is not yet authenticated -- it's expected that your7193* code (or preferably, the client library of your choice) will authenticate7194* using the information in this class's readonly fields.7195*/7196connect(): Socket;7197/**7198* A valid DB connection string that can be passed straight into the typical7199* client library/driver/ORM. This will typically be the easiest way to use7200* Hyperdrive.7201*/7202readonly connectionString: string;7203/*7204* A randomly generated hostname that is only valid within the context of the7205* currently running Worker which, when passed into `connect()` function from7206* the "cloudflare:sockets" module, will connect to the Hyperdrive instance7207* for your database.7208*/7209readonly host: string;7210/*7211* The port that must be paired the the host field when connecting.7212*/7213readonly port: number;7214/*7215* The username to use when authenticating to your database via Hyperdrive.7216* Unlike the host and password, this will be the same every time7217*/7218readonly user: string;7219/*7220* The randomly generated password to use when authenticating to your7221* database via Hyperdrive. Like the host field, this password is only valid7222* within the context of the currently running Worker instance from which7223* it's read.7224*/7225readonly password: string;7226/*7227* The name of the database to connect to.7228*/7229readonly database: string;7230}7231// Copyright (c) 2024 Cloudflare, Inc.7232// Licensed under the Apache 2.0 license found in the LICENSE file or at:7233// https://opensource.org/licenses/Apache-2.07234type ImageInfoResponse = {7235format: 'image/svg+xml';7236} | {7237format: string;7238fileSize: number;7239width: number;7240height: number;7241};7242type ImageTransform = {7243width?: number;7244height?: number;7245background?: string;7246blur?: number;7247border?: {7248color?: string;7249width?: number;7250} | {7251top?: number;7252bottom?: number;7253left?: number;7254right?: number;7255};7256brightness?: number;7257contrast?: number;7258fit?: 'scale-down' | 'contain' | 'pad' | 'squeeze' | 'cover' | 'crop';7259flip?: 'h' | 'v' | 'hv';7260gamma?: number;7261segment?: 'foreground';7262gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | {7263x?: number;7264y?: number;7265mode: 'remainder' | 'box-center';7266};7267rotate?: 0 | 90 | 180 | 270;7268saturation?: number;7269sharpen?: number;7270trim?: 'border' | {7271top?: number;7272bottom?: number;7273left?: number;7274right?: number;7275width?: number;7276height?: number;7277border?: boolean | {7278color?: string;7279tolerance?: number;7280keep?: number;7281};7282};7283};7284type ImageDrawOptions = {7285opacity?: number;7286repeat?: boolean | string;7287top?: number;7288left?: number;7289bottom?: number;7290right?: number;7291};7292type ImageInputOptions = {7293encoding?: 'base64';7294};7295type ImageOutputOptions = {7296format: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/avif' | 'rgb' | 'rgba';7297quality?: number;7298background?: string;7299anim?: boolean;7300};7301interface ImagesBinding {7302/**7303* Get image metadata (type, width and height)7304* @throws {@link ImagesError} with code 9412 if input is not an image7305* @param stream The image bytes7306*/7307info(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): Promise<ImageInfoResponse>;7308/**7309* Begin applying a series of transformations to an image7310* @param stream The image bytes7311* @returns A transform handle7312*/7313input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;7314}7315interface ImageTransformer {7316/**7317* Apply transform next, returning a transform handle.7318* You can then apply more transformations, draw, or retrieve the output.7319* @param transform7320*/7321transform(transform: ImageTransform): ImageTransformer;7322/**7323* Draw an image on this transformer, returning a transform handle.7324* You can then apply more transformations, draw, or retrieve the output.7325* @param image The image (or transformer that will give the image) to draw7326* @param options The options configuring how to draw the image7327*/7328draw(image: ReadableStream<Uint8Array> | ImageTransformer, options?: ImageDrawOptions): ImageTransformer;7329/**7330* Retrieve the image that results from applying the transforms to the7331* provided input7332* @param options Options that apply to the output e.g. output format7333*/7334output(options: ImageOutputOptions): Promise<ImageTransformationResult>;7335}7336type ImageTransformationOutputOptions = {7337encoding?: 'base64';7338};7339interface ImageTransformationResult {7340/**7341* The image as a response, ready to store in cache or return to users7342*/7343response(): Response;7344/**7345* The content type of the returned image7346*/7347contentType(): string;7348/**7349* The bytes of the response7350*/7351image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array>;7352}7353interface ImagesError extends Error {7354readonly code: number;7355readonly message: string;7356readonly stack?: string;7357}7358/**7359* Media binding for transforming media streams.7360* Provides the entry point for media transformation operations.7361*/7362interface MediaBinding {7363/**7364* Creates a media transformer from an input stream.7365* @param media - The input media bytes7366* @returns A MediaTransformer instance for applying transformations7367*/7368input(media: ReadableStream<Uint8Array>): MediaTransformer;7369}7370/**7371* Media transformer for applying transformation operations to media content.7372* Handles sizing, fitting, and other input transformation parameters.7373*/7374interface MediaTransformer {7375/**7376* Applies transformation options to the media content.7377* @param transform - Configuration for how the media should be transformed7378* @returns A generator for producing the transformed media output7379*/7380transform(transform: MediaTransformationInputOptions): MediaTransformationGenerator;7381}7382/**7383* Generator for producing media transformation results.7384* Configures the output format and parameters for the transformed media.7385*/7386interface MediaTransformationGenerator {7387/**7388* Generates the final media output with specified options.7389* @param output - Configuration for the output format and parameters7390* @returns The final transformation result containing the transformed media7391*/7392output(output: MediaTransformationOutputOptions): MediaTransformationResult;7393}7394/**7395* Result of a media transformation operation.7396* Provides multiple ways to access the transformed media content.7397*/7398interface MediaTransformationResult {7399/**7400* Returns the transformed media as a readable stream of bytes.7401* @returns A stream containing the transformed media data7402*/7403media(): ReadableStream<Uint8Array>;7404/**7405* Returns the transformed media as an HTTP response object.7406* @returns The transformed media as a Response, ready to store in cache or return to users7407*/7408response(): Response;7409/**7410* Returns the MIME type of the transformed media.7411* @returns The content type string (e.g., 'image/jpeg', 'video/mp4')7412*/7413contentType(): string;7414}7415/**7416* Configuration options for transforming media input.7417* Controls how the media should be resized and fitted.7418*/7419type MediaTransformationInputOptions = {7420/** How the media should be resized to fit the specified dimensions */7421fit?: 'contain' | 'cover' | 'scale-down';7422/** Target width in pixels */7423width?: number;7424/** Target height in pixels */7425height?: number;7426};7427/**7428* Configuration options for Media Transformations output.7429* Controls the format, timing, and type of the generated output.7430*/7431type MediaTransformationOutputOptions = {7432/**7433* Output mode determining the type of media to generate7434*/7435mode?: 'video' | 'spritesheet' | 'frame' | 'audio';7436/** Whether to include audio in the output */7437audio?: boolean;7438/**7439* Starting timestamp for frame extraction or start time for clips. (e.g. '2s').7440*/7441time?: string;7442/**7443* Duration for video clips, audio extraction, and spritesheet generation (e.g. '5s').7444*/7445duration?: string;7446/**7447* Number of frames in the spritesheet.7448*/7449imageCount?: number;7450/**7451* Output format for the generated media.7452*/7453format?: 'jpg' | 'png' | 'm4a';7454};7455/**7456* Error object for media transformation operations.7457* Extends the standard Error interface with additional media-specific information.7458*/7459interface MediaError extends Error {7460readonly code: number;7461readonly message: string;7462readonly stack?: string;7463}7464declare module 'cloudflare:node' {7465interface NodeStyleServer {7466listen(...args: unknown[]): this;7467address(): {7468port?: number | null | undefined;7469};7470}7471export function httpServerHandler(port: number): ExportedHandler;7472export function httpServerHandler(options: {7473port: number;7474}): ExportedHandler;7475export function httpServerHandler(server: NodeStyleServer): ExportedHandler;7476}7477type Params<P extends string = any> = Record<P, string | string[]>;7478type EventContext<Env, P extends string, Data> = {7479request: Request<unknown, IncomingRequestCfProperties<unknown>>;7480functionPath: string;7481waitUntil: (promise: Promise<any>) => void;7482passThroughOnException: () => void;7483next: (input?: Request | string, init?: RequestInit) => Promise<Response>;7484env: Env & {7485ASSETS: {7486fetch: typeof fetch;7487};7488};7489params: Params<P>;7490data: Data;7491};7492type PagesFunction<Env = unknown, Params extends string = any, Data extends Record<string, unknown> = Record<string, unknown>> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;7493type EventPluginContext<Env, P extends string, Data, PluginArgs> = {7494request: Request<unknown, IncomingRequestCfProperties<unknown>>;7495functionPath: string;7496waitUntil: (promise: Promise<any>) => void;7497passThroughOnException: () => void;7498next: (input?: Request | string, init?: RequestInit) => Promise<Response>;7499env: Env & {7500ASSETS: {7501fetch: typeof fetch;7502};7503};7504params: Params<P>;7505data: Data;7506pluginArgs: PluginArgs;7507};7508type PagesPluginFunction<Env = unknown, Params extends string = any, Data extends Record<string, unknown> = Record<string, unknown>, PluginArgs = unknown> = (context: EventPluginContext<Env, Params, Data, PluginArgs>) => Response | Promise<Response>;7509declare module "assets:*" {7510export const onRequest: PagesFunction;7511}7512// Copyright (c) 2022-2023 Cloudflare, Inc.7513// Licensed under the Apache 2.0 license found in the LICENSE file or at:7514// https://opensource.org/licenses/Apache-2.07515declare module "cloudflare:pipelines" {7516export abstract class PipelineTransformationEntrypoint<Env = unknown, I extends PipelineRecord = PipelineRecord, O extends PipelineRecord = PipelineRecord> {7517protected env: Env;7518protected ctx: ExecutionContext;7519constructor(ctx: ExecutionContext, env: Env);7520/**7521* run recieves an array of PipelineRecord which can be7522* transformed and returned to the pipeline7523* @param records Incoming records from the pipeline to be transformed7524* @param metadata Information about the specific pipeline calling the transformation entrypoint7525* @returns A promise containing the transformed PipelineRecord array7526*/7527public run(records: I[], metadata: PipelineBatchMetadata): Promise<O[]>;7528}7529export type PipelineRecord = Record<string, unknown>;7530export type PipelineBatchMetadata = {7531pipelineId: string;7532pipelineName: string;7533};7534export interface Pipeline<T extends PipelineRecord = PipelineRecord> {7535/**7536* The Pipeline interface represents the type of a binding to a Pipeline7537*7538* @param records The records to send to the pipeline7539*/7540send(records: T[]): Promise<void>;7541}7542}7543// PubSubMessage represents an incoming PubSub message.7544// The message includes metadata about the broker, the client, and the payload7545// itself.7546// https://developers.cloudflare.com/pub-sub/7547interface PubSubMessage {7548// Message ID7549readonly mid: number;7550// MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT7551readonly broker: string;7552// The MQTT topic the message was sent on.7553readonly topic: string;7554// The client ID of the client that published this message.7555readonly clientId: string;7556// The unique identifier (JWT ID) used by the client to authenticate, if token7557// auth was used.7558readonly jti?: string;7559// A Unix timestamp (seconds from Jan 1, 1970), set when the Pub/Sub Broker7560// received the message from the client.7561readonly receivedAt: number;7562// An (optional) string with the MIME type of the payload, if set by the7563// client.7564readonly contentType: string;7565// Set to 1 when the payload is a UTF-8 string7566// https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc39010637567readonly payloadFormatIndicator: number;7568// Pub/Sub (MQTT) payloads can be UTF-8 strings, or byte arrays.7569// You can use payloadFormatIndicator to inspect this before decoding.7570payload: string | Uint8Array;7571}7572// JsonWebKey extended by kid parameter7573interface JsonWebKeyWithKid extends JsonWebKey {7574// Key Identifier of the JWK7575readonly kid: string;7576}7577interface RateLimitOptions {7578key: string;7579}7580interface RateLimitOutcome {7581success: boolean;7582}7583interface RateLimit {7584/**7585* Rate limit a request based on the provided options.7586* @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/7587* @returns A promise that resolves with the outcome of the rate limit.7588*/7589limit(options: RateLimitOptions): Promise<RateLimitOutcome>;7590}7591// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need7592// to referenced by `Fetcher`. This is included in the "importable" version of the types which7593// strips all `module` blocks.7594declare namespace Rpc {7595// Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.7596// TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.7597// For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to7598// accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)7599export const __RPC_STUB_BRAND: '__RPC_STUB_BRAND';7600export const __RPC_TARGET_BRAND: '__RPC_TARGET_BRAND';7601export const __WORKER_ENTRYPOINT_BRAND: '__WORKER_ENTRYPOINT_BRAND';7602export const __DURABLE_OBJECT_BRAND: '__DURABLE_OBJECT_BRAND';7603export const __WORKFLOW_ENTRYPOINT_BRAND: '__WORKFLOW_ENTRYPOINT_BRAND';7604export interface RpcTargetBranded {7605[__RPC_TARGET_BRAND]: never;7606}7607export interface WorkerEntrypointBranded {7608[__WORKER_ENTRYPOINT_BRAND]: never;7609}7610export interface DurableObjectBranded {7611[__DURABLE_OBJECT_BRAND]: never;7612}7613export interface WorkflowEntrypointBranded {7614[__WORKFLOW_ENTRYPOINT_BRAND]: never;7615}7616export type EntrypointBranded = WorkerEntrypointBranded | DurableObjectBranded | WorkflowEntrypointBranded;7617// Types that can be used through `Stub`s7618export type Stubable = RpcTargetBranded | ((...args: any[]) => any);7619// Types that can be passed over RPC7620// The reason for using a generic type here is to build a serializable subset of structured7621// cloneable composite types. This allows types defined with the "interface" keyword to pass the7622// serializable check as well. Otherwise, only types defined with the "type" keyword would pass.7623type Serializable<T> =7624// Structured cloneables7625BaseType7626// Structured cloneable composites7627| Map<T extends Map<infer U, unknown> ? Serializable<U> : never, T extends Map<unknown, infer U> ? Serializable<U> : never> | Set<T extends Set<infer U> ? Serializable<U> : never> | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never> | {7628[K in keyof T]: K extends number | string ? Serializable<T[K]> : never;7629}7630// Special types7631| Stub<Stubable>7632// Serialized as stubs, see `Stubify`7633| Stubable;7634// Base type for all RPC stubs, including common memory management methods.7635// `T` is used as a marker type for unwrapping `Stub`s later.7636interface StubBase<T extends Stubable> extends Disposable {7637[__RPC_STUB_BRAND]: T;7638dup(): this;7639}7640export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;7641// This represents all the types that can be sent as-is over an RPC boundary7642type BaseType = void | undefined | null | boolean | number | bigint | string | TypedArray | ArrayBuffer | DataView | Date | Error | RegExp | ReadableStream<Uint8Array> | WritableStream<Uint8Array> | Request | Response | Headers;7643// Recursively rewrite all `Stubable` types with `Stub`s7644// prettier-ignore7645type Stubify<T> = T extends Stubable ? Stub<T> : T extends Map<infer K, infer V> ? Map<Stubify<K>, Stubify<V>> : T extends Set<infer V> ? Set<Stubify<V>> : T extends Array<infer V> ? Array<Stubify<V>> : T extends ReadonlyArray<infer V> ? ReadonlyArray<Stubify<V>> : T extends BaseType ? T : T extends {7646[key: string | number]: any;7647} ? {7648[K in keyof T]: Stubify<T[K]>;7649} : T;7650// Recursively rewrite all `Stub<T>`s with the corresponding `T`s.7651// Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:7652// `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.7653// prettier-ignore7654type Unstubify<T> = T extends StubBase<infer V> ? V : T extends Map<infer K, infer V> ? Map<Unstubify<K>, Unstubify<V>> : T extends Set<infer V> ? Set<Unstubify<V>> : T extends Array<infer V> ? Array<Unstubify<V>> : T extends ReadonlyArray<infer V> ? ReadonlyArray<Unstubify<V>> : T extends BaseType ? T : T extends {7655[key: string | number]: unknown;7656} ? {7657[K in keyof T]: Unstubify<T[K]>;7658} : T;7659type UnstubifyAll<A extends any[]> = {7660[I in keyof A]: Unstubify<A[I]>;7661};7662// Utility type for adding `Provider`/`Disposable`s to `object` types only.7663// Note `unknown & T` is equivalent to `T`.7664type MaybeProvider<T> = T extends object ? Provider<T> : unknown;7665type MaybeDisposable<T> = T extends object ? Disposable : unknown;7666// Type for method return or property on an RPC interface.7667// - Stubable types are replaced by stubs.7668// - Serializable types are passed by value, with stubable types replaced by stubs7669// and a top-level `Disposer`.7670// Everything else can't be passed over PRC.7671// Technically, we use custom thenables here, but they quack like `Promise`s.7672// Intersecting with `(Maybe)Provider` allows pipelining.7673// prettier-ignore7674type Result<R> = R extends Stubable ? Promise<Stub<R>> & Provider<R> : R extends Serializable<R> ? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R> : never;7675// Type for method or property on an RPC interface.7676// For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.7677// Unwrapping `Stub`s allows calling with `Stubable` arguments.7678// For properties, rewrite types to be `Result`s.7679// In each case, unwrap `Promise`s.7680type MethodOrProperty<V> = V extends (...args: infer P) => infer R ? (...args: UnstubifyAll<P>) => Result<Awaited<R>> : Result<Awaited<V>>;7681// Type for the callable part of an `Provider` if `T` is callable.7682// This is intersected with methods/properties.7683type MaybeCallableProvider<T> = T extends (...args: any[]) => any ? MethodOrProperty<T> : unknown;7684// Base type for all other types providing RPC-like interfaces.7685// Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.7686// `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.7687export type Provider<T extends object, Reserved extends string = never> = MaybeCallableProvider<T> & {7688[K in Exclude<keyof T, Reserved | symbol | keyof StubBase<never>>]: MethodOrProperty<T[K]>;7689};7690}7691declare namespace Cloudflare {7692// Type of `env`.7693//7694// The specific project can extend `Env` by redeclaring it in project-specific files. Typescript7695// will merge all declarations.7696//7697// You can use `wrangler types` to generate the `Env` type automatically.7698interface Env {7699}7700// Project-specific parameters used to inform types.7701//7702// This interface is, again, intended to be declared in project-specific files, and then that7703// declaration will be merged with this one.7704//7705// A project should have a declaration like this:7706//7707// interface GlobalProps {7708// // Declares the main module's exports. Used to populate Cloudflare.Exports aka the type7709// // of `ctx.exports`.7710// mainModule: typeof import("my-main-module");7711//7712// // Declares which of the main module's exports are configured with durable storage, and7713// // thus should behave as Durable Object namsepace bindings.7714// durableNamespaces: "MyDurableObject" | "AnotherDurableObject";7715// }7716//7717// You can use `wrangler types` to generate `GlobalProps` automatically.7718interface GlobalProps {7719}7720// Evaluates to the type of a property in GlobalProps, defaulting to `Default` if it is not7721// present.7722type GlobalProp<K extends string, Default> = K extends keyof GlobalProps ? GlobalProps[K] : Default;7723// The type of the program's main module exports, if known. Requires `GlobalProps` to declare the7724// `mainModule` property.7725type MainModule = GlobalProp<"mainModule", {}>;7726// The type of ctx.exports, which contains loopback bindings for all top-level exports.7727type Exports = {7728[K in keyof MainModule]: LoopbackForExport<MainModule[K]>7729// If the export is listed in `durableNamespaces`, then it is also a7730// DurableObjectNamespace.7731& (K extends GlobalProp<"durableNamespaces", never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace<DoInstance> : DurableObjectNamespace<undefined> : DurableObjectNamespace<undefined> : {});7732};7733}7734declare namespace CloudflareWorkersModule {7735export type RpcStub<T extends Rpc.Stubable> = Rpc.Stub<T>;7736export const RpcStub: {7737new <T extends Rpc.Stubable>(value: T): Rpc.Stub<T>;7738};7739export abstract class RpcTarget implements Rpc.RpcTargetBranded {7740[Rpc.__RPC_TARGET_BRAND]: never;7741}7742// `protected` fields don't appear in `keyof`s, so can't be accessed over RPC7743export abstract class WorkerEntrypoint<Env = Cloudflare.Env, Props = {}> implements Rpc.WorkerEntrypointBranded {7744[Rpc.__WORKER_ENTRYPOINT_BRAND]: never;7745protected ctx: ExecutionContext<Props>;7746protected env: Env;7747constructor(ctx: ExecutionContext, env: Env);7748fetch?(request: Request): Response | Promise<Response>;7749tail?(events: TraceItem[]): void | Promise<void>;7750trace?(traces: TraceItem[]): void | Promise<void>;7751scheduled?(controller: ScheduledController): void | Promise<void>;7752queue?(batch: MessageBatch<unknown>): void | Promise<void>;7753test?(controller: TestController): void | Promise<void>;7754}7755export abstract class DurableObject<Env = Cloudflare.Env, Props = {}> implements Rpc.DurableObjectBranded {7756[Rpc.__DURABLE_OBJECT_BRAND]: never;7757protected ctx: DurableObjectState<Props>;7758protected env: Env;7759constructor(ctx: DurableObjectState, env: Env);7760fetch?(request: Request): Response | Promise<Response>;7761alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;7762webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>;7763webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>;7764webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;7765}7766export type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';7767export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;7768export type WorkflowDelayDuration = WorkflowSleepDuration;7769export type WorkflowTimeoutDuration = WorkflowSleepDuration;7770export type WorkflowRetentionDuration = WorkflowSleepDuration;7771export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';7772export type WorkflowStepConfig = {7773retries?: {7774limit: number;7775delay: WorkflowDelayDuration | number;7776backoff?: WorkflowBackoff;7777};7778timeout?: WorkflowTimeoutDuration | number;7779};7780export type WorkflowEvent<T> = {7781payload: Readonly<T>;7782timestamp: Date;7783instanceId: string;7784};7785export type WorkflowStepEvent<T> = {7786payload: Readonly<T>;7787timestamp: Date;7788type: string;7789};7790export abstract class WorkflowStep {7791do<T extends Rpc.Serializable<T>>(name: string, callback: () => Promise<T>): Promise<T>;7792do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: () => Promise<T>): Promise<T>;7793sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;7794sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;7795waitForEvent<T extends Rpc.Serializable<T>>(name: string, options: {7796type: string;7797timeout?: WorkflowTimeoutDuration | number;7798}): Promise<WorkflowStepEvent<T>>;7799}7800export abstract class WorkflowEntrypoint<Env = unknown, T extends Rpc.Serializable<T> | unknown = unknown> implements Rpc.WorkflowEntrypointBranded {7801[Rpc.__WORKFLOW_ENTRYPOINT_BRAND]: never;7802protected ctx: ExecutionContext;7803protected env: Env;7804constructor(ctx: ExecutionContext, env: Env);7805run(event: Readonly<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>;7806}7807export function waitUntil(promise: Promise<unknown>): void;7808export const env: Cloudflare.Env;7809}7810declare module 'cloudflare:workers' {7811export = CloudflareWorkersModule;7812}7813interface SecretsStoreSecret {7814/**7815* Get a secret from the Secrets Store, returning a string of the secret value7816* if it exists, or throws an error if it does not exist7817*/7818get(): Promise<string>;7819}7820declare module "cloudflare:sockets" {7821function _connect(address: string | SocketAddress, options?: SocketOptions): Socket;7822export { _connect as connect };7823}7824type ConversionResponse = {7825name: string;7826mimeType: string;7827} & ({7828format: "markdown";7829tokens: number;7830data: string;7831} | {7832format: "error";7833error: string;7834});7835type SupportedFileFormat = {7836mimeType: string;7837extension: string;7838};7839declare abstract class ToMarkdownService {7840transform(files: {7841name: string;7842blob: Blob;7843}[], options?: {7844gateway?: GatewayOptions;7845extraHeaders?: object;7846}): Promise<ConversionResponse[]>;7847transform(files: {7848name: string;7849blob: Blob;7850}, options?: {7851gateway?: GatewayOptions;7852extraHeaders?: object;7853}): Promise<ConversionResponse>;7854supported(): Promise<SupportedFileFormat[]>;7855}7856declare namespace TailStream {7857interface Header {7858readonly name: string;7859readonly value: string;7860}7861interface FetchEventInfo {7862readonly type: "fetch";7863readonly method: string;7864readonly url: string;7865readonly cfJson?: object;7866readonly headers: Header[];7867}7868interface JsRpcEventInfo {7869readonly type: "jsrpc";7870}7871interface ScheduledEventInfo {7872readonly type: "scheduled";7873readonly scheduledTime: Date;7874readonly cron: string;7875}7876interface AlarmEventInfo {7877readonly type: "alarm";7878readonly scheduledTime: Date;7879}7880interface QueueEventInfo {7881readonly type: "queue";7882readonly queueName: string;7883readonly batchSize: number;7884}7885interface EmailEventInfo {7886readonly type: "email";7887readonly mailFrom: string;7888readonly rcptTo: string;7889readonly rawSize: number;7890}7891interface TraceEventInfo {7892readonly type: "trace";7893readonly traces: (string | null)[];7894}7895interface HibernatableWebSocketEventInfoMessage {7896readonly type: "message";7897}7898interface HibernatableWebSocketEventInfoError {7899readonly type: "error";7900}7901interface HibernatableWebSocketEventInfoClose {7902readonly type: "close";7903readonly code: number;7904readonly wasClean: boolean;7905}7906interface HibernatableWebSocketEventInfo {7907readonly type: "hibernatableWebSocket";7908readonly info: HibernatableWebSocketEventInfoClose | HibernatableWebSocketEventInfoError | HibernatableWebSocketEventInfoMessage;7909}7910interface CustomEventInfo {7911readonly type: "custom";7912}7913interface FetchResponseInfo {7914readonly type: "fetch";7915readonly statusCode: number;7916}7917type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound";7918interface ScriptVersion {7919readonly id: string;7920readonly tag?: string;7921readonly message?: string;7922}7923interface Onset {7924readonly type: "onset";7925readonly attributes: Attribute[];7926// id for the span being opened by this Onset event.7927readonly spanId: string;7928readonly dispatchNamespace?: string;7929readonly entrypoint?: string;7930readonly executionModel: string;7931readonly scriptName?: string;7932readonly scriptTags?: string[];7933readonly scriptVersion?: ScriptVersion;7934readonly info: FetchEventInfo | JsRpcEventInfo | ScheduledEventInfo | AlarmEventInfo | QueueEventInfo | EmailEventInfo | TraceEventInfo | HibernatableWebSocketEventInfo | CustomEventInfo;7935}7936interface Outcome {7937readonly type: "outcome";7938readonly outcome: EventOutcome;7939readonly cpuTime: number;7940readonly wallTime: number;7941}7942interface SpanOpen {7943readonly type: "spanOpen";7944readonly name: string;7945// id for the span being opened by this SpanOpen event.7946readonly spanId: string;7947readonly info?: FetchEventInfo | JsRpcEventInfo | Attributes;7948}7949interface SpanClose {7950readonly type: "spanClose";7951readonly outcome: EventOutcome;7952}7953interface DiagnosticChannelEvent {7954readonly type: "diagnosticChannel";7955readonly channel: string;7956readonly message: any;7957}7958interface Exception {7959readonly type: "exception";7960readonly name: string;7961readonly message: string;7962readonly stack?: string;7963}7964interface Log {7965readonly type: "log";7966readonly level: "debug" | "error" | "info" | "log" | "warn";7967readonly message: object;7968}7969// This marks the worker handler return information.7970// This is separate from Outcome because the worker invocation can live for a long time after7971// returning. For example - Websockets that return an http upgrade response but then continue7972// streaming information or SSE http connections.7973interface Return {7974readonly type: "return";7975readonly info?: FetchResponseInfo;7976}7977interface Attribute {7978readonly name: string;7979readonly value: string | string[] | boolean | boolean[] | number | number[] | bigint | bigint[];7980}7981interface Attributes {7982readonly type: "attributes";7983readonly info: Attribute[];7984}7985type EventType = Onset | Outcome | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | Return | Attributes;7986// Context in which this trace event lives.7987interface SpanContext {7988// Single id for the entire top-level invocation7989// This should be a new traceId for the first worker stage invoked in the eyeball request and then7990// same-account service-bindings should reuse the same traceId but cross-account service-bindings7991// should use a new traceId.7992readonly traceId: string;7993// spanId in which this event is handled7994// for Onset and SpanOpen events this would be the parent span id7995// for Outcome and SpanClose these this would be the span id of the opening Onset and SpanOpen events7996// For Hibernate and Mark this would be the span under which they were emitted.7997// spanId is not set ONLY if:7998// 1. This is an Onset event7999// 2. We are not inherting any SpanContext. (e.g. this is a cross-account service binding or a new top-level invocation)8000readonly spanId?: string;8001}8002interface TailEvent<Event extends EventType> {8003// invocation id of the currently invoked worker stage.8004// invocation id will always be unique to every Onset event and will be the same until the Outcome event.8005readonly invocationId: string;8006// Inherited spanContext for this event.8007readonly spanContext: SpanContext;8008readonly timestamp: Date;8009readonly sequence: number;8010readonly event: Event;8011}8012type TailEventHandler<Event extends EventType = EventType> = (event: TailEvent<Event>) => void | Promise<void>;8013type TailEventHandlerObject = {8014outcome?: TailEventHandler<Outcome>;8015spanOpen?: TailEventHandler<SpanOpen>;8016spanClose?: TailEventHandler<SpanClose>;8017diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent>;8018exception?: TailEventHandler<Exception>;8019log?: TailEventHandler<Log>;8020return?: TailEventHandler<Return>;8021attributes?: TailEventHandler<Attributes>;8022};8023type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;8024}8025// Copyright (c) 2022-2023 Cloudflare, Inc.8026// Licensed under the Apache 2.0 license found in the LICENSE file or at:8027// https://opensource.org/licenses/Apache-2.08028/**8029* Data types supported for holding vector metadata.8030*/8031type VectorizeVectorMetadataValue = string | number | boolean | string[];8032/**8033* Additional information to associate with a vector.8034*/8035type VectorizeVectorMetadata = VectorizeVectorMetadataValue | Record<string, VectorizeVectorMetadataValue>;8036type VectorFloatArray = Float32Array | Float64Array;8037interface VectorizeError {8038code?: number;8039error: string;8040}8041/**8042* Comparison logic/operation to use for metadata filtering.8043*8044* This list is expected to grow as support for more operations are released.8045*/8046type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";8047/**8048* Filter criteria for vector metadata used to limit the retrieved query result set.8049*/8050type VectorizeVectorMetadataFilter = {8051[field: string]: Exclude<VectorizeVectorMetadataValue, string[]> | null | {8052[Op in VectorizeVectorMetadataFilterOp]?: Exclude<VectorizeVectorMetadataValue, string[]> | null;8053};8054};8055/**8056* Supported distance metrics for an index.8057* Distance metrics determine how other "similar" vectors are determined.8058*/8059type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";8060/**8061* Metadata return levels for a Vectorize query.8062*8063* Default to "none".8064*8065* @property all Full metadata for the vector return set, including all fields (including those un-indexed) without truncation. This is a more expensive retrieval, as it requires additional fetching & reading of un-indexed data.8066* @property indexed Return all metadata fields configured for indexing in the vector return set. This level of retrieval is "free" in that no additional overhead is incurred returning this data. However, note that indexed metadata is subject to truncation (especially for larger strings).8067* @property none No indexed metadata will be returned.8068*/8069type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";8070interface VectorizeQueryOptions {8071topK?: number;8072namespace?: string;8073returnValues?: boolean;8074returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;8075filter?: VectorizeVectorMetadataFilter;8076}8077/**8078* Information about the configuration of an index.8079*/8080type VectorizeIndexConfig = {8081dimensions: number;8082metric: VectorizeDistanceMetric;8083} | {8084preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity8085};8086/**8087* Metadata about an existing index.8088*8089* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.8090* See {@link VectorizeIndexInfo} for its post-beta equivalent.8091*/8092interface VectorizeIndexDetails {8093/** The unique ID of the index */8094readonly id: string;8095/** The name of the index. */8096name: string;8097/** (optional) A human readable description for the index. */8098description?: string;8099/** The index configuration, including the dimension size and distance metric. */8100config: VectorizeIndexConfig;8101/** The number of records containing vectors within the index. */8102vectorsCount: number;8103}8104/**8105* Metadata about an existing index.8106*/8107interface VectorizeIndexInfo {8108/** The number of records containing vectors within the index. */8109vectorCount: number;8110/** Number of dimensions the index has been configured for. */8111dimensions: number;8112/** ISO 8601 datetime of the last processed mutation on in the index. All changes before this mutation will be reflected in the index state. */8113processedUpToDatetime: number;8114/** UUIDv4 of the last mutation processed by the index. All changes before this mutation will be reflected in the index state. */8115processedUpToMutation: number;8116}8117/**8118* Represents a single vector value set along with its associated metadata.8119*/8120interface VectorizeVector {8121/** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */8122id: string;8123/** The vector values */8124values: VectorFloatArray | number[];8125/** The namespace this vector belongs to. */8126namespace?: string;8127/** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */8128metadata?: Record<string, VectorizeVectorMetadata>;8129}8130/**8131* Represents a matched vector for a query along with its score and (if specified) the matching vector information.8132*/8133type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> & Omit<VectorizeVector, "values"> & {8134/** The score or rank for similarity, when returned as a result */8135score: number;8136};8137/**8138* A set of matching {@link VectorizeMatch} for a particular query.8139*/8140interface VectorizeMatches {8141matches: VectorizeMatch[];8142count: number;8143}8144/**8145* Results of an operation that performed a mutation on a set of vectors.8146* Here, `ids` is a list of vectors that were successfully processed.8147*8148* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.8149* See {@link VectorizeAsyncMutation} for its post-beta equivalent.8150*/8151interface VectorizeVectorMutation {8152/* List of ids of vectors that were successfully processed. */8153ids: string[];8154/* Total count of the number of processed vectors. */8155count: number;8156}8157/**8158* Result type indicating a mutation on the Vectorize Index.8159* Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.8160*/8161interface VectorizeAsyncMutation {8162/** The unique identifier for the async mutation operation containing the changeset. */8163mutationId: string;8164}8165/**8166* A Vectorize Vector Search Index for querying vectors/embeddings.8167*8168* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.8169* See {@link Vectorize} for its new implementation.8170*/8171declare abstract class VectorizeIndex {8172/**8173* Get information about the currently bound index.8174* @returns A promise that resolves with information about the current index.8175*/8176public describe(): Promise<VectorizeIndexDetails>;8177/**8178* Use the provided vector to perform a similarity search across the index.8179* @param vector Input vector that will be used to drive the similarity search.8180* @param options Configuration options to massage the returned data.8181* @returns A promise that resolves with matched and scored vectors.8182*/8183public query(vector: VectorFloatArray | number[], options?: VectorizeQueryOptions): Promise<VectorizeMatches>;8184/**8185* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.8186* @param vectors List of vectors that will be inserted.8187* @returns A promise that resolves with the ids & count of records that were successfully processed.8188*/8189public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;8190/**8191* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.8192* @param vectors List of vectors that will be upserted.8193* @returns A promise that resolves with the ids & count of records that were successfully processed.8194*/8195public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;8196/**8197* Delete a list of vectors with a matching id.8198* @param ids List of vector ids that should be deleted.8199* @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted).8200*/8201public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation>;8202/**8203* Get a list of vectors with a matching id.8204* @param ids List of vector ids that should be returned.8205* @returns A promise that resolves with the raw unscored vectors matching the id set.8206*/8207public getByIds(ids: string[]): Promise<VectorizeVector[]>;8208}8209/**8210* A Vectorize Vector Search Index for querying vectors/embeddings.8211*8212* Mutations in this version are async, returning a mutation id.8213*/8214declare abstract class Vectorize {8215/**8216* Get information about the currently bound index.8217* @returns A promise that resolves with information about the current index.8218*/8219public describe(): Promise<VectorizeIndexInfo>;8220/**8221* Use the provided vector to perform a similarity search across the index.8222* @param vector Input vector that will be used to drive the similarity search.8223* @param options Configuration options to massage the returned data.8224* @returns A promise that resolves with matched and scored vectors.8225*/8226public query(vector: VectorFloatArray | number[], options?: VectorizeQueryOptions): Promise<VectorizeMatches>;8227/**8228* Use the provided vector-id to perform a similarity search across the index.8229* @param vectorId Id for a vector in the index against which the index should be queried.8230* @param options Configuration options to massage the returned data.8231* @returns A promise that resolves with matched and scored vectors.8232*/8233public queryById(vectorId: string, options?: VectorizeQueryOptions): Promise<VectorizeMatches>;8234/**8235* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.8236* @param vectors List of vectors that will be inserted.8237* @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.8238*/8239public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;8240/**8241* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.8242* @param vectors List of vectors that will be upserted.8243* @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.8244*/8245public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;8246/**8247* Delete a list of vectors with a matching id.8248* @param ids List of vector ids that should be deleted.8249* @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.8250*/8251public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;8252/**8253* Get a list of vectors with a matching id.8254* @param ids List of vector ids that should be returned.8255* @returns A promise that resolves with the raw unscored vectors matching the id set.8256*/8257public getByIds(ids: string[]): Promise<VectorizeVector[]>;8258}8259/**8260* The interface for "version_metadata" binding8261* providing metadata about the Worker Version using this binding.8262*/8263type WorkerVersionMetadata = {8264/** The ID of the Worker Version using this binding */8265id: string;8266/** The tag of the Worker Version using this binding */8267tag: string;8268/** The timestamp of when the Worker Version was uploaded */8269timestamp: string;8270};8271interface DynamicDispatchLimits {8272/**8273* Limit CPU time in milliseconds.8274*/8275cpuMs?: number;8276/**8277* Limit number of subrequests.8278*/8279subRequests?: number;8280}8281interface DynamicDispatchOptions {8282/**8283* Limit resources of invoked Worker script.8284*/8285limits?: DynamicDispatchLimits;8286/**8287* Arguments for outbound Worker script, if configured.8288*/8289outbound?: {8290[key: string]: any;8291};8292}8293interface DispatchNamespace {8294/**8295* @param name Name of the Worker script.8296* @param args Arguments to Worker script.8297* @param options Options for Dynamic Dispatch invocation.8298* @returns A Fetcher object that allows you to send requests to the Worker script.8299* @throws If the Worker script does not exist in this dispatch namespace, an error will be thrown.8300*/8301get(name: string, args?: {8302[key: string]: any;8303}, options?: DynamicDispatchOptions): Fetcher;8304}8305declare module 'cloudflare:workflows' {8306/**8307* NonRetryableError allows for a user to throw a fatal error8308* that makes a Workflow instance fail immediately without triggering a retry8309*/8310export class NonRetryableError extends Error {8311public constructor(message: string, name?: string);8312}8313}8314declare abstract class Workflow<PARAMS = unknown> {8315/**8316* Get a handle to an existing instance of the Workflow.8317* @param id Id for the instance of this Workflow8318* @returns A promise that resolves with a handle for the Instance8319*/8320public get(id: string): Promise<WorkflowInstance>;8321/**8322* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.8323* @param options Options when creating an instance including id and params8324* @returns A promise that resolves with a handle for the Instance8325*/8326public create(options?: WorkflowInstanceCreateOptions<PARAMS>): Promise<WorkflowInstance>;8327/**8328* Create a batch of instances and return handle for all of them. If a provided id exists, an error will be thrown.8329* `createBatch` is limited at 100 instances at a time or when the RPC limit for the batch (1MiB) is reached.8330* @param batch List of Options when creating an instance including name and params8331* @returns A promise that resolves with a list of handles for the created instances.8332*/8333public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>;8334}8335type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';8336type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number;8337type WorkflowRetentionDuration = WorkflowSleepDuration;8338interface WorkflowInstanceCreateOptions<PARAMS = unknown> {8339/**8340* An id for your Workflow instance. Must be unique within the Workflow.8341*/8342id?: string;8343/**8344* The event payload the Workflow instance is triggered with8345*/8346params?: PARAMS;8347/**8348* The retention policy for Workflow instance.8349* Defaults to the maximum retention period available for the owner's account.8350*/8351retention?: {8352successRetention?: WorkflowRetentionDuration;8353errorRetention?: WorkflowRetentionDuration;8354};8355}8356type InstanceStatus = {8357status: 'queued' // means that instance is waiting to be started (see concurrency limits)8358| 'running' | 'paused' | 'errored' | 'terminated' // user terminated the instance while it was running8359| 'complete' | 'waiting' // instance is hibernating and waiting for sleep or event to finish8360| 'waitingForPause' // instance is finishing the current work to pause8361| 'unknown';8362error?: string;8363output?: object;8364};8365interface WorkflowError {8366code?: number;8367message: string;8368}8369declare abstract class WorkflowInstance {8370public id: string;8371/**8372* Pause the instance.8373*/8374public pause(): Promise<void>;8375/**8376* Resume the instance. If it is already running, an error will be thrown.8377*/8378public resume(): Promise<void>;8379/**8380* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.8381*/8382public terminate(): Promise<void>;8383/**8384* Restart the instance.8385*/8386public restart(): Promise<void>;8387/**8388* Returns the current status of the instance.8389*/8390public status(): Promise<InstanceStatus>;8391/**8392* Send an event to this instance.8393*/8394public sendEvent({ type, payload, }: {8395type: string;8396payload: unknown;8397}): Promise<void>;8398}839984008401