···11// oxlint-disable typescript/consistent-type-definitions
22-33-import { KVNamespace, DurableObjectNamespace } from '@cloudflare/workers-types'
42import type { Session, SupabaseClient, User } from '@supabase/supabase-js'
53import type { Database } from './database.types.ts' // import generated types
64
+2-1
app/tsconfig.json
···1010 "skipLibCheck": true,
1111 "sourceMap": true,
1212 "strict": true,
1313- "moduleResolution": "bundler"
1313+ "moduleResolution": "bundler",
1414+ "types": ["./worker-configuration.d.ts", "node"]
1415 }
1516 // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
1617 // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
+11954
app/worker-configuration.d.ts
···11+/* eslint-disable */
22+// Generated by Wrangler by running `wrangler types` (hash: 93851a135272be61ff875ada0ef59f66)
33+// Runtime types generated with workerd@1.20251217.0 2025-11-17 nodejs_compat
44+declare namespace Cloudflare {
55+ interface GlobalProps {
66+ mainModule: typeof import('./.svelte-kit/.cloudflare/_worker')
77+ }
88+ interface Env {
99+ ASSETS: Fetcher
1010+ }
1111+}
1212+interface Env extends Cloudflare.Env {}
1313+1414+// Begin runtime types
1515+/*! *****************************************************************************
1616+Copyright (c) Cloudflare. All rights reserved.
1717+Copyright (c) Microsoft Corporation. All rights reserved.
1818+1919+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
2020+this file except in compliance with the License. You may obtain a copy of the
2121+License at http://www.apache.org/licenses/LICENSE-2.0
2222+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
2323+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
2424+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
2525+MERCHANTABLITY OR NON-INFRINGEMENT.
2626+See the Apache Version 2.0 License for specific language governing permissions
2727+and limitations under the License.
2828+***************************************************************************** */
2929+/* eslint-disable */
3030+// noinspection JSUnusedGlobalSymbols
3131+declare var onmessage: never
3232+/**
3333+ * The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
3434+ *
3535+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
3636+ */
3737+declare class DOMException extends Error {
3838+ constructor(message?: string, name?: string)
3939+ /**
4040+ * The **`message`** read-only property of the a message or description associated with the given error name.
4141+ *
4242+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
4343+ */
4444+ readonly message: string
4545+ /**
4646+ * The **`name`** read-only property of the one of the strings associated with an error name.
4747+ *
4848+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
4949+ */
5050+ readonly name: string
5151+ /**
5252+ * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
5353+ * @deprecated
5454+ *
5555+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
5656+ */
5757+ readonly code: number
5858+ static readonly INDEX_SIZE_ERR: number
5959+ static readonly DOMSTRING_SIZE_ERR: number
6060+ static readonly HIERARCHY_REQUEST_ERR: number
6161+ static readonly WRONG_DOCUMENT_ERR: number
6262+ static readonly INVALID_CHARACTER_ERR: number
6363+ static readonly NO_DATA_ALLOWED_ERR: number
6464+ static readonly NO_MODIFICATION_ALLOWED_ERR: number
6565+ static readonly NOT_FOUND_ERR: number
6666+ static readonly NOT_SUPPORTED_ERR: number
6767+ static readonly INUSE_ATTRIBUTE_ERR: number
6868+ static readonly INVALID_STATE_ERR: number
6969+ static readonly SYNTAX_ERR: number
7070+ static readonly INVALID_MODIFICATION_ERR: number
7171+ static readonly NAMESPACE_ERR: number
7272+ static readonly INVALID_ACCESS_ERR: number
7373+ static readonly VALIDATION_ERR: number
7474+ static readonly TYPE_MISMATCH_ERR: number
7575+ static readonly SECURITY_ERR: number
7676+ static readonly NETWORK_ERR: number
7777+ static readonly ABORT_ERR: number
7878+ static readonly URL_MISMATCH_ERR: number
7979+ static readonly QUOTA_EXCEEDED_ERR: number
8080+ static readonly TIMEOUT_ERR: number
8181+ static readonly INVALID_NODE_TYPE_ERR: number
8282+ static readonly DATA_CLONE_ERR: number
8383+ get stack(): any
8484+ set stack(value: any)
8585+}
8686+type WorkerGlobalScopeEventMap = {
8787+ fetch: FetchEvent
8888+ scheduled: ScheduledEvent
8989+ queue: QueueEvent
9090+ unhandledrejection: PromiseRejectionEvent
9191+ rejectionhandled: PromiseRejectionEvent
9292+}
9393+declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
9494+ EventTarget: typeof EventTarget
9595+}
9696+/* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). *
9797+ * The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox).
9898+ *
9999+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console)
100100+ */
101101+interface Console {
102102+ 'assert'(condition?: boolean, ...data: any[]): void
103103+ /**
104104+ * The **`console.clear()`** static method clears the console if possible.
105105+ *
106106+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static)
107107+ */
108108+ clear(): void
109109+ /**
110110+ * The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
111111+ *
112112+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
113113+ */
114114+ count(label?: string): void
115115+ /**
116116+ * The **`console.countReset()`** static method resets counter used with console/count_static.
117117+ *
118118+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
119119+ */
120120+ countReset(label?: string): void
121121+ /**
122122+ * The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
123123+ *
124124+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
125125+ */
126126+ debug(...data: any[]): void
127127+ /**
128128+ * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
129129+ *
130130+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
131131+ */
132132+ dir(item?: any, options?: any): void
133133+ /**
134134+ * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
135135+ *
136136+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
137137+ */
138138+ dirxml(...data: any[]): void
139139+ /**
140140+ * The **`console.error()`** static method outputs a message to the console at the 'error' log level.
141141+ *
142142+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
143143+ */
144144+ error(...data: any[]): void
145145+ /**
146146+ * The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
147147+ *
148148+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
149149+ */
150150+ group(...data: any[]): void
151151+ /**
152152+ * The **`console.groupCollapsed()`** static method creates a new inline group in the console.
153153+ *
154154+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
155155+ */
156156+ groupCollapsed(...data: any[]): void
157157+ /**
158158+ * The **`console.groupEnd()`** static method exits the current inline group in the console.
159159+ *
160160+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
161161+ */
162162+ groupEnd(): void
163163+ /**
164164+ * The **`console.info()`** static method outputs a message to the console at the 'info' log level.
165165+ *
166166+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
167167+ */
168168+ info(...data: any[]): void
169169+ /**
170170+ * The **`console.log()`** static method outputs a message to the console.
171171+ *
172172+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
173173+ */
174174+ log(...data: any[]): void
175175+ /**
176176+ * The **`console.table()`** static method displays tabular data as a table.
177177+ *
178178+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static)
179179+ */
180180+ table(tabularData?: any, properties?: string[]): void
181181+ /**
182182+ * The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
183183+ *
184184+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
185185+ */
186186+ time(label?: string): void
187187+ /**
188188+ * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
189189+ *
190190+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
191191+ */
192192+ timeEnd(label?: string): void
193193+ /**
194194+ * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
195195+ *
196196+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
197197+ */
198198+ timeLog(label?: string, ...data: any[]): void
199199+ timeStamp(label?: string): void
200200+ /**
201201+ * The **`console.trace()`** static method outputs a stack trace to the console.
202202+ *
203203+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static)
204204+ */
205205+ trace(...data: any[]): void
206206+ /**
207207+ * The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
208208+ *
209209+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
210210+ */
211211+ warn(...data: any[]): void
212212+}
213213+declare const console: Console
214214+type BufferSource = ArrayBufferView | ArrayBuffer
215215+type TypedArray =
216216+ | Int8Array
217217+ | Uint8Array
218218+ | Uint8ClampedArray
219219+ | Int16Array
220220+ | Uint16Array
221221+ | Int32Array
222222+ | Uint32Array
223223+ | Float32Array
224224+ | Float64Array
225225+ | BigInt64Array
226226+ | BigUint64Array
227227+declare namespace WebAssembly {
228228+ class CompileError extends Error {
229229+ constructor(message?: string)
230230+ }
231231+ class RuntimeError extends Error {
232232+ constructor(message?: string)
233233+ }
234234+ type ValueType = 'anyfunc' | 'externref' | 'f32' | 'f64' | 'i32' | 'i64' | 'v128'
235235+ interface GlobalDescriptor {
236236+ value: ValueType
237237+ mutable?: boolean
238238+ }
239239+ class Global {
240240+ constructor(descriptor: GlobalDescriptor, value?: any)
241241+ value: any
242242+ valueOf(): any
243243+ }
244244+ type ImportValue = ExportValue | number
245245+ type ModuleImports = Record<string, ImportValue>
246246+ type Imports = Record<string, ModuleImports>
247247+ type ExportValue = Function | Global | Memory | Table
248248+ type Exports = Record<string, ExportValue>
249249+ class Instance {
250250+ constructor(module: Module, imports?: Imports)
251251+ readonly exports: Exports
252252+ }
253253+ interface MemoryDescriptor {
254254+ initial: number
255255+ maximum?: number
256256+ shared?: boolean
257257+ }
258258+ class Memory {
259259+ constructor(descriptor: MemoryDescriptor)
260260+ readonly buffer: ArrayBuffer
261261+ grow(delta: number): number
262262+ }
263263+ type ImportExportKind = 'function' | 'global' | 'memory' | 'table'
264264+ interface ModuleExportDescriptor {
265265+ kind: ImportExportKind
266266+ name: string
267267+ }
268268+ interface ModuleImportDescriptor {
269269+ kind: ImportExportKind
270270+ module: string
271271+ name: string
272272+ }
273273+ abstract class Module {
274274+ static customSections(module: Module, sectionName: string): ArrayBuffer[]
275275+ static exports(module: Module): ModuleExportDescriptor[]
276276+ static imports(module: Module): ModuleImportDescriptor[]
277277+ }
278278+ type TableKind = 'anyfunc' | 'externref'
279279+ interface TableDescriptor {
280280+ element: TableKind
281281+ initial: number
282282+ maximum?: number
283283+ }
284284+ class Table {
285285+ constructor(descriptor: TableDescriptor, value?: any)
286286+ readonly length: number
287287+ get(index: number): any
288288+ grow(delta: number, value?: any): number
289289+ set(index: number, value?: any): void
290290+ }
291291+ function instantiate(module: Module, imports?: Imports): Promise<Instance>
292292+ function validate(bytes: BufferSource): boolean
293293+}
294294+/**
295295+ * The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker.
296296+ * Available only in secure contexts.
297297+ *
298298+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
299299+ */
300300+interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
301301+ DOMException: typeof DOMException
302302+ WorkerGlobalScope: typeof WorkerGlobalScope
303303+ btoa(data: string): string
304304+ atob(data: string): string
305305+ setTimeout(callback: (...args: any[]) => void, msDelay?: number): number
306306+ setTimeout<Args extends any[]>(
307307+ callback: (...args: Args) => void,
308308+ msDelay?: number,
309309+ ...args: Args
310310+ ): number
311311+ clearTimeout(timeoutId: number | null): void
312312+ setInterval(callback: (...args: any[]) => void, msDelay?: number): number
313313+ setInterval<Args extends any[]>(
314314+ callback: (...args: Args) => void,
315315+ msDelay?: number,
316316+ ...args: Args
317317+ ): number
318318+ clearInterval(timeoutId: number | null): void
319319+ queueMicrotask(task: Function): void
320320+ structuredClone<T>(value: T, options?: StructuredSerializeOptions): T
321321+ reportError(error: any): void
322322+ fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>
323323+ self: ServiceWorkerGlobalScope
324324+ crypto: Crypto
325325+ caches: CacheStorage
326326+ scheduler: Scheduler
327327+ performance: Performance
328328+ Cloudflare: Cloudflare
329329+ readonly origin: string
330330+ Event: typeof Event
331331+ ExtendableEvent: typeof ExtendableEvent
332332+ CustomEvent: typeof CustomEvent
333333+ PromiseRejectionEvent: typeof PromiseRejectionEvent
334334+ FetchEvent: typeof FetchEvent
335335+ TailEvent: typeof TailEvent
336336+ TraceEvent: typeof TailEvent
337337+ ScheduledEvent: typeof ScheduledEvent
338338+ MessageEvent: typeof MessageEvent
339339+ CloseEvent: typeof CloseEvent
340340+ ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader
341341+ ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader
342342+ ReadableStream: typeof ReadableStream
343343+ WritableStream: typeof WritableStream
344344+ WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter
345345+ TransformStream: typeof TransformStream
346346+ ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy
347347+ CountQueuingStrategy: typeof CountQueuingStrategy
348348+ ErrorEvent: typeof ErrorEvent
349349+ MessageChannel: typeof MessageChannel
350350+ MessagePort: typeof MessagePort
351351+ EventSource: typeof EventSource
352352+ ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest
353353+ ReadableStreamDefaultController: typeof ReadableStreamDefaultController
354354+ ReadableByteStreamController: typeof ReadableByteStreamController
355355+ WritableStreamDefaultController: typeof WritableStreamDefaultController
356356+ TransformStreamDefaultController: typeof TransformStreamDefaultController
357357+ CompressionStream: typeof CompressionStream
358358+ DecompressionStream: typeof DecompressionStream
359359+ TextEncoderStream: typeof TextEncoderStream
360360+ TextDecoderStream: typeof TextDecoderStream
361361+ Headers: typeof Headers
362362+ Body: typeof Body
363363+ Request: typeof Request
364364+ Response: typeof Response
365365+ WebSocket: typeof WebSocket
366366+ WebSocketPair: typeof WebSocketPair
367367+ WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair
368368+ AbortController: typeof AbortController
369369+ AbortSignal: typeof AbortSignal
370370+ TextDecoder: typeof TextDecoder
371371+ TextEncoder: typeof TextEncoder
372372+ navigator: Navigator
373373+ Navigator: typeof Navigator
374374+ URL: typeof URL
375375+ URLSearchParams: typeof URLSearchParams
376376+ URLPattern: typeof URLPattern
377377+ Blob: typeof Blob
378378+ File: typeof File
379379+ FormData: typeof FormData
380380+ Crypto: typeof Crypto
381381+ SubtleCrypto: typeof SubtleCrypto
382382+ CryptoKey: typeof CryptoKey
383383+ CacheStorage: typeof CacheStorage
384384+ Cache: typeof Cache
385385+ FixedLengthStream: typeof FixedLengthStream
386386+ IdentityTransformStream: typeof IdentityTransformStream
387387+ HTMLRewriter: typeof HTMLRewriter
388388+}
389389+declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
390390+ type: Type,
391391+ handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
392392+ options?: EventTargetAddEventListenerOptions | boolean,
393393+): void
394394+declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
395395+ type: Type,
396396+ handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
397397+ options?: EventTargetEventListenerOptions | boolean,
398398+): void
399399+/**
400400+ * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
401401+ *
402402+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
403403+ */
404404+declare function dispatchEvent(
405405+ event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
406406+): boolean
407407+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
408408+declare function btoa(data: string): string
409409+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
410410+declare function atob(data: string): string
411411+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
412412+declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number
413413+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
414414+declare function setTimeout<Args extends any[]>(
415415+ callback: (...args: Args) => void,
416416+ msDelay?: number,
417417+ ...args: Args
418418+): number
419419+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */
420420+declare function clearTimeout(timeoutId: number | null): void
421421+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
422422+declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number
423423+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
424424+declare function setInterval<Args extends any[]>(
425425+ callback: (...args: Args) => void,
426426+ msDelay?: number,
427427+ ...args: Args
428428+): number
429429+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */
430430+declare function clearInterval(timeoutId: number | null): void
431431+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */
432432+declare function queueMicrotask(task: Function): void
433433+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
434434+declare function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T
435435+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */
436436+declare function reportError(error: any): void
437437+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */
438438+declare function fetch(
439439+ input: RequestInfo | URL,
440440+ init?: RequestInit<RequestInitCfProperties>,
441441+): Promise<Response>
442442+declare const self: ServiceWorkerGlobalScope
443443+/**
444444+ * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
445445+ * The Workers runtime implements the full surface of this API, but with some differences in
446446+ * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
447447+ * compared to those implemented in most browsers.
448448+ *
449449+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
450450+ */
451451+declare const crypto: Crypto
452452+/**
453453+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
454454+ *
455455+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
456456+ */
457457+declare const caches: CacheStorage
458458+declare const scheduler: Scheduler
459459+/**
460460+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
461461+ * as well as timing of subrequests and other operations.
462462+ *
463463+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
464464+ */
465465+declare const performance: Performance
466466+declare const Cloudflare: Cloudflare
467467+declare const origin: string
468468+declare const navigator: Navigator
469469+interface TestController {}
470470+interface ExecutionContext<Props = unknown> {
471471+ waitUntil(promise: Promise<any>): void
472472+ passThroughOnException(): void
473473+ readonly exports: Cloudflare.Exports
474474+ readonly props: Props
475475+}
476476+type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (
477477+ request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
478478+ env: Env,
479479+ ctx: ExecutionContext,
480480+) => Response | Promise<Response>
481481+type ExportedHandlerTailHandler<Env = unknown> = (
482482+ events: TraceItem[],
483483+ env: Env,
484484+ ctx: ExecutionContext,
485485+) => void | Promise<void>
486486+type ExportedHandlerTraceHandler<Env = unknown> = (
487487+ traces: TraceItem[],
488488+ env: Env,
489489+ ctx: ExecutionContext,
490490+) => void | Promise<void>
491491+type ExportedHandlerTailStreamHandler<Env = unknown> = (
492492+ event: TailStream.TailEvent<TailStream.Onset>,
493493+ env: Env,
494494+ ctx: ExecutionContext,
495495+) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>
496496+type ExportedHandlerScheduledHandler<Env = unknown> = (
497497+ controller: ScheduledController,
498498+ env: Env,
499499+ ctx: ExecutionContext,
500500+) => void | Promise<void>
501501+type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
502502+ batch: MessageBatch<Message>,
503503+ env: Env,
504504+ ctx: ExecutionContext,
505505+) => void | Promise<void>
506506+type ExportedHandlerTestHandler<Env = unknown> = (
507507+ controller: TestController,
508508+ env: Env,
509509+ ctx: ExecutionContext,
510510+) => void | Promise<void>
511511+interface ExportedHandler<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown> {
512512+ fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>
513513+ tail?: ExportedHandlerTailHandler<Env>
514514+ trace?: ExportedHandlerTraceHandler<Env>
515515+ tailStream?: ExportedHandlerTailStreamHandler<Env>
516516+ scheduled?: ExportedHandlerScheduledHandler<Env>
517517+ test?: ExportedHandlerTestHandler<Env>
518518+ email?: EmailExportedHandler<Env>
519519+ queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>
520520+}
521521+interface StructuredSerializeOptions {
522522+ transfer?: any[]
523523+}
524524+declare abstract class Navigator {
525525+ sendBeacon(url: string, body?: BodyInit): boolean
526526+ readonly userAgent: string
527527+ readonly hardwareConcurrency: number
528528+ readonly language: string
529529+ readonly languages: string[]
530530+}
531531+interface AlarmInvocationInfo {
532532+ readonly isRetry: boolean
533533+ readonly retryCount: number
534534+}
535535+interface Cloudflare {
536536+ readonly compatibilityFlags: Record<string, boolean>
537537+}
538538+interface DurableObject {
539539+ fetch(request: Request): Response | Promise<Response>
540540+ alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>
541541+ webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>
542542+ webSocketClose?(
543543+ ws: WebSocket,
544544+ code: number,
545545+ reason: string,
546546+ wasClean: boolean,
547547+ ): void | Promise<void>
548548+ webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>
549549+}
550550+type DurableObjectStub<T extends Rpc.DurableObjectBranded | undefined = undefined> = Fetcher<
551551+ T,
552552+ 'alarm' | 'webSocketMessage' | 'webSocketClose' | 'webSocketError'
553553+> & {
554554+ readonly id: DurableObjectId
555555+ readonly name?: string
556556+}
557557+interface DurableObjectId {
558558+ toString(): string
559559+ equals(other: DurableObjectId): boolean
560560+ readonly name?: string
561561+}
562562+declare abstract class DurableObjectNamespace<
563563+ T extends Rpc.DurableObjectBranded | undefined = undefined,
564564+> {
565565+ newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId
566566+ idFromName(name: string): DurableObjectId
567567+ idFromString(id: string): DurableObjectId
568568+ get(
569569+ id: DurableObjectId,
570570+ options?: DurableObjectNamespaceGetDurableObjectOptions,
571571+ ): DurableObjectStub<T>
572572+ getByName(
573573+ name: string,
574574+ options?: DurableObjectNamespaceGetDurableObjectOptions,
575575+ ): DurableObjectStub<T>
576576+ jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>
577577+}
578578+type DurableObjectJurisdiction = 'eu' | 'fedramp' | 'fedramp-high'
579579+interface DurableObjectNamespaceNewUniqueIdOptions {
580580+ jurisdiction?: DurableObjectJurisdiction
581581+}
582582+type DurableObjectLocationHint =
583583+ | 'wnam'
584584+ | 'enam'
585585+ | 'sam'
586586+ | 'weur'
587587+ | 'eeur'
588588+ | 'apac'
589589+ | 'oc'
590590+ | 'afr'
591591+ | 'me'
592592+interface DurableObjectNamespaceGetDurableObjectOptions {
593593+ locationHint?: DurableObjectLocationHint
594594+}
595595+interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {}
596596+interface DurableObjectState<Props = unknown> {
597597+ waitUntil(promise: Promise<any>): void
598598+ readonly exports: Cloudflare.Exports
599599+ readonly props: Props
600600+ readonly id: DurableObjectId
601601+ readonly storage: DurableObjectStorage
602602+ container?: Container
603603+ blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>
604604+ acceptWebSocket(ws: WebSocket, tags?: string[]): void
605605+ getWebSockets(tag?: string): WebSocket[]
606606+ setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void
607607+ getWebSocketAutoResponse(): WebSocketRequestResponsePair | null
608608+ getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null
609609+ setHibernatableWebSocketEventTimeout(timeoutMs?: number): void
610610+ getHibernatableWebSocketEventTimeout(): number | null
611611+ getTags(ws: WebSocket): string[]
612612+ abort(reason?: string): void
613613+}
614614+interface DurableObjectTransaction {
615615+ get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>
616616+ get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>
617617+ list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>
618618+ put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>
619619+ put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>
620620+ delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>
621621+ delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>
622622+ rollback(): void
623623+ getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>
624624+ setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>
625625+ deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>
626626+}
627627+interface DurableObjectStorage {
628628+ get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>
629629+ get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>
630630+ list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>
631631+ put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>
632632+ put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>
633633+ delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>
634634+ delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>
635635+ deleteAll(options?: DurableObjectPutOptions): Promise<void>
636636+ transaction<T>(closure: (txn: DurableObjectTransaction) => Promise<T>): Promise<T>
637637+ getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>
638638+ setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>
639639+ deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>
640640+ sync(): Promise<void>
641641+ sql: SqlStorage
642642+ kv: SyncKvStorage
643643+ transactionSync<T>(closure: () => T): T
644644+ getCurrentBookmark(): Promise<string>
645645+ getBookmarkForTime(timestamp: number | Date): Promise<string>
646646+ onNextSessionRestoreBookmark(bookmark: string): Promise<string>
647647+}
648648+interface DurableObjectListOptions {
649649+ start?: string
650650+ startAfter?: string
651651+ end?: string
652652+ prefix?: string
653653+ reverse?: boolean
654654+ limit?: number
655655+ allowConcurrency?: boolean
656656+ noCache?: boolean
657657+}
658658+interface DurableObjectGetOptions {
659659+ allowConcurrency?: boolean
660660+ noCache?: boolean
661661+}
662662+interface DurableObjectGetAlarmOptions {
663663+ allowConcurrency?: boolean
664664+}
665665+interface DurableObjectPutOptions {
666666+ allowConcurrency?: boolean
667667+ allowUnconfirmed?: boolean
668668+ noCache?: boolean
669669+}
670670+interface DurableObjectSetAlarmOptions {
671671+ allowConcurrency?: boolean
672672+ allowUnconfirmed?: boolean
673673+}
674674+declare class WebSocketRequestResponsePair {
675675+ constructor(request: string, response: string)
676676+ get request(): string
677677+ get response(): string
678678+}
679679+interface AnalyticsEngineDataset {
680680+ writeDataPoint(event?: AnalyticsEngineDataPoint): void
681681+}
682682+interface AnalyticsEngineDataPoint {
683683+ indexes?: ((ArrayBuffer | string) | null)[]
684684+ doubles?: number[]
685685+ blobs?: ((ArrayBuffer | string) | null)[]
686686+}
687687+/**
688688+ * The **`Event`** interface represents an event which takes place on an `EventTarget`.
689689+ *
690690+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
691691+ */
692692+declare class Event {
693693+ constructor(type: string, init?: EventInit)
694694+ /**
695695+ * The **`type`** read-only property of the Event interface returns a string containing the event's type.
696696+ *
697697+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
698698+ */
699699+ get type(): string
700700+ /**
701701+ * The **`eventPhase`** read-only property of the being evaluated.
702702+ *
703703+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
704704+ */
705705+ get eventPhase(): number
706706+ /**
707707+ * The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
708708+ *
709709+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
710710+ */
711711+ get composed(): boolean
712712+ /**
713713+ * The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not.
714714+ *
715715+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
716716+ */
717717+ get bubbles(): boolean
718718+ /**
719719+ * The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.
720720+ *
721721+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
722722+ */
723723+ get cancelable(): boolean
724724+ /**
725725+ * The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event.
726726+ *
727727+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
728728+ */
729729+ get defaultPrevented(): boolean
730730+ /**
731731+ * The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not.
732732+ * @deprecated
733733+ *
734734+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
735735+ */
736736+ get returnValue(): boolean
737737+ /**
738738+ * The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached.
739739+ *
740740+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
741741+ */
742742+ get currentTarget(): EventTarget | undefined
743743+ /**
744744+ * The read-only **`target`** property of the dispatched.
745745+ *
746746+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
747747+ */
748748+ get target(): EventTarget | undefined
749749+ /**
750750+ * The deprecated **`Event.srcElement`** is an alias for the Event.target property.
751751+ * @deprecated
752752+ *
753753+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
754754+ */
755755+ get srcElement(): EventTarget | undefined
756756+ /**
757757+ * The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created.
758758+ *
759759+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
760760+ */
761761+ get timeStamp(): number
762762+ /**
763763+ * The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
764764+ *
765765+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
766766+ */
767767+ get isTrusted(): boolean
768768+ /**
769769+ * The **`cancelBubble`** property of the Event interface is deprecated.
770770+ * @deprecated
771771+ *
772772+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
773773+ */
774774+ get cancelBubble(): boolean
775775+ /**
776776+ * The **`cancelBubble`** property of the Event interface is deprecated.
777777+ * @deprecated
778778+ *
779779+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
780780+ */
781781+ set cancelBubble(value: boolean)
782782+ /**
783783+ * The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
784784+ *
785785+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
786786+ */
787787+ stopImmediatePropagation(): void
788788+ /**
789789+ * The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
790790+ *
791791+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
792792+ */
793793+ preventDefault(): void
794794+ /**
795795+ * The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
796796+ *
797797+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
798798+ */
799799+ stopPropagation(): void
800800+ /**
801801+ * The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
802802+ *
803803+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
804804+ */
805805+ composedPath(): EventTarget[]
806806+ static readonly NONE: number
807807+ static readonly CAPTURING_PHASE: number
808808+ static readonly AT_TARGET: number
809809+ static readonly BUBBLING_PHASE: number
810810+}
811811+interface EventInit {
812812+ bubbles?: boolean
813813+ cancelable?: boolean
814814+ composed?: boolean
815815+}
816816+type EventListener<EventType extends Event = Event> = (event: EventType) => void
817817+interface EventListenerObject<EventType extends Event = Event> {
818818+ handleEvent(event: EventType): void
819819+}
820820+type EventListenerOrEventListenerObject<EventType extends Event = Event> =
821821+ | EventListener<EventType>
822822+ | EventListenerObject<EventType>
823823+/**
824824+ * The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
825825+ *
826826+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
827827+ */
828828+declare class EventTarget<EventMap extends Record<string, Event> = Record<string, Event>> {
829829+ constructor()
830830+ /**
831831+ * The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
832832+ *
833833+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
834834+ */
835835+ addEventListener<Type extends keyof EventMap>(
836836+ type: Type,
837837+ handler: EventListenerOrEventListenerObject<EventMap[Type]>,
838838+ options?: EventTargetAddEventListenerOptions | boolean,
839839+ ): void
840840+ /**
841841+ * The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
842842+ *
843843+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
844844+ */
845845+ removeEventListener<Type extends keyof EventMap>(
846846+ type: Type,
847847+ handler: EventListenerOrEventListenerObject<EventMap[Type]>,
848848+ options?: EventTargetEventListenerOptions | boolean,
849849+ ): void
850850+ /**
851851+ * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
852852+ *
853853+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
854854+ */
855855+ dispatchEvent(event: EventMap[keyof EventMap]): boolean
856856+}
857857+interface EventTargetEventListenerOptions {
858858+ capture?: boolean
859859+}
860860+interface EventTargetAddEventListenerOptions {
861861+ capture?: boolean
862862+ passive?: boolean
863863+ once?: boolean
864864+ signal?: AbortSignal
865865+}
866866+interface EventTargetHandlerObject {
867867+ handleEvent: (event: Event) => any | undefined
868868+}
869869+/**
870870+ * The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired.
871871+ *
872872+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
873873+ */
874874+declare class AbortController {
875875+ constructor()
876876+ /**
877877+ * The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired.
878878+ *
879879+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
880880+ */
881881+ get signal(): AbortSignal
882882+ /**
883883+ * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
884884+ *
885885+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
886886+ */
887887+ abort(reason?: any): void
888888+}
889889+/**
890890+ * The **`AbortSignal`** interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object.
891891+ *
892892+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
893893+ */
894894+declare abstract class AbortSignal extends EventTarget {
895895+ /**
896896+ * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
897897+ *
898898+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
899899+ */
900900+ static abort(reason?: any): AbortSignal
901901+ /**
902902+ * The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time.
903903+ *
904904+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static)
905905+ */
906906+ static timeout(delay: number): AbortSignal
907907+ /**
908908+ * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
909909+ *
910910+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
911911+ */
912912+ static any(signals: AbortSignal[]): AbortSignal
913913+ /**
914914+ * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
915915+ *
916916+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
917917+ */
918918+ get aborted(): boolean
919919+ /**
920920+ * The **`reason`** read-only property returns a JavaScript value that indicates the abort reason.
921921+ *
922922+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason)
923923+ */
924924+ get reason(): any
925925+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
926926+ get onabort(): any | null
927927+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
928928+ set onabort(value: any | null)
929929+ /**
930930+ * The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
931931+ *
932932+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
933933+ */
934934+ throwIfAborted(): void
935935+}
936936+interface Scheduler {
937937+ wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>
938938+}
939939+interface SchedulerWaitOptions {
940940+ signal?: AbortSignal
941941+}
942942+/**
943943+ * The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
944944+ *
945945+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
946946+ */
947947+declare abstract class ExtendableEvent extends Event {
948948+ /**
949949+ * The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
950950+ *
951951+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
952952+ */
953953+ waitUntil(promise: Promise<any>): void
954954+}
955955+/**
956956+ * The **`CustomEvent`** interface represents events initialized by an application for any purpose.
957957+ *
958958+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
959959+ */
960960+declare class CustomEvent<T = any> extends Event {
961961+ constructor(type: string, init?: CustomEventCustomEventInit)
962962+ /**
963963+ * The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event.
964964+ *
965965+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
966966+ */
967967+ get detail(): T
968968+}
969969+interface CustomEventCustomEventInit {
970970+ bubbles?: boolean
971971+ cancelable?: boolean
972972+ composed?: boolean
973973+ detail?: any
974974+}
975975+/**
976976+ * The **`Blob`** interface represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a ReadableStream so its methods can be used for processing the data.
977977+ *
978978+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
979979+ */
980980+declare class Blob {
981981+ constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions)
982982+ /**
983983+ * The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes.
984984+ *
985985+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size)
986986+ */
987987+ get size(): number
988988+ /**
989989+ * The **`type`** read-only property of the Blob interface returns the MIME type of the file.
990990+ *
991991+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type)
992992+ */
993993+ get type(): string
994994+ /**
995995+ * The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
996996+ *
997997+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
998998+ */
999999+ slice(start?: number, end?: number, type?: string): Blob
10001000+ /**
10011001+ * The **`arrayBuffer()`** method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer.
10021002+ *
10031003+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer)
10041004+ */
10051005+ arrayBuffer(): Promise<ArrayBuffer>
10061006+ /**
10071007+ * The **`bytes()`** method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.
10081008+ *
10091009+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes)
10101010+ */
10111011+ bytes(): Promise<Uint8Array>
10121012+ /**
10131013+ * The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
10141014+ *
10151015+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
10161016+ */
10171017+ text(): Promise<string>
10181018+ /**
10191019+ * The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
10201020+ *
10211021+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
10221022+ */
10231023+ stream(): ReadableStream
10241024+}
10251025+interface BlobOptions {
10261026+ type?: string
10271027+}
10281028+/**
10291029+ * The **`File`** interface provides information about files and allows JavaScript in a web page to access their content.
10301030+ *
10311031+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
10321032+ */
10331033+declare class File extends Blob {
10341034+ constructor(
10351035+ bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
10361036+ name: string,
10371037+ options?: FileOptions,
10381038+ )
10391039+ /**
10401040+ * The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
10411041+ *
10421042+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
10431043+ */
10441044+ get name(): string
10451045+ /**
10461046+ * The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
10471047+ *
10481048+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
10491049+ */
10501050+ get lastModified(): number
10511051+}
10521052+interface FileOptions {
10531053+ type?: string
10541054+ lastModified?: number
10551055+}
10561056+/**
10571057+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
10581058+ *
10591059+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
10601060+ */
10611061+declare abstract class CacheStorage {
10621062+ /**
10631063+ * The **`open()`** method of the the Cache object matching the `cacheName`.
10641064+ *
10651065+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
10661066+ */
10671067+ open(cacheName: string): Promise<Cache>
10681068+ readonly default: Cache
10691069+}
10701070+/**
10711071+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
10721072+ *
10731073+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
10741074+ */
10751075+declare abstract class Cache {
10761076+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
10771077+ delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>
10781078+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
10791079+ match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>
10801080+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
10811081+ put(request: RequestInfo | URL, response: Response): Promise<void>
10821082+}
10831083+interface CacheQueryOptions {
10841084+ ignoreMethod?: boolean
10851085+}
10861086+/**
10871087+ * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
10881088+ * The Workers runtime implements the full surface of this API, but with some differences in
10891089+ * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
10901090+ * compared to those implemented in most browsers.
10911091+ *
10921092+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
10931093+ */
10941094+declare abstract class Crypto {
10951095+ /**
10961096+ * The **`Crypto.subtle`** read-only property returns a cryptographic operations.
10971097+ * Available only in secure contexts.
10981098+ *
10991099+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
11001100+ */
11011101+ get subtle(): SubtleCrypto
11021102+ /**
11031103+ * The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
11041104+ *
11051105+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
11061106+ */
11071107+ getRandomValues<
11081108+ T extends
11091109+ | Int8Array
11101110+ | Uint8Array
11111111+ | Int16Array
11121112+ | Uint16Array
11131113+ | Int32Array
11141114+ | Uint32Array
11151115+ | BigInt64Array
11161116+ | BigUint64Array,
11171117+ >(buffer: T): T
11181118+ /**
11191119+ * The **`randomUUID()`** method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator.
11201120+ * Available only in secure contexts.
11211121+ *
11221122+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
11231123+ */
11241124+ randomUUID(): string
11251125+ DigestStream: typeof DigestStream
11261126+}
11271127+/**
11281128+ * The **`SubtleCrypto`** interface of the Web Crypto API provides a number of low-level cryptographic functions.
11291129+ * Available only in secure contexts.
11301130+ *
11311131+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
11321132+ */
11331133+declare abstract class SubtleCrypto {
11341134+ /**
11351135+ * The **`encrypt()`** method of the SubtleCrypto interface encrypts data.
11361136+ *
11371137+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt)
11381138+ */
11391139+ encrypt(
11401140+ algorithm: string | SubtleCryptoEncryptAlgorithm,
11411141+ key: CryptoKey,
11421142+ plainText: ArrayBuffer | ArrayBufferView,
11431143+ ): Promise<ArrayBuffer>
11441144+ /**
11451145+ * The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
11461146+ *
11471147+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
11481148+ */
11491149+ decrypt(
11501150+ algorithm: string | SubtleCryptoEncryptAlgorithm,
11511151+ key: CryptoKey,
11521152+ cipherText: ArrayBuffer | ArrayBufferView,
11531153+ ): Promise<ArrayBuffer>
11541154+ /**
11551155+ * The **`sign()`** method of the SubtleCrypto interface generates a digital signature.
11561156+ *
11571157+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign)
11581158+ */
11591159+ sign(
11601160+ algorithm: string | SubtleCryptoSignAlgorithm,
11611161+ key: CryptoKey,
11621162+ data: ArrayBuffer | ArrayBufferView,
11631163+ ): Promise<ArrayBuffer>
11641164+ /**
11651165+ * The **`verify()`** method of the SubtleCrypto interface verifies a digital signature.
11661166+ *
11671167+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify)
11681168+ */
11691169+ verify(
11701170+ algorithm: string | SubtleCryptoSignAlgorithm,
11711171+ key: CryptoKey,
11721172+ signature: ArrayBuffer | ArrayBufferView,
11731173+ data: ArrayBuffer | ArrayBufferView,
11741174+ ): Promise<boolean>
11751175+ /**
11761176+ * The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
11771177+ *
11781178+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
11791179+ */
11801180+ digest(
11811181+ algorithm: string | SubtleCryptoHashAlgorithm,
11821182+ data: ArrayBuffer | ArrayBufferView,
11831183+ ): Promise<ArrayBuffer>
11841184+ /**
11851185+ * The **`generateKey()`** method of the SubtleCrypto interface is used to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms).
11861186+ *
11871187+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey)
11881188+ */
11891189+ generateKey(
11901190+ algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
11911191+ extractable: boolean,
11921192+ keyUsages: string[],
11931193+ ): Promise<CryptoKey | CryptoKeyPair>
11941194+ /**
11951195+ * The **`deriveKey()`** method of the SubtleCrypto interface can be used to derive a secret key from a master key.
11961196+ *
11971197+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey)
11981198+ */
11991199+ deriveKey(
12001200+ algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
12011201+ baseKey: CryptoKey,
12021202+ derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
12031203+ extractable: boolean,
12041204+ keyUsages: string[],
12051205+ ): Promise<CryptoKey>
12061206+ /**
12071207+ * The **`deriveBits()`** method of the key.
12081208+ *
12091209+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
12101210+ */
12111211+ deriveBits(
12121212+ algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
12131213+ baseKey: CryptoKey,
12141214+ length?: number | null,
12151215+ ): Promise<ArrayBuffer>
12161216+ /**
12171217+ * The **`importKey()`** method of the SubtleCrypto interface imports a key: that is, it takes as input a key in an external, portable format and gives you a CryptoKey object that you can use in the Web Crypto API.
12181218+ *
12191219+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey)
12201220+ */
12211221+ importKey(
12221222+ format: string,
12231223+ keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
12241224+ algorithm: string | SubtleCryptoImportKeyAlgorithm,
12251225+ extractable: boolean,
12261226+ keyUsages: string[],
12271227+ ): Promise<CryptoKey>
12281228+ /**
12291229+ * The **`exportKey()`** method of the SubtleCrypto interface exports a key: that is, it takes as input a CryptoKey object and gives you the key in an external, portable format.
12301230+ *
12311231+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey)
12321232+ */
12331233+ exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>
12341234+ /**
12351235+ * The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key.
12361236+ *
12371237+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
12381238+ */
12391239+ wrapKey(
12401240+ format: string,
12411241+ key: CryptoKey,
12421242+ wrappingKey: CryptoKey,
12431243+ wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
12441244+ ): Promise<ArrayBuffer>
12451245+ /**
12461246+ * The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
12471247+ *
12481248+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
12491249+ */
12501250+ unwrapKey(
12511251+ format: string,
12521252+ wrappedKey: ArrayBuffer | ArrayBufferView,
12531253+ unwrappingKey: CryptoKey,
12541254+ unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
12551255+ unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
12561256+ extractable: boolean,
12571257+ keyUsages: string[],
12581258+ ): Promise<CryptoKey>
12591259+ timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean
12601260+}
12611261+/**
12621262+ * The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey.
12631263+ * Available only in secure contexts.
12641264+ *
12651265+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
12661266+ */
12671267+declare abstract class CryptoKey {
12681268+ /**
12691269+ * The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object.
12701270+ *
12711271+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
12721272+ */
12731273+ readonly type: string
12741274+ /**
12751275+ * The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`.
12761276+ *
12771277+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
12781278+ */
12791279+ readonly extractable: boolean
12801280+ /**
12811281+ * The read-only **`algorithm`** property of the CryptoKey interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters.
12821282+ *
12831283+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm)
12841284+ */
12851285+ readonly algorithm:
12861286+ | CryptoKeyKeyAlgorithm
12871287+ | CryptoKeyAesKeyAlgorithm
12881288+ | CryptoKeyHmacKeyAlgorithm
12891289+ | CryptoKeyRsaKeyAlgorithm
12901290+ | CryptoKeyEllipticKeyAlgorithm
12911291+ | CryptoKeyArbitraryKeyAlgorithm
12921292+ /**
12931293+ * The read-only **`usages`** property of the CryptoKey interface indicates what can be done with the key.
12941294+ *
12951295+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages)
12961296+ */
12971297+ readonly usages: string[]
12981298+}
12991299+interface CryptoKeyPair {
13001300+ publicKey: CryptoKey
13011301+ privateKey: CryptoKey
13021302+}
13031303+interface JsonWebKey {
13041304+ kty: string
13051305+ use?: string
13061306+ key_ops?: string[]
13071307+ alg?: string
13081308+ ext?: boolean
13091309+ crv?: string
13101310+ x?: string
13111311+ y?: string
13121312+ d?: string
13131313+ n?: string
13141314+ e?: string
13151315+ p?: string
13161316+ q?: string
13171317+ dp?: string
13181318+ dq?: string
13191319+ qi?: string
13201320+ oth?: RsaOtherPrimesInfo[]
13211321+ k?: string
13221322+}
13231323+interface RsaOtherPrimesInfo {
13241324+ r?: string
13251325+ d?: string
13261326+ t?: string
13271327+}
13281328+interface SubtleCryptoDeriveKeyAlgorithm {
13291329+ name: string
13301330+ salt?: ArrayBuffer | ArrayBufferView
13311331+ iterations?: number
13321332+ hash?: string | SubtleCryptoHashAlgorithm
13331333+ $public?: CryptoKey
13341334+ info?: ArrayBuffer | ArrayBufferView
13351335+}
13361336+interface SubtleCryptoEncryptAlgorithm {
13371337+ name: string
13381338+ iv?: ArrayBuffer | ArrayBufferView
13391339+ additionalData?: ArrayBuffer | ArrayBufferView
13401340+ tagLength?: number
13411341+ counter?: ArrayBuffer | ArrayBufferView
13421342+ length?: number
13431343+ label?: ArrayBuffer | ArrayBufferView
13441344+}
13451345+interface SubtleCryptoGenerateKeyAlgorithm {
13461346+ name: string
13471347+ hash?: string | SubtleCryptoHashAlgorithm
13481348+ modulusLength?: number
13491349+ publicExponent?: ArrayBuffer | ArrayBufferView
13501350+ length?: number
13511351+ namedCurve?: string
13521352+}
13531353+interface SubtleCryptoHashAlgorithm {
13541354+ name: string
13551355+}
13561356+interface SubtleCryptoImportKeyAlgorithm {
13571357+ name: string
13581358+ hash?: string | SubtleCryptoHashAlgorithm
13591359+ length?: number
13601360+ namedCurve?: string
13611361+ compressed?: boolean
13621362+}
13631363+interface SubtleCryptoSignAlgorithm {
13641364+ name: string
13651365+ hash?: string | SubtleCryptoHashAlgorithm
13661366+ dataLength?: number
13671367+ saltLength?: number
13681368+}
13691369+interface CryptoKeyKeyAlgorithm {
13701370+ name: string
13711371+}
13721372+interface CryptoKeyAesKeyAlgorithm {
13731373+ name: string
13741374+ length: number
13751375+}
13761376+interface CryptoKeyHmacKeyAlgorithm {
13771377+ name: string
13781378+ hash: CryptoKeyKeyAlgorithm
13791379+ length: number
13801380+}
13811381+interface CryptoKeyRsaKeyAlgorithm {
13821382+ name: string
13831383+ modulusLength: number
13841384+ publicExponent: ArrayBuffer | ArrayBufferView
13851385+ hash?: CryptoKeyKeyAlgorithm
13861386+}
13871387+interface CryptoKeyEllipticKeyAlgorithm {
13881388+ name: string
13891389+ namedCurve: string
13901390+}
13911391+interface CryptoKeyArbitraryKeyAlgorithm {
13921392+ name: string
13931393+ hash?: CryptoKeyKeyAlgorithm
13941394+ namedCurve?: string
13951395+ length?: number
13961396+}
13971397+declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
13981398+ constructor(algorithm: string | SubtleCryptoHashAlgorithm)
13991399+ readonly digest: Promise<ArrayBuffer>
14001400+ get bytesWritten(): number | bigint
14011401+}
14021402+/**
14031403+ * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc.
14041404+ *
14051405+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
14061406+ */
14071407+declare class TextDecoder {
14081408+ constructor(label?: string, options?: TextDecoderConstructorOptions)
14091409+ /**
14101410+ * The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter.
14111411+ *
14121412+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
14131413+ */
14141414+ decode(input?: ArrayBuffer | ArrayBufferView, options?: TextDecoderDecodeOptions): string
14151415+ get encoding(): string
14161416+ get fatal(): boolean
14171417+ get ignoreBOM(): boolean
14181418+}
14191419+/**
14201420+ * The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes.
14211421+ *
14221422+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
14231423+ */
14241424+declare class TextEncoder {
14251425+ constructor()
14261426+ /**
14271427+ * The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
14281428+ *
14291429+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
14301430+ */
14311431+ encode(input?: string): Uint8Array
14321432+ /**
14331433+ * The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
14341434+ *
14351435+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
14361436+ */
14371437+ encodeInto(input: string, buffer: Uint8Array): TextEncoderEncodeIntoResult
14381438+ get encoding(): string
14391439+}
14401440+interface TextDecoderConstructorOptions {
14411441+ fatal: boolean
14421442+ ignoreBOM: boolean
14431443+}
14441444+interface TextDecoderDecodeOptions {
14451445+ stream: boolean
14461446+}
14471447+interface TextEncoderEncodeIntoResult {
14481448+ read: number
14491449+ written: number
14501450+}
14511451+/**
14521452+ * The **`ErrorEvent`** interface represents events providing information related to errors in scripts or in files.
14531453+ *
14541454+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
14551455+ */
14561456+declare class ErrorEvent extends Event {
14571457+ constructor(type: string, init?: ErrorEventErrorEventInit)
14581458+ /**
14591459+ * The **`filename`** read-only property of the ErrorEvent interface returns a string containing the name of the script file in which the error occurred.
14601460+ *
14611461+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename)
14621462+ */
14631463+ get filename(): string
14641464+ /**
14651465+ * The **`message`** read-only property of the ErrorEvent interface returns a string containing a human-readable error message describing the problem.
14661466+ *
14671467+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message)
14681468+ */
14691469+ get message(): string
14701470+ /**
14711471+ * The **`lineno`** read-only property of the ErrorEvent interface returns an integer containing the line number of the script file on which the error occurred.
14721472+ *
14731473+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno)
14741474+ */
14751475+ get lineno(): number
14761476+ /**
14771477+ * The **`colno`** read-only property of the ErrorEvent interface returns an integer containing the column number of the script file on which the error occurred.
14781478+ *
14791479+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno)
14801480+ */
14811481+ get colno(): number
14821482+ /**
14831483+ * The **`error`** read-only property of the ErrorEvent interface returns a JavaScript value, such as an Error or DOMException, representing the error associated with this event.
14841484+ *
14851485+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error)
14861486+ */
14871487+ get error(): any
14881488+}
14891489+interface ErrorEventErrorEventInit {
14901490+ message?: string
14911491+ filename?: string
14921492+ lineno?: number
14931493+ colno?: number
14941494+ error?: any
14951495+}
14961496+/**
14971497+ * The **`MessageEvent`** interface represents a message received by a target object.
14981498+ *
14991499+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
15001500+ */
15011501+declare class MessageEvent extends Event {
15021502+ constructor(type: string, initializer: MessageEventInit)
15031503+ /**
15041504+ * The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.
15051505+ *
15061506+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
15071507+ */
15081508+ readonly data: any
15091509+ /**
15101510+ * The **`origin`** read-only property of the origin of the message emitter.
15111511+ *
15121512+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
15131513+ */
15141514+ readonly origin: string | null
15151515+ /**
15161516+ * The **`lastEventId`** read-only property of the unique ID for the event.
15171517+ *
15181518+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
15191519+ */
15201520+ readonly lastEventId: string
15211521+ /**
15221522+ * The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter.
15231523+ *
15241524+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
15251525+ */
15261526+ readonly source: MessagePort | null
15271527+ /**
15281528+ * The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order.
15291529+ *
15301530+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
15311531+ */
15321532+ readonly ports: MessagePort[]
15331533+}
15341534+interface MessageEventInit {
15351535+ data: ArrayBuffer | string
15361536+}
15371537+/**
15381538+ * The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected.
15391539+ *
15401540+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
15411541+ */
15421542+declare abstract class PromiseRejectionEvent extends Event {
15431543+ /**
15441544+ * The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected.
15451545+ *
15461546+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
15471547+ */
15481548+ readonly promise: Promise<any>
15491549+ /**
15501550+ * The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject().
15511551+ *
15521552+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
15531553+ */
15541554+ readonly reason: any
15551555+}
15561556+/**
15571557+ * The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods.
15581558+ *
15591559+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
15601560+ */
15611561+declare class FormData {
15621562+ constructor()
15631563+ /**
15641564+ * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
15651565+ *
15661566+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
15671567+ */
15681568+ append(name: string, value: string): void
15691569+ /**
15701570+ * The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
15711571+ *
15721572+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
15731573+ */
15741574+ append(name: string, value: Blob, filename?: string): void
15751575+ /**
15761576+ * The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object.
15771577+ *
15781578+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
15791579+ */
15801580+ delete(name: string): void
15811581+ /**
15821582+ * The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object.
15831583+ *
15841584+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
15851585+ */
15861586+ get(name: string): (File | string) | null
15871587+ /**
15881588+ * The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object.
15891589+ *
15901590+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
15911591+ */
15921592+ getAll(name: string): (File | string)[]
15931593+ /**
15941594+ * The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key.
15951595+ *
15961596+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
15971597+ */
15981598+ has(name: string): boolean
15991599+ /**
16001600+ * The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
16011601+ *
16021602+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
16031603+ */
16041604+ set(name: string, value: string): void
16051605+ /**
16061606+ * The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
16071607+ *
16081608+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
16091609+ */
16101610+ set(name: string, value: Blob, filename?: string): void
16111611+ /* Returns an array of key, value pairs for every entry in the list. */
16121612+ entries(): IterableIterator<[key: string, value: File | string]>
16131613+ /* Returns a list of keys in the list. */
16141614+ keys(): IterableIterator<string>
16151615+ /* Returns a list of values in the list. */
16161616+ values(): IterableIterator<File | string>
16171617+ forEach<This = unknown>(
16181618+ callback: (this: This, value: File | string, key: string, parent: FormData) => void,
16191619+ thisArg?: This,
16201620+ ): void
16211621+ [Symbol.iterator](): IterableIterator<[key: string, value: File | string]>
16221622+}
16231623+interface ContentOptions {
16241624+ html?: boolean
16251625+}
16261626+declare class HTMLRewriter {
16271627+ constructor()
16281628+ on(selector: string, handlers: HTMLRewriterElementContentHandlers): HTMLRewriter
16291629+ onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter
16301630+ transform(response: Response): Response
16311631+}
16321632+interface HTMLRewriterElementContentHandlers {
16331633+ element?(element: Element): void | Promise<void>
16341634+ comments?(comment: Comment): void | Promise<void>
16351635+ text?(element: Text): void | Promise<void>
16361636+}
16371637+interface HTMLRewriterDocumentContentHandlers {
16381638+ doctype?(doctype: Doctype): void | Promise<void>
16391639+ comments?(comment: Comment): void | Promise<void>
16401640+ text?(text: Text): void | Promise<void>
16411641+ end?(end: DocumentEnd): void | Promise<void>
16421642+}
16431643+interface Doctype {
16441644+ readonly name: string | null
16451645+ readonly publicId: string | null
16461646+ readonly systemId: string | null
16471647+}
16481648+interface Element {
16491649+ tagName: string
16501650+ readonly attributes: IterableIterator<string[]>
16511651+ readonly removed: boolean
16521652+ readonly namespaceURI: string
16531653+ getAttribute(name: string): string | null
16541654+ hasAttribute(name: string): boolean
16551655+ setAttribute(name: string, value: string): Element
16561656+ removeAttribute(name: string): Element
16571657+ before(content: string | ReadableStream | Response, options?: ContentOptions): Element
16581658+ after(content: string | ReadableStream | Response, options?: ContentOptions): Element
16591659+ prepend(content: string | ReadableStream | Response, options?: ContentOptions): Element
16601660+ append(content: string | ReadableStream | Response, options?: ContentOptions): Element
16611661+ replace(content: string | ReadableStream | Response, options?: ContentOptions): Element
16621662+ remove(): Element
16631663+ removeAndKeepContent(): Element
16641664+ setInnerContent(content: string | ReadableStream | Response, options?: ContentOptions): Element
16651665+ onEndTag(handler: (tag: EndTag) => void | Promise<void>): void
16661666+}
16671667+interface EndTag {
16681668+ name: string
16691669+ before(content: string | ReadableStream | Response, options?: ContentOptions): EndTag
16701670+ after(content: string | ReadableStream | Response, options?: ContentOptions): EndTag
16711671+ remove(): EndTag
16721672+}
16731673+interface Comment {
16741674+ text: string
16751675+ readonly removed: boolean
16761676+ before(content: string, options?: ContentOptions): Comment
16771677+ after(content: string, options?: ContentOptions): Comment
16781678+ replace(content: string, options?: ContentOptions): Comment
16791679+ remove(): Comment
16801680+}
16811681+interface Text {
16821682+ readonly text: string
16831683+ readonly lastInTextNode: boolean
16841684+ readonly removed: boolean
16851685+ before(content: string | ReadableStream | Response, options?: ContentOptions): Text
16861686+ after(content: string | ReadableStream | Response, options?: ContentOptions): Text
16871687+ replace(content: string | ReadableStream | Response, options?: ContentOptions): Text
16881688+ remove(): Text
16891689+}
16901690+interface DocumentEnd {
16911691+ append(content: string, options?: ContentOptions): DocumentEnd
16921692+}
16931693+/**
16941694+ * This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope.
16951695+ *
16961696+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
16971697+ */
16981698+declare abstract class FetchEvent extends ExtendableEvent {
16991699+ /**
17001700+ * The **`request`** read-only property of the the event handler.
17011701+ *
17021702+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
17031703+ */
17041704+ readonly request: Request
17051705+ /**
17061706+ * The **`respondWith()`** method of allows you to provide a promise for a Response yourself.
17071707+ *
17081708+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
17091709+ */
17101710+ respondWith(promise: Response | Promise<Response>): void
17111711+ passThroughOnException(): void
17121712+}
17131713+type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>
17141714+/**
17151715+ * The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
17161716+ *
17171717+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
17181718+ */
17191719+declare class Headers {
17201720+ constructor(init?: HeadersInit)
17211721+ /**
17221722+ * The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name.
17231723+ *
17241724+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
17251725+ */
17261726+ get(name: string): string | null
17271727+ getAll(name: string): string[]
17281728+ /**
17291729+ * The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response.
17301730+ *
17311731+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
17321732+ */
17331733+ getSetCookie(): string[]
17341734+ /**
17351735+ * The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header.
17361736+ *
17371737+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
17381738+ */
17391739+ has(name: string): boolean
17401740+ /**
17411741+ * The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
17421742+ *
17431743+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
17441744+ */
17451745+ set(name: string, value: string): void
17461746+ /**
17471747+ * The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
17481748+ *
17491749+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
17501750+ */
17511751+ append(name: string, value: string): void
17521752+ /**
17531753+ * The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object.
17541754+ *
17551755+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
17561756+ */
17571757+ delete(name: string): void
17581758+ forEach<This = unknown>(
17591759+ callback: (this: This, value: string, key: string, parent: Headers) => void,
17601760+ thisArg?: This,
17611761+ ): void
17621762+ /* Returns an iterator allowing to go through all key/value pairs contained in this object. */
17631763+ entries(): IterableIterator<[key: string, value: string]>
17641764+ /* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
17651765+ keys(): IterableIterator<string>
17661766+ /* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
17671767+ values(): IterableIterator<string>
17681768+ [Symbol.iterator](): IterableIterator<[key: string, value: string]>
17691769+}
17701770+type BodyInit =
17711771+ | ReadableStream<Uint8Array>
17721772+ | string
17731773+ | ArrayBuffer
17741774+ | ArrayBufferView
17751775+ | Blob
17761776+ | URLSearchParams
17771777+ | FormData
17781778+declare abstract class Body {
17791779+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
17801780+ get body(): ReadableStream | null
17811781+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
17821782+ get bodyUsed(): boolean
17831783+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
17841784+ arrayBuffer(): Promise<ArrayBuffer>
17851785+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */
17861786+ bytes(): Promise<Uint8Array>
17871787+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
17881788+ text(): Promise<string>
17891789+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
17901790+ json<T>(): Promise<T>
17911791+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
17921792+ formData(): Promise<FormData>
17931793+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
17941794+ blob(): Promise<Blob>
17951795+}
17961796+/**
17971797+ * The **`Response`** interface of the Fetch API represents the response to a request.
17981798+ *
17991799+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
18001800+ */
18011801+declare var Response: {
18021802+ prototype: Response
18031803+ new (body?: BodyInit | null, init?: ResponseInit): Response
18041804+ error(): Response
18051805+ redirect(url: string, status?: number): Response
18061806+ json(any: any, maybeInit?: ResponseInit | Response): Response
18071807+}
18081808+/**
18091809+ * The **`Response`** interface of the Fetch API represents the response to a request.
18101810+ *
18111811+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
18121812+ */
18131813+interface Response extends Body {
18141814+ /**
18151815+ * The **`clone()`** method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable.
18161816+ *
18171817+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone)
18181818+ */
18191819+ clone(): Response
18201820+ /**
18211821+ * The **`status`** read-only property of the Response interface contains the HTTP status codes of the response.
18221822+ *
18231823+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status)
18241824+ */
18251825+ status: number
18261826+ /**
18271827+ * The **`statusText`** read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status.
18281828+ *
18291829+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText)
18301830+ */
18311831+ statusText: string
18321832+ /**
18331833+ * The **`headers`** read-only property of the with the response.
18341834+ *
18351835+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
18361836+ */
18371837+ headers: Headers
18381838+ /**
18391839+ * The **`ok`** read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not.
18401840+ *
18411841+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok)
18421842+ */
18431843+ ok: boolean
18441844+ /**
18451845+ * The **`redirected`** read-only property of the Response interface indicates whether or not the response is the result of a request you made which was redirected.
18461846+ *
18471847+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected)
18481848+ */
18491849+ redirected: boolean
18501850+ /**
18511851+ * The **`url`** read-only property of the Response interface contains the URL of the response.
18521852+ *
18531853+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
18541854+ */
18551855+ url: string
18561856+ webSocket: WebSocket | null
18571857+ cf: any | undefined
18581858+ /**
18591859+ * The **`type`** read-only property of the Response interface contains the type of the response.
18601860+ *
18611861+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
18621862+ */
18631863+ type: 'default' | 'error'
18641864+}
18651865+interface ResponseInit {
18661866+ status?: number
18671867+ statusText?: string
18681868+ headers?: HeadersInit
18691869+ cf?: any
18701870+ webSocket?: WebSocket | null
18711871+ encodeBody?: 'automatic' | 'manual'
18721872+}
18731873+type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
18741874+ | Request<CfHostMetadata, Cf>
18751875+ | string
18761876+/**
18771877+ * The **`Request`** interface of the Fetch API represents a resource request.
18781878+ *
18791879+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
18801880+ */
18811881+declare var Request: {
18821882+ prototype: Request
18831883+ new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
18841884+ input: RequestInfo<CfProperties> | URL,
18851885+ init?: RequestInit<Cf>,
18861886+ ): Request<CfHostMetadata, Cf>
18871887+}
18881888+/**
18891889+ * The **`Request`** interface of the Fetch API represents a resource request.
18901890+ *
18911891+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
18921892+ */
18931893+interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
18941894+ /**
18951895+ * The **`clone()`** method of the Request interface creates a copy of the current `Request` object.
18961896+ *
18971897+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
18981898+ */
18991899+ clone(): Request<CfHostMetadata, Cf>
19001900+ /**
19011901+ * The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request.
19021902+ *
19031903+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
19041904+ */
19051905+ method: string
19061906+ /**
19071907+ * The **`url`** read-only property of the Request interface contains the URL of the request.
19081908+ *
19091909+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
19101910+ */
19111911+ url: string
19121912+ /**
19131913+ * The **`headers`** read-only property of the with the request.
19141914+ *
19151915+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
19161916+ */
19171917+ headers: Headers
19181918+ /**
19191919+ * The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled.
19201920+ *
19211921+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
19221922+ */
19231923+ redirect: string
19241924+ fetcher: Fetcher | null
19251925+ /**
19261926+ * The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request.
19271927+ *
19281928+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
19291929+ */
19301930+ signal: AbortSignal
19311931+ cf: Cf | undefined
19321932+ /**
19331933+ * The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request.
19341934+ *
19351935+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
19361936+ */
19371937+ integrity: string
19381938+ /**
19391939+ * The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
19401940+ *
19411941+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
19421942+ */
19431943+ keepalive: boolean
19441944+ /**
19451945+ * The **`cache`** read-only property of the Request interface contains the cache mode of the request.
19461946+ *
19471947+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
19481948+ */
19491949+ cache?: 'no-store' | 'no-cache'
19501950+}
19511951+interface RequestInit<Cf = CfProperties> {
19521952+ /* A string to set request's method. */
19531953+ method?: string
19541954+ /* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
19551955+ headers?: HeadersInit
19561956+ /* A BodyInit object or null to set request's body. */
19571957+ body?: BodyInit | null
19581958+ /* 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. */
19591959+ redirect?: string
19601960+ fetcher?: Fetcher | null
19611961+ cf?: Cf
19621962+ /* A string indicating how the request will interact with the browser's cache to set request's cache. */
19631963+ cache?: 'no-store' | 'no-cache'
19641964+ /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
19651965+ integrity?: string
19661966+ /* An AbortSignal to set request's signal. */
19671967+ signal?: AbortSignal | null
19681968+ encodeResponseBody?: 'automatic' | 'manual'
19691969+}
19701970+type Service<
19711971+ T extends
19721972+ | (new (...args: any[]) => Rpc.WorkerEntrypointBranded)
19731973+ | Rpc.WorkerEntrypointBranded
19741974+ | ExportedHandler<any, any, any>
19751975+ | undefined = undefined,
19761976+> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded
19771977+ ? Fetcher<InstanceType<T>>
19781978+ : T extends Rpc.WorkerEntrypointBranded
19791979+ ? Fetcher<T>
19801980+ : T extends Exclude<Rpc.EntrypointBranded, Rpc.WorkerEntrypointBranded>
19811981+ ? never
19821982+ : Fetcher<undefined>
19831983+type Fetcher<
19841984+ T extends Rpc.EntrypointBranded | undefined = undefined,
19851985+ Reserved extends string = never,
19861986+> = (T extends Rpc.EntrypointBranded
19871987+ ? Rpc.Provider<T, Reserved | 'fetch' | 'connect'>
19881988+ : unknown) & {
19891989+ fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>
19901990+ connect(address: SocketAddress | string, options?: SocketOptions): Socket
19911991+}
19921992+interface KVNamespaceListKey<Metadata, Key extends string = string> {
19931993+ name: Key
19941994+ expiration?: number
19951995+ metadata?: Metadata
19961996+}
19971997+type KVNamespaceListResult<Metadata, Key extends string = string> =
19981998+ | {
19991999+ list_complete: false
20002000+ keys: KVNamespaceListKey<Metadata, Key>[]
20012001+ cursor: string
20022002+ cacheStatus: string | null
20032003+ }
20042004+ | {
20052005+ list_complete: true
20062006+ keys: KVNamespaceListKey<Metadata, Key>[]
20072007+ cacheStatus: string | null
20082008+ }
20092009+interface KVNamespace<Key extends string = string> {
20102010+ get(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<string | null>
20112011+ get(key: Key, type: 'text'): Promise<string | null>
20122012+ get<ExpectedValue = unknown>(key: Key, type: 'json'): Promise<ExpectedValue | null>
20132013+ get(key: Key, type: 'arrayBuffer'): Promise<ArrayBuffer | null>
20142014+ get(key: Key, type: 'stream'): Promise<ReadableStream | null>
20152015+ get(key: Key, options?: KVNamespaceGetOptions<'text'>): Promise<string | null>
20162016+ get<ExpectedValue = unknown>(
20172017+ key: Key,
20182018+ options?: KVNamespaceGetOptions<'json'>,
20192019+ ): Promise<ExpectedValue | null>
20202020+ get(key: Key, options?: KVNamespaceGetOptions<'arrayBuffer'>): Promise<ArrayBuffer | null>
20212021+ get(key: Key, options?: KVNamespaceGetOptions<'stream'>): Promise<ReadableStream | null>
20222022+ get(key: Array<Key>, type: 'text'): Promise<Map<string, string | null>>
20232023+ get<ExpectedValue = unknown>(
20242024+ key: Array<Key>,
20252025+ type: 'json',
20262026+ ): Promise<Map<string, ExpectedValue | null>>
20272027+ get(
20282028+ key: Array<Key>,
20292029+ options?: Partial<KVNamespaceGetOptions<undefined>>,
20302030+ ): Promise<Map<string, string | null>>
20312031+ get(key: Array<Key>, options?: KVNamespaceGetOptions<'text'>): Promise<Map<string, string | null>>
20322032+ get<ExpectedValue = unknown>(
20332033+ key: Array<Key>,
20342034+ options?: KVNamespaceGetOptions<'json'>,
20352035+ ): Promise<Map<string, ExpectedValue | null>>
20362036+ list<Metadata = unknown>(
20372037+ options?: KVNamespaceListOptions,
20382038+ ): Promise<KVNamespaceListResult<Metadata, Key>>
20392039+ put(
20402040+ key: Key,
20412041+ value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
20422042+ options?: KVNamespacePutOptions,
20432043+ ): Promise<void>
20442044+ getWithMetadata<Metadata = unknown>(
20452045+ key: Key,
20462046+ options?: Partial<KVNamespaceGetOptions<undefined>>,
20472047+ ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>
20482048+ getWithMetadata<Metadata = unknown>(
20492049+ key: Key,
20502050+ type: 'text',
20512051+ ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>
20522052+ getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
20532053+ key: Key,
20542054+ type: 'json',
20552055+ ): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>
20562056+ getWithMetadata<Metadata = unknown>(
20572057+ key: Key,
20582058+ type: 'arrayBuffer',
20592059+ ): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>
20602060+ getWithMetadata<Metadata = unknown>(
20612061+ key: Key,
20622062+ type: 'stream',
20632063+ ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>
20642064+ getWithMetadata<Metadata = unknown>(
20652065+ key: Key,
20662066+ options: KVNamespaceGetOptions<'text'>,
20672067+ ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>
20682068+ getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
20692069+ key: Key,
20702070+ options: KVNamespaceGetOptions<'json'>,
20712071+ ): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>
20722072+ getWithMetadata<Metadata = unknown>(
20732073+ key: Key,
20742074+ options: KVNamespaceGetOptions<'arrayBuffer'>,
20752075+ ): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>
20762076+ getWithMetadata<Metadata = unknown>(
20772077+ key: Key,
20782078+ options: KVNamespaceGetOptions<'stream'>,
20792079+ ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>
20802080+ getWithMetadata<Metadata = unknown>(
20812081+ key: Array<Key>,
20822082+ type: 'text',
20832083+ ): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>
20842084+ getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
20852085+ key: Array<Key>,
20862086+ type: 'json',
20872087+ ): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>
20882088+ getWithMetadata<Metadata = unknown>(
20892089+ key: Array<Key>,
20902090+ options?: Partial<KVNamespaceGetOptions<undefined>>,
20912091+ ): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>
20922092+ getWithMetadata<Metadata = unknown>(
20932093+ key: Array<Key>,
20942094+ options?: KVNamespaceGetOptions<'text'>,
20952095+ ): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>
20962096+ getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
20972097+ key: Array<Key>,
20982098+ options?: KVNamespaceGetOptions<'json'>,
20992099+ ): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>
21002100+ delete(key: Key): Promise<void>
21012101+}
21022102+interface KVNamespaceListOptions {
21032103+ limit?: number
21042104+ prefix?: string | null
21052105+ cursor?: string | null
21062106+}
21072107+interface KVNamespaceGetOptions<Type> {
21082108+ type: Type
21092109+ cacheTtl?: number
21102110+}
21112111+interface KVNamespacePutOptions {
21122112+ expiration?: number
21132113+ expirationTtl?: number
21142114+ metadata?: any | null
21152115+}
21162116+interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
21172117+ value: Value | null
21182118+ metadata: Metadata | null
21192119+ cacheStatus: string | null
21202120+}
21212121+type QueueContentType = 'text' | 'bytes' | 'json' | 'v8'
21222122+interface Queue<Body = unknown> {
21232123+ send(message: Body, options?: QueueSendOptions): Promise<void>
21242124+ sendBatch(
21252125+ messages: Iterable<MessageSendRequest<Body>>,
21262126+ options?: QueueSendBatchOptions,
21272127+ ): Promise<void>
21282128+}
21292129+interface QueueSendOptions {
21302130+ contentType?: QueueContentType
21312131+ delaySeconds?: number
21322132+}
21332133+interface QueueSendBatchOptions {
21342134+ delaySeconds?: number
21352135+}
21362136+interface MessageSendRequest<Body = unknown> {
21372137+ body: Body
21382138+ contentType?: QueueContentType
21392139+ delaySeconds?: number
21402140+}
21412141+interface QueueRetryOptions {
21422142+ delaySeconds?: number
21432143+}
21442144+interface Message<Body = unknown> {
21452145+ readonly id: string
21462146+ readonly timestamp: Date
21472147+ readonly body: Body
21482148+ readonly attempts: number
21492149+ retry(options?: QueueRetryOptions): void
21502150+ ack(): void
21512151+}
21522152+interface QueueEvent<Body = unknown> extends ExtendableEvent {
21532153+ readonly messages: readonly Message<Body>[]
21542154+ readonly queue: string
21552155+ retryAll(options?: QueueRetryOptions): void
21562156+ ackAll(): void
21572157+}
21582158+interface MessageBatch<Body = unknown> {
21592159+ readonly messages: readonly Message<Body>[]
21602160+ readonly queue: string
21612161+ retryAll(options?: QueueRetryOptions): void
21622162+ ackAll(): void
21632163+}
21642164+interface R2Error extends Error {
21652165+ readonly name: string
21662166+ readonly code: number
21672167+ readonly message: string
21682168+ readonly action: string
21692169+ readonly stack: any
21702170+}
21712171+interface R2ListOptions {
21722172+ limit?: number
21732173+ prefix?: string
21742174+ cursor?: string
21752175+ delimiter?: string
21762176+ startAfter?: string
21772177+ include?: ('httpMetadata' | 'customMetadata')[]
21782178+}
21792179+declare abstract class R2Bucket {
21802180+ head(key: string): Promise<R2Object | null>
21812181+ get(
21822182+ key: string,
21832183+ options: R2GetOptions & {
21842184+ onlyIf: R2Conditional | Headers
21852185+ },
21862186+ ): Promise<R2ObjectBody | R2Object | null>
21872187+ get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>
21882188+ put(
21892189+ key: string,
21902190+ value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob,
21912191+ options?: R2PutOptions & {
21922192+ onlyIf: R2Conditional | Headers
21932193+ },
21942194+ ): Promise<R2Object | null>
21952195+ put(
21962196+ key: string,
21972197+ value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob,
21982198+ options?: R2PutOptions,
21992199+ ): Promise<R2Object>
22002200+ createMultipartUpload(key: string, options?: R2MultipartOptions): Promise<R2MultipartUpload>
22012201+ resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload
22022202+ delete(keys: string | string[]): Promise<void>
22032203+ list(options?: R2ListOptions): Promise<R2Objects>
22042204+}
22052205+interface R2MultipartUpload {
22062206+ readonly key: string
22072207+ readonly uploadId: string
22082208+ uploadPart(
22092209+ partNumber: number,
22102210+ value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
22112211+ options?: R2UploadPartOptions,
22122212+ ): Promise<R2UploadedPart>
22132213+ abort(): Promise<void>
22142214+ complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>
22152215+}
22162216+interface R2UploadedPart {
22172217+ partNumber: number
22182218+ etag: string
22192219+}
22202220+declare abstract class R2Object {
22212221+ readonly key: string
22222222+ readonly version: string
22232223+ readonly size: number
22242224+ readonly etag: string
22252225+ readonly httpEtag: string
22262226+ readonly checksums: R2Checksums
22272227+ readonly uploaded: Date
22282228+ readonly httpMetadata?: R2HTTPMetadata
22292229+ readonly customMetadata?: Record<string, string>
22302230+ readonly range?: R2Range
22312231+ readonly storageClass: string
22322232+ readonly ssecKeyMd5?: string
22332233+ writeHttpMetadata(headers: Headers): void
22342234+}
22352235+interface R2ObjectBody extends R2Object {
22362236+ get body(): ReadableStream
22372237+ get bodyUsed(): boolean
22382238+ arrayBuffer(): Promise<ArrayBuffer>
22392239+ bytes(): Promise<Uint8Array>
22402240+ text(): Promise<string>
22412241+ json<T>(): Promise<T>
22422242+ blob(): Promise<Blob>
22432243+}
22442244+type R2Range =
22452245+ | {
22462246+ offset: number
22472247+ length?: number
22482248+ }
22492249+ | {
22502250+ offset?: number
22512251+ length: number
22522252+ }
22532253+ | {
22542254+ suffix: number
22552255+ }
22562256+interface R2Conditional {
22572257+ etagMatches?: string
22582258+ etagDoesNotMatch?: string
22592259+ uploadedBefore?: Date
22602260+ uploadedAfter?: Date
22612261+ secondsGranularity?: boolean
22622262+}
22632263+interface R2GetOptions {
22642264+ onlyIf?: R2Conditional | Headers
22652265+ range?: R2Range | Headers
22662266+ ssecKey?: ArrayBuffer | string
22672267+}
22682268+interface R2PutOptions {
22692269+ onlyIf?: R2Conditional | Headers
22702270+ httpMetadata?: R2HTTPMetadata | Headers
22712271+ customMetadata?: Record<string, string>
22722272+ md5?: (ArrayBuffer | ArrayBufferView) | string
22732273+ sha1?: (ArrayBuffer | ArrayBufferView) | string
22742274+ sha256?: (ArrayBuffer | ArrayBufferView) | string
22752275+ sha384?: (ArrayBuffer | ArrayBufferView) | string
22762276+ sha512?: (ArrayBuffer | ArrayBufferView) | string
22772277+ storageClass?: string
22782278+ ssecKey?: ArrayBuffer | string
22792279+}
22802280+interface R2MultipartOptions {
22812281+ httpMetadata?: R2HTTPMetadata | Headers
22822282+ customMetadata?: Record<string, string>
22832283+ storageClass?: string
22842284+ ssecKey?: ArrayBuffer | string
22852285+}
22862286+interface R2Checksums {
22872287+ readonly md5?: ArrayBuffer
22882288+ readonly sha1?: ArrayBuffer
22892289+ readonly sha256?: ArrayBuffer
22902290+ readonly sha384?: ArrayBuffer
22912291+ readonly sha512?: ArrayBuffer
22922292+ toJSON(): R2StringChecksums
22932293+}
22942294+interface R2StringChecksums {
22952295+ md5?: string
22962296+ sha1?: string
22972297+ sha256?: string
22982298+ sha384?: string
22992299+ sha512?: string
23002300+}
23012301+interface R2HTTPMetadata {
23022302+ contentType?: string
23032303+ contentLanguage?: string
23042304+ contentDisposition?: string
23052305+ contentEncoding?: string
23062306+ cacheControl?: string
23072307+ cacheExpiry?: Date
23082308+}
23092309+type R2Objects = {
23102310+ objects: R2Object[]
23112311+ delimitedPrefixes: string[]
23122312+} & (
23132313+ | {
23142314+ truncated: true
23152315+ cursor: string
23162316+ }
23172317+ | {
23182318+ truncated: false
23192319+ }
23202320+)
23212321+interface R2UploadPartOptions {
23222322+ ssecKey?: ArrayBuffer | string
23232323+}
23242324+declare abstract class ScheduledEvent extends ExtendableEvent {
23252325+ readonly scheduledTime: number
23262326+ readonly cron: string
23272327+ noRetry(): void
23282328+}
23292329+interface ScheduledController {
23302330+ readonly scheduledTime: number
23312331+ readonly cron: string
23322332+ noRetry(): void
23332333+}
23342334+interface QueuingStrategy<T = any> {
23352335+ highWaterMark?: number | bigint
23362336+ size?: (chunk: T) => number | bigint
23372337+}
23382338+interface UnderlyingSink<W = any> {
23392339+ type?: string
23402340+ start?: (controller: WritableStreamDefaultController) => void | Promise<void>
23412341+ write?: (chunk: W, controller: WritableStreamDefaultController) => void | Promise<void>
23422342+ abort?: (reason: any) => void | Promise<void>
23432343+ close?: () => void | Promise<void>
23442344+}
23452345+interface UnderlyingByteSource {
23462346+ type: 'bytes'
23472347+ autoAllocateChunkSize?: number
23482348+ start?: (controller: ReadableByteStreamController) => void | Promise<void>
23492349+ pull?: (controller: ReadableByteStreamController) => void | Promise<void>
23502350+ cancel?: (reason: any) => void | Promise<void>
23512351+}
23522352+interface UnderlyingSource<R = any> {
23532353+ type?: '' | undefined
23542354+ start?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>
23552355+ pull?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>
23562356+ cancel?: (reason: any) => void | Promise<void>
23572357+ expectedLength?: number | bigint
23582358+}
23592359+interface Transformer<I = any, O = any> {
23602360+ readableType?: string
23612361+ writableType?: string
23622362+ start?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>
23632363+ transform?: (chunk: I, controller: TransformStreamDefaultController<O>) => void | Promise<void>
23642364+ flush?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>
23652365+ cancel?: (reason: any) => void | Promise<void>
23662366+ expectedLength?: number
23672367+}
23682368+interface StreamPipeOptions {
23692369+ /**
23702370+ * 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.
23712371+ *
23722372+ * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
23732373+ *
23742374+ * Errors and closures of the source and destination streams propagate as follows:
23752375+ *
23762376+ * 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.
23772377+ *
23782378+ * 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.
23792379+ *
23802380+ * 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.
23812381+ *
23822382+ * 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.
23832383+ *
23842384+ * 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.
23852385+ */
23862386+ preventClose?: boolean
23872387+ preventAbort?: boolean
23882388+ preventCancel?: boolean
23892389+ signal?: AbortSignal
23902390+}
23912391+type ReadableStreamReadResult<R = any> =
23922392+ | {
23932393+ done: false
23942394+ value: R
23952395+ }
23962396+ | {
23972397+ done: true
23982398+ value?: undefined
23992399+ }
24002400+/**
24012401+ * The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
24022402+ *
24032403+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
24042404+ */
24052405+interface ReadableStream<R = any> {
24062406+ /**
24072407+ * The **`locked`** read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.
24082408+ *
24092409+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked)
24102410+ */
24112411+ get locked(): boolean
24122412+ /**
24132413+ * The **`cancel()`** method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.
24142414+ *
24152415+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel)
24162416+ */
24172417+ cancel(reason?: any): Promise<void>
24182418+ /**
24192419+ * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
24202420+ *
24212421+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
24222422+ */
24232423+ getReader(): ReadableStreamDefaultReader<R>
24242424+ /**
24252425+ * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
24262426+ *
24272427+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
24282428+ */
24292429+ getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader
24302430+ /**
24312431+ * The **`pipeThrough()`** method of the ReadableStream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
24322432+ *
24332433+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough)
24342434+ */
24352435+ pipeThrough<T>(
24362436+ transform: ReadableWritablePair<T, R>,
24372437+ options?: StreamPipeOptions,
24382438+ ): ReadableStream<T>
24392439+ /**
24402440+ * The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
24412441+ *
24422442+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
24432443+ */
24442444+ pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>
24452445+ /**
24462446+ * The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
24472447+ *
24482448+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
24492449+ */
24502450+ tee(): [ReadableStream<R>, ReadableStream<R>]
24512451+ values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>
24522452+ [Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>
24532453+}
24542454+/**
24552455+ * The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
24562456+ *
24572457+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
24582458+ */
24592459+declare const ReadableStream: {
24602460+ prototype: ReadableStream
24612461+ new (
24622462+ underlyingSource: UnderlyingByteSource,
24632463+ strategy?: QueuingStrategy<Uint8Array>,
24642464+ ): ReadableStream<Uint8Array>
24652465+ new <R = any>(
24662466+ underlyingSource?: UnderlyingSource<R>,
24672467+ strategy?: QueuingStrategy<R>,
24682468+ ): ReadableStream<R>
24692469+}
24702470+/**
24712471+ * The **`ReadableStreamDefaultReader`** interface of the Streams API represents a default reader that can be used to read stream data supplied from a network (such as a fetch request).
24722472+ *
24732473+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader)
24742474+ */
24752475+declare class ReadableStreamDefaultReader<R = any> {
24762476+ constructor(stream: ReadableStream)
24772477+ get closed(): Promise<void>
24782478+ cancel(reason?: any): Promise<void>
24792479+ /**
24802480+ * The **`read()`** method of the ReadableStreamDefaultReader interface returns a Promise providing access to the next chunk in the stream's internal queue.
24812481+ *
24822482+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read)
24832483+ */
24842484+ read(): Promise<ReadableStreamReadResult<R>>
24852485+ /**
24862486+ * The **`releaseLock()`** method of the ReadableStreamDefaultReader interface releases the reader's lock on the stream.
24872487+ *
24882488+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock)
24892489+ */
24902490+ releaseLock(): void
24912491+}
24922492+/**
24932493+ * The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.
24942494+ *
24952495+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
24962496+ */
24972497+declare class ReadableStreamBYOBReader {
24982498+ constructor(stream: ReadableStream)
24992499+ get closed(): Promise<void>
25002500+ cancel(reason?: any): Promise<void>
25012501+ /**
25022502+ * The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.
25032503+ *
25042504+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
25052505+ */
25062506+ read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>
25072507+ /**
25082508+ * The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
25092509+ *
25102510+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
25112511+ */
25122512+ releaseLock(): void
25132513+ readAtLeast<T extends ArrayBufferView>(
25142514+ minElements: number,
25152515+ view: T,
25162516+ ): Promise<ReadableStreamReadResult<T>>
25172517+}
25182518+interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
25192519+ min?: number
25202520+}
25212521+interface ReadableStreamGetReaderOptions {
25222522+ /**
25232523+ * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
25242524+ *
25252525+ * 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.
25262526+ */
25272527+ mode: 'byob'
25282528+}
25292529+/**
25302530+ * The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
25312531+ *
25322532+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
25332533+ */
25342534+declare abstract class ReadableStreamBYOBRequest {
25352535+ /**
25362536+ * The **`view`** getter property of the ReadableStreamBYOBRequest interface returns the current view.
25372537+ *
25382538+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view)
25392539+ */
25402540+ get view(): Uint8Array | null
25412541+ /**
25422542+ * The **`respond()`** method of the ReadableStreamBYOBRequest interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the ReadableStreamBYOBRequest.view.
25432543+ *
25442544+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond)
25452545+ */
25462546+ respond(bytesWritten: number): void
25472547+ /**
25482548+ * The **`respondWithNewView()`** method of the ReadableStreamBYOBRequest interface specifies a new view that the consumer of the associated readable byte stream should write to instead of ReadableStreamBYOBRequest.view.
25492549+ *
25502550+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)
25512551+ */
25522552+ respondWithNewView(view: ArrayBuffer | ArrayBufferView): void
25532553+ get atLeast(): number | null
25542554+}
25552555+/**
25562556+ * The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.
25572557+ *
25582558+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
25592559+ */
25602560+declare abstract class ReadableStreamDefaultController<R = any> {
25612561+ /**
25622562+ * The **`desiredSize`** read-only property of the required to fill the stream's internal queue.
25632563+ *
25642564+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
25652565+ */
25662566+ get desiredSize(): number | null
25672567+ /**
25682568+ * The **`close()`** method of the ReadableStreamDefaultController interface closes the associated stream.
25692569+ *
25702570+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close)
25712571+ */
25722572+ close(): void
25732573+ /**
25742574+ * The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue.
25752575+ *
25762576+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
25772577+ */
25782578+ enqueue(chunk?: R): void
25792579+ /**
25802580+ * The **`error()`** method of the with the associated stream to error.
25812581+ *
25822582+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
25832583+ */
25842584+ error(reason: any): void
25852585+}
25862586+/**
25872587+ * The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream.
25882588+ *
25892589+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
25902590+ */
25912591+declare abstract class ReadableByteStreamController {
25922592+ /**
25932593+ * The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests.
25942594+ *
25952595+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
25962596+ */
25972597+ get byobRequest(): ReadableStreamBYOBRequest | null
25982598+ /**
25992599+ * The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'.
26002600+ *
26012601+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
26022602+ */
26032603+ get desiredSize(): number | null
26042604+ /**
26052605+ * The **`close()`** method of the ReadableByteStreamController interface closes the associated stream.
26062606+ *
26072607+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close)
26082608+ */
26092609+ close(): void
26102610+ /**
26112611+ * The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues).
26122612+ *
26132613+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
26142614+ */
26152615+ enqueue(chunk: ArrayBuffer | ArrayBufferView): void
26162616+ /**
26172617+ * The **`error()`** method of the ReadableByteStreamController interface causes any future interactions with the associated stream to error with the specified reason.
26182618+ *
26192619+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error)
26202620+ */
26212621+ error(reason: any): void
26222622+}
26232623+/**
26242624+ * The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state.
26252625+ *
26262626+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
26272627+ */
26282628+declare abstract class WritableStreamDefaultController {
26292629+ /**
26302630+ * The read-only **`signal`** property of the WritableStreamDefaultController interface returns the AbortSignal associated with the controller.
26312631+ *
26322632+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal)
26332633+ */
26342634+ get signal(): AbortSignal
26352635+ /**
26362636+ * The **`error()`** method of the with the associated stream to error.
26372637+ *
26382638+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
26392639+ */
26402640+ error(reason?: any): void
26412641+}
26422642+/**
26432643+ * The **`TransformStreamDefaultController`** interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream.
26442644+ *
26452645+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController)
26462646+ */
26472647+declare abstract class TransformStreamDefaultController<O = any> {
26482648+ /**
26492649+ * The **`desiredSize`** read-only property of the TransformStreamDefaultController interface returns the desired size to fill the queue of the associated ReadableStream.
26502650+ *
26512651+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize)
26522652+ */
26532653+ get desiredSize(): number | null
26542654+ /**
26552655+ * The **`enqueue()`** method of the TransformStreamDefaultController interface enqueues the given chunk in the readable side of the stream.
26562656+ *
26572657+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue)
26582658+ */
26592659+ enqueue(chunk?: O): void
26602660+ /**
26612661+ * The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream.
26622662+ *
26632663+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
26642664+ */
26652665+ error(reason: any): void
26662666+ /**
26672667+ * The **`terminate()`** method of the TransformStreamDefaultController interface closes the readable side and errors the writable side of the stream.
26682668+ *
26692669+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate)
26702670+ */
26712671+ terminate(): void
26722672+}
26732673+interface ReadableWritablePair<R = any, W = any> {
26742674+ /**
26752675+ * 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.
26762676+ *
26772677+ * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
26782678+ */
26792679+ writable: WritableStream<W>
26802680+ readable: ReadableStream<R>
26812681+}
26822682+/**
26832683+ * The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
26842684+ *
26852685+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
26862686+ */
26872687+declare class WritableStream<W = any> {
26882688+ constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy)
26892689+ /**
26902690+ * The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer.
26912691+ *
26922692+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
26932693+ */
26942694+ get locked(): boolean
26952695+ /**
26962696+ * The **`abort()`** method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
26972697+ *
26982698+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
26992699+ */
27002700+ abort(reason?: any): Promise<void>
27012701+ /**
27022702+ * The **`close()`** method of the WritableStream interface closes the associated stream.
27032703+ *
27042704+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
27052705+ */
27062706+ close(): Promise<void>
27072707+ /**
27082708+ * The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
27092709+ *
27102710+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
27112711+ */
27122712+ getWriter(): WritableStreamDefaultWriter<W>
27132713+}
27142714+/**
27152715+ * The **`WritableStreamDefaultWriter`** interface of the Streams API 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.
27162716+ *
27172717+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
27182718+ */
27192719+declare class WritableStreamDefaultWriter<W = any> {
27202720+ constructor(stream: WritableStream)
27212721+ /**
27222722+ * The **`closed`** read-only property of the the stream errors or the writer's lock is released.
27232723+ *
27242724+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
27252725+ */
27262726+ get closed(): Promise<void>
27272727+ /**
27282728+ * The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
27292729+ *
27302730+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
27312731+ */
27322732+ get ready(): Promise<void>
27332733+ /**
27342734+ * The **`desiredSize`** read-only property of the to fill the stream's internal queue.
27352735+ *
27362736+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
27372737+ */
27382738+ get desiredSize(): number | null
27392739+ /**
27402740+ * The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
27412741+ *
27422742+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
27432743+ */
27442744+ abort(reason?: any): Promise<void>
27452745+ /**
27462746+ * The **`close()`** method of the stream.
27472747+ *
27482748+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
27492749+ */
27502750+ close(): Promise<void>
27512751+ /**
27522752+ * The **`write()`** method of the operation.
27532753+ *
27542754+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
27552755+ */
27562756+ write(chunk?: W): Promise<void>
27572757+ /**
27582758+ * The **`releaseLock()`** method of the corresponding stream.
27592759+ *
27602760+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
27612761+ */
27622762+ releaseLock(): void
27632763+}
27642764+/**
27652765+ * The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept.
27662766+ *
27672767+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
27682768+ */
27692769+declare class TransformStream<I = any, O = any> {
27702770+ constructor(
27712771+ transformer?: Transformer<I, O>,
27722772+ writableStrategy?: QueuingStrategy<I>,
27732773+ readableStrategy?: QueuingStrategy<O>,
27742774+ )
27752775+ /**
27762776+ * The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`.
27772777+ *
27782778+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
27792779+ */
27802780+ get readable(): ReadableStream<O>
27812781+ /**
27822782+ * The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`.
27832783+ *
27842784+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
27852785+ */
27862786+ get writable(): WritableStream<I>
27872787+}
27882788+declare class FixedLengthStream extends IdentityTransformStream {
27892789+ constructor(
27902790+ expectedLength: number | bigint,
27912791+ queuingStrategy?: IdentityTransformStreamQueuingStrategy,
27922792+ )
27932793+}
27942794+declare class IdentityTransformStream extends TransformStream<
27952795+ ArrayBuffer | ArrayBufferView,
27962796+ Uint8Array
27972797+> {
27982798+ constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy)
27992799+}
28002800+interface IdentityTransformStreamQueuingStrategy {
28012801+ highWaterMark?: number | bigint
28022802+}
28032803+interface ReadableStreamValuesOptions {
28042804+ preventCancel?: boolean
28052805+}
28062806+/**
28072807+ * The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data.
28082808+ *
28092809+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
28102810+ */
28112811+declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
28122812+ constructor(format: 'gzip' | 'deflate' | 'deflate-raw')
28132813+}
28142814+/**
28152815+ * The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data.
28162816+ *
28172817+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
28182818+ */
28192819+declare class DecompressionStream extends TransformStream<
28202820+ ArrayBuffer | ArrayBufferView,
28212821+ Uint8Array
28222822+> {
28232823+ constructor(format: 'gzip' | 'deflate' | 'deflate-raw')
28242824+}
28252825+/**
28262826+ * The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding.
28272827+ *
28282828+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
28292829+ */
28302830+declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
28312831+ constructor()
28322832+ get encoding(): string
28332833+}
28342834+/**
28352835+ * The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
28362836+ *
28372837+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
28382838+ */
28392839+declare class TextDecoderStream extends TransformStream<ArrayBuffer | ArrayBufferView, string> {
28402840+ constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit)
28412841+ get encoding(): string
28422842+ get fatal(): boolean
28432843+ get ignoreBOM(): boolean
28442844+}
28452845+interface TextDecoderStreamTextDecoderStreamInit {
28462846+ fatal?: boolean
28472847+ ignoreBOM?: boolean
28482848+}
28492849+/**
28502850+ * The **`ByteLengthQueuingStrategy`** interface of the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams.
28512851+ *
28522852+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
28532853+ */
28542854+declare class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> {
28552855+ constructor(init: QueuingStrategyInit)
28562856+ /**
28572857+ * The read-only **`ByteLengthQueuingStrategy.highWaterMark`** property returns the total number of bytes that can be contained in the internal queue before backpressure is applied.
28582858+ *
28592859+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark)
28602860+ */
28612861+ get highWaterMark(): number
28622862+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
28632863+ get size(): (chunk?: any) => number
28642864+}
28652865+/**
28662866+ * The **`CountQueuingStrategy`** interface of the Streams API provides a built-in chunk counting queuing strategy that can be used when constructing streams.
28672867+ *
28682868+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
28692869+ */
28702870+declare class CountQueuingStrategy implements QueuingStrategy {
28712871+ constructor(init: QueuingStrategyInit)
28722872+ /**
28732873+ * The read-only **`CountQueuingStrategy.highWaterMark`** property returns the total number of chunks that can be contained in the internal queue before backpressure is applied.
28742874+ *
28752875+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark)
28762876+ */
28772877+ get highWaterMark(): number
28782878+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
28792879+ get size(): (chunk?: any) => number
28802880+}
28812881+interface QueuingStrategyInit {
28822882+ /**
28832883+ * Creates a new ByteLengthQueuingStrategy with the provided high water mark.
28842884+ *
28852885+ * 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.
28862886+ */
28872887+ highWaterMark: number
28882888+}
28892889+interface ScriptVersion {
28902890+ id?: string
28912891+ tag?: string
28922892+ message?: string
28932893+}
28942894+declare abstract class TailEvent extends ExtendableEvent {
28952895+ readonly events: TraceItem[]
28962896+ readonly traces: TraceItem[]
28972897+}
28982898+interface TraceItem {
28992899+ readonly event:
29002900+ | (
29012901+ | TraceItemFetchEventInfo
29022902+ | TraceItemJsRpcEventInfo
29032903+ | TraceItemScheduledEventInfo
29042904+ | TraceItemAlarmEventInfo
29052905+ | TraceItemQueueEventInfo
29062906+ | TraceItemEmailEventInfo
29072907+ | TraceItemTailEventInfo
29082908+ | TraceItemCustomEventInfo
29092909+ | TraceItemHibernatableWebSocketEventInfo
29102910+ )
29112911+ | null
29122912+ readonly eventTimestamp: number | null
29132913+ readonly logs: TraceLog[]
29142914+ readonly exceptions: TraceException[]
29152915+ readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[]
29162916+ readonly scriptName: string | null
29172917+ readonly entrypoint?: string
29182918+ readonly scriptVersion?: ScriptVersion
29192919+ readonly dispatchNamespace?: string
29202920+ readonly scriptTags?: string[]
29212921+ readonly durableObjectId?: string
29222922+ readonly outcome: string
29232923+ readonly executionModel: string
29242924+ readonly truncated: boolean
29252925+ readonly cpuTime: number
29262926+ readonly wallTime: number
29272927+}
29282928+interface TraceItemAlarmEventInfo {
29292929+ readonly scheduledTime: Date
29302930+}
29312931+interface TraceItemCustomEventInfo {}
29322932+interface TraceItemScheduledEventInfo {
29332933+ readonly scheduledTime: number
29342934+ readonly cron: string
29352935+}
29362936+interface TraceItemQueueEventInfo {
29372937+ readonly queue: string
29382938+ readonly batchSize: number
29392939+}
29402940+interface TraceItemEmailEventInfo {
29412941+ readonly mailFrom: string
29422942+ readonly rcptTo: string
29432943+ readonly rawSize: number
29442944+}
29452945+interface TraceItemTailEventInfo {
29462946+ readonly consumedEvents: TraceItemTailEventInfoTailItem[]
29472947+}
29482948+interface TraceItemTailEventInfoTailItem {
29492949+ readonly scriptName: string | null
29502950+}
29512951+interface TraceItemFetchEventInfo {
29522952+ readonly response?: TraceItemFetchEventInfoResponse
29532953+ readonly request: TraceItemFetchEventInfoRequest
29542954+}
29552955+interface TraceItemFetchEventInfoRequest {
29562956+ readonly cf?: any
29572957+ readonly headers: Record<string, string>
29582958+ readonly method: string
29592959+ readonly url: string
29602960+ getUnredacted(): TraceItemFetchEventInfoRequest
29612961+}
29622962+interface TraceItemFetchEventInfoResponse {
29632963+ readonly status: number
29642964+}
29652965+interface TraceItemJsRpcEventInfo {
29662966+ readonly rpcMethod: string
29672967+}
29682968+interface TraceItemHibernatableWebSocketEventInfo {
29692969+ readonly getWebSocketEvent:
29702970+ | TraceItemHibernatableWebSocketEventInfoMessage
29712971+ | TraceItemHibernatableWebSocketEventInfoClose
29722972+ | TraceItemHibernatableWebSocketEventInfoError
29732973+}
29742974+interface TraceItemHibernatableWebSocketEventInfoMessage {
29752975+ readonly webSocketEventType: string
29762976+}
29772977+interface TraceItemHibernatableWebSocketEventInfoClose {
29782978+ readonly webSocketEventType: string
29792979+ readonly code: number
29802980+ readonly wasClean: boolean
29812981+}
29822982+interface TraceItemHibernatableWebSocketEventInfoError {
29832983+ readonly webSocketEventType: string
29842984+}
29852985+interface TraceLog {
29862986+ readonly timestamp: number
29872987+ readonly level: string
29882988+ readonly message: any
29892989+}
29902990+interface TraceException {
29912991+ readonly timestamp: number
29922992+ readonly message: string
29932993+ readonly name: string
29942994+ readonly stack?: string
29952995+}
29962996+interface TraceDiagnosticChannelEvent {
29972997+ readonly timestamp: number
29982998+ readonly channel: string
29992999+ readonly message: any
30003000+}
30013001+interface TraceMetrics {
30023002+ readonly cpuTime: number
30033003+ readonly wallTime: number
30043004+}
30053005+interface UnsafeTraceMetrics {
30063006+ fromTrace(item: TraceItem): TraceMetrics
30073007+}
30083008+/**
30093009+ * The **`URL`** interface is used to parse, construct, normalize, and encode URL.
30103010+ *
30113011+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
30123012+ */
30133013+declare class URL {
30143014+ constructor(url: string | URL, base?: string | URL)
30153015+ /**
30163016+ * The **`origin`** read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL.
30173017+ *
30183018+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin)
30193019+ */
30203020+ get origin(): string
30213021+ /**
30223022+ * The **`href`** property of the URL interface is a string containing the whole URL.
30233023+ *
30243024+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href)
30253025+ */
30263026+ get href(): string
30273027+ /**
30283028+ * The **`href`** property of the URL interface is a string containing the whole URL.
30293029+ *
30303030+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href)
30313031+ */
30323032+ set href(value: string)
30333033+ /**
30343034+ * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
30353035+ *
30363036+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
30373037+ */
30383038+ get protocol(): string
30393039+ /**
30403040+ * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
30413041+ *
30423042+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
30433043+ */
30443044+ set protocol(value: string)
30453045+ /**
30463046+ * The **`username`** property of the URL interface is a string containing the username component of the URL.
30473047+ *
30483048+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
30493049+ */
30503050+ get username(): string
30513051+ /**
30523052+ * The **`username`** property of the URL interface is a string containing the username component of the URL.
30533053+ *
30543054+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
30553055+ */
30563056+ set username(value: string)
30573057+ /**
30583058+ * The **`password`** property of the URL interface is a string containing the password component of the URL.
30593059+ *
30603060+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
30613061+ */
30623062+ get password(): string
30633063+ /**
30643064+ * The **`password`** property of the URL interface is a string containing the password component of the URL.
30653065+ *
30663066+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
30673067+ */
30683068+ set password(value: string)
30693069+ /**
30703070+ * The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
30713071+ *
30723072+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
30733073+ */
30743074+ get host(): string
30753075+ /**
30763076+ * The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
30773077+ *
30783078+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
30793079+ */
30803080+ set host(value: string)
30813081+ /**
30823082+ * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
30833083+ *
30843084+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
30853085+ */
30863086+ get hostname(): string
30873087+ /**
30883088+ * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
30893089+ *
30903090+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
30913091+ */
30923092+ set hostname(value: string)
30933093+ /**
30943094+ * The **`port`** property of the URL interface is a string containing the port number of the URL.
30953095+ *
30963096+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
30973097+ */
30983098+ get port(): string
30993099+ /**
31003100+ * The **`port`** property of the URL interface is a string containing the port number of the URL.
31013101+ *
31023102+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
31033103+ */
31043104+ set port(value: string)
31053105+ /**
31063106+ * The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
31073107+ *
31083108+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
31093109+ */
31103110+ get pathname(): string
31113111+ /**
31123112+ * The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
31133113+ *
31143114+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
31153115+ */
31163116+ set pathname(value: string)
31173117+ /**
31183118+ * The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
31193119+ *
31203120+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
31213121+ */
31223122+ get search(): string
31233123+ /**
31243124+ * The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
31253125+ *
31263126+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
31273127+ */
31283128+ set search(value: string)
31293129+ /**
31303130+ * The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
31313131+ *
31323132+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
31333133+ */
31343134+ get hash(): string
31353135+ /**
31363136+ * The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
31373137+ *
31383138+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
31393139+ */
31403140+ set hash(value: string)
31413141+ /**
31423142+ * The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL.
31433143+ *
31443144+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
31453145+ */
31463146+ get searchParams(): URLSearchParams
31473147+ /**
31483148+ * The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None.
31493149+ *
31503150+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
31513151+ */
31523152+ toJSON(): string
31533153+ /*function toString() { [native code] }*/
31543154+ toString(): string
31553155+ /**
31563156+ * The **`URL.canParse()`** static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid.
31573157+ *
31583158+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static)
31593159+ */
31603160+ static canParse(url: string, base?: string): boolean
31613161+ /**
31623162+ * The **`URL.parse()`** static method of the URL interface returns a newly created URL object representing the URL defined by the parameters.
31633163+ *
31643164+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static)
31653165+ */
31663166+ static parse(url: string, base?: string): URL | null
31673167+ /**
31683168+ * The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter.
31693169+ *
31703170+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
31713171+ */
31723172+ static createObjectURL(object: File | Blob): string
31733173+ /**
31743174+ * The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.
31753175+ *
31763176+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
31773177+ */
31783178+ static revokeObjectURL(object_url: string): void
31793179+}
31803180+/**
31813181+ * The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL.
31823182+ *
31833183+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
31843184+ */
31853185+declare class URLSearchParams {
31863186+ constructor(init?: Iterable<Iterable<string>> | Record<string, string> | string)
31873187+ /**
31883188+ * The **`size`** read-only property of the URLSearchParams interface indicates the total number of search parameter entries.
31893189+ *
31903190+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size)
31913191+ */
31923192+ get size(): number
31933193+ /**
31943194+ * The **`append()`** method of the URLSearchParams interface appends a specified key/value pair as a new search parameter.
31953195+ *
31963196+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
31973197+ */
31983198+ append(name: string, value: string): void
31993199+ /**
32003200+ * The **`delete()`** method of the URLSearchParams interface deletes specified parameters and their associated value(s) from the list of all search parameters.
32013201+ *
32023202+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
32033203+ */
32043204+ delete(name: string, value?: string): void
32053205+ /**
32063206+ * The **`get()`** method of the URLSearchParams interface returns the first value associated to the given search parameter.
32073207+ *
32083208+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
32093209+ */
32103210+ get(name: string): string | null
32113211+ /**
32123212+ * The **`getAll()`** method of the URLSearchParams interface returns all the values associated with a given search parameter as an array.
32133213+ *
32143214+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
32153215+ */
32163216+ getAll(name: string): string[]
32173217+ /**
32183218+ * The **`has()`** method of the URLSearchParams interface returns a boolean value that indicates whether the specified parameter is in the search parameters.
32193219+ *
32203220+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
32213221+ */
32223222+ has(name: string, value?: string): boolean
32233223+ /**
32243224+ * The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.
32253225+ *
32263226+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
32273227+ */
32283228+ set(name: string, value: string): void
32293229+ /**
32303230+ * The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`.
32313231+ *
32323232+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
32333233+ */
32343234+ sort(): void
32353235+ /* Returns an array of key, value pairs for every entry in the search params. */
32363236+ entries(): IterableIterator<[key: string, value: string]>
32373237+ /* Returns a list of keys in the search params. */
32383238+ keys(): IterableIterator<string>
32393239+ /* Returns a list of values in the search params. */
32403240+ values(): IterableIterator<string>
32413241+ forEach<This = unknown>(
32423242+ callback: (this: This, value: string, key: string, parent: URLSearchParams) => void,
32433243+ thisArg?: This,
32443244+ ): void
32453245+ /*function toString() { [native code] }*/
32463246+ toString(): string
32473247+ [Symbol.iterator](): IterableIterator<[key: string, value: string]>
32483248+}
32493249+declare class URLPattern {
32503250+ constructor(
32513251+ input?: string | URLPatternInit,
32523252+ baseURL?: string | URLPatternOptions,
32533253+ patternOptions?: URLPatternOptions,
32543254+ )
32553255+ get protocol(): string
32563256+ get username(): string
32573257+ get password(): string
32583258+ get hostname(): string
32593259+ get port(): string
32603260+ get pathname(): string
32613261+ get search(): string
32623262+ get hash(): string
32633263+ get hasRegExpGroups(): boolean
32643264+ test(input?: string | URLPatternInit, baseURL?: string): boolean
32653265+ exec(input?: string | URLPatternInit, baseURL?: string): URLPatternResult | null
32663266+}
32673267+interface URLPatternInit {
32683268+ protocol?: string
32693269+ username?: string
32703270+ password?: string
32713271+ hostname?: string
32723272+ port?: string
32733273+ pathname?: string
32743274+ search?: string
32753275+ hash?: string
32763276+ baseURL?: string
32773277+}
32783278+interface URLPatternComponentResult {
32793279+ input: string
32803280+ groups: Record<string, string>
32813281+}
32823282+interface URLPatternResult {
32833283+ inputs: (string | URLPatternInit)[]
32843284+ protocol: URLPatternComponentResult
32853285+ username: URLPatternComponentResult
32863286+ password: URLPatternComponentResult
32873287+ hostname: URLPatternComponentResult
32883288+ port: URLPatternComponentResult
32893289+ pathname: URLPatternComponentResult
32903290+ search: URLPatternComponentResult
32913291+ hash: URLPatternComponentResult
32923292+}
32933293+interface URLPatternOptions {
32943294+ ignoreCase?: boolean
32953295+}
32963296+/**
32973297+ * A `CloseEvent` is sent to clients using WebSockets when the connection is closed.
32983298+ *
32993299+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
33003300+ */
33013301+declare class CloseEvent extends Event {
33023302+ constructor(type: string, initializer?: CloseEventInit)
33033303+ /**
33043304+ * The **`code`** read-only property of the CloseEvent interface returns a WebSocket connection close code indicating the reason the connection was closed.
33053305+ *
33063306+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
33073307+ */
33083308+ readonly code: number
33093309+ /**
33103310+ * The **`reason`** read-only property of the CloseEvent interface returns the WebSocket connection close reason the server gave for closing the connection; that is, a concise human-readable prose explanation for the closure.
33113311+ *
33123312+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
33133313+ */
33143314+ readonly reason: string
33153315+ /**
33163316+ * The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly.
33173317+ *
33183318+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
33193319+ */
33203320+ readonly wasClean: boolean
33213321+}
33223322+interface CloseEventInit {
33233323+ code?: number
33243324+ reason?: string
33253325+ wasClean?: boolean
33263326+}
33273327+type WebSocketEventMap = {
33283328+ close: CloseEvent
33293329+ message: MessageEvent
33303330+ open: Event
33313331+ error: ErrorEvent
33323332+}
33333333+/**
33343334+ * The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
33353335+ *
33363336+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
33373337+ */
33383338+declare var WebSocket: {
33393339+ prototype: WebSocket
33403340+ new (url: string, protocols?: string[] | string): WebSocket
33413341+ readonly READY_STATE_CONNECTING: number
33423342+ readonly CONNECTING: number
33433343+ readonly READY_STATE_OPEN: number
33443344+ readonly OPEN: number
33453345+ readonly READY_STATE_CLOSING: number
33463346+ readonly CLOSING: number
33473347+ readonly READY_STATE_CLOSED: number
33483348+ readonly CLOSED: number
33493349+}
33503350+/**
33513351+ * The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
33523352+ *
33533353+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
33543354+ */
33553355+interface WebSocket extends EventTarget<WebSocketEventMap> {
33563356+ accept(): void
33573357+ /**
33583358+ * The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
33593359+ *
33603360+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
33613361+ */
33623362+ send(message: (ArrayBuffer | ArrayBufferView) | string): void
33633363+ /**
33643364+ * The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing.
33653365+ *
33663366+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
33673367+ */
33683368+ close(code?: number, reason?: string): void
33693369+ serializeAttachment(attachment: any): void
33703370+ deserializeAttachment(): any | null
33713371+ /**
33723372+ * The **`WebSocket.readyState`** read-only property returns the current state of the WebSocket connection.
33733373+ *
33743374+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
33753375+ */
33763376+ readyState: number
33773377+ /**
33783378+ * The **`WebSocket.url`** read-only property returns the absolute URL of the WebSocket as resolved by the constructor.
33793379+ *
33803380+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
33813381+ */
33823382+ url: string | null
33833383+ /**
33843384+ * The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established.
33853385+ *
33863386+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
33873387+ */
33883388+ protocol: string | null
33893389+ /**
33903390+ * The **`WebSocket.extensions`** read-only property returns the extensions selected by the server.
33913391+ *
33923392+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
33933393+ */
33943394+ extensions: string | null
33953395+}
33963396+declare const WebSocketPair: {
33973397+ new (): {
33983398+ 0: WebSocket
33993399+ 1: WebSocket
34003400+ }
34013401+}
34023402+interface SqlStorage {
34033403+ exec<T extends Record<string, SqlStorageValue>>(
34043404+ query: string,
34053405+ ...bindings: any[]
34063406+ ): SqlStorageCursor<T>
34073407+ get databaseSize(): number
34083408+ Cursor: typeof SqlStorageCursor
34093409+ Statement: typeof SqlStorageStatement
34103410+}
34113411+declare abstract class SqlStorageStatement {}
34123412+type SqlStorageValue = ArrayBuffer | string | number | null
34133413+declare abstract class SqlStorageCursor<T extends Record<string, SqlStorageValue>> {
34143414+ next():
34153415+ | {
34163416+ done?: false
34173417+ value: T
34183418+ }
34193419+ | {
34203420+ done: true
34213421+ value?: never
34223422+ }
34233423+ toArray(): T[]
34243424+ one(): T
34253425+ raw<U extends SqlStorageValue[]>(): IterableIterator<U>
34263426+ columnNames: string[]
34273427+ get rowsRead(): number
34283428+ get rowsWritten(): number
34293429+ [Symbol.iterator](): IterableIterator<T>
34303430+}
34313431+interface Socket {
34323432+ get readable(): ReadableStream
34333433+ get writable(): WritableStream
34343434+ get closed(): Promise<void>
34353435+ get opened(): Promise<SocketInfo>
34363436+ get upgraded(): boolean
34373437+ get secureTransport(): 'on' | 'off' | 'starttls'
34383438+ close(): Promise<void>
34393439+ startTls(options?: TlsOptions): Socket
34403440+}
34413441+interface SocketOptions {
34423442+ secureTransport?: string
34433443+ allowHalfOpen: boolean
34443444+ highWaterMark?: number | bigint
34453445+}
34463446+interface SocketAddress {
34473447+ hostname: string
34483448+ port: number
34493449+}
34503450+interface TlsOptions {
34513451+ expectedServerHostname?: string
34523452+}
34533453+interface SocketInfo {
34543454+ remoteAddress?: string
34553455+ localAddress?: string
34563456+}
34573457+/**
34583458+ * The **`EventSource`** interface is web content's interface to server-sent events.
34593459+ *
34603460+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource)
34613461+ */
34623462+declare class EventSource extends EventTarget {
34633463+ constructor(url: string, init?: EventSourceEventSourceInit)
34643464+ /**
34653465+ * The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None.
34663466+ *
34673467+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
34683468+ */
34693469+ close(): void
34703470+ /**
34713471+ * The **`url`** read-only property of the URL of the source.
34723472+ *
34733473+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
34743474+ */
34753475+ get url(): string
34763476+ /**
34773477+ * The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set.
34783478+ *
34793479+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
34803480+ */
34813481+ get withCredentials(): boolean
34823482+ /**
34833483+ * The **`readyState`** read-only property of the connection.
34843484+ *
34853485+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
34863486+ */
34873487+ get readyState(): number
34883488+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
34893489+ get onopen(): any | null
34903490+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
34913491+ set onopen(value: any | null)
34923492+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
34933493+ get onmessage(): any | null
34943494+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
34953495+ set onmessage(value: any | null)
34963496+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
34973497+ get onerror(): any | null
34983498+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
34993499+ set onerror(value: any | null)
35003500+ static readonly CONNECTING: number
35013501+ static readonly OPEN: number
35023502+ static readonly CLOSED: number
35033503+ static from(stream: ReadableStream): EventSource
35043504+}
35053505+interface EventSourceEventSourceInit {
35063506+ withCredentials?: boolean
35073507+ fetcher?: Fetcher
35083508+}
35093509+interface Container {
35103510+ get running(): boolean
35113511+ start(options?: ContainerStartupOptions): void
35123512+ monitor(): Promise<void>
35133513+ destroy(error?: any): Promise<void>
35143514+ signal(signo: number): void
35153515+ getTcpPort(port: number): Fetcher
35163516+ setInactivityTimeout(durationMs: number | bigint): Promise<void>
35173517+}
35183518+interface ContainerStartupOptions {
35193519+ entrypoint?: string[]
35203520+ enableInternet: boolean
35213521+ env?: Record<string, string>
35223522+ hardTimeout?: number | bigint
35233523+}
35243524+/**
35253525+ * The **`MessagePort`** interface of the Channel Messaging API 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.
35263526+ *
35273527+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort)
35283528+ */
35293529+declare abstract class MessagePort extends EventTarget {
35303530+ /**
35313531+ * The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts.
35323532+ *
35333533+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
35343534+ */
35353535+ postMessage(data?: any, options?: any[] | MessagePortPostMessageOptions): void
35363536+ /**
35373537+ * The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active.
35383538+ *
35393539+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
35403540+ */
35413541+ close(): void
35423542+ /**
35433543+ * The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port.
35443544+ *
35453545+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
35463546+ */
35473547+ start(): void
35483548+ get onmessage(): any | null
35493549+ set onmessage(value: any | null)
35503550+}
35513551+/**
35523552+ * The **`MessageChannel`** interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties.
35533553+ *
35543554+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel)
35553555+ */
35563556+declare class MessageChannel {
35573557+ constructor()
35583558+ /**
35593559+ * The **`port1`** read-only property of the the port attached to the context that originated the channel.
35603560+ *
35613561+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
35623562+ */
35633563+ readonly port1: MessagePort
35643564+ /**
35653565+ * The **`port2`** read-only property of the the port attached to the context at the other end of the channel, which the message is initially sent to.
35663566+ *
35673567+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
35683568+ */
35693569+ readonly port2: MessagePort
35703570+}
35713571+interface MessagePortPostMessageOptions {
35723572+ transfer?: any[]
35733573+}
35743574+type LoopbackForExport<
35753575+ T extends
35763576+ | (new (...args: any[]) => Rpc.EntrypointBranded)
35773577+ | ExportedHandler<any, any, any>
35783578+ | undefined = undefined,
35793579+> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded
35803580+ ? LoopbackServiceStub<InstanceType<T>>
35813581+ : T extends new (...args: any[]) => Rpc.DurableObjectBranded
35823582+ ? LoopbackDurableObjectClass<InstanceType<T>>
35833583+ : T extends ExportedHandler<any, any, any>
35843584+ ? LoopbackServiceStub<undefined>
35853585+ : undefined
35863586+type LoopbackServiceStub<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> =
35873587+ Fetcher<T> &
35883588+ (T extends CloudflareWorkersModule.WorkerEntrypoint<any, infer Props>
35893589+ ? (opts: { props?: Props }) => Fetcher<T>
35903590+ : (opts: { props?: any }) => Fetcher<T>)
35913591+type LoopbackDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined = undefined> =
35923592+ DurableObjectClass<T> &
35933593+ (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
35943594+ ? (opts: { props?: Props }) => DurableObjectClass<T>
35953595+ : (opts: { props?: any }) => DurableObjectClass<T>)
35963596+interface SyncKvStorage {
35973597+ get<T = unknown>(key: string): T | undefined
35983598+ list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>
35993599+ put<T>(key: string, value: T): void
36003600+ delete(key: string): boolean
36013601+}
36023602+interface SyncKvListOptions {
36033603+ start?: string
36043604+ startAfter?: string
36053605+ end?: string
36063606+ prefix?: string
36073607+ reverse?: boolean
36083608+ limit?: number
36093609+}
36103610+interface WorkerStub {
36113611+ getEntrypoint<T extends Rpc.WorkerEntrypointBranded | undefined>(
36123612+ name?: string,
36133613+ options?: WorkerStubEntrypointOptions,
36143614+ ): Fetcher<T>
36153615+}
36163616+interface WorkerStubEntrypointOptions {
36173617+ props?: any
36183618+}
36193619+interface WorkerLoader {
36203620+ get(
36213621+ name: string | null,
36223622+ getCode: () => WorkerLoaderWorkerCode | Promise<WorkerLoaderWorkerCode>,
36233623+ ): WorkerStub
36243624+}
36253625+interface WorkerLoaderModule {
36263626+ js?: string
36273627+ cjs?: string
36283628+ text?: string
36293629+ data?: ArrayBuffer
36303630+ json?: any
36313631+ py?: string
36323632+ wasm?: ArrayBuffer
36333633+}
36343634+interface WorkerLoaderWorkerCode {
36353635+ compatibilityDate: string
36363636+ compatibilityFlags?: string[]
36373637+ allowExperimental?: boolean
36383638+ mainModule: string
36393639+ modules: Record<string, WorkerLoaderModule | string>
36403640+ env?: any
36413641+ globalOutbound?: Fetcher | null
36423642+ tails?: Fetcher[]
36433643+ streamingTails?: Fetcher[]
36443644+}
36453645+/**
36463646+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
36473647+ * as well as timing of subrequests and other operations.
36483648+ *
36493649+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
36503650+ */
36513651+declare abstract class Performance {
36523652+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
36533653+ get timeOrigin(): number
36543654+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
36553655+ now(): number
36563656+}
36573657+type AiImageClassificationInput = {
36583658+ image: number[]
36593659+}
36603660+type AiImageClassificationOutput = {
36613661+ score?: number
36623662+ label?: string
36633663+}[]
36643664+declare abstract class BaseAiImageClassification {
36653665+ inputs: AiImageClassificationInput
36663666+ postProcessedOutputs: AiImageClassificationOutput
36673667+}
36683668+type AiImageToTextInput = {
36693669+ image: number[]
36703670+ prompt?: string
36713671+ max_tokens?: number
36723672+ temperature?: number
36733673+ top_p?: number
36743674+ top_k?: number
36753675+ seed?: number
36763676+ repetition_penalty?: number
36773677+ frequency_penalty?: number
36783678+ presence_penalty?: number
36793679+ raw?: boolean
36803680+ messages?: RoleScopedChatInput[]
36813681+}
36823682+type AiImageToTextOutput = {
36833683+ description: string
36843684+}
36853685+declare abstract class BaseAiImageToText {
36863686+ inputs: AiImageToTextInput
36873687+ postProcessedOutputs: AiImageToTextOutput
36883688+}
36893689+type AiImageTextToTextInput = {
36903690+ image: string
36913691+ prompt?: string
36923692+ max_tokens?: number
36933693+ temperature?: number
36943694+ ignore_eos?: boolean
36953695+ top_p?: number
36963696+ top_k?: number
36973697+ seed?: number
36983698+ repetition_penalty?: number
36993699+ frequency_penalty?: number
37003700+ presence_penalty?: number
37013701+ raw?: boolean
37023702+ messages?: RoleScopedChatInput[]
37033703+}
37043704+type AiImageTextToTextOutput = {
37053705+ description: string
37063706+}
37073707+declare abstract class BaseAiImageTextToText {
37083708+ inputs: AiImageTextToTextInput
37093709+ postProcessedOutputs: AiImageTextToTextOutput
37103710+}
37113711+type AiMultimodalEmbeddingsInput = {
37123712+ image: string
37133713+ text: string[]
37143714+}
37153715+type AiIMultimodalEmbeddingsOutput = {
37163716+ data: number[][]
37173717+ shape: number[]
37183718+}
37193719+declare abstract class BaseAiMultimodalEmbeddings {
37203720+ inputs: AiImageTextToTextInput
37213721+ postProcessedOutputs: AiImageTextToTextOutput
37223722+}
37233723+type AiObjectDetectionInput = {
37243724+ image: number[]
37253725+}
37263726+type AiObjectDetectionOutput = {
37273727+ score?: number
37283728+ label?: string
37293729+}[]
37303730+declare abstract class BaseAiObjectDetection {
37313731+ inputs: AiObjectDetectionInput
37323732+ postProcessedOutputs: AiObjectDetectionOutput
37333733+}
37343734+type AiSentenceSimilarityInput = {
37353735+ source: string
37363736+ sentences: string[]
37373737+}
37383738+type AiSentenceSimilarityOutput = number[]
37393739+declare abstract class BaseAiSentenceSimilarity {
37403740+ inputs: AiSentenceSimilarityInput
37413741+ postProcessedOutputs: AiSentenceSimilarityOutput
37423742+}
37433743+type AiAutomaticSpeechRecognitionInput = {
37443744+ audio: number[]
37453745+}
37463746+type AiAutomaticSpeechRecognitionOutput = {
37473747+ text?: string
37483748+ words?: {
37493749+ word: string
37503750+ start: number
37513751+ end: number
37523752+ }[]
37533753+ vtt?: string
37543754+}
37553755+declare abstract class BaseAiAutomaticSpeechRecognition {
37563756+ inputs: AiAutomaticSpeechRecognitionInput
37573757+ postProcessedOutputs: AiAutomaticSpeechRecognitionOutput
37583758+}
37593759+type AiSummarizationInput = {
37603760+ input_text: string
37613761+ max_length?: number
37623762+}
37633763+type AiSummarizationOutput = {
37643764+ summary: string
37653765+}
37663766+declare abstract class BaseAiSummarization {
37673767+ inputs: AiSummarizationInput
37683768+ postProcessedOutputs: AiSummarizationOutput
37693769+}
37703770+type AiTextClassificationInput = {
37713771+ text: string
37723772+}
37733773+type AiTextClassificationOutput = {
37743774+ score?: number
37753775+ label?: string
37763776+}[]
37773777+declare abstract class BaseAiTextClassification {
37783778+ inputs: AiTextClassificationInput
37793779+ postProcessedOutputs: AiTextClassificationOutput
37803780+}
37813781+type AiTextEmbeddingsInput = {
37823782+ text: string | string[]
37833783+}
37843784+type AiTextEmbeddingsOutput = {
37853785+ shape: number[]
37863786+ data: number[][]
37873787+}
37883788+declare abstract class BaseAiTextEmbeddings {
37893789+ inputs: AiTextEmbeddingsInput
37903790+ postProcessedOutputs: AiTextEmbeddingsOutput
37913791+}
37923792+type RoleScopedChatInput = {
37933793+ role: 'user' | 'assistant' | 'system' | 'tool' | (string & NonNullable<unknown>)
37943794+ content: string
37953795+ name?: string
37963796+}
37973797+type AiTextGenerationToolLegacyInput = {
37983798+ name: string
37993799+ description: string
38003800+ parameters?: {
38013801+ type: 'object' | (string & NonNullable<unknown>)
38023802+ properties: {
38033803+ [key: string]: {
38043804+ type: string
38053805+ description?: string
38063806+ }
38073807+ }
38083808+ required: string[]
38093809+ }
38103810+}
38113811+type AiTextGenerationToolInput = {
38123812+ type: 'function' | (string & NonNullable<unknown>)
38133813+ function: {
38143814+ name: string
38153815+ description: string
38163816+ parameters?: {
38173817+ type: 'object' | (string & NonNullable<unknown>)
38183818+ properties: {
38193819+ [key: string]: {
38203820+ type: string
38213821+ description?: string
38223822+ }
38233823+ }
38243824+ required: string[]
38253825+ }
38263826+ }
38273827+}
38283828+type AiTextGenerationFunctionsInput = {
38293829+ name: string
38303830+ code: string
38313831+}
38323832+type AiTextGenerationResponseFormat = {
38333833+ type: string
38343834+ json_schema?: any
38353835+}
38363836+type AiTextGenerationInput = {
38373837+ prompt?: string
38383838+ raw?: boolean
38393839+ stream?: boolean
38403840+ max_tokens?: number
38413841+ temperature?: number
38423842+ top_p?: number
38433843+ top_k?: number
38443844+ seed?: number
38453845+ repetition_penalty?: number
38463846+ frequency_penalty?: number
38473847+ presence_penalty?: number
38483848+ messages?: RoleScopedChatInput[]
38493849+ response_format?: AiTextGenerationResponseFormat
38503850+ tools?:
38513851+ | AiTextGenerationToolInput[]
38523852+ | AiTextGenerationToolLegacyInput[]
38533853+ | (object & NonNullable<unknown>)
38543854+ functions?: AiTextGenerationFunctionsInput[]
38553855+}
38563856+type AiTextGenerationToolLegacyOutput = {
38573857+ name: string
38583858+ arguments: unknown
38593859+}
38603860+type AiTextGenerationToolOutput = {
38613861+ id: string
38623862+ type: 'function'
38633863+ function: {
38643864+ name: string
38653865+ arguments: string
38663866+ }
38673867+}
38683868+type UsageTags = {
38693869+ prompt_tokens: number
38703870+ completion_tokens: number
38713871+ total_tokens: number
38723872+}
38733873+type AiTextGenerationOutput = {
38743874+ response?: string
38753875+ tool_calls?: AiTextGenerationToolLegacyOutput[] & AiTextGenerationToolOutput[]
38763876+ usage?: UsageTags
38773877+}
38783878+declare abstract class BaseAiTextGeneration {
38793879+ inputs: AiTextGenerationInput
38803880+ postProcessedOutputs: AiTextGenerationOutput
38813881+}
38823882+type AiTextToSpeechInput = {
38833883+ prompt: string
38843884+ lang?: string
38853885+}
38863886+type AiTextToSpeechOutput =
38873887+ | Uint8Array
38883888+ | {
38893889+ audio: string
38903890+ }
38913891+declare abstract class BaseAiTextToSpeech {
38923892+ inputs: AiTextToSpeechInput
38933893+ postProcessedOutputs: AiTextToSpeechOutput
38943894+}
38953895+type AiTextToImageInput = {
38963896+ prompt: string
38973897+ negative_prompt?: string
38983898+ height?: number
38993899+ width?: number
39003900+ image?: number[]
39013901+ image_b64?: string
39023902+ mask?: number[]
39033903+ num_steps?: number
39043904+ strength?: number
39053905+ guidance?: number
39063906+ seed?: number
39073907+}
39083908+type AiTextToImageOutput = ReadableStream<Uint8Array>
39093909+declare abstract class BaseAiTextToImage {
39103910+ inputs: AiTextToImageInput
39113911+ postProcessedOutputs: AiTextToImageOutput
39123912+}
39133913+type AiTranslationInput = {
39143914+ text: string
39153915+ target_lang: string
39163916+ source_lang?: string
39173917+}
39183918+type AiTranslationOutput = {
39193919+ translated_text?: string
39203920+}
39213921+declare abstract class BaseAiTranslation {
39223922+ inputs: AiTranslationInput
39233923+ postProcessedOutputs: AiTranslationOutput
39243924+}
39253925+/**
39263926+ * Workers AI support for OpenAI's Responses API
39273927+ * Reference: https://github.com/openai/openai-node/blob/master/src/resources/responses/responses.ts
39283928+ *
39293929+ * It's a stripped down version from its source.
39303930+ * It currently supports basic function calling, json mode and accepts images as input.
39313931+ *
39323932+ * It does not include types for WebSearch, CodeInterpreter, FileInputs, MCP, CustomTools.
39333933+ * We plan to add those incrementally as model + platform capabilities evolve.
39343934+ */
39353935+type ResponsesInput = {
39363936+ background?: boolean | null
39373937+ conversation?: string | ResponseConversationParam | null
39383938+ include?: Array<ResponseIncludable> | null
39393939+ input?: string | ResponseInput
39403940+ instructions?: string | null
39413941+ max_output_tokens?: number | null
39423942+ parallel_tool_calls?: boolean | null
39433943+ previous_response_id?: string | null
39443944+ prompt_cache_key?: string
39453945+ reasoning?: Reasoning | null
39463946+ safety_identifier?: string
39473947+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null
39483948+ stream?: boolean | null
39493949+ stream_options?: StreamOptions | null
39503950+ temperature?: number | null
39513951+ text?: ResponseTextConfig
39523952+ tool_choice?: ToolChoiceOptions | ToolChoiceFunction
39533953+ tools?: Array<Tool>
39543954+ top_p?: number | null
39553955+ truncation?: 'auto' | 'disabled' | null
39563956+}
39573957+type ResponsesOutput = {
39583958+ id?: string
39593959+ created_at?: number
39603960+ output_text?: string
39613961+ error?: ResponseError | null
39623962+ incomplete_details?: ResponseIncompleteDetails | null
39633963+ instructions?: string | Array<ResponseInputItem> | null
39643964+ object?: 'response'
39653965+ output?: Array<ResponseOutputItem>
39663966+ parallel_tool_calls?: boolean
39673967+ temperature?: number | null
39683968+ tool_choice?: ToolChoiceOptions | ToolChoiceFunction
39693969+ tools?: Array<Tool>
39703970+ top_p?: number | null
39713971+ max_output_tokens?: number | null
39723972+ previous_response_id?: string | null
39733973+ prompt?: ResponsePrompt | null
39743974+ reasoning?: Reasoning | null
39753975+ safety_identifier?: string
39763976+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null
39773977+ status?: ResponseStatus
39783978+ text?: ResponseTextConfig
39793979+ truncation?: 'auto' | 'disabled' | null
39803980+ usage?: ResponseUsage
39813981+}
39823982+type EasyInputMessage = {
39833983+ content: string | ResponseInputMessageContentList
39843984+ role: 'user' | 'assistant' | 'system' | 'developer'
39853985+ type?: 'message'
39863986+}
39873987+type ResponsesFunctionTool = {
39883988+ name: string
39893989+ parameters: {
39903990+ [key: string]: unknown
39913991+ } | null
39923992+ strict: boolean | null
39933993+ type: 'function'
39943994+ description?: string | null
39953995+}
39963996+type ResponseIncompleteDetails = {
39973997+ reason?: 'max_output_tokens' | 'content_filter'
39983998+}
39993999+type ResponsePrompt = {
40004000+ id: string
40014001+ variables?: {
40024002+ [key: string]: string | ResponseInputText | ResponseInputImage
40034003+ } | null
40044004+ version?: string | null
40054005+}
40064006+type Reasoning = {
40074007+ effort?: ReasoningEffort | null
40084008+ generate_summary?: 'auto' | 'concise' | 'detailed' | null
40094009+ summary?: 'auto' | 'concise' | 'detailed' | null
40104010+}
40114011+type ResponseContent =
40124012+ | ResponseInputText
40134013+ | ResponseInputImage
40144014+ | ResponseOutputText
40154015+ | ResponseOutputRefusal
40164016+ | ResponseContentReasoningText
40174017+type ResponseContentReasoningText = {
40184018+ text: string
40194019+ type: 'reasoning_text'
40204020+}
40214021+type ResponseConversationParam = {
40224022+ id: string
40234023+}
40244024+type ResponseCreatedEvent = {
40254025+ response: Response
40264026+ sequence_number: number
40274027+ type: 'response.created'
40284028+}
40294029+type ResponseCustomToolCallOutput = {
40304030+ call_id: string
40314031+ output: string | Array<ResponseInputText | ResponseInputImage>
40324032+ type: 'custom_tool_call_output'
40334033+ id?: string
40344034+}
40354035+type ResponseError = {
40364036+ code:
40374037+ | 'server_error'
40384038+ | 'rate_limit_exceeded'
40394039+ | 'invalid_prompt'
40404040+ | 'vector_store_timeout'
40414041+ | 'invalid_image'
40424042+ | 'invalid_image_format'
40434043+ | 'invalid_base64_image'
40444044+ | 'invalid_image_url'
40454045+ | 'image_too_large'
40464046+ | 'image_too_small'
40474047+ | 'image_parse_error'
40484048+ | 'image_content_policy_violation'
40494049+ | 'invalid_image_mode'
40504050+ | 'image_file_too_large'
40514051+ | 'unsupported_image_media_type'
40524052+ | 'empty_image_file'
40534053+ | 'failed_to_download_image'
40544054+ | 'image_file_not_found'
40554055+ message: string
40564056+}
40574057+type ResponseErrorEvent = {
40584058+ code: string | null
40594059+ message: string
40604060+ param: string | null
40614061+ sequence_number: number
40624062+ type: 'error'
40634063+}
40644064+type ResponseFailedEvent = {
40654065+ response: Response
40664066+ sequence_number: number
40674067+ type: 'response.failed'
40684068+}
40694069+type ResponseFormatText = {
40704070+ type: 'text'
40714071+}
40724072+type ResponseFormatJSONObject = {
40734073+ type: 'json_object'
40744074+}
40754075+type ResponseFormatTextConfig =
40764076+ | ResponseFormatText
40774077+ | ResponseFormatTextJSONSchemaConfig
40784078+ | ResponseFormatJSONObject
40794079+type ResponseFormatTextJSONSchemaConfig = {
40804080+ name: string
40814081+ schema: {
40824082+ [key: string]: unknown
40834083+ }
40844084+ type: 'json_schema'
40854085+ description?: string
40864086+ strict?: boolean | null
40874087+}
40884088+type ResponseFunctionCallArgumentsDeltaEvent = {
40894089+ delta: string
40904090+ item_id: string
40914091+ output_index: number
40924092+ sequence_number: number
40934093+ type: 'response.function_call_arguments.delta'
40944094+}
40954095+type ResponseFunctionCallArgumentsDoneEvent = {
40964096+ arguments: string
40974097+ item_id: string
40984098+ name: string
40994099+ output_index: number
41004100+ sequence_number: number
41014101+ type: 'response.function_call_arguments.done'
41024102+}
41034103+type ResponseFunctionCallOutputItem = ResponseInputTextContent | ResponseInputImageContent
41044104+type ResponseFunctionCallOutputItemList = Array<ResponseFunctionCallOutputItem>
41054105+type ResponseFunctionToolCall = {
41064106+ arguments: string
41074107+ call_id: string
41084108+ name: string
41094109+ type: 'function_call'
41104110+ id?: string
41114111+ status?: 'in_progress' | 'completed' | 'incomplete'
41124112+}
41134113+interface ResponseFunctionToolCallItem extends ResponseFunctionToolCall {
41144114+ id: string
41154115+}
41164116+type ResponseFunctionToolCallOutputItem = {
41174117+ id: string
41184118+ call_id: string
41194119+ output: string | Array<ResponseInputText | ResponseInputImage>
41204120+ type: 'function_call_output'
41214121+ status?: 'in_progress' | 'completed' | 'incomplete'
41224122+}
41234123+type ResponseIncludable = 'message.input_image.image_url' | 'message.output_text.logprobs'
41244124+type ResponseIncompleteEvent = {
41254125+ response: Response
41264126+ sequence_number: number
41274127+ type: 'response.incomplete'
41284128+}
41294129+type ResponseInput = Array<ResponseInputItem>
41304130+type ResponseInputContent = ResponseInputText | ResponseInputImage
41314131+type ResponseInputImage = {
41324132+ detail: 'low' | 'high' | 'auto'
41334133+ type: 'input_image'
41344134+ /**
41354135+ * Base64 encoded image
41364136+ */
41374137+ image_url?: string | null
41384138+}
41394139+type ResponseInputImageContent = {
41404140+ type: 'input_image'
41414141+ detail?: 'low' | 'high' | 'auto' | null
41424142+ /**
41434143+ * Base64 encoded image
41444144+ */
41454145+ image_url?: string | null
41464146+}
41474147+type ResponseInputItem =
41484148+ | EasyInputMessage
41494149+ | ResponseInputItemMessage
41504150+ | ResponseOutputMessage
41514151+ | ResponseFunctionToolCall
41524152+ | ResponseInputItemFunctionCallOutput
41534153+ | ResponseReasoningItem
41544154+type ResponseInputItemFunctionCallOutput = {
41554155+ call_id: string
41564156+ output: string | ResponseFunctionCallOutputItemList
41574157+ type: 'function_call_output'
41584158+ id?: string | null
41594159+ status?: 'in_progress' | 'completed' | 'incomplete' | null
41604160+}
41614161+type ResponseInputItemMessage = {
41624162+ content: ResponseInputMessageContentList
41634163+ role: 'user' | 'system' | 'developer'
41644164+ status?: 'in_progress' | 'completed' | 'incomplete'
41654165+ type?: 'message'
41664166+}
41674167+type ResponseInputMessageContentList = Array<ResponseInputContent>
41684168+type ResponseInputMessageItem = {
41694169+ id: string
41704170+ content: ResponseInputMessageContentList
41714171+ role: 'user' | 'system' | 'developer'
41724172+ status?: 'in_progress' | 'completed' | 'incomplete'
41734173+ type?: 'message'
41744174+}
41754175+type ResponseInputText = {
41764176+ text: string
41774177+ type: 'input_text'
41784178+}
41794179+type ResponseInputTextContent = {
41804180+ text: string
41814181+ type: 'input_text'
41824182+}
41834183+type ResponseItem =
41844184+ | ResponseInputMessageItem
41854185+ | ResponseOutputMessage
41864186+ | ResponseFunctionToolCallItem
41874187+ | ResponseFunctionToolCallOutputItem
41884188+type ResponseOutputItem = ResponseOutputMessage | ResponseFunctionToolCall | ResponseReasoningItem
41894189+type ResponseOutputItemAddedEvent = {
41904190+ item: ResponseOutputItem
41914191+ output_index: number
41924192+ sequence_number: number
41934193+ type: 'response.output_item.added'
41944194+}
41954195+type ResponseOutputItemDoneEvent = {
41964196+ item: ResponseOutputItem
41974197+ output_index: number
41984198+ sequence_number: number
41994199+ type: 'response.output_item.done'
42004200+}
42014201+type ResponseOutputMessage = {
42024202+ id: string
42034203+ content: Array<ResponseOutputText | ResponseOutputRefusal>
42044204+ role: 'assistant'
42054205+ status: 'in_progress' | 'completed' | 'incomplete'
42064206+ type: 'message'
42074207+}
42084208+type ResponseOutputRefusal = {
42094209+ refusal: string
42104210+ type: 'refusal'
42114211+}
42124212+type ResponseOutputText = {
42134213+ text: string
42144214+ type: 'output_text'
42154215+ logprobs?: Array<Logprob>
42164216+}
42174217+type ResponseReasoningItem = {
42184218+ id: string
42194219+ summary: Array<ResponseReasoningSummaryItem>
42204220+ type: 'reasoning'
42214221+ content?: Array<ResponseReasoningContentItem>
42224222+ encrypted_content?: string | null
42234223+ status?: 'in_progress' | 'completed' | 'incomplete'
42244224+}
42254225+type ResponseReasoningSummaryItem = {
42264226+ text: string
42274227+ type: 'summary_text'
42284228+}
42294229+type ResponseReasoningContentItem = {
42304230+ text: string
42314231+ type: 'reasoning_text'
42324232+}
42334233+type ResponseReasoningTextDeltaEvent = {
42344234+ content_index: number
42354235+ delta: string
42364236+ item_id: string
42374237+ output_index: number
42384238+ sequence_number: number
42394239+ type: 'response.reasoning_text.delta'
42404240+}
42414241+type ResponseReasoningTextDoneEvent = {
42424242+ content_index: number
42434243+ item_id: string
42444244+ output_index: number
42454245+ sequence_number: number
42464246+ text: string
42474247+ type: 'response.reasoning_text.done'
42484248+}
42494249+type ResponseRefusalDeltaEvent = {
42504250+ content_index: number
42514251+ delta: string
42524252+ item_id: string
42534253+ output_index: number
42544254+ sequence_number: number
42554255+ type: 'response.refusal.delta'
42564256+}
42574257+type ResponseRefusalDoneEvent = {
42584258+ content_index: number
42594259+ item_id: string
42604260+ output_index: number
42614261+ refusal: string
42624262+ sequence_number: number
42634263+ type: 'response.refusal.done'
42644264+}
42654265+type ResponseStatus = 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete'
42664266+type ResponseStreamEvent =
42674267+ | ResponseCompletedEvent
42684268+ | ResponseCreatedEvent
42694269+ | ResponseErrorEvent
42704270+ | ResponseFunctionCallArgumentsDeltaEvent
42714271+ | ResponseFunctionCallArgumentsDoneEvent
42724272+ | ResponseFailedEvent
42734273+ | ResponseIncompleteEvent
42744274+ | ResponseOutputItemAddedEvent
42754275+ | ResponseOutputItemDoneEvent
42764276+ | ResponseReasoningTextDeltaEvent
42774277+ | ResponseReasoningTextDoneEvent
42784278+ | ResponseRefusalDeltaEvent
42794279+ | ResponseRefusalDoneEvent
42804280+ | ResponseTextDeltaEvent
42814281+ | ResponseTextDoneEvent
42824282+type ResponseCompletedEvent = {
42834283+ response: Response
42844284+ sequence_number: number
42854285+ type: 'response.completed'
42864286+}
42874287+type ResponseTextConfig = {
42884288+ format?: ResponseFormatTextConfig
42894289+ verbosity?: 'low' | 'medium' | 'high' | null
42904290+}
42914291+type ResponseTextDeltaEvent = {
42924292+ content_index: number
42934293+ delta: string
42944294+ item_id: string
42954295+ logprobs: Array<Logprob>
42964296+ output_index: number
42974297+ sequence_number: number
42984298+ type: 'response.output_text.delta'
42994299+}
43004300+type ResponseTextDoneEvent = {
43014301+ content_index: number
43024302+ item_id: string
43034303+ logprobs: Array<Logprob>
43044304+ output_index: number
43054305+ sequence_number: number
43064306+ text: string
43074307+ type: 'response.output_text.done'
43084308+}
43094309+type Logprob = {
43104310+ token: string
43114311+ logprob: number
43124312+ top_logprobs?: Array<TopLogprob>
43134313+}
43144314+type TopLogprob = {
43154315+ token?: string
43164316+ logprob?: number
43174317+}
43184318+type ResponseUsage = {
43194319+ input_tokens: number
43204320+ output_tokens: number
43214321+ total_tokens: number
43224322+}
43234323+type Tool = ResponsesFunctionTool
43244324+type ToolChoiceFunction = {
43254325+ name: string
43264326+ type: 'function'
43274327+}
43284328+type ToolChoiceOptions = 'none'
43294329+type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | null
43304330+type StreamOptions = {
43314331+ include_obfuscation?: boolean
43324332+}
43334333+type Ai_Cf_Baai_Bge_Base_En_V1_5_Input =
43344334+ | {
43354335+ text: string | string[]
43364336+ /**
43374337+ * 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.
43384338+ */
43394339+ pooling?: 'mean' | 'cls'
43404340+ }
43414341+ | {
43424342+ /**
43434343+ * Batch of the embeddings requests to run using async-queue
43444344+ */
43454345+ requests: {
43464346+ text: string | string[]
43474347+ /**
43484348+ * 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.
43494349+ */
43504350+ pooling?: 'mean' | 'cls'
43514351+ }[]
43524352+ }
43534353+type Ai_Cf_Baai_Bge_Base_En_V1_5_Output =
43544354+ | {
43554355+ shape?: number[]
43564356+ /**
43574357+ * Embeddings of the requested text values
43584358+ */
43594359+ data?: number[][]
43604360+ /**
43614361+ * The pooling method used in the embedding process.
43624362+ */
43634363+ pooling?: 'mean' | 'cls'
43644364+ }
43654365+ | Ai_Cf_Baai_Bge_Base_En_V1_5_AsyncResponse
43664366+interface Ai_Cf_Baai_Bge_Base_En_V1_5_AsyncResponse {
43674367+ /**
43684368+ * The async request id that can be used to obtain the results.
43694369+ */
43704370+ request_id?: string
43714371+}
43724372+declare abstract class Base_Ai_Cf_Baai_Bge_Base_En_V1_5 {
43734373+ inputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Input
43744374+ postProcessedOutputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Output
43754375+}
43764376+type Ai_Cf_Openai_Whisper_Input =
43774377+ | string
43784378+ | {
43794379+ /**
43804380+ * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
43814381+ */
43824382+ audio: number[]
43834383+ }
43844384+interface Ai_Cf_Openai_Whisper_Output {
43854385+ /**
43864386+ * The transcription
43874387+ */
43884388+ text: string
43894389+ word_count?: number
43904390+ words?: {
43914391+ word?: string
43924392+ /**
43934393+ * The second this word begins in the recording
43944394+ */
43954395+ start?: number
43964396+ /**
43974397+ * The ending second when the word completes
43984398+ */
43994399+ end?: number
44004400+ }[]
44014401+ vtt?: string
44024402+}
44034403+declare abstract class Base_Ai_Cf_Openai_Whisper {
44044404+ inputs: Ai_Cf_Openai_Whisper_Input
44054405+ postProcessedOutputs: Ai_Cf_Openai_Whisper_Output
44064406+}
44074407+type Ai_Cf_Meta_M2M100_1_2B_Input =
44084408+ | {
44094409+ /**
44104410+ * The text to be translated
44114411+ */
44124412+ text: string
44134413+ /**
44144414+ * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
44154415+ */
44164416+ source_lang?: string
44174417+ /**
44184418+ * The language code to translate the text into (e.g., 'es' for Spanish)
44194419+ */
44204420+ target_lang: string
44214421+ }
44224422+ | {
44234423+ /**
44244424+ * Batch of the embeddings requests to run using async-queue
44254425+ */
44264426+ requests: {
44274427+ /**
44284428+ * The text to be translated
44294429+ */
44304430+ text: string
44314431+ /**
44324432+ * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
44334433+ */
44344434+ source_lang?: string
44354435+ /**
44364436+ * The language code to translate the text into (e.g., 'es' for Spanish)
44374437+ */
44384438+ target_lang: string
44394439+ }[]
44404440+ }
44414441+type Ai_Cf_Meta_M2M100_1_2B_Output =
44424442+ | {
44434443+ /**
44444444+ * The translated text in the target language
44454445+ */
44464446+ translated_text?: string
44474447+ }
44484448+ | Ai_Cf_Meta_M2M100_1_2B_AsyncResponse
44494449+interface Ai_Cf_Meta_M2M100_1_2B_AsyncResponse {
44504450+ /**
44514451+ * The async request id that can be used to obtain the results.
44524452+ */
44534453+ request_id?: string
44544454+}
44554455+declare abstract class Base_Ai_Cf_Meta_M2M100_1_2B {
44564456+ inputs: Ai_Cf_Meta_M2M100_1_2B_Input
44574457+ postProcessedOutputs: Ai_Cf_Meta_M2M100_1_2B_Output
44584458+}
44594459+type Ai_Cf_Baai_Bge_Small_En_V1_5_Input =
44604460+ | {
44614461+ text: string | string[]
44624462+ /**
44634463+ * 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.
44644464+ */
44654465+ pooling?: 'mean' | 'cls'
44664466+ }
44674467+ | {
44684468+ /**
44694469+ * Batch of the embeddings requests to run using async-queue
44704470+ */
44714471+ requests: {
44724472+ text: string | string[]
44734473+ /**
44744474+ * 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.
44754475+ */
44764476+ pooling?: 'mean' | 'cls'
44774477+ }[]
44784478+ }
44794479+type Ai_Cf_Baai_Bge_Small_En_V1_5_Output =
44804480+ | {
44814481+ shape?: number[]
44824482+ /**
44834483+ * Embeddings of the requested text values
44844484+ */
44854485+ data?: number[][]
44864486+ /**
44874487+ * The pooling method used in the embedding process.
44884488+ */
44894489+ pooling?: 'mean' | 'cls'
44904490+ }
44914491+ | Ai_Cf_Baai_Bge_Small_En_V1_5_AsyncResponse
44924492+interface Ai_Cf_Baai_Bge_Small_En_V1_5_AsyncResponse {
44934493+ /**
44944494+ * The async request id that can be used to obtain the results.
44954495+ */
44964496+ request_id?: string
44974497+}
44984498+declare abstract class Base_Ai_Cf_Baai_Bge_Small_En_V1_5 {
44994499+ inputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Input
45004500+ postProcessedOutputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Output
45014501+}
45024502+type Ai_Cf_Baai_Bge_Large_En_V1_5_Input =
45034503+ | {
45044504+ text: string | string[]
45054505+ /**
45064506+ * 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.
45074507+ */
45084508+ pooling?: 'mean' | 'cls'
45094509+ }
45104510+ | {
45114511+ /**
45124512+ * Batch of the embeddings requests to run using async-queue
45134513+ */
45144514+ requests: {
45154515+ text: string | string[]
45164516+ /**
45174517+ * 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.
45184518+ */
45194519+ pooling?: 'mean' | 'cls'
45204520+ }[]
45214521+ }
45224522+type Ai_Cf_Baai_Bge_Large_En_V1_5_Output =
45234523+ | {
45244524+ shape?: number[]
45254525+ /**
45264526+ * Embeddings of the requested text values
45274527+ */
45284528+ data?: number[][]
45294529+ /**
45304530+ * The pooling method used in the embedding process.
45314531+ */
45324532+ pooling?: 'mean' | 'cls'
45334533+ }
45344534+ | Ai_Cf_Baai_Bge_Large_En_V1_5_AsyncResponse
45354535+interface Ai_Cf_Baai_Bge_Large_En_V1_5_AsyncResponse {
45364536+ /**
45374537+ * The async request id that can be used to obtain the results.
45384538+ */
45394539+ request_id?: string
45404540+}
45414541+declare abstract class Base_Ai_Cf_Baai_Bge_Large_En_V1_5 {
45424542+ inputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Input
45434543+ postProcessedOutputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Output
45444544+}
45454545+type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input =
45464546+ | string
45474547+ | {
45484548+ /**
45494549+ * The input text prompt for the model to generate a response.
45504550+ */
45514551+ prompt?: string
45524552+ /**
45534553+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
45544554+ */
45554555+ raw?: boolean
45564556+ /**
45574557+ * 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.
45584558+ */
45594559+ top_p?: number
45604560+ /**
45614561+ * 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.
45624562+ */
45634563+ top_k?: number
45644564+ /**
45654565+ * Random seed for reproducibility of the generation.
45664566+ */
45674567+ seed?: number
45684568+ /**
45694569+ * Penalty for repeated tokens; higher values discourage repetition.
45704570+ */
45714571+ repetition_penalty?: number
45724572+ /**
45734573+ * Decreases the likelihood of the model repeating the same lines verbatim.
45744574+ */
45754575+ frequency_penalty?: number
45764576+ /**
45774577+ * Increases the likelihood of the model introducing new topics.
45784578+ */
45794579+ presence_penalty?: number
45804580+ image: number[] | (string & NonNullable<unknown>)
45814581+ /**
45824582+ * The maximum number of tokens to generate in the response.
45834583+ */
45844584+ max_tokens?: number
45854585+ }
45864586+interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {
45874587+ description?: string
45884588+}
45894589+declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {
45904590+ inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input
45914591+ postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output
45924592+}
45934593+type Ai_Cf_Openai_Whisper_Tiny_En_Input =
45944594+ | string
45954595+ | {
45964596+ /**
45974597+ * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
45984598+ */
45994599+ audio: number[]
46004600+ }
46014601+interface Ai_Cf_Openai_Whisper_Tiny_En_Output {
46024602+ /**
46034603+ * The transcription
46044604+ */
46054605+ text: string
46064606+ word_count?: number
46074607+ words?: {
46084608+ word?: string
46094609+ /**
46104610+ * The second this word begins in the recording
46114611+ */
46124612+ start?: number
46134613+ /**
46144614+ * The ending second when the word completes
46154615+ */
46164616+ end?: number
46174617+ }[]
46184618+ vtt?: string
46194619+}
46204620+declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
46214621+ inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input
46224622+ postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output
46234623+}
46244624+interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
46254625+ /**
46264626+ * Base64 encoded value of the audio data.
46274627+ */
46284628+ audio: string
46294629+ /**
46304630+ * Supported tasks are 'translate' or 'transcribe'.
46314631+ */
46324632+ task?: string
46334633+ /**
46344634+ * The language of the audio being transcribed or translated.
46354635+ */
46364636+ language?: string
46374637+ /**
46384638+ * Preprocess the audio with a voice activity detection model.
46394639+ */
46404640+ vad_filter?: boolean
46414641+ /**
46424642+ * A text prompt to help provide context to the model on the contents of the audio.
46434643+ */
46444644+ initial_prompt?: string
46454645+ /**
46464646+ * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
46474647+ */
46484648+ prefix?: string
46494649+}
46504650+interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
46514651+ transcription_info?: {
46524652+ /**
46534653+ * The language of the audio being transcribed or translated.
46544654+ */
46554655+ language?: string
46564656+ /**
46574657+ * The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1.
46584658+ */
46594659+ language_probability?: number
46604660+ /**
46614661+ * The total duration of the original audio file, in seconds.
46624662+ */
46634663+ duration?: number
46644664+ /**
46654665+ * The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds.
46664666+ */
46674667+ duration_after_vad?: number
46684668+ }
46694669+ /**
46704670+ * The complete transcription of the audio.
46714671+ */
46724672+ text: string
46734673+ /**
46744674+ * The total number of words in the transcription.
46754675+ */
46764676+ word_count?: number
46774677+ segments?: {
46784678+ /**
46794679+ * The starting time of the segment within the audio, in seconds.
46804680+ */
46814681+ start?: number
46824682+ /**
46834683+ * The ending time of the segment within the audio, in seconds.
46844684+ */
46854685+ end?: number
46864686+ /**
46874687+ * The transcription of the segment.
46884688+ */
46894689+ text?: string
46904690+ /**
46914691+ * The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs.
46924692+ */
46934693+ temperature?: number
46944694+ /**
46954695+ * The average log probability of the predictions for the words in this segment, indicating overall confidence.
46964696+ */
46974697+ avg_logprob?: number
46984698+ /**
46994699+ * The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process.
47004700+ */
47014701+ compression_ratio?: number
47024702+ /**
47034703+ * The probability that the segment contains no speech, represented as a decimal between 0 and 1.
47044704+ */
47054705+ no_speech_prob?: number
47064706+ words?: {
47074707+ /**
47084708+ * The individual word transcribed from the audio.
47094709+ */
47104710+ word?: string
47114711+ /**
47124712+ * The starting time of the word within the audio, in seconds.
47134713+ */
47144714+ start?: number
47154715+ /**
47164716+ * The ending time of the word within the audio, in seconds.
47174717+ */
47184718+ end?: number
47194719+ }[]
47204720+ }[]
47214721+ /**
47224722+ * The transcription in WebVTT format, which includes timing and text information for use in subtitles.
47234723+ */
47244724+ vtt?: string
47254725+}
47264726+declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
47274727+ inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input
47284728+ postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output
47294729+}
47304730+type Ai_Cf_Baai_Bge_M3_Input =
47314731+ | Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts
47324732+ | Ai_Cf_Baai_Bge_M3_Input_Embedding
47334733+ | {
47344734+ /**
47354735+ * Batch of the embeddings requests to run using async-queue
47364736+ */
47374737+ requests: (
47384738+ | Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts_1
47394739+ | Ai_Cf_Baai_Bge_M3_Input_Embedding_1
47404740+ )[]
47414741+ }
47424742+interface Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts {
47434743+ /**
47444744+ * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
47454745+ */
47464746+ query?: string
47474747+ /**
47484748+ * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
47494749+ */
47504750+ contexts: {
47514751+ /**
47524752+ * One of the provided context content
47534753+ */
47544754+ text?: string
47554755+ }[]
47564756+ /**
47574757+ * When provided with too long context should the model error out or truncate the context to fit?
47584758+ */
47594759+ truncate_inputs?: boolean
47604760+}
47614761+interface Ai_Cf_Baai_Bge_M3_Input_Embedding {
47624762+ text: string | string[]
47634763+ /**
47644764+ * When provided with too long context should the model error out or truncate the context to fit?
47654765+ */
47664766+ truncate_inputs?: boolean
47674767+}
47684768+interface Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts_1 {
47694769+ /**
47704770+ * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
47714771+ */
47724772+ query?: string
47734773+ /**
47744774+ * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
47754775+ */
47764776+ contexts: {
47774777+ /**
47784778+ * One of the provided context content
47794779+ */
47804780+ text?: string
47814781+ }[]
47824782+ /**
47834783+ * When provided with too long context should the model error out or truncate the context to fit?
47844784+ */
47854785+ truncate_inputs?: boolean
47864786+}
47874787+interface Ai_Cf_Baai_Bge_M3_Input_Embedding_1 {
47884788+ text: string | string[]
47894789+ /**
47904790+ * When provided with too long context should the model error out or truncate the context to fit?
47914791+ */
47924792+ truncate_inputs?: boolean
47934793+}
47944794+type Ai_Cf_Baai_Bge_M3_Output =
47954795+ | Ai_Cf_Baai_Bge_M3_Ouput_Query
47964796+ | Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts
47974797+ | Ai_Cf_Baai_Bge_M3_Ouput_Embedding
47984798+ | Ai_Cf_Baai_Bge_M3_AsyncResponse
47994799+interface Ai_Cf_Baai_Bge_M3_Ouput_Query {
48004800+ response?: {
48014801+ /**
48024802+ * Index of the context in the request
48034803+ */
48044804+ id?: number
48054805+ /**
48064806+ * Score of the context under the index.
48074807+ */
48084808+ score?: number
48094809+ }[]
48104810+}
48114811+interface Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts {
48124812+ response?: number[][]
48134813+ shape?: number[]
48144814+ /**
48154815+ * The pooling method used in the embedding process.
48164816+ */
48174817+ pooling?: 'mean' | 'cls'
48184818+}
48194819+interface Ai_Cf_Baai_Bge_M3_Ouput_Embedding {
48204820+ shape?: number[]
48214821+ /**
48224822+ * Embeddings of the requested text values
48234823+ */
48244824+ data?: number[][]
48254825+ /**
48264826+ * The pooling method used in the embedding process.
48274827+ */
48284828+ pooling?: 'mean' | 'cls'
48294829+}
48304830+interface Ai_Cf_Baai_Bge_M3_AsyncResponse {
48314831+ /**
48324832+ * The async request id that can be used to obtain the results.
48334833+ */
48344834+ request_id?: string
48354835+}
48364836+declare abstract class Base_Ai_Cf_Baai_Bge_M3 {
48374837+ inputs: Ai_Cf_Baai_Bge_M3_Input
48384838+ postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output
48394839+}
48404840+interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
48414841+ /**
48424842+ * A text description of the image you want to generate.
48434843+ */
48444844+ prompt: string
48454845+ /**
48464846+ * The number of diffusion steps; higher values can improve quality but take longer.
48474847+ */
48484848+ steps?: number
48494849+}
48504850+interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output {
48514851+ /**
48524852+ * The generated image in Base64 format.
48534853+ */
48544854+ image?: string
48554855+}
48564856+declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell {
48574857+ inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input
48584858+ postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output
48594859+}
48604860+type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input =
48614861+ | Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Prompt
48624862+ | Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages
48634863+interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Prompt {
48644864+ /**
48654865+ * The input text prompt for the model to generate a response.
48664866+ */
48674867+ prompt: string
48684868+ image?: number[] | (string & NonNullable<unknown>)
48694869+ /**
48704870+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
48714871+ */
48724872+ raw?: boolean
48734873+ /**
48744874+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
48754875+ */
48764876+ stream?: boolean
48774877+ /**
48784878+ * The maximum number of tokens to generate in the response.
48794879+ */
48804880+ max_tokens?: number
48814881+ /**
48824882+ * Controls the randomness of the output; higher values produce more random results.
48834883+ */
48844884+ temperature?: number
48854885+ /**
48864886+ * 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.
48874887+ */
48884888+ top_p?: number
48894889+ /**
48904890+ * 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.
48914891+ */
48924892+ top_k?: number
48934893+ /**
48944894+ * Random seed for reproducibility of the generation.
48954895+ */
48964896+ seed?: number
48974897+ /**
48984898+ * Penalty for repeated tokens; higher values discourage repetition.
48994899+ */
49004900+ repetition_penalty?: number
49014901+ /**
49024902+ * Decreases the likelihood of the model repeating the same lines verbatim.
49034903+ */
49044904+ frequency_penalty?: number
49054905+ /**
49064906+ * Increases the likelihood of the model introducing new topics.
49074907+ */
49084908+ presence_penalty?: number
49094909+ /**
49104910+ * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
49114911+ */
49124912+ lora?: string
49134913+}
49144914+interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages {
49154915+ /**
49164916+ * An array of message objects representing the conversation history.
49174917+ */
49184918+ messages: {
49194919+ /**
49204920+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
49214921+ */
49224922+ role?: string
49234923+ /**
49244924+ * 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 000000001
49254925+ */
49264926+ tool_call_id?: string
49274927+ content?:
49284928+ | string
49294929+ | {
49304930+ /**
49314931+ * Type of the content provided
49324932+ */
49334933+ type?: string
49344934+ text?: string
49354935+ image_url?: {
49364936+ /**
49374937+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
49384938+ */
49394939+ url?: string
49404940+ }
49414941+ }[]
49424942+ | {
49434943+ /**
49444944+ * Type of the content provided
49454945+ */
49464946+ type?: string
49474947+ text?: string
49484948+ image_url?: {
49494949+ /**
49504950+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
49514951+ */
49524952+ url?: string
49534953+ }
49544954+ }
49554955+ }[]
49564956+ image?: number[] | (string & NonNullable<unknown>)
49574957+ functions?: {
49584958+ name: string
49594959+ code: string
49604960+ }[]
49614961+ /**
49624962+ * A list of tools available for the assistant to use.
49634963+ */
49644964+ tools?: (
49654965+ | {
49664966+ /**
49674967+ * The name of the tool. More descriptive the better.
49684968+ */
49694969+ name: string
49704970+ /**
49714971+ * A brief description of what the tool does.
49724972+ */
49734973+ description: string
49744974+ /**
49754975+ * Schema defining the parameters accepted by the tool.
49764976+ */
49774977+ parameters: {
49784978+ /**
49794979+ * The type of the parameters object (usually 'object').
49804980+ */
49814981+ type: string
49824982+ /**
49834983+ * List of required parameter names.
49844984+ */
49854985+ required?: string[]
49864986+ /**
49874987+ * Definitions of each parameter.
49884988+ */
49894989+ properties: {
49904990+ [k: string]: {
49914991+ /**
49924992+ * The data type of the parameter.
49934993+ */
49944994+ type: string
49954995+ /**
49964996+ * A description of the expected parameter.
49974997+ */
49984998+ description: string
49994999+ }
50005000+ }
50015001+ }
50025002+ }
50035003+ | {
50045004+ /**
50055005+ * Specifies the type of tool (e.g., 'function').
50065006+ */
50075007+ type: string
50085008+ /**
50095009+ * Details of the function tool.
50105010+ */
50115011+ function: {
50125012+ /**
50135013+ * The name of the function.
50145014+ */
50155015+ name: string
50165016+ /**
50175017+ * A brief description of what the function does.
50185018+ */
50195019+ description: string
50205020+ /**
50215021+ * Schema defining the parameters accepted by the function.
50225022+ */
50235023+ parameters: {
50245024+ /**
50255025+ * The type of the parameters object (usually 'object').
50265026+ */
50275027+ type: string
50285028+ /**
50295029+ * List of required parameter names.
50305030+ */
50315031+ required?: string[]
50325032+ /**
50335033+ * Definitions of each parameter.
50345034+ */
50355035+ properties: {
50365036+ [k: string]: {
50375037+ /**
50385038+ * The data type of the parameter.
50395039+ */
50405040+ type: string
50415041+ /**
50425042+ * A description of the expected parameter.
50435043+ */
50445044+ description: string
50455045+ }
50465046+ }
50475047+ }
50485048+ }
50495049+ }
50505050+ )[]
50515051+ /**
50525052+ * If true, the response will be streamed back incrementally.
50535053+ */
50545054+ stream?: boolean
50555055+ /**
50565056+ * The maximum number of tokens to generate in the response.
50575057+ */
50585058+ max_tokens?: number
50595059+ /**
50605060+ * Controls the randomness of the output; higher values produce more random results.
50615061+ */
50625062+ temperature?: number
50635063+ /**
50645064+ * 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.
50655065+ */
50665066+ top_p?: number
50675067+ /**
50685068+ * 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.
50695069+ */
50705070+ top_k?: number
50715071+ /**
50725072+ * Random seed for reproducibility of the generation.
50735073+ */
50745074+ seed?: number
50755075+ /**
50765076+ * Penalty for repeated tokens; higher values discourage repetition.
50775077+ */
50785078+ repetition_penalty?: number
50795079+ /**
50805080+ * Decreases the likelihood of the model repeating the same lines verbatim.
50815081+ */
50825082+ frequency_penalty?: number
50835083+ /**
50845084+ * Increases the likelihood of the model introducing new topics.
50855085+ */
50865086+ presence_penalty?: number
50875087+}
50885088+type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output = {
50895089+ /**
50905090+ * The generated text response from the model
50915091+ */
50925092+ response?: string
50935093+ /**
50945094+ * An array of tool calls requests made during the response generation
50955095+ */
50965096+ tool_calls?: {
50975097+ /**
50985098+ * The arguments passed to be passed to the tool call request
50995099+ */
51005100+ arguments?: object
51015101+ /**
51025102+ * The name of the tool to be called
51035103+ */
51045104+ name?: string
51055105+ }[]
51065106+}
51075107+declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct {
51085108+ inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input
51095109+ postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output
51105110+}
51115111+type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input =
51125112+ | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt
51135113+ | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages
51145114+ | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Async_Batch
51155115+interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt {
51165116+ /**
51175117+ * The input text prompt for the model to generate a response.
51185118+ */
51195119+ prompt: string
51205120+ /**
51215121+ * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
51225122+ */
51235123+ lora?: string
51245124+ response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode
51255125+ /**
51265126+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
51275127+ */
51285128+ raw?: boolean
51295129+ /**
51305130+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
51315131+ */
51325132+ stream?: boolean
51335133+ /**
51345134+ * The maximum number of tokens to generate in the response.
51355135+ */
51365136+ max_tokens?: number
51375137+ /**
51385138+ * Controls the randomness of the output; higher values produce more random results.
51395139+ */
51405140+ temperature?: number
51415141+ /**
51425142+ * 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.
51435143+ */
51445144+ top_p?: number
51455145+ /**
51465146+ * 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.
51475147+ */
51485148+ top_k?: number
51495149+ /**
51505150+ * Random seed for reproducibility of the generation.
51515151+ */
51525152+ seed?: number
51535153+ /**
51545154+ * Penalty for repeated tokens; higher values discourage repetition.
51555155+ */
51565156+ repetition_penalty?: number
51575157+ /**
51585158+ * Decreases the likelihood of the model repeating the same lines verbatim.
51595159+ */
51605160+ frequency_penalty?: number
51615161+ /**
51625162+ * Increases the likelihood of the model introducing new topics.
51635163+ */
51645164+ presence_penalty?: number
51655165+}
51665166+interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode {
51675167+ type?: 'json_object' | 'json_schema'
51685168+ json_schema?: unknown
51695169+}
51705170+interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {
51715171+ /**
51725172+ * An array of message objects representing the conversation history.
51735173+ */
51745174+ messages: {
51755175+ /**
51765176+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
51775177+ */
51785178+ role: string
51795179+ /**
51805180+ * The content of the message as a string.
51815181+ */
51825182+ content: string
51835183+ }[]
51845184+ functions?: {
51855185+ name: string
51865186+ code: string
51875187+ }[]
51885188+ /**
51895189+ * A list of tools available for the assistant to use.
51905190+ */
51915191+ tools?: (
51925192+ | {
51935193+ /**
51945194+ * The name of the tool. More descriptive the better.
51955195+ */
51965196+ name: string
51975197+ /**
51985198+ * A brief description of what the tool does.
51995199+ */
52005200+ description: string
52015201+ /**
52025202+ * Schema defining the parameters accepted by the tool.
52035203+ */
52045204+ parameters: {
52055205+ /**
52065206+ * The type of the parameters object (usually 'object').
52075207+ */
52085208+ type: string
52095209+ /**
52105210+ * List of required parameter names.
52115211+ */
52125212+ required?: string[]
52135213+ /**
52145214+ * Definitions of each parameter.
52155215+ */
52165216+ properties: {
52175217+ [k: string]: {
52185218+ /**
52195219+ * The data type of the parameter.
52205220+ */
52215221+ type: string
52225222+ /**
52235223+ * A description of the expected parameter.
52245224+ */
52255225+ description: string
52265226+ }
52275227+ }
52285228+ }
52295229+ }
52305230+ | {
52315231+ /**
52325232+ * Specifies the type of tool (e.g., 'function').
52335233+ */
52345234+ type: string
52355235+ /**
52365236+ * Details of the function tool.
52375237+ */
52385238+ function: {
52395239+ /**
52405240+ * The name of the function.
52415241+ */
52425242+ name: string
52435243+ /**
52445244+ * A brief description of what the function does.
52455245+ */
52465246+ description: string
52475247+ /**
52485248+ * Schema defining the parameters accepted by the function.
52495249+ */
52505250+ parameters: {
52515251+ /**
52525252+ * The type of the parameters object (usually 'object').
52535253+ */
52545254+ type: string
52555255+ /**
52565256+ * List of required parameter names.
52575257+ */
52585258+ required?: string[]
52595259+ /**
52605260+ * Definitions of each parameter.
52615261+ */
52625262+ properties: {
52635263+ [k: string]: {
52645264+ /**
52655265+ * The data type of the parameter.
52665266+ */
52675267+ type: string
52685268+ /**
52695269+ * A description of the expected parameter.
52705270+ */
52715271+ description: string
52725272+ }
52735273+ }
52745274+ }
52755275+ }
52765276+ }
52775277+ )[]
52785278+ response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_1
52795279+ /**
52805280+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
52815281+ */
52825282+ raw?: boolean
52835283+ /**
52845284+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
52855285+ */
52865286+ stream?: boolean
52875287+ /**
52885288+ * The maximum number of tokens to generate in the response.
52895289+ */
52905290+ max_tokens?: number
52915291+ /**
52925292+ * Controls the randomness of the output; higher values produce more random results.
52935293+ */
52945294+ temperature?: number
52955295+ /**
52965296+ * 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.
52975297+ */
52985298+ top_p?: number
52995299+ /**
53005300+ * 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.
53015301+ */
53025302+ top_k?: number
53035303+ /**
53045304+ * Random seed for reproducibility of the generation.
53055305+ */
53065306+ seed?: number
53075307+ /**
53085308+ * Penalty for repeated tokens; higher values discourage repetition.
53095309+ */
53105310+ repetition_penalty?: number
53115311+ /**
53125312+ * Decreases the likelihood of the model repeating the same lines verbatim.
53135313+ */
53145314+ frequency_penalty?: number
53155315+ /**
53165316+ * Increases the likelihood of the model introducing new topics.
53175317+ */
53185318+ presence_penalty?: number
53195319+}
53205320+interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_1 {
53215321+ type?: 'json_object' | 'json_schema'
53225322+ json_schema?: unknown
53235323+}
53245324+interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Async_Batch {
53255325+ requests?: {
53265326+ /**
53275327+ * 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.
53285328+ */
53295329+ external_reference?: string
53305330+ /**
53315331+ * Prompt for the text generation model
53325332+ */
53335333+ prompt?: string
53345334+ /**
53355335+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
53365336+ */
53375337+ stream?: boolean
53385338+ /**
53395339+ * The maximum number of tokens to generate in the response.
53405340+ */
53415341+ max_tokens?: number
53425342+ /**
53435343+ * Controls the randomness of the output; higher values produce more random results.
53445344+ */
53455345+ temperature?: number
53465346+ /**
53475347+ * 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.
53485348+ */
53495349+ top_p?: number
53505350+ /**
53515351+ * Random seed for reproducibility of the generation.
53525352+ */
53535353+ seed?: number
53545354+ /**
53555355+ * Penalty for repeated tokens; higher values discourage repetition.
53565356+ */
53575357+ repetition_penalty?: number
53585358+ /**
53595359+ * Decreases the likelihood of the model repeating the same lines verbatim.
53605360+ */
53615361+ frequency_penalty?: number
53625362+ /**
53635363+ * Increases the likelihood of the model introducing new topics.
53645364+ */
53655365+ presence_penalty?: number
53665366+ response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_2
53675367+ }[]
53685368+}
53695369+interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_2 {
53705370+ type?: 'json_object' | 'json_schema'
53715371+ json_schema?: unknown
53725372+}
53735373+type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
53745374+ | {
53755375+ /**
53765376+ * The generated text response from the model
53775377+ */
53785378+ response: string
53795379+ /**
53805380+ * Usage statistics for the inference request
53815381+ */
53825382+ usage?: {
53835383+ /**
53845384+ * Total number of tokens in input
53855385+ */
53865386+ prompt_tokens?: number
53875387+ /**
53885388+ * Total number of tokens in output
53895389+ */
53905390+ completion_tokens?: number
53915391+ /**
53925392+ * Total number of input and output tokens
53935393+ */
53945394+ total_tokens?: number
53955395+ }
53965396+ /**
53975397+ * An array of tool calls requests made during the response generation
53985398+ */
53995399+ tool_calls?: {
54005400+ /**
54015401+ * The arguments passed to be passed to the tool call request
54025402+ */
54035403+ arguments?: object
54045404+ /**
54055405+ * The name of the tool to be called
54065406+ */
54075407+ name?: string
54085408+ }[]
54095409+ }
54105410+ | string
54115411+ | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_AsyncResponse
54125412+interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_AsyncResponse {
54135413+ /**
54145414+ * The async request id that can be used to obtain the results.
54155415+ */
54165416+ request_id?: string
54175417+}
54185418+declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
54195419+ inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input
54205420+ postProcessedOutputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output
54215421+}
54225422+interface Ai_Cf_Meta_Llama_Guard_3_8B_Input {
54235423+ /**
54245424+ * An array of message objects representing the conversation history.
54255425+ */
54265426+ messages: {
54275427+ /**
54285428+ * The role of the message sender must alternate between 'user' and 'assistant'.
54295429+ */
54305430+ role: 'user' | 'assistant'
54315431+ /**
54325432+ * The content of the message as a string.
54335433+ */
54345434+ content: string
54355435+ }[]
54365436+ /**
54375437+ * The maximum number of tokens to generate in the response.
54385438+ */
54395439+ max_tokens?: number
54405440+ /**
54415441+ * Controls the randomness of the output; higher values produce more random results.
54425442+ */
54435443+ temperature?: number
54445444+ /**
54455445+ * Dictate the output format of the generated response.
54465446+ */
54475447+ response_format?: {
54485448+ /**
54495449+ * Set to json_object to process and output generated text as JSON.
54505450+ */
54515451+ type?: string
54525452+ }
54535453+}
54545454+interface Ai_Cf_Meta_Llama_Guard_3_8B_Output {
54555455+ response?:
54565456+ | string
54575457+ | {
54585458+ /**
54595459+ * Whether the conversation is safe or not.
54605460+ */
54615461+ safe?: boolean
54625462+ /**
54635463+ * A list of what hazard categories predicted for the conversation, if the conversation is deemed unsafe.
54645464+ */
54655465+ categories?: string[]
54665466+ }
54675467+ /**
54685468+ * Usage statistics for the inference request
54695469+ */
54705470+ usage?: {
54715471+ /**
54725472+ * Total number of tokens in input
54735473+ */
54745474+ prompt_tokens?: number
54755475+ /**
54765476+ * Total number of tokens in output
54775477+ */
54785478+ completion_tokens?: number
54795479+ /**
54805480+ * Total number of input and output tokens
54815481+ */
54825482+ total_tokens?: number
54835483+ }
54845484+}
54855485+declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B {
54865486+ inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input
54875487+ postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output
54885488+}
54895489+interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
54905490+ /**
54915491+ * A query you wish to perform against the provided contexts.
54925492+ */
54935493+ /**
54945494+ * Number of returned results starting with the best score.
54955495+ */
54965496+ top_k?: number
54975497+ /**
54985498+ * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
54995499+ */
55005500+ contexts: {
55015501+ /**
55025502+ * One of the provided context content
55035503+ */
55045504+ text?: string
55055505+ }[]
55065506+}
55075507+interface Ai_Cf_Baai_Bge_Reranker_Base_Output {
55085508+ response?: {
55095509+ /**
55105510+ * Index of the context in the request
55115511+ */
55125512+ id?: number
55135513+ /**
55145514+ * Score of the context under the index.
55155515+ */
55165516+ score?: number
55175517+ }[]
55185518+}
55195519+declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {
55205520+ inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input
55215521+ postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output
55225522+}
55235523+type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input =
55245524+ | Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Prompt
55255525+ | Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Messages
55265526+interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Prompt {
55275527+ /**
55285528+ * The input text prompt for the model to generate a response.
55295529+ */
55305530+ prompt: string
55315531+ /**
55325532+ * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
55335533+ */
55345534+ lora?: string
55355535+ response_format?: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode
55365536+ /**
55375537+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
55385538+ */
55395539+ raw?: boolean
55405540+ /**
55415541+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
55425542+ */
55435543+ stream?: boolean
55445544+ /**
55455545+ * The maximum number of tokens to generate in the response.
55465546+ */
55475547+ max_tokens?: number
55485548+ /**
55495549+ * Controls the randomness of the output; higher values produce more random results.
55505550+ */
55515551+ temperature?: number
55525552+ /**
55535553+ * 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.
55545554+ */
55555555+ top_p?: number
55565556+ /**
55575557+ * 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.
55585558+ */
55595559+ top_k?: number
55605560+ /**
55615561+ * Random seed for reproducibility of the generation.
55625562+ */
55635563+ seed?: number
55645564+ /**
55655565+ * Penalty for repeated tokens; higher values discourage repetition.
55665566+ */
55675567+ repetition_penalty?: number
55685568+ /**
55695569+ * Decreases the likelihood of the model repeating the same lines verbatim.
55705570+ */
55715571+ frequency_penalty?: number
55725572+ /**
55735573+ * Increases the likelihood of the model introducing new topics.
55745574+ */
55755575+ presence_penalty?: number
55765576+}
55775577+interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode {
55785578+ type?: 'json_object' | 'json_schema'
55795579+ json_schema?: unknown
55805580+}
55815581+interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Messages {
55825582+ /**
55835583+ * An array of message objects representing the conversation history.
55845584+ */
55855585+ messages: {
55865586+ /**
55875587+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
55885588+ */
55895589+ role: string
55905590+ /**
55915591+ * The content of the message as a string.
55925592+ */
55935593+ content: string
55945594+ }[]
55955595+ functions?: {
55965596+ name: string
55975597+ code: string
55985598+ }[]
55995599+ /**
56005600+ * A list of tools available for the assistant to use.
56015601+ */
56025602+ tools?: (
56035603+ | {
56045604+ /**
56055605+ * The name of the tool. More descriptive the better.
56065606+ */
56075607+ name: string
56085608+ /**
56095609+ * A brief description of what the tool does.
56105610+ */
56115611+ description: string
56125612+ /**
56135613+ * Schema defining the parameters accepted by the tool.
56145614+ */
56155615+ parameters: {
56165616+ /**
56175617+ * The type of the parameters object (usually 'object').
56185618+ */
56195619+ type: string
56205620+ /**
56215621+ * List of required parameter names.
56225622+ */
56235623+ required?: string[]
56245624+ /**
56255625+ * Definitions of each parameter.
56265626+ */
56275627+ properties: {
56285628+ [k: string]: {
56295629+ /**
56305630+ * The data type of the parameter.
56315631+ */
56325632+ type: string
56335633+ /**
56345634+ * A description of the expected parameter.
56355635+ */
56365636+ description: string
56375637+ }
56385638+ }
56395639+ }
56405640+ }
56415641+ | {
56425642+ /**
56435643+ * Specifies the type of tool (e.g., 'function').
56445644+ */
56455645+ type: string
56465646+ /**
56475647+ * Details of the function tool.
56485648+ */
56495649+ function: {
56505650+ /**
56515651+ * The name of the function.
56525652+ */
56535653+ name: string
56545654+ /**
56555655+ * A brief description of what the function does.
56565656+ */
56575657+ description: string
56585658+ /**
56595659+ * Schema defining the parameters accepted by the function.
56605660+ */
56615661+ parameters: {
56625662+ /**
56635663+ * The type of the parameters object (usually 'object').
56645664+ */
56655665+ type: string
56665666+ /**
56675667+ * List of required parameter names.
56685668+ */
56695669+ required?: string[]
56705670+ /**
56715671+ * Definitions of each parameter.
56725672+ */
56735673+ properties: {
56745674+ [k: string]: {
56755675+ /**
56765676+ * The data type of the parameter.
56775677+ */
56785678+ type: string
56795679+ /**
56805680+ * A description of the expected parameter.
56815681+ */
56825682+ description: string
56835683+ }
56845684+ }
56855685+ }
56865686+ }
56875687+ }
56885688+ )[]
56895689+ response_format?: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode_1
56905690+ /**
56915691+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
56925692+ */
56935693+ raw?: boolean
56945694+ /**
56955695+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
56965696+ */
56975697+ stream?: boolean
56985698+ /**
56995699+ * The maximum number of tokens to generate in the response.
57005700+ */
57015701+ max_tokens?: number
57025702+ /**
57035703+ * Controls the randomness of the output; higher values produce more random results.
57045704+ */
57055705+ temperature?: number
57065706+ /**
57075707+ * 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.
57085708+ */
57095709+ top_p?: number
57105710+ /**
57115711+ * 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.
57125712+ */
57135713+ top_k?: number
57145714+ /**
57155715+ * Random seed for reproducibility of the generation.
57165716+ */
57175717+ seed?: number
57185718+ /**
57195719+ * Penalty for repeated tokens; higher values discourage repetition.
57205720+ */
57215721+ repetition_penalty?: number
57225722+ /**
57235723+ * Decreases the likelihood of the model repeating the same lines verbatim.
57245724+ */
57255725+ frequency_penalty?: number
57265726+ /**
57275727+ * Increases the likelihood of the model introducing new topics.
57285728+ */
57295729+ presence_penalty?: number
57305730+}
57315731+interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode_1 {
57325732+ type?: 'json_object' | 'json_schema'
57335733+ json_schema?: unknown
57345734+}
57355735+type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output = {
57365736+ /**
57375737+ * The generated text response from the model
57385738+ */
57395739+ response: string
57405740+ /**
57415741+ * Usage statistics for the inference request
57425742+ */
57435743+ usage?: {
57445744+ /**
57455745+ * Total number of tokens in input
57465746+ */
57475747+ prompt_tokens?: number
57485748+ /**
57495749+ * Total number of tokens in output
57505750+ */
57515751+ completion_tokens?: number
57525752+ /**
57535753+ * Total number of input and output tokens
57545754+ */
57555755+ total_tokens?: number
57565756+ }
57575757+ /**
57585758+ * An array of tool calls requests made during the response generation
57595759+ */
57605760+ tool_calls?: {
57615761+ /**
57625762+ * The arguments passed to be passed to the tool call request
57635763+ */
57645764+ arguments?: object
57655765+ /**
57665766+ * The name of the tool to be called
57675767+ */
57685768+ name?: string
57695769+ }[]
57705770+}
57715771+declare abstract class Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct {
57725772+ inputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input
57735773+ postProcessedOutputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output
57745774+}
57755775+type Ai_Cf_Qwen_Qwq_32B_Input = Ai_Cf_Qwen_Qwq_32B_Prompt | Ai_Cf_Qwen_Qwq_32B_Messages
57765776+interface Ai_Cf_Qwen_Qwq_32B_Prompt {
57775777+ /**
57785778+ * The input text prompt for the model to generate a response.
57795779+ */
57805780+ prompt: string
57815781+ /**
57825782+ * JSON schema that should be fulfilled for the response.
57835783+ */
57845784+ guided_json?: object
57855785+ /**
57865786+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
57875787+ */
57885788+ raw?: boolean
57895789+ /**
57905790+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
57915791+ */
57925792+ stream?: boolean
57935793+ /**
57945794+ * The maximum number of tokens to generate in the response.
57955795+ */
57965796+ max_tokens?: number
57975797+ /**
57985798+ * Controls the randomness of the output; higher values produce more random results.
57995799+ */
58005800+ temperature?: number
58015801+ /**
58025802+ * 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.
58035803+ */
58045804+ top_p?: number
58055805+ /**
58065806+ * 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.
58075807+ */
58085808+ top_k?: number
58095809+ /**
58105810+ * Random seed for reproducibility of the generation.
58115811+ */
58125812+ seed?: number
58135813+ /**
58145814+ * Penalty for repeated tokens; higher values discourage repetition.
58155815+ */
58165816+ repetition_penalty?: number
58175817+ /**
58185818+ * Decreases the likelihood of the model repeating the same lines verbatim.
58195819+ */
58205820+ frequency_penalty?: number
58215821+ /**
58225822+ * Increases the likelihood of the model introducing new topics.
58235823+ */
58245824+ presence_penalty?: number
58255825+}
58265826+interface Ai_Cf_Qwen_Qwq_32B_Messages {
58275827+ /**
58285828+ * An array of message objects representing the conversation history.
58295829+ */
58305830+ messages: {
58315831+ /**
58325832+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
58335833+ */
58345834+ role?: string
58355835+ /**
58365836+ * 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 000000001
58375837+ */
58385838+ tool_call_id?: string
58395839+ content?:
58405840+ | string
58415841+ | {
58425842+ /**
58435843+ * Type of the content provided
58445844+ */
58455845+ type?: string
58465846+ text?: string
58475847+ image_url?: {
58485848+ /**
58495849+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
58505850+ */
58515851+ url?: string
58525852+ }
58535853+ }[]
58545854+ | {
58555855+ /**
58565856+ * Type of the content provided
58575857+ */
58585858+ type?: string
58595859+ text?: string
58605860+ image_url?: {
58615861+ /**
58625862+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
58635863+ */
58645864+ url?: string
58655865+ }
58665866+ }
58675867+ }[]
58685868+ functions?: {
58695869+ name: string
58705870+ code: string
58715871+ }[]
58725872+ /**
58735873+ * A list of tools available for the assistant to use.
58745874+ */
58755875+ tools?: (
58765876+ | {
58775877+ /**
58785878+ * The name of the tool. More descriptive the better.
58795879+ */
58805880+ name: string
58815881+ /**
58825882+ * A brief description of what the tool does.
58835883+ */
58845884+ description: string
58855885+ /**
58865886+ * Schema defining the parameters accepted by the tool.
58875887+ */
58885888+ parameters: {
58895889+ /**
58905890+ * The type of the parameters object (usually 'object').
58915891+ */
58925892+ type: string
58935893+ /**
58945894+ * List of required parameter names.
58955895+ */
58965896+ required?: string[]
58975897+ /**
58985898+ * Definitions of each parameter.
58995899+ */
59005900+ properties: {
59015901+ [k: string]: {
59025902+ /**
59035903+ * The data type of the parameter.
59045904+ */
59055905+ type: string
59065906+ /**
59075907+ * A description of the expected parameter.
59085908+ */
59095909+ description: string
59105910+ }
59115911+ }
59125912+ }
59135913+ }
59145914+ | {
59155915+ /**
59165916+ * Specifies the type of tool (e.g., 'function').
59175917+ */
59185918+ type: string
59195919+ /**
59205920+ * Details of the function tool.
59215921+ */
59225922+ function: {
59235923+ /**
59245924+ * The name of the function.
59255925+ */
59265926+ name: string
59275927+ /**
59285928+ * A brief description of what the function does.
59295929+ */
59305930+ description: string
59315931+ /**
59325932+ * Schema defining the parameters accepted by the function.
59335933+ */
59345934+ parameters: {
59355935+ /**
59365936+ * The type of the parameters object (usually 'object').
59375937+ */
59385938+ type: string
59395939+ /**
59405940+ * List of required parameter names.
59415941+ */
59425942+ required?: string[]
59435943+ /**
59445944+ * Definitions of each parameter.
59455945+ */
59465946+ properties: {
59475947+ [k: string]: {
59485948+ /**
59495949+ * The data type of the parameter.
59505950+ */
59515951+ type: string
59525952+ /**
59535953+ * A description of the expected parameter.
59545954+ */
59555955+ description: string
59565956+ }
59575957+ }
59585958+ }
59595959+ }
59605960+ }
59615961+ )[]
59625962+ /**
59635963+ * JSON schema that should be fufilled for the response.
59645964+ */
59655965+ guided_json?: object
59665966+ /**
59675967+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
59685968+ */
59695969+ raw?: boolean
59705970+ /**
59715971+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
59725972+ */
59735973+ stream?: boolean
59745974+ /**
59755975+ * The maximum number of tokens to generate in the response.
59765976+ */
59775977+ max_tokens?: number
59785978+ /**
59795979+ * Controls the randomness of the output; higher values produce more random results.
59805980+ */
59815981+ temperature?: number
59825982+ /**
59835983+ * 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.
59845984+ */
59855985+ top_p?: number
59865986+ /**
59875987+ * 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.
59885988+ */
59895989+ top_k?: number
59905990+ /**
59915991+ * Random seed for reproducibility of the generation.
59925992+ */
59935993+ seed?: number
59945994+ /**
59955995+ * Penalty for repeated tokens; higher values discourage repetition.
59965996+ */
59975997+ repetition_penalty?: number
59985998+ /**
59995999+ * Decreases the likelihood of the model repeating the same lines verbatim.
60006000+ */
60016001+ frequency_penalty?: number
60026002+ /**
60036003+ * Increases the likelihood of the model introducing new topics.
60046004+ */
60056005+ presence_penalty?: number
60066006+}
60076007+type Ai_Cf_Qwen_Qwq_32B_Output = {
60086008+ /**
60096009+ * The generated text response from the model
60106010+ */
60116011+ response: string
60126012+ /**
60136013+ * Usage statistics for the inference request
60146014+ */
60156015+ usage?: {
60166016+ /**
60176017+ * Total number of tokens in input
60186018+ */
60196019+ prompt_tokens?: number
60206020+ /**
60216021+ * Total number of tokens in output
60226022+ */
60236023+ completion_tokens?: number
60246024+ /**
60256025+ * Total number of input and output tokens
60266026+ */
60276027+ total_tokens?: number
60286028+ }
60296029+ /**
60306030+ * An array of tool calls requests made during the response generation
60316031+ */
60326032+ tool_calls?: {
60336033+ /**
60346034+ * The arguments passed to be passed to the tool call request
60356035+ */
60366036+ arguments?: object
60376037+ /**
60386038+ * The name of the tool to be called
60396039+ */
60406040+ name?: string
60416041+ }[]
60426042+}
60436043+declare abstract class Base_Ai_Cf_Qwen_Qwq_32B {
60446044+ inputs: Ai_Cf_Qwen_Qwq_32B_Input
60456045+ postProcessedOutputs: Ai_Cf_Qwen_Qwq_32B_Output
60466046+}
60476047+type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input =
60486048+ | Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Prompt
60496049+ | Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages
60506050+interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Prompt {
60516051+ /**
60526052+ * The input text prompt for the model to generate a response.
60536053+ */
60546054+ prompt: string
60556055+ /**
60566056+ * JSON schema that should be fulfilled for the response.
60576057+ */
60586058+ guided_json?: object
60596059+ /**
60606060+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
60616061+ */
60626062+ raw?: boolean
60636063+ /**
60646064+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
60656065+ */
60666066+ stream?: boolean
60676067+ /**
60686068+ * The maximum number of tokens to generate in the response.
60696069+ */
60706070+ max_tokens?: number
60716071+ /**
60726072+ * Controls the randomness of the output; higher values produce more random results.
60736073+ */
60746074+ temperature?: number
60756075+ /**
60766076+ * 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.
60776077+ */
60786078+ top_p?: number
60796079+ /**
60806080+ * 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.
60816081+ */
60826082+ top_k?: number
60836083+ /**
60846084+ * Random seed for reproducibility of the generation.
60856085+ */
60866086+ seed?: number
60876087+ /**
60886088+ * Penalty for repeated tokens; higher values discourage repetition.
60896089+ */
60906090+ repetition_penalty?: number
60916091+ /**
60926092+ * Decreases the likelihood of the model repeating the same lines verbatim.
60936093+ */
60946094+ frequency_penalty?: number
60956095+ /**
60966096+ * Increases the likelihood of the model introducing new topics.
60976097+ */
60986098+ presence_penalty?: number
60996099+}
61006100+interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages {
61016101+ /**
61026102+ * An array of message objects representing the conversation history.
61036103+ */
61046104+ messages: {
61056105+ /**
61066106+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
61076107+ */
61086108+ role?: string
61096109+ /**
61106110+ * 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 000000001
61116111+ */
61126112+ tool_call_id?: string
61136113+ content?:
61146114+ | string
61156115+ | {
61166116+ /**
61176117+ * Type of the content provided
61186118+ */
61196119+ type?: string
61206120+ text?: string
61216121+ image_url?: {
61226122+ /**
61236123+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
61246124+ */
61256125+ url?: string
61266126+ }
61276127+ }[]
61286128+ | {
61296129+ /**
61306130+ * Type of the content provided
61316131+ */
61326132+ type?: string
61336133+ text?: string
61346134+ image_url?: {
61356135+ /**
61366136+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
61376137+ */
61386138+ url?: string
61396139+ }
61406140+ }
61416141+ }[]
61426142+ functions?: {
61436143+ name: string
61446144+ code: string
61456145+ }[]
61466146+ /**
61476147+ * A list of tools available for the assistant to use.
61486148+ */
61496149+ tools?: (
61506150+ | {
61516151+ /**
61526152+ * The name of the tool. More descriptive the better.
61536153+ */
61546154+ name: string
61556155+ /**
61566156+ * A brief description of what the tool does.
61576157+ */
61586158+ description: string
61596159+ /**
61606160+ * Schema defining the parameters accepted by the tool.
61616161+ */
61626162+ parameters: {
61636163+ /**
61646164+ * The type of the parameters object (usually 'object').
61656165+ */
61666166+ type: string
61676167+ /**
61686168+ * List of required parameter names.
61696169+ */
61706170+ required?: string[]
61716171+ /**
61726172+ * Definitions of each parameter.
61736173+ */
61746174+ properties: {
61756175+ [k: string]: {
61766176+ /**
61776177+ * The data type of the parameter.
61786178+ */
61796179+ type: string
61806180+ /**
61816181+ * A description of the expected parameter.
61826182+ */
61836183+ description: string
61846184+ }
61856185+ }
61866186+ }
61876187+ }
61886188+ | {
61896189+ /**
61906190+ * Specifies the type of tool (e.g., 'function').
61916191+ */
61926192+ type: string
61936193+ /**
61946194+ * Details of the function tool.
61956195+ */
61966196+ function: {
61976197+ /**
61986198+ * The name of the function.
61996199+ */
62006200+ name: string
62016201+ /**
62026202+ * A brief description of what the function does.
62036203+ */
62046204+ description: string
62056205+ /**
62066206+ * Schema defining the parameters accepted by the function.
62076207+ */
62086208+ parameters: {
62096209+ /**
62106210+ * The type of the parameters object (usually 'object').
62116211+ */
62126212+ type: string
62136213+ /**
62146214+ * List of required parameter names.
62156215+ */
62166216+ required?: string[]
62176217+ /**
62186218+ * Definitions of each parameter.
62196219+ */
62206220+ properties: {
62216221+ [k: string]: {
62226222+ /**
62236223+ * The data type of the parameter.
62246224+ */
62256225+ type: string
62266226+ /**
62276227+ * A description of the expected parameter.
62286228+ */
62296229+ description: string
62306230+ }
62316231+ }
62326232+ }
62336233+ }
62346234+ }
62356235+ )[]
62366236+ /**
62376237+ * JSON schema that should be fufilled for the response.
62386238+ */
62396239+ guided_json?: object
62406240+ /**
62416241+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
62426242+ */
62436243+ raw?: boolean
62446244+ /**
62456245+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
62466246+ */
62476247+ stream?: boolean
62486248+ /**
62496249+ * The maximum number of tokens to generate in the response.
62506250+ */
62516251+ max_tokens?: number
62526252+ /**
62536253+ * Controls the randomness of the output; higher values produce more random results.
62546254+ */
62556255+ temperature?: number
62566256+ /**
62576257+ * 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.
62586258+ */
62596259+ top_p?: number
62606260+ /**
62616261+ * 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.
62626262+ */
62636263+ top_k?: number
62646264+ /**
62656265+ * Random seed for reproducibility of the generation.
62666266+ */
62676267+ seed?: number
62686268+ /**
62696269+ * Penalty for repeated tokens; higher values discourage repetition.
62706270+ */
62716271+ repetition_penalty?: number
62726272+ /**
62736273+ * Decreases the likelihood of the model repeating the same lines verbatim.
62746274+ */
62756275+ frequency_penalty?: number
62766276+ /**
62776277+ * Increases the likelihood of the model introducing new topics.
62786278+ */
62796279+ presence_penalty?: number
62806280+}
62816281+type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output = {
62826282+ /**
62836283+ * The generated text response from the model
62846284+ */
62856285+ response: string
62866286+ /**
62876287+ * Usage statistics for the inference request
62886288+ */
62896289+ usage?: {
62906290+ /**
62916291+ * Total number of tokens in input
62926292+ */
62936293+ prompt_tokens?: number
62946294+ /**
62956295+ * Total number of tokens in output
62966296+ */
62976297+ completion_tokens?: number
62986298+ /**
62996299+ * Total number of input and output tokens
63006300+ */
63016301+ total_tokens?: number
63026302+ }
63036303+ /**
63046304+ * An array of tool calls requests made during the response generation
63056305+ */
63066306+ tool_calls?: {
63076307+ /**
63086308+ * The arguments passed to be passed to the tool call request
63096309+ */
63106310+ arguments?: object
63116311+ /**
63126312+ * The name of the tool to be called
63136313+ */
63146314+ name?: string
63156315+ }[]
63166316+}
63176317+declare abstract class Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct {
63186318+ inputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input
63196319+ postProcessedOutputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output
63206320+}
63216321+type Ai_Cf_Google_Gemma_3_12B_It_Input =
63226322+ | Ai_Cf_Google_Gemma_3_12B_It_Prompt
63236323+ | Ai_Cf_Google_Gemma_3_12B_It_Messages
63246324+interface Ai_Cf_Google_Gemma_3_12B_It_Prompt {
63256325+ /**
63266326+ * The input text prompt for the model to generate a response.
63276327+ */
63286328+ prompt: string
63296329+ /**
63306330+ * JSON schema that should be fufilled for the response.
63316331+ */
63326332+ guided_json?: object
63336333+ /**
63346334+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
63356335+ */
63366336+ raw?: boolean
63376337+ /**
63386338+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
63396339+ */
63406340+ stream?: boolean
63416341+ /**
63426342+ * The maximum number of tokens to generate in the response.
63436343+ */
63446344+ max_tokens?: number
63456345+ /**
63466346+ * Controls the randomness of the output; higher values produce more random results.
63476347+ */
63486348+ temperature?: number
63496349+ /**
63506350+ * 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.
63516351+ */
63526352+ top_p?: number
63536353+ /**
63546354+ * 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.
63556355+ */
63566356+ top_k?: number
63576357+ /**
63586358+ * Random seed for reproducibility of the generation.
63596359+ */
63606360+ seed?: number
63616361+ /**
63626362+ * Penalty for repeated tokens; higher values discourage repetition.
63636363+ */
63646364+ repetition_penalty?: number
63656365+ /**
63666366+ * Decreases the likelihood of the model repeating the same lines verbatim.
63676367+ */
63686368+ frequency_penalty?: number
63696369+ /**
63706370+ * Increases the likelihood of the model introducing new topics.
63716371+ */
63726372+ presence_penalty?: number
63736373+}
63746374+interface Ai_Cf_Google_Gemma_3_12B_It_Messages {
63756375+ /**
63766376+ * An array of message objects representing the conversation history.
63776377+ */
63786378+ messages: {
63796379+ /**
63806380+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
63816381+ */
63826382+ role?: string
63836383+ content?:
63846384+ | string
63856385+ | {
63866386+ /**
63876387+ * Type of the content provided
63886388+ */
63896389+ type?: string
63906390+ text?: string
63916391+ image_url?: {
63926392+ /**
63936393+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
63946394+ */
63956395+ url?: string
63966396+ }
63976397+ }[]
63986398+ }[]
63996399+ functions?: {
64006400+ name: string
64016401+ code: string
64026402+ }[]
64036403+ /**
64046404+ * A list of tools available for the assistant to use.
64056405+ */
64066406+ tools?: (
64076407+ | {
64086408+ /**
64096409+ * The name of the tool. More descriptive the better.
64106410+ */
64116411+ name: string
64126412+ /**
64136413+ * A brief description of what the tool does.
64146414+ */
64156415+ description: string
64166416+ /**
64176417+ * Schema defining the parameters accepted by the tool.
64186418+ */
64196419+ parameters: {
64206420+ /**
64216421+ * The type of the parameters object (usually 'object').
64226422+ */
64236423+ type: string
64246424+ /**
64256425+ * List of required parameter names.
64266426+ */
64276427+ required?: string[]
64286428+ /**
64296429+ * Definitions of each parameter.
64306430+ */
64316431+ properties: {
64326432+ [k: string]: {
64336433+ /**
64346434+ * The data type of the parameter.
64356435+ */
64366436+ type: string
64376437+ /**
64386438+ * A description of the expected parameter.
64396439+ */
64406440+ description: string
64416441+ }
64426442+ }
64436443+ }
64446444+ }
64456445+ | {
64466446+ /**
64476447+ * Specifies the type of tool (e.g., 'function').
64486448+ */
64496449+ type: string
64506450+ /**
64516451+ * Details of the function tool.
64526452+ */
64536453+ function: {
64546454+ /**
64556455+ * The name of the function.
64566456+ */
64576457+ name: string
64586458+ /**
64596459+ * A brief description of what the function does.
64606460+ */
64616461+ description: string
64626462+ /**
64636463+ * Schema defining the parameters accepted by the function.
64646464+ */
64656465+ parameters: {
64666466+ /**
64676467+ * The type of the parameters object (usually 'object').
64686468+ */
64696469+ type: string
64706470+ /**
64716471+ * List of required parameter names.
64726472+ */
64736473+ required?: string[]
64746474+ /**
64756475+ * Definitions of each parameter.
64766476+ */
64776477+ properties: {
64786478+ [k: string]: {
64796479+ /**
64806480+ * The data type of the parameter.
64816481+ */
64826482+ type: string
64836483+ /**
64846484+ * A description of the expected parameter.
64856485+ */
64866486+ description: string
64876487+ }
64886488+ }
64896489+ }
64906490+ }
64916491+ }
64926492+ )[]
64936493+ /**
64946494+ * JSON schema that should be fufilled for the response.
64956495+ */
64966496+ guided_json?: object
64976497+ /**
64986498+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
64996499+ */
65006500+ raw?: boolean
65016501+ /**
65026502+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
65036503+ */
65046504+ stream?: boolean
65056505+ /**
65066506+ * The maximum number of tokens to generate in the response.
65076507+ */
65086508+ max_tokens?: number
65096509+ /**
65106510+ * Controls the randomness of the output; higher values produce more random results.
65116511+ */
65126512+ temperature?: number
65136513+ /**
65146514+ * 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.
65156515+ */
65166516+ top_p?: number
65176517+ /**
65186518+ * 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.
65196519+ */
65206520+ top_k?: number
65216521+ /**
65226522+ * Random seed for reproducibility of the generation.
65236523+ */
65246524+ seed?: number
65256525+ /**
65266526+ * Penalty for repeated tokens; higher values discourage repetition.
65276527+ */
65286528+ repetition_penalty?: number
65296529+ /**
65306530+ * Decreases the likelihood of the model repeating the same lines verbatim.
65316531+ */
65326532+ frequency_penalty?: number
65336533+ /**
65346534+ * Increases the likelihood of the model introducing new topics.
65356535+ */
65366536+ presence_penalty?: number
65376537+}
65386538+type Ai_Cf_Google_Gemma_3_12B_It_Output = {
65396539+ /**
65406540+ * The generated text response from the model
65416541+ */
65426542+ response: string
65436543+ /**
65446544+ * Usage statistics for the inference request
65456545+ */
65466546+ usage?: {
65476547+ /**
65486548+ * Total number of tokens in input
65496549+ */
65506550+ prompt_tokens?: number
65516551+ /**
65526552+ * Total number of tokens in output
65536553+ */
65546554+ completion_tokens?: number
65556555+ /**
65566556+ * Total number of input and output tokens
65576557+ */
65586558+ total_tokens?: number
65596559+ }
65606560+ /**
65616561+ * An array of tool calls requests made during the response generation
65626562+ */
65636563+ tool_calls?: {
65646564+ /**
65656565+ * The arguments passed to be passed to the tool call request
65666566+ */
65676567+ arguments?: object
65686568+ /**
65696569+ * The name of the tool to be called
65706570+ */
65716571+ name?: string
65726572+ }[]
65736573+}
65746574+declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
65756575+ inputs: Ai_Cf_Google_Gemma_3_12B_It_Input
65766576+ postProcessedOutputs: Ai_Cf_Google_Gemma_3_12B_It_Output
65776577+}
65786578+type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
65796579+ | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt
65806580+ | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages
65816581+ | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Async_Batch
65826582+interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt {
65836583+ /**
65846584+ * The input text prompt for the model to generate a response.
65856585+ */
65866586+ prompt: string
65876587+ /**
65886588+ * JSON schema that should be fulfilled for the response.
65896589+ */
65906590+ guided_json?: object
65916591+ response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode
65926592+ /**
65936593+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
65946594+ */
65956595+ raw?: boolean
65966596+ /**
65976597+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
65986598+ */
65996599+ stream?: boolean
66006600+ /**
66016601+ * The maximum number of tokens to generate in the response.
66026602+ */
66036603+ max_tokens?: number
66046604+ /**
66056605+ * Controls the randomness of the output; higher values produce more random results.
66066606+ */
66076607+ temperature?: number
66086608+ /**
66096609+ * 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.
66106610+ */
66116611+ top_p?: number
66126612+ /**
66136613+ * 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.
66146614+ */
66156615+ top_k?: number
66166616+ /**
66176617+ * Random seed for reproducibility of the generation.
66186618+ */
66196619+ seed?: number
66206620+ /**
66216621+ * Penalty for repeated tokens; higher values discourage repetition.
66226622+ */
66236623+ repetition_penalty?: number
66246624+ /**
66256625+ * Decreases the likelihood of the model repeating the same lines verbatim.
66266626+ */
66276627+ frequency_penalty?: number
66286628+ /**
66296629+ * Increases the likelihood of the model introducing new topics.
66306630+ */
66316631+ presence_penalty?: number
66326632+}
66336633+interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode {
66346634+ type?: 'json_object' | 'json_schema'
66356635+ json_schema?: unknown
66366636+}
66376637+interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages {
66386638+ /**
66396639+ * An array of message objects representing the conversation history.
66406640+ */
66416641+ messages: {
66426642+ /**
66436643+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
66446644+ */
66456645+ role?: string
66466646+ /**
66476647+ * The tool call id. If you don't know what to put here you can fall back to 000000001
66486648+ */
66496649+ tool_call_id?: string
66506650+ content?:
66516651+ | string
66526652+ | {
66536653+ /**
66546654+ * Type of the content provided
66556655+ */
66566656+ type?: string
66576657+ text?: string
66586658+ image_url?: {
66596659+ /**
66606660+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
66616661+ */
66626662+ url?: string
66636663+ }
66646664+ }[]
66656665+ | {
66666666+ /**
66676667+ * Type of the content provided
66686668+ */
66696669+ type?: string
66706670+ text?: string
66716671+ image_url?: {
66726672+ /**
66736673+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
66746674+ */
66756675+ url?: string
66766676+ }
66776677+ }
66786678+ }[]
66796679+ functions?: {
66806680+ name: string
66816681+ code: string
66826682+ }[]
66836683+ /**
66846684+ * A list of tools available for the assistant to use.
66856685+ */
66866686+ tools?: (
66876687+ | {
66886688+ /**
66896689+ * The name of the tool. More descriptive the better.
66906690+ */
66916691+ name: string
66926692+ /**
66936693+ * A brief description of what the tool does.
66946694+ */
66956695+ description: string
66966696+ /**
66976697+ * Schema defining the parameters accepted by the tool.
66986698+ */
66996699+ parameters: {
67006700+ /**
67016701+ * The type of the parameters object (usually 'object').
67026702+ */
67036703+ type: string
67046704+ /**
67056705+ * List of required parameter names.
67066706+ */
67076707+ required?: string[]
67086708+ /**
67096709+ * Definitions of each parameter.
67106710+ */
67116711+ properties: {
67126712+ [k: string]: {
67136713+ /**
67146714+ * The data type of the parameter.
67156715+ */
67166716+ type: string
67176717+ /**
67186718+ * A description of the expected parameter.
67196719+ */
67206720+ description: string
67216721+ }
67226722+ }
67236723+ }
67246724+ }
67256725+ | {
67266726+ /**
67276727+ * Specifies the type of tool (e.g., 'function').
67286728+ */
67296729+ type: string
67306730+ /**
67316731+ * Details of the function tool.
67326732+ */
67336733+ function: {
67346734+ /**
67356735+ * The name of the function.
67366736+ */
67376737+ name: string
67386738+ /**
67396739+ * A brief description of what the function does.
67406740+ */
67416741+ description: string
67426742+ /**
67436743+ * Schema defining the parameters accepted by the function.
67446744+ */
67456745+ parameters: {
67466746+ /**
67476747+ * The type of the parameters object (usually 'object').
67486748+ */
67496749+ type: string
67506750+ /**
67516751+ * List of required parameter names.
67526752+ */
67536753+ required?: string[]
67546754+ /**
67556755+ * Definitions of each parameter.
67566756+ */
67576757+ properties: {
67586758+ [k: string]: {
67596759+ /**
67606760+ * The data type of the parameter.
67616761+ */
67626762+ type: string
67636763+ /**
67646764+ * A description of the expected parameter.
67656765+ */
67666766+ description: string
67676767+ }
67686768+ }
67696769+ }
67706770+ }
67716771+ }
67726772+ )[]
67736773+ response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode
67746774+ /**
67756775+ * JSON schema that should be fufilled for the response.
67766776+ */
67776777+ guided_json?: object
67786778+ /**
67796779+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
67806780+ */
67816781+ raw?: boolean
67826782+ /**
67836783+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
67846784+ */
67856785+ stream?: boolean
67866786+ /**
67876787+ * The maximum number of tokens to generate in the response.
67886788+ */
67896789+ max_tokens?: number
67906790+ /**
67916791+ * Controls the randomness of the output; higher values produce more random results.
67926792+ */
67936793+ temperature?: number
67946794+ /**
67956795+ * 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.
67966796+ */
67976797+ top_p?: number
67986798+ /**
67996799+ * 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.
68006800+ */
68016801+ top_k?: number
68026802+ /**
68036803+ * Random seed for reproducibility of the generation.
68046804+ */
68056805+ seed?: number
68066806+ /**
68076807+ * Penalty for repeated tokens; higher values discourage repetition.
68086808+ */
68096809+ repetition_penalty?: number
68106810+ /**
68116811+ * Decreases the likelihood of the model repeating the same lines verbatim.
68126812+ */
68136813+ frequency_penalty?: number
68146814+ /**
68156815+ * Increases the likelihood of the model introducing new topics.
68166816+ */
68176817+ presence_penalty?: number
68186818+}
68196819+interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Async_Batch {
68206820+ requests: (
68216821+ | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt_Inner
68226822+ | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner
68236823+ )[]
68246824+}
68256825+interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt_Inner {
68266826+ /**
68276827+ * The input text prompt for the model to generate a response.
68286828+ */
68296829+ prompt: string
68306830+ /**
68316831+ * JSON schema that should be fulfilled for the response.
68326832+ */
68336833+ guided_json?: object
68346834+ response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode
68356835+ /**
68366836+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
68376837+ */
68386838+ raw?: boolean
68396839+ /**
68406840+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
68416841+ */
68426842+ stream?: boolean
68436843+ /**
68446844+ * The maximum number of tokens to generate in the response.
68456845+ */
68466846+ max_tokens?: number
68476847+ /**
68486848+ * Controls the randomness of the output; higher values produce more random results.
68496849+ */
68506850+ temperature?: number
68516851+ /**
68526852+ * 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.
68536853+ */
68546854+ top_p?: number
68556855+ /**
68566856+ * 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.
68576857+ */
68586858+ top_k?: number
68596859+ /**
68606860+ * Random seed for reproducibility of the generation.
68616861+ */
68626862+ seed?: number
68636863+ /**
68646864+ * Penalty for repeated tokens; higher values discourage repetition.
68656865+ */
68666866+ repetition_penalty?: number
68676867+ /**
68686868+ * Decreases the likelihood of the model repeating the same lines verbatim.
68696869+ */
68706870+ frequency_penalty?: number
68716871+ /**
68726872+ * Increases the likelihood of the model introducing new topics.
68736873+ */
68746874+ presence_penalty?: number
68756875+}
68766876+interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner {
68776877+ /**
68786878+ * An array of message objects representing the conversation history.
68796879+ */
68806880+ messages: {
68816881+ /**
68826882+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
68836883+ */
68846884+ role?: string
68856885+ /**
68866886+ * The tool call id. If you don't know what to put here you can fall back to 000000001
68876887+ */
68886888+ tool_call_id?: string
68896889+ content?:
68906890+ | string
68916891+ | {
68926892+ /**
68936893+ * Type of the content provided
68946894+ */
68956895+ type?: string
68966896+ text?: string
68976897+ image_url?: {
68986898+ /**
68996899+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
69006900+ */
69016901+ url?: string
69026902+ }
69036903+ }[]
69046904+ | {
69056905+ /**
69066906+ * Type of the content provided
69076907+ */
69086908+ type?: string
69096909+ text?: string
69106910+ image_url?: {
69116911+ /**
69126912+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
69136913+ */
69146914+ url?: string
69156915+ }
69166916+ }
69176917+ }[]
69186918+ functions?: {
69196919+ name: string
69206920+ code: string
69216921+ }[]
69226922+ /**
69236923+ * A list of tools available for the assistant to use.
69246924+ */
69256925+ tools?: (
69266926+ | {
69276927+ /**
69286928+ * The name of the tool. More descriptive the better.
69296929+ */
69306930+ name: string
69316931+ /**
69326932+ * A brief description of what the tool does.
69336933+ */
69346934+ description: string
69356935+ /**
69366936+ * Schema defining the parameters accepted by the tool.
69376937+ */
69386938+ parameters: {
69396939+ /**
69406940+ * The type of the parameters object (usually 'object').
69416941+ */
69426942+ type: string
69436943+ /**
69446944+ * List of required parameter names.
69456945+ */
69466946+ required?: string[]
69476947+ /**
69486948+ * Definitions of each parameter.
69496949+ */
69506950+ properties: {
69516951+ [k: string]: {
69526952+ /**
69536953+ * The data type of the parameter.
69546954+ */
69556955+ type: string
69566956+ /**
69576957+ * A description of the expected parameter.
69586958+ */
69596959+ description: string
69606960+ }
69616961+ }
69626962+ }
69636963+ }
69646964+ | {
69656965+ /**
69666966+ * Specifies the type of tool (e.g., 'function').
69676967+ */
69686968+ type: string
69696969+ /**
69706970+ * Details of the function tool.
69716971+ */
69726972+ function: {
69736973+ /**
69746974+ * The name of the function.
69756975+ */
69766976+ name: string
69776977+ /**
69786978+ * A brief description of what the function does.
69796979+ */
69806980+ description: string
69816981+ /**
69826982+ * Schema defining the parameters accepted by the function.
69836983+ */
69846984+ parameters: {
69856985+ /**
69866986+ * The type of the parameters object (usually 'object').
69876987+ */
69886988+ type: string
69896989+ /**
69906990+ * List of required parameter names.
69916991+ */
69926992+ required?: string[]
69936993+ /**
69946994+ * Definitions of each parameter.
69956995+ */
69966996+ properties: {
69976997+ [k: string]: {
69986998+ /**
69996999+ * The data type of the parameter.
70007000+ */
70017001+ type: string
70027002+ /**
70037003+ * A description of the expected parameter.
70047004+ */
70057005+ description: string
70067006+ }
70077007+ }
70087008+ }
70097009+ }
70107010+ }
70117011+ )[]
70127012+ response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode
70137013+ /**
70147014+ * JSON schema that should be fufilled for the response.
70157015+ */
70167016+ guided_json?: object
70177017+ /**
70187018+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
70197019+ */
70207020+ raw?: boolean
70217021+ /**
70227022+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
70237023+ */
70247024+ stream?: boolean
70257025+ /**
70267026+ * The maximum number of tokens to generate in the response.
70277027+ */
70287028+ max_tokens?: number
70297029+ /**
70307030+ * Controls the randomness of the output; higher values produce more random results.
70317031+ */
70327032+ temperature?: number
70337033+ /**
70347034+ * 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.
70357035+ */
70367036+ top_p?: number
70377037+ /**
70387038+ * 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.
70397039+ */
70407040+ top_k?: number
70417041+ /**
70427042+ * Random seed for reproducibility of the generation.
70437043+ */
70447044+ seed?: number
70457045+ /**
70467046+ * Penalty for repeated tokens; higher values discourage repetition.
70477047+ */
70487048+ repetition_penalty?: number
70497049+ /**
70507050+ * Decreases the likelihood of the model repeating the same lines verbatim.
70517051+ */
70527052+ frequency_penalty?: number
70537053+ /**
70547054+ * Increases the likelihood of the model introducing new topics.
70557055+ */
70567056+ presence_penalty?: number
70577057+}
70587058+type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
70597059+ /**
70607060+ * The generated text response from the model
70617061+ */
70627062+ response: string
70637063+ /**
70647064+ * Usage statistics for the inference request
70657065+ */
70667066+ usage?: {
70677067+ /**
70687068+ * Total number of tokens in input
70697069+ */
70707070+ prompt_tokens?: number
70717071+ /**
70727072+ * Total number of tokens in output
70737073+ */
70747074+ completion_tokens?: number
70757075+ /**
70767076+ * Total number of input and output tokens
70777077+ */
70787078+ total_tokens?: number
70797079+ }
70807080+ /**
70817081+ * An array of tool calls requests made during the response generation
70827082+ */
70837083+ tool_calls?: {
70847084+ /**
70857085+ * The tool call id.
70867086+ */
70877087+ id?: string
70887088+ /**
70897089+ * Specifies the type of tool (e.g., 'function').
70907090+ */
70917091+ type?: string
70927092+ /**
70937093+ * Details of the function tool.
70947094+ */
70957095+ function?: {
70967096+ /**
70977097+ * The name of the tool to be called
70987098+ */
70997099+ name?: string
71007100+ /**
71017101+ * The arguments passed to be passed to the tool call request
71027102+ */
71037103+ arguments?: object
71047104+ }
71057105+ }[]
71067106+}
71077107+declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
71087108+ inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input
71097109+ postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output
71107110+}
71117111+type Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Input =
71127112+ | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt
71137113+ | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages
71147114+ | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Async_Batch
71157115+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt {
71167116+ /**
71177117+ * The input text prompt for the model to generate a response.
71187118+ */
71197119+ prompt: string
71207120+ /**
71217121+ * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
71227122+ */
71237123+ lora?: string
71247124+ response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode
71257125+ /**
71267126+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
71277127+ */
71287128+ raw?: boolean
71297129+ /**
71307130+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
71317131+ */
71327132+ stream?: boolean
71337133+ /**
71347134+ * The maximum number of tokens to generate in the response.
71357135+ */
71367136+ max_tokens?: number
71377137+ /**
71387138+ * Controls the randomness of the output; higher values produce more random results.
71397139+ */
71407140+ temperature?: number
71417141+ /**
71427142+ * 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.
71437143+ */
71447144+ top_p?: number
71457145+ /**
71467146+ * 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.
71477147+ */
71487148+ top_k?: number
71497149+ /**
71507150+ * Random seed for reproducibility of the generation.
71517151+ */
71527152+ seed?: number
71537153+ /**
71547154+ * Penalty for repeated tokens; higher values discourage repetition.
71557155+ */
71567156+ repetition_penalty?: number
71577157+ /**
71587158+ * Decreases the likelihood of the model repeating the same lines verbatim.
71597159+ */
71607160+ frequency_penalty?: number
71617161+ /**
71627162+ * Increases the likelihood of the model introducing new topics.
71637163+ */
71647164+ presence_penalty?: number
71657165+}
71667166+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode {
71677167+ type?: 'json_object' | 'json_schema'
71687168+ json_schema?: unknown
71697169+}
71707170+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages {
71717171+ /**
71727172+ * An array of message objects representing the conversation history.
71737173+ */
71747174+ messages: {
71757175+ /**
71767176+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
71777177+ */
71787178+ role: string
71797179+ /**
71807180+ * The content of the message as a string.
71817181+ */
71827182+ content: string
71837183+ }[]
71847184+ functions?: {
71857185+ name: string
71867186+ code: string
71877187+ }[]
71887188+ /**
71897189+ * A list of tools available for the assistant to use.
71907190+ */
71917191+ tools?: (
71927192+ | {
71937193+ /**
71947194+ * The name of the tool. More descriptive the better.
71957195+ */
71967196+ name: string
71977197+ /**
71987198+ * A brief description of what the tool does.
71997199+ */
72007200+ description: string
72017201+ /**
72027202+ * Schema defining the parameters accepted by the tool.
72037203+ */
72047204+ parameters: {
72057205+ /**
72067206+ * The type of the parameters object (usually 'object').
72077207+ */
72087208+ type: string
72097209+ /**
72107210+ * List of required parameter names.
72117211+ */
72127212+ required?: string[]
72137213+ /**
72147214+ * Definitions of each parameter.
72157215+ */
72167216+ properties: {
72177217+ [k: string]: {
72187218+ /**
72197219+ * The data type of the parameter.
72207220+ */
72217221+ type: string
72227222+ /**
72237223+ * A description of the expected parameter.
72247224+ */
72257225+ description: string
72267226+ }
72277227+ }
72287228+ }
72297229+ }
72307230+ | {
72317231+ /**
72327232+ * Specifies the type of tool (e.g., 'function').
72337233+ */
72347234+ type: string
72357235+ /**
72367236+ * Details of the function tool.
72377237+ */
72387238+ function: {
72397239+ /**
72407240+ * The name of the function.
72417241+ */
72427242+ name: string
72437243+ /**
72447244+ * A brief description of what the function does.
72457245+ */
72467246+ description: string
72477247+ /**
72487248+ * Schema defining the parameters accepted by the function.
72497249+ */
72507250+ parameters: {
72517251+ /**
72527252+ * The type of the parameters object (usually 'object').
72537253+ */
72547254+ type: string
72557255+ /**
72567256+ * List of required parameter names.
72577257+ */
72587258+ required?: string[]
72597259+ /**
72607260+ * Definitions of each parameter.
72617261+ */
72627262+ properties: {
72637263+ [k: string]: {
72647264+ /**
72657265+ * The data type of the parameter.
72667266+ */
72677267+ type: string
72687268+ /**
72697269+ * A description of the expected parameter.
72707270+ */
72717271+ description: string
72727272+ }
72737273+ }
72747274+ }
72757275+ }
72767276+ }
72777277+ )[]
72787278+ response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_1
72797279+ /**
72807280+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
72817281+ */
72827282+ raw?: boolean
72837283+ /**
72847284+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
72857285+ */
72867286+ stream?: boolean
72877287+ /**
72887288+ * The maximum number of tokens to generate in the response.
72897289+ */
72907290+ max_tokens?: number
72917291+ /**
72927292+ * Controls the randomness of the output; higher values produce more random results.
72937293+ */
72947294+ temperature?: number
72957295+ /**
72967296+ * 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.
72977297+ */
72987298+ top_p?: number
72997299+ /**
73007300+ * 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.
73017301+ */
73027302+ top_k?: number
73037303+ /**
73047304+ * Random seed for reproducibility of the generation.
73057305+ */
73067306+ seed?: number
73077307+ /**
73087308+ * Penalty for repeated tokens; higher values discourage repetition.
73097309+ */
73107310+ repetition_penalty?: number
73117311+ /**
73127312+ * Decreases the likelihood of the model repeating the same lines verbatim.
73137313+ */
73147314+ frequency_penalty?: number
73157315+ /**
73167316+ * Increases the likelihood of the model introducing new topics.
73177317+ */
73187318+ presence_penalty?: number
73197319+}
73207320+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_1 {
73217321+ type?: 'json_object' | 'json_schema'
73227322+ json_schema?: unknown
73237323+}
73247324+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Async_Batch {
73257325+ requests: (Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt_1 | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1)[]
73267326+}
73277327+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt_1 {
73287328+ /**
73297329+ * The input text prompt for the model to generate a response.
73307330+ */
73317331+ prompt: string
73327332+ /**
73337333+ * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
73347334+ */
73357335+ lora?: string
73367336+ response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_2
73377337+ /**
73387338+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
73397339+ */
73407340+ raw?: boolean
73417341+ /**
73427342+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
73437343+ */
73447344+ stream?: boolean
73457345+ /**
73467346+ * The maximum number of tokens to generate in the response.
73477347+ */
73487348+ max_tokens?: number
73497349+ /**
73507350+ * Controls the randomness of the output; higher values produce more random results.
73517351+ */
73527352+ temperature?: number
73537353+ /**
73547354+ * 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.
73557355+ */
73567356+ top_p?: number
73577357+ /**
73587358+ * 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.
73597359+ */
73607360+ top_k?: number
73617361+ /**
73627362+ * Random seed for reproducibility of the generation.
73637363+ */
73647364+ seed?: number
73657365+ /**
73667366+ * Penalty for repeated tokens; higher values discourage repetition.
73677367+ */
73687368+ repetition_penalty?: number
73697369+ /**
73707370+ * Decreases the likelihood of the model repeating the same lines verbatim.
73717371+ */
73727372+ frequency_penalty?: number
73737373+ /**
73747374+ * Increases the likelihood of the model introducing new topics.
73757375+ */
73767376+ presence_penalty?: number
73777377+}
73787378+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_2 {
73797379+ type?: 'json_object' | 'json_schema'
73807380+ json_schema?: unknown
73817381+}
73827382+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1 {
73837383+ /**
73847384+ * An array of message objects representing the conversation history.
73857385+ */
73867386+ messages: {
73877387+ /**
73887388+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
73897389+ */
73907390+ role: string
73917391+ /**
73927392+ * The content of the message as a string.
73937393+ */
73947394+ content: string
73957395+ }[]
73967396+ functions?: {
73977397+ name: string
73987398+ code: string
73997399+ }[]
74007400+ /**
74017401+ * A list of tools available for the assistant to use.
74027402+ */
74037403+ tools?: (
74047404+ | {
74057405+ /**
74067406+ * The name of the tool. More descriptive the better.
74077407+ */
74087408+ name: string
74097409+ /**
74107410+ * A brief description of what the tool does.
74117411+ */
74127412+ description: string
74137413+ /**
74147414+ * Schema defining the parameters accepted by the tool.
74157415+ */
74167416+ parameters: {
74177417+ /**
74187418+ * The type of the parameters object (usually 'object').
74197419+ */
74207420+ type: string
74217421+ /**
74227422+ * List of required parameter names.
74237423+ */
74247424+ required?: string[]
74257425+ /**
74267426+ * Definitions of each parameter.
74277427+ */
74287428+ properties: {
74297429+ [k: string]: {
74307430+ /**
74317431+ * The data type of the parameter.
74327432+ */
74337433+ type: string
74347434+ /**
74357435+ * A description of the expected parameter.
74367436+ */
74377437+ description: string
74387438+ }
74397439+ }
74407440+ }
74417441+ }
74427442+ | {
74437443+ /**
74447444+ * Specifies the type of tool (e.g., 'function').
74457445+ */
74467446+ type: string
74477447+ /**
74487448+ * Details of the function tool.
74497449+ */
74507450+ function: {
74517451+ /**
74527452+ * The name of the function.
74537453+ */
74547454+ name: string
74557455+ /**
74567456+ * A brief description of what the function does.
74577457+ */
74587458+ description: string
74597459+ /**
74607460+ * Schema defining the parameters accepted by the function.
74617461+ */
74627462+ parameters: {
74637463+ /**
74647464+ * The type of the parameters object (usually 'object').
74657465+ */
74667466+ type: string
74677467+ /**
74687468+ * List of required parameter names.
74697469+ */
74707470+ required?: string[]
74717471+ /**
74727472+ * Definitions of each parameter.
74737473+ */
74747474+ properties: {
74757475+ [k: string]: {
74767476+ /**
74777477+ * The data type of the parameter.
74787478+ */
74797479+ type: string
74807480+ /**
74817481+ * A description of the expected parameter.
74827482+ */
74837483+ description: string
74847484+ }
74857485+ }
74867486+ }
74877487+ }
74887488+ }
74897489+ )[]
74907490+ response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_3
74917491+ /**
74927492+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
74937493+ */
74947494+ raw?: boolean
74957495+ /**
74967496+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
74977497+ */
74987498+ stream?: boolean
74997499+ /**
75007500+ * The maximum number of tokens to generate in the response.
75017501+ */
75027502+ max_tokens?: number
75037503+ /**
75047504+ * Controls the randomness of the output; higher values produce more random results.
75057505+ */
75067506+ temperature?: number
75077507+ /**
75087508+ * 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.
75097509+ */
75107510+ top_p?: number
75117511+ /**
75127512+ * 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.
75137513+ */
75147514+ top_k?: number
75157515+ /**
75167516+ * Random seed for reproducibility of the generation.
75177517+ */
75187518+ seed?: number
75197519+ /**
75207520+ * Penalty for repeated tokens; higher values discourage repetition.
75217521+ */
75227522+ repetition_penalty?: number
75237523+ /**
75247524+ * Decreases the likelihood of the model repeating the same lines verbatim.
75257525+ */
75267526+ frequency_penalty?: number
75277527+ /**
75287528+ * Increases the likelihood of the model introducing new topics.
75297529+ */
75307530+ presence_penalty?: number
75317531+}
75327532+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_3 {
75337533+ type?: 'json_object' | 'json_schema'
75347534+ json_schema?: unknown
75357535+}
75367536+type Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Output =
75377537+ | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Chat_Completion_Response
75387538+ | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Text_Completion_Response
75397539+ | string
75407540+ | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_AsyncResponse
75417541+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Chat_Completion_Response {
75427542+ /**
75437543+ * Unique identifier for the completion
75447544+ */
75457545+ id?: string
75467546+ /**
75477547+ * Object type identifier
75487548+ */
75497549+ object?: 'chat.completion'
75507550+ /**
75517551+ * Unix timestamp of when the completion was created
75527552+ */
75537553+ created?: number
75547554+ /**
75557555+ * Model used for the completion
75567556+ */
75577557+ model?: string
75587558+ /**
75597559+ * List of completion choices
75607560+ */
75617561+ choices?: {
75627562+ /**
75637563+ * Index of the choice in the list
75647564+ */
75657565+ index?: number
75667566+ /**
75677567+ * The message generated by the model
75687568+ */
75697569+ message?: {
75707570+ /**
75717571+ * Role of the message author
75727572+ */
75737573+ role: string
75747574+ /**
75757575+ * The content of the message
75767576+ */
75777577+ content: string
75787578+ /**
75797579+ * Internal reasoning content (if available)
75807580+ */
75817581+ reasoning_content?: string
75827582+ /**
75837583+ * Tool calls made by the assistant
75847584+ */
75857585+ tool_calls?: {
75867586+ /**
75877587+ * Unique identifier for the tool call
75887588+ */
75897589+ id: string
75907590+ /**
75917591+ * Type of tool call
75927592+ */
75937593+ type: 'function'
75947594+ function: {
75957595+ /**
75967596+ * Name of the function to call
75977597+ */
75987598+ name: string
75997599+ /**
76007600+ * JSON string of arguments for the function
76017601+ */
76027602+ arguments: string
76037603+ }
76047604+ }[]
76057605+ }
76067606+ /**
76077607+ * Reason why the model stopped generating
76087608+ */
76097609+ finish_reason?: string
76107610+ /**
76117611+ * Stop reason (may be null)
76127612+ */
76137613+ stop_reason?: string | null
76147614+ /**
76157615+ * Log probabilities (if requested)
76167616+ */
76177617+ logprobs?: {} | null
76187618+ }[]
76197619+ /**
76207620+ * Usage statistics for the inference request
76217621+ */
76227622+ usage?: {
76237623+ /**
76247624+ * Total number of tokens in input
76257625+ */
76267626+ prompt_tokens?: number
76277627+ /**
76287628+ * Total number of tokens in output
76297629+ */
76307630+ completion_tokens?: number
76317631+ /**
76327632+ * Total number of input and output tokens
76337633+ */
76347634+ total_tokens?: number
76357635+ }
76367636+ /**
76377637+ * Log probabilities for the prompt (if requested)
76387638+ */
76397639+ prompt_logprobs?: {} | null
76407640+}
76417641+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Text_Completion_Response {
76427642+ /**
76437643+ * Unique identifier for the completion
76447644+ */
76457645+ id?: string
76467646+ /**
76477647+ * Object type identifier
76487648+ */
76497649+ object?: 'text_completion'
76507650+ /**
76517651+ * Unix timestamp of when the completion was created
76527652+ */
76537653+ created?: number
76547654+ /**
76557655+ * Model used for the completion
76567656+ */
76577657+ model?: string
76587658+ /**
76597659+ * List of completion choices
76607660+ */
76617661+ choices?: {
76627662+ /**
76637663+ * Index of the choice in the list
76647664+ */
76657665+ index: number
76667666+ /**
76677667+ * The generated text completion
76687668+ */
76697669+ text: string
76707670+ /**
76717671+ * Reason why the model stopped generating
76727672+ */
76737673+ finish_reason: string
76747674+ /**
76757675+ * Stop reason (may be null)
76767676+ */
76777677+ stop_reason?: string | null
76787678+ /**
76797679+ * Log probabilities (if requested)
76807680+ */
76817681+ logprobs?: {} | null
76827682+ /**
76837683+ * Log probabilities for the prompt (if requested)
76847684+ */
76857685+ prompt_logprobs?: {} | null
76867686+ }[]
76877687+ /**
76887688+ * Usage statistics for the inference request
76897689+ */
76907690+ usage?: {
76917691+ /**
76927692+ * Total number of tokens in input
76937693+ */
76947694+ prompt_tokens?: number
76957695+ /**
76967696+ * Total number of tokens in output
76977697+ */
76987698+ completion_tokens?: number
76997699+ /**
77007700+ * Total number of input and output tokens
77017701+ */
77027702+ total_tokens?: number
77037703+ }
77047704+}
77057705+interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_AsyncResponse {
77067706+ /**
77077707+ * The async request id that can be used to obtain the results.
77087708+ */
77097709+ request_id?: string
77107710+}
77117711+declare abstract class Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8 {
77127712+ inputs: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Input
77137713+ postProcessedOutputs: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Output
77147714+}
77157715+interface Ai_Cf_Deepgram_Nova_3_Input {
77167716+ audio: {
77177717+ body: object
77187718+ contentType: string
77197719+ }
77207720+ /**
77217721+ * 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.
77227722+ */
77237723+ custom_topic_mode?: 'extended' | 'strict'
77247724+ /**
77257725+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
77267726+ */
77277727+ custom_topic?: string
77287728+ /**
77297729+ * 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 param
77307730+ */
77317731+ custom_intent_mode?: 'extended' | 'strict'
77327732+ /**
77337733+ * Custom intents you want the model to detect within your input audio if present
77347734+ */
77357735+ custom_intent?: string
77367736+ /**
77377737+ * Identifies and extracts key entities from content in submitted audio
77387738+ */
77397739+ detect_entities?: boolean
77407740+ /**
77417741+ * Identifies the dominant language spoken in submitted audio
77427742+ */
77437743+ detect_language?: boolean
77447744+ /**
77457745+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
77467746+ */
77477747+ diarize?: boolean
77487748+ /**
77497749+ * Identify and extract key entities from content in submitted audio
77507750+ */
77517751+ dictation?: boolean
77527752+ /**
77537753+ * Specify the expected encoding of your submitted audio
77547754+ */
77557755+ encoding?: 'linear16' | 'flac' | 'mulaw' | 'amr-nb' | 'amr-wb' | 'opus' | 'speex' | 'g729'
77567756+ /**
77577757+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
77587758+ */
77597759+ extra?: string
77607760+ /**
77617761+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
77627762+ */
77637763+ filler_words?: boolean
77647764+ /**
77657765+ * Key term prompting can boost or suppress specialized terminology and brands.
77667766+ */
77677767+ keyterm?: string
77687768+ /**
77697769+ * Keywords can boost or suppress specialized terminology and brands.
77707770+ */
77717771+ keywords?: string
77727772+ /**
77737773+ * 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.
77747774+ */
77757775+ language?: string
77767776+ /**
77777777+ * Spoken measurements will be converted to their corresponding abbreviations.
77787778+ */
77797779+ measurements?: boolean
77807780+ /**
77817781+ * 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.
77827782+ */
77837783+ mip_opt_out?: boolean
77847784+ /**
77857785+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
77867786+ */
77877787+ mode?: 'general' | 'medical' | 'finance'
77887788+ /**
77897789+ * Transcribe each audio channel independently.
77907790+ */
77917791+ multichannel?: boolean
77927792+ /**
77937793+ * Numerals converts numbers from written format to numerical format.
77947794+ */
77957795+ numerals?: boolean
77967796+ /**
77977797+ * Splits audio into paragraphs to improve transcript readability.
77987798+ */
77997799+ paragraphs?: boolean
78007800+ /**
78017801+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
78027802+ */
78037803+ profanity_filter?: boolean
78047804+ /**
78057805+ * Add punctuation and capitalization to the transcript.
78067806+ */
78077807+ punctuate?: boolean
78087808+ /**
78097809+ * Redaction removes sensitive information from your transcripts.
78107810+ */
78117811+ redact?: string
78127812+ /**
78137813+ * Search for terms or phrases in submitted audio and replaces them.
78147814+ */
78157815+ replace?: string
78167816+ /**
78177817+ * Search for terms or phrases in submitted audio.
78187818+ */
78197819+ search?: string
78207820+ /**
78217821+ * Recognizes the sentiment throughout a transcript or text.
78227822+ */
78237823+ sentiment?: boolean
78247824+ /**
78257825+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
78267826+ */
78277827+ smart_format?: boolean
78287828+ /**
78297829+ * Detect topics throughout a transcript or text.
78307830+ */
78317831+ topics?: boolean
78327832+ /**
78337833+ * Segments speech into meaningful semantic units.
78347834+ */
78357835+ utterances?: boolean
78367836+ /**
78377837+ * Seconds to wait before detecting a pause between words in submitted audio.
78387838+ */
78397839+ utt_split?: number
78407840+ /**
78417841+ * The number of channels in the submitted audio
78427842+ */
78437843+ channels?: number
78447844+ /**
78457845+ * 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.
78467846+ */
78477847+ interim_results?: boolean
78487848+ /**
78497849+ * 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 endpointing
78507850+ */
78517851+ endpointing?: string
78527852+ /**
78537853+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
78547854+ */
78557855+ vad_events?: boolean
78567856+ /**
78577857+ * 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.
78587858+ */
78597859+ utterance_end_ms?: boolean
78607860+}
78617861+interface Ai_Cf_Deepgram_Nova_3_Output {
78627862+ results?: {
78637863+ channels?: {
78647864+ alternatives?: {
78657865+ confidence?: number
78667866+ transcript?: string
78677867+ words?: {
78687868+ confidence?: number
78697869+ end?: number
78707870+ start?: number
78717871+ word?: string
78727872+ }[]
78737873+ }[]
78747874+ }[]
78757875+ summary?: {
78767876+ result?: string
78777877+ short?: string
78787878+ }
78797879+ sentiments?: {
78807880+ segments?: {
78817881+ text?: string
78827882+ start_word?: number
78837883+ end_word?: number
78847884+ sentiment?: string
78857885+ sentiment_score?: number
78867886+ }[]
78877887+ average?: {
78887888+ sentiment?: string
78897889+ sentiment_score?: number
78907890+ }
78917891+ }
78927892+ }
78937893+}
78947894+declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
78957895+ inputs: Ai_Cf_Deepgram_Nova_3_Input
78967896+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output
78977897+}
78987898+interface Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input {
78997899+ queries?: string | string[]
79007900+ /**
79017901+ * Optional instruction for the task
79027902+ */
79037903+ instruction?: string
79047904+ documents?: string | string[]
79057905+ text?: string | string[]
79067906+}
79077907+interface Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Output {
79087908+ data?: number[][]
79097909+ shape?: number[]
79107910+}
79117911+declare abstract class Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B {
79127912+ inputs: Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input
79137913+ postProcessedOutputs: Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Output
79147914+}
79157915+type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
79167916+ | {
79177917+ /**
79187918+ * readable stream with audio data and content-type specified for that data
79197919+ */
79207920+ audio: {
79217921+ body: object
79227922+ contentType: string
79237923+ }
79247924+ /**
79257925+ * type of data PCM data that's sent to the inference server as raw array
79267926+ */
79277927+ dtype?: 'uint8' | 'float32' | 'float64'
79287928+ }
79297929+ | {
79307930+ /**
79317931+ * base64 encoded audio data
79327932+ */
79337933+ audio: string
79347934+ /**
79357935+ * type of data PCM data that's sent to the inference server as raw array
79367936+ */
79377937+ dtype?: 'uint8' | 'float32' | 'float64'
79387938+ }
79397939+interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
79407940+ /**
79417941+ * if true, end-of-turn was detected
79427942+ */
79437943+ is_complete?: boolean
79447944+ /**
79457945+ * probability of the end-of-turn detection
79467946+ */
79477947+ probability?: number
79487948+}
79497949+declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
79507950+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input
79517951+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output
79527952+}
79537953+declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
79547954+ inputs: ResponsesInput
79557955+ postProcessedOutputs: ResponsesOutput
79567956+}
79577957+declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
79587958+ inputs: ResponsesInput
79597959+ postProcessedOutputs: ResponsesOutput
79607960+}
79617961+interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
79627962+ /**
79637963+ * A text description of the image you want to generate.
79647964+ */
79657965+ prompt: string
79667966+ /**
79677967+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
79687968+ */
79697969+ guidance?: number
79707970+ /**
79717971+ * Random seed for reproducibility of the image generation
79727972+ */
79737973+ seed?: number
79747974+ /**
79757975+ * The height of the generated image in pixels
79767976+ */
79777977+ height?: number
79787978+ /**
79797979+ * The width of the generated image in pixels
79807980+ */
79817981+ width?: number
79827982+ /**
79837983+ * The number of diffusion steps; higher values can improve quality but take longer
79847984+ */
79857985+ num_steps?: number
79867986+ /**
79877987+ * Specify what to exclude from the generated images
79887988+ */
79897989+ negative_prompt?: string
79907990+}
79917991+/**
79927992+ * The generated image in JPEG format
79937993+ */
79947994+type Ai_Cf_Leonardo_Phoenix_1_0_Output = string
79957995+declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
79967996+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input
79977997+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output
79987998+}
79997999+interface Ai_Cf_Leonardo_Lucid_Origin_Input {
80008000+ /**
80018001+ * A text description of the image you want to generate.
80028002+ */
80038003+ prompt: string
80048004+ /**
80058005+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
80068006+ */
80078007+ guidance?: number
80088008+ /**
80098009+ * Random seed for reproducibility of the image generation
80108010+ */
80118011+ seed?: number
80128012+ /**
80138013+ * The height of the generated image in pixels
80148014+ */
80158015+ height?: number
80168016+ /**
80178017+ * The width of the generated image in pixels
80188018+ */
80198019+ width?: number
80208020+ /**
80218021+ * The number of diffusion steps; higher values can improve quality but take longer
80228022+ */
80238023+ num_steps?: number
80248024+ /**
80258025+ * The number of diffusion steps; higher values can improve quality but take longer
80268026+ */
80278027+ steps?: number
80288028+}
80298029+interface Ai_Cf_Leonardo_Lucid_Origin_Output {
80308030+ /**
80318031+ * The generated image in Base64 format.
80328032+ */
80338033+ image?: string
80348034+}
80358035+declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
80368036+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input
80378037+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output
80388038+}
80398039+interface Ai_Cf_Deepgram_Aura_1_Input {
80408040+ /**
80418041+ * Speaker used to produce the audio.
80428042+ */
80438043+ speaker?:
80448044+ | 'angus'
80458045+ | 'asteria'
80468046+ | 'arcas'
80478047+ | 'orion'
80488048+ | 'orpheus'
80498049+ | 'athena'
80508050+ | 'luna'
80518051+ | 'zeus'
80528052+ | 'perseus'
80538053+ | 'helios'
80548054+ | 'hera'
80558055+ | 'stella'
80568056+ /**
80578057+ * Encoding of the output audio.
80588058+ */
80598059+ encoding?: 'linear16' | 'flac' | 'mulaw' | 'alaw' | 'mp3' | 'opus' | 'aac'
80608060+ /**
80618061+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
80628062+ */
80638063+ container?: 'none' | 'wav' | 'ogg'
80648064+ /**
80658065+ * The text content to be converted to speech
80668066+ */
80678067+ text: string
80688068+ /**
80698069+ * 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 configurable
80708070+ */
80718071+ sample_rate?: number
80728072+ /**
80738073+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
80748074+ */
80758075+ bit_rate?: number
80768076+}
80778077+/**
80788078+ * The generated audio in MP3 format
80798079+ */
80808080+type Ai_Cf_Deepgram_Aura_1_Output = string
80818081+declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
80828082+ inputs: Ai_Cf_Deepgram_Aura_1_Input
80838083+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output
80848084+}
80858085+interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input {
80868086+ /**
80878087+ * Input text to translate. Can be a single string or a list of strings.
80888088+ */
80898089+ text: string | string[]
80908090+ /**
80918091+ * Target langauge to translate to
80928092+ */
80938093+ target_language:
80948094+ | 'asm_Beng'
80958095+ | 'awa_Deva'
80968096+ | 'ben_Beng'
80978097+ | 'bho_Deva'
80988098+ | 'brx_Deva'
80998099+ | 'doi_Deva'
81008100+ | 'eng_Latn'
81018101+ | 'gom_Deva'
81028102+ | 'gon_Deva'
81038103+ | 'guj_Gujr'
81048104+ | 'hin_Deva'
81058105+ | 'hne_Deva'
81068106+ | 'kan_Knda'
81078107+ | 'kas_Arab'
81088108+ | 'kas_Deva'
81098109+ | 'kha_Latn'
81108110+ | 'lus_Latn'
81118111+ | 'mag_Deva'
81128112+ | 'mai_Deva'
81138113+ | 'mal_Mlym'
81148114+ | 'mar_Deva'
81158115+ | 'mni_Beng'
81168116+ | 'mni_Mtei'
81178117+ | 'npi_Deva'
81188118+ | 'ory_Orya'
81198119+ | 'pan_Guru'
81208120+ | 'san_Deva'
81218121+ | 'sat_Olck'
81228122+ | 'snd_Arab'
81238123+ | 'snd_Deva'
81248124+ | 'tam_Taml'
81258125+ | 'tel_Telu'
81268126+ | 'urd_Arab'
81278127+ | 'unr_Deva'
81288128+}
81298129+interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Output {
81308130+ /**
81318131+ * Translated texts
81328132+ */
81338133+ translations: string[]
81348134+}
81358135+declare abstract class Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B {
81368136+ inputs: Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input
81378137+ postProcessedOutputs: Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Output
81388138+}
81398139+type Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Input =
81408140+ | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt
81418141+ | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages
81428142+ | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Async_Batch
81438143+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt {
81448144+ /**
81458145+ * The input text prompt for the model to generate a response.
81468146+ */
81478147+ prompt: string
81488148+ /**
81498149+ * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
81508150+ */
81518151+ lora?: string
81528152+ response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode
81538153+ /**
81548154+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
81558155+ */
81568156+ raw?: boolean
81578157+ /**
81588158+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
81598159+ */
81608160+ stream?: boolean
81618161+ /**
81628162+ * The maximum number of tokens to generate in the response.
81638163+ */
81648164+ max_tokens?: number
81658165+ /**
81668166+ * Controls the randomness of the output; higher values produce more random results.
81678167+ */
81688168+ temperature?: number
81698169+ /**
81708170+ * 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.
81718171+ */
81728172+ top_p?: number
81738173+ /**
81748174+ * 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.
81758175+ */
81768176+ top_k?: number
81778177+ /**
81788178+ * Random seed for reproducibility of the generation.
81798179+ */
81808180+ seed?: number
81818181+ /**
81828182+ * Penalty for repeated tokens; higher values discourage repetition.
81838183+ */
81848184+ repetition_penalty?: number
81858185+ /**
81868186+ * Decreases the likelihood of the model repeating the same lines verbatim.
81878187+ */
81888188+ frequency_penalty?: number
81898189+ /**
81908190+ * Increases the likelihood of the model introducing new topics.
81918191+ */
81928192+ presence_penalty?: number
81938193+}
81948194+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode {
81958195+ type?: 'json_object' | 'json_schema'
81968196+ json_schema?: unknown
81978197+}
81988198+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages {
81998199+ /**
82008200+ * An array of message objects representing the conversation history.
82018201+ */
82028202+ messages: {
82038203+ /**
82048204+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
82058205+ */
82068206+ role: string
82078207+ /**
82088208+ * The content of the message as a string.
82098209+ */
82108210+ content: string
82118211+ }[]
82128212+ functions?: {
82138213+ name: string
82148214+ code: string
82158215+ }[]
82168216+ /**
82178217+ * A list of tools available for the assistant to use.
82188218+ */
82198219+ tools?: (
82208220+ | {
82218221+ /**
82228222+ * The name of the tool. More descriptive the better.
82238223+ */
82248224+ name: string
82258225+ /**
82268226+ * A brief description of what the tool does.
82278227+ */
82288228+ description: string
82298229+ /**
82308230+ * Schema defining the parameters accepted by the tool.
82318231+ */
82328232+ parameters: {
82338233+ /**
82348234+ * The type of the parameters object (usually 'object').
82358235+ */
82368236+ type: string
82378237+ /**
82388238+ * List of required parameter names.
82398239+ */
82408240+ required?: string[]
82418241+ /**
82428242+ * Definitions of each parameter.
82438243+ */
82448244+ properties: {
82458245+ [k: string]: {
82468246+ /**
82478247+ * The data type of the parameter.
82488248+ */
82498249+ type: string
82508250+ /**
82518251+ * A description of the expected parameter.
82528252+ */
82538253+ description: string
82548254+ }
82558255+ }
82568256+ }
82578257+ }
82588258+ | {
82598259+ /**
82608260+ * Specifies the type of tool (e.g., 'function').
82618261+ */
82628262+ type: string
82638263+ /**
82648264+ * Details of the function tool.
82658265+ */
82668266+ function: {
82678267+ /**
82688268+ * The name of the function.
82698269+ */
82708270+ name: string
82718271+ /**
82728272+ * A brief description of what the function does.
82738273+ */
82748274+ description: string
82758275+ /**
82768276+ * Schema defining the parameters accepted by the function.
82778277+ */
82788278+ parameters: {
82798279+ /**
82808280+ * The type of the parameters object (usually 'object').
82818281+ */
82828282+ type: string
82838283+ /**
82848284+ * List of required parameter names.
82858285+ */
82868286+ required?: string[]
82878287+ /**
82888288+ * Definitions of each parameter.
82898289+ */
82908290+ properties: {
82918291+ [k: string]: {
82928292+ /**
82938293+ * The data type of the parameter.
82948294+ */
82958295+ type: string
82968296+ /**
82978297+ * A description of the expected parameter.
82988298+ */
82998299+ description: string
83008300+ }
83018301+ }
83028302+ }
83038303+ }
83048304+ }
83058305+ )[]
83068306+ response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_1
83078307+ /**
83088308+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
83098309+ */
83108310+ raw?: boolean
83118311+ /**
83128312+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
83138313+ */
83148314+ stream?: boolean
83158315+ /**
83168316+ * The maximum number of tokens to generate in the response.
83178317+ */
83188318+ max_tokens?: number
83198319+ /**
83208320+ * Controls the randomness of the output; higher values produce more random results.
83218321+ */
83228322+ temperature?: number
83238323+ /**
83248324+ * 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.
83258325+ */
83268326+ top_p?: number
83278327+ /**
83288328+ * 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.
83298329+ */
83308330+ top_k?: number
83318331+ /**
83328332+ * Random seed for reproducibility of the generation.
83338333+ */
83348334+ seed?: number
83358335+ /**
83368336+ * Penalty for repeated tokens; higher values discourage repetition.
83378337+ */
83388338+ repetition_penalty?: number
83398339+ /**
83408340+ * Decreases the likelihood of the model repeating the same lines verbatim.
83418341+ */
83428342+ frequency_penalty?: number
83438343+ /**
83448344+ * Increases the likelihood of the model introducing new topics.
83458345+ */
83468346+ presence_penalty?: number
83478347+}
83488348+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_1 {
83498349+ type?: 'json_object' | 'json_schema'
83508350+ json_schema?: unknown
83518351+}
83528352+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Async_Batch {
83538353+ requests: (
83548354+ | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt_1
83558355+ | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1
83568356+ )[]
83578357+}
83588358+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt_1 {
83598359+ /**
83608360+ * The input text prompt for the model to generate a response.
83618361+ */
83628362+ prompt: string
83638363+ /**
83648364+ * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
83658365+ */
83668366+ lora?: string
83678367+ response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_2
83688368+ /**
83698369+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
83708370+ */
83718371+ raw?: boolean
83728372+ /**
83738373+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
83748374+ */
83758375+ stream?: boolean
83768376+ /**
83778377+ * The maximum number of tokens to generate in the response.
83788378+ */
83798379+ max_tokens?: number
83808380+ /**
83818381+ * Controls the randomness of the output; higher values produce more random results.
83828382+ */
83838383+ temperature?: number
83848384+ /**
83858385+ * 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.
83868386+ */
83878387+ top_p?: number
83888388+ /**
83898389+ * 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.
83908390+ */
83918391+ top_k?: number
83928392+ /**
83938393+ * Random seed for reproducibility of the generation.
83948394+ */
83958395+ seed?: number
83968396+ /**
83978397+ * Penalty for repeated tokens; higher values discourage repetition.
83988398+ */
83998399+ repetition_penalty?: number
84008400+ /**
84018401+ * Decreases the likelihood of the model repeating the same lines verbatim.
84028402+ */
84038403+ frequency_penalty?: number
84048404+ /**
84058405+ * Increases the likelihood of the model introducing new topics.
84068406+ */
84078407+ presence_penalty?: number
84088408+}
84098409+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_2 {
84108410+ type?: 'json_object' | 'json_schema'
84118411+ json_schema?: unknown
84128412+}
84138413+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1 {
84148414+ /**
84158415+ * An array of message objects representing the conversation history.
84168416+ */
84178417+ messages: {
84188418+ /**
84198419+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
84208420+ */
84218421+ role: string
84228422+ /**
84238423+ * The content of the message as a string.
84248424+ */
84258425+ content: string
84268426+ }[]
84278427+ functions?: {
84288428+ name: string
84298429+ code: string
84308430+ }[]
84318431+ /**
84328432+ * A list of tools available for the assistant to use.
84338433+ */
84348434+ tools?: (
84358435+ | {
84368436+ /**
84378437+ * The name of the tool. More descriptive the better.
84388438+ */
84398439+ name: string
84408440+ /**
84418441+ * A brief description of what the tool does.
84428442+ */
84438443+ description: string
84448444+ /**
84458445+ * Schema defining the parameters accepted by the tool.
84468446+ */
84478447+ parameters: {
84488448+ /**
84498449+ * The type of the parameters object (usually 'object').
84508450+ */
84518451+ type: string
84528452+ /**
84538453+ * List of required parameter names.
84548454+ */
84558455+ required?: string[]
84568456+ /**
84578457+ * Definitions of each parameter.
84588458+ */
84598459+ properties: {
84608460+ [k: string]: {
84618461+ /**
84628462+ * The data type of the parameter.
84638463+ */
84648464+ type: string
84658465+ /**
84668466+ * A description of the expected parameter.
84678467+ */
84688468+ description: string
84698469+ }
84708470+ }
84718471+ }
84728472+ }
84738473+ | {
84748474+ /**
84758475+ * Specifies the type of tool (e.g., 'function').
84768476+ */
84778477+ type: string
84788478+ /**
84798479+ * Details of the function tool.
84808480+ */
84818481+ function: {
84828482+ /**
84838483+ * The name of the function.
84848484+ */
84858485+ name: string
84868486+ /**
84878487+ * A brief description of what the function does.
84888488+ */
84898489+ description: string
84908490+ /**
84918491+ * Schema defining the parameters accepted by the function.
84928492+ */
84938493+ parameters: {
84948494+ /**
84958495+ * The type of the parameters object (usually 'object').
84968496+ */
84978497+ type: string
84988498+ /**
84998499+ * List of required parameter names.
85008500+ */
85018501+ required?: string[]
85028502+ /**
85038503+ * Definitions of each parameter.
85048504+ */
85058505+ properties: {
85068506+ [k: string]: {
85078507+ /**
85088508+ * The data type of the parameter.
85098509+ */
85108510+ type: string
85118511+ /**
85128512+ * A description of the expected parameter.
85138513+ */
85148514+ description: string
85158515+ }
85168516+ }
85178517+ }
85188518+ }
85198519+ }
85208520+ )[]
85218521+ response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_3
85228522+ /**
85238523+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
85248524+ */
85258525+ raw?: boolean
85268526+ /**
85278527+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
85288528+ */
85298529+ stream?: boolean
85308530+ /**
85318531+ * The maximum number of tokens to generate in the response.
85328532+ */
85338533+ max_tokens?: number
85348534+ /**
85358535+ * Controls the randomness of the output; higher values produce more random results.
85368536+ */
85378537+ temperature?: number
85388538+ /**
85398539+ * 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.
85408540+ */
85418541+ top_p?: number
85428542+ /**
85438543+ * 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.
85448544+ */
85458545+ top_k?: number
85468546+ /**
85478547+ * Random seed for reproducibility of the generation.
85488548+ */
85498549+ seed?: number
85508550+ /**
85518551+ * Penalty for repeated tokens; higher values discourage repetition.
85528552+ */
85538553+ repetition_penalty?: number
85548554+ /**
85558555+ * Decreases the likelihood of the model repeating the same lines verbatim.
85568556+ */
85578557+ frequency_penalty?: number
85588558+ /**
85598559+ * Increases the likelihood of the model introducing new topics.
85608560+ */
85618561+ presence_penalty?: number
85628562+}
85638563+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_3 {
85648564+ type?: 'json_object' | 'json_schema'
85658565+ json_schema?: unknown
85668566+}
85678567+type Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Output =
85688568+ | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Chat_Completion_Response
85698569+ | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Text_Completion_Response
85708570+ | string
85718571+ | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_AsyncResponse
85728572+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Chat_Completion_Response {
85738573+ /**
85748574+ * Unique identifier for the completion
85758575+ */
85768576+ id?: string
85778577+ /**
85788578+ * Object type identifier
85798579+ */
85808580+ object?: 'chat.completion'
85818581+ /**
85828582+ * Unix timestamp of when the completion was created
85838583+ */
85848584+ created?: number
85858585+ /**
85868586+ * Model used for the completion
85878587+ */
85888588+ model?: string
85898589+ /**
85908590+ * List of completion choices
85918591+ */
85928592+ choices?: {
85938593+ /**
85948594+ * Index of the choice in the list
85958595+ */
85968596+ index?: number
85978597+ /**
85988598+ * The message generated by the model
85998599+ */
86008600+ message?: {
86018601+ /**
86028602+ * Role of the message author
86038603+ */
86048604+ role: string
86058605+ /**
86068606+ * The content of the message
86078607+ */
86088608+ content: string
86098609+ /**
86108610+ * Internal reasoning content (if available)
86118611+ */
86128612+ reasoning_content?: string
86138613+ /**
86148614+ * Tool calls made by the assistant
86158615+ */
86168616+ tool_calls?: {
86178617+ /**
86188618+ * Unique identifier for the tool call
86198619+ */
86208620+ id: string
86218621+ /**
86228622+ * Type of tool call
86238623+ */
86248624+ type: 'function'
86258625+ function: {
86268626+ /**
86278627+ * Name of the function to call
86288628+ */
86298629+ name: string
86308630+ /**
86318631+ * JSON string of arguments for the function
86328632+ */
86338633+ arguments: string
86348634+ }
86358635+ }[]
86368636+ }
86378637+ /**
86388638+ * Reason why the model stopped generating
86398639+ */
86408640+ finish_reason?: string
86418641+ /**
86428642+ * Stop reason (may be null)
86438643+ */
86448644+ stop_reason?: string | null
86458645+ /**
86468646+ * Log probabilities (if requested)
86478647+ */
86488648+ logprobs?: {} | null
86498649+ }[]
86508650+ /**
86518651+ * Usage statistics for the inference request
86528652+ */
86538653+ usage?: {
86548654+ /**
86558655+ * Total number of tokens in input
86568656+ */
86578657+ prompt_tokens?: number
86588658+ /**
86598659+ * Total number of tokens in output
86608660+ */
86618661+ completion_tokens?: number
86628662+ /**
86638663+ * Total number of input and output tokens
86648664+ */
86658665+ total_tokens?: number
86668666+ }
86678667+ /**
86688668+ * Log probabilities for the prompt (if requested)
86698669+ */
86708670+ prompt_logprobs?: {} | null
86718671+}
86728672+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Text_Completion_Response {
86738673+ /**
86748674+ * Unique identifier for the completion
86758675+ */
86768676+ id?: string
86778677+ /**
86788678+ * Object type identifier
86798679+ */
86808680+ object?: 'text_completion'
86818681+ /**
86828682+ * Unix timestamp of when the completion was created
86838683+ */
86848684+ created?: number
86858685+ /**
86868686+ * Model used for the completion
86878687+ */
86888688+ model?: string
86898689+ /**
86908690+ * List of completion choices
86918691+ */
86928692+ choices?: {
86938693+ /**
86948694+ * Index of the choice in the list
86958695+ */
86968696+ index: number
86978697+ /**
86988698+ * The generated text completion
86998699+ */
87008700+ text: string
87018701+ /**
87028702+ * Reason why the model stopped generating
87038703+ */
87048704+ finish_reason: string
87058705+ /**
87068706+ * Stop reason (may be null)
87078707+ */
87088708+ stop_reason?: string | null
87098709+ /**
87108710+ * Log probabilities (if requested)
87118711+ */
87128712+ logprobs?: {} | null
87138713+ /**
87148714+ * Log probabilities for the prompt (if requested)
87158715+ */
87168716+ prompt_logprobs?: {} | null
87178717+ }[]
87188718+ /**
87198719+ * Usage statistics for the inference request
87208720+ */
87218721+ usage?: {
87228722+ /**
87238723+ * Total number of tokens in input
87248724+ */
87258725+ prompt_tokens?: number
87268726+ /**
87278727+ * Total number of tokens in output
87288728+ */
87298729+ completion_tokens?: number
87308730+ /**
87318731+ * Total number of input and output tokens
87328732+ */
87338733+ total_tokens?: number
87348734+ }
87358735+}
87368736+interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_AsyncResponse {
87378737+ /**
87388738+ * The async request id that can be used to obtain the results.
87398739+ */
87408740+ request_id?: string
87418741+}
87428742+declare abstract class Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It {
87438743+ inputs: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Input
87448744+ postProcessedOutputs: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Output
87458745+}
87468746+interface Ai_Cf_Pfnet_Plamo_Embedding_1B_Input {
87478747+ /**
87488748+ * Input text to embed. Can be a single string or a list of strings.
87498749+ */
87508750+ text: string | string[]
87518751+}
87528752+interface Ai_Cf_Pfnet_Plamo_Embedding_1B_Output {
87538753+ /**
87548754+ * Embedding vectors, where each vector is a list of floats.
87558755+ */
87568756+ data: number[][]
87578757+ /**
87588758+ * Shape of the embedding data as [number_of_embeddings, embedding_dimension].
87598759+ *
87608760+ * @minItems 2
87618761+ * @maxItems 2
87628762+ */
87638763+ shape: [number, number]
87648764+}
87658765+declare abstract class Base_Ai_Cf_Pfnet_Plamo_Embedding_1B {
87668766+ inputs: Ai_Cf_Pfnet_Plamo_Embedding_1B_Input
87678767+ postProcessedOutputs: Ai_Cf_Pfnet_Plamo_Embedding_1B_Output
87688768+}
87698769+interface Ai_Cf_Deepgram_Flux_Input {
87708770+ /**
87718771+ * Encoding of the audio stream. Currently only supports raw signed little-endian 16-bit PCM.
87728772+ */
87738773+ encoding: 'linear16'
87748774+ /**
87758775+ * Sample rate of the audio stream in Hz.
87768776+ */
87778777+ sample_rate: string
87788778+ /**
87798779+ * End-of-turn confidence required to fire an eager end-of-turn event. When set, enables EagerEndOfTurn and TurnResumed events. Valid Values 0.3 - 0.9.
87808780+ */
87818781+ eager_eot_threshold?: string
87828782+ /**
87838783+ * End-of-turn confidence required to finish a turn. Valid Values 0.5 - 0.9.
87848784+ */
87858785+ eot_threshold?: string
87868786+ /**
87878787+ * A turn will be finished when this much time has passed after speech, regardless of EOT confidence.
87888788+ */
87898789+ eot_timeout_ms?: string
87908790+ /**
87918791+ * Keyterm prompting can improve recognition of specialized terminology. Pass multiple keyterm query parameters to boost multiple keyterms.
87928792+ */
87938793+ keyterm?: string
87948794+ /**
87958795+ * Opts out requests from the Deepgram Model Improvement Program. Refer to Deepgram Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip
87968796+ */
87978797+ mip_opt_out?: 'true' | 'false'
87988798+ /**
87998799+ * Label your requests for the purpose of identification during usage reporting
88008800+ */
88018801+ tag?: string
88028802+}
88038803+/**
88048804+ * Output will be returned as websocket messages.
88058805+ */
88068806+interface Ai_Cf_Deepgram_Flux_Output {
88078807+ /**
88088808+ * The unique identifier of the request (uuid)
88098809+ */
88108810+ request_id?: string
88118811+ /**
88128812+ * Starts at 0 and increments for each message the server sends to the client.
88138813+ */
88148814+ sequence_id?: number
88158815+ /**
88168816+ * The type of event being reported.
88178817+ */
88188818+ event?: 'Update' | 'StartOfTurn' | 'EagerEndOfTurn' | 'TurnResumed' | 'EndOfTurn'
88198819+ /**
88208820+ * The index of the current turn
88218821+ */
88228822+ turn_index?: number
88238823+ /**
88248824+ * Start time in seconds of the audio range that was transcribed
88258825+ */
88268826+ audio_window_start?: number
88278827+ /**
88288828+ * End time in seconds of the audio range that was transcribed
88298829+ */
88308830+ audio_window_end?: number
88318831+ /**
88328832+ * Text that was said over the course of the current turn
88338833+ */
88348834+ transcript?: string
88358835+ /**
88368836+ * The words in the transcript
88378837+ */
88388838+ words?: {
88398839+ /**
88408840+ * The individual punctuated, properly-cased word from the transcript
88418841+ */
88428842+ word: string
88438843+ /**
88448844+ * Confidence that this word was transcribed correctly
88458845+ */
88468846+ confidence: number
88478847+ }[]
88488848+ /**
88498849+ * Confidence that no more speech is coming in this turn
88508850+ */
88518851+ end_of_turn_confidence?: number
88528852+}
88538853+declare abstract class Base_Ai_Cf_Deepgram_Flux {
88548854+ inputs: Ai_Cf_Deepgram_Flux_Input
88558855+ postProcessedOutputs: Ai_Cf_Deepgram_Flux_Output
88568856+}
88578857+interface Ai_Cf_Deepgram_Aura_2_En_Input {
88588858+ /**
88598859+ * Speaker used to produce the audio.
88608860+ */
88618861+ speaker?:
88628862+ | 'amalthea'
88638863+ | 'andromeda'
88648864+ | 'apollo'
88658865+ | 'arcas'
88668866+ | 'aries'
88678867+ | 'asteria'
88688868+ | 'athena'
88698869+ | 'atlas'
88708870+ | 'aurora'
88718871+ | 'callista'
88728872+ | 'cora'
88738873+ | 'cordelia'
88748874+ | 'delia'
88758875+ | 'draco'
88768876+ | 'electra'
88778877+ | 'harmonia'
88788878+ | 'helena'
88798879+ | 'hera'
88808880+ | 'hermes'
88818881+ | 'hyperion'
88828882+ | 'iris'
88838883+ | 'janus'
88848884+ | 'juno'
88858885+ | 'jupiter'
88868886+ | 'luna'
88878887+ | 'mars'
88888888+ | 'minerva'
88898889+ | 'neptune'
88908890+ | 'odysseus'
88918891+ | 'ophelia'
88928892+ | 'orion'
88938893+ | 'orpheus'
88948894+ | 'pandora'
88958895+ | 'phoebe'
88968896+ | 'pluto'
88978897+ | 'saturn'
88988898+ | 'thalia'
88998899+ | 'theia'
89008900+ | 'vesta'
89018901+ | 'zeus'
89028902+ /**
89038903+ * Encoding of the output audio.
89048904+ */
89058905+ encoding?: 'linear16' | 'flac' | 'mulaw' | 'alaw' | 'mp3' | 'opus' | 'aac'
89068906+ /**
89078907+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
89088908+ */
89098909+ container?: 'none' | 'wav' | 'ogg'
89108910+ /**
89118911+ * The text content to be converted to speech
89128912+ */
89138913+ text: string
89148914+ /**
89158915+ * 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 configurable
89168916+ */
89178917+ sample_rate?: number
89188918+ /**
89198919+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
89208920+ */
89218921+ bit_rate?: number
89228922+}
89238923+/**
89248924+ * The generated audio in MP3 format
89258925+ */
89268926+type Ai_Cf_Deepgram_Aura_2_En_Output = string
89278927+declare abstract class Base_Ai_Cf_Deepgram_Aura_2_En {
89288928+ inputs: Ai_Cf_Deepgram_Aura_2_En_Input
89298929+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_En_Output
89308930+}
89318931+interface Ai_Cf_Deepgram_Aura_2_Es_Input {
89328932+ /**
89338933+ * Speaker used to produce the audio.
89348934+ */
89358935+ speaker?:
89368936+ | 'sirio'
89378937+ | 'nestor'
89388938+ | 'carina'
89398939+ | 'celeste'
89408940+ | 'alvaro'
89418941+ | 'diana'
89428942+ | 'aquila'
89438943+ | 'selena'
89448944+ | 'estrella'
89458945+ | 'javier'
89468946+ /**
89478947+ * Encoding of the output audio.
89488948+ */
89498949+ encoding?: 'linear16' | 'flac' | 'mulaw' | 'alaw' | 'mp3' | 'opus' | 'aac'
89508950+ /**
89518951+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
89528952+ */
89538953+ container?: 'none' | 'wav' | 'ogg'
89548954+ /**
89558955+ * The text content to be converted to speech
89568956+ */
89578957+ text: string
89588958+ /**
89598959+ * 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 configurable
89608960+ */
89618961+ sample_rate?: number
89628962+ /**
89638963+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
89648964+ */
89658965+ bit_rate?: number
89668966+}
89678967+/**
89688968+ * The generated audio in MP3 format
89698969+ */
89708970+type Ai_Cf_Deepgram_Aura_2_Es_Output = string
89718971+declare abstract class Base_Ai_Cf_Deepgram_Aura_2_Es {
89728972+ inputs: Ai_Cf_Deepgram_Aura_2_Es_Input
89738973+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_Es_Output
89748974+}
89758975+interface AiModels {
89768976+ '@cf/huggingface/distilbert-sst-2-int8': BaseAiTextClassification
89778977+ '@cf/stabilityai/stable-diffusion-xl-base-1.0': BaseAiTextToImage
89788978+ '@cf/runwayml/stable-diffusion-v1-5-inpainting': BaseAiTextToImage
89798979+ '@cf/runwayml/stable-diffusion-v1-5-img2img': BaseAiTextToImage
89808980+ '@cf/lykon/dreamshaper-8-lcm': BaseAiTextToImage
89818981+ '@cf/bytedance/stable-diffusion-xl-lightning': BaseAiTextToImage
89828982+ '@cf/myshell-ai/melotts': BaseAiTextToSpeech
89838983+ '@cf/google/embeddinggemma-300m': BaseAiTextEmbeddings
89848984+ '@cf/microsoft/resnet-50': BaseAiImageClassification
89858985+ '@cf/meta/llama-2-7b-chat-int8': BaseAiTextGeneration
89868986+ '@cf/mistral/mistral-7b-instruct-v0.1': BaseAiTextGeneration
89878987+ '@cf/meta/llama-2-7b-chat-fp16': BaseAiTextGeneration
89888988+ '@hf/thebloke/llama-2-13b-chat-awq': BaseAiTextGeneration
89898989+ '@hf/thebloke/mistral-7b-instruct-v0.1-awq': BaseAiTextGeneration
89908990+ '@hf/thebloke/zephyr-7b-beta-awq': BaseAiTextGeneration
89918991+ '@hf/thebloke/openhermes-2.5-mistral-7b-awq': BaseAiTextGeneration
89928992+ '@hf/thebloke/neural-chat-7b-v3-1-awq': BaseAiTextGeneration
89938993+ '@hf/thebloke/llamaguard-7b-awq': BaseAiTextGeneration
89948994+ '@hf/thebloke/deepseek-coder-6.7b-base-awq': BaseAiTextGeneration
89958995+ '@hf/thebloke/deepseek-coder-6.7b-instruct-awq': BaseAiTextGeneration
89968996+ '@cf/deepseek-ai/deepseek-math-7b-instruct': BaseAiTextGeneration
89978997+ '@cf/defog/sqlcoder-7b-2': BaseAiTextGeneration
89988998+ '@cf/openchat/openchat-3.5-0106': BaseAiTextGeneration
89998999+ '@cf/tiiuae/falcon-7b-instruct': BaseAiTextGeneration
90009000+ '@cf/thebloke/discolm-german-7b-v1-awq': BaseAiTextGeneration
90019001+ '@cf/qwen/qwen1.5-0.5b-chat': BaseAiTextGeneration
90029002+ '@cf/qwen/qwen1.5-7b-chat-awq': BaseAiTextGeneration
90039003+ '@cf/qwen/qwen1.5-14b-chat-awq': BaseAiTextGeneration
90049004+ '@cf/tinyllama/tinyllama-1.1b-chat-v1.0': BaseAiTextGeneration
90059005+ '@cf/microsoft/phi-2': BaseAiTextGeneration
90069006+ '@cf/qwen/qwen1.5-1.8b-chat': BaseAiTextGeneration
90079007+ '@cf/mistral/mistral-7b-instruct-v0.2-lora': BaseAiTextGeneration
90089008+ '@hf/nousresearch/hermes-2-pro-mistral-7b': BaseAiTextGeneration
90099009+ '@hf/nexusflow/starling-lm-7b-beta': BaseAiTextGeneration
90109010+ '@hf/google/gemma-7b-it': BaseAiTextGeneration
90119011+ '@cf/meta-llama/llama-2-7b-chat-hf-lora': BaseAiTextGeneration
90129012+ '@cf/google/gemma-2b-it-lora': BaseAiTextGeneration
90139013+ '@cf/google/gemma-7b-it-lora': BaseAiTextGeneration
90149014+ '@hf/mistral/mistral-7b-instruct-v0.2': BaseAiTextGeneration
90159015+ '@cf/meta/llama-3-8b-instruct': BaseAiTextGeneration
90169016+ '@cf/fblgit/una-cybertron-7b-v2-bf16': BaseAiTextGeneration
90179017+ '@cf/meta/llama-3-8b-instruct-awq': BaseAiTextGeneration
90189018+ '@cf/meta/llama-3.1-8b-instruct-fp8': BaseAiTextGeneration
90199019+ '@cf/meta/llama-3.1-8b-instruct-awq': BaseAiTextGeneration
90209020+ '@cf/meta/llama-3.2-3b-instruct': BaseAiTextGeneration
90219021+ '@cf/meta/llama-3.2-1b-instruct': BaseAiTextGeneration
90229022+ '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b': BaseAiTextGeneration
90239023+ '@cf/ibm-granite/granite-4.0-h-micro': BaseAiTextGeneration
90249024+ '@cf/facebook/bart-large-cnn': BaseAiSummarization
90259025+ '@cf/llava-hf/llava-1.5-7b-hf': BaseAiImageToText
90269026+ '@cf/baai/bge-base-en-v1.5': Base_Ai_Cf_Baai_Bge_Base_En_V1_5
90279027+ '@cf/openai/whisper': Base_Ai_Cf_Openai_Whisper
90289028+ '@cf/meta/m2m100-1.2b': Base_Ai_Cf_Meta_M2M100_1_2B
90299029+ '@cf/baai/bge-small-en-v1.5': Base_Ai_Cf_Baai_Bge_Small_En_V1_5
90309030+ '@cf/baai/bge-large-en-v1.5': Base_Ai_Cf_Baai_Bge_Large_En_V1_5
90319031+ '@cf/unum/uform-gen2-qwen-500m': Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M
90329032+ '@cf/openai/whisper-tiny-en': Base_Ai_Cf_Openai_Whisper_Tiny_En
90339033+ '@cf/openai/whisper-large-v3-turbo': Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo
90349034+ '@cf/baai/bge-m3': Base_Ai_Cf_Baai_Bge_M3
90359035+ '@cf/black-forest-labs/flux-1-schnell': Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell
90369036+ '@cf/meta/llama-3.2-11b-vision-instruct': Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct
90379037+ '@cf/meta/llama-3.3-70b-instruct-fp8-fast': Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast
90389038+ '@cf/meta/llama-guard-3-8b': Base_Ai_Cf_Meta_Llama_Guard_3_8B
90399039+ '@cf/baai/bge-reranker-base': Base_Ai_Cf_Baai_Bge_Reranker_Base
90409040+ '@cf/qwen/qwen2.5-coder-32b-instruct': Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct
90419041+ '@cf/qwen/qwq-32b': Base_Ai_Cf_Qwen_Qwq_32B
90429042+ '@cf/mistralai/mistral-small-3.1-24b-instruct': Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct
90439043+ '@cf/google/gemma-3-12b-it': Base_Ai_Cf_Google_Gemma_3_12B_It
90449044+ '@cf/meta/llama-4-scout-17b-16e-instruct': Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct
90459045+ '@cf/qwen/qwen3-30b-a3b-fp8': Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8
90469046+ '@cf/deepgram/nova-3': Base_Ai_Cf_Deepgram_Nova_3
90479047+ '@cf/qwen/qwen3-embedding-0.6b': Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B
90489048+ '@cf/pipecat-ai/smart-turn-v2': Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2
90499049+ '@cf/openai/gpt-oss-120b': Base_Ai_Cf_Openai_Gpt_Oss_120B
90509050+ '@cf/openai/gpt-oss-20b': Base_Ai_Cf_Openai_Gpt_Oss_20B
90519051+ '@cf/leonardo/phoenix-1.0': Base_Ai_Cf_Leonardo_Phoenix_1_0
90529052+ '@cf/leonardo/lucid-origin': Base_Ai_Cf_Leonardo_Lucid_Origin
90539053+ '@cf/deepgram/aura-1': Base_Ai_Cf_Deepgram_Aura_1
90549054+ '@cf/ai4bharat/indictrans2-en-indic-1B': Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B
90559055+ '@cf/aisingapore/gemma-sea-lion-v4-27b-it': Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It
90569056+ '@cf/pfnet/plamo-embedding-1b': Base_Ai_Cf_Pfnet_Plamo_Embedding_1B
90579057+ '@cf/deepgram/flux': Base_Ai_Cf_Deepgram_Flux
90589058+ '@cf/deepgram/aura-2-en': Base_Ai_Cf_Deepgram_Aura_2_En
90599059+ '@cf/deepgram/aura-2-es': Base_Ai_Cf_Deepgram_Aura_2_Es
90609060+}
90619061+type AiOptions = {
90629062+ /**
90639063+ * Send requests as an asynchronous batch job, only works for supported models
90649064+ * https://developers.cloudflare.com/workers-ai/features/batch-api
90659065+ */
90669066+ queueRequest?: boolean
90679067+ /**
90689068+ * Establish websocket connections, only works for supported models
90699069+ */
90709070+ websocket?: boolean
90719071+ /**
90729072+ * Tag your requests to group and view them in Cloudflare dashboard.
90739073+ *
90749074+ * Rules:
90759075+ * Tags must only contain letters, numbers, and the symbols: : - . / @
90769076+ * Each tag can have maximum 50 characters.
90779077+ * Maximum 5 tags are allowed each request.
90789078+ * Duplicate tags will removed.
90799079+ */
90809080+ tags?: string[]
90819081+ gateway?: GatewayOptions
90829082+ returnRawResponse?: boolean
90839083+ prefix?: string
90849084+ extraHeaders?: object
90859085+}
90869086+type AiModelsSearchParams = {
90879087+ author?: string
90889088+ hide_experimental?: boolean
90899089+ page?: number
90909090+ per_page?: number
90919091+ search?: string
90929092+ source?: number
90939093+ task?: string
90949094+}
90959095+type AiModelsSearchObject = {
90969096+ id: string
90979097+ source: number
90989098+ name: string
90999099+ description: string
91009100+ task: {
91019101+ id: string
91029102+ name: string
91039103+ description: string
91049104+ }
91059105+ tags: string[]
91069106+ properties: {
91079107+ property_id: string
91089108+ value: string
91099109+ }[]
91109110+}
91119111+interface InferenceUpstreamError extends Error {}
91129112+interface AiInternalError extends Error {}
91139113+type AiModelListType = Record<string, any>
91149114+declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
91159115+ aiGatewayLogId: string | null
91169116+ gateway(gatewayId: string): AiGateway
91179117+ autorag(autoragId: string): AutoRAG
91189118+ run<
91199119+ Name extends keyof AiModelList,
91209120+ Options extends AiOptions,
91219121+ InputOptions extends AiModelList[Name]['inputs'],
91229122+ >(
91239123+ model: Name,
91249124+ inputs: InputOptions,
91259125+ options?: Options,
91269126+ ): Promise<
91279127+ Options extends
91289128+ | {
91299129+ returnRawResponse: true
91309130+ }
91319131+ | {
91329132+ websocket: true
91339133+ }
91349134+ ? Response
91359135+ : InputOptions extends {
91369136+ stream: true
91379137+ }
91389138+ ? ReadableStream
91399139+ : AiModelList[Name]['postProcessedOutputs']
91409140+ >
91419141+ models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>
91429142+ toMarkdown(): ToMarkdownService
91439143+ toMarkdown(
91449144+ files: MarkdownDocument[],
91459145+ options?: ConversionRequestOptions,
91469146+ ): Promise<ConversionResponse[]>
91479147+ toMarkdown(
91489148+ files: MarkdownDocument,
91499149+ options?: ConversionRequestOptions,
91509150+ ): Promise<ConversionResponse>
91519151+}
91529152+type GatewayRetries = {
91539153+ maxAttempts?: 1 | 2 | 3 | 4 | 5
91549154+ retryDelayMs?: number
91559155+ backoff?: 'constant' | 'linear' | 'exponential'
91569156+}
91579157+type GatewayOptions = {
91589158+ id: string
91599159+ cacheKey?: string
91609160+ cacheTtl?: number
91619161+ skipCache?: boolean
91629162+ metadata?: Record<string, number | string | boolean | null | bigint>
91639163+ collectLog?: boolean
91649164+ eventId?: string
91659165+ requestTimeoutMs?: number
91669166+ retries?: GatewayRetries
91679167+}
91689168+type UniversalGatewayOptions = Exclude<GatewayOptions, 'id'> & {
91699169+ /**
91709170+ ** @deprecated
91719171+ */
91729172+ id?: string
91739173+}
91749174+type AiGatewayPatchLog = {
91759175+ score?: number | null
91769176+ feedback?: -1 | 1 | null
91779177+ metadata?: Record<string, number | string | boolean | null | bigint> | null
91789178+}
91799179+type AiGatewayLog = {
91809180+ id: string
91819181+ provider: string
91829182+ model: string
91839183+ model_type?: string
91849184+ path: string
91859185+ duration: number
91869186+ request_type?: string
91879187+ request_content_type?: string
91889188+ status_code: number
91899189+ response_content_type?: string
91909190+ success: boolean
91919191+ cached: boolean
91929192+ tokens_in?: number
91939193+ tokens_out?: number
91949194+ metadata?: Record<string, number | string | boolean | null | bigint>
91959195+ step?: number
91969196+ cost?: number
91979197+ custom_cost?: boolean
91989198+ request_size: number
91999199+ request_head?: string
92009200+ request_head_complete: boolean
92019201+ response_size: number
92029202+ response_head?: string
92039203+ response_head_complete: boolean
92049204+ created_at: Date
92059205+}
92069206+type AIGatewayProviders =
92079207+ | 'workers-ai'
92089208+ | 'anthropic'
92099209+ | 'aws-bedrock'
92109210+ | 'azure-openai'
92119211+ | 'google-vertex-ai'
92129212+ | 'huggingface'
92139213+ | 'openai'
92149214+ | 'perplexity-ai'
92159215+ | 'replicate'
92169216+ | 'groq'
92179217+ | 'cohere'
92189218+ | 'google-ai-studio'
92199219+ | 'mistral'
92209220+ | 'grok'
92219221+ | 'openrouter'
92229222+ | 'deepseek'
92239223+ | 'cerebras'
92249224+ | 'cartesia'
92259225+ | 'elevenlabs'
92269226+ | 'adobe-firefly'
92279227+type AIGatewayHeaders = {
92289228+ 'cf-aig-metadata': Record<string, number | string | boolean | null | bigint> | string
92299229+ 'cf-aig-custom-cost':
92309230+ | {
92319231+ per_token_in?: number
92329232+ per_token_out?: number
92339233+ }
92349234+ | {
92359235+ total_cost?: number
92369236+ }
92379237+ | string
92389238+ 'cf-aig-cache-ttl': number | string
92399239+ 'cf-aig-skip-cache': boolean | string
92409240+ 'cf-aig-cache-key': string
92419241+ 'cf-aig-event-id': string
92429242+ 'cf-aig-request-timeout': number | string
92439243+ 'cf-aig-max-attempts': number | string
92449244+ 'cf-aig-retry-delay': number | string
92459245+ 'cf-aig-backoff': string
92469246+ 'cf-aig-collect-log': boolean | string
92479247+ Authorization: string
92489248+ 'Content-Type': string
92499249+ [key: string]: string | number | boolean | object
92509250+}
92519251+type AIGatewayUniversalRequest = {
92529252+ provider: AIGatewayProviders | string // eslint-disable-line
92539253+ endpoint: string
92549254+ headers: Partial<AIGatewayHeaders>
92559255+ query: unknown
92569256+}
92579257+interface AiGatewayInternalError extends Error {}
92589258+interface AiGatewayLogNotFound extends Error {}
92599259+declare abstract class AiGateway {
92609260+ patchLog(logId: string, data: AiGatewayPatchLog): Promise<void>
92619261+ getLog(logId: string): Promise<AiGatewayLog>
92629262+ run(
92639263+ data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[],
92649264+ options?: {
92659265+ gateway?: UniversalGatewayOptions
92669266+ extraHeaders?: object
92679267+ },
92689268+ ): Promise<Response>
92699269+ getUrl(provider?: AIGatewayProviders | string): Promise<string> // eslint-disable-line
92709270+}
92719271+interface AutoRAGInternalError extends Error {}
92729272+interface AutoRAGNotFoundError extends Error {}
92739273+interface AutoRAGUnauthorizedError extends Error {}
92749274+interface AutoRAGNameNotSetError extends Error {}
92759275+type ComparisonFilter = {
92769276+ key: string
92779277+ type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte'
92789278+ value: string | number | boolean
92799279+}
92809280+type CompoundFilter = {
92819281+ type: 'and' | 'or'
92829282+ filters: ComparisonFilter[]
92839283+}
92849284+type AutoRagSearchRequest = {
92859285+ query: string
92869286+ filters?: CompoundFilter | ComparisonFilter
92879287+ max_num_results?: number
92889288+ ranking_options?: {
92899289+ ranker?: string
92909290+ score_threshold?: number
92919291+ }
92929292+ reranking?: {
92939293+ enabled?: boolean
92949294+ model?: string
92959295+ }
92969296+ rewrite_query?: boolean
92979297+}
92989298+type AutoRagAiSearchRequest = AutoRagSearchRequest & {
92999299+ stream?: boolean
93009300+ system_prompt?: string
93019301+}
93029302+type AutoRagAiSearchRequestStreaming = Omit<AutoRagAiSearchRequest, 'stream'> & {
93039303+ stream: true
93049304+}
93059305+type AutoRagSearchResponse = {
93069306+ object: 'vector_store.search_results.page'
93079307+ search_query: string
93089308+ data: {
93099309+ file_id: string
93109310+ filename: string
93119311+ score: number
93129312+ attributes: Record<string, string | number | boolean | null>
93139313+ content: {
93149314+ type: 'text'
93159315+ text: string
93169316+ }[]
93179317+ }[]
93189318+ has_more: boolean
93199319+ next_page: string | null
93209320+}
93219321+type AutoRagListResponse = {
93229322+ id: string
93239323+ enable: boolean
93249324+ type: string
93259325+ source: string
93269326+ vectorize_name: string
93279327+ paused: boolean
93289328+ status: string
93299329+}[]
93309330+type AutoRagAiSearchResponse = AutoRagSearchResponse & {
93319331+ response: string
93329332+}
93339333+declare abstract class AutoRAG {
93349334+ list(): Promise<AutoRagListResponse>
93359335+ search(params: AutoRagSearchRequest): Promise<AutoRagSearchResponse>
93369336+ aiSearch(params: AutoRagAiSearchRequestStreaming): Promise<Response>
93379337+ aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse>
93389338+ aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse | Response>
93399339+}
93409340+interface BasicImageTransformations {
93419341+ /**
93429342+ * Maximum width in image pixels. The value must be an integer.
93439343+ */
93449344+ width?: number
93459345+ /**
93469346+ * Maximum height in image pixels. The value must be an integer.
93479347+ */
93489348+ height?: number
93499349+ /**
93509350+ * Resizing mode as a string. It affects interpretation of width and height
93519351+ * options:
93529352+ * - scale-down: Similar to contain, but the image is never enlarged. If
93539353+ * the image is larger than given width or height, it will be resized.
93549354+ * Otherwise its original size will be kept.
93559355+ * - contain: Resizes to maximum size that fits within the given width and
93569356+ * height. If only a single dimension is given (e.g. only width), the
93579357+ * image will be shrunk or enlarged to exactly match that dimension.
93589358+ * Aspect ratio is always preserved.
93599359+ * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
93609360+ * and height. If the image has an aspect ratio different from the ratio
93619361+ * of width and height, it will be cropped to fit.
93629362+ * - crop: The image will be shrunk and cropped to fit within the area
93639363+ * specified by width and height. The image will not be enlarged. For images
93649364+ * smaller than the given dimensions it's the same as scale-down. For
93659365+ * images larger than the given dimensions, it's the same as cover.
93669366+ * See also trim.
93679367+ * - pad: Resizes to the maximum size that fits within the given width and
93689368+ * height, and then fills the remaining area with a background color
93699369+ * (white by default). Use of this mode is not recommended, as the same
93709370+ * effect can be more efficiently achieved with the contain mode and the
93719371+ * CSS object-fit: contain property.
93729372+ * - squeeze: Stretches and deforms to the width and height given, even if it
93739373+ * breaks aspect ratio
93749374+ */
93759375+ fit?: 'scale-down' | 'contain' | 'cover' | 'crop' | 'pad' | 'squeeze'
93769376+ /**
93779377+ * Image segmentation using artificial intelligence models. Sets pixels not
93789378+ * within selected segment area to transparent e.g "foreground" sets every
93799379+ * background pixel as transparent.
93809380+ */
93819381+ segment?: 'foreground'
93829382+ /**
93839383+ * When cropping with fit: "cover", this defines the side or point that should
93849384+ * be left uncropped. The value is either a string
93859385+ * "left", "right", "top", "bottom", "auto", or "center" (the default),
93869386+ * or an object {x, y} containing focal point coordinates in the original
93879387+ * image expressed as fractions ranging from 0.0 (top or left) to 1.0
93889388+ * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
93899389+ * crop bottom or left and right sides as necessary, but won’t crop anything
93909390+ * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
93919391+ * preserve as much as possible around a point at 20% of the height of the
93929392+ * source image.
93939393+ */
93949394+ gravity?:
93959395+ | 'face'
93969396+ | 'left'
93979397+ | 'right'
93989398+ | 'top'
93999399+ | 'bottom'
94009400+ | 'center'
94019401+ | 'auto'
94029402+ | 'entropy'
94039403+ | BasicImageTransformationsGravityCoordinates
94049404+ /**
94059405+ * Background color to add underneath the image. Applies only to images with
94069406+ * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
94079407+ * hsl(…), etc.)
94089408+ */
94099409+ background?: string
94109410+ /**
94119411+ * Number of degrees (90, 180, 270) to rotate the image by. width and height
94129412+ * options refer to axes after rotation.
94139413+ */
94149414+ rotate?: 0 | 90 | 180 | 270 | 360
94159415+}
94169416+interface BasicImageTransformationsGravityCoordinates {
94179417+ x?: number
94189418+ y?: number
94199419+ mode?: 'remainder' | 'box-center'
94209420+}
94219421+/**
94229422+ * In addition to the properties you can set in the RequestInit dict
94239423+ * that you pass as an argument to the Request constructor, you can
94249424+ * set certain properties of a `cf` object to control how Cloudflare
94259425+ * features are applied to that new Request.
94269426+ *
94279427+ * Note: Currently, these properties cannot be tested in the
94289428+ * playground.
94299429+ */
94309430+interface RequestInitCfProperties extends Record<string, unknown> {
94319431+ cacheEverything?: boolean
94329432+ /**
94339433+ * A request's cache key is what determines if two requests are
94349434+ * "the same" for caching purposes. If a request has the same cache key
94359435+ * as some previous request, then we can serve the same cached response for
94369436+ * both. (e.g. 'some-key')
94379437+ *
94389438+ * Only available for Enterprise customers.
94399439+ */
94409440+ cacheKey?: string
94419441+ /**
94429442+ * This allows you to append additional Cache-Tag response headers
94439443+ * to the origin response without modifications to the origin server.
94449444+ * This will allow for greater control over the Purge by Cache Tag feature
94459445+ * utilizing changes only in the Workers process.
94469446+ *
94479447+ * Only available for Enterprise customers.
94489448+ */
94499449+ cacheTags?: string[]
94509450+ /**
94519451+ * Force response to be cached for a given number of seconds. (e.g. 300)
94529452+ */
94539453+ cacheTtl?: number
94549454+ /**
94559455+ * Force response to be cached for a given number of seconds based on the Origin status code.
94569456+ * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
94579457+ */
94589458+ cacheTtlByStatus?: Record<string, number>
94599459+ scrapeShield?: boolean
94609460+ apps?: boolean
94619461+ image?: RequestInitCfPropertiesImage
94629462+ minify?: RequestInitCfPropertiesImageMinify
94639463+ mirage?: boolean
94649464+ polish?: 'lossy' | 'lossless' | 'off'
94659465+ r2?: RequestInitCfPropertiesR2
94669466+ /**
94679467+ * Redirects the request to an alternate origin server. You can use this,
94689468+ * for example, to implement load balancing across several origins.
94699469+ * (e.g.us-east.example.com)
94709470+ *
94719471+ * Note - For security reasons, the hostname set in resolveOverride must
94729472+ * be proxied on the same Cloudflare zone of the incoming request.
94739473+ * Otherwise, the setting is ignored. CNAME hosts are allowed, so to
94749474+ * resolve to a host under a different domain or a DNS only domain first
94759475+ * declare a CNAME record within your own zone’s DNS mapping to the
94769476+ * external hostname, set proxy on Cloudflare, then set resolveOverride
94779477+ * to point to that CNAME record.
94789478+ */
94799479+ resolveOverride?: string
94809480+}
94819481+interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
94829482+ /**
94839483+ * Absolute URL of the image file to use for the drawing. It can be any of
94849484+ * the supported file formats. For drawing of watermarks or non-rectangular
94859485+ * overlays we recommend using PNG or WebP images.
94869486+ */
94879487+ url: string
94889488+ /**
94899489+ * Floating-point number between 0 (transparent) and 1 (opaque).
94909490+ * For example, opacity: 0.5 makes overlay semitransparent.
94919491+ */
94929492+ opacity?: number
94939493+ /**
94949494+ * - If set to true, the overlay image will be tiled to cover the entire
94959495+ * area. This is useful for stock-photo-like watermarks.
94969496+ * - If set to "x", the overlay image will be tiled horizontally only
94979497+ * (form a line).
94989498+ * - If set to "y", the overlay image will be tiled vertically only
94999499+ * (form a line).
95009500+ */
95019501+ repeat?: true | 'x' | 'y'
95029502+ /**
95039503+ * Position of the overlay image relative to a given edge. Each property is
95049504+ * an offset in pixels. 0 aligns exactly to the edge. For example, left: 10
95059505+ * positions left side of the overlay 10 pixels from the left edge of the
95069506+ * image it's drawn over. bottom: 0 aligns bottom of the overlay with bottom
95079507+ * of the background image.
95089508+ *
95099509+ * Setting both left & right, or both top & bottom is an error.
95109510+ *
95119511+ * If no position is specified, the image will be centered.
95129512+ */
95139513+ top?: number
95149514+ left?: number
95159515+ bottom?: number
95169516+ right?: number
95179517+}
95189518+interface RequestInitCfPropertiesImage extends BasicImageTransformations {
95199519+ /**
95209520+ * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
95219521+ * easier to specify higher-DPI sizes in <img srcset>.
95229522+ */
95239523+ dpr?: number
95249524+ /**
95259525+ * Allows you to trim your image. Takes dpr into account and is performed before
95269526+ * resizing or rotation.
95279527+ *
95289528+ * It can be used as:
95299529+ * - left, top, right, bottom - it will specify the number of pixels to cut
95309530+ * off each side
95319531+ * - width, height - the width/height you'd like to end up with - can be used
95329532+ * in combination with the properties above
95339533+ * - border - this will automatically trim the surroundings of an image based on
95349534+ * it's color. It consists of three properties:
95359535+ * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
95369536+ * - tolerance: difference from color to treat as color
95379537+ * - keep: the number of pixels of border to keep
95389538+ */
95399539+ trim?:
95409540+ | 'border'
95419541+ | {
95429542+ top?: number
95439543+ bottom?: number
95449544+ left?: number
95459545+ right?: number
95469546+ width?: number
95479547+ height?: number
95489548+ border?:
95499549+ | boolean
95509550+ | {
95519551+ color?: string
95529552+ tolerance?: number
95539553+ keep?: number
95549554+ }
95559555+ }
95569556+ /**
95579557+ * Quality setting from 1-100 (useful values are in 60-90 range). Lower values
95589558+ * make images look worse, but load faster. The default is 85. It applies only
95599559+ * to JPEG and WebP images. It doesn’t have any effect on PNG.
95609560+ */
95619561+ quality?: number | 'low' | 'medium-low' | 'medium-high' | 'high'
95629562+ /**
95639563+ * Output format to generate. It can be:
95649564+ * - avif: generate images in AVIF format.
95659565+ * - webp: generate images in Google WebP format. Set quality to 100 to get
95669566+ * the WebP-lossless format.
95679567+ * - json: instead of generating an image, outputs information about the
95689568+ * image, in JSON format. The JSON object will contain image size
95699569+ * (before and after resizing), source image’s MIME type, file size, etc.
95709570+ * - jpeg: generate images in JPEG format.
95719571+ * - png: generate images in PNG format.
95729572+ */
95739573+ format?: 'avif' | 'webp' | 'json' | 'jpeg' | 'png' | 'baseline-jpeg' | 'png-force' | 'svg'
95749574+ /**
95759575+ * Whether to preserve animation frames from input files. Default is true.
95769576+ * Setting it to false reduces animations to still images. This setting is
95779577+ * recommended when enlarging images or processing arbitrary user content,
95789578+ * because large GIF animations can weigh tens or even hundreds of megabytes.
95799579+ * It is also useful to set anim:false when using format:"json" to get the
95809580+ * response quicker without the number of frames.
95819581+ */
95829582+ anim?: boolean
95839583+ /**
95849584+ * What EXIF data should be preserved in the output image. Note that EXIF
95859585+ * rotation and embedded color profiles are always applied ("baked in" into
95869586+ * the image), and aren't affected by this option. Note that if the Polish
95879587+ * feature is enabled, all metadata may have been removed already and this
95889588+ * option may have no effect.
95899589+ * - keep: Preserve most of EXIF metadata, including GPS location if there's
95909590+ * any.
95919591+ * - copyright: Only keep the copyright tag, and discard everything else.
95929592+ * This is the default behavior for JPEG files.
95939593+ * - none: Discard all invisible EXIF metadata. Currently WebP and PNG
95949594+ * output formats always discard metadata.
95959595+ */
95969596+ metadata?: 'keep' | 'copyright' | 'none'
95979597+ /**
95989598+ * Strength of sharpening filter to apply to the image. Floating-point
95999599+ * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
96009600+ * recommended value for downscaled images.
96019601+ */
96029602+ sharpen?: number
96039603+ /**
96049604+ * Radius of a blur filter (approximate gaussian). Maximum supported radius
96059605+ * is 250.
96069606+ */
96079607+ blur?: number
96089608+ /**
96099609+ * Overlays are drawn in the order they appear in the array (last array
96109610+ * entry is the topmost layer).
96119611+ */
96129612+ draw?: RequestInitCfPropertiesImageDraw[]
96139613+ /**
96149614+ * Fetching image from authenticated origin. Setting this property will
96159615+ * pass authentication headers (Authorization, Cookie, etc.) through to
96169616+ * the origin.
96179617+ */
96189618+ 'origin-auth'?: 'share-publicly'
96199619+ /**
96209620+ * Adds a border around the image. The border is added after resizing. Border
96219621+ * width takes dpr into account, and can be specified either using a single
96229622+ * width property, or individually for each side.
96239623+ */
96249624+ border?:
96259625+ | {
96269626+ color: string
96279627+ width: number
96289628+ }
96299629+ | {
96309630+ color: string
96319631+ top: number
96329632+ right: number
96339633+ bottom: number
96349634+ left: number
96359635+ }
96369636+ /**
96379637+ * Increase brightness by a factor. A value of 1.0 equals no change, a value
96389638+ * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
96399639+ * 0 is ignored.
96409640+ */
96419641+ brightness?: number
96429642+ /**
96439643+ * Increase contrast by a factor. A value of 1.0 equals no change, a value of
96449644+ * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
96459645+ * ignored.
96469646+ */
96479647+ contrast?: number
96489648+ /**
96499649+ * Increase exposure by a factor. A value of 1.0 equals no change, a value of
96509650+ * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
96519651+ */
96529652+ gamma?: number
96539653+ /**
96549654+ * Increase contrast by a factor. A value of 1.0 equals no change, a value of
96559655+ * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
96569656+ * ignored.
96579657+ */
96589658+ saturation?: number
96599659+ /**
96609660+ * Flips the images horizontally, vertically, or both. Flipping is applied before
96619661+ * rotation, so if you apply flip=h,rotate=90 then the image will be flipped
96629662+ * horizontally, then rotated by 90 degrees.
96639663+ */
96649664+ flip?: 'h' | 'v' | 'hv'
96659665+ /**
96669666+ * Slightly reduces latency on a cache miss by selecting a
96679667+ * quickest-to-compress file format, at a cost of increased file size and
96689668+ * lower image quality. It will usually override the format option and choose
96699669+ * JPEG over WebP or AVIF. We do not recommend using this option, except in
96709670+ * unusual circumstances like resizing uncacheable dynamically-generated
96719671+ * images.
96729672+ */
96739673+ compression?: 'fast'
96749674+}
96759675+interface RequestInitCfPropertiesImageMinify {
96769676+ javascript?: boolean
96779677+ css?: boolean
96789678+ html?: boolean
96799679+}
96809680+interface RequestInitCfPropertiesR2 {
96819681+ /**
96829682+ * Colo id of bucket that an object is stored in
96839683+ */
96849684+ bucketColoId?: number
96859685+}
96869686+/**
96879687+ * Request metadata provided by Cloudflare's edge.
96889688+ */
96899689+type IncomingRequestCfProperties<HostMetadata = unknown> = IncomingRequestCfPropertiesBase &
96909690+ IncomingRequestCfPropertiesBotManagementEnterprise &
96919691+ IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> &
96929692+ IncomingRequestCfPropertiesGeographicInformation &
96939693+ IncomingRequestCfPropertiesCloudflareAccessOrApiShield
96949694+interface IncomingRequestCfPropertiesBase extends Record<string, unknown> {
96959695+ /**
96969696+ * [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request.
96979697+ *
96989698+ * @example 395747
96999699+ */
97009700+ asn?: number
97019701+ /**
97029702+ * The organization which owns the ASN of the incoming request.
97039703+ *
97049704+ * @example "Google Cloud"
97059705+ */
97069706+ asOrganization?: string
97079707+ /**
97089708+ * The original value of the `Accept-Encoding` header if Cloudflare modified it.
97099709+ *
97109710+ * @example "gzip, deflate, br"
97119711+ */
97129712+ clientAcceptEncoding?: string
97139713+ /**
97149714+ * The number of milliseconds it took for the request to reach your worker.
97159715+ *
97169716+ * @example 22
97179717+ */
97189718+ clientTcpRtt?: number
97199719+ /**
97209720+ * The three-letter [IATA](https://en.wikipedia.org/wiki/IATA_airport_code)
97219721+ * airport code of the data center that the request hit.
97229722+ *
97239723+ * @example "DFW"
97249724+ */
97259725+ colo: string
97269726+ /**
97279727+ * Represents the upstream's response to a
97289728+ * [TCP `keepalive` message](https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)
97299729+ * from cloudflare.
97309730+ *
97319731+ * For workers with no upstream, this will always be `1`.
97329732+ *
97339733+ * @example 3
97349734+ */
97359735+ edgeRequestKeepAliveStatus: IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus
97369736+ /**
97379737+ * The HTTP Protocol the request used.
97389738+ *
97399739+ * @example "HTTP/2"
97409740+ */
97419741+ httpProtocol: string
97429742+ /**
97439743+ * The browser-requested prioritization information in the request object.
97449744+ *
97459745+ * If no information was set, defaults to the empty string `""`
97469746+ *
97479747+ * @example "weight=192;exclusive=0;group=3;group-weight=127"
97489748+ * @default ""
97499749+ */
97509750+ requestPriority: string
97519751+ /**
97529752+ * The TLS version of the connection to Cloudflare.
97539753+ * In requests served over plaintext (without TLS), this property is the empty string `""`.
97549754+ *
97559755+ * @example "TLSv1.3"
97569756+ */
97579757+ tlsVersion: string
97589758+ /**
97599759+ * The cipher for the connection to Cloudflare.
97609760+ * In requests served over plaintext (without TLS), this property is the empty string `""`.
97619761+ *
97629762+ * @example "AEAD-AES128-GCM-SHA256"
97639763+ */
97649764+ tlsCipher: string
97659765+ /**
97669766+ * 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.
97679767+ *
97689768+ * If the incoming request was served over plaintext (without TLS) this field is undefined.
97699769+ */
97709770+ tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata
97719771+}
97729772+interface IncomingRequestCfPropertiesBotManagementBase {
97739773+ /**
97749774+ * Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot,
97759775+ * represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human).
97769776+ *
97779777+ * @example 54
97789778+ */
97799779+ score: number
97809780+ /**
97819781+ * A boolean value that is true if the request comes from a good bot, like Google or Bing.
97829782+ * 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).
97839783+ */
97849784+ verifiedBot: boolean
97859785+ /**
97869786+ * A boolean value that is true if the request originates from a
97879787+ * Cloudflare-verified proxy service.
97889788+ */
97899789+ corporateProxy: boolean
97909790+ /**
97919791+ * 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.
97929792+ */
97939793+ staticResource: boolean
97949794+ /**
97959795+ * 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).
97969796+ */
97979797+ detectionIds: number[]
97989798+}
97999799+interface IncomingRequestCfPropertiesBotManagement {
98009800+ /**
98019801+ * Results of Cloudflare's Bot Management analysis
98029802+ */
98039803+ botManagement: IncomingRequestCfPropertiesBotManagementBase
98049804+ /**
98059805+ * Duplicate of `botManagement.score`.
98069806+ *
98079807+ * @deprecated
98089808+ */
98099809+ clientTrustScore: number
98109810+}
98119811+interface IncomingRequestCfPropertiesBotManagementEnterprise extends IncomingRequestCfPropertiesBotManagement {
98129812+ /**
98139813+ * Results of Cloudflare's Bot Management analysis
98149814+ */
98159815+ botManagement: IncomingRequestCfPropertiesBotManagementBase & {
98169816+ /**
98179817+ * A [JA3 Fingerprint](https://developers.cloudflare.com/bots/concepts/ja3-fingerprint/) to help profile specific SSL/TLS clients
98189818+ * across different destination IPs, Ports, and X509 certificates.
98199819+ */
98209820+ ja3Hash: string
98219821+ }
98229822+}
98239823+interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> {
98249824+ /**
98259825+ * Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
98269826+ *
98279827+ * This field is only present if you have Cloudflare for SaaS enabled on your account
98289828+ * and you have followed the [required steps to enable it]((https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/)).
98299829+ */
98309830+ hostMetadata?: HostMetadata
98319831+}
98329832+interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
98339833+ /**
98349834+ * Information about the client certificate presented to Cloudflare.
98359835+ *
98369836+ * This is populated when the incoming request is served over TLS using
98379837+ * either Cloudflare Access or API Shield (mTLS)
98389838+ * and the presented SSL certificate has a valid
98399839+ * [Certificate Serial Number](https://ldapwiki.com/wiki/Certificate%20Serial%20Number)
98409840+ * (i.e., not `null` or `""`).
98419841+ *
98429842+ * Otherwise, a set of placeholder values are used.
98439843+ *
98449844+ * The property `certPresented` will be set to `"1"` when
98459845+ * the object is populated (i.e. the above conditions were met).
98469846+ */
98479847+ tlsClientAuth:
98489848+ | IncomingRequestCfPropertiesTLSClientAuth
98499849+ | IncomingRequestCfPropertiesTLSClientAuthPlaceholder
98509850+}
98519851+/**
98529852+ * Metadata about the request's TLS handshake
98539853+ */
98549854+interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
98559855+ /**
98569856+ * The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal
98579857+ *
98589858+ * @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d"
98599859+ */
98609860+ clientHandshake: string
98619861+ /**
98629862+ * The server's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal
98639863+ *
98649864+ * @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d"
98659865+ */
98669866+ serverHandshake: string
98679867+ /**
98689868+ * The client's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal
98699869+ *
98709870+ * @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b"
98719871+ */
98729872+ clientFinished: string
98739873+ /**
98749874+ * The server's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal
98759875+ *
98769876+ * @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b"
98779877+ */
98789878+ serverFinished: string
98799879+}
98809880+/**
98819881+ * Geographic data about the request's origin.
98829882+ */
98839883+interface IncomingRequestCfPropertiesGeographicInformation {
98849884+ /**
98859885+ * The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
98869886+ *
98879887+ * 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.
98889888+ *
98899889+ * If Cloudflare is unable to determine where the request originated this property is omitted.
98909890+ *
98919891+ * The country code `"T1"` is used for requests originating on TOR.
98929892+ *
98939893+ * @example "GB"
98949894+ */
98959895+ country?: Iso3166Alpha2Code | 'T1'
98969896+ /**
98979897+ * If present, this property indicates that the request originated in the EU
98989898+ *
98999899+ * @example "1"
99009900+ */
99019901+ isEUCountry?: '1'
99029902+ /**
99039903+ * A two-letter code indicating the continent the request originated from.
99049904+ *
99059905+ * @example "AN"
99069906+ */
99079907+ continent?: ContinentCode
99089908+ /**
99099909+ * The city the request originated from
99109910+ *
99119911+ * @example "Austin"
99129912+ */
99139913+ city?: string
99149914+ /**
99159915+ * Postal code of the incoming request
99169916+ *
99179917+ * @example "78701"
99189918+ */
99199919+ postalCode?: string
99209920+ /**
99219921+ * Latitude of the incoming request
99229922+ *
99239923+ * @example "30.27130"
99249924+ */
99259925+ latitude?: string
99269926+ /**
99279927+ * Longitude of the incoming request
99289928+ *
99299929+ * @example "-97.74260"
99309930+ */
99319931+ longitude?: string
99329932+ /**
99339933+ * Timezone of the incoming request
99349934+ *
99359935+ * @example "America/Chicago"
99369936+ */
99379937+ timezone?: string
99389938+ /**
99399939+ * If known, the ISO 3166-2 name for the first level region associated with
99409940+ * the IP address of the incoming request
99419941+ *
99429942+ * @example "Texas"
99439943+ */
99449944+ region?: string
99459945+ /**
99469946+ * If known, the ISO 3166-2 code for the first-level region associated with
99479947+ * the IP address of the incoming request
99489948+ *
99499949+ * @example "TX"
99509950+ */
99519951+ regionCode?: string
99529952+ /**
99539953+ * Metro code (DMA) of the incoming request
99549954+ *
99559955+ * @example "635"
99569956+ */
99579957+ metroCode?: string
99589958+}
99599959+/** Data about the incoming request's TLS certificate */
99609960+interface IncomingRequestCfPropertiesTLSClientAuth {
99619961+ /** Always `"1"`, indicating that the certificate was presented */
99629962+ certPresented: '1'
99639963+ /**
99649964+ * Result of certificate verification.
99659965+ *
99669966+ * @example "FAILED:self signed certificate"
99679967+ */
99689968+ certVerified: Exclude<CertVerificationStatus, 'NONE'>
99699969+ /** The presented certificate's revokation status.
99709970+ *
99719971+ * - A value of `"1"` indicates the certificate has been revoked
99729972+ * - A value of `"0"` indicates the certificate has not been revoked
99739973+ */
99749974+ certRevoked: '1' | '0'
99759975+ /**
99769976+ * The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html)
99779977+ *
99789978+ * @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"
99799979+ */
99809980+ certIssuerDN: string
99819981+ /**
99829982+ * The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html)
99839983+ *
99849984+ * @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"
99859985+ */
99869986+ certSubjectDN: string
99879987+ /**
99889988+ * The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted)
99899989+ *
99909990+ * @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"
99919991+ */
99929992+ certIssuerDNRFC2253: string
99939993+ /**
99949994+ * The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted)
99959995+ *
99969996+ * @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare"
99979997+ */
99989998+ certSubjectDNRFC2253: string
99999999+ /** The certificate issuer's distinguished name (legacy policies) */
1000010000+ certIssuerDNLegacy: string
1000110001+ /** The certificate subject's distinguished name (legacy policies) */
1000210002+ certSubjectDNLegacy: string
1000310003+ /**
1000410004+ * The certificate's serial number
1000510005+ *
1000610006+ * @example "00936EACBE07F201DF"
1000710007+ */
1000810008+ certSerial: string
1000910009+ /**
1001010010+ * The certificate issuer's serial number
1001110011+ *
1001210012+ * @example "2489002934BDFEA34"
1001310013+ */
1001410014+ certIssuerSerial: string
1001510015+ /**
1001610016+ * The certificate's Subject Key Identifier
1001710017+ *
1001810018+ * @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4"
1001910019+ */
1002010020+ certSKI: string
1002110021+ /**
1002210022+ * The certificate issuer's Subject Key Identifier
1002310023+ *
1002410024+ * @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4"
1002510025+ */
1002610026+ certIssuerSKI: string
1002710027+ /**
1002810028+ * The certificate's SHA-1 fingerprint
1002910029+ *
1003010030+ * @example "6b9109f323999e52259cda7373ff0b4d26bd232e"
1003110031+ */
1003210032+ certFingerprintSHA1: string
1003310033+ /**
1003410034+ * The certificate's SHA-256 fingerprint
1003510035+ *
1003610036+ * @example "acf77cf37b4156a2708e34c4eb755f9b5dbbe5ebb55adfec8f11493438d19e6ad3f157f81fa3b98278453d5652b0c1fd1d71e5695ae4d709803a4d3f39de9dea"
1003710037+ */
1003810038+ certFingerprintSHA256: string
1003910039+ /**
1004010040+ * The effective starting date of the certificate
1004110041+ *
1004210042+ * @example "Dec 22 19:39:00 2018 GMT"
1004310043+ */
1004410044+ certNotBefore: string
1004510045+ /**
1004610046+ * The effective expiration date of the certificate
1004710047+ *
1004810048+ * @example "Dec 22 19:39:00 2018 GMT"
1004910049+ */
1005010050+ certNotAfter: string
1005110051+}
1005210052+/** Placeholder values for TLS Client Authorization */
1005310053+interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
1005410054+ certPresented: '0'
1005510055+ certVerified: 'NONE'
1005610056+ certRevoked: '0'
1005710057+ certIssuerDN: ''
1005810058+ certSubjectDN: ''
1005910059+ certIssuerDNRFC2253: ''
1006010060+ certSubjectDNRFC2253: ''
1006110061+ certIssuerDNLegacy: ''
1006210062+ certSubjectDNLegacy: ''
1006310063+ certSerial: ''
1006410064+ certIssuerSerial: ''
1006510065+ certSKI: ''
1006610066+ certIssuerSKI: ''
1006710067+ certFingerprintSHA1: ''
1006810068+ certFingerprintSHA256: ''
1006910069+ certNotBefore: ''
1007010070+ certNotAfter: ''
1007110071+}
1007210072+/** Possible outcomes of TLS verification */
1007310073+declare type CertVerificationStatus =
1007410074+ /** Authentication succeeded */
1007510075+ | 'SUCCESS'
1007610076+ /** No certificate was presented */
1007710077+ | 'NONE'
1007810078+ /** Failed because the certificate was self-signed */
1007910079+ | 'FAILED:self signed certificate'
1008010080+ /** Failed because the certificate failed a trust chain check */
1008110081+ | 'FAILED:unable to verify the first certificate'
1008210082+ /** Failed because the certificate not yet valid */
1008310083+ | 'FAILED:certificate is not yet valid'
1008410084+ /** Failed because the certificate is expired */
1008510085+ | 'FAILED:certificate has expired'
1008610086+ /** Failed for another unspecified reason */
1008710087+ | 'FAILED'
1008810088+/**
1008910089+ * An upstream endpoint's response to a TCP `keepalive` message from Cloudflare.
1009010090+ */
1009110091+declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
1009210092+ | 0 /** Unknown */
1009310093+ | 1 /** no keepalives (not found) */
1009410094+ | 2 /** no connection re-use, opening keepalive connection failed */
1009510095+ | 3 /** no connection re-use, keepalive accepted and saved */
1009610096+ | 4 /** connection re-use, refused by the origin server (`TCP FIN`) */
1009710097+ | 5 /** connection re-use, accepted by the origin server */
1009810098+/** ISO 3166-1 Alpha-2 codes */
1009910099+declare type Iso3166Alpha2Code =
1010010100+ | 'AD'
1010110101+ | 'AE'
1010210102+ | 'AF'
1010310103+ | 'AG'
1010410104+ | 'AI'
1010510105+ | 'AL'
1010610106+ | 'AM'
1010710107+ | 'AO'
1010810108+ | 'AQ'
1010910109+ | 'AR'
1011010110+ | 'AS'
1011110111+ | 'AT'
1011210112+ | 'AU'
1011310113+ | 'AW'
1011410114+ | 'AX'
1011510115+ | 'AZ'
1011610116+ | 'BA'
1011710117+ | 'BB'
1011810118+ | 'BD'
1011910119+ | 'BE'
1012010120+ | 'BF'
1012110121+ | 'BG'
1012210122+ | 'BH'
1012310123+ | 'BI'
1012410124+ | 'BJ'
1012510125+ | 'BL'
1012610126+ | 'BM'
1012710127+ | 'BN'
1012810128+ | 'BO'
1012910129+ | 'BQ'
1013010130+ | 'BR'
1013110131+ | 'BS'
1013210132+ | 'BT'
1013310133+ | 'BV'
1013410134+ | 'BW'
1013510135+ | 'BY'
1013610136+ | 'BZ'
1013710137+ | 'CA'
1013810138+ | 'CC'
1013910139+ | 'CD'
1014010140+ | 'CF'
1014110141+ | 'CG'
1014210142+ | 'CH'
1014310143+ | 'CI'
1014410144+ | 'CK'
1014510145+ | 'CL'
1014610146+ | 'CM'
1014710147+ | 'CN'
1014810148+ | 'CO'
1014910149+ | 'CR'
1015010150+ | 'CU'
1015110151+ | 'CV'
1015210152+ | 'CW'
1015310153+ | 'CX'
1015410154+ | 'CY'
1015510155+ | 'CZ'
1015610156+ | 'DE'
1015710157+ | 'DJ'
1015810158+ | 'DK'
1015910159+ | 'DM'
1016010160+ | 'DO'
1016110161+ | 'DZ'
1016210162+ | 'EC'
1016310163+ | 'EE'
1016410164+ | 'EG'
1016510165+ | 'EH'
1016610166+ | 'ER'
1016710167+ | 'ES'
1016810168+ | 'ET'
1016910169+ | 'FI'
1017010170+ | 'FJ'
1017110171+ | 'FK'
1017210172+ | 'FM'
1017310173+ | 'FO'
1017410174+ | 'FR'
1017510175+ | 'GA'
1017610176+ | 'GB'
1017710177+ | 'GD'
1017810178+ | 'GE'
1017910179+ | 'GF'
1018010180+ | 'GG'
1018110181+ | 'GH'
1018210182+ | 'GI'
1018310183+ | 'GL'
1018410184+ | 'GM'
1018510185+ | 'GN'
1018610186+ | 'GP'
1018710187+ | 'GQ'
1018810188+ | 'GR'
1018910189+ | 'GS'
1019010190+ | 'GT'
1019110191+ | 'GU'
1019210192+ | 'GW'
1019310193+ | 'GY'
1019410194+ | 'HK'
1019510195+ | 'HM'
1019610196+ | 'HN'
1019710197+ | 'HR'
1019810198+ | 'HT'
1019910199+ | 'HU'
1020010200+ | 'ID'
1020110201+ | 'IE'
1020210202+ | 'IL'
1020310203+ | 'IM'
1020410204+ | 'IN'
1020510205+ | 'IO'
1020610206+ | 'IQ'
1020710207+ | 'IR'
1020810208+ | 'IS'
1020910209+ | 'IT'
1021010210+ | 'JE'
1021110211+ | 'JM'
1021210212+ | 'JO'
1021310213+ | 'JP'
1021410214+ | 'KE'
1021510215+ | 'KG'
1021610216+ | 'KH'
1021710217+ | 'KI'
1021810218+ | 'KM'
1021910219+ | 'KN'
1022010220+ | 'KP'
1022110221+ | 'KR'
1022210222+ | 'KW'
1022310223+ | 'KY'
1022410224+ | 'KZ'
1022510225+ | 'LA'
1022610226+ | 'LB'
1022710227+ | 'LC'
1022810228+ | 'LI'
1022910229+ | 'LK'
1023010230+ | 'LR'
1023110231+ | 'LS'
1023210232+ | 'LT'
1023310233+ | 'LU'
1023410234+ | 'LV'
1023510235+ | 'LY'
1023610236+ | 'MA'
1023710237+ | 'MC'
1023810238+ | 'MD'
1023910239+ | 'ME'
1024010240+ | 'MF'
1024110241+ | 'MG'
1024210242+ | 'MH'
1024310243+ | 'MK'
1024410244+ | 'ML'
1024510245+ | 'MM'
1024610246+ | 'MN'
1024710247+ | 'MO'
1024810248+ | 'MP'
1024910249+ | 'MQ'
1025010250+ | 'MR'
1025110251+ | 'MS'
1025210252+ | 'MT'
1025310253+ | 'MU'
1025410254+ | 'MV'
1025510255+ | 'MW'
1025610256+ | 'MX'
1025710257+ | 'MY'
1025810258+ | 'MZ'
1025910259+ | 'NA'
1026010260+ | 'NC'
1026110261+ | 'NE'
1026210262+ | 'NF'
1026310263+ | 'NG'
1026410264+ | 'NI'
1026510265+ | 'NL'
1026610266+ | 'NO'
1026710267+ | 'NP'
1026810268+ | 'NR'
1026910269+ | 'NU'
1027010270+ | 'NZ'
1027110271+ | 'OM'
1027210272+ | 'PA'
1027310273+ | 'PE'
1027410274+ | 'PF'
1027510275+ | 'PG'
1027610276+ | 'PH'
1027710277+ | 'PK'
1027810278+ | 'PL'
1027910279+ | 'PM'
1028010280+ | 'PN'
1028110281+ | 'PR'
1028210282+ | 'PS'
1028310283+ | 'PT'
1028410284+ | 'PW'
1028510285+ | 'PY'
1028610286+ | 'QA'
1028710287+ | 'RE'
1028810288+ | 'RO'
1028910289+ | 'RS'
1029010290+ | 'RU'
1029110291+ | 'RW'
1029210292+ | 'SA'
1029310293+ | 'SB'
1029410294+ | 'SC'
1029510295+ | 'SD'
1029610296+ | 'SE'
1029710297+ | 'SG'
1029810298+ | 'SH'
1029910299+ | 'SI'
1030010300+ | 'SJ'
1030110301+ | 'SK'
1030210302+ | 'SL'
1030310303+ | 'SM'
1030410304+ | 'SN'
1030510305+ | 'SO'
1030610306+ | 'SR'
1030710307+ | 'SS'
1030810308+ | 'ST'
1030910309+ | 'SV'
1031010310+ | 'SX'
1031110311+ | 'SY'
1031210312+ | 'SZ'
1031310313+ | 'TC'
1031410314+ | 'TD'
1031510315+ | 'TF'
1031610316+ | 'TG'
1031710317+ | 'TH'
1031810318+ | 'TJ'
1031910319+ | 'TK'
1032010320+ | 'TL'
1032110321+ | 'TM'
1032210322+ | 'TN'
1032310323+ | 'TO'
1032410324+ | 'TR'
1032510325+ | 'TT'
1032610326+ | 'TV'
1032710327+ | 'TW'
1032810328+ | 'TZ'
1032910329+ | 'UA'
1033010330+ | 'UG'
1033110331+ | 'UM'
1033210332+ | 'US'
1033310333+ | 'UY'
1033410334+ | 'UZ'
1033510335+ | 'VA'
1033610336+ | 'VC'
1033710337+ | 'VE'
1033810338+ | 'VG'
1033910339+ | 'VI'
1034010340+ | 'VN'
1034110341+ | 'VU'
1034210342+ | 'WF'
1034310343+ | 'WS'
1034410344+ | 'YE'
1034510345+ | 'YT'
1034610346+ | 'ZA'
1034710347+ | 'ZM'
1034810348+ | 'ZW'
1034910349+/** The 2-letter continent codes Cloudflare uses */
1035010350+declare type ContinentCode = 'AF' | 'AN' | 'AS' | 'EU' | 'NA' | 'OC' | 'SA'
1035110351+type CfProperties<HostMetadata = unknown> =
1035210352+ | IncomingRequestCfProperties<HostMetadata>
1035310353+ | RequestInitCfProperties
1035410354+interface D1Meta {
1035510355+ duration: number
1035610356+ size_after: number
1035710357+ rows_read: number
1035810358+ rows_written: number
1035910359+ last_row_id: number
1036010360+ changed_db: boolean
1036110361+ changes: number
1036210362+ /**
1036310363+ * The region of the database instance that executed the query.
1036410364+ */
1036510365+ served_by_region?: string
1036610366+ /**
1036710367+ * True if-and-only-if the database instance that executed the query was the primary.
1036810368+ */
1036910369+ served_by_primary?: boolean
1037010370+ timings?: {
1037110371+ /**
1037210372+ * The duration of the SQL query execution by the database instance. It doesn't include any network time.
1037310373+ */
1037410374+ sql_duration_ms: number
1037510375+ }
1037610376+ /**
1037710377+ * Number of total attempts to execute the query, due to automatic retries.
1037810378+ * Note: All other fields in the response like `timings` only apply to the last attempt.
1037910379+ */
1038010380+ total_attempts?: number
1038110381+}
1038210382+interface D1Response {
1038310383+ success: true
1038410384+ meta: D1Meta & Record<string, unknown>
1038510385+ error?: never
1038610386+}
1038710387+type D1Result<T = unknown> = D1Response & {
1038810388+ results: T[]
1038910389+}
1039010390+interface D1ExecResult {
1039110391+ count: number
1039210392+ duration: number
1039310393+}
1039410394+type D1SessionConstraint =
1039510395+ // Indicates that the first query should go to the primary, and the rest queries
1039610396+ // using the same D1DatabaseSession will go to any replica that is consistent with
1039710397+ // the bookmark maintained by the session (returned by the first query).
1039810398+ | 'first-primary'
1039910399+ // Indicates that the first query can go anywhere (primary or replica), and the rest queries
1040010400+ // using the same D1DatabaseSession will go to any replica that is consistent with
1040110401+ // the bookmark maintained by the session (returned by the first query).
1040210402+ | 'first-unconstrained'
1040310403+type D1SessionBookmark = string
1040410404+declare abstract class D1Database {
1040510405+ prepare(query: string): D1PreparedStatement
1040610406+ batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>
1040710407+ exec(query: string): Promise<D1ExecResult>
1040810408+ /**
1040910409+ * Creates a new D1 Session anchored at the given constraint or the bookmark.
1041010410+ * All queries executed using the created session will have sequential consistency,
1041110411+ * meaning that all writes done through the session will be visible in subsequent reads.
1041210412+ *
1041310413+ * @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session.
1041410414+ */
1041510415+ withSession(constraintOrBookmark?: D1SessionBookmark | D1SessionConstraint): D1DatabaseSession
1041610416+ /**
1041710417+ * @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases.
1041810418+ */
1041910419+ dump(): Promise<ArrayBuffer>
1042010420+}
1042110421+declare abstract class D1DatabaseSession {
1042210422+ prepare(query: string): D1PreparedStatement
1042310423+ batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>
1042410424+ /**
1042510425+ * @returns The latest session bookmark across all executed queries on the session.
1042610426+ * If no query has been executed yet, `null` is returned.
1042710427+ */
1042810428+ getBookmark(): D1SessionBookmark | null
1042910429+}
1043010430+declare abstract class D1PreparedStatement {
1043110431+ bind(...values: unknown[]): D1PreparedStatement
1043210432+ first<T = unknown>(colName: string): Promise<T | null>
1043310433+ first<T = Record<string, unknown>>(): Promise<T | null>
1043410434+ run<T = Record<string, unknown>>(): Promise<D1Result<T>>
1043510435+ all<T = Record<string, unknown>>(): Promise<D1Result<T>>
1043610436+ raw<T = unknown[]>(options: { columnNames: true }): Promise<[string[], ...T[]]>
1043710437+ raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>
1043810438+}
1043910439+// `Disposable` was added to TypeScript's standard lib types in version 5.2.
1044010440+// To support older TypeScript versions, define an empty `Disposable` interface.
1044110441+// Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
1044210442+// but this will ensure type checking on older versions still passes.
1044310443+// TypeScript's interface merging will ensure our empty interface is effectively
1044410444+// ignored when `Disposable` is included in the standard lib.
1044510445+interface Disposable {}
1044610446+/**
1044710447+ * An email message that can be sent from a Worker.
1044810448+ */
1044910449+interface EmailMessage {
1045010450+ /**
1045110451+ * Envelope From attribute of the email message.
1045210452+ */
1045310453+ readonly from: string
1045410454+ /**
1045510455+ * Envelope To attribute of the email message.
1045610456+ */
1045710457+ readonly to: string
1045810458+}
1045910459+/**
1046010460+ * An email message that is sent to a consumer Worker and can be rejected/forwarded.
1046110461+ */
1046210462+interface ForwardableEmailMessage extends EmailMessage {
1046310463+ /**
1046410464+ * Stream of the email message content.
1046510465+ */
1046610466+ readonly raw: ReadableStream<Uint8Array>
1046710467+ /**
1046810468+ * An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
1046910469+ */
1047010470+ readonly headers: Headers
1047110471+ /**
1047210472+ * Size of the email message content.
1047310473+ */
1047410474+ readonly rawSize: number
1047510475+ /**
1047610476+ * Reject this email message by returning a permanent SMTP error back to the connecting client including the given reason.
1047710477+ * @param reason The reject reason.
1047810478+ * @returns void
1047910479+ */
1048010480+ setReject(reason: string): void
1048110481+ /**
1048210482+ * Forward this email message to a verified destination address of the account.
1048310483+ * @param rcptTo Verified destination address.
1048410484+ * @param headers A [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
1048510485+ * @returns A promise that resolves when the email message is forwarded.
1048610486+ */
1048710487+ forward(rcptTo: string, headers?: Headers): Promise<void>
1048810488+ /**
1048910489+ * Reply to the sender of this email message with a new EmailMessage object.
1049010490+ * @param message The reply message.
1049110491+ * @returns A promise that resolves when the email message is replied.
1049210492+ */
1049310493+ reply(message: EmailMessage): Promise<void>
1049410494+}
1049510495+/**
1049610496+ * A binding that allows a Worker to send email messages.
1049710497+ */
1049810498+interface SendEmail {
1049910499+ send(message: EmailMessage): Promise<void>
1050010500+}
1050110501+declare abstract class EmailEvent extends ExtendableEvent {
1050210502+ readonly message: ForwardableEmailMessage
1050310503+}
1050410504+declare type EmailExportedHandler<Env = unknown> = (
1050510505+ message: ForwardableEmailMessage,
1050610506+ env: Env,
1050710507+ ctx: ExecutionContext,
1050810508+) => void | Promise<void>
1050910509+declare module 'cloudflare:email' {
1051010510+ let _EmailMessage: {
1051110511+ prototype: EmailMessage
1051210512+ new (from: string, to: string, raw: ReadableStream | string): EmailMessage
1051310513+ }
1051410514+ export { _EmailMessage as EmailMessage }
1051510515+}
1051610516+/**
1051710517+ * Hello World binding to serve as an explanatory example. DO NOT USE
1051810518+ */
1051910519+interface HelloWorldBinding {
1052010520+ /**
1052110521+ * Retrieve the current stored value
1052210522+ */
1052310523+ get(): Promise<{
1052410524+ value: string
1052510525+ ms?: number
1052610526+ }>
1052710527+ /**
1052810528+ * Set a new stored value
1052910529+ */
1053010530+ set(value: string): Promise<void>
1053110531+}
1053210532+interface Hyperdrive {
1053310533+ /**
1053410534+ * Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
1053510535+ *
1053610536+ * Calling this method returns an idential socket to if you call
1053710537+ * `connect("host:port")` using the `host` and `port` fields from this object.
1053810538+ * Pick whichever approach works better with your preferred DB client library.
1053910539+ *
1054010540+ * Note that this socket is not yet authenticated -- it's expected that your
1054110541+ * code (or preferably, the client library of your choice) will authenticate
1054210542+ * using the information in this class's readonly fields.
1054310543+ */
1054410544+ connect(): Socket
1054510545+ /**
1054610546+ * A valid DB connection string that can be passed straight into the typical
1054710547+ * client library/driver/ORM. This will typically be the easiest way to use
1054810548+ * Hyperdrive.
1054910549+ */
1055010550+ readonly connectionString: string
1055110551+ /*
1055210552+ * A randomly generated hostname that is only valid within the context of the
1055310553+ * currently running Worker which, when passed into `connect()` function from
1055410554+ * the "cloudflare:sockets" module, will connect to the Hyperdrive instance
1055510555+ * for your database.
1055610556+ */
1055710557+ readonly host: string
1055810558+ /*
1055910559+ * The port that must be paired the the host field when connecting.
1056010560+ */
1056110561+ readonly port: number
1056210562+ /*
1056310563+ * The username to use when authenticating to your database via Hyperdrive.
1056410564+ * Unlike the host and password, this will be the same every time
1056510565+ */
1056610566+ readonly user: string
1056710567+ /*
1056810568+ * The randomly generated password to use when authenticating to your
1056910569+ * database via Hyperdrive. Like the host field, this password is only valid
1057010570+ * within the context of the currently running Worker instance from which
1057110571+ * it's read.
1057210572+ */
1057310573+ readonly password: string
1057410574+ /*
1057510575+ * The name of the database to connect to.
1057610576+ */
1057710577+ readonly database: string
1057810578+}
1057910579+// Copyright (c) 2024 Cloudflare, Inc.
1058010580+// Licensed under the Apache 2.0 license found in the LICENSE file or at:
1058110581+// https://opensource.org/licenses/Apache-2.0
1058210582+type ImageInfoResponse =
1058310583+ | {
1058410584+ format: 'image/svg+xml'
1058510585+ }
1058610586+ | {
1058710587+ format: string
1058810588+ fileSize: number
1058910589+ width: number
1059010590+ height: number
1059110591+ }
1059210592+type ImageTransform = {
1059310593+ width?: number
1059410594+ height?: number
1059510595+ background?: string
1059610596+ blur?: number
1059710597+ border?:
1059810598+ | {
1059910599+ color?: string
1060010600+ width?: number
1060110601+ }
1060210602+ | {
1060310603+ top?: number
1060410604+ bottom?: number
1060510605+ left?: number
1060610606+ right?: number
1060710607+ }
1060810608+ brightness?: number
1060910609+ contrast?: number
1061010610+ fit?: 'scale-down' | 'contain' | 'pad' | 'squeeze' | 'cover' | 'crop'
1061110611+ flip?: 'h' | 'v' | 'hv'
1061210612+ gamma?: number
1061310613+ segment?: 'foreground'
1061410614+ gravity?:
1061510615+ | 'face'
1061610616+ | 'left'
1061710617+ | 'right'
1061810618+ | 'top'
1061910619+ | 'bottom'
1062010620+ | 'center'
1062110621+ | 'auto'
1062210622+ | 'entropy'
1062310623+ | {
1062410624+ x?: number
1062510625+ y?: number
1062610626+ mode: 'remainder' | 'box-center'
1062710627+ }
1062810628+ rotate?: 0 | 90 | 180 | 270
1062910629+ saturation?: number
1063010630+ sharpen?: number
1063110631+ trim?:
1063210632+ | 'border'
1063310633+ | {
1063410634+ top?: number
1063510635+ bottom?: number
1063610636+ left?: number
1063710637+ right?: number
1063810638+ width?: number
1063910639+ height?: number
1064010640+ border?:
1064110641+ | boolean
1064210642+ | {
1064310643+ color?: string
1064410644+ tolerance?: number
1064510645+ keep?: number
1064610646+ }
1064710647+ }
1064810648+}
1064910649+type ImageDrawOptions = {
1065010650+ opacity?: number
1065110651+ repeat?: boolean | string
1065210652+ top?: number
1065310653+ left?: number
1065410654+ bottom?: number
1065510655+ right?: number
1065610656+}
1065710657+type ImageInputOptions = {
1065810658+ encoding?: 'base64'
1065910659+}
1066010660+type ImageOutputOptions = {
1066110661+ format: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/avif' | 'rgb' | 'rgba'
1066210662+ quality?: number
1066310663+ background?: string
1066410664+ anim?: boolean
1066510665+}
1066610666+interface ImagesBinding {
1066710667+ /**
1066810668+ * Get image metadata (type, width and height)
1066910669+ * @throws {@link ImagesError} with code 9412 if input is not an image
1067010670+ * @param stream The image bytes
1067110671+ */
1067210672+ info(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): Promise<ImageInfoResponse>
1067310673+ /**
1067410674+ * Begin applying a series of transformations to an image
1067510675+ * @param stream The image bytes
1067610676+ * @returns A transform handle
1067710677+ */
1067810678+ input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer
1067910679+}
1068010680+interface ImageTransformer {
1068110681+ /**
1068210682+ * Apply transform next, returning a transform handle.
1068310683+ * You can then apply more transformations, draw, or retrieve the output.
1068410684+ * @param transform
1068510685+ */
1068610686+ transform(transform: ImageTransform): ImageTransformer
1068710687+ /**
1068810688+ * Draw an image on this transformer, returning a transform handle.
1068910689+ * You can then apply more transformations, draw, or retrieve the output.
1069010690+ * @param image The image (or transformer that will give the image) to draw
1069110691+ * @param options The options configuring how to draw the image
1069210692+ */
1069310693+ draw(
1069410694+ image: ReadableStream<Uint8Array> | ImageTransformer,
1069510695+ options?: ImageDrawOptions,
1069610696+ ): ImageTransformer
1069710697+ /**
1069810698+ * Retrieve the image that results from applying the transforms to the
1069910699+ * provided input
1070010700+ * @param options Options that apply to the output e.g. output format
1070110701+ */
1070210702+ output(options: ImageOutputOptions): Promise<ImageTransformationResult>
1070310703+}
1070410704+type ImageTransformationOutputOptions = {
1070510705+ encoding?: 'base64'
1070610706+}
1070710707+interface ImageTransformationResult {
1070810708+ /**
1070910709+ * The image as a response, ready to store in cache or return to users
1071010710+ */
1071110711+ response(): Response
1071210712+ /**
1071310713+ * The content type of the returned image
1071410714+ */
1071510715+ contentType(): string
1071610716+ /**
1071710717+ * The bytes of the response
1071810718+ */
1071910719+ image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array>
1072010720+}
1072110721+interface ImagesError extends Error {
1072210722+ readonly code: number
1072310723+ readonly message: string
1072410724+ readonly stack?: string
1072510725+}
1072610726+/**
1072710727+ * Media binding for transforming media streams.
1072810728+ * Provides the entry point for media transformation operations.
1072910729+ */
1073010730+interface MediaBinding {
1073110731+ /**
1073210732+ * Creates a media transformer from an input stream.
1073310733+ * @param media - The input media bytes
1073410734+ * @returns A MediaTransformer instance for applying transformations
1073510735+ */
1073610736+ input(media: ReadableStream<Uint8Array>): MediaTransformer
1073710737+}
1073810738+/**
1073910739+ * Media transformer for applying transformation operations to media content.
1074010740+ * Handles sizing, fitting, and other input transformation parameters.
1074110741+ */
1074210742+interface MediaTransformer {
1074310743+ /**
1074410744+ * Applies transformation options to the media content.
1074510745+ * @param transform - Configuration for how the media should be transformed
1074610746+ * @returns A generator for producing the transformed media output
1074710747+ */
1074810748+ transform(transform: MediaTransformationInputOptions): MediaTransformationGenerator
1074910749+}
1075010750+/**
1075110751+ * Generator for producing media transformation results.
1075210752+ * Configures the output format and parameters for the transformed media.
1075310753+ */
1075410754+interface MediaTransformationGenerator {
1075510755+ /**
1075610756+ * Generates the final media output with specified options.
1075710757+ * @param output - Configuration for the output format and parameters
1075810758+ * @returns The final transformation result containing the transformed media
1075910759+ */
1076010760+ output(output: MediaTransformationOutputOptions): MediaTransformationResult
1076110761+}
1076210762+/**
1076310763+ * Result of a media transformation operation.
1076410764+ * Provides multiple ways to access the transformed media content.
1076510765+ */
1076610766+interface MediaTransformationResult {
1076710767+ /**
1076810768+ * Returns the transformed media as a readable stream of bytes.
1076910769+ * @returns A stream containing the transformed media data
1077010770+ */
1077110771+ media(): ReadableStream<Uint8Array>
1077210772+ /**
1077310773+ * Returns the transformed media as an HTTP response object.
1077410774+ * @returns The transformed media as a Response, ready to store in cache or return to users
1077510775+ */
1077610776+ response(): Response
1077710777+ /**
1077810778+ * Returns the MIME type of the transformed media.
1077910779+ * @returns The content type string (e.g., 'image/jpeg', 'video/mp4')
1078010780+ */
1078110781+ contentType(): string
1078210782+}
1078310783+/**
1078410784+ * Configuration options for transforming media input.
1078510785+ * Controls how the media should be resized and fitted.
1078610786+ */
1078710787+type MediaTransformationInputOptions = {
1078810788+ /** How the media should be resized to fit the specified dimensions */
1078910789+ fit?: 'contain' | 'cover' | 'scale-down'
1079010790+ /** Target width in pixels */
1079110791+ width?: number
1079210792+ /** Target height in pixels */
1079310793+ height?: number
1079410794+}
1079510795+/**
1079610796+ * Configuration options for Media Transformations output.
1079710797+ * Controls the format, timing, and type of the generated output.
1079810798+ */
1079910799+type MediaTransformationOutputOptions = {
1080010800+ /**
1080110801+ * Output mode determining the type of media to generate
1080210802+ */
1080310803+ mode?: 'video' | 'spritesheet' | 'frame' | 'audio'
1080410804+ /** Whether to include audio in the output */
1080510805+ audio?: boolean
1080610806+ /**
1080710807+ * Starting timestamp for frame extraction or start time for clips. (e.g. '2s').
1080810808+ */
1080910809+ time?: string
1081010810+ /**
1081110811+ * Duration for video clips, audio extraction, and spritesheet generation (e.g. '5s').
1081210812+ */
1081310813+ duration?: string
1081410814+ /**
1081510815+ * Number of frames in the spritesheet.
1081610816+ */
1081710817+ imageCount?: number
1081810818+ /**
1081910819+ * Output format for the generated media.
1082010820+ */
1082110821+ format?: 'jpg' | 'png' | 'm4a'
1082210822+}
1082310823+/**
1082410824+ * Error object for media transformation operations.
1082510825+ * Extends the standard Error interface with additional media-specific information.
1082610826+ */
1082710827+interface MediaError extends Error {
1082810828+ readonly code: number
1082910829+ readonly message: string
1083010830+ readonly stack?: string
1083110831+}
1083210832+declare module 'cloudflare:node' {
1083310833+ interface NodeStyleServer {
1083410834+ listen(...args: unknown[]): this
1083510835+ address(): {
1083610836+ port?: number | null | undefined
1083710837+ }
1083810838+ }
1083910839+ export function httpServerHandler(port: number): ExportedHandler
1084010840+ export function httpServerHandler(options: { port: number }): ExportedHandler
1084110841+ export function httpServerHandler(server: NodeStyleServer): ExportedHandler
1084210842+}
1084310843+type Params<P extends string = any> = Record<P, string | string[]>
1084410844+type EventContext<Env, P extends string, Data> = {
1084510845+ request: Request<unknown, IncomingRequestCfProperties<unknown>>
1084610846+ functionPath: string
1084710847+ waitUntil: (promise: Promise<any>) => void
1084810848+ passThroughOnException: () => void
1084910849+ next: (input?: Request | string, init?: RequestInit) => Promise<Response>
1085010850+ env: Env & {
1085110851+ ASSETS: {
1085210852+ fetch: typeof fetch
1085310853+ }
1085410854+ }
1085510855+ params: Params<P>
1085610856+ data: Data
1085710857+}
1085810858+type PagesFunction<
1085910859+ Env = unknown,
1086010860+ Params extends string = any,
1086110861+ Data extends Record<string, unknown> = Record<string, unknown>,
1086210862+> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>
1086310863+type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
1086410864+ request: Request<unknown, IncomingRequestCfProperties<unknown>>
1086510865+ functionPath: string
1086610866+ waitUntil: (promise: Promise<any>) => void
1086710867+ passThroughOnException: () => void
1086810868+ next: (input?: Request | string, init?: RequestInit) => Promise<Response>
1086910869+ env: Env & {
1087010870+ ASSETS: {
1087110871+ fetch: typeof fetch
1087210872+ }
1087310873+ }
1087410874+ params: Params<P>
1087510875+ data: Data
1087610876+ pluginArgs: PluginArgs
1087710877+}
1087810878+type PagesPluginFunction<
1087910879+ Env = unknown,
1088010880+ Params extends string = any,
1088110881+ Data extends Record<string, unknown> = Record<string, unknown>,
1088210882+ PluginArgs = unknown,
1088310883+> = (context: EventPluginContext<Env, Params, Data, PluginArgs>) => Response | Promise<Response>
1088410884+declare module 'assets:*' {
1088510885+ export const onRequest: PagesFunction
1088610886+}
1088710887+// Copyright (c) 2022-2023 Cloudflare, Inc.
1088810888+// Licensed under the Apache 2.0 license found in the LICENSE file or at:
1088910889+// https://opensource.org/licenses/Apache-2.0
1089010890+declare module 'cloudflare:pipelines' {
1089110891+ export abstract class PipelineTransformationEntrypoint<
1089210892+ Env = unknown,
1089310893+ I extends PipelineRecord = PipelineRecord,
1089410894+ O extends PipelineRecord = PipelineRecord,
1089510895+ > {
1089610896+ protected env: Env
1089710897+ protected ctx: ExecutionContext
1089810898+ constructor(ctx: ExecutionContext, env: Env)
1089910899+ /**
1090010900+ * run recieves an array of PipelineRecord which can be
1090110901+ * transformed and returned to the pipeline
1090210902+ * @param records Incoming records from the pipeline to be transformed
1090310903+ * @param metadata Information about the specific pipeline calling the transformation entrypoint
1090410904+ * @returns A promise containing the transformed PipelineRecord array
1090510905+ */
1090610906+ public run(records: I[], metadata: PipelineBatchMetadata): Promise<O[]>
1090710907+ }
1090810908+ export type PipelineRecord = Record<string, unknown>
1090910909+ export type PipelineBatchMetadata = {
1091010910+ pipelineId: string
1091110911+ pipelineName: string
1091210912+ }
1091310913+ export interface Pipeline<T extends PipelineRecord = PipelineRecord> {
1091410914+ /**
1091510915+ * The Pipeline interface represents the type of a binding to a Pipeline
1091610916+ *
1091710917+ * @param records The records to send to the pipeline
1091810918+ */
1091910919+ send(records: T[]): Promise<void>
1092010920+ }
1092110921+}
1092210922+// PubSubMessage represents an incoming PubSub message.
1092310923+// The message includes metadata about the broker, the client, and the payload
1092410924+// itself.
1092510925+// https://developers.cloudflare.com/pub-sub/
1092610926+interface PubSubMessage {
1092710927+ // Message ID
1092810928+ readonly mid: number
1092910929+ // MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT
1093010930+ readonly broker: string
1093110931+ // The MQTT topic the message was sent on.
1093210932+ readonly topic: string
1093310933+ // The client ID of the client that published this message.
1093410934+ readonly clientId: string
1093510935+ // The unique identifier (JWT ID) used by the client to authenticate, if token
1093610936+ // auth was used.
1093710937+ readonly jti?: string
1093810938+ // A Unix timestamp (seconds from Jan 1, 1970), set when the Pub/Sub Broker
1093910939+ // received the message from the client.
1094010940+ readonly receivedAt: number
1094110941+ // An (optional) string with the MIME type of the payload, if set by the
1094210942+ // client.
1094310943+ readonly contentType: string
1094410944+ // Set to 1 when the payload is a UTF-8 string
1094510945+ // https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901063
1094610946+ readonly payloadFormatIndicator: number
1094710947+ // Pub/Sub (MQTT) payloads can be UTF-8 strings, or byte arrays.
1094810948+ // You can use payloadFormatIndicator to inspect this before decoding.
1094910949+ payload: string | Uint8Array
1095010950+}
1095110951+// JsonWebKey extended by kid parameter
1095210952+interface JsonWebKeyWithKid extends JsonWebKey {
1095310953+ // Key Identifier of the JWK
1095410954+ readonly kid: string
1095510955+}
1095610956+interface RateLimitOptions {
1095710957+ key: string
1095810958+}
1095910959+interface RateLimitOutcome {
1096010960+ success: boolean
1096110961+}
1096210962+interface RateLimit {
1096310963+ /**
1096410964+ * Rate limit a request based on the provided options.
1096510965+ * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
1096610966+ * @returns A promise that resolves with the outcome of the rate limit.
1096710967+ */
1096810968+ limit(options: RateLimitOptions): Promise<RateLimitOutcome>
1096910969+}
1097010970+// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
1097110971+// to referenced by `Fetcher`. This is included in the "importable" version of the types which
1097210972+// strips all `module` blocks.
1097310973+declare namespace Rpc {
1097410974+ // Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
1097510975+ // TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
1097610976+ // For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
1097710977+ // accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
1097810978+ export const __RPC_STUB_BRAND: '__RPC_STUB_BRAND'
1097910979+ export const __RPC_TARGET_BRAND: '__RPC_TARGET_BRAND'
1098010980+ export const __WORKER_ENTRYPOINT_BRAND: '__WORKER_ENTRYPOINT_BRAND'
1098110981+ export const __DURABLE_OBJECT_BRAND: '__DURABLE_OBJECT_BRAND'
1098210982+ export const __WORKFLOW_ENTRYPOINT_BRAND: '__WORKFLOW_ENTRYPOINT_BRAND'
1098310983+ export interface RpcTargetBranded {
1098410984+ [__RPC_TARGET_BRAND]: never
1098510985+ }
1098610986+ export interface WorkerEntrypointBranded {
1098710987+ [__WORKER_ENTRYPOINT_BRAND]: never
1098810988+ }
1098910989+ export interface DurableObjectBranded {
1099010990+ [__DURABLE_OBJECT_BRAND]: never
1099110991+ }
1099210992+ export interface WorkflowEntrypointBranded {
1099310993+ [__WORKFLOW_ENTRYPOINT_BRAND]: never
1099410994+ }
1099510995+ export type EntrypointBranded =
1099610996+ | WorkerEntrypointBranded
1099710997+ | DurableObjectBranded
1099810998+ | WorkflowEntrypointBranded
1099910999+ // Types that can be used through `Stub`s
1100011000+ export type Stubable = RpcTargetBranded | ((...args: any[]) => any)
1100111001+ // Types that can be passed over RPC
1100211002+ // The reason for using a generic type here is to build a serializable subset of structured
1100311003+ // cloneable composite types. This allows types defined with the "interface" keyword to pass the
1100411004+ // serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
1100511005+ type Serializable<T> =
1100611006+ // Structured cloneables
1100711007+ | BaseType
1100811008+ // Structured cloneable composites
1100911009+ | Map<
1101011010+ T extends Map<infer U, unknown> ? Serializable<U> : never,
1101111011+ T extends Map<unknown, infer U> ? Serializable<U> : never
1101211012+ >
1101311013+ | Set<T extends Set<infer U> ? Serializable<U> : never>
1101411014+ | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
1101511015+ | {
1101611016+ [K in keyof T]: K extends number | string ? Serializable<T[K]> : never
1101711017+ }
1101811018+ // Special types
1101911019+ | Stub<Stubable>
1102011020+ // Serialized as stubs, see `Stubify`
1102111021+ | Stubable
1102211022+ // Base type for all RPC stubs, including common memory management methods.
1102311023+ // `T` is used as a marker type for unwrapping `Stub`s later.
1102411024+ interface StubBase<T extends Stubable> extends Disposable {
1102511025+ [__RPC_STUB_BRAND]: T
1102611026+ dup(): this
1102711027+ }
1102811028+ export type Stub<T extends Stubable> = Provider<T> & StubBase<T>
1102911029+ // This represents all the types that can be sent as-is over an RPC boundary
1103011030+ type BaseType =
1103111031+ | void
1103211032+ | undefined
1103311033+ | null
1103411034+ | boolean
1103511035+ | number
1103611036+ | bigint
1103711037+ | string
1103811038+ | TypedArray
1103911039+ | ArrayBuffer
1104011040+ | DataView
1104111041+ | Date
1104211042+ | Error
1104311043+ | RegExp
1104411044+ | ReadableStream<Uint8Array>
1104511045+ | WritableStream<Uint8Array>
1104611046+ | Request
1104711047+ | Response
1104811048+ | Headers
1104911049+ // Recursively rewrite all `Stubable` types with `Stub`s
1105011050+ // prettier-ignore
1105111051+ type 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 {
1105211052+ [key: string | number]: any;
1105311053+ } ? {
1105411054+ [K in keyof T]: Stubify<T[K]>;
1105511055+ } : T;
1105611056+ // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
1105711057+ // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
1105811058+ // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
1105911059+ // prettier-ignore
1106011060+ type 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 {
1106111061+ [key: string | number]: unknown;
1106211062+ } ? {
1106311063+ [K in keyof T]: Unstubify<T[K]>;
1106411064+ } : T;
1106511065+ type UnstubifyAll<A extends any[]> = {
1106611066+ [I in keyof A]: Unstubify<A[I]>
1106711067+ }
1106811068+ // Utility type for adding `Provider`/`Disposable`s to `object` types only.
1106911069+ // Note `unknown & T` is equivalent to `T`.
1107011070+ type MaybeProvider<T> = T extends object ? Provider<T> : unknown
1107111071+ type MaybeDisposable<T> = T extends object ? Disposable : unknown
1107211072+ // Type for method return or property on an RPC interface.
1107311073+ // - Stubable types are replaced by stubs.
1107411074+ // - Serializable types are passed by value, with stubable types replaced by stubs
1107511075+ // and a top-level `Disposer`.
1107611076+ // Everything else can't be passed over PRC.
1107711077+ // Technically, we use custom thenables here, but they quack like `Promise`s.
1107811078+ // Intersecting with `(Maybe)Provider` allows pipelining.
1107911079+ // prettier-ignore
1108011080+ type Result<R> = R extends Stubable ? Promise<Stub<R>> & Provider<R> : R extends Serializable<R> ? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R> : never;
1108111081+ // Type for method or property on an RPC interface.
1108211082+ // For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
1108311083+ // Unwrapping `Stub`s allows calling with `Stubable` arguments.
1108411084+ // For properties, rewrite types to be `Result`s.
1108511085+ // In each case, unwrap `Promise`s.
1108611086+ type MethodOrProperty<V> = V extends (...args: infer P) => infer R
1108711087+ ? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
1108811088+ : Result<Awaited<V>>
1108911089+ // Type for the callable part of an `Provider` if `T` is callable.
1109011090+ // This is intersected with methods/properties.
1109111091+ type MaybeCallableProvider<T> = T extends (...args: any[]) => any ? MethodOrProperty<T> : unknown
1109211092+ // Base type for all other types providing RPC-like interfaces.
1109311093+ // Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
1109411094+ // `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
1109511095+ export type Provider<
1109611096+ T extends object,
1109711097+ Reserved extends string = never,
1109811098+ > = MaybeCallableProvider<T> &
1109911099+ Pick<
1110011100+ {
1110111101+ [K in keyof T]: MethodOrProperty<T[K]>
1110211102+ },
1110311103+ Exclude<keyof T, Reserved | symbol | keyof StubBase<never>>
1110411104+ >
1110511105+}
1110611106+declare namespace Cloudflare {
1110711107+ // Type of `env`.
1110811108+ //
1110911109+ // The specific project can extend `Env` by redeclaring it in project-specific files. Typescript
1111011110+ // will merge all declarations.
1111111111+ //
1111211112+ // You can use `wrangler types` to generate the `Env` type automatically.
1111311113+ interface Env {}
1111411114+ // Project-specific parameters used to inform types.
1111511115+ //
1111611116+ // This interface is, again, intended to be declared in project-specific files, and then that
1111711117+ // declaration will be merged with this one.
1111811118+ //
1111911119+ // A project should have a declaration like this:
1112011120+ //
1112111121+ // interface GlobalProps {
1112211122+ // // Declares the main module's exports. Used to populate Cloudflare.Exports aka the type
1112311123+ // // of `ctx.exports`.
1112411124+ // mainModule: typeof import("my-main-module");
1112511125+ //
1112611126+ // // Declares which of the main module's exports are configured with durable storage, and
1112711127+ // // thus should behave as Durable Object namsepace bindings.
1112811128+ // durableNamespaces: "MyDurableObject" | "AnotherDurableObject";
1112911129+ // }
1113011130+ //
1113111131+ // You can use `wrangler types` to generate `GlobalProps` automatically.
1113211132+ interface GlobalProps {}
1113311133+ // Evaluates to the type of a property in GlobalProps, defaulting to `Default` if it is not
1113411134+ // present.
1113511135+ type GlobalProp<K extends string, Default> = K extends keyof GlobalProps
1113611136+ ? GlobalProps[K]
1113711137+ : Default
1113811138+ // The type of the program's main module exports, if known. Requires `GlobalProps` to declare the
1113911139+ // `mainModule` property.
1114011140+ type MainModule = GlobalProp<'mainModule', {}>
1114111141+ // The type of ctx.exports, which contains loopback bindings for all top-level exports.
1114211142+ type Exports = {
1114311143+ [K in keyof MainModule]: LoopbackForExport<MainModule[K]> &
1114411144+ // If the export is listed in `durableNamespaces`, then it is also a
1114511145+ // DurableObjectNamespace.
1114611146+ (K extends GlobalProp<'durableNamespaces', never>
1114711147+ ? MainModule[K] extends new (...args: any[]) => infer DoInstance
1114811148+ ? DoInstance extends Rpc.DurableObjectBranded
1114911149+ ? DurableObjectNamespace<DoInstance>
1115011150+ : DurableObjectNamespace<undefined>
1115111151+ : DurableObjectNamespace<undefined>
1115211152+ : {})
1115311153+ }
1115411154+}
1115511155+declare namespace CloudflareWorkersModule {
1115611156+ export type RpcStub<T extends Rpc.Stubable> = Rpc.Stub<T>
1115711157+ export const RpcStub: {
1115811158+ new <T extends Rpc.Stubable>(value: T): Rpc.Stub<T>
1115911159+ }
1116011160+ export abstract class RpcTarget implements Rpc.RpcTargetBranded {
1116111161+ [Rpc.__RPC_TARGET_BRAND]: never
1116211162+ }
1116311163+ // `protected` fields don't appear in `keyof`s, so can't be accessed over RPC
1116411164+ export abstract class WorkerEntrypoint<Env = Cloudflare.Env, Props = {}>
1116511165+ implements Rpc.WorkerEntrypointBranded
1116611166+ {
1116711167+ [Rpc.__WORKER_ENTRYPOINT_BRAND]: never
1116811168+ protected ctx: ExecutionContext<Props>
1116911169+ protected env: Env
1117011170+ constructor(ctx: ExecutionContext, env: Env)
1117111171+ email?(message: ForwardableEmailMessage): void | Promise<void>
1117211172+ fetch?(request: Request): Response | Promise<Response>
1117311173+ queue?(batch: MessageBatch<unknown>): void | Promise<void>
1117411174+ scheduled?(controller: ScheduledController): void | Promise<void>
1117511175+ tail?(events: TraceItem[]): void | Promise<void>
1117611176+ tailStream?(
1117711177+ event: TailStream.TailEvent<TailStream.Onset>,
1117811178+ ): TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>
1117911179+ test?(controller: TestController): void | Promise<void>
1118011180+ trace?(traces: TraceItem[]): void | Promise<void>
1118111181+ }
1118211182+ export abstract class DurableObject<Env = Cloudflare.Env, Props = {}>
1118311183+ implements Rpc.DurableObjectBranded
1118411184+ {
1118511185+ [Rpc.__DURABLE_OBJECT_BRAND]: never
1118611186+ protected ctx: DurableObjectState<Props>
1118711187+ protected env: Env
1118811188+ constructor(ctx: DurableObjectState, env: Env)
1118911189+ alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>
1119011190+ fetch?(request: Request): Response | Promise<Response>
1119111191+ webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>
1119211192+ webSocketClose?(
1119311193+ ws: WebSocket,
1119411194+ code: number,
1119511195+ reason: string,
1119611196+ wasClean: boolean,
1119711197+ ): void | Promise<void>
1119811198+ webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>
1119911199+ }
1120011200+ export type WorkflowDurationLabel =
1120111201+ | 'second'
1120211202+ | 'minute'
1120311203+ | 'hour'
1120411204+ | 'day'
1120511205+ | 'week'
1120611206+ | 'month'
1120711207+ | 'year'
1120811208+ export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number
1120911209+ export type WorkflowDelayDuration = WorkflowSleepDuration
1121011210+ export type WorkflowTimeoutDuration = WorkflowSleepDuration
1121111211+ export type WorkflowRetentionDuration = WorkflowSleepDuration
1121211212+ export type WorkflowBackoff = 'constant' | 'linear' | 'exponential'
1121311213+ export type WorkflowStepConfig = {
1121411214+ retries?: {
1121511215+ limit: number
1121611216+ delay: WorkflowDelayDuration | number
1121711217+ backoff?: WorkflowBackoff
1121811218+ }
1121911219+ timeout?: WorkflowTimeoutDuration | number
1122011220+ }
1122111221+ export type WorkflowEvent<T> = {
1122211222+ payload: Readonly<T>
1122311223+ timestamp: Date
1122411224+ instanceId: string
1122511225+ }
1122611226+ export type WorkflowStepEvent<T> = {
1122711227+ payload: Readonly<T>
1122811228+ timestamp: Date
1122911229+ type: string
1123011230+ }
1123111231+ export abstract class WorkflowStep {
1123211232+ do<T extends Rpc.Serializable<T>>(name: string, callback: () => Promise<T>): Promise<T>
1123311233+ do<T extends Rpc.Serializable<T>>(
1123411234+ name: string,
1123511235+ config: WorkflowStepConfig,
1123611236+ callback: () => Promise<T>,
1123711237+ ): Promise<T>
1123811238+ sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>
1123911239+ sleepUntil: (name: string, timestamp: Date | number) => Promise<void>
1124011240+ waitForEvent<T extends Rpc.Serializable<T>>(
1124111241+ name: string,
1124211242+ options: {
1124311243+ type: string
1124411244+ timeout?: WorkflowTimeoutDuration | number
1124511245+ },
1124611246+ ): Promise<WorkflowStepEvent<T>>
1124711247+ }
1124811248+ export abstract class WorkflowEntrypoint<
1124911249+ Env = unknown,
1125011250+ T extends Rpc.Serializable<T> | unknown = unknown,
1125111251+ >
1125211252+ implements Rpc.WorkflowEntrypointBranded
1125311253+ {
1125411254+ [Rpc.__WORKFLOW_ENTRYPOINT_BRAND]: never
1125511255+ protected ctx: ExecutionContext
1125611256+ protected env: Env
1125711257+ constructor(ctx: ExecutionContext, env: Env)
1125811258+ run(event: Readonly<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>
1125911259+ }
1126011260+ export function waitUntil(promise: Promise<unknown>): void
1126111261+ export function withEnv(newEnv: unknown, fn: () => unknown): unknown
1126211262+ export function withExports(newExports: unknown, fn: () => unknown): unknown
1126311263+ export function withEnvAndExports(
1126411264+ newEnv: unknown,
1126511265+ newExports: unknown,
1126611266+ fn: () => unknown,
1126711267+ ): unknown
1126811268+ export const env: Cloudflare.Env
1126911269+ export const exports: Cloudflare.Exports
1127011270+}
1127111271+declare module 'cloudflare:workers' {
1127211272+ export = CloudflareWorkersModule
1127311273+}
1127411274+interface SecretsStoreSecret {
1127511275+ /**
1127611276+ * Get a secret from the Secrets Store, returning a string of the secret value
1127711277+ * if it exists, or throws an error if it does not exist
1127811278+ */
1127911279+ get(): Promise<string>
1128011280+}
1128111281+declare module 'cloudflare:sockets' {
1128211282+ function _connect(address: string | SocketAddress, options?: SocketOptions): Socket
1128311283+ export { _connect as connect }
1128411284+}
1128511285+type MarkdownDocument = {
1128611286+ name: string
1128711287+ blob: Blob
1128811288+}
1128911289+type ConversionResponse =
1129011290+ | {
1129111291+ name: string
1129211292+ mimeType: string
1129311293+ format: 'markdown'
1129411294+ tokens: number
1129511295+ data: string
1129611296+ }
1129711297+ | {
1129811298+ name: string
1129911299+ mimeType: string
1130011300+ format: 'error'
1130111301+ error: string
1130211302+ }
1130311303+type ImageConversionOptions = {
1130411304+ descriptionLanguage?: 'en' | 'es' | 'fr' | 'it' | 'pt' | 'de'
1130511305+}
1130611306+type EmbeddedImageConversionOptions = ImageConversionOptions & {
1130711307+ convert?: boolean
1130811308+ maxConvertedImages?: number
1130911309+}
1131011310+type ConversionOptions = {
1131111311+ html?: {
1131211312+ images?: EmbeddedImageConversionOptions & {
1131311313+ convertOGImage?: boolean
1131411314+ }
1131511315+ }
1131611316+ docx?: {
1131711317+ images?: EmbeddedImageConversionOptions
1131811318+ }
1131911319+ image?: ImageConversionOptions
1132011320+ pdf?: {
1132111321+ images?: EmbeddedImageConversionOptions
1132211322+ metadata?: boolean
1132311323+ }
1132411324+}
1132511325+type ConversionRequestOptions = {
1132611326+ gateway?: GatewayOptions
1132711327+ extraHeaders?: object
1132811328+ conversionOptions?: ConversionOptions
1132911329+}
1133011330+type SupportedFileFormat = {
1133111331+ mimeType: string
1133211332+ extension: string
1133311333+}
1133411334+declare abstract class ToMarkdownService {
1133511335+ transform(
1133611336+ files: MarkdownDocument[],
1133711337+ options?: ConversionRequestOptions,
1133811338+ ): Promise<ConversionResponse[]>
1133911339+ transform(
1134011340+ files: MarkdownDocument,
1134111341+ options?: ConversionRequestOptions,
1134211342+ ): Promise<ConversionResponse>
1134311343+ supported(): Promise<SupportedFileFormat[]>
1134411344+}
1134511345+declare namespace TailStream {
1134611346+ interface Header {
1134711347+ readonly name: string
1134811348+ readonly value: string
1134911349+ }
1135011350+ interface FetchEventInfo {
1135111351+ readonly type: 'fetch'
1135211352+ readonly method: string
1135311353+ readonly url: string
1135411354+ readonly cfJson?: object
1135511355+ readonly headers: Header[]
1135611356+ }
1135711357+ interface JsRpcEventInfo {
1135811358+ readonly type: 'jsrpc'
1135911359+ }
1136011360+ interface ScheduledEventInfo {
1136111361+ readonly type: 'scheduled'
1136211362+ readonly scheduledTime: Date
1136311363+ readonly cron: string
1136411364+ }
1136511365+ interface AlarmEventInfo {
1136611366+ readonly type: 'alarm'
1136711367+ readonly scheduledTime: Date
1136811368+ }
1136911369+ interface QueueEventInfo {
1137011370+ readonly type: 'queue'
1137111371+ readonly queueName: string
1137211372+ readonly batchSize: number
1137311373+ }
1137411374+ interface EmailEventInfo {
1137511375+ readonly type: 'email'
1137611376+ readonly mailFrom: string
1137711377+ readonly rcptTo: string
1137811378+ readonly rawSize: number
1137911379+ }
1138011380+ interface TraceEventInfo {
1138111381+ readonly type: 'trace'
1138211382+ readonly traces: (string | null)[]
1138311383+ }
1138411384+ interface HibernatableWebSocketEventInfoMessage {
1138511385+ readonly type: 'message'
1138611386+ }
1138711387+ interface HibernatableWebSocketEventInfoError {
1138811388+ readonly type: 'error'
1138911389+ }
1139011390+ interface HibernatableWebSocketEventInfoClose {
1139111391+ readonly type: 'close'
1139211392+ readonly code: number
1139311393+ readonly wasClean: boolean
1139411394+ }
1139511395+ interface HibernatableWebSocketEventInfo {
1139611396+ readonly type: 'hibernatableWebSocket'
1139711397+ readonly info:
1139811398+ | HibernatableWebSocketEventInfoClose
1139911399+ | HibernatableWebSocketEventInfoError
1140011400+ | HibernatableWebSocketEventInfoMessage
1140111401+ }
1140211402+ interface CustomEventInfo {
1140311403+ readonly type: 'custom'
1140411404+ }
1140511405+ interface FetchResponseInfo {
1140611406+ readonly type: 'fetch'
1140711407+ readonly statusCode: number
1140811408+ }
1140911409+ type EventOutcome =
1141011410+ | 'ok'
1141111411+ | 'canceled'
1141211412+ | 'exception'
1141311413+ | 'unknown'
1141411414+ | 'killSwitch'
1141511415+ | 'daemonDown'
1141611416+ | 'exceededCpu'
1141711417+ | 'exceededMemory'
1141811418+ | 'loadShed'
1141911419+ | 'responseStreamDisconnected'
1142011420+ | 'scriptNotFound'
1142111421+ interface ScriptVersion {
1142211422+ readonly id: string
1142311423+ readonly tag?: string
1142411424+ readonly message?: string
1142511425+ }
1142611426+ interface Onset {
1142711427+ readonly type: 'onset'
1142811428+ readonly attributes: Attribute[]
1142911429+ // id for the span being opened by this Onset event.
1143011430+ readonly spanId: string
1143111431+ readonly dispatchNamespace?: string
1143211432+ readonly entrypoint?: string
1143311433+ readonly executionModel: string
1143411434+ readonly scriptName?: string
1143511435+ readonly scriptTags?: string[]
1143611436+ readonly scriptVersion?: ScriptVersion
1143711437+ readonly info:
1143811438+ | FetchEventInfo
1143911439+ | JsRpcEventInfo
1144011440+ | ScheduledEventInfo
1144111441+ | AlarmEventInfo
1144211442+ | QueueEventInfo
1144311443+ | EmailEventInfo
1144411444+ | TraceEventInfo
1144511445+ | HibernatableWebSocketEventInfo
1144611446+ | CustomEventInfo
1144711447+ }
1144811448+ interface Outcome {
1144911449+ readonly type: 'outcome'
1145011450+ readonly outcome: EventOutcome
1145111451+ readonly cpuTime: number
1145211452+ readonly wallTime: number
1145311453+ }
1145411454+ interface SpanOpen {
1145511455+ readonly type: 'spanOpen'
1145611456+ readonly name: string
1145711457+ // id for the span being opened by this SpanOpen event.
1145811458+ readonly spanId: string
1145911459+ readonly info?: FetchEventInfo | JsRpcEventInfo | Attributes
1146011460+ }
1146111461+ interface SpanClose {
1146211462+ readonly type: 'spanClose'
1146311463+ readonly outcome: EventOutcome
1146411464+ }
1146511465+ interface DiagnosticChannelEvent {
1146611466+ readonly type: 'diagnosticChannel'
1146711467+ readonly channel: string
1146811468+ readonly message: any
1146911469+ }
1147011470+ interface Exception {
1147111471+ readonly type: 'exception'
1147211472+ readonly name: string
1147311473+ readonly message: string
1147411474+ readonly stack?: string
1147511475+ }
1147611476+ interface Log {
1147711477+ readonly type: 'log'
1147811478+ readonly level: 'debug' | 'error' | 'info' | 'log' | 'warn'
1147911479+ readonly message: object
1148011480+ }
1148111481+ // This marks the worker handler return information.
1148211482+ // This is separate from Outcome because the worker invocation can live for a long time after
1148311483+ // returning. For example - Websockets that return an http upgrade response but then continue
1148411484+ // streaming information or SSE http connections.
1148511485+ interface Return {
1148611486+ readonly type: 'return'
1148711487+ readonly info?: FetchResponseInfo
1148811488+ }
1148911489+ interface Attribute {
1149011490+ readonly name: string
1149111491+ readonly value: string | string[] | boolean | boolean[] | number | number[] | bigint | bigint[]
1149211492+ }
1149311493+ interface Attributes {
1149411494+ readonly type: 'attributes'
1149511495+ readonly info: Attribute[]
1149611496+ }
1149711497+ type EventType =
1149811498+ | Onset
1149911499+ | Outcome
1150011500+ | SpanOpen
1150111501+ | SpanClose
1150211502+ | DiagnosticChannelEvent
1150311503+ | Exception
1150411504+ | Log
1150511505+ | Return
1150611506+ | Attributes
1150711507+ // Context in which this trace event lives.
1150811508+ interface SpanContext {
1150911509+ // Single id for the entire top-level invocation
1151011510+ // This should be a new traceId for the first worker stage invoked in the eyeball request and then
1151111511+ // same-account service-bindings should reuse the same traceId but cross-account service-bindings
1151211512+ // should use a new traceId.
1151311513+ readonly traceId: string
1151411514+ // spanId in which this event is handled
1151511515+ // for Onset and SpanOpen events this would be the parent span id
1151611516+ // for Outcome and SpanClose these this would be the span id of the opening Onset and SpanOpen events
1151711517+ // For Hibernate and Mark this would be the span under which they were emitted.
1151811518+ // spanId is not set ONLY if:
1151911519+ // 1. This is an Onset event
1152011520+ // 2. We are not inherting any SpanContext. (e.g. this is a cross-account service binding or a new top-level invocation)
1152111521+ readonly spanId?: string
1152211522+ }
1152311523+ interface TailEvent<Event extends EventType> {
1152411524+ // invocation id of the currently invoked worker stage.
1152511525+ // invocation id will always be unique to every Onset event and will be the same until the Outcome event.
1152611526+ readonly invocationId: string
1152711527+ // Inherited spanContext for this event.
1152811528+ readonly spanContext: SpanContext
1152911529+ readonly timestamp: Date
1153011530+ readonly sequence: number
1153111531+ readonly event: Event
1153211532+ }
1153311533+ type TailEventHandler<Event extends EventType = EventType> = (
1153411534+ event: TailEvent<Event>,
1153511535+ ) => void | Promise<void>
1153611536+ type TailEventHandlerObject = {
1153711537+ outcome?: TailEventHandler<Outcome>
1153811538+ spanOpen?: TailEventHandler<SpanOpen>
1153911539+ spanClose?: TailEventHandler<SpanClose>
1154011540+ diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent>
1154111541+ exception?: TailEventHandler<Exception>
1154211542+ log?: TailEventHandler<Log>
1154311543+ return?: TailEventHandler<Return>
1154411544+ attributes?: TailEventHandler<Attributes>
1154511545+ }
1154611546+ type TailEventHandlerType = TailEventHandler | TailEventHandlerObject
1154711547+}
1154811548+// Copyright (c) 2022-2023 Cloudflare, Inc.
1154911549+// Licensed under the Apache 2.0 license found in the LICENSE file or at:
1155011550+// https://opensource.org/licenses/Apache-2.0
1155111551+/**
1155211552+ * Data types supported for holding vector metadata.
1155311553+ */
1155411554+type VectorizeVectorMetadataValue = string | number | boolean | string[]
1155511555+/**
1155611556+ * Additional information to associate with a vector.
1155711557+ */
1155811558+type VectorizeVectorMetadata =
1155911559+ | VectorizeVectorMetadataValue
1156011560+ | Record<string, VectorizeVectorMetadataValue>
1156111561+type VectorFloatArray = Float32Array | Float64Array
1156211562+interface VectorizeError {
1156311563+ code?: number
1156411564+ error: string
1156511565+}
1156611566+/**
1156711567+ * Comparison logic/operation to use for metadata filtering.
1156811568+ *
1156911569+ * This list is expected to grow as support for more operations are released.
1157011570+ */
1157111571+type VectorizeVectorMetadataFilterOp = '$eq' | '$ne' | '$lt' | '$lte' | '$gt' | '$gte'
1157211572+type VectorizeVectorMetadataFilterCollectionOp = '$in' | '$nin'
1157311573+/**
1157411574+ * Filter criteria for vector metadata used to limit the retrieved query result set.
1157511575+ */
1157611576+type VectorizeVectorMetadataFilter = {
1157711577+ [field: string]:
1157811578+ | Exclude<VectorizeVectorMetadataValue, string[]>
1157911579+ | null
1158011580+ | {
1158111581+ [Op in VectorizeVectorMetadataFilterOp]?: Exclude<
1158211582+ VectorizeVectorMetadataValue,
1158311583+ string[]
1158411584+ > | null
1158511585+ }
1158611586+ | {
1158711587+ [Op in VectorizeVectorMetadataFilterCollectionOp]?: Exclude<
1158811588+ VectorizeVectorMetadataValue,
1158911589+ string[]
1159011590+ >[]
1159111591+ }
1159211592+}
1159311593+/**
1159411594+ * Supported distance metrics for an index.
1159511595+ * Distance metrics determine how other "similar" vectors are determined.
1159611596+ */
1159711597+type VectorizeDistanceMetric = 'euclidean' | 'cosine' | 'dot-product'
1159811598+/**
1159911599+ * Metadata return levels for a Vectorize query.
1160011600+ *
1160111601+ * Default to "none".
1160211602+ *
1160311603+ * @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.
1160411604+ * @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).
1160511605+ * @property none No indexed metadata will be returned.
1160611606+ */
1160711607+type VectorizeMetadataRetrievalLevel = 'all' | 'indexed' | 'none'
1160811608+interface VectorizeQueryOptions {
1160911609+ topK?: number
1161011610+ namespace?: string
1161111611+ returnValues?: boolean
1161211612+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel
1161311613+ filter?: VectorizeVectorMetadataFilter
1161411614+}
1161511615+/**
1161611616+ * Information about the configuration of an index.
1161711617+ */
1161811618+type VectorizeIndexConfig =
1161911619+ | {
1162011620+ dimensions: number
1162111621+ metric: VectorizeDistanceMetric
1162211622+ }
1162311623+ | {
1162411624+ preset: string // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity
1162511625+ }
1162611626+/**
1162711627+ * Metadata about an existing index.
1162811628+ *
1162911629+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
1163011630+ * See {@link VectorizeIndexInfo} for its post-beta equivalent.
1163111631+ */
1163211632+interface VectorizeIndexDetails {
1163311633+ /** The unique ID of the index */
1163411634+ readonly id: string
1163511635+ /** The name of the index. */
1163611636+ name: string
1163711637+ /** (optional) A human readable description for the index. */
1163811638+ description?: string
1163911639+ /** The index configuration, including the dimension size and distance metric. */
1164011640+ config: VectorizeIndexConfig
1164111641+ /** The number of records containing vectors within the index. */
1164211642+ vectorsCount: number
1164311643+}
1164411644+/**
1164511645+ * Metadata about an existing index.
1164611646+ */
1164711647+interface VectorizeIndexInfo {
1164811648+ /** The number of records containing vectors within the index. */
1164911649+ vectorCount: number
1165011650+ /** Number of dimensions the index has been configured for. */
1165111651+ dimensions: number
1165211652+ /** ISO 8601 datetime of the last processed mutation on in the index. All changes before this mutation will be reflected in the index state. */
1165311653+ processedUpToDatetime: number
1165411654+ /** UUIDv4 of the last mutation processed by the index. All changes before this mutation will be reflected in the index state. */
1165511655+ processedUpToMutation: number
1165611656+}
1165711657+/**
1165811658+ * Represents a single vector value set along with its associated metadata.
1165911659+ */
1166011660+interface VectorizeVector {
1166111661+ /** 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. */
1166211662+ id: string
1166311663+ /** The vector values */
1166411664+ values: VectorFloatArray | number[]
1166511665+ /** The namespace this vector belongs to. */
1166611666+ namespace?: string
1166711667+ /** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
1166811668+ metadata?: Record<string, VectorizeVectorMetadata>
1166911669+}
1167011670+/**
1167111671+ * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
1167211672+ */
1167311673+type VectorizeMatch = Pick<Partial<VectorizeVector>, 'values'> &
1167411674+ Omit<VectorizeVector, 'values'> & {
1167511675+ /** The score or rank for similarity, when returned as a result */
1167611676+ score: number
1167711677+ }
1167811678+/**
1167911679+ * A set of matching {@link VectorizeMatch} for a particular query.
1168011680+ */
1168111681+interface VectorizeMatches {
1168211682+ matches: VectorizeMatch[]
1168311683+ count: number
1168411684+}
1168511685+/**
1168611686+ * Results of an operation that performed a mutation on a set of vectors.
1168711687+ * Here, `ids` is a list of vectors that were successfully processed.
1168811688+ *
1168911689+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
1169011690+ * See {@link VectorizeAsyncMutation} for its post-beta equivalent.
1169111691+ */
1169211692+interface VectorizeVectorMutation {
1169311693+ /* List of ids of vectors that were successfully processed. */
1169411694+ ids: string[]
1169511695+ /* Total count of the number of processed vectors. */
1169611696+ count: number
1169711697+}
1169811698+/**
1169911699+ * Result type indicating a mutation on the Vectorize Index.
1170011700+ * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
1170111701+ */
1170211702+interface VectorizeAsyncMutation {
1170311703+ /** The unique identifier for the async mutation operation containing the changeset. */
1170411704+ mutationId: string
1170511705+}
1170611706+/**
1170711707+ * A Vectorize Vector Search Index for querying vectors/embeddings.
1170811708+ *
1170911709+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
1171011710+ * See {@link Vectorize} for its new implementation.
1171111711+ */
1171211712+declare abstract class VectorizeIndex {
1171311713+ /**
1171411714+ * Get information about the currently bound index.
1171511715+ * @returns A promise that resolves with information about the current index.
1171611716+ */
1171711717+ public describe(): Promise<VectorizeIndexDetails>
1171811718+ /**
1171911719+ * Use the provided vector to perform a similarity search across the index.
1172011720+ * @param vector Input vector that will be used to drive the similarity search.
1172111721+ * @param options Configuration options to massage the returned data.
1172211722+ * @returns A promise that resolves with matched and scored vectors.
1172311723+ */
1172411724+ public query(
1172511725+ vector: VectorFloatArray | number[],
1172611726+ options?: VectorizeQueryOptions,
1172711727+ ): Promise<VectorizeMatches>
1172811728+ /**
1172911729+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
1173011730+ * @param vectors List of vectors that will be inserted.
1173111731+ * @returns A promise that resolves with the ids & count of records that were successfully processed.
1173211732+ */
1173311733+ public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>
1173411734+ /**
1173511735+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
1173611736+ * @param vectors List of vectors that will be upserted.
1173711737+ * @returns A promise that resolves with the ids & count of records that were successfully processed.
1173811738+ */
1173911739+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>
1174011740+ /**
1174111741+ * Delete a list of vectors with a matching id.
1174211742+ * @param ids List of vector ids that should be deleted.
1174311743+ * @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted).
1174411744+ */
1174511745+ public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation>
1174611746+ /**
1174711747+ * Get a list of vectors with a matching id.
1174811748+ * @param ids List of vector ids that should be returned.
1174911749+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
1175011750+ */
1175111751+ public getByIds(ids: string[]): Promise<VectorizeVector[]>
1175211752+}
1175311753+/**
1175411754+ * A Vectorize Vector Search Index for querying vectors/embeddings.
1175511755+ *
1175611756+ * Mutations in this version are async, returning a mutation id.
1175711757+ */
1175811758+declare abstract class Vectorize {
1175911759+ /**
1176011760+ * Get information about the currently bound index.
1176111761+ * @returns A promise that resolves with information about the current index.
1176211762+ */
1176311763+ public describe(): Promise<VectorizeIndexInfo>
1176411764+ /**
1176511765+ * Use the provided vector to perform a similarity search across the index.
1176611766+ * @param vector Input vector that will be used to drive the similarity search.
1176711767+ * @param options Configuration options to massage the returned data.
1176811768+ * @returns A promise that resolves with matched and scored vectors.
1176911769+ */
1177011770+ public query(
1177111771+ vector: VectorFloatArray | number[],
1177211772+ options?: VectorizeQueryOptions,
1177311773+ ): Promise<VectorizeMatches>
1177411774+ /**
1177511775+ * Use the provided vector-id to perform a similarity search across the index.
1177611776+ * @param vectorId Id for a vector in the index against which the index should be queried.
1177711777+ * @param options Configuration options to massage the returned data.
1177811778+ * @returns A promise that resolves with matched and scored vectors.
1177911779+ */
1178011780+ public queryById(vectorId: string, options?: VectorizeQueryOptions): Promise<VectorizeMatches>
1178111781+ /**
1178211782+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
1178311783+ * @param vectors List of vectors that will be inserted.
1178411784+ * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
1178511785+ */
1178611786+ public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>
1178711787+ /**
1178811788+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
1178911789+ * @param vectors List of vectors that will be upserted.
1179011790+ * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
1179111791+ */
1179211792+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>
1179311793+ /**
1179411794+ * Delete a list of vectors with a matching id.
1179511795+ * @param ids List of vector ids that should be deleted.
1179611796+ * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
1179711797+ */
1179811798+ public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>
1179911799+ /**
1180011800+ * Get a list of vectors with a matching id.
1180111801+ * @param ids List of vector ids that should be returned.
1180211802+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
1180311803+ */
1180411804+ public getByIds(ids: string[]): Promise<VectorizeVector[]>
1180511805+}
1180611806+/**
1180711807+ * The interface for "version_metadata" binding
1180811808+ * providing metadata about the Worker Version using this binding.
1180911809+ */
1181011810+type WorkerVersionMetadata = {
1181111811+ /** The ID of the Worker Version using this binding */
1181211812+ id: string
1181311813+ /** The tag of the Worker Version using this binding */
1181411814+ tag: string
1181511815+ /** The timestamp of when the Worker Version was uploaded */
1181611816+ timestamp: string
1181711817+}
1181811818+interface DynamicDispatchLimits {
1181911819+ /**
1182011820+ * Limit CPU time in milliseconds.
1182111821+ */
1182211822+ cpuMs?: number
1182311823+ /**
1182411824+ * Limit number of subrequests.
1182511825+ */
1182611826+ subRequests?: number
1182711827+}
1182811828+interface DynamicDispatchOptions {
1182911829+ /**
1183011830+ * Limit resources of invoked Worker script.
1183111831+ */
1183211832+ limits?: DynamicDispatchLimits
1183311833+ /**
1183411834+ * Arguments for outbound Worker script, if configured.
1183511835+ */
1183611836+ outbound?: {
1183711837+ [key: string]: any
1183811838+ }
1183911839+}
1184011840+interface DispatchNamespace {
1184111841+ /**
1184211842+ * @param name Name of the Worker script.
1184311843+ * @param args Arguments to Worker script.
1184411844+ * @param options Options for Dynamic Dispatch invocation.
1184511845+ * @returns A Fetcher object that allows you to send requests to the Worker script.
1184611846+ * @throws If the Worker script does not exist in this dispatch namespace, an error will be thrown.
1184711847+ */
1184811848+ get(
1184911849+ name: string,
1185011850+ args?: {
1185111851+ [key: string]: any
1185211852+ },
1185311853+ options?: DynamicDispatchOptions,
1185411854+ ): Fetcher
1185511855+}
1185611856+declare module 'cloudflare:workflows' {
1185711857+ /**
1185811858+ * NonRetryableError allows for a user to throw a fatal error
1185911859+ * that makes a Workflow instance fail immediately without triggering a retry
1186011860+ */
1186111861+ export class NonRetryableError extends Error {
1186211862+ public constructor(message: string, name?: string)
1186311863+ }
1186411864+}
1186511865+declare abstract class Workflow<PARAMS = unknown> {
1186611866+ /**
1186711867+ * Get a handle to an existing instance of the Workflow.
1186811868+ * @param id Id for the instance of this Workflow
1186911869+ * @returns A promise that resolves with a handle for the Instance
1187011870+ */
1187111871+ public get(id: string): Promise<WorkflowInstance>
1187211872+ /**
1187311873+ * Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
1187411874+ * @param options Options when creating an instance including id and params
1187511875+ * @returns A promise that resolves with a handle for the Instance
1187611876+ */
1187711877+ public create(options?: WorkflowInstanceCreateOptions<PARAMS>): Promise<WorkflowInstance>
1187811878+ /**
1187911879+ * Create a batch of instances and return handle for all of them. If a provided id exists, an error will be thrown.
1188011880+ * `createBatch` is limited at 100 instances at a time or when the RPC limit for the batch (1MiB) is reached.
1188111881+ * @param batch List of Options when creating an instance including name and params
1188211882+ * @returns A promise that resolves with a list of handles for the created instances.
1188311883+ */
1188411884+ public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]>
1188511885+}
1188611886+type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year'
1188711887+type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number
1188811888+type WorkflowRetentionDuration = WorkflowSleepDuration
1188911889+interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
1189011890+ /**
1189111891+ * An id for your Workflow instance. Must be unique within the Workflow.
1189211892+ */
1189311893+ id?: string
1189411894+ /**
1189511895+ * The event payload the Workflow instance is triggered with
1189611896+ */
1189711897+ params?: PARAMS
1189811898+ /**
1189911899+ * The retention policy for Workflow instance.
1190011900+ * Defaults to the maximum retention period available for the owner's account.
1190111901+ */
1190211902+ retention?: {
1190311903+ successRetention?: WorkflowRetentionDuration
1190411904+ errorRetention?: WorkflowRetentionDuration
1190511905+ }
1190611906+}
1190711907+type InstanceStatus = {
1190811908+ status:
1190911909+ | 'queued' // means that instance is waiting to be started (see concurrency limits)
1191011910+ | 'running'
1191111911+ | 'paused'
1191211912+ | 'errored'
1191311913+ | 'terminated' // user terminated the instance while it was running
1191411914+ | 'complete'
1191511915+ | 'waiting' // instance is hibernating and waiting for sleep or event to finish
1191611916+ | 'waitingForPause' // instance is finishing the current work to pause
1191711917+ | 'unknown'
1191811918+ error?: {
1191911919+ name: string
1192011920+ message: string
1192111921+ }
1192211922+ output?: unknown
1192311923+}
1192411924+interface WorkflowError {
1192511925+ code?: number
1192611926+ message: string
1192711927+}
1192811928+declare abstract class WorkflowInstance {
1192911929+ public id: string
1193011930+ /**
1193111931+ * Pause the instance.
1193211932+ */
1193311933+ public pause(): Promise<void>
1193411934+ /**
1193511935+ * Resume the instance. If it is already running, an error will be thrown.
1193611936+ */
1193711937+ public resume(): Promise<void>
1193811938+ /**
1193911939+ * Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
1194011940+ */
1194111941+ public terminate(): Promise<void>
1194211942+ /**
1194311943+ * Restart the instance.
1194411944+ */
1194511945+ public restart(): Promise<void>
1194611946+ /**
1194711947+ * Returns the current status of the instance.
1194811948+ */
1194911949+ public status(): Promise<InstanceStatus>
1195011950+ /**
1195111951+ * Send an event to this instance.
1195211952+ */
1195311953+ public sendEvent({ type, payload }: { type: string; payload: unknown }): Promise<void>
1195411954+}