a homebrewed DnD campaign based in the Honkai: Star Rail universe
hsr honkaistarrail dnd

chore: migrate from `@cloudflare/workers-types` to `wrangler types` (#102)

authored by samanthanguyen.me and committed by

GitHub 9d7a9c77 2b32721a

+12017 -59
+4 -1
.gitattributes
··· 4 4 # hide things 5 5 packages/icons/src/app.html -linguist-detectable 6 6 7 - # - Recognize TSConfig file variants as JSONC (e.g: tsconfig.base.json) 7 + # - Recognize TSConfig file variants as JSONC (e.g: tsconfig.base.json) 8 8 # - Recognize Oxlint config file as JSONC 9 9 tsconfig.*.json linguist-language=JSON-with-Comments 10 10 .oxlintrc.json linguist-language=JSON-with-Comments 11 + 12 + # generated files 13 + app/worker-configuration.d.ts linguist-generated
+2 -2
app/package.json
··· 17 17 "build-storybook": "storybook build", 18 18 "chromatic": "chromatic --exit-zero-on-changes", 19 19 "test": "vitest", 20 - "test-ui": "vitest --ui" 20 + "test-ui": "vitest --ui", 21 + "cloudflare-types": "wrangler types" 21 22 }, 22 23 "dependencies": { 23 - "@cloudflare/workers-types": "^4.20251217.0", 24 24 "@lucide/svelte": "^0.562.0", 25 25 "@starlight/color": "file:../packages/color", 26 26 "@starlight/icons": "file:../packages/icons",
-2
app/src/app.d.ts
··· 1 1 // oxlint-disable typescript/consistent-type-definitions 2 - 3 - import { KVNamespace, DurableObjectNamespace } from '@cloudflare/workers-types' 4 2 import type { Session, SupabaseClient, User } from '@supabase/supabase-js' 5 3 import type { Database } from './database.types.ts' // import generated types 6 4
+2 -1
app/tsconfig.json
··· 10 10 "skipLibCheck": true, 11 11 "sourceMap": true, 12 12 "strict": true, 13 - "moduleResolution": "bundler" 13 + "moduleResolution": "bundler", 14 + "types": ["./worker-configuration.d.ts", "node"] 14 15 } 15 16 // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias 16 17 // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
+11954
app/worker-configuration.d.ts
··· 1 + /* eslint-disable */ 2 + // Generated by Wrangler by running `wrangler types` (hash: 93851a135272be61ff875ada0ef59f66) 3 + // Runtime types generated with workerd@1.20251217.0 2025-11-17 nodejs_compat 4 + declare namespace Cloudflare { 5 + interface GlobalProps { 6 + mainModule: typeof import('./.svelte-kit/.cloudflare/_worker') 7 + } 8 + interface Env { 9 + ASSETS: Fetcher 10 + } 11 + } 12 + interface Env extends Cloudflare.Env {} 13 + 14 + // Begin runtime types 15 + /*! ***************************************************************************** 16 + Copyright (c) Cloudflare. All rights reserved. 17 + Copyright (c) Microsoft Corporation. All rights reserved. 18 + 19 + Licensed under the Apache License, Version 2.0 (the "License"); you may not use 20 + this file except in compliance with the License. You may obtain a copy of the 21 + License at http://www.apache.org/licenses/LICENSE-2.0 22 + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 23 + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 24 + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 25 + MERCHANTABLITY OR NON-INFRINGEMENT. 26 + See the Apache Version 2.0 License for specific language governing permissions 27 + and limitations under the License. 28 + ***************************************************************************** */ 29 + /* eslint-disable */ 30 + // noinspection JSUnusedGlobalSymbols 31 + declare var onmessage: never 32 + /** 33 + * 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. 34 + * 35 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) 36 + */ 37 + declare class DOMException extends Error { 38 + constructor(message?: string, name?: string) 39 + /** 40 + * The **`message`** read-only property of the a message or description associated with the given error name. 41 + * 42 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) 43 + */ 44 + readonly message: string 45 + /** 46 + * The **`name`** read-only property of the one of the strings associated with an error name. 47 + * 48 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) 49 + */ 50 + readonly name: string 51 + /** 52 + * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match. 53 + * @deprecated 54 + * 55 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) 56 + */ 57 + readonly code: number 58 + static readonly INDEX_SIZE_ERR: number 59 + static readonly DOMSTRING_SIZE_ERR: number 60 + static readonly HIERARCHY_REQUEST_ERR: number 61 + static readonly WRONG_DOCUMENT_ERR: number 62 + static readonly INVALID_CHARACTER_ERR: number 63 + static readonly NO_DATA_ALLOWED_ERR: number 64 + static readonly NO_MODIFICATION_ALLOWED_ERR: number 65 + static readonly NOT_FOUND_ERR: number 66 + static readonly NOT_SUPPORTED_ERR: number 67 + static readonly INUSE_ATTRIBUTE_ERR: number 68 + static readonly INVALID_STATE_ERR: number 69 + static readonly SYNTAX_ERR: number 70 + static readonly INVALID_MODIFICATION_ERR: number 71 + static readonly NAMESPACE_ERR: number 72 + static readonly INVALID_ACCESS_ERR: number 73 + static readonly VALIDATION_ERR: number 74 + static readonly TYPE_MISMATCH_ERR: number 75 + static readonly SECURITY_ERR: number 76 + static readonly NETWORK_ERR: number 77 + static readonly ABORT_ERR: number 78 + static readonly URL_MISMATCH_ERR: number 79 + static readonly QUOTA_EXCEEDED_ERR: number 80 + static readonly TIMEOUT_ERR: number 81 + static readonly INVALID_NODE_TYPE_ERR: number 82 + static readonly DATA_CLONE_ERR: number 83 + get stack(): any 84 + set stack(value: any) 85 + } 86 + type WorkerGlobalScopeEventMap = { 87 + fetch: FetchEvent 88 + scheduled: ScheduledEvent 89 + queue: QueueEvent 90 + unhandledrejection: PromiseRejectionEvent 91 + rejectionhandled: PromiseRejectionEvent 92 + } 93 + declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> { 94 + EventTarget: typeof EventTarget 95 + } 96 + /* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). * 97 + * The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). 98 + * 99 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) 100 + */ 101 + interface Console { 102 + 'assert'(condition?: boolean, ...data: any[]): void 103 + /** 104 + * The **`console.clear()`** static method clears the console if possible. 105 + * 106 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) 107 + */ 108 + clear(): void 109 + /** 110 + * The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called. 111 + * 112 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) 113 + */ 114 + count(label?: string): void 115 + /** 116 + * The **`console.countReset()`** static method resets counter used with console/count_static. 117 + * 118 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) 119 + */ 120 + countReset(label?: string): void 121 + /** 122 + * The **`console.debug()`** static method outputs a message to the console at the 'debug' log level. 123 + * 124 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) 125 + */ 126 + debug(...data: any[]): void 127 + /** 128 + * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object. 129 + * 130 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) 131 + */ 132 + dir(item?: any, options?: any): void 133 + /** 134 + * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element. 135 + * 136 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) 137 + */ 138 + dirxml(...data: any[]): void 139 + /** 140 + * The **`console.error()`** static method outputs a message to the console at the 'error' log level. 141 + * 142 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) 143 + */ 144 + error(...data: any[]): void 145 + /** 146 + * 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. 147 + * 148 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) 149 + */ 150 + group(...data: any[]): void 151 + /** 152 + * The **`console.groupCollapsed()`** static method creates a new inline group in the console. 153 + * 154 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) 155 + */ 156 + groupCollapsed(...data: any[]): void 157 + /** 158 + * The **`console.groupEnd()`** static method exits the current inline group in the console. 159 + * 160 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) 161 + */ 162 + groupEnd(): void 163 + /** 164 + * The **`console.info()`** static method outputs a message to the console at the 'info' log level. 165 + * 166 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) 167 + */ 168 + info(...data: any[]): void 169 + /** 170 + * The **`console.log()`** static method outputs a message to the console. 171 + * 172 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) 173 + */ 174 + log(...data: any[]): void 175 + /** 176 + * The **`console.table()`** static method displays tabular data as a table. 177 + * 178 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) 179 + */ 180 + table(tabularData?: any, properties?: string[]): void 181 + /** 182 + * The **`console.time()`** static method starts a timer you can use to track how long an operation takes. 183 + * 184 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) 185 + */ 186 + time(label?: string): void 187 + /** 188 + * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static. 189 + * 190 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) 191 + */ 192 + timeEnd(label?: string): void 193 + /** 194 + * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static. 195 + * 196 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) 197 + */ 198 + timeLog(label?: string, ...data: any[]): void 199 + timeStamp(label?: string): void 200 + /** 201 + * The **`console.trace()`** static method outputs a stack trace to the console. 202 + * 203 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) 204 + */ 205 + trace(...data: any[]): void 206 + /** 207 + * The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level. 208 + * 209 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) 210 + */ 211 + warn(...data: any[]): void 212 + } 213 + declare const console: Console 214 + type BufferSource = ArrayBufferView | ArrayBuffer 215 + type TypedArray = 216 + | Int8Array 217 + | Uint8Array 218 + | Uint8ClampedArray 219 + | Int16Array 220 + | Uint16Array 221 + | Int32Array 222 + | Uint32Array 223 + | Float32Array 224 + | Float64Array 225 + | BigInt64Array 226 + | BigUint64Array 227 + declare namespace WebAssembly { 228 + class CompileError extends Error { 229 + constructor(message?: string) 230 + } 231 + class RuntimeError extends Error { 232 + constructor(message?: string) 233 + } 234 + type ValueType = 'anyfunc' | 'externref' | 'f32' | 'f64' | 'i32' | 'i64' | 'v128' 235 + interface GlobalDescriptor { 236 + value: ValueType 237 + mutable?: boolean 238 + } 239 + class Global { 240 + constructor(descriptor: GlobalDescriptor, value?: any) 241 + value: any 242 + valueOf(): any 243 + } 244 + type ImportValue = ExportValue | number 245 + type ModuleImports = Record<string, ImportValue> 246 + type Imports = Record<string, ModuleImports> 247 + type ExportValue = Function | Global | Memory | Table 248 + type Exports = Record<string, ExportValue> 249 + class Instance { 250 + constructor(module: Module, imports?: Imports) 251 + readonly exports: Exports 252 + } 253 + interface MemoryDescriptor { 254 + initial: number 255 + maximum?: number 256 + shared?: boolean 257 + } 258 + class Memory { 259 + constructor(descriptor: MemoryDescriptor) 260 + readonly buffer: ArrayBuffer 261 + grow(delta: number): number 262 + } 263 + type ImportExportKind = 'function' | 'global' | 'memory' | 'table' 264 + interface ModuleExportDescriptor { 265 + kind: ImportExportKind 266 + name: string 267 + } 268 + interface ModuleImportDescriptor { 269 + kind: ImportExportKind 270 + module: string 271 + name: string 272 + } 273 + abstract class Module { 274 + static customSections(module: Module, sectionName: string): ArrayBuffer[] 275 + static exports(module: Module): ModuleExportDescriptor[] 276 + static imports(module: Module): ModuleImportDescriptor[] 277 + } 278 + type TableKind = 'anyfunc' | 'externref' 279 + interface TableDescriptor { 280 + element: TableKind 281 + initial: number 282 + maximum?: number 283 + } 284 + class Table { 285 + constructor(descriptor: TableDescriptor, value?: any) 286 + readonly length: number 287 + get(index: number): any 288 + grow(delta: number, value?: any): number 289 + set(index: number, value?: any): void 290 + } 291 + function instantiate(module: Module, imports?: Imports): Promise<Instance> 292 + function validate(bytes: BufferSource): boolean 293 + } 294 + /** 295 + * The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker. 296 + * Available only in secure contexts. 297 + * 298 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope) 299 + */ 300 + interface ServiceWorkerGlobalScope extends WorkerGlobalScope { 301 + DOMException: typeof DOMException 302 + WorkerGlobalScope: typeof WorkerGlobalScope 303 + btoa(data: string): string 304 + atob(data: string): string 305 + setTimeout(callback: (...args: any[]) => void, msDelay?: number): number 306 + setTimeout<Args extends any[]>( 307 + callback: (...args: Args) => void, 308 + msDelay?: number, 309 + ...args: Args 310 + ): number 311 + clearTimeout(timeoutId: number | null): void 312 + setInterval(callback: (...args: any[]) => void, msDelay?: number): number 313 + setInterval<Args extends any[]>( 314 + callback: (...args: Args) => void, 315 + msDelay?: number, 316 + ...args: Args 317 + ): number 318 + clearInterval(timeoutId: number | null): void 319 + queueMicrotask(task: Function): void 320 + structuredClone<T>(value: T, options?: StructuredSerializeOptions): T 321 + reportError(error: any): void 322 + fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response> 323 + self: ServiceWorkerGlobalScope 324 + crypto: Crypto 325 + caches: CacheStorage 326 + scheduler: Scheduler 327 + performance: Performance 328 + Cloudflare: Cloudflare 329 + readonly origin: string 330 + Event: typeof Event 331 + ExtendableEvent: typeof ExtendableEvent 332 + CustomEvent: typeof CustomEvent 333 + PromiseRejectionEvent: typeof PromiseRejectionEvent 334 + FetchEvent: typeof FetchEvent 335 + TailEvent: typeof TailEvent 336 + TraceEvent: typeof TailEvent 337 + ScheduledEvent: typeof ScheduledEvent 338 + MessageEvent: typeof MessageEvent 339 + CloseEvent: typeof CloseEvent 340 + ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader 341 + ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader 342 + ReadableStream: typeof ReadableStream 343 + WritableStream: typeof WritableStream 344 + WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter 345 + TransformStream: typeof TransformStream 346 + ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy 347 + CountQueuingStrategy: typeof CountQueuingStrategy 348 + ErrorEvent: typeof ErrorEvent 349 + MessageChannel: typeof MessageChannel 350 + MessagePort: typeof MessagePort 351 + EventSource: typeof EventSource 352 + ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest 353 + ReadableStreamDefaultController: typeof ReadableStreamDefaultController 354 + ReadableByteStreamController: typeof ReadableByteStreamController 355 + WritableStreamDefaultController: typeof WritableStreamDefaultController 356 + TransformStreamDefaultController: typeof TransformStreamDefaultController 357 + CompressionStream: typeof CompressionStream 358 + DecompressionStream: typeof DecompressionStream 359 + TextEncoderStream: typeof TextEncoderStream 360 + TextDecoderStream: typeof TextDecoderStream 361 + Headers: typeof Headers 362 + Body: typeof Body 363 + Request: typeof Request 364 + Response: typeof Response 365 + WebSocket: typeof WebSocket 366 + WebSocketPair: typeof WebSocketPair 367 + WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair 368 + AbortController: typeof AbortController 369 + AbortSignal: typeof AbortSignal 370 + TextDecoder: typeof TextDecoder 371 + TextEncoder: typeof TextEncoder 372 + navigator: Navigator 373 + Navigator: typeof Navigator 374 + URL: typeof URL 375 + URLSearchParams: typeof URLSearchParams 376 + URLPattern: typeof URLPattern 377 + Blob: typeof Blob 378 + File: typeof File 379 + FormData: typeof FormData 380 + Crypto: typeof Crypto 381 + SubtleCrypto: typeof SubtleCrypto 382 + CryptoKey: typeof CryptoKey 383 + CacheStorage: typeof CacheStorage 384 + Cache: typeof Cache 385 + FixedLengthStream: typeof FixedLengthStream 386 + IdentityTransformStream: typeof IdentityTransformStream 387 + HTMLRewriter: typeof HTMLRewriter 388 + } 389 + declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>( 390 + type: Type, 391 + handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, 392 + options?: EventTargetAddEventListenerOptions | boolean, 393 + ): void 394 + declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>( 395 + type: Type, 396 + handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, 397 + options?: EventTargetEventListenerOptions | boolean, 398 + ): void 399 + /** 400 + * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. 401 + * 402 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) 403 + */ 404 + declare function dispatchEvent( 405 + event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap], 406 + ): boolean 407 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */ 408 + declare function btoa(data: string): string 409 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */ 410 + declare function atob(data: string): string 411 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */ 412 + declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number 413 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */ 414 + declare function setTimeout<Args extends any[]>( 415 + callback: (...args: Args) => void, 416 + msDelay?: number, 417 + ...args: Args 418 + ): number 419 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */ 420 + declare function clearTimeout(timeoutId: number | null): void 421 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */ 422 + declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number 423 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */ 424 + declare function setInterval<Args extends any[]>( 425 + callback: (...args: Args) => void, 426 + msDelay?: number, 427 + ...args: Args 428 + ): number 429 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */ 430 + declare function clearInterval(timeoutId: number | null): void 431 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */ 432 + declare function queueMicrotask(task: Function): void 433 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */ 434 + declare function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T 435 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */ 436 + declare function reportError(error: any): void 437 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */ 438 + declare function fetch( 439 + input: RequestInfo | URL, 440 + init?: RequestInit<RequestInitCfProperties>, 441 + ): Promise<Response> 442 + declare const self: ServiceWorkerGlobalScope 443 + /** 444 + * The Web Crypto API provides a set of low-level functions for common cryptographic tasks. 445 + * The Workers runtime implements the full surface of this API, but with some differences in 446 + * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms) 447 + * compared to those implemented in most browsers. 448 + * 449 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/) 450 + */ 451 + declare const crypto: Crypto 452 + /** 453 + * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache. 454 + * 455 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/) 456 + */ 457 + declare const caches: CacheStorage 458 + declare const scheduler: Scheduler 459 + /** 460 + * The Workers runtime supports a subset of the Performance API, used to measure timing and performance, 461 + * as well as timing of subrequests and other operations. 462 + * 463 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/) 464 + */ 465 + declare const performance: Performance 466 + declare const Cloudflare: Cloudflare 467 + declare const origin: string 468 + declare const navigator: Navigator 469 + interface TestController {} 470 + interface ExecutionContext<Props = unknown> { 471 + waitUntil(promise: Promise<any>): void 472 + passThroughOnException(): void 473 + readonly exports: Cloudflare.Exports 474 + readonly props: Props 475 + } 476 + type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = ( 477 + request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, 478 + env: Env, 479 + ctx: ExecutionContext, 480 + ) => Response | Promise<Response> 481 + type ExportedHandlerTailHandler<Env = unknown> = ( 482 + events: TraceItem[], 483 + env: Env, 484 + ctx: ExecutionContext, 485 + ) => void | Promise<void> 486 + type ExportedHandlerTraceHandler<Env = unknown> = ( 487 + traces: TraceItem[], 488 + env: Env, 489 + ctx: ExecutionContext, 490 + ) => void | Promise<void> 491 + type ExportedHandlerTailStreamHandler<Env = unknown> = ( 492 + event: TailStream.TailEvent<TailStream.Onset>, 493 + env: Env, 494 + ctx: ExecutionContext, 495 + ) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType> 496 + type ExportedHandlerScheduledHandler<Env = unknown> = ( 497 + controller: ScheduledController, 498 + env: Env, 499 + ctx: ExecutionContext, 500 + ) => void | Promise<void> 501 + type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = ( 502 + batch: MessageBatch<Message>, 503 + env: Env, 504 + ctx: ExecutionContext, 505 + ) => void | Promise<void> 506 + type ExportedHandlerTestHandler<Env = unknown> = ( 507 + controller: TestController, 508 + env: Env, 509 + ctx: ExecutionContext, 510 + ) => void | Promise<void> 511 + interface ExportedHandler<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown> { 512 + fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata> 513 + tail?: ExportedHandlerTailHandler<Env> 514 + trace?: ExportedHandlerTraceHandler<Env> 515 + tailStream?: ExportedHandlerTailStreamHandler<Env> 516 + scheduled?: ExportedHandlerScheduledHandler<Env> 517 + test?: ExportedHandlerTestHandler<Env> 518 + email?: EmailExportedHandler<Env> 519 + queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage> 520 + } 521 + interface StructuredSerializeOptions { 522 + transfer?: any[] 523 + } 524 + declare abstract class Navigator { 525 + sendBeacon(url: string, body?: BodyInit): boolean 526 + readonly userAgent: string 527 + readonly hardwareConcurrency: number 528 + readonly language: string 529 + readonly languages: string[] 530 + } 531 + interface AlarmInvocationInfo { 532 + readonly isRetry: boolean 533 + readonly retryCount: number 534 + } 535 + interface Cloudflare { 536 + readonly compatibilityFlags: Record<string, boolean> 537 + } 538 + interface DurableObject { 539 + fetch(request: Request): Response | Promise<Response> 540 + alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void> 541 + webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void> 542 + webSocketClose?( 543 + ws: WebSocket, 544 + code: number, 545 + reason: string, 546 + wasClean: boolean, 547 + ): void | Promise<void> 548 + webSocketError?(ws: WebSocket, error: unknown): void | Promise<void> 549 + } 550 + type DurableObjectStub<T extends Rpc.DurableObjectBranded | undefined = undefined> = Fetcher< 551 + T, 552 + 'alarm' | 'webSocketMessage' | 'webSocketClose' | 'webSocketError' 553 + > & { 554 + readonly id: DurableObjectId 555 + readonly name?: string 556 + } 557 + interface DurableObjectId { 558 + toString(): string 559 + equals(other: DurableObjectId): boolean 560 + readonly name?: string 561 + } 562 + declare abstract class DurableObjectNamespace< 563 + T extends Rpc.DurableObjectBranded | undefined = undefined, 564 + > { 565 + newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId 566 + idFromName(name: string): DurableObjectId 567 + idFromString(id: string): DurableObjectId 568 + get( 569 + id: DurableObjectId, 570 + options?: DurableObjectNamespaceGetDurableObjectOptions, 571 + ): DurableObjectStub<T> 572 + getByName( 573 + name: string, 574 + options?: DurableObjectNamespaceGetDurableObjectOptions, 575 + ): DurableObjectStub<T> 576 + jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T> 577 + } 578 + type DurableObjectJurisdiction = 'eu' | 'fedramp' | 'fedramp-high' 579 + interface DurableObjectNamespaceNewUniqueIdOptions { 580 + jurisdiction?: DurableObjectJurisdiction 581 + } 582 + type DurableObjectLocationHint = 583 + | 'wnam' 584 + | 'enam' 585 + | 'sam' 586 + | 'weur' 587 + | 'eeur' 588 + | 'apac' 589 + | 'oc' 590 + | 'afr' 591 + | 'me' 592 + interface DurableObjectNamespaceGetDurableObjectOptions { 593 + locationHint?: DurableObjectLocationHint 594 + } 595 + interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {} 596 + interface DurableObjectState<Props = unknown> { 597 + waitUntil(promise: Promise<any>): void 598 + readonly exports: Cloudflare.Exports 599 + readonly props: Props 600 + readonly id: DurableObjectId 601 + readonly storage: DurableObjectStorage 602 + container?: Container 603 + blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T> 604 + acceptWebSocket(ws: WebSocket, tags?: string[]): void 605 + getWebSockets(tag?: string): WebSocket[] 606 + setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void 607 + getWebSocketAutoResponse(): WebSocketRequestResponsePair | null 608 + getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null 609 + setHibernatableWebSocketEventTimeout(timeoutMs?: number): void 610 + getHibernatableWebSocketEventTimeout(): number | null 611 + getTags(ws: WebSocket): string[] 612 + abort(reason?: string): void 613 + } 614 + interface DurableObjectTransaction { 615 + get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined> 616 + get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>> 617 + list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>> 618 + put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void> 619 + put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void> 620 + delete(key: string, options?: DurableObjectPutOptions): Promise<boolean> 621 + delete(keys: string[], options?: DurableObjectPutOptions): Promise<number> 622 + rollback(): void 623 + getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null> 624 + setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void> 625 + deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void> 626 + } 627 + interface DurableObjectStorage { 628 + get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined> 629 + get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>> 630 + list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>> 631 + put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void> 632 + put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void> 633 + delete(key: string, options?: DurableObjectPutOptions): Promise<boolean> 634 + delete(keys: string[], options?: DurableObjectPutOptions): Promise<number> 635 + deleteAll(options?: DurableObjectPutOptions): Promise<void> 636 + transaction<T>(closure: (txn: DurableObjectTransaction) => Promise<T>): Promise<T> 637 + getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null> 638 + setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void> 639 + deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void> 640 + sync(): Promise<void> 641 + sql: SqlStorage 642 + kv: SyncKvStorage 643 + transactionSync<T>(closure: () => T): T 644 + getCurrentBookmark(): Promise<string> 645 + getBookmarkForTime(timestamp: number | Date): Promise<string> 646 + onNextSessionRestoreBookmark(bookmark: string): Promise<string> 647 + } 648 + interface DurableObjectListOptions { 649 + start?: string 650 + startAfter?: string 651 + end?: string 652 + prefix?: string 653 + reverse?: boolean 654 + limit?: number 655 + allowConcurrency?: boolean 656 + noCache?: boolean 657 + } 658 + interface DurableObjectGetOptions { 659 + allowConcurrency?: boolean 660 + noCache?: boolean 661 + } 662 + interface DurableObjectGetAlarmOptions { 663 + allowConcurrency?: boolean 664 + } 665 + interface DurableObjectPutOptions { 666 + allowConcurrency?: boolean 667 + allowUnconfirmed?: boolean 668 + noCache?: boolean 669 + } 670 + interface DurableObjectSetAlarmOptions { 671 + allowConcurrency?: boolean 672 + allowUnconfirmed?: boolean 673 + } 674 + declare class WebSocketRequestResponsePair { 675 + constructor(request: string, response: string) 676 + get request(): string 677 + get response(): string 678 + } 679 + interface AnalyticsEngineDataset { 680 + writeDataPoint(event?: AnalyticsEngineDataPoint): void 681 + } 682 + interface AnalyticsEngineDataPoint { 683 + indexes?: ((ArrayBuffer | string) | null)[] 684 + doubles?: number[] 685 + blobs?: ((ArrayBuffer | string) | null)[] 686 + } 687 + /** 688 + * The **`Event`** interface represents an event which takes place on an `EventTarget`. 689 + * 690 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event) 691 + */ 692 + declare class Event { 693 + constructor(type: string, init?: EventInit) 694 + /** 695 + * The **`type`** read-only property of the Event interface returns a string containing the event's type. 696 + * 697 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type) 698 + */ 699 + get type(): string 700 + /** 701 + * The **`eventPhase`** read-only property of the being evaluated. 702 + * 703 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase) 704 + */ 705 + get eventPhase(): number 706 + /** 707 + * The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM. 708 + * 709 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed) 710 + */ 711 + get composed(): boolean 712 + /** 713 + * The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not. 714 + * 715 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles) 716 + */ 717 + get bubbles(): boolean 718 + /** 719 + * 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. 720 + * 721 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable) 722 + */ 723 + get cancelable(): boolean 724 + /** 725 + * 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. 726 + * 727 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented) 728 + */ 729 + get defaultPrevented(): boolean 730 + /** 731 + * The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not. 732 + * @deprecated 733 + * 734 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue) 735 + */ 736 + get returnValue(): boolean 737 + /** 738 + * The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached. 739 + * 740 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget) 741 + */ 742 + get currentTarget(): EventTarget | undefined 743 + /** 744 + * The read-only **`target`** property of the dispatched. 745 + * 746 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target) 747 + */ 748 + get target(): EventTarget | undefined 749 + /** 750 + * The deprecated **`Event.srcElement`** is an alias for the Event.target property. 751 + * @deprecated 752 + * 753 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement) 754 + */ 755 + get srcElement(): EventTarget | undefined 756 + /** 757 + * The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created. 758 + * 759 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp) 760 + */ 761 + get timeStamp(): number 762 + /** 763 + * 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. 764 + * 765 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted) 766 + */ 767 + get isTrusted(): boolean 768 + /** 769 + * The **`cancelBubble`** property of the Event interface is deprecated. 770 + * @deprecated 771 + * 772 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble) 773 + */ 774 + get cancelBubble(): boolean 775 + /** 776 + * The **`cancelBubble`** property of the Event interface is deprecated. 777 + * @deprecated 778 + * 779 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble) 780 + */ 781 + set cancelBubble(value: boolean) 782 + /** 783 + * 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. 784 + * 785 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) 786 + */ 787 + stopImmediatePropagation(): void 788 + /** 789 + * 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. 790 + * 791 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) 792 + */ 793 + preventDefault(): void 794 + /** 795 + * The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. 796 + * 797 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) 798 + */ 799 + stopPropagation(): void 800 + /** 801 + * 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. 802 + * 803 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath) 804 + */ 805 + composedPath(): EventTarget[] 806 + static readonly NONE: number 807 + static readonly CAPTURING_PHASE: number 808 + static readonly AT_TARGET: number 809 + static readonly BUBBLING_PHASE: number 810 + } 811 + interface EventInit { 812 + bubbles?: boolean 813 + cancelable?: boolean 814 + composed?: boolean 815 + } 816 + type EventListener<EventType extends Event = Event> = (event: EventType) => void 817 + interface EventListenerObject<EventType extends Event = Event> { 818 + handleEvent(event: EventType): void 819 + } 820 + type EventListenerOrEventListenerObject<EventType extends Event = Event> = 821 + | EventListener<EventType> 822 + | EventListenerObject<EventType> 823 + /** 824 + * The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them. 825 + * 826 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget) 827 + */ 828 + declare class EventTarget<EventMap extends Record<string, Event> = Record<string, Event>> { 829 + constructor() 830 + /** 831 + * The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. 832 + * 833 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) 834 + */ 835 + addEventListener<Type extends keyof EventMap>( 836 + type: Type, 837 + handler: EventListenerOrEventListenerObject<EventMap[Type]>, 838 + options?: EventTargetAddEventListenerOptions | boolean, 839 + ): void 840 + /** 841 + * The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. 842 + * 843 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) 844 + */ 845 + removeEventListener<Type extends keyof EventMap>( 846 + type: Type, 847 + handler: EventListenerOrEventListenerObject<EventMap[Type]>, 848 + options?: EventTargetEventListenerOptions | boolean, 849 + ): void 850 + /** 851 + * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. 852 + * 853 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) 854 + */ 855 + dispatchEvent(event: EventMap[keyof EventMap]): boolean 856 + } 857 + interface EventTargetEventListenerOptions { 858 + capture?: boolean 859 + } 860 + interface EventTargetAddEventListenerOptions { 861 + capture?: boolean 862 + passive?: boolean 863 + once?: boolean 864 + signal?: AbortSignal 865 + } 866 + interface EventTargetHandlerObject { 867 + handleEvent: (event: Event) => any | undefined 868 + } 869 + /** 870 + * The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired. 871 + * 872 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController) 873 + */ 874 + declare class AbortController { 875 + constructor() 876 + /** 877 + * 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. 878 + * 879 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal) 880 + */ 881 + get signal(): AbortSignal 882 + /** 883 + * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. 884 + * 885 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort) 886 + */ 887 + abort(reason?: any): void 888 + } 889 + /** 890 + * 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. 891 + * 892 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) 893 + */ 894 + declare abstract class AbortSignal extends EventTarget { 895 + /** 896 + * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event). 897 + * 898 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) 899 + */ 900 + static abort(reason?: any): AbortSignal 901 + /** 902 + * The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time. 903 + * 904 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) 905 + */ 906 + static timeout(delay: number): AbortSignal 907 + /** 908 + * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. 909 + * 910 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) 911 + */ 912 + static any(signals: AbortSignal[]): AbortSignal 913 + /** 914 + * 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`). 915 + * 916 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted) 917 + */ 918 + get aborted(): boolean 919 + /** 920 + * The **`reason`** read-only property returns a JavaScript value that indicates the abort reason. 921 + * 922 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) 923 + */ 924 + get reason(): any 925 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */ 926 + get onabort(): any | null 927 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */ 928 + set onabort(value: any | null) 929 + /** 930 + * The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing. 931 + * 932 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) 933 + */ 934 + throwIfAborted(): void 935 + } 936 + interface Scheduler { 937 + wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void> 938 + } 939 + interface SchedulerWaitOptions { 940 + signal?: AbortSignal 941 + } 942 + /** 943 + * The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle. 944 + * 945 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent) 946 + */ 947 + declare abstract class ExtendableEvent extends Event { 948 + /** 949 + * The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. 950 + * 951 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) 952 + */ 953 + waitUntil(promise: Promise<any>): void 954 + } 955 + /** 956 + * The **`CustomEvent`** interface represents events initialized by an application for any purpose. 957 + * 958 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) 959 + */ 960 + declare class CustomEvent<T = any> extends Event { 961 + constructor(type: string, init?: CustomEventCustomEventInit) 962 + /** 963 + * The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event. 964 + * 965 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail) 966 + */ 967 + get detail(): T 968 + } 969 + interface CustomEventCustomEventInit { 970 + bubbles?: boolean 971 + cancelable?: boolean 972 + composed?: boolean 973 + detail?: any 974 + } 975 + /** 976 + * 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. 977 + * 978 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob) 979 + */ 980 + declare class Blob { 981 + constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions) 982 + /** 983 + * The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes. 984 + * 985 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) 986 + */ 987 + get size(): number 988 + /** 989 + * The **`type`** read-only property of the Blob interface returns the MIME type of the file. 990 + * 991 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) 992 + */ 993 + get type(): string 994 + /** 995 + * 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. 996 + * 997 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) 998 + */ 999 + slice(start?: number, end?: number, type?: string): Blob 1000 + /** 1001 + * 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. 1002 + * 1003 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) 1004 + */ 1005 + arrayBuffer(): Promise<ArrayBuffer> 1006 + /** 1007 + * 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. 1008 + * 1009 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) 1010 + */ 1011 + bytes(): Promise<Uint8Array> 1012 + /** 1013 + * The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8. 1014 + * 1015 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) 1016 + */ 1017 + text(): Promise<string> 1018 + /** 1019 + * The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`. 1020 + * 1021 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) 1022 + */ 1023 + stream(): ReadableStream 1024 + } 1025 + interface BlobOptions { 1026 + type?: string 1027 + } 1028 + /** 1029 + * The **`File`** interface provides information about files and allows JavaScript in a web page to access their content. 1030 + * 1031 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File) 1032 + */ 1033 + declare class File extends Blob { 1034 + constructor( 1035 + bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, 1036 + name: string, 1037 + options?: FileOptions, 1038 + ) 1039 + /** 1040 + * The **`name`** read-only property of the File interface returns the name of the file represented by a File object. 1041 + * 1042 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) 1043 + */ 1044 + get name(): string 1045 + /** 1046 + * 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). 1047 + * 1048 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) 1049 + */ 1050 + get lastModified(): number 1051 + } 1052 + interface FileOptions { 1053 + type?: string 1054 + lastModified?: number 1055 + } 1056 + /** 1057 + * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache. 1058 + * 1059 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/) 1060 + */ 1061 + declare abstract class CacheStorage { 1062 + /** 1063 + * The **`open()`** method of the the Cache object matching the `cacheName`. 1064 + * 1065 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) 1066 + */ 1067 + open(cacheName: string): Promise<Cache> 1068 + readonly default: Cache 1069 + } 1070 + /** 1071 + * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache. 1072 + * 1073 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/) 1074 + */ 1075 + declare abstract class Cache { 1076 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */ 1077 + delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean> 1078 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */ 1079 + match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined> 1080 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */ 1081 + put(request: RequestInfo | URL, response: Response): Promise<void> 1082 + } 1083 + interface CacheQueryOptions { 1084 + ignoreMethod?: boolean 1085 + } 1086 + /** 1087 + * The Web Crypto API provides a set of low-level functions for common cryptographic tasks. 1088 + * The Workers runtime implements the full surface of this API, but with some differences in 1089 + * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms) 1090 + * compared to those implemented in most browsers. 1091 + * 1092 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/) 1093 + */ 1094 + declare abstract class Crypto { 1095 + /** 1096 + * The **`Crypto.subtle`** read-only property returns a cryptographic operations. 1097 + * Available only in secure contexts. 1098 + * 1099 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle) 1100 + */ 1101 + get subtle(): SubtleCrypto 1102 + /** 1103 + * The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. 1104 + * 1105 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) 1106 + */ 1107 + getRandomValues< 1108 + T extends 1109 + | Int8Array 1110 + | Uint8Array 1111 + | Int16Array 1112 + | Uint16Array 1113 + | Int32Array 1114 + | Uint32Array 1115 + | BigInt64Array 1116 + | BigUint64Array, 1117 + >(buffer: T): T 1118 + /** 1119 + * The **`randomUUID()`** method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator. 1120 + * Available only in secure contexts. 1121 + * 1122 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID) 1123 + */ 1124 + randomUUID(): string 1125 + DigestStream: typeof DigestStream 1126 + } 1127 + /** 1128 + * The **`SubtleCrypto`** interface of the Web Crypto API provides a number of low-level cryptographic functions. 1129 + * Available only in secure contexts. 1130 + * 1131 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto) 1132 + */ 1133 + declare abstract class SubtleCrypto { 1134 + /** 1135 + * The **`encrypt()`** method of the SubtleCrypto interface encrypts data. 1136 + * 1137 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) 1138 + */ 1139 + encrypt( 1140 + algorithm: string | SubtleCryptoEncryptAlgorithm, 1141 + key: CryptoKey, 1142 + plainText: ArrayBuffer | ArrayBufferView, 1143 + ): Promise<ArrayBuffer> 1144 + /** 1145 + * The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data. 1146 + * 1147 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) 1148 + */ 1149 + decrypt( 1150 + algorithm: string | SubtleCryptoEncryptAlgorithm, 1151 + key: CryptoKey, 1152 + cipherText: ArrayBuffer | ArrayBufferView, 1153 + ): Promise<ArrayBuffer> 1154 + /** 1155 + * The **`sign()`** method of the SubtleCrypto interface generates a digital signature. 1156 + * 1157 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) 1158 + */ 1159 + sign( 1160 + algorithm: string | SubtleCryptoSignAlgorithm, 1161 + key: CryptoKey, 1162 + data: ArrayBuffer | ArrayBufferView, 1163 + ): Promise<ArrayBuffer> 1164 + /** 1165 + * The **`verify()`** method of the SubtleCrypto interface verifies a digital signature. 1166 + * 1167 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) 1168 + */ 1169 + verify( 1170 + algorithm: string | SubtleCryptoSignAlgorithm, 1171 + key: CryptoKey, 1172 + signature: ArrayBuffer | ArrayBufferView, 1173 + data: ArrayBuffer | ArrayBufferView, 1174 + ): Promise<boolean> 1175 + /** 1176 + * The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function. 1177 + * 1178 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) 1179 + */ 1180 + digest( 1181 + algorithm: string | SubtleCryptoHashAlgorithm, 1182 + data: ArrayBuffer | ArrayBufferView, 1183 + ): Promise<ArrayBuffer> 1184 + /** 1185 + * The **`generateKey()`** method of the SubtleCrypto interface is used to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms). 1186 + * 1187 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) 1188 + */ 1189 + generateKey( 1190 + algorithm: string | SubtleCryptoGenerateKeyAlgorithm, 1191 + extractable: boolean, 1192 + keyUsages: string[], 1193 + ): Promise<CryptoKey | CryptoKeyPair> 1194 + /** 1195 + * The **`deriveKey()`** method of the SubtleCrypto interface can be used to derive a secret key from a master key. 1196 + * 1197 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) 1198 + */ 1199 + deriveKey( 1200 + algorithm: string | SubtleCryptoDeriveKeyAlgorithm, 1201 + baseKey: CryptoKey, 1202 + derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, 1203 + extractable: boolean, 1204 + keyUsages: string[], 1205 + ): Promise<CryptoKey> 1206 + /** 1207 + * The **`deriveBits()`** method of the key. 1208 + * 1209 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) 1210 + */ 1211 + deriveBits( 1212 + algorithm: string | SubtleCryptoDeriveKeyAlgorithm, 1213 + baseKey: CryptoKey, 1214 + length?: number | null, 1215 + ): Promise<ArrayBuffer> 1216 + /** 1217 + * 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. 1218 + * 1219 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) 1220 + */ 1221 + importKey( 1222 + format: string, 1223 + keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey, 1224 + algorithm: string | SubtleCryptoImportKeyAlgorithm, 1225 + extractable: boolean, 1226 + keyUsages: string[], 1227 + ): Promise<CryptoKey> 1228 + /** 1229 + * 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. 1230 + * 1231 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) 1232 + */ 1233 + exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey> 1234 + /** 1235 + * The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key. 1236 + * 1237 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) 1238 + */ 1239 + wrapKey( 1240 + format: string, 1241 + key: CryptoKey, 1242 + wrappingKey: CryptoKey, 1243 + wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm, 1244 + ): Promise<ArrayBuffer> 1245 + /** 1246 + * The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key. 1247 + * 1248 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) 1249 + */ 1250 + unwrapKey( 1251 + format: string, 1252 + wrappedKey: ArrayBuffer | ArrayBufferView, 1253 + unwrappingKey: CryptoKey, 1254 + unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm, 1255 + unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, 1256 + extractable: boolean, 1257 + keyUsages: string[], 1258 + ): Promise<CryptoKey> 1259 + timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean 1260 + } 1261 + /** 1262 + * 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. 1263 + * Available only in secure contexts. 1264 + * 1265 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey) 1266 + */ 1267 + declare abstract class CryptoKey { 1268 + /** 1269 + * The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object. 1270 + * 1271 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) 1272 + */ 1273 + readonly type: string 1274 + /** 1275 + * The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`. 1276 + * 1277 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) 1278 + */ 1279 + readonly extractable: boolean 1280 + /** 1281 + * 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. 1282 + * 1283 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) 1284 + */ 1285 + readonly algorithm: 1286 + | CryptoKeyKeyAlgorithm 1287 + | CryptoKeyAesKeyAlgorithm 1288 + | CryptoKeyHmacKeyAlgorithm 1289 + | CryptoKeyRsaKeyAlgorithm 1290 + | CryptoKeyEllipticKeyAlgorithm 1291 + | CryptoKeyArbitraryKeyAlgorithm 1292 + /** 1293 + * The read-only **`usages`** property of the CryptoKey interface indicates what can be done with the key. 1294 + * 1295 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) 1296 + */ 1297 + readonly usages: string[] 1298 + } 1299 + interface CryptoKeyPair { 1300 + publicKey: CryptoKey 1301 + privateKey: CryptoKey 1302 + } 1303 + interface JsonWebKey { 1304 + kty: string 1305 + use?: string 1306 + key_ops?: string[] 1307 + alg?: string 1308 + ext?: boolean 1309 + crv?: string 1310 + x?: string 1311 + y?: string 1312 + d?: string 1313 + n?: string 1314 + e?: string 1315 + p?: string 1316 + q?: string 1317 + dp?: string 1318 + dq?: string 1319 + qi?: string 1320 + oth?: RsaOtherPrimesInfo[] 1321 + k?: string 1322 + } 1323 + interface RsaOtherPrimesInfo { 1324 + r?: string 1325 + d?: string 1326 + t?: string 1327 + } 1328 + interface SubtleCryptoDeriveKeyAlgorithm { 1329 + name: string 1330 + salt?: ArrayBuffer | ArrayBufferView 1331 + iterations?: number 1332 + hash?: string | SubtleCryptoHashAlgorithm 1333 + $public?: CryptoKey 1334 + info?: ArrayBuffer | ArrayBufferView 1335 + } 1336 + interface SubtleCryptoEncryptAlgorithm { 1337 + name: string 1338 + iv?: ArrayBuffer | ArrayBufferView 1339 + additionalData?: ArrayBuffer | ArrayBufferView 1340 + tagLength?: number 1341 + counter?: ArrayBuffer | ArrayBufferView 1342 + length?: number 1343 + label?: ArrayBuffer | ArrayBufferView 1344 + } 1345 + interface SubtleCryptoGenerateKeyAlgorithm { 1346 + name: string 1347 + hash?: string | SubtleCryptoHashAlgorithm 1348 + modulusLength?: number 1349 + publicExponent?: ArrayBuffer | ArrayBufferView 1350 + length?: number 1351 + namedCurve?: string 1352 + } 1353 + interface SubtleCryptoHashAlgorithm { 1354 + name: string 1355 + } 1356 + interface SubtleCryptoImportKeyAlgorithm { 1357 + name: string 1358 + hash?: string | SubtleCryptoHashAlgorithm 1359 + length?: number 1360 + namedCurve?: string 1361 + compressed?: boolean 1362 + } 1363 + interface SubtleCryptoSignAlgorithm { 1364 + name: string 1365 + hash?: string | SubtleCryptoHashAlgorithm 1366 + dataLength?: number 1367 + saltLength?: number 1368 + } 1369 + interface CryptoKeyKeyAlgorithm { 1370 + name: string 1371 + } 1372 + interface CryptoKeyAesKeyAlgorithm { 1373 + name: string 1374 + length: number 1375 + } 1376 + interface CryptoKeyHmacKeyAlgorithm { 1377 + name: string 1378 + hash: CryptoKeyKeyAlgorithm 1379 + length: number 1380 + } 1381 + interface CryptoKeyRsaKeyAlgorithm { 1382 + name: string 1383 + modulusLength: number 1384 + publicExponent: ArrayBuffer | ArrayBufferView 1385 + hash?: CryptoKeyKeyAlgorithm 1386 + } 1387 + interface CryptoKeyEllipticKeyAlgorithm { 1388 + name: string 1389 + namedCurve: string 1390 + } 1391 + interface CryptoKeyArbitraryKeyAlgorithm { 1392 + name: string 1393 + hash?: CryptoKeyKeyAlgorithm 1394 + namedCurve?: string 1395 + length?: number 1396 + } 1397 + declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> { 1398 + constructor(algorithm: string | SubtleCryptoHashAlgorithm) 1399 + readonly digest: Promise<ArrayBuffer> 1400 + get bytesWritten(): number | bigint 1401 + } 1402 + /** 1403 + * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc. 1404 + * 1405 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder) 1406 + */ 1407 + declare class TextDecoder { 1408 + constructor(label?: string, options?: TextDecoderConstructorOptions) 1409 + /** 1410 + * The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. 1411 + * 1412 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode) 1413 + */ 1414 + decode(input?: ArrayBuffer | ArrayBufferView, options?: TextDecoderDecodeOptions): string 1415 + get encoding(): string 1416 + get fatal(): boolean 1417 + get ignoreBOM(): boolean 1418 + } 1419 + /** 1420 + * The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes. 1421 + * 1422 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder) 1423 + */ 1424 + declare class TextEncoder { 1425 + constructor() 1426 + /** 1427 + * 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. 1428 + * 1429 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode) 1430 + */ 1431 + encode(input?: string): Uint8Array 1432 + /** 1433 + * 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. 1434 + * 1435 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto) 1436 + */ 1437 + encodeInto(input: string, buffer: Uint8Array): TextEncoderEncodeIntoResult 1438 + get encoding(): string 1439 + } 1440 + interface TextDecoderConstructorOptions { 1441 + fatal: boolean 1442 + ignoreBOM: boolean 1443 + } 1444 + interface TextDecoderDecodeOptions { 1445 + stream: boolean 1446 + } 1447 + interface TextEncoderEncodeIntoResult { 1448 + read: number 1449 + written: number 1450 + } 1451 + /** 1452 + * The **`ErrorEvent`** interface represents events providing information related to errors in scripts or in files. 1453 + * 1454 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent) 1455 + */ 1456 + declare class ErrorEvent extends Event { 1457 + constructor(type: string, init?: ErrorEventErrorEventInit) 1458 + /** 1459 + * The **`filename`** read-only property of the ErrorEvent interface returns a string containing the name of the script file in which the error occurred. 1460 + * 1461 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) 1462 + */ 1463 + get filename(): string 1464 + /** 1465 + * The **`message`** read-only property of the ErrorEvent interface returns a string containing a human-readable error message describing the problem. 1466 + * 1467 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) 1468 + */ 1469 + get message(): string 1470 + /** 1471 + * 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. 1472 + * 1473 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) 1474 + */ 1475 + get lineno(): number 1476 + /** 1477 + * 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. 1478 + * 1479 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) 1480 + */ 1481 + get colno(): number 1482 + /** 1483 + * 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. 1484 + * 1485 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) 1486 + */ 1487 + get error(): any 1488 + } 1489 + interface ErrorEventErrorEventInit { 1490 + message?: string 1491 + filename?: string 1492 + lineno?: number 1493 + colno?: number 1494 + error?: any 1495 + } 1496 + /** 1497 + * The **`MessageEvent`** interface represents a message received by a target object. 1498 + * 1499 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent) 1500 + */ 1501 + declare class MessageEvent extends Event { 1502 + constructor(type: string, initializer: MessageEventInit) 1503 + /** 1504 + * 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. 1505 + * 1506 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data) 1507 + */ 1508 + readonly data: any 1509 + /** 1510 + * The **`origin`** read-only property of the origin of the message emitter. 1511 + * 1512 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin) 1513 + */ 1514 + readonly origin: string | null 1515 + /** 1516 + * The **`lastEventId`** read-only property of the unique ID for the event. 1517 + * 1518 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId) 1519 + */ 1520 + readonly lastEventId: string 1521 + /** 1522 + * The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter. 1523 + * 1524 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source) 1525 + */ 1526 + readonly source: MessagePort | null 1527 + /** 1528 + * The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order. 1529 + * 1530 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports) 1531 + */ 1532 + readonly ports: MessagePort[] 1533 + } 1534 + interface MessageEventInit { 1535 + data: ArrayBuffer | string 1536 + } 1537 + /** 1538 + * The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected. 1539 + * 1540 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) 1541 + */ 1542 + declare abstract class PromiseRejectionEvent extends Event { 1543 + /** 1544 + * The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected. 1545 + * 1546 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) 1547 + */ 1548 + readonly promise: Promise<any> 1549 + /** 1550 + * The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject(). 1551 + * 1552 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) 1553 + */ 1554 + readonly reason: any 1555 + } 1556 + /** 1557 + * 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. 1558 + * 1559 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData) 1560 + */ 1561 + declare class FormData { 1562 + constructor() 1563 + /** 1564 + * 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. 1565 + * 1566 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) 1567 + */ 1568 + append(name: string, value: string): void 1569 + /** 1570 + * 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. 1571 + * 1572 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) 1573 + */ 1574 + append(name: string, value: Blob, filename?: string): void 1575 + /** 1576 + * The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object. 1577 + * 1578 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) 1579 + */ 1580 + delete(name: string): void 1581 + /** 1582 + * The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object. 1583 + * 1584 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) 1585 + */ 1586 + get(name: string): (File | string) | null 1587 + /** 1588 + * The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object. 1589 + * 1590 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) 1591 + */ 1592 + getAll(name: string): (File | string)[] 1593 + /** 1594 + * The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key. 1595 + * 1596 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) 1597 + */ 1598 + has(name: string): boolean 1599 + /** 1600 + * 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. 1601 + * 1602 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) 1603 + */ 1604 + set(name: string, value: string): void 1605 + /** 1606 + * 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. 1607 + * 1608 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) 1609 + */ 1610 + set(name: string, value: Blob, filename?: string): void 1611 + /* Returns an array of key, value pairs for every entry in the list. */ 1612 + entries(): IterableIterator<[key: string, value: File | string]> 1613 + /* Returns a list of keys in the list. */ 1614 + keys(): IterableIterator<string> 1615 + /* Returns a list of values in the list. */ 1616 + values(): IterableIterator<File | string> 1617 + forEach<This = unknown>( 1618 + callback: (this: This, value: File | string, key: string, parent: FormData) => void, 1619 + thisArg?: This, 1620 + ): void 1621 + [Symbol.iterator](): IterableIterator<[key: string, value: File | string]> 1622 + } 1623 + interface ContentOptions { 1624 + html?: boolean 1625 + } 1626 + declare class HTMLRewriter { 1627 + constructor() 1628 + on(selector: string, handlers: HTMLRewriterElementContentHandlers): HTMLRewriter 1629 + onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter 1630 + transform(response: Response): Response 1631 + } 1632 + interface HTMLRewriterElementContentHandlers { 1633 + element?(element: Element): void | Promise<void> 1634 + comments?(comment: Comment): void | Promise<void> 1635 + text?(element: Text): void | Promise<void> 1636 + } 1637 + interface HTMLRewriterDocumentContentHandlers { 1638 + doctype?(doctype: Doctype): void | Promise<void> 1639 + comments?(comment: Comment): void | Promise<void> 1640 + text?(text: Text): void | Promise<void> 1641 + end?(end: DocumentEnd): void | Promise<void> 1642 + } 1643 + interface Doctype { 1644 + readonly name: string | null 1645 + readonly publicId: string | null 1646 + readonly systemId: string | null 1647 + } 1648 + interface Element { 1649 + tagName: string 1650 + readonly attributes: IterableIterator<string[]> 1651 + readonly removed: boolean 1652 + readonly namespaceURI: string 1653 + getAttribute(name: string): string | null 1654 + hasAttribute(name: string): boolean 1655 + setAttribute(name: string, value: string): Element 1656 + removeAttribute(name: string): Element 1657 + before(content: string | ReadableStream | Response, options?: ContentOptions): Element 1658 + after(content: string | ReadableStream | Response, options?: ContentOptions): Element 1659 + prepend(content: string | ReadableStream | Response, options?: ContentOptions): Element 1660 + append(content: string | ReadableStream | Response, options?: ContentOptions): Element 1661 + replace(content: string | ReadableStream | Response, options?: ContentOptions): Element 1662 + remove(): Element 1663 + removeAndKeepContent(): Element 1664 + setInnerContent(content: string | ReadableStream | Response, options?: ContentOptions): Element 1665 + onEndTag(handler: (tag: EndTag) => void | Promise<void>): void 1666 + } 1667 + interface EndTag { 1668 + name: string 1669 + before(content: string | ReadableStream | Response, options?: ContentOptions): EndTag 1670 + after(content: string | ReadableStream | Response, options?: ContentOptions): EndTag 1671 + remove(): EndTag 1672 + } 1673 + interface Comment { 1674 + text: string 1675 + readonly removed: boolean 1676 + before(content: string, options?: ContentOptions): Comment 1677 + after(content: string, options?: ContentOptions): Comment 1678 + replace(content: string, options?: ContentOptions): Comment 1679 + remove(): Comment 1680 + } 1681 + interface Text { 1682 + readonly text: string 1683 + readonly lastInTextNode: boolean 1684 + readonly removed: boolean 1685 + before(content: string | ReadableStream | Response, options?: ContentOptions): Text 1686 + after(content: string | ReadableStream | Response, options?: ContentOptions): Text 1687 + replace(content: string | ReadableStream | Response, options?: ContentOptions): Text 1688 + remove(): Text 1689 + } 1690 + interface DocumentEnd { 1691 + append(content: string, options?: ContentOptions): DocumentEnd 1692 + } 1693 + /** 1694 + * This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope. 1695 + * 1696 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent) 1697 + */ 1698 + declare abstract class FetchEvent extends ExtendableEvent { 1699 + /** 1700 + * The **`request`** read-only property of the the event handler. 1701 + * 1702 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) 1703 + */ 1704 + readonly request: Request 1705 + /** 1706 + * The **`respondWith()`** method of allows you to provide a promise for a Response yourself. 1707 + * 1708 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) 1709 + */ 1710 + respondWith(promise: Response | Promise<Response>): void 1711 + passThroughOnException(): void 1712 + } 1713 + type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string> 1714 + /** 1715 + * The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers. 1716 + * 1717 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers) 1718 + */ 1719 + declare class Headers { 1720 + constructor(init?: HeadersInit) 1721 + /** 1722 + * 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. 1723 + * 1724 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) 1725 + */ 1726 + get(name: string): string | null 1727 + getAll(name: string): string[] 1728 + /** 1729 + * The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. 1730 + * 1731 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) 1732 + */ 1733 + getSetCookie(): string[] 1734 + /** 1735 + * The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header. 1736 + * 1737 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) 1738 + */ 1739 + has(name: string): boolean 1740 + /** 1741 + * 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. 1742 + * 1743 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) 1744 + */ 1745 + set(name: string, value: string): void 1746 + /** 1747 + * 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. 1748 + * 1749 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) 1750 + */ 1751 + append(name: string, value: string): void 1752 + /** 1753 + * The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object. 1754 + * 1755 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) 1756 + */ 1757 + delete(name: string): void 1758 + forEach<This = unknown>( 1759 + callback: (this: This, value: string, key: string, parent: Headers) => void, 1760 + thisArg?: This, 1761 + ): void 1762 + /* Returns an iterator allowing to go through all key/value pairs contained in this object. */ 1763 + entries(): IterableIterator<[key: string, value: string]> 1764 + /* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */ 1765 + keys(): IterableIterator<string> 1766 + /* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */ 1767 + values(): IterableIterator<string> 1768 + [Symbol.iterator](): IterableIterator<[key: string, value: string]> 1769 + } 1770 + type BodyInit = 1771 + | ReadableStream<Uint8Array> 1772 + | string 1773 + | ArrayBuffer 1774 + | ArrayBufferView 1775 + | Blob 1776 + | URLSearchParams 1777 + | FormData 1778 + declare abstract class Body { 1779 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */ 1780 + get body(): ReadableStream | null 1781 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ 1782 + get bodyUsed(): boolean 1783 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */ 1784 + arrayBuffer(): Promise<ArrayBuffer> 1785 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */ 1786 + bytes(): Promise<Uint8Array> 1787 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */ 1788 + text(): Promise<string> 1789 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */ 1790 + json<T>(): Promise<T> 1791 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ 1792 + formData(): Promise<FormData> 1793 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ 1794 + blob(): Promise<Blob> 1795 + } 1796 + /** 1797 + * The **`Response`** interface of the Fetch API represents the response to a request. 1798 + * 1799 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response) 1800 + */ 1801 + declare var Response: { 1802 + prototype: Response 1803 + new (body?: BodyInit | null, init?: ResponseInit): Response 1804 + error(): Response 1805 + redirect(url: string, status?: number): Response 1806 + json(any: any, maybeInit?: ResponseInit | Response): Response 1807 + } 1808 + /** 1809 + * The **`Response`** interface of the Fetch API represents the response to a request. 1810 + * 1811 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response) 1812 + */ 1813 + interface Response extends Body { 1814 + /** 1815 + * The **`clone()`** method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable. 1816 + * 1817 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) 1818 + */ 1819 + clone(): Response 1820 + /** 1821 + * The **`status`** read-only property of the Response interface contains the HTTP status codes of the response. 1822 + * 1823 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) 1824 + */ 1825 + status: number 1826 + /** 1827 + * The **`statusText`** read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status. 1828 + * 1829 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) 1830 + */ 1831 + statusText: string 1832 + /** 1833 + * The **`headers`** read-only property of the with the response. 1834 + * 1835 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) 1836 + */ 1837 + headers: Headers 1838 + /** 1839 + * 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. 1840 + * 1841 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) 1842 + */ 1843 + ok: boolean 1844 + /** 1845 + * 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. 1846 + * 1847 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) 1848 + */ 1849 + redirected: boolean 1850 + /** 1851 + * The **`url`** read-only property of the Response interface contains the URL of the response. 1852 + * 1853 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) 1854 + */ 1855 + url: string 1856 + webSocket: WebSocket | null 1857 + cf: any | undefined 1858 + /** 1859 + * The **`type`** read-only property of the Response interface contains the type of the response. 1860 + * 1861 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type) 1862 + */ 1863 + type: 'default' | 'error' 1864 + } 1865 + interface ResponseInit { 1866 + status?: number 1867 + statusText?: string 1868 + headers?: HeadersInit 1869 + cf?: any 1870 + webSocket?: WebSocket | null 1871 + encodeBody?: 'automatic' | 'manual' 1872 + } 1873 + type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> = 1874 + | Request<CfHostMetadata, Cf> 1875 + | string 1876 + /** 1877 + * The **`Request`** interface of the Fetch API represents a resource request. 1878 + * 1879 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request) 1880 + */ 1881 + declare var Request: { 1882 + prototype: Request 1883 + new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>( 1884 + input: RequestInfo<CfProperties> | URL, 1885 + init?: RequestInit<Cf>, 1886 + ): Request<CfHostMetadata, Cf> 1887 + } 1888 + /** 1889 + * The **`Request`** interface of the Fetch API represents a resource request. 1890 + * 1891 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request) 1892 + */ 1893 + interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body { 1894 + /** 1895 + * The **`clone()`** method of the Request interface creates a copy of the current `Request` object. 1896 + * 1897 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) 1898 + */ 1899 + clone(): Request<CfHostMetadata, Cf> 1900 + /** 1901 + * The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request. 1902 + * 1903 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method) 1904 + */ 1905 + method: string 1906 + /** 1907 + * The **`url`** read-only property of the Request interface contains the URL of the request. 1908 + * 1909 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url) 1910 + */ 1911 + url: string 1912 + /** 1913 + * The **`headers`** read-only property of the with the request. 1914 + * 1915 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers) 1916 + */ 1917 + headers: Headers 1918 + /** 1919 + * The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled. 1920 + * 1921 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect) 1922 + */ 1923 + redirect: string 1924 + fetcher: Fetcher | null 1925 + /** 1926 + * The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request. 1927 + * 1928 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal) 1929 + */ 1930 + signal: AbortSignal 1931 + cf: Cf | undefined 1932 + /** 1933 + * The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request. 1934 + * 1935 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity) 1936 + */ 1937 + integrity: string 1938 + /** 1939 + * 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. 1940 + * 1941 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive) 1942 + */ 1943 + keepalive: boolean 1944 + /** 1945 + * The **`cache`** read-only property of the Request interface contains the cache mode of the request. 1946 + * 1947 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache) 1948 + */ 1949 + cache?: 'no-store' | 'no-cache' 1950 + } 1951 + interface RequestInit<Cf = CfProperties> { 1952 + /* A string to set request's method. */ 1953 + method?: string 1954 + /* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */ 1955 + headers?: HeadersInit 1956 + /* A BodyInit object or null to set request's body. */ 1957 + body?: BodyInit | null 1958 + /* 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. */ 1959 + redirect?: string 1960 + fetcher?: Fetcher | null 1961 + cf?: Cf 1962 + /* A string indicating how the request will interact with the browser's cache to set request's cache. */ 1963 + cache?: 'no-store' | 'no-cache' 1964 + /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */ 1965 + integrity?: string 1966 + /* An AbortSignal to set request's signal. */ 1967 + signal?: AbortSignal | null 1968 + encodeResponseBody?: 'automatic' | 'manual' 1969 + } 1970 + type Service< 1971 + T extends 1972 + | (new (...args: any[]) => Rpc.WorkerEntrypointBranded) 1973 + | Rpc.WorkerEntrypointBranded 1974 + | ExportedHandler<any, any, any> 1975 + | undefined = undefined, 1976 + > = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded 1977 + ? Fetcher<InstanceType<T>> 1978 + : T extends Rpc.WorkerEntrypointBranded 1979 + ? Fetcher<T> 1980 + : T extends Exclude<Rpc.EntrypointBranded, Rpc.WorkerEntrypointBranded> 1981 + ? never 1982 + : Fetcher<undefined> 1983 + type Fetcher< 1984 + T extends Rpc.EntrypointBranded | undefined = undefined, 1985 + Reserved extends string = never, 1986 + > = (T extends Rpc.EntrypointBranded 1987 + ? Rpc.Provider<T, Reserved | 'fetch' | 'connect'> 1988 + : unknown) & { 1989 + fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> 1990 + connect(address: SocketAddress | string, options?: SocketOptions): Socket 1991 + } 1992 + interface KVNamespaceListKey<Metadata, Key extends string = string> { 1993 + name: Key 1994 + expiration?: number 1995 + metadata?: Metadata 1996 + } 1997 + type KVNamespaceListResult<Metadata, Key extends string = string> = 1998 + | { 1999 + list_complete: false 2000 + keys: KVNamespaceListKey<Metadata, Key>[] 2001 + cursor: string 2002 + cacheStatus: string | null 2003 + } 2004 + | { 2005 + list_complete: true 2006 + keys: KVNamespaceListKey<Metadata, Key>[] 2007 + cacheStatus: string | null 2008 + } 2009 + interface KVNamespace<Key extends string = string> { 2010 + get(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<string | null> 2011 + get(key: Key, type: 'text'): Promise<string | null> 2012 + get<ExpectedValue = unknown>(key: Key, type: 'json'): Promise<ExpectedValue | null> 2013 + get(key: Key, type: 'arrayBuffer'): Promise<ArrayBuffer | null> 2014 + get(key: Key, type: 'stream'): Promise<ReadableStream | null> 2015 + get(key: Key, options?: KVNamespaceGetOptions<'text'>): Promise<string | null> 2016 + get<ExpectedValue = unknown>( 2017 + key: Key, 2018 + options?: KVNamespaceGetOptions<'json'>, 2019 + ): Promise<ExpectedValue | null> 2020 + get(key: Key, options?: KVNamespaceGetOptions<'arrayBuffer'>): Promise<ArrayBuffer | null> 2021 + get(key: Key, options?: KVNamespaceGetOptions<'stream'>): Promise<ReadableStream | null> 2022 + get(key: Array<Key>, type: 'text'): Promise<Map<string, string | null>> 2023 + get<ExpectedValue = unknown>( 2024 + key: Array<Key>, 2025 + type: 'json', 2026 + ): Promise<Map<string, ExpectedValue | null>> 2027 + get( 2028 + key: Array<Key>, 2029 + options?: Partial<KVNamespaceGetOptions<undefined>>, 2030 + ): Promise<Map<string, string | null>> 2031 + get(key: Array<Key>, options?: KVNamespaceGetOptions<'text'>): Promise<Map<string, string | null>> 2032 + get<ExpectedValue = unknown>( 2033 + key: Array<Key>, 2034 + options?: KVNamespaceGetOptions<'json'>, 2035 + ): Promise<Map<string, ExpectedValue | null>> 2036 + list<Metadata = unknown>( 2037 + options?: KVNamespaceListOptions, 2038 + ): Promise<KVNamespaceListResult<Metadata, Key>> 2039 + put( 2040 + key: Key, 2041 + value: string | ArrayBuffer | ArrayBufferView | ReadableStream, 2042 + options?: KVNamespacePutOptions, 2043 + ): Promise<void> 2044 + getWithMetadata<Metadata = unknown>( 2045 + key: Key, 2046 + options?: Partial<KVNamespaceGetOptions<undefined>>, 2047 + ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>> 2048 + getWithMetadata<Metadata = unknown>( 2049 + key: Key, 2050 + type: 'text', 2051 + ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>> 2052 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>( 2053 + key: Key, 2054 + type: 'json', 2055 + ): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>> 2056 + getWithMetadata<Metadata = unknown>( 2057 + key: Key, 2058 + type: 'arrayBuffer', 2059 + ): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>> 2060 + getWithMetadata<Metadata = unknown>( 2061 + key: Key, 2062 + type: 'stream', 2063 + ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>> 2064 + getWithMetadata<Metadata = unknown>( 2065 + key: Key, 2066 + options: KVNamespaceGetOptions<'text'>, 2067 + ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>> 2068 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>( 2069 + key: Key, 2070 + options: KVNamespaceGetOptions<'json'>, 2071 + ): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>> 2072 + getWithMetadata<Metadata = unknown>( 2073 + key: Key, 2074 + options: KVNamespaceGetOptions<'arrayBuffer'>, 2075 + ): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>> 2076 + getWithMetadata<Metadata = unknown>( 2077 + key: Key, 2078 + options: KVNamespaceGetOptions<'stream'>, 2079 + ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>> 2080 + getWithMetadata<Metadata = unknown>( 2081 + key: Array<Key>, 2082 + type: 'text', 2083 + ): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>> 2084 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>( 2085 + key: Array<Key>, 2086 + type: 'json', 2087 + ): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>> 2088 + getWithMetadata<Metadata = unknown>( 2089 + key: Array<Key>, 2090 + options?: Partial<KVNamespaceGetOptions<undefined>>, 2091 + ): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>> 2092 + getWithMetadata<Metadata = unknown>( 2093 + key: Array<Key>, 2094 + options?: KVNamespaceGetOptions<'text'>, 2095 + ): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>> 2096 + getWithMetadata<ExpectedValue = unknown, Metadata = unknown>( 2097 + key: Array<Key>, 2098 + options?: KVNamespaceGetOptions<'json'>, 2099 + ): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>> 2100 + delete(key: Key): Promise<void> 2101 + } 2102 + interface KVNamespaceListOptions { 2103 + limit?: number 2104 + prefix?: string | null 2105 + cursor?: string | null 2106 + } 2107 + interface KVNamespaceGetOptions<Type> { 2108 + type: Type 2109 + cacheTtl?: number 2110 + } 2111 + interface KVNamespacePutOptions { 2112 + expiration?: number 2113 + expirationTtl?: number 2114 + metadata?: any | null 2115 + } 2116 + interface KVNamespaceGetWithMetadataResult<Value, Metadata> { 2117 + value: Value | null 2118 + metadata: Metadata | null 2119 + cacheStatus: string | null 2120 + } 2121 + type QueueContentType = 'text' | 'bytes' | 'json' | 'v8' 2122 + interface Queue<Body = unknown> { 2123 + send(message: Body, options?: QueueSendOptions): Promise<void> 2124 + sendBatch( 2125 + messages: Iterable<MessageSendRequest<Body>>, 2126 + options?: QueueSendBatchOptions, 2127 + ): Promise<void> 2128 + } 2129 + interface QueueSendOptions { 2130 + contentType?: QueueContentType 2131 + delaySeconds?: number 2132 + } 2133 + interface QueueSendBatchOptions { 2134 + delaySeconds?: number 2135 + } 2136 + interface MessageSendRequest<Body = unknown> { 2137 + body: Body 2138 + contentType?: QueueContentType 2139 + delaySeconds?: number 2140 + } 2141 + interface QueueRetryOptions { 2142 + delaySeconds?: number 2143 + } 2144 + interface Message<Body = unknown> { 2145 + readonly id: string 2146 + readonly timestamp: Date 2147 + readonly body: Body 2148 + readonly attempts: number 2149 + retry(options?: QueueRetryOptions): void 2150 + ack(): void 2151 + } 2152 + interface QueueEvent<Body = unknown> extends ExtendableEvent { 2153 + readonly messages: readonly Message<Body>[] 2154 + readonly queue: string 2155 + retryAll(options?: QueueRetryOptions): void 2156 + ackAll(): void 2157 + } 2158 + interface MessageBatch<Body = unknown> { 2159 + readonly messages: readonly Message<Body>[] 2160 + readonly queue: string 2161 + retryAll(options?: QueueRetryOptions): void 2162 + ackAll(): void 2163 + } 2164 + interface R2Error extends Error { 2165 + readonly name: string 2166 + readonly code: number 2167 + readonly message: string 2168 + readonly action: string 2169 + readonly stack: any 2170 + } 2171 + interface R2ListOptions { 2172 + limit?: number 2173 + prefix?: string 2174 + cursor?: string 2175 + delimiter?: string 2176 + startAfter?: string 2177 + include?: ('httpMetadata' | 'customMetadata')[] 2178 + } 2179 + declare abstract class R2Bucket { 2180 + head(key: string): Promise<R2Object | null> 2181 + get( 2182 + key: string, 2183 + options: R2GetOptions & { 2184 + onlyIf: R2Conditional | Headers 2185 + }, 2186 + ): Promise<R2ObjectBody | R2Object | null> 2187 + get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null> 2188 + put( 2189 + key: string, 2190 + value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, 2191 + options?: R2PutOptions & { 2192 + onlyIf: R2Conditional | Headers 2193 + }, 2194 + ): Promise<R2Object | null> 2195 + put( 2196 + key: string, 2197 + value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, 2198 + options?: R2PutOptions, 2199 + ): Promise<R2Object> 2200 + createMultipartUpload(key: string, options?: R2MultipartOptions): Promise<R2MultipartUpload> 2201 + resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload 2202 + delete(keys: string | string[]): Promise<void> 2203 + list(options?: R2ListOptions): Promise<R2Objects> 2204 + } 2205 + interface R2MultipartUpload { 2206 + readonly key: string 2207 + readonly uploadId: string 2208 + uploadPart( 2209 + partNumber: number, 2210 + value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob, 2211 + options?: R2UploadPartOptions, 2212 + ): Promise<R2UploadedPart> 2213 + abort(): Promise<void> 2214 + complete(uploadedParts: R2UploadedPart[]): Promise<R2Object> 2215 + } 2216 + interface R2UploadedPart { 2217 + partNumber: number 2218 + etag: string 2219 + } 2220 + declare abstract class R2Object { 2221 + readonly key: string 2222 + readonly version: string 2223 + readonly size: number 2224 + readonly etag: string 2225 + readonly httpEtag: string 2226 + readonly checksums: R2Checksums 2227 + readonly uploaded: Date 2228 + readonly httpMetadata?: R2HTTPMetadata 2229 + readonly customMetadata?: Record<string, string> 2230 + readonly range?: R2Range 2231 + readonly storageClass: string 2232 + readonly ssecKeyMd5?: string 2233 + writeHttpMetadata(headers: Headers): void 2234 + } 2235 + interface R2ObjectBody extends R2Object { 2236 + get body(): ReadableStream 2237 + get bodyUsed(): boolean 2238 + arrayBuffer(): Promise<ArrayBuffer> 2239 + bytes(): Promise<Uint8Array> 2240 + text(): Promise<string> 2241 + json<T>(): Promise<T> 2242 + blob(): Promise<Blob> 2243 + } 2244 + type R2Range = 2245 + | { 2246 + offset: number 2247 + length?: number 2248 + } 2249 + | { 2250 + offset?: number 2251 + length: number 2252 + } 2253 + | { 2254 + suffix: number 2255 + } 2256 + interface R2Conditional { 2257 + etagMatches?: string 2258 + etagDoesNotMatch?: string 2259 + uploadedBefore?: Date 2260 + uploadedAfter?: Date 2261 + secondsGranularity?: boolean 2262 + } 2263 + interface R2GetOptions { 2264 + onlyIf?: R2Conditional | Headers 2265 + range?: R2Range | Headers 2266 + ssecKey?: ArrayBuffer | string 2267 + } 2268 + interface R2PutOptions { 2269 + onlyIf?: R2Conditional | Headers 2270 + httpMetadata?: R2HTTPMetadata | Headers 2271 + customMetadata?: Record<string, string> 2272 + md5?: (ArrayBuffer | ArrayBufferView) | string 2273 + sha1?: (ArrayBuffer | ArrayBufferView) | string 2274 + sha256?: (ArrayBuffer | ArrayBufferView) | string 2275 + sha384?: (ArrayBuffer | ArrayBufferView) | string 2276 + sha512?: (ArrayBuffer | ArrayBufferView) | string 2277 + storageClass?: string 2278 + ssecKey?: ArrayBuffer | string 2279 + } 2280 + interface R2MultipartOptions { 2281 + httpMetadata?: R2HTTPMetadata | Headers 2282 + customMetadata?: Record<string, string> 2283 + storageClass?: string 2284 + ssecKey?: ArrayBuffer | string 2285 + } 2286 + interface R2Checksums { 2287 + readonly md5?: ArrayBuffer 2288 + readonly sha1?: ArrayBuffer 2289 + readonly sha256?: ArrayBuffer 2290 + readonly sha384?: ArrayBuffer 2291 + readonly sha512?: ArrayBuffer 2292 + toJSON(): R2StringChecksums 2293 + } 2294 + interface R2StringChecksums { 2295 + md5?: string 2296 + sha1?: string 2297 + sha256?: string 2298 + sha384?: string 2299 + sha512?: string 2300 + } 2301 + interface R2HTTPMetadata { 2302 + contentType?: string 2303 + contentLanguage?: string 2304 + contentDisposition?: string 2305 + contentEncoding?: string 2306 + cacheControl?: string 2307 + cacheExpiry?: Date 2308 + } 2309 + type R2Objects = { 2310 + objects: R2Object[] 2311 + delimitedPrefixes: string[] 2312 + } & ( 2313 + | { 2314 + truncated: true 2315 + cursor: string 2316 + } 2317 + | { 2318 + truncated: false 2319 + } 2320 + ) 2321 + interface R2UploadPartOptions { 2322 + ssecKey?: ArrayBuffer | string 2323 + } 2324 + declare abstract class ScheduledEvent extends ExtendableEvent { 2325 + readonly scheduledTime: number 2326 + readonly cron: string 2327 + noRetry(): void 2328 + } 2329 + interface ScheduledController { 2330 + readonly scheduledTime: number 2331 + readonly cron: string 2332 + noRetry(): void 2333 + } 2334 + interface QueuingStrategy<T = any> { 2335 + highWaterMark?: number | bigint 2336 + size?: (chunk: T) => number | bigint 2337 + } 2338 + interface UnderlyingSink<W = any> { 2339 + type?: string 2340 + start?: (controller: WritableStreamDefaultController) => void | Promise<void> 2341 + write?: (chunk: W, controller: WritableStreamDefaultController) => void | Promise<void> 2342 + abort?: (reason: any) => void | Promise<void> 2343 + close?: () => void | Promise<void> 2344 + } 2345 + interface UnderlyingByteSource { 2346 + type: 'bytes' 2347 + autoAllocateChunkSize?: number 2348 + start?: (controller: ReadableByteStreamController) => void | Promise<void> 2349 + pull?: (controller: ReadableByteStreamController) => void | Promise<void> 2350 + cancel?: (reason: any) => void | Promise<void> 2351 + } 2352 + interface UnderlyingSource<R = any> { 2353 + type?: '' | undefined 2354 + start?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void> 2355 + pull?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void> 2356 + cancel?: (reason: any) => void | Promise<void> 2357 + expectedLength?: number | bigint 2358 + } 2359 + interface Transformer<I = any, O = any> { 2360 + readableType?: string 2361 + writableType?: string 2362 + start?: (controller: TransformStreamDefaultController<O>) => void | Promise<void> 2363 + transform?: (chunk: I, controller: TransformStreamDefaultController<O>) => void | Promise<void> 2364 + flush?: (controller: TransformStreamDefaultController<O>) => void | Promise<void> 2365 + cancel?: (reason: any) => void | Promise<void> 2366 + expectedLength?: number 2367 + } 2368 + interface StreamPipeOptions { 2369 + /** 2370 + * 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. 2371 + * 2372 + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. 2373 + * 2374 + * Errors and closures of the source and destination streams propagate as follows: 2375 + * 2376 + * 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. 2377 + * 2378 + * 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. 2379 + * 2380 + * 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. 2381 + * 2382 + * 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. 2383 + * 2384 + * 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. 2385 + */ 2386 + preventClose?: boolean 2387 + preventAbort?: boolean 2388 + preventCancel?: boolean 2389 + signal?: AbortSignal 2390 + } 2391 + type ReadableStreamReadResult<R = any> = 2392 + | { 2393 + done: false 2394 + value: R 2395 + } 2396 + | { 2397 + done: true 2398 + value?: undefined 2399 + } 2400 + /** 2401 + * The `ReadableStream` interface of the Streams API represents a readable stream of byte data. 2402 + * 2403 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream) 2404 + */ 2405 + interface ReadableStream<R = any> { 2406 + /** 2407 + * The **`locked`** read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader. 2408 + * 2409 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) 2410 + */ 2411 + get locked(): boolean 2412 + /** 2413 + * The **`cancel()`** method of the ReadableStream interface returns a Promise that resolves when the stream is canceled. 2414 + * 2415 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) 2416 + */ 2417 + cancel(reason?: any): Promise<void> 2418 + /** 2419 + * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. 2420 + * 2421 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) 2422 + */ 2423 + getReader(): ReadableStreamDefaultReader<R> 2424 + /** 2425 + * The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it. 2426 + * 2427 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) 2428 + */ 2429 + getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader 2430 + /** 2431 + * 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. 2432 + * 2433 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) 2434 + */ 2435 + pipeThrough<T>( 2436 + transform: ReadableWritablePair<T, R>, 2437 + options?: StreamPipeOptions, 2438 + ): ReadableStream<T> 2439 + /** 2440 + * 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. 2441 + * 2442 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) 2443 + */ 2444 + pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void> 2445 + /** 2446 + * The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances. 2447 + * 2448 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) 2449 + */ 2450 + tee(): [ReadableStream<R>, ReadableStream<R>] 2451 + values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R> 2452 + [Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R> 2453 + } 2454 + /** 2455 + * The `ReadableStream` interface of the Streams API represents a readable stream of byte data. 2456 + * 2457 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream) 2458 + */ 2459 + declare const ReadableStream: { 2460 + prototype: ReadableStream 2461 + new ( 2462 + underlyingSource: UnderlyingByteSource, 2463 + strategy?: QueuingStrategy<Uint8Array>, 2464 + ): ReadableStream<Uint8Array> 2465 + new <R = any>( 2466 + underlyingSource?: UnderlyingSource<R>, 2467 + strategy?: QueuingStrategy<R>, 2468 + ): ReadableStream<R> 2469 + } 2470 + /** 2471 + * 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). 2472 + * 2473 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) 2474 + */ 2475 + declare class ReadableStreamDefaultReader<R = any> { 2476 + constructor(stream: ReadableStream) 2477 + get closed(): Promise<void> 2478 + cancel(reason?: any): Promise<void> 2479 + /** 2480 + * The **`read()`** method of the ReadableStreamDefaultReader interface returns a Promise providing access to the next chunk in the stream's internal queue. 2481 + * 2482 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) 2483 + */ 2484 + read(): Promise<ReadableStreamReadResult<R>> 2485 + /** 2486 + * The **`releaseLock()`** method of the ReadableStreamDefaultReader interface releases the reader's lock on the stream. 2487 + * 2488 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) 2489 + */ 2490 + releaseLock(): void 2491 + } 2492 + /** 2493 + * The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source. 2494 + * 2495 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) 2496 + */ 2497 + declare class ReadableStreamBYOBReader { 2498 + constructor(stream: ReadableStream) 2499 + get closed(): Promise<void> 2500 + cancel(reason?: any): Promise<void> 2501 + /** 2502 + * 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. 2503 + * 2504 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) 2505 + */ 2506 + read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>> 2507 + /** 2508 + * The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream. 2509 + * 2510 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) 2511 + */ 2512 + releaseLock(): void 2513 + readAtLeast<T extends ArrayBufferView>( 2514 + minElements: number, 2515 + view: T, 2516 + ): Promise<ReadableStreamReadResult<T>> 2517 + } 2518 + interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions { 2519 + min?: number 2520 + } 2521 + interface ReadableStreamGetReaderOptions { 2522 + /** 2523 + * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. 2524 + * 2525 + * 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. 2526 + */ 2527 + mode: 'byob' 2528 + } 2529 + /** 2530 + * 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). 2531 + * 2532 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) 2533 + */ 2534 + declare abstract class ReadableStreamBYOBRequest { 2535 + /** 2536 + * The **`view`** getter property of the ReadableStreamBYOBRequest interface returns the current view. 2537 + * 2538 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) 2539 + */ 2540 + get view(): Uint8Array | null 2541 + /** 2542 + * 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. 2543 + * 2544 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) 2545 + */ 2546 + respond(bytesWritten: number): void 2547 + /** 2548 + * 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. 2549 + * 2550 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) 2551 + */ 2552 + respondWithNewView(view: ArrayBuffer | ArrayBufferView): void 2553 + get atLeast(): number | null 2554 + } 2555 + /** 2556 + * The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. 2557 + * 2558 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) 2559 + */ 2560 + declare abstract class ReadableStreamDefaultController<R = any> { 2561 + /** 2562 + * The **`desiredSize`** read-only property of the required to fill the stream's internal queue. 2563 + * 2564 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) 2565 + */ 2566 + get desiredSize(): number | null 2567 + /** 2568 + * The **`close()`** method of the ReadableStreamDefaultController interface closes the associated stream. 2569 + * 2570 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) 2571 + */ 2572 + close(): void 2573 + /** 2574 + * The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue. 2575 + * 2576 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) 2577 + */ 2578 + enqueue(chunk?: R): void 2579 + /** 2580 + * The **`error()`** method of the with the associated stream to error. 2581 + * 2582 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) 2583 + */ 2584 + error(reason: any): void 2585 + } 2586 + /** 2587 + * The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream. 2588 + * 2589 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) 2590 + */ 2591 + declare abstract class ReadableByteStreamController { 2592 + /** 2593 + * The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests. 2594 + * 2595 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) 2596 + */ 2597 + get byobRequest(): ReadableStreamBYOBRequest | null 2598 + /** 2599 + * 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'. 2600 + * 2601 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) 2602 + */ 2603 + get desiredSize(): number | null 2604 + /** 2605 + * The **`close()`** method of the ReadableByteStreamController interface closes the associated stream. 2606 + * 2607 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) 2608 + */ 2609 + close(): void 2610 + /** 2611 + * 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). 2612 + * 2613 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) 2614 + */ 2615 + enqueue(chunk: ArrayBuffer | ArrayBufferView): void 2616 + /** 2617 + * The **`error()`** method of the ReadableByteStreamController interface causes any future interactions with the associated stream to error with the specified reason. 2618 + * 2619 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) 2620 + */ 2621 + error(reason: any): void 2622 + } 2623 + /** 2624 + * The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state. 2625 + * 2626 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController) 2627 + */ 2628 + declare abstract class WritableStreamDefaultController { 2629 + /** 2630 + * The read-only **`signal`** property of the WritableStreamDefaultController interface returns the AbortSignal associated with the controller. 2631 + * 2632 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) 2633 + */ 2634 + get signal(): AbortSignal 2635 + /** 2636 + * The **`error()`** method of the with the associated stream to error. 2637 + * 2638 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) 2639 + */ 2640 + error(reason?: any): void 2641 + } 2642 + /** 2643 + * The **`TransformStreamDefaultController`** interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream. 2644 + * 2645 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) 2646 + */ 2647 + declare abstract class TransformStreamDefaultController<O = any> { 2648 + /** 2649 + * The **`desiredSize`** read-only property of the TransformStreamDefaultController interface returns the desired size to fill the queue of the associated ReadableStream. 2650 + * 2651 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) 2652 + */ 2653 + get desiredSize(): number | null 2654 + /** 2655 + * The **`enqueue()`** method of the TransformStreamDefaultController interface enqueues the given chunk in the readable side of the stream. 2656 + * 2657 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) 2658 + */ 2659 + enqueue(chunk?: O): void 2660 + /** 2661 + * The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream. 2662 + * 2663 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) 2664 + */ 2665 + error(reason: any): void 2666 + /** 2667 + * The **`terminate()`** method of the TransformStreamDefaultController interface closes the readable side and errors the writable side of the stream. 2668 + * 2669 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) 2670 + */ 2671 + terminate(): void 2672 + } 2673 + interface ReadableWritablePair<R = any, W = any> { 2674 + /** 2675 + * 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. 2676 + * 2677 + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. 2678 + */ 2679 + writable: WritableStream<W> 2680 + readable: ReadableStream<R> 2681 + } 2682 + /** 2683 + * The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. 2684 + * 2685 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream) 2686 + */ 2687 + declare class WritableStream<W = any> { 2688 + constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy) 2689 + /** 2690 + * The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer. 2691 + * 2692 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) 2693 + */ 2694 + get locked(): boolean 2695 + /** 2696 + * 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. 2697 + * 2698 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) 2699 + */ 2700 + abort(reason?: any): Promise<void> 2701 + /** 2702 + * The **`close()`** method of the WritableStream interface closes the associated stream. 2703 + * 2704 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) 2705 + */ 2706 + close(): Promise<void> 2707 + /** 2708 + * The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. 2709 + * 2710 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) 2711 + */ 2712 + getWriter(): WritableStreamDefaultWriter<W> 2713 + } 2714 + /** 2715 + * 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. 2716 + * 2717 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter) 2718 + */ 2719 + declare class WritableStreamDefaultWriter<W = any> { 2720 + constructor(stream: WritableStream) 2721 + /** 2722 + * The **`closed`** read-only property of the the stream errors or the writer's lock is released. 2723 + * 2724 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) 2725 + */ 2726 + get closed(): Promise<void> 2727 + /** 2728 + * 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. 2729 + * 2730 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) 2731 + */ 2732 + get ready(): Promise<void> 2733 + /** 2734 + * The **`desiredSize`** read-only property of the to fill the stream's internal queue. 2735 + * 2736 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) 2737 + */ 2738 + get desiredSize(): number | null 2739 + /** 2740 + * 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. 2741 + * 2742 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) 2743 + */ 2744 + abort(reason?: any): Promise<void> 2745 + /** 2746 + * The **`close()`** method of the stream. 2747 + * 2748 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) 2749 + */ 2750 + close(): Promise<void> 2751 + /** 2752 + * The **`write()`** method of the operation. 2753 + * 2754 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) 2755 + */ 2756 + write(chunk?: W): Promise<void> 2757 + /** 2758 + * The **`releaseLock()`** method of the corresponding stream. 2759 + * 2760 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) 2761 + */ 2762 + releaseLock(): void 2763 + } 2764 + /** 2765 + * The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept. 2766 + * 2767 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) 2768 + */ 2769 + declare class TransformStream<I = any, O = any> { 2770 + constructor( 2771 + transformer?: Transformer<I, O>, 2772 + writableStrategy?: QueuingStrategy<I>, 2773 + readableStrategy?: QueuingStrategy<O>, 2774 + ) 2775 + /** 2776 + * The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`. 2777 + * 2778 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) 2779 + */ 2780 + get readable(): ReadableStream<O> 2781 + /** 2782 + * The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`. 2783 + * 2784 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) 2785 + */ 2786 + get writable(): WritableStream<I> 2787 + } 2788 + declare class FixedLengthStream extends IdentityTransformStream { 2789 + constructor( 2790 + expectedLength: number | bigint, 2791 + queuingStrategy?: IdentityTransformStreamQueuingStrategy, 2792 + ) 2793 + } 2794 + declare class IdentityTransformStream extends TransformStream< 2795 + ArrayBuffer | ArrayBufferView, 2796 + Uint8Array 2797 + > { 2798 + constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy) 2799 + } 2800 + interface IdentityTransformStreamQueuingStrategy { 2801 + highWaterMark?: number | bigint 2802 + } 2803 + interface ReadableStreamValuesOptions { 2804 + preventCancel?: boolean 2805 + } 2806 + /** 2807 + * The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data. 2808 + * 2809 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) 2810 + */ 2811 + declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> { 2812 + constructor(format: 'gzip' | 'deflate' | 'deflate-raw') 2813 + } 2814 + /** 2815 + * The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data. 2816 + * 2817 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) 2818 + */ 2819 + declare class DecompressionStream extends TransformStream< 2820 + ArrayBuffer | ArrayBufferView, 2821 + Uint8Array 2822 + > { 2823 + constructor(format: 'gzip' | 'deflate' | 'deflate-raw') 2824 + } 2825 + /** 2826 + * The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. 2827 + * 2828 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) 2829 + */ 2830 + declare class TextEncoderStream extends TransformStream<string, Uint8Array> { 2831 + constructor() 2832 + get encoding(): string 2833 + } 2834 + /** 2835 + * 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. 2836 + * 2837 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) 2838 + */ 2839 + declare class TextDecoderStream extends TransformStream<ArrayBuffer | ArrayBufferView, string> { 2840 + constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit) 2841 + get encoding(): string 2842 + get fatal(): boolean 2843 + get ignoreBOM(): boolean 2844 + } 2845 + interface TextDecoderStreamTextDecoderStreamInit { 2846 + fatal?: boolean 2847 + ignoreBOM?: boolean 2848 + } 2849 + /** 2850 + * The **`ByteLengthQueuingStrategy`** interface of the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams. 2851 + * 2852 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy) 2853 + */ 2854 + declare class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> { 2855 + constructor(init: QueuingStrategyInit) 2856 + /** 2857 + * The read-only **`ByteLengthQueuingStrategy.highWaterMark`** property returns the total number of bytes that can be contained in the internal queue before backpressure is applied. 2858 + * 2859 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) 2860 + */ 2861 + get highWaterMark(): number 2862 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */ 2863 + get size(): (chunk?: any) => number 2864 + } 2865 + /** 2866 + * The **`CountQueuingStrategy`** interface of the Streams API provides a built-in chunk counting queuing strategy that can be used when constructing streams. 2867 + * 2868 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy) 2869 + */ 2870 + declare class CountQueuingStrategy implements QueuingStrategy { 2871 + constructor(init: QueuingStrategyInit) 2872 + /** 2873 + * The read-only **`CountQueuingStrategy.highWaterMark`** property returns the total number of chunks that can be contained in the internal queue before backpressure is applied. 2874 + * 2875 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) 2876 + */ 2877 + get highWaterMark(): number 2878 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */ 2879 + get size(): (chunk?: any) => number 2880 + } 2881 + interface QueuingStrategyInit { 2882 + /** 2883 + * Creates a new ByteLengthQueuingStrategy with the provided high water mark. 2884 + * 2885 + * 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. 2886 + */ 2887 + highWaterMark: number 2888 + } 2889 + interface ScriptVersion { 2890 + id?: string 2891 + tag?: string 2892 + message?: string 2893 + } 2894 + declare abstract class TailEvent extends ExtendableEvent { 2895 + readonly events: TraceItem[] 2896 + readonly traces: TraceItem[] 2897 + } 2898 + interface TraceItem { 2899 + readonly event: 2900 + | ( 2901 + | TraceItemFetchEventInfo 2902 + | TraceItemJsRpcEventInfo 2903 + | TraceItemScheduledEventInfo 2904 + | TraceItemAlarmEventInfo 2905 + | TraceItemQueueEventInfo 2906 + | TraceItemEmailEventInfo 2907 + | TraceItemTailEventInfo 2908 + | TraceItemCustomEventInfo 2909 + | TraceItemHibernatableWebSocketEventInfo 2910 + ) 2911 + | null 2912 + readonly eventTimestamp: number | null 2913 + readonly logs: TraceLog[] 2914 + readonly exceptions: TraceException[] 2915 + readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[] 2916 + readonly scriptName: string | null 2917 + readonly entrypoint?: string 2918 + readonly scriptVersion?: ScriptVersion 2919 + readonly dispatchNamespace?: string 2920 + readonly scriptTags?: string[] 2921 + readonly durableObjectId?: string 2922 + readonly outcome: string 2923 + readonly executionModel: string 2924 + readonly truncated: boolean 2925 + readonly cpuTime: number 2926 + readonly wallTime: number 2927 + } 2928 + interface TraceItemAlarmEventInfo { 2929 + readonly scheduledTime: Date 2930 + } 2931 + interface TraceItemCustomEventInfo {} 2932 + interface TraceItemScheduledEventInfo { 2933 + readonly scheduledTime: number 2934 + readonly cron: string 2935 + } 2936 + interface TraceItemQueueEventInfo { 2937 + readonly queue: string 2938 + readonly batchSize: number 2939 + } 2940 + interface TraceItemEmailEventInfo { 2941 + readonly mailFrom: string 2942 + readonly rcptTo: string 2943 + readonly rawSize: number 2944 + } 2945 + interface TraceItemTailEventInfo { 2946 + readonly consumedEvents: TraceItemTailEventInfoTailItem[] 2947 + } 2948 + interface TraceItemTailEventInfoTailItem { 2949 + readonly scriptName: string | null 2950 + } 2951 + interface TraceItemFetchEventInfo { 2952 + readonly response?: TraceItemFetchEventInfoResponse 2953 + readonly request: TraceItemFetchEventInfoRequest 2954 + } 2955 + interface TraceItemFetchEventInfoRequest { 2956 + readonly cf?: any 2957 + readonly headers: Record<string, string> 2958 + readonly method: string 2959 + readonly url: string 2960 + getUnredacted(): TraceItemFetchEventInfoRequest 2961 + } 2962 + interface TraceItemFetchEventInfoResponse { 2963 + readonly status: number 2964 + } 2965 + interface TraceItemJsRpcEventInfo { 2966 + readonly rpcMethod: string 2967 + } 2968 + interface TraceItemHibernatableWebSocketEventInfo { 2969 + readonly getWebSocketEvent: 2970 + | TraceItemHibernatableWebSocketEventInfoMessage 2971 + | TraceItemHibernatableWebSocketEventInfoClose 2972 + | TraceItemHibernatableWebSocketEventInfoError 2973 + } 2974 + interface TraceItemHibernatableWebSocketEventInfoMessage { 2975 + readonly webSocketEventType: string 2976 + } 2977 + interface TraceItemHibernatableWebSocketEventInfoClose { 2978 + readonly webSocketEventType: string 2979 + readonly code: number 2980 + readonly wasClean: boolean 2981 + } 2982 + interface TraceItemHibernatableWebSocketEventInfoError { 2983 + readonly webSocketEventType: string 2984 + } 2985 + interface TraceLog { 2986 + readonly timestamp: number 2987 + readonly level: string 2988 + readonly message: any 2989 + } 2990 + interface TraceException { 2991 + readonly timestamp: number 2992 + readonly message: string 2993 + readonly name: string 2994 + readonly stack?: string 2995 + } 2996 + interface TraceDiagnosticChannelEvent { 2997 + readonly timestamp: number 2998 + readonly channel: string 2999 + readonly message: any 3000 + } 3001 + interface TraceMetrics { 3002 + readonly cpuTime: number 3003 + readonly wallTime: number 3004 + } 3005 + interface UnsafeTraceMetrics { 3006 + fromTrace(item: TraceItem): TraceMetrics 3007 + } 3008 + /** 3009 + * The **`URL`** interface is used to parse, construct, normalize, and encode URL. 3010 + * 3011 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL) 3012 + */ 3013 + declare class URL { 3014 + constructor(url: string | URL, base?: string | URL) 3015 + /** 3016 + * The **`origin`** read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL. 3017 + * 3018 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) 3019 + */ 3020 + get origin(): string 3021 + /** 3022 + * The **`href`** property of the URL interface is a string containing the whole URL. 3023 + * 3024 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) 3025 + */ 3026 + get href(): string 3027 + /** 3028 + * The **`href`** property of the URL interface is a string containing the whole URL. 3029 + * 3030 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) 3031 + */ 3032 + set href(value: string) 3033 + /** 3034 + * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`. 3035 + * 3036 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) 3037 + */ 3038 + get protocol(): string 3039 + /** 3040 + * The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`. 3041 + * 3042 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) 3043 + */ 3044 + set protocol(value: string) 3045 + /** 3046 + * The **`username`** property of the URL interface is a string containing the username component of the URL. 3047 + * 3048 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) 3049 + */ 3050 + get username(): string 3051 + /** 3052 + * The **`username`** property of the URL interface is a string containing the username component of the URL. 3053 + * 3054 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) 3055 + */ 3056 + set username(value: string) 3057 + /** 3058 + * The **`password`** property of the URL interface is a string containing the password component of the URL. 3059 + * 3060 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) 3061 + */ 3062 + get password(): string 3063 + /** 3064 + * The **`password`** property of the URL interface is a string containing the password component of the URL. 3065 + * 3066 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) 3067 + */ 3068 + set password(value: string) 3069 + /** 3070 + * 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. 3071 + * 3072 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) 3073 + */ 3074 + get host(): string 3075 + /** 3076 + * 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. 3077 + * 3078 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) 3079 + */ 3080 + set host(value: string) 3081 + /** 3082 + * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. 3083 + * 3084 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) 3085 + */ 3086 + get hostname(): string 3087 + /** 3088 + * The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. 3089 + * 3090 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) 3091 + */ 3092 + set hostname(value: string) 3093 + /** 3094 + * The **`port`** property of the URL interface is a string containing the port number of the URL. 3095 + * 3096 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) 3097 + */ 3098 + get port(): string 3099 + /** 3100 + * The **`port`** property of the URL interface is a string containing the port number of the URL. 3101 + * 3102 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) 3103 + */ 3104 + set port(value: string) 3105 + /** 3106 + * The **`pathname`** property of the URL interface represents a location in a hierarchical structure. 3107 + * 3108 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) 3109 + */ 3110 + get pathname(): string 3111 + /** 3112 + * The **`pathname`** property of the URL interface represents a location in a hierarchical structure. 3113 + * 3114 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) 3115 + */ 3116 + set pathname(value: string) 3117 + /** 3118 + * 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. 3119 + * 3120 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) 3121 + */ 3122 + get search(): string 3123 + /** 3124 + * 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. 3125 + * 3126 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) 3127 + */ 3128 + set search(value: string) 3129 + /** 3130 + * The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL. 3131 + * 3132 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) 3133 + */ 3134 + get hash(): string 3135 + /** 3136 + * The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL. 3137 + * 3138 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) 3139 + */ 3140 + set hash(value: string) 3141 + /** 3142 + * The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL. 3143 + * 3144 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) 3145 + */ 3146 + get searchParams(): URLSearchParams 3147 + /** 3148 + * 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. 3149 + * 3150 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) 3151 + */ 3152 + toJSON(): string 3153 + /*function toString() { [native code] }*/ 3154 + toString(): string 3155 + /** 3156 + * 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. 3157 + * 3158 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) 3159 + */ 3160 + static canParse(url: string, base?: string): boolean 3161 + /** 3162 + * The **`URL.parse()`** static method of the URL interface returns a newly created URL object representing the URL defined by the parameters. 3163 + * 3164 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) 3165 + */ 3166 + static parse(url: string, base?: string): URL | null 3167 + /** 3168 + * The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter. 3169 + * 3170 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) 3171 + */ 3172 + static createObjectURL(object: File | Blob): string 3173 + /** 3174 + * 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. 3175 + * 3176 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) 3177 + */ 3178 + static revokeObjectURL(object_url: string): void 3179 + } 3180 + /** 3181 + * The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL. 3182 + * 3183 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) 3184 + */ 3185 + declare class URLSearchParams { 3186 + constructor(init?: Iterable<Iterable<string>> | Record<string, string> | string) 3187 + /** 3188 + * The **`size`** read-only property of the URLSearchParams interface indicates the total number of search parameter entries. 3189 + * 3190 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) 3191 + */ 3192 + get size(): number 3193 + /** 3194 + * The **`append()`** method of the URLSearchParams interface appends a specified key/value pair as a new search parameter. 3195 + * 3196 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append) 3197 + */ 3198 + append(name: string, value: string): void 3199 + /** 3200 + * The **`delete()`** method of the URLSearchParams interface deletes specified parameters and their associated value(s) from the list of all search parameters. 3201 + * 3202 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete) 3203 + */ 3204 + delete(name: string, value?: string): void 3205 + /** 3206 + * The **`get()`** method of the URLSearchParams interface returns the first value associated to the given search parameter. 3207 + * 3208 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get) 3209 + */ 3210 + get(name: string): string | null 3211 + /** 3212 + * The **`getAll()`** method of the URLSearchParams interface returns all the values associated with a given search parameter as an array. 3213 + * 3214 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll) 3215 + */ 3216 + getAll(name: string): string[] 3217 + /** 3218 + * The **`has()`** method of the URLSearchParams interface returns a boolean value that indicates whether the specified parameter is in the search parameters. 3219 + * 3220 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has) 3221 + */ 3222 + has(name: string, value?: string): boolean 3223 + /** 3224 + * The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. 3225 + * 3226 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set) 3227 + */ 3228 + set(name: string, value: string): void 3229 + /** 3230 + * The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`. 3231 + * 3232 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) 3233 + */ 3234 + sort(): void 3235 + /* Returns an array of key, value pairs for every entry in the search params. */ 3236 + entries(): IterableIterator<[key: string, value: string]> 3237 + /* Returns a list of keys in the search params. */ 3238 + keys(): IterableIterator<string> 3239 + /* Returns a list of values in the search params. */ 3240 + values(): IterableIterator<string> 3241 + forEach<This = unknown>( 3242 + callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, 3243 + thisArg?: This, 3244 + ): void 3245 + /*function toString() { [native code] }*/ 3246 + toString(): string 3247 + [Symbol.iterator](): IterableIterator<[key: string, value: string]> 3248 + } 3249 + declare class URLPattern { 3250 + constructor( 3251 + input?: string | URLPatternInit, 3252 + baseURL?: string | URLPatternOptions, 3253 + patternOptions?: URLPatternOptions, 3254 + ) 3255 + get protocol(): string 3256 + get username(): string 3257 + get password(): string 3258 + get hostname(): string 3259 + get port(): string 3260 + get pathname(): string 3261 + get search(): string 3262 + get hash(): string 3263 + get hasRegExpGroups(): boolean 3264 + test(input?: string | URLPatternInit, baseURL?: string): boolean 3265 + exec(input?: string | URLPatternInit, baseURL?: string): URLPatternResult | null 3266 + } 3267 + interface URLPatternInit { 3268 + protocol?: string 3269 + username?: string 3270 + password?: string 3271 + hostname?: string 3272 + port?: string 3273 + pathname?: string 3274 + search?: string 3275 + hash?: string 3276 + baseURL?: string 3277 + } 3278 + interface URLPatternComponentResult { 3279 + input: string 3280 + groups: Record<string, string> 3281 + } 3282 + interface URLPatternResult { 3283 + inputs: (string | URLPatternInit)[] 3284 + protocol: URLPatternComponentResult 3285 + username: URLPatternComponentResult 3286 + password: URLPatternComponentResult 3287 + hostname: URLPatternComponentResult 3288 + port: URLPatternComponentResult 3289 + pathname: URLPatternComponentResult 3290 + search: URLPatternComponentResult 3291 + hash: URLPatternComponentResult 3292 + } 3293 + interface URLPatternOptions { 3294 + ignoreCase?: boolean 3295 + } 3296 + /** 3297 + * A `CloseEvent` is sent to clients using WebSockets when the connection is closed. 3298 + * 3299 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent) 3300 + */ 3301 + declare class CloseEvent extends Event { 3302 + constructor(type: string, initializer?: CloseEventInit) 3303 + /** 3304 + * The **`code`** read-only property of the CloseEvent interface returns a WebSocket connection close code indicating the reason the connection was closed. 3305 + * 3306 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code) 3307 + */ 3308 + readonly code: number 3309 + /** 3310 + * 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. 3311 + * 3312 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason) 3313 + */ 3314 + readonly reason: string 3315 + /** 3316 + * The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly. 3317 + * 3318 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean) 3319 + */ 3320 + readonly wasClean: boolean 3321 + } 3322 + interface CloseEventInit { 3323 + code?: number 3324 + reason?: string 3325 + wasClean?: boolean 3326 + } 3327 + type WebSocketEventMap = { 3328 + close: CloseEvent 3329 + message: MessageEvent 3330 + open: Event 3331 + error: ErrorEvent 3332 + } 3333 + /** 3334 + * 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. 3335 + * 3336 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket) 3337 + */ 3338 + declare var WebSocket: { 3339 + prototype: WebSocket 3340 + new (url: string, protocols?: string[] | string): WebSocket 3341 + readonly READY_STATE_CONNECTING: number 3342 + readonly CONNECTING: number 3343 + readonly READY_STATE_OPEN: number 3344 + readonly OPEN: number 3345 + readonly READY_STATE_CLOSING: number 3346 + readonly CLOSING: number 3347 + readonly READY_STATE_CLOSED: number 3348 + readonly CLOSED: number 3349 + } 3350 + /** 3351 + * 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. 3352 + * 3353 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket) 3354 + */ 3355 + interface WebSocket extends EventTarget<WebSocketEventMap> { 3356 + accept(): void 3357 + /** 3358 + * 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. 3359 + * 3360 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send) 3361 + */ 3362 + send(message: (ArrayBuffer | ArrayBufferView) | string): void 3363 + /** 3364 + * The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing. 3365 + * 3366 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close) 3367 + */ 3368 + close(code?: number, reason?: string): void 3369 + serializeAttachment(attachment: any): void 3370 + deserializeAttachment(): any | null 3371 + /** 3372 + * The **`WebSocket.readyState`** read-only property returns the current state of the WebSocket connection. 3373 + * 3374 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState) 3375 + */ 3376 + readyState: number 3377 + /** 3378 + * The **`WebSocket.url`** read-only property returns the absolute URL of the WebSocket as resolved by the constructor. 3379 + * 3380 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url) 3381 + */ 3382 + url: string | null 3383 + /** 3384 + * 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. 3385 + * 3386 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol) 3387 + */ 3388 + protocol: string | null 3389 + /** 3390 + * The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. 3391 + * 3392 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions) 3393 + */ 3394 + extensions: string | null 3395 + } 3396 + declare const WebSocketPair: { 3397 + new (): { 3398 + 0: WebSocket 3399 + 1: WebSocket 3400 + } 3401 + } 3402 + interface SqlStorage { 3403 + exec<T extends Record<string, SqlStorageValue>>( 3404 + query: string, 3405 + ...bindings: any[] 3406 + ): SqlStorageCursor<T> 3407 + get databaseSize(): number 3408 + Cursor: typeof SqlStorageCursor 3409 + Statement: typeof SqlStorageStatement 3410 + } 3411 + declare abstract class SqlStorageStatement {} 3412 + type SqlStorageValue = ArrayBuffer | string | number | null 3413 + declare abstract class SqlStorageCursor<T extends Record<string, SqlStorageValue>> { 3414 + next(): 3415 + | { 3416 + done?: false 3417 + value: T 3418 + } 3419 + | { 3420 + done: true 3421 + value?: never 3422 + } 3423 + toArray(): T[] 3424 + one(): T 3425 + raw<U extends SqlStorageValue[]>(): IterableIterator<U> 3426 + columnNames: string[] 3427 + get rowsRead(): number 3428 + get rowsWritten(): number 3429 + [Symbol.iterator](): IterableIterator<T> 3430 + } 3431 + interface Socket { 3432 + get readable(): ReadableStream 3433 + get writable(): WritableStream 3434 + get closed(): Promise<void> 3435 + get opened(): Promise<SocketInfo> 3436 + get upgraded(): boolean 3437 + get secureTransport(): 'on' | 'off' | 'starttls' 3438 + close(): Promise<void> 3439 + startTls(options?: TlsOptions): Socket 3440 + } 3441 + interface SocketOptions { 3442 + secureTransport?: string 3443 + allowHalfOpen: boolean 3444 + highWaterMark?: number | bigint 3445 + } 3446 + interface SocketAddress { 3447 + hostname: string 3448 + port: number 3449 + } 3450 + interface TlsOptions { 3451 + expectedServerHostname?: string 3452 + } 3453 + interface SocketInfo { 3454 + remoteAddress?: string 3455 + localAddress?: string 3456 + } 3457 + /** 3458 + * The **`EventSource`** interface is web content's interface to server-sent events. 3459 + * 3460 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) 3461 + */ 3462 + declare class EventSource extends EventTarget { 3463 + constructor(url: string, init?: EventSourceEventSourceInit) 3464 + /** 3465 + * The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None. 3466 + * 3467 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close) 3468 + */ 3469 + close(): void 3470 + /** 3471 + * The **`url`** read-only property of the URL of the source. 3472 + * 3473 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url) 3474 + */ 3475 + get url(): string 3476 + /** 3477 + * The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set. 3478 + * 3479 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials) 3480 + */ 3481 + get withCredentials(): boolean 3482 + /** 3483 + * The **`readyState`** read-only property of the connection. 3484 + * 3485 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState) 3486 + */ 3487 + get readyState(): number 3488 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */ 3489 + get onopen(): any | null 3490 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */ 3491 + set onopen(value: any | null) 3492 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */ 3493 + get onmessage(): any | null 3494 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */ 3495 + set onmessage(value: any | null) 3496 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */ 3497 + get onerror(): any | null 3498 + /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */ 3499 + set onerror(value: any | null) 3500 + static readonly CONNECTING: number 3501 + static readonly OPEN: number 3502 + static readonly CLOSED: number 3503 + static from(stream: ReadableStream): EventSource 3504 + } 3505 + interface EventSourceEventSourceInit { 3506 + withCredentials?: boolean 3507 + fetcher?: Fetcher 3508 + } 3509 + interface Container { 3510 + get running(): boolean 3511 + start(options?: ContainerStartupOptions): void 3512 + monitor(): Promise<void> 3513 + destroy(error?: any): Promise<void> 3514 + signal(signo: number): void 3515 + getTcpPort(port: number): Fetcher 3516 + setInactivityTimeout(durationMs: number | bigint): Promise<void> 3517 + } 3518 + interface ContainerStartupOptions { 3519 + entrypoint?: string[] 3520 + enableInternet: boolean 3521 + env?: Record<string, string> 3522 + hardTimeout?: number | bigint 3523 + } 3524 + /** 3525 + * 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. 3526 + * 3527 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort) 3528 + */ 3529 + declare abstract class MessagePort extends EventTarget { 3530 + /** 3531 + * The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts. 3532 + * 3533 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage) 3534 + */ 3535 + postMessage(data?: any, options?: any[] | MessagePortPostMessageOptions): void 3536 + /** 3537 + * The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. 3538 + * 3539 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close) 3540 + */ 3541 + close(): void 3542 + /** 3543 + * The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. 3544 + * 3545 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start) 3546 + */ 3547 + start(): void 3548 + get onmessage(): any | null 3549 + set onmessage(value: any | null) 3550 + } 3551 + /** 3552 + * 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. 3553 + * 3554 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel) 3555 + */ 3556 + declare class MessageChannel { 3557 + constructor() 3558 + /** 3559 + * The **`port1`** read-only property of the the port attached to the context that originated the channel. 3560 + * 3561 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1) 3562 + */ 3563 + readonly port1: MessagePort 3564 + /** 3565 + * 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. 3566 + * 3567 + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2) 3568 + */ 3569 + readonly port2: MessagePort 3570 + } 3571 + interface MessagePortPostMessageOptions { 3572 + transfer?: any[] 3573 + } 3574 + type LoopbackForExport< 3575 + T extends 3576 + | (new (...args: any[]) => Rpc.EntrypointBranded) 3577 + | ExportedHandler<any, any, any> 3578 + | undefined = undefined, 3579 + > = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded 3580 + ? LoopbackServiceStub<InstanceType<T>> 3581 + : T extends new (...args: any[]) => Rpc.DurableObjectBranded 3582 + ? LoopbackDurableObjectClass<InstanceType<T>> 3583 + : T extends ExportedHandler<any, any, any> 3584 + ? LoopbackServiceStub<undefined> 3585 + : undefined 3586 + type LoopbackServiceStub<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = 3587 + Fetcher<T> & 3588 + (T extends CloudflareWorkersModule.WorkerEntrypoint<any, infer Props> 3589 + ? (opts: { props?: Props }) => Fetcher<T> 3590 + : (opts: { props?: any }) => Fetcher<T>) 3591 + type LoopbackDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined = undefined> = 3592 + DurableObjectClass<T> & 3593 + (T extends CloudflareWorkersModule.DurableObject<any, infer Props> 3594 + ? (opts: { props?: Props }) => DurableObjectClass<T> 3595 + : (opts: { props?: any }) => DurableObjectClass<T>) 3596 + interface SyncKvStorage { 3597 + get<T = unknown>(key: string): T | undefined 3598 + list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]> 3599 + put<T>(key: string, value: T): void 3600 + delete(key: string): boolean 3601 + } 3602 + interface SyncKvListOptions { 3603 + start?: string 3604 + startAfter?: string 3605 + end?: string 3606 + prefix?: string 3607 + reverse?: boolean 3608 + limit?: number 3609 + } 3610 + interface WorkerStub { 3611 + getEntrypoint<T extends Rpc.WorkerEntrypointBranded | undefined>( 3612 + name?: string, 3613 + options?: WorkerStubEntrypointOptions, 3614 + ): Fetcher<T> 3615 + } 3616 + interface WorkerStubEntrypointOptions { 3617 + props?: any 3618 + } 3619 + interface WorkerLoader { 3620 + get( 3621 + name: string | null, 3622 + getCode: () => WorkerLoaderWorkerCode | Promise<WorkerLoaderWorkerCode>, 3623 + ): WorkerStub 3624 + } 3625 + interface WorkerLoaderModule { 3626 + js?: string 3627 + cjs?: string 3628 + text?: string 3629 + data?: ArrayBuffer 3630 + json?: any 3631 + py?: string 3632 + wasm?: ArrayBuffer 3633 + } 3634 + interface WorkerLoaderWorkerCode { 3635 + compatibilityDate: string 3636 + compatibilityFlags?: string[] 3637 + allowExperimental?: boolean 3638 + mainModule: string 3639 + modules: Record<string, WorkerLoaderModule | string> 3640 + env?: any 3641 + globalOutbound?: Fetcher | null 3642 + tails?: Fetcher[] 3643 + streamingTails?: Fetcher[] 3644 + } 3645 + /** 3646 + * The Workers runtime supports a subset of the Performance API, used to measure timing and performance, 3647 + * as well as timing of subrequests and other operations. 3648 + * 3649 + * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/) 3650 + */ 3651 + declare abstract class Performance { 3652 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */ 3653 + get timeOrigin(): number 3654 + /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */ 3655 + now(): number 3656 + } 3657 + type AiImageClassificationInput = { 3658 + image: number[] 3659 + } 3660 + type AiImageClassificationOutput = { 3661 + score?: number 3662 + label?: string 3663 + }[] 3664 + declare abstract class BaseAiImageClassification { 3665 + inputs: AiImageClassificationInput 3666 + postProcessedOutputs: AiImageClassificationOutput 3667 + } 3668 + type AiImageToTextInput = { 3669 + image: number[] 3670 + prompt?: string 3671 + max_tokens?: number 3672 + temperature?: number 3673 + top_p?: number 3674 + top_k?: number 3675 + seed?: number 3676 + repetition_penalty?: number 3677 + frequency_penalty?: number 3678 + presence_penalty?: number 3679 + raw?: boolean 3680 + messages?: RoleScopedChatInput[] 3681 + } 3682 + type AiImageToTextOutput = { 3683 + description: string 3684 + } 3685 + declare abstract class BaseAiImageToText { 3686 + inputs: AiImageToTextInput 3687 + postProcessedOutputs: AiImageToTextOutput 3688 + } 3689 + type AiImageTextToTextInput = { 3690 + image: string 3691 + prompt?: string 3692 + max_tokens?: number 3693 + temperature?: number 3694 + ignore_eos?: boolean 3695 + top_p?: number 3696 + top_k?: number 3697 + seed?: number 3698 + repetition_penalty?: number 3699 + frequency_penalty?: number 3700 + presence_penalty?: number 3701 + raw?: boolean 3702 + messages?: RoleScopedChatInput[] 3703 + } 3704 + type AiImageTextToTextOutput = { 3705 + description: string 3706 + } 3707 + declare abstract class BaseAiImageTextToText { 3708 + inputs: AiImageTextToTextInput 3709 + postProcessedOutputs: AiImageTextToTextOutput 3710 + } 3711 + type AiMultimodalEmbeddingsInput = { 3712 + image: string 3713 + text: string[] 3714 + } 3715 + type AiIMultimodalEmbeddingsOutput = { 3716 + data: number[][] 3717 + shape: number[] 3718 + } 3719 + declare abstract class BaseAiMultimodalEmbeddings { 3720 + inputs: AiImageTextToTextInput 3721 + postProcessedOutputs: AiImageTextToTextOutput 3722 + } 3723 + type AiObjectDetectionInput = { 3724 + image: number[] 3725 + } 3726 + type AiObjectDetectionOutput = { 3727 + score?: number 3728 + label?: string 3729 + }[] 3730 + declare abstract class BaseAiObjectDetection { 3731 + inputs: AiObjectDetectionInput 3732 + postProcessedOutputs: AiObjectDetectionOutput 3733 + } 3734 + type AiSentenceSimilarityInput = { 3735 + source: string 3736 + sentences: string[] 3737 + } 3738 + type AiSentenceSimilarityOutput = number[] 3739 + declare abstract class BaseAiSentenceSimilarity { 3740 + inputs: AiSentenceSimilarityInput 3741 + postProcessedOutputs: AiSentenceSimilarityOutput 3742 + } 3743 + type AiAutomaticSpeechRecognitionInput = { 3744 + audio: number[] 3745 + } 3746 + type AiAutomaticSpeechRecognitionOutput = { 3747 + text?: string 3748 + words?: { 3749 + word: string 3750 + start: number 3751 + end: number 3752 + }[] 3753 + vtt?: string 3754 + } 3755 + declare abstract class BaseAiAutomaticSpeechRecognition { 3756 + inputs: AiAutomaticSpeechRecognitionInput 3757 + postProcessedOutputs: AiAutomaticSpeechRecognitionOutput 3758 + } 3759 + type AiSummarizationInput = { 3760 + input_text: string 3761 + max_length?: number 3762 + } 3763 + type AiSummarizationOutput = { 3764 + summary: string 3765 + } 3766 + declare abstract class BaseAiSummarization { 3767 + inputs: AiSummarizationInput 3768 + postProcessedOutputs: AiSummarizationOutput 3769 + } 3770 + type AiTextClassificationInput = { 3771 + text: string 3772 + } 3773 + type AiTextClassificationOutput = { 3774 + score?: number 3775 + label?: string 3776 + }[] 3777 + declare abstract class BaseAiTextClassification { 3778 + inputs: AiTextClassificationInput 3779 + postProcessedOutputs: AiTextClassificationOutput 3780 + } 3781 + type AiTextEmbeddingsInput = { 3782 + text: string | string[] 3783 + } 3784 + type AiTextEmbeddingsOutput = { 3785 + shape: number[] 3786 + data: number[][] 3787 + } 3788 + declare abstract class BaseAiTextEmbeddings { 3789 + inputs: AiTextEmbeddingsInput 3790 + postProcessedOutputs: AiTextEmbeddingsOutput 3791 + } 3792 + type RoleScopedChatInput = { 3793 + role: 'user' | 'assistant' | 'system' | 'tool' | (string & NonNullable<unknown>) 3794 + content: string 3795 + name?: string 3796 + } 3797 + type AiTextGenerationToolLegacyInput = { 3798 + name: string 3799 + description: string 3800 + parameters?: { 3801 + type: 'object' | (string & NonNullable<unknown>) 3802 + properties: { 3803 + [key: string]: { 3804 + type: string 3805 + description?: string 3806 + } 3807 + } 3808 + required: string[] 3809 + } 3810 + } 3811 + type AiTextGenerationToolInput = { 3812 + type: 'function' | (string & NonNullable<unknown>) 3813 + function: { 3814 + name: string 3815 + description: string 3816 + parameters?: { 3817 + type: 'object' | (string & NonNullable<unknown>) 3818 + properties: { 3819 + [key: string]: { 3820 + type: string 3821 + description?: string 3822 + } 3823 + } 3824 + required: string[] 3825 + } 3826 + } 3827 + } 3828 + type AiTextGenerationFunctionsInput = { 3829 + name: string 3830 + code: string 3831 + } 3832 + type AiTextGenerationResponseFormat = { 3833 + type: string 3834 + json_schema?: any 3835 + } 3836 + type AiTextGenerationInput = { 3837 + prompt?: string 3838 + raw?: boolean 3839 + stream?: boolean 3840 + max_tokens?: number 3841 + temperature?: number 3842 + top_p?: number 3843 + top_k?: number 3844 + seed?: number 3845 + repetition_penalty?: number 3846 + frequency_penalty?: number 3847 + presence_penalty?: number 3848 + messages?: RoleScopedChatInput[] 3849 + response_format?: AiTextGenerationResponseFormat 3850 + tools?: 3851 + | AiTextGenerationToolInput[] 3852 + | AiTextGenerationToolLegacyInput[] 3853 + | (object & NonNullable<unknown>) 3854 + functions?: AiTextGenerationFunctionsInput[] 3855 + } 3856 + type AiTextGenerationToolLegacyOutput = { 3857 + name: string 3858 + arguments: unknown 3859 + } 3860 + type AiTextGenerationToolOutput = { 3861 + id: string 3862 + type: 'function' 3863 + function: { 3864 + name: string 3865 + arguments: string 3866 + } 3867 + } 3868 + type UsageTags = { 3869 + prompt_tokens: number 3870 + completion_tokens: number 3871 + total_tokens: number 3872 + } 3873 + type AiTextGenerationOutput = { 3874 + response?: string 3875 + tool_calls?: AiTextGenerationToolLegacyOutput[] & AiTextGenerationToolOutput[] 3876 + usage?: UsageTags 3877 + } 3878 + declare abstract class BaseAiTextGeneration { 3879 + inputs: AiTextGenerationInput 3880 + postProcessedOutputs: AiTextGenerationOutput 3881 + } 3882 + type AiTextToSpeechInput = { 3883 + prompt: string 3884 + lang?: string 3885 + } 3886 + type AiTextToSpeechOutput = 3887 + | Uint8Array 3888 + | { 3889 + audio: string 3890 + } 3891 + declare abstract class BaseAiTextToSpeech { 3892 + inputs: AiTextToSpeechInput 3893 + postProcessedOutputs: AiTextToSpeechOutput 3894 + } 3895 + type AiTextToImageInput = { 3896 + prompt: string 3897 + negative_prompt?: string 3898 + height?: number 3899 + width?: number 3900 + image?: number[] 3901 + image_b64?: string 3902 + mask?: number[] 3903 + num_steps?: number 3904 + strength?: number 3905 + guidance?: number 3906 + seed?: number 3907 + } 3908 + type AiTextToImageOutput = ReadableStream<Uint8Array> 3909 + declare abstract class BaseAiTextToImage { 3910 + inputs: AiTextToImageInput 3911 + postProcessedOutputs: AiTextToImageOutput 3912 + } 3913 + type AiTranslationInput = { 3914 + text: string 3915 + target_lang: string 3916 + source_lang?: string 3917 + } 3918 + type AiTranslationOutput = { 3919 + translated_text?: string 3920 + } 3921 + declare abstract class BaseAiTranslation { 3922 + inputs: AiTranslationInput 3923 + postProcessedOutputs: AiTranslationOutput 3924 + } 3925 + /** 3926 + * Workers AI support for OpenAI's Responses API 3927 + * Reference: https://github.com/openai/openai-node/blob/master/src/resources/responses/responses.ts 3928 + * 3929 + * It's a stripped down version from its source. 3930 + * It currently supports basic function calling, json mode and accepts images as input. 3931 + * 3932 + * It does not include types for WebSearch, CodeInterpreter, FileInputs, MCP, CustomTools. 3933 + * We plan to add those incrementally as model + platform capabilities evolve. 3934 + */ 3935 + type ResponsesInput = { 3936 + background?: boolean | null 3937 + conversation?: string | ResponseConversationParam | null 3938 + include?: Array<ResponseIncludable> | null 3939 + input?: string | ResponseInput 3940 + instructions?: string | null 3941 + max_output_tokens?: number | null 3942 + parallel_tool_calls?: boolean | null 3943 + previous_response_id?: string | null 3944 + prompt_cache_key?: string 3945 + reasoning?: Reasoning | null 3946 + safety_identifier?: string 3947 + service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null 3948 + stream?: boolean | null 3949 + stream_options?: StreamOptions | null 3950 + temperature?: number | null 3951 + text?: ResponseTextConfig 3952 + tool_choice?: ToolChoiceOptions | ToolChoiceFunction 3953 + tools?: Array<Tool> 3954 + top_p?: number | null 3955 + truncation?: 'auto' | 'disabled' | null 3956 + } 3957 + type ResponsesOutput = { 3958 + id?: string 3959 + created_at?: number 3960 + output_text?: string 3961 + error?: ResponseError | null 3962 + incomplete_details?: ResponseIncompleteDetails | null 3963 + instructions?: string | Array<ResponseInputItem> | null 3964 + object?: 'response' 3965 + output?: Array<ResponseOutputItem> 3966 + parallel_tool_calls?: boolean 3967 + temperature?: number | null 3968 + tool_choice?: ToolChoiceOptions | ToolChoiceFunction 3969 + tools?: Array<Tool> 3970 + top_p?: number | null 3971 + max_output_tokens?: number | null 3972 + previous_response_id?: string | null 3973 + prompt?: ResponsePrompt | null 3974 + reasoning?: Reasoning | null 3975 + safety_identifier?: string 3976 + service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null 3977 + status?: ResponseStatus 3978 + text?: ResponseTextConfig 3979 + truncation?: 'auto' | 'disabled' | null 3980 + usage?: ResponseUsage 3981 + } 3982 + type EasyInputMessage = { 3983 + content: string | ResponseInputMessageContentList 3984 + role: 'user' | 'assistant' | 'system' | 'developer' 3985 + type?: 'message' 3986 + } 3987 + type ResponsesFunctionTool = { 3988 + name: string 3989 + parameters: { 3990 + [key: string]: unknown 3991 + } | null 3992 + strict: boolean | null 3993 + type: 'function' 3994 + description?: string | null 3995 + } 3996 + type ResponseIncompleteDetails = { 3997 + reason?: 'max_output_tokens' | 'content_filter' 3998 + } 3999 + type ResponsePrompt = { 4000 + id: string 4001 + variables?: { 4002 + [key: string]: string | ResponseInputText | ResponseInputImage 4003 + } | null 4004 + version?: string | null 4005 + } 4006 + type Reasoning = { 4007 + effort?: ReasoningEffort | null 4008 + generate_summary?: 'auto' | 'concise' | 'detailed' | null 4009 + summary?: 'auto' | 'concise' | 'detailed' | null 4010 + } 4011 + type ResponseContent = 4012 + | ResponseInputText 4013 + | ResponseInputImage 4014 + | ResponseOutputText 4015 + | ResponseOutputRefusal 4016 + | ResponseContentReasoningText 4017 + type ResponseContentReasoningText = { 4018 + text: string 4019 + type: 'reasoning_text' 4020 + } 4021 + type ResponseConversationParam = { 4022 + id: string 4023 + } 4024 + type ResponseCreatedEvent = { 4025 + response: Response 4026 + sequence_number: number 4027 + type: 'response.created' 4028 + } 4029 + type ResponseCustomToolCallOutput = { 4030 + call_id: string 4031 + output: string | Array<ResponseInputText | ResponseInputImage> 4032 + type: 'custom_tool_call_output' 4033 + id?: string 4034 + } 4035 + type ResponseError = { 4036 + code: 4037 + | 'server_error' 4038 + | 'rate_limit_exceeded' 4039 + | 'invalid_prompt' 4040 + | 'vector_store_timeout' 4041 + | 'invalid_image' 4042 + | 'invalid_image_format' 4043 + | 'invalid_base64_image' 4044 + | 'invalid_image_url' 4045 + | 'image_too_large' 4046 + | 'image_too_small' 4047 + | 'image_parse_error' 4048 + | 'image_content_policy_violation' 4049 + | 'invalid_image_mode' 4050 + | 'image_file_too_large' 4051 + | 'unsupported_image_media_type' 4052 + | 'empty_image_file' 4053 + | 'failed_to_download_image' 4054 + | 'image_file_not_found' 4055 + message: string 4056 + } 4057 + type ResponseErrorEvent = { 4058 + code: string | null 4059 + message: string 4060 + param: string | null 4061 + sequence_number: number 4062 + type: 'error' 4063 + } 4064 + type ResponseFailedEvent = { 4065 + response: Response 4066 + sequence_number: number 4067 + type: 'response.failed' 4068 + } 4069 + type ResponseFormatText = { 4070 + type: 'text' 4071 + } 4072 + type ResponseFormatJSONObject = { 4073 + type: 'json_object' 4074 + } 4075 + type ResponseFormatTextConfig = 4076 + | ResponseFormatText 4077 + | ResponseFormatTextJSONSchemaConfig 4078 + | ResponseFormatJSONObject 4079 + type ResponseFormatTextJSONSchemaConfig = { 4080 + name: string 4081 + schema: { 4082 + [key: string]: unknown 4083 + } 4084 + type: 'json_schema' 4085 + description?: string 4086 + strict?: boolean | null 4087 + } 4088 + type ResponseFunctionCallArgumentsDeltaEvent = { 4089 + delta: string 4090 + item_id: string 4091 + output_index: number 4092 + sequence_number: number 4093 + type: 'response.function_call_arguments.delta' 4094 + } 4095 + type ResponseFunctionCallArgumentsDoneEvent = { 4096 + arguments: string 4097 + item_id: string 4098 + name: string 4099 + output_index: number 4100 + sequence_number: number 4101 + type: 'response.function_call_arguments.done' 4102 + } 4103 + type ResponseFunctionCallOutputItem = ResponseInputTextContent | ResponseInputImageContent 4104 + type ResponseFunctionCallOutputItemList = Array<ResponseFunctionCallOutputItem> 4105 + type ResponseFunctionToolCall = { 4106 + arguments: string 4107 + call_id: string 4108 + name: string 4109 + type: 'function_call' 4110 + id?: string 4111 + status?: 'in_progress' | 'completed' | 'incomplete' 4112 + } 4113 + interface ResponseFunctionToolCallItem extends ResponseFunctionToolCall { 4114 + id: string 4115 + } 4116 + type ResponseFunctionToolCallOutputItem = { 4117 + id: string 4118 + call_id: string 4119 + output: string | Array<ResponseInputText | ResponseInputImage> 4120 + type: 'function_call_output' 4121 + status?: 'in_progress' | 'completed' | 'incomplete' 4122 + } 4123 + type ResponseIncludable = 'message.input_image.image_url' | 'message.output_text.logprobs' 4124 + type ResponseIncompleteEvent = { 4125 + response: Response 4126 + sequence_number: number 4127 + type: 'response.incomplete' 4128 + } 4129 + type ResponseInput = Array<ResponseInputItem> 4130 + type ResponseInputContent = ResponseInputText | ResponseInputImage 4131 + type ResponseInputImage = { 4132 + detail: 'low' | 'high' | 'auto' 4133 + type: 'input_image' 4134 + /** 4135 + * Base64 encoded image 4136 + */ 4137 + image_url?: string | null 4138 + } 4139 + type ResponseInputImageContent = { 4140 + type: 'input_image' 4141 + detail?: 'low' | 'high' | 'auto' | null 4142 + /** 4143 + * Base64 encoded image 4144 + */ 4145 + image_url?: string | null 4146 + } 4147 + type ResponseInputItem = 4148 + | EasyInputMessage 4149 + | ResponseInputItemMessage 4150 + | ResponseOutputMessage 4151 + | ResponseFunctionToolCall 4152 + | ResponseInputItemFunctionCallOutput 4153 + | ResponseReasoningItem 4154 + type ResponseInputItemFunctionCallOutput = { 4155 + call_id: string 4156 + output: string | ResponseFunctionCallOutputItemList 4157 + type: 'function_call_output' 4158 + id?: string | null 4159 + status?: 'in_progress' | 'completed' | 'incomplete' | null 4160 + } 4161 + type ResponseInputItemMessage = { 4162 + content: ResponseInputMessageContentList 4163 + role: 'user' | 'system' | 'developer' 4164 + status?: 'in_progress' | 'completed' | 'incomplete' 4165 + type?: 'message' 4166 + } 4167 + type ResponseInputMessageContentList = Array<ResponseInputContent> 4168 + type ResponseInputMessageItem = { 4169 + id: string 4170 + content: ResponseInputMessageContentList 4171 + role: 'user' | 'system' | 'developer' 4172 + status?: 'in_progress' | 'completed' | 'incomplete' 4173 + type?: 'message' 4174 + } 4175 + type ResponseInputText = { 4176 + text: string 4177 + type: 'input_text' 4178 + } 4179 + type ResponseInputTextContent = { 4180 + text: string 4181 + type: 'input_text' 4182 + } 4183 + type ResponseItem = 4184 + | ResponseInputMessageItem 4185 + | ResponseOutputMessage 4186 + | ResponseFunctionToolCallItem 4187 + | ResponseFunctionToolCallOutputItem 4188 + type ResponseOutputItem = ResponseOutputMessage | ResponseFunctionToolCall | ResponseReasoningItem 4189 + type ResponseOutputItemAddedEvent = { 4190 + item: ResponseOutputItem 4191 + output_index: number 4192 + sequence_number: number 4193 + type: 'response.output_item.added' 4194 + } 4195 + type ResponseOutputItemDoneEvent = { 4196 + item: ResponseOutputItem 4197 + output_index: number 4198 + sequence_number: number 4199 + type: 'response.output_item.done' 4200 + } 4201 + type ResponseOutputMessage = { 4202 + id: string 4203 + content: Array<ResponseOutputText | ResponseOutputRefusal> 4204 + role: 'assistant' 4205 + status: 'in_progress' | 'completed' | 'incomplete' 4206 + type: 'message' 4207 + } 4208 + type ResponseOutputRefusal = { 4209 + refusal: string 4210 + type: 'refusal' 4211 + } 4212 + type ResponseOutputText = { 4213 + text: string 4214 + type: 'output_text' 4215 + logprobs?: Array<Logprob> 4216 + } 4217 + type ResponseReasoningItem = { 4218 + id: string 4219 + summary: Array<ResponseReasoningSummaryItem> 4220 + type: 'reasoning' 4221 + content?: Array<ResponseReasoningContentItem> 4222 + encrypted_content?: string | null 4223 + status?: 'in_progress' | 'completed' | 'incomplete' 4224 + } 4225 + type ResponseReasoningSummaryItem = { 4226 + text: string 4227 + type: 'summary_text' 4228 + } 4229 + type ResponseReasoningContentItem = { 4230 + text: string 4231 + type: 'reasoning_text' 4232 + } 4233 + type ResponseReasoningTextDeltaEvent = { 4234 + content_index: number 4235 + delta: string 4236 + item_id: string 4237 + output_index: number 4238 + sequence_number: number 4239 + type: 'response.reasoning_text.delta' 4240 + } 4241 + type ResponseReasoningTextDoneEvent = { 4242 + content_index: number 4243 + item_id: string 4244 + output_index: number 4245 + sequence_number: number 4246 + text: string 4247 + type: 'response.reasoning_text.done' 4248 + } 4249 + type ResponseRefusalDeltaEvent = { 4250 + content_index: number 4251 + delta: string 4252 + item_id: string 4253 + output_index: number 4254 + sequence_number: number 4255 + type: 'response.refusal.delta' 4256 + } 4257 + type ResponseRefusalDoneEvent = { 4258 + content_index: number 4259 + item_id: string 4260 + output_index: number 4261 + refusal: string 4262 + sequence_number: number 4263 + type: 'response.refusal.done' 4264 + } 4265 + type ResponseStatus = 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete' 4266 + type ResponseStreamEvent = 4267 + | ResponseCompletedEvent 4268 + | ResponseCreatedEvent 4269 + | ResponseErrorEvent 4270 + | ResponseFunctionCallArgumentsDeltaEvent 4271 + | ResponseFunctionCallArgumentsDoneEvent 4272 + | ResponseFailedEvent 4273 + | ResponseIncompleteEvent 4274 + | ResponseOutputItemAddedEvent 4275 + | ResponseOutputItemDoneEvent 4276 + | ResponseReasoningTextDeltaEvent 4277 + | ResponseReasoningTextDoneEvent 4278 + | ResponseRefusalDeltaEvent 4279 + | ResponseRefusalDoneEvent 4280 + | ResponseTextDeltaEvent 4281 + | ResponseTextDoneEvent 4282 + type ResponseCompletedEvent = { 4283 + response: Response 4284 + sequence_number: number 4285 + type: 'response.completed' 4286 + } 4287 + type ResponseTextConfig = { 4288 + format?: ResponseFormatTextConfig 4289 + verbosity?: 'low' | 'medium' | 'high' | null 4290 + } 4291 + type ResponseTextDeltaEvent = { 4292 + content_index: number 4293 + delta: string 4294 + item_id: string 4295 + logprobs: Array<Logprob> 4296 + output_index: number 4297 + sequence_number: number 4298 + type: 'response.output_text.delta' 4299 + } 4300 + type ResponseTextDoneEvent = { 4301 + content_index: number 4302 + item_id: string 4303 + logprobs: Array<Logprob> 4304 + output_index: number 4305 + sequence_number: number 4306 + text: string 4307 + type: 'response.output_text.done' 4308 + } 4309 + type Logprob = { 4310 + token: string 4311 + logprob: number 4312 + top_logprobs?: Array<TopLogprob> 4313 + } 4314 + type TopLogprob = { 4315 + token?: string 4316 + logprob?: number 4317 + } 4318 + type ResponseUsage = { 4319 + input_tokens: number 4320 + output_tokens: number 4321 + total_tokens: number 4322 + } 4323 + type Tool = ResponsesFunctionTool 4324 + type ToolChoiceFunction = { 4325 + name: string 4326 + type: 'function' 4327 + } 4328 + type ToolChoiceOptions = 'none' 4329 + type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | null 4330 + type StreamOptions = { 4331 + include_obfuscation?: boolean 4332 + } 4333 + type Ai_Cf_Baai_Bge_Base_En_V1_5_Input = 4334 + | { 4335 + text: string | string[] 4336 + /** 4337 + * 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. 4338 + */ 4339 + pooling?: 'mean' | 'cls' 4340 + } 4341 + | { 4342 + /** 4343 + * Batch of the embeddings requests to run using async-queue 4344 + */ 4345 + requests: { 4346 + text: string | string[] 4347 + /** 4348 + * 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. 4349 + */ 4350 + pooling?: 'mean' | 'cls' 4351 + }[] 4352 + } 4353 + type Ai_Cf_Baai_Bge_Base_En_V1_5_Output = 4354 + | { 4355 + shape?: number[] 4356 + /** 4357 + * Embeddings of the requested text values 4358 + */ 4359 + data?: number[][] 4360 + /** 4361 + * The pooling method used in the embedding process. 4362 + */ 4363 + pooling?: 'mean' | 'cls' 4364 + } 4365 + | Ai_Cf_Baai_Bge_Base_En_V1_5_AsyncResponse 4366 + interface Ai_Cf_Baai_Bge_Base_En_V1_5_AsyncResponse { 4367 + /** 4368 + * The async request id that can be used to obtain the results. 4369 + */ 4370 + request_id?: string 4371 + } 4372 + declare abstract class Base_Ai_Cf_Baai_Bge_Base_En_V1_5 { 4373 + inputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Input 4374 + postProcessedOutputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Output 4375 + } 4376 + type Ai_Cf_Openai_Whisper_Input = 4377 + | string 4378 + | { 4379 + /** 4380 + * An array of integers that represent the audio data constrained to 8-bit unsigned integer values 4381 + */ 4382 + audio: number[] 4383 + } 4384 + interface Ai_Cf_Openai_Whisper_Output { 4385 + /** 4386 + * The transcription 4387 + */ 4388 + text: string 4389 + word_count?: number 4390 + words?: { 4391 + word?: string 4392 + /** 4393 + * The second this word begins in the recording 4394 + */ 4395 + start?: number 4396 + /** 4397 + * The ending second when the word completes 4398 + */ 4399 + end?: number 4400 + }[] 4401 + vtt?: string 4402 + } 4403 + declare abstract class Base_Ai_Cf_Openai_Whisper { 4404 + inputs: Ai_Cf_Openai_Whisper_Input 4405 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Output 4406 + } 4407 + type Ai_Cf_Meta_M2M100_1_2B_Input = 4408 + | { 4409 + /** 4410 + * The text to be translated 4411 + */ 4412 + text: string 4413 + /** 4414 + * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified 4415 + */ 4416 + source_lang?: string 4417 + /** 4418 + * The language code to translate the text into (e.g., 'es' for Spanish) 4419 + */ 4420 + target_lang: string 4421 + } 4422 + | { 4423 + /** 4424 + * Batch of the embeddings requests to run using async-queue 4425 + */ 4426 + requests: { 4427 + /** 4428 + * The text to be translated 4429 + */ 4430 + text: string 4431 + /** 4432 + * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified 4433 + */ 4434 + source_lang?: string 4435 + /** 4436 + * The language code to translate the text into (e.g., 'es' for Spanish) 4437 + */ 4438 + target_lang: string 4439 + }[] 4440 + } 4441 + type Ai_Cf_Meta_M2M100_1_2B_Output = 4442 + | { 4443 + /** 4444 + * The translated text in the target language 4445 + */ 4446 + translated_text?: string 4447 + } 4448 + | Ai_Cf_Meta_M2M100_1_2B_AsyncResponse 4449 + interface Ai_Cf_Meta_M2M100_1_2B_AsyncResponse { 4450 + /** 4451 + * The async request id that can be used to obtain the results. 4452 + */ 4453 + request_id?: string 4454 + } 4455 + declare abstract class Base_Ai_Cf_Meta_M2M100_1_2B { 4456 + inputs: Ai_Cf_Meta_M2M100_1_2B_Input 4457 + postProcessedOutputs: Ai_Cf_Meta_M2M100_1_2B_Output 4458 + } 4459 + type Ai_Cf_Baai_Bge_Small_En_V1_5_Input = 4460 + | { 4461 + text: string | string[] 4462 + /** 4463 + * 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. 4464 + */ 4465 + pooling?: 'mean' | 'cls' 4466 + } 4467 + | { 4468 + /** 4469 + * Batch of the embeddings requests to run using async-queue 4470 + */ 4471 + requests: { 4472 + text: string | string[] 4473 + /** 4474 + * 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. 4475 + */ 4476 + pooling?: 'mean' | 'cls' 4477 + }[] 4478 + } 4479 + type Ai_Cf_Baai_Bge_Small_En_V1_5_Output = 4480 + | { 4481 + shape?: number[] 4482 + /** 4483 + * Embeddings of the requested text values 4484 + */ 4485 + data?: number[][] 4486 + /** 4487 + * The pooling method used in the embedding process. 4488 + */ 4489 + pooling?: 'mean' | 'cls' 4490 + } 4491 + | Ai_Cf_Baai_Bge_Small_En_V1_5_AsyncResponse 4492 + interface Ai_Cf_Baai_Bge_Small_En_V1_5_AsyncResponse { 4493 + /** 4494 + * The async request id that can be used to obtain the results. 4495 + */ 4496 + request_id?: string 4497 + } 4498 + declare abstract class Base_Ai_Cf_Baai_Bge_Small_En_V1_5 { 4499 + inputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Input 4500 + postProcessedOutputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Output 4501 + } 4502 + type Ai_Cf_Baai_Bge_Large_En_V1_5_Input = 4503 + | { 4504 + text: string | string[] 4505 + /** 4506 + * 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. 4507 + */ 4508 + pooling?: 'mean' | 'cls' 4509 + } 4510 + | { 4511 + /** 4512 + * Batch of the embeddings requests to run using async-queue 4513 + */ 4514 + requests: { 4515 + text: string | string[] 4516 + /** 4517 + * 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. 4518 + */ 4519 + pooling?: 'mean' | 'cls' 4520 + }[] 4521 + } 4522 + type Ai_Cf_Baai_Bge_Large_En_V1_5_Output = 4523 + | { 4524 + shape?: number[] 4525 + /** 4526 + * Embeddings of the requested text values 4527 + */ 4528 + data?: number[][] 4529 + /** 4530 + * The pooling method used in the embedding process. 4531 + */ 4532 + pooling?: 'mean' | 'cls' 4533 + } 4534 + | Ai_Cf_Baai_Bge_Large_En_V1_5_AsyncResponse 4535 + interface Ai_Cf_Baai_Bge_Large_En_V1_5_AsyncResponse { 4536 + /** 4537 + * The async request id that can be used to obtain the results. 4538 + */ 4539 + request_id?: string 4540 + } 4541 + declare abstract class Base_Ai_Cf_Baai_Bge_Large_En_V1_5 { 4542 + inputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Input 4543 + postProcessedOutputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Output 4544 + } 4545 + type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input = 4546 + | string 4547 + | { 4548 + /** 4549 + * The input text prompt for the model to generate a response. 4550 + */ 4551 + prompt?: string 4552 + /** 4553 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 4554 + */ 4555 + raw?: boolean 4556 + /** 4557 + * 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. 4558 + */ 4559 + top_p?: number 4560 + /** 4561 + * 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. 4562 + */ 4563 + top_k?: number 4564 + /** 4565 + * Random seed for reproducibility of the generation. 4566 + */ 4567 + seed?: number 4568 + /** 4569 + * Penalty for repeated tokens; higher values discourage repetition. 4570 + */ 4571 + repetition_penalty?: number 4572 + /** 4573 + * Decreases the likelihood of the model repeating the same lines verbatim. 4574 + */ 4575 + frequency_penalty?: number 4576 + /** 4577 + * Increases the likelihood of the model introducing new topics. 4578 + */ 4579 + presence_penalty?: number 4580 + image: number[] | (string & NonNullable<unknown>) 4581 + /** 4582 + * The maximum number of tokens to generate in the response. 4583 + */ 4584 + max_tokens?: number 4585 + } 4586 + interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output { 4587 + description?: string 4588 + } 4589 + declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M { 4590 + inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input 4591 + postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output 4592 + } 4593 + type Ai_Cf_Openai_Whisper_Tiny_En_Input = 4594 + | string 4595 + | { 4596 + /** 4597 + * An array of integers that represent the audio data constrained to 8-bit unsigned integer values 4598 + */ 4599 + audio: number[] 4600 + } 4601 + interface Ai_Cf_Openai_Whisper_Tiny_En_Output { 4602 + /** 4603 + * The transcription 4604 + */ 4605 + text: string 4606 + word_count?: number 4607 + words?: { 4608 + word?: string 4609 + /** 4610 + * The second this word begins in the recording 4611 + */ 4612 + start?: number 4613 + /** 4614 + * The ending second when the word completes 4615 + */ 4616 + end?: number 4617 + }[] 4618 + vtt?: string 4619 + } 4620 + declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En { 4621 + inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input 4622 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output 4623 + } 4624 + interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input { 4625 + /** 4626 + * Base64 encoded value of the audio data. 4627 + */ 4628 + audio: string 4629 + /** 4630 + * Supported tasks are 'translate' or 'transcribe'. 4631 + */ 4632 + task?: string 4633 + /** 4634 + * The language of the audio being transcribed or translated. 4635 + */ 4636 + language?: string 4637 + /** 4638 + * Preprocess the audio with a voice activity detection model. 4639 + */ 4640 + vad_filter?: boolean 4641 + /** 4642 + * A text prompt to help provide context to the model on the contents of the audio. 4643 + */ 4644 + initial_prompt?: string 4645 + /** 4646 + * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result. 4647 + */ 4648 + prefix?: string 4649 + } 4650 + interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output { 4651 + transcription_info?: { 4652 + /** 4653 + * The language of the audio being transcribed or translated. 4654 + */ 4655 + language?: string 4656 + /** 4657 + * The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1. 4658 + */ 4659 + language_probability?: number 4660 + /** 4661 + * The total duration of the original audio file, in seconds. 4662 + */ 4663 + duration?: number 4664 + /** 4665 + * The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds. 4666 + */ 4667 + duration_after_vad?: number 4668 + } 4669 + /** 4670 + * The complete transcription of the audio. 4671 + */ 4672 + text: string 4673 + /** 4674 + * The total number of words in the transcription. 4675 + */ 4676 + word_count?: number 4677 + segments?: { 4678 + /** 4679 + * The starting time of the segment within the audio, in seconds. 4680 + */ 4681 + start?: number 4682 + /** 4683 + * The ending time of the segment within the audio, in seconds. 4684 + */ 4685 + end?: number 4686 + /** 4687 + * The transcription of the segment. 4688 + */ 4689 + text?: string 4690 + /** 4691 + * The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs. 4692 + */ 4693 + temperature?: number 4694 + /** 4695 + * The average log probability of the predictions for the words in this segment, indicating overall confidence. 4696 + */ 4697 + avg_logprob?: number 4698 + /** 4699 + * The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process. 4700 + */ 4701 + compression_ratio?: number 4702 + /** 4703 + * The probability that the segment contains no speech, represented as a decimal between 0 and 1. 4704 + */ 4705 + no_speech_prob?: number 4706 + words?: { 4707 + /** 4708 + * The individual word transcribed from the audio. 4709 + */ 4710 + word?: string 4711 + /** 4712 + * The starting time of the word within the audio, in seconds. 4713 + */ 4714 + start?: number 4715 + /** 4716 + * The ending time of the word within the audio, in seconds. 4717 + */ 4718 + end?: number 4719 + }[] 4720 + }[] 4721 + /** 4722 + * The transcription in WebVTT format, which includes timing and text information for use in subtitles. 4723 + */ 4724 + vtt?: string 4725 + } 4726 + declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo { 4727 + inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input 4728 + postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output 4729 + } 4730 + type Ai_Cf_Baai_Bge_M3_Input = 4731 + | Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts 4732 + | Ai_Cf_Baai_Bge_M3_Input_Embedding 4733 + | { 4734 + /** 4735 + * Batch of the embeddings requests to run using async-queue 4736 + */ 4737 + requests: ( 4738 + | Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts_1 4739 + | Ai_Cf_Baai_Bge_M3_Input_Embedding_1 4740 + )[] 4741 + } 4742 + interface Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts { 4743 + /** 4744 + * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts 4745 + */ 4746 + query?: string 4747 + /** 4748 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it. 4749 + */ 4750 + contexts: { 4751 + /** 4752 + * One of the provided context content 4753 + */ 4754 + text?: string 4755 + }[] 4756 + /** 4757 + * When provided with too long context should the model error out or truncate the context to fit? 4758 + */ 4759 + truncate_inputs?: boolean 4760 + } 4761 + interface Ai_Cf_Baai_Bge_M3_Input_Embedding { 4762 + text: string | string[] 4763 + /** 4764 + * When provided with too long context should the model error out or truncate the context to fit? 4765 + */ 4766 + truncate_inputs?: boolean 4767 + } 4768 + interface Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts_1 { 4769 + /** 4770 + * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts 4771 + */ 4772 + query?: string 4773 + /** 4774 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it. 4775 + */ 4776 + contexts: { 4777 + /** 4778 + * One of the provided context content 4779 + */ 4780 + text?: string 4781 + }[] 4782 + /** 4783 + * When provided with too long context should the model error out or truncate the context to fit? 4784 + */ 4785 + truncate_inputs?: boolean 4786 + } 4787 + interface Ai_Cf_Baai_Bge_M3_Input_Embedding_1 { 4788 + text: string | string[] 4789 + /** 4790 + * When provided with too long context should the model error out or truncate the context to fit? 4791 + */ 4792 + truncate_inputs?: boolean 4793 + } 4794 + type Ai_Cf_Baai_Bge_M3_Output = 4795 + | Ai_Cf_Baai_Bge_M3_Ouput_Query 4796 + | Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts 4797 + | Ai_Cf_Baai_Bge_M3_Ouput_Embedding 4798 + | Ai_Cf_Baai_Bge_M3_AsyncResponse 4799 + interface Ai_Cf_Baai_Bge_M3_Ouput_Query { 4800 + response?: { 4801 + /** 4802 + * Index of the context in the request 4803 + */ 4804 + id?: number 4805 + /** 4806 + * Score of the context under the index. 4807 + */ 4808 + score?: number 4809 + }[] 4810 + } 4811 + interface Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts { 4812 + response?: number[][] 4813 + shape?: number[] 4814 + /** 4815 + * The pooling method used in the embedding process. 4816 + */ 4817 + pooling?: 'mean' | 'cls' 4818 + } 4819 + interface Ai_Cf_Baai_Bge_M3_Ouput_Embedding { 4820 + shape?: number[] 4821 + /** 4822 + * Embeddings of the requested text values 4823 + */ 4824 + data?: number[][] 4825 + /** 4826 + * The pooling method used in the embedding process. 4827 + */ 4828 + pooling?: 'mean' | 'cls' 4829 + } 4830 + interface Ai_Cf_Baai_Bge_M3_AsyncResponse { 4831 + /** 4832 + * The async request id that can be used to obtain the results. 4833 + */ 4834 + request_id?: string 4835 + } 4836 + declare abstract class Base_Ai_Cf_Baai_Bge_M3 { 4837 + inputs: Ai_Cf_Baai_Bge_M3_Input 4838 + postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output 4839 + } 4840 + interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input { 4841 + /** 4842 + * A text description of the image you want to generate. 4843 + */ 4844 + prompt: string 4845 + /** 4846 + * The number of diffusion steps; higher values can improve quality but take longer. 4847 + */ 4848 + steps?: number 4849 + } 4850 + interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output { 4851 + /** 4852 + * The generated image in Base64 format. 4853 + */ 4854 + image?: string 4855 + } 4856 + declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell { 4857 + inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input 4858 + postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output 4859 + } 4860 + type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = 4861 + | Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Prompt 4862 + | Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages 4863 + interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Prompt { 4864 + /** 4865 + * The input text prompt for the model to generate a response. 4866 + */ 4867 + prompt: string 4868 + image?: number[] | (string & NonNullable<unknown>) 4869 + /** 4870 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 4871 + */ 4872 + raw?: boolean 4873 + /** 4874 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 4875 + */ 4876 + stream?: boolean 4877 + /** 4878 + * The maximum number of tokens to generate in the response. 4879 + */ 4880 + max_tokens?: number 4881 + /** 4882 + * Controls the randomness of the output; higher values produce more random results. 4883 + */ 4884 + temperature?: number 4885 + /** 4886 + * 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. 4887 + */ 4888 + top_p?: number 4889 + /** 4890 + * 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. 4891 + */ 4892 + top_k?: number 4893 + /** 4894 + * Random seed for reproducibility of the generation. 4895 + */ 4896 + seed?: number 4897 + /** 4898 + * Penalty for repeated tokens; higher values discourage repetition. 4899 + */ 4900 + repetition_penalty?: number 4901 + /** 4902 + * Decreases the likelihood of the model repeating the same lines verbatim. 4903 + */ 4904 + frequency_penalty?: number 4905 + /** 4906 + * Increases the likelihood of the model introducing new topics. 4907 + */ 4908 + presence_penalty?: number 4909 + /** 4910 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 4911 + */ 4912 + lora?: string 4913 + } 4914 + interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages { 4915 + /** 4916 + * An array of message objects representing the conversation history. 4917 + */ 4918 + messages: { 4919 + /** 4920 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 4921 + */ 4922 + role?: string 4923 + /** 4924 + * 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 4925 + */ 4926 + tool_call_id?: string 4927 + content?: 4928 + | string 4929 + | { 4930 + /** 4931 + * Type of the content provided 4932 + */ 4933 + type?: string 4934 + text?: string 4935 + image_url?: { 4936 + /** 4937 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 4938 + */ 4939 + url?: string 4940 + } 4941 + }[] 4942 + | { 4943 + /** 4944 + * Type of the content provided 4945 + */ 4946 + type?: string 4947 + text?: string 4948 + image_url?: { 4949 + /** 4950 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 4951 + */ 4952 + url?: string 4953 + } 4954 + } 4955 + }[] 4956 + image?: number[] | (string & NonNullable<unknown>) 4957 + functions?: { 4958 + name: string 4959 + code: string 4960 + }[] 4961 + /** 4962 + * A list of tools available for the assistant to use. 4963 + */ 4964 + tools?: ( 4965 + | { 4966 + /** 4967 + * The name of the tool. More descriptive the better. 4968 + */ 4969 + name: string 4970 + /** 4971 + * A brief description of what the tool does. 4972 + */ 4973 + description: string 4974 + /** 4975 + * Schema defining the parameters accepted by the tool. 4976 + */ 4977 + parameters: { 4978 + /** 4979 + * The type of the parameters object (usually 'object'). 4980 + */ 4981 + type: string 4982 + /** 4983 + * List of required parameter names. 4984 + */ 4985 + required?: string[] 4986 + /** 4987 + * Definitions of each parameter. 4988 + */ 4989 + properties: { 4990 + [k: string]: { 4991 + /** 4992 + * The data type of the parameter. 4993 + */ 4994 + type: string 4995 + /** 4996 + * A description of the expected parameter. 4997 + */ 4998 + description: string 4999 + } 5000 + } 5001 + } 5002 + } 5003 + | { 5004 + /** 5005 + * Specifies the type of tool (e.g., 'function'). 5006 + */ 5007 + type: string 5008 + /** 5009 + * Details of the function tool. 5010 + */ 5011 + function: { 5012 + /** 5013 + * The name of the function. 5014 + */ 5015 + name: string 5016 + /** 5017 + * A brief description of what the function does. 5018 + */ 5019 + description: string 5020 + /** 5021 + * Schema defining the parameters accepted by the function. 5022 + */ 5023 + parameters: { 5024 + /** 5025 + * The type of the parameters object (usually 'object'). 5026 + */ 5027 + type: string 5028 + /** 5029 + * List of required parameter names. 5030 + */ 5031 + required?: string[] 5032 + /** 5033 + * Definitions of each parameter. 5034 + */ 5035 + properties: { 5036 + [k: string]: { 5037 + /** 5038 + * The data type of the parameter. 5039 + */ 5040 + type: string 5041 + /** 5042 + * A description of the expected parameter. 5043 + */ 5044 + description: string 5045 + } 5046 + } 5047 + } 5048 + } 5049 + } 5050 + )[] 5051 + /** 5052 + * If true, the response will be streamed back incrementally. 5053 + */ 5054 + stream?: boolean 5055 + /** 5056 + * The maximum number of tokens to generate in the response. 5057 + */ 5058 + max_tokens?: number 5059 + /** 5060 + * Controls the randomness of the output; higher values produce more random results. 5061 + */ 5062 + temperature?: number 5063 + /** 5064 + * 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. 5065 + */ 5066 + top_p?: number 5067 + /** 5068 + * 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. 5069 + */ 5070 + top_k?: number 5071 + /** 5072 + * Random seed for reproducibility of the generation. 5073 + */ 5074 + seed?: number 5075 + /** 5076 + * Penalty for repeated tokens; higher values discourage repetition. 5077 + */ 5078 + repetition_penalty?: number 5079 + /** 5080 + * Decreases the likelihood of the model repeating the same lines verbatim. 5081 + */ 5082 + frequency_penalty?: number 5083 + /** 5084 + * Increases the likelihood of the model introducing new topics. 5085 + */ 5086 + presence_penalty?: number 5087 + } 5088 + type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output = { 5089 + /** 5090 + * The generated text response from the model 5091 + */ 5092 + response?: string 5093 + /** 5094 + * An array of tool calls requests made during the response generation 5095 + */ 5096 + tool_calls?: { 5097 + /** 5098 + * The arguments passed to be passed to the tool call request 5099 + */ 5100 + arguments?: object 5101 + /** 5102 + * The name of the tool to be called 5103 + */ 5104 + name?: string 5105 + }[] 5106 + } 5107 + declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct { 5108 + inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input 5109 + postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output 5110 + } 5111 + type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input = 5112 + | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt 5113 + | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages 5114 + | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Async_Batch 5115 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt { 5116 + /** 5117 + * The input text prompt for the model to generate a response. 5118 + */ 5119 + prompt: string 5120 + /** 5121 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 5122 + */ 5123 + lora?: string 5124 + response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode 5125 + /** 5126 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5127 + */ 5128 + raw?: boolean 5129 + /** 5130 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5131 + */ 5132 + stream?: boolean 5133 + /** 5134 + * The maximum number of tokens to generate in the response. 5135 + */ 5136 + max_tokens?: number 5137 + /** 5138 + * Controls the randomness of the output; higher values produce more random results. 5139 + */ 5140 + temperature?: number 5141 + /** 5142 + * 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. 5143 + */ 5144 + top_p?: number 5145 + /** 5146 + * 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. 5147 + */ 5148 + top_k?: number 5149 + /** 5150 + * Random seed for reproducibility of the generation. 5151 + */ 5152 + seed?: number 5153 + /** 5154 + * Penalty for repeated tokens; higher values discourage repetition. 5155 + */ 5156 + repetition_penalty?: number 5157 + /** 5158 + * Decreases the likelihood of the model repeating the same lines verbatim. 5159 + */ 5160 + frequency_penalty?: number 5161 + /** 5162 + * Increases the likelihood of the model introducing new topics. 5163 + */ 5164 + presence_penalty?: number 5165 + } 5166 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode { 5167 + type?: 'json_object' | 'json_schema' 5168 + json_schema?: unknown 5169 + } 5170 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages { 5171 + /** 5172 + * An array of message objects representing the conversation history. 5173 + */ 5174 + messages: { 5175 + /** 5176 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 5177 + */ 5178 + role: string 5179 + /** 5180 + * The content of the message as a string. 5181 + */ 5182 + content: string 5183 + }[] 5184 + functions?: { 5185 + name: string 5186 + code: string 5187 + }[] 5188 + /** 5189 + * A list of tools available for the assistant to use. 5190 + */ 5191 + tools?: ( 5192 + | { 5193 + /** 5194 + * The name of the tool. More descriptive the better. 5195 + */ 5196 + name: string 5197 + /** 5198 + * A brief description of what the tool does. 5199 + */ 5200 + description: string 5201 + /** 5202 + * Schema defining the parameters accepted by the tool. 5203 + */ 5204 + parameters: { 5205 + /** 5206 + * The type of the parameters object (usually 'object'). 5207 + */ 5208 + type: string 5209 + /** 5210 + * List of required parameter names. 5211 + */ 5212 + required?: string[] 5213 + /** 5214 + * Definitions of each parameter. 5215 + */ 5216 + properties: { 5217 + [k: string]: { 5218 + /** 5219 + * The data type of the parameter. 5220 + */ 5221 + type: string 5222 + /** 5223 + * A description of the expected parameter. 5224 + */ 5225 + description: string 5226 + } 5227 + } 5228 + } 5229 + } 5230 + | { 5231 + /** 5232 + * Specifies the type of tool (e.g., 'function'). 5233 + */ 5234 + type: string 5235 + /** 5236 + * Details of the function tool. 5237 + */ 5238 + function: { 5239 + /** 5240 + * The name of the function. 5241 + */ 5242 + name: string 5243 + /** 5244 + * A brief description of what the function does. 5245 + */ 5246 + description: string 5247 + /** 5248 + * Schema defining the parameters accepted by the function. 5249 + */ 5250 + parameters: { 5251 + /** 5252 + * The type of the parameters object (usually 'object'). 5253 + */ 5254 + type: string 5255 + /** 5256 + * List of required parameter names. 5257 + */ 5258 + required?: string[] 5259 + /** 5260 + * Definitions of each parameter. 5261 + */ 5262 + properties: { 5263 + [k: string]: { 5264 + /** 5265 + * The data type of the parameter. 5266 + */ 5267 + type: string 5268 + /** 5269 + * A description of the expected parameter. 5270 + */ 5271 + description: string 5272 + } 5273 + } 5274 + } 5275 + } 5276 + } 5277 + )[] 5278 + response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_1 5279 + /** 5280 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5281 + */ 5282 + raw?: boolean 5283 + /** 5284 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5285 + */ 5286 + stream?: boolean 5287 + /** 5288 + * The maximum number of tokens to generate in the response. 5289 + */ 5290 + max_tokens?: number 5291 + /** 5292 + * Controls the randomness of the output; higher values produce more random results. 5293 + */ 5294 + temperature?: number 5295 + /** 5296 + * 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. 5297 + */ 5298 + top_p?: number 5299 + /** 5300 + * 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. 5301 + */ 5302 + top_k?: number 5303 + /** 5304 + * Random seed for reproducibility of the generation. 5305 + */ 5306 + seed?: number 5307 + /** 5308 + * Penalty for repeated tokens; higher values discourage repetition. 5309 + */ 5310 + repetition_penalty?: number 5311 + /** 5312 + * Decreases the likelihood of the model repeating the same lines verbatim. 5313 + */ 5314 + frequency_penalty?: number 5315 + /** 5316 + * Increases the likelihood of the model introducing new topics. 5317 + */ 5318 + presence_penalty?: number 5319 + } 5320 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_1 { 5321 + type?: 'json_object' | 'json_schema' 5322 + json_schema?: unknown 5323 + } 5324 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Async_Batch { 5325 + requests?: { 5326 + /** 5327 + * 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. 5328 + */ 5329 + external_reference?: string 5330 + /** 5331 + * Prompt for the text generation model 5332 + */ 5333 + prompt?: string 5334 + /** 5335 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5336 + */ 5337 + stream?: boolean 5338 + /** 5339 + * The maximum number of tokens to generate in the response. 5340 + */ 5341 + max_tokens?: number 5342 + /** 5343 + * Controls the randomness of the output; higher values produce more random results. 5344 + */ 5345 + temperature?: number 5346 + /** 5347 + * 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. 5348 + */ 5349 + top_p?: number 5350 + /** 5351 + * Random seed for reproducibility of the generation. 5352 + */ 5353 + seed?: number 5354 + /** 5355 + * Penalty for repeated tokens; higher values discourage repetition. 5356 + */ 5357 + repetition_penalty?: number 5358 + /** 5359 + * Decreases the likelihood of the model repeating the same lines verbatim. 5360 + */ 5361 + frequency_penalty?: number 5362 + /** 5363 + * Increases the likelihood of the model introducing new topics. 5364 + */ 5365 + presence_penalty?: number 5366 + response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_2 5367 + }[] 5368 + } 5369 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_2 { 5370 + type?: 'json_object' | 'json_schema' 5371 + json_schema?: unknown 5372 + } 5373 + type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output = 5374 + | { 5375 + /** 5376 + * The generated text response from the model 5377 + */ 5378 + response: string 5379 + /** 5380 + * Usage statistics for the inference request 5381 + */ 5382 + usage?: { 5383 + /** 5384 + * Total number of tokens in input 5385 + */ 5386 + prompt_tokens?: number 5387 + /** 5388 + * Total number of tokens in output 5389 + */ 5390 + completion_tokens?: number 5391 + /** 5392 + * Total number of input and output tokens 5393 + */ 5394 + total_tokens?: number 5395 + } 5396 + /** 5397 + * An array of tool calls requests made during the response generation 5398 + */ 5399 + tool_calls?: { 5400 + /** 5401 + * The arguments passed to be passed to the tool call request 5402 + */ 5403 + arguments?: object 5404 + /** 5405 + * The name of the tool to be called 5406 + */ 5407 + name?: string 5408 + }[] 5409 + } 5410 + | string 5411 + | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_AsyncResponse 5412 + interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_AsyncResponse { 5413 + /** 5414 + * The async request id that can be used to obtain the results. 5415 + */ 5416 + request_id?: string 5417 + } 5418 + declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast { 5419 + inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input 5420 + postProcessedOutputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output 5421 + } 5422 + interface Ai_Cf_Meta_Llama_Guard_3_8B_Input { 5423 + /** 5424 + * An array of message objects representing the conversation history. 5425 + */ 5426 + messages: { 5427 + /** 5428 + * The role of the message sender must alternate between 'user' and 'assistant'. 5429 + */ 5430 + role: 'user' | 'assistant' 5431 + /** 5432 + * The content of the message as a string. 5433 + */ 5434 + content: string 5435 + }[] 5436 + /** 5437 + * The maximum number of tokens to generate in the response. 5438 + */ 5439 + max_tokens?: number 5440 + /** 5441 + * Controls the randomness of the output; higher values produce more random results. 5442 + */ 5443 + temperature?: number 5444 + /** 5445 + * Dictate the output format of the generated response. 5446 + */ 5447 + response_format?: { 5448 + /** 5449 + * Set to json_object to process and output generated text as JSON. 5450 + */ 5451 + type?: string 5452 + } 5453 + } 5454 + interface Ai_Cf_Meta_Llama_Guard_3_8B_Output { 5455 + response?: 5456 + | string 5457 + | { 5458 + /** 5459 + * Whether the conversation is safe or not. 5460 + */ 5461 + safe?: boolean 5462 + /** 5463 + * A list of what hazard categories predicted for the conversation, if the conversation is deemed unsafe. 5464 + */ 5465 + categories?: string[] 5466 + } 5467 + /** 5468 + * Usage statistics for the inference request 5469 + */ 5470 + usage?: { 5471 + /** 5472 + * Total number of tokens in input 5473 + */ 5474 + prompt_tokens?: number 5475 + /** 5476 + * Total number of tokens in output 5477 + */ 5478 + completion_tokens?: number 5479 + /** 5480 + * Total number of input and output tokens 5481 + */ 5482 + total_tokens?: number 5483 + } 5484 + } 5485 + declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B { 5486 + inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input 5487 + postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output 5488 + } 5489 + interface Ai_Cf_Baai_Bge_Reranker_Base_Input { 5490 + /** 5491 + * A query you wish to perform against the provided contexts. 5492 + */ 5493 + /** 5494 + * Number of returned results starting with the best score. 5495 + */ 5496 + top_k?: number 5497 + /** 5498 + * List of provided contexts. Note that the index in this array is important, as the response will refer to it. 5499 + */ 5500 + contexts: { 5501 + /** 5502 + * One of the provided context content 5503 + */ 5504 + text?: string 5505 + }[] 5506 + } 5507 + interface Ai_Cf_Baai_Bge_Reranker_Base_Output { 5508 + response?: { 5509 + /** 5510 + * Index of the context in the request 5511 + */ 5512 + id?: number 5513 + /** 5514 + * Score of the context under the index. 5515 + */ 5516 + score?: number 5517 + }[] 5518 + } 5519 + declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base { 5520 + inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input 5521 + postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output 5522 + } 5523 + type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input = 5524 + | Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Prompt 5525 + | Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Messages 5526 + interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Prompt { 5527 + /** 5528 + * The input text prompt for the model to generate a response. 5529 + */ 5530 + prompt: string 5531 + /** 5532 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 5533 + */ 5534 + lora?: string 5535 + response_format?: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode 5536 + /** 5537 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5538 + */ 5539 + raw?: boolean 5540 + /** 5541 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5542 + */ 5543 + stream?: boolean 5544 + /** 5545 + * The maximum number of tokens to generate in the response. 5546 + */ 5547 + max_tokens?: number 5548 + /** 5549 + * Controls the randomness of the output; higher values produce more random results. 5550 + */ 5551 + temperature?: number 5552 + /** 5553 + * 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. 5554 + */ 5555 + top_p?: number 5556 + /** 5557 + * 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. 5558 + */ 5559 + top_k?: number 5560 + /** 5561 + * Random seed for reproducibility of the generation. 5562 + */ 5563 + seed?: number 5564 + /** 5565 + * Penalty for repeated tokens; higher values discourage repetition. 5566 + */ 5567 + repetition_penalty?: number 5568 + /** 5569 + * Decreases the likelihood of the model repeating the same lines verbatim. 5570 + */ 5571 + frequency_penalty?: number 5572 + /** 5573 + * Increases the likelihood of the model introducing new topics. 5574 + */ 5575 + presence_penalty?: number 5576 + } 5577 + interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode { 5578 + type?: 'json_object' | 'json_schema' 5579 + json_schema?: unknown 5580 + } 5581 + interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Messages { 5582 + /** 5583 + * An array of message objects representing the conversation history. 5584 + */ 5585 + messages: { 5586 + /** 5587 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 5588 + */ 5589 + role: string 5590 + /** 5591 + * The content of the message as a string. 5592 + */ 5593 + content: string 5594 + }[] 5595 + functions?: { 5596 + name: string 5597 + code: string 5598 + }[] 5599 + /** 5600 + * A list of tools available for the assistant to use. 5601 + */ 5602 + tools?: ( 5603 + | { 5604 + /** 5605 + * The name of the tool. More descriptive the better. 5606 + */ 5607 + name: string 5608 + /** 5609 + * A brief description of what the tool does. 5610 + */ 5611 + description: string 5612 + /** 5613 + * Schema defining the parameters accepted by the tool. 5614 + */ 5615 + parameters: { 5616 + /** 5617 + * The type of the parameters object (usually 'object'). 5618 + */ 5619 + type: string 5620 + /** 5621 + * List of required parameter names. 5622 + */ 5623 + required?: string[] 5624 + /** 5625 + * Definitions of each parameter. 5626 + */ 5627 + properties: { 5628 + [k: string]: { 5629 + /** 5630 + * The data type of the parameter. 5631 + */ 5632 + type: string 5633 + /** 5634 + * A description of the expected parameter. 5635 + */ 5636 + description: string 5637 + } 5638 + } 5639 + } 5640 + } 5641 + | { 5642 + /** 5643 + * Specifies the type of tool (e.g., 'function'). 5644 + */ 5645 + type: string 5646 + /** 5647 + * Details of the function tool. 5648 + */ 5649 + function: { 5650 + /** 5651 + * The name of the function. 5652 + */ 5653 + name: string 5654 + /** 5655 + * A brief description of what the function does. 5656 + */ 5657 + description: string 5658 + /** 5659 + * Schema defining the parameters accepted by the function. 5660 + */ 5661 + parameters: { 5662 + /** 5663 + * The type of the parameters object (usually 'object'). 5664 + */ 5665 + type: string 5666 + /** 5667 + * List of required parameter names. 5668 + */ 5669 + required?: string[] 5670 + /** 5671 + * Definitions of each parameter. 5672 + */ 5673 + properties: { 5674 + [k: string]: { 5675 + /** 5676 + * The data type of the parameter. 5677 + */ 5678 + type: string 5679 + /** 5680 + * A description of the expected parameter. 5681 + */ 5682 + description: string 5683 + } 5684 + } 5685 + } 5686 + } 5687 + } 5688 + )[] 5689 + response_format?: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode_1 5690 + /** 5691 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5692 + */ 5693 + raw?: boolean 5694 + /** 5695 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5696 + */ 5697 + stream?: boolean 5698 + /** 5699 + * The maximum number of tokens to generate in the response. 5700 + */ 5701 + max_tokens?: number 5702 + /** 5703 + * Controls the randomness of the output; higher values produce more random results. 5704 + */ 5705 + temperature?: number 5706 + /** 5707 + * 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. 5708 + */ 5709 + top_p?: number 5710 + /** 5711 + * 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. 5712 + */ 5713 + top_k?: number 5714 + /** 5715 + * Random seed for reproducibility of the generation. 5716 + */ 5717 + seed?: number 5718 + /** 5719 + * Penalty for repeated tokens; higher values discourage repetition. 5720 + */ 5721 + repetition_penalty?: number 5722 + /** 5723 + * Decreases the likelihood of the model repeating the same lines verbatim. 5724 + */ 5725 + frequency_penalty?: number 5726 + /** 5727 + * Increases the likelihood of the model introducing new topics. 5728 + */ 5729 + presence_penalty?: number 5730 + } 5731 + interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode_1 { 5732 + type?: 'json_object' | 'json_schema' 5733 + json_schema?: unknown 5734 + } 5735 + type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output = { 5736 + /** 5737 + * The generated text response from the model 5738 + */ 5739 + response: string 5740 + /** 5741 + * Usage statistics for the inference request 5742 + */ 5743 + usage?: { 5744 + /** 5745 + * Total number of tokens in input 5746 + */ 5747 + prompt_tokens?: number 5748 + /** 5749 + * Total number of tokens in output 5750 + */ 5751 + completion_tokens?: number 5752 + /** 5753 + * Total number of input and output tokens 5754 + */ 5755 + total_tokens?: number 5756 + } 5757 + /** 5758 + * An array of tool calls requests made during the response generation 5759 + */ 5760 + tool_calls?: { 5761 + /** 5762 + * The arguments passed to be passed to the tool call request 5763 + */ 5764 + arguments?: object 5765 + /** 5766 + * The name of the tool to be called 5767 + */ 5768 + name?: string 5769 + }[] 5770 + } 5771 + declare abstract class Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct { 5772 + inputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input 5773 + postProcessedOutputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output 5774 + } 5775 + type Ai_Cf_Qwen_Qwq_32B_Input = Ai_Cf_Qwen_Qwq_32B_Prompt | Ai_Cf_Qwen_Qwq_32B_Messages 5776 + interface Ai_Cf_Qwen_Qwq_32B_Prompt { 5777 + /** 5778 + * The input text prompt for the model to generate a response. 5779 + */ 5780 + prompt: string 5781 + /** 5782 + * JSON schema that should be fulfilled for the response. 5783 + */ 5784 + guided_json?: object 5785 + /** 5786 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5787 + */ 5788 + raw?: boolean 5789 + /** 5790 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5791 + */ 5792 + stream?: boolean 5793 + /** 5794 + * The maximum number of tokens to generate in the response. 5795 + */ 5796 + max_tokens?: number 5797 + /** 5798 + * Controls the randomness of the output; higher values produce more random results. 5799 + */ 5800 + temperature?: number 5801 + /** 5802 + * 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. 5803 + */ 5804 + top_p?: number 5805 + /** 5806 + * 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. 5807 + */ 5808 + top_k?: number 5809 + /** 5810 + * Random seed for reproducibility of the generation. 5811 + */ 5812 + seed?: number 5813 + /** 5814 + * Penalty for repeated tokens; higher values discourage repetition. 5815 + */ 5816 + repetition_penalty?: number 5817 + /** 5818 + * Decreases the likelihood of the model repeating the same lines verbatim. 5819 + */ 5820 + frequency_penalty?: number 5821 + /** 5822 + * Increases the likelihood of the model introducing new topics. 5823 + */ 5824 + presence_penalty?: number 5825 + } 5826 + interface Ai_Cf_Qwen_Qwq_32B_Messages { 5827 + /** 5828 + * An array of message objects representing the conversation history. 5829 + */ 5830 + messages: { 5831 + /** 5832 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 5833 + */ 5834 + role?: string 5835 + /** 5836 + * 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 5837 + */ 5838 + tool_call_id?: string 5839 + content?: 5840 + | string 5841 + | { 5842 + /** 5843 + * Type of the content provided 5844 + */ 5845 + type?: string 5846 + text?: string 5847 + image_url?: { 5848 + /** 5849 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 5850 + */ 5851 + url?: string 5852 + } 5853 + }[] 5854 + | { 5855 + /** 5856 + * Type of the content provided 5857 + */ 5858 + type?: string 5859 + text?: string 5860 + image_url?: { 5861 + /** 5862 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 5863 + */ 5864 + url?: string 5865 + } 5866 + } 5867 + }[] 5868 + functions?: { 5869 + name: string 5870 + code: string 5871 + }[] 5872 + /** 5873 + * A list of tools available for the assistant to use. 5874 + */ 5875 + tools?: ( 5876 + | { 5877 + /** 5878 + * The name of the tool. More descriptive the better. 5879 + */ 5880 + name: string 5881 + /** 5882 + * A brief description of what the tool does. 5883 + */ 5884 + description: string 5885 + /** 5886 + * Schema defining the parameters accepted by the tool. 5887 + */ 5888 + parameters: { 5889 + /** 5890 + * The type of the parameters object (usually 'object'). 5891 + */ 5892 + type: string 5893 + /** 5894 + * List of required parameter names. 5895 + */ 5896 + required?: string[] 5897 + /** 5898 + * Definitions of each parameter. 5899 + */ 5900 + properties: { 5901 + [k: string]: { 5902 + /** 5903 + * The data type of the parameter. 5904 + */ 5905 + type: string 5906 + /** 5907 + * A description of the expected parameter. 5908 + */ 5909 + description: string 5910 + } 5911 + } 5912 + } 5913 + } 5914 + | { 5915 + /** 5916 + * Specifies the type of tool (e.g., 'function'). 5917 + */ 5918 + type: string 5919 + /** 5920 + * Details of the function tool. 5921 + */ 5922 + function: { 5923 + /** 5924 + * The name of the function. 5925 + */ 5926 + name: string 5927 + /** 5928 + * A brief description of what the function does. 5929 + */ 5930 + description: string 5931 + /** 5932 + * Schema defining the parameters accepted by the function. 5933 + */ 5934 + parameters: { 5935 + /** 5936 + * The type of the parameters object (usually 'object'). 5937 + */ 5938 + type: string 5939 + /** 5940 + * List of required parameter names. 5941 + */ 5942 + required?: string[] 5943 + /** 5944 + * Definitions of each parameter. 5945 + */ 5946 + properties: { 5947 + [k: string]: { 5948 + /** 5949 + * The data type of the parameter. 5950 + */ 5951 + type: string 5952 + /** 5953 + * A description of the expected parameter. 5954 + */ 5955 + description: string 5956 + } 5957 + } 5958 + } 5959 + } 5960 + } 5961 + )[] 5962 + /** 5963 + * JSON schema that should be fufilled for the response. 5964 + */ 5965 + guided_json?: object 5966 + /** 5967 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 5968 + */ 5969 + raw?: boolean 5970 + /** 5971 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 5972 + */ 5973 + stream?: boolean 5974 + /** 5975 + * The maximum number of tokens to generate in the response. 5976 + */ 5977 + max_tokens?: number 5978 + /** 5979 + * Controls the randomness of the output; higher values produce more random results. 5980 + */ 5981 + temperature?: number 5982 + /** 5983 + * 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. 5984 + */ 5985 + top_p?: number 5986 + /** 5987 + * 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. 5988 + */ 5989 + top_k?: number 5990 + /** 5991 + * Random seed for reproducibility of the generation. 5992 + */ 5993 + seed?: number 5994 + /** 5995 + * Penalty for repeated tokens; higher values discourage repetition. 5996 + */ 5997 + repetition_penalty?: number 5998 + /** 5999 + * Decreases the likelihood of the model repeating the same lines verbatim. 6000 + */ 6001 + frequency_penalty?: number 6002 + /** 6003 + * Increases the likelihood of the model introducing new topics. 6004 + */ 6005 + presence_penalty?: number 6006 + } 6007 + type Ai_Cf_Qwen_Qwq_32B_Output = { 6008 + /** 6009 + * The generated text response from the model 6010 + */ 6011 + response: string 6012 + /** 6013 + * Usage statistics for the inference request 6014 + */ 6015 + usage?: { 6016 + /** 6017 + * Total number of tokens in input 6018 + */ 6019 + prompt_tokens?: number 6020 + /** 6021 + * Total number of tokens in output 6022 + */ 6023 + completion_tokens?: number 6024 + /** 6025 + * Total number of input and output tokens 6026 + */ 6027 + total_tokens?: number 6028 + } 6029 + /** 6030 + * An array of tool calls requests made during the response generation 6031 + */ 6032 + tool_calls?: { 6033 + /** 6034 + * The arguments passed to be passed to the tool call request 6035 + */ 6036 + arguments?: object 6037 + /** 6038 + * The name of the tool to be called 6039 + */ 6040 + name?: string 6041 + }[] 6042 + } 6043 + declare abstract class Base_Ai_Cf_Qwen_Qwq_32B { 6044 + inputs: Ai_Cf_Qwen_Qwq_32B_Input 6045 + postProcessedOutputs: Ai_Cf_Qwen_Qwq_32B_Output 6046 + } 6047 + type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input = 6048 + | Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Prompt 6049 + | Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages 6050 + interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Prompt { 6051 + /** 6052 + * The input text prompt for the model to generate a response. 6053 + */ 6054 + prompt: string 6055 + /** 6056 + * JSON schema that should be fulfilled for the response. 6057 + */ 6058 + guided_json?: object 6059 + /** 6060 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6061 + */ 6062 + raw?: boolean 6063 + /** 6064 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6065 + */ 6066 + stream?: boolean 6067 + /** 6068 + * The maximum number of tokens to generate in the response. 6069 + */ 6070 + max_tokens?: number 6071 + /** 6072 + * Controls the randomness of the output; higher values produce more random results. 6073 + */ 6074 + temperature?: number 6075 + /** 6076 + * 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. 6077 + */ 6078 + top_p?: number 6079 + /** 6080 + * 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. 6081 + */ 6082 + top_k?: number 6083 + /** 6084 + * Random seed for reproducibility of the generation. 6085 + */ 6086 + seed?: number 6087 + /** 6088 + * Penalty for repeated tokens; higher values discourage repetition. 6089 + */ 6090 + repetition_penalty?: number 6091 + /** 6092 + * Decreases the likelihood of the model repeating the same lines verbatim. 6093 + */ 6094 + frequency_penalty?: number 6095 + /** 6096 + * Increases the likelihood of the model introducing new topics. 6097 + */ 6098 + presence_penalty?: number 6099 + } 6100 + interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages { 6101 + /** 6102 + * An array of message objects representing the conversation history. 6103 + */ 6104 + messages: { 6105 + /** 6106 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 6107 + */ 6108 + role?: string 6109 + /** 6110 + * 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 6111 + */ 6112 + tool_call_id?: string 6113 + content?: 6114 + | string 6115 + | { 6116 + /** 6117 + * Type of the content provided 6118 + */ 6119 + type?: string 6120 + text?: string 6121 + image_url?: { 6122 + /** 6123 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6124 + */ 6125 + url?: string 6126 + } 6127 + }[] 6128 + | { 6129 + /** 6130 + * Type of the content provided 6131 + */ 6132 + type?: string 6133 + text?: string 6134 + image_url?: { 6135 + /** 6136 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6137 + */ 6138 + url?: string 6139 + } 6140 + } 6141 + }[] 6142 + functions?: { 6143 + name: string 6144 + code: string 6145 + }[] 6146 + /** 6147 + * A list of tools available for the assistant to use. 6148 + */ 6149 + tools?: ( 6150 + | { 6151 + /** 6152 + * The name of the tool. More descriptive the better. 6153 + */ 6154 + name: string 6155 + /** 6156 + * A brief description of what the tool does. 6157 + */ 6158 + description: string 6159 + /** 6160 + * Schema defining the parameters accepted by the tool. 6161 + */ 6162 + parameters: { 6163 + /** 6164 + * The type of the parameters object (usually 'object'). 6165 + */ 6166 + type: string 6167 + /** 6168 + * List of required parameter names. 6169 + */ 6170 + required?: string[] 6171 + /** 6172 + * Definitions of each parameter. 6173 + */ 6174 + properties: { 6175 + [k: string]: { 6176 + /** 6177 + * The data type of the parameter. 6178 + */ 6179 + type: string 6180 + /** 6181 + * A description of the expected parameter. 6182 + */ 6183 + description: string 6184 + } 6185 + } 6186 + } 6187 + } 6188 + | { 6189 + /** 6190 + * Specifies the type of tool (e.g., 'function'). 6191 + */ 6192 + type: string 6193 + /** 6194 + * Details of the function tool. 6195 + */ 6196 + function: { 6197 + /** 6198 + * The name of the function. 6199 + */ 6200 + name: string 6201 + /** 6202 + * A brief description of what the function does. 6203 + */ 6204 + description: string 6205 + /** 6206 + * Schema defining the parameters accepted by the function. 6207 + */ 6208 + parameters: { 6209 + /** 6210 + * The type of the parameters object (usually 'object'). 6211 + */ 6212 + type: string 6213 + /** 6214 + * List of required parameter names. 6215 + */ 6216 + required?: string[] 6217 + /** 6218 + * Definitions of each parameter. 6219 + */ 6220 + properties: { 6221 + [k: string]: { 6222 + /** 6223 + * The data type of the parameter. 6224 + */ 6225 + type: string 6226 + /** 6227 + * A description of the expected parameter. 6228 + */ 6229 + description: string 6230 + } 6231 + } 6232 + } 6233 + } 6234 + } 6235 + )[] 6236 + /** 6237 + * JSON schema that should be fufilled for the response. 6238 + */ 6239 + guided_json?: object 6240 + /** 6241 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6242 + */ 6243 + raw?: boolean 6244 + /** 6245 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6246 + */ 6247 + stream?: boolean 6248 + /** 6249 + * The maximum number of tokens to generate in the response. 6250 + */ 6251 + max_tokens?: number 6252 + /** 6253 + * Controls the randomness of the output; higher values produce more random results. 6254 + */ 6255 + temperature?: number 6256 + /** 6257 + * 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. 6258 + */ 6259 + top_p?: number 6260 + /** 6261 + * 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. 6262 + */ 6263 + top_k?: number 6264 + /** 6265 + * Random seed for reproducibility of the generation. 6266 + */ 6267 + seed?: number 6268 + /** 6269 + * Penalty for repeated tokens; higher values discourage repetition. 6270 + */ 6271 + repetition_penalty?: number 6272 + /** 6273 + * Decreases the likelihood of the model repeating the same lines verbatim. 6274 + */ 6275 + frequency_penalty?: number 6276 + /** 6277 + * Increases the likelihood of the model introducing new topics. 6278 + */ 6279 + presence_penalty?: number 6280 + } 6281 + type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output = { 6282 + /** 6283 + * The generated text response from the model 6284 + */ 6285 + response: string 6286 + /** 6287 + * Usage statistics for the inference request 6288 + */ 6289 + usage?: { 6290 + /** 6291 + * Total number of tokens in input 6292 + */ 6293 + prompt_tokens?: number 6294 + /** 6295 + * Total number of tokens in output 6296 + */ 6297 + completion_tokens?: number 6298 + /** 6299 + * Total number of input and output tokens 6300 + */ 6301 + total_tokens?: number 6302 + } 6303 + /** 6304 + * An array of tool calls requests made during the response generation 6305 + */ 6306 + tool_calls?: { 6307 + /** 6308 + * The arguments passed to be passed to the tool call request 6309 + */ 6310 + arguments?: object 6311 + /** 6312 + * The name of the tool to be called 6313 + */ 6314 + name?: string 6315 + }[] 6316 + } 6317 + declare abstract class Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct { 6318 + inputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input 6319 + postProcessedOutputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output 6320 + } 6321 + type Ai_Cf_Google_Gemma_3_12B_It_Input = 6322 + | Ai_Cf_Google_Gemma_3_12B_It_Prompt 6323 + | Ai_Cf_Google_Gemma_3_12B_It_Messages 6324 + interface Ai_Cf_Google_Gemma_3_12B_It_Prompt { 6325 + /** 6326 + * The input text prompt for the model to generate a response. 6327 + */ 6328 + prompt: string 6329 + /** 6330 + * JSON schema that should be fufilled for the response. 6331 + */ 6332 + guided_json?: object 6333 + /** 6334 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6335 + */ 6336 + raw?: boolean 6337 + /** 6338 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6339 + */ 6340 + stream?: boolean 6341 + /** 6342 + * The maximum number of tokens to generate in the response. 6343 + */ 6344 + max_tokens?: number 6345 + /** 6346 + * Controls the randomness of the output; higher values produce more random results. 6347 + */ 6348 + temperature?: number 6349 + /** 6350 + * 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. 6351 + */ 6352 + top_p?: number 6353 + /** 6354 + * 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. 6355 + */ 6356 + top_k?: number 6357 + /** 6358 + * Random seed for reproducibility of the generation. 6359 + */ 6360 + seed?: number 6361 + /** 6362 + * Penalty for repeated tokens; higher values discourage repetition. 6363 + */ 6364 + repetition_penalty?: number 6365 + /** 6366 + * Decreases the likelihood of the model repeating the same lines verbatim. 6367 + */ 6368 + frequency_penalty?: number 6369 + /** 6370 + * Increases the likelihood of the model introducing new topics. 6371 + */ 6372 + presence_penalty?: number 6373 + } 6374 + interface Ai_Cf_Google_Gemma_3_12B_It_Messages { 6375 + /** 6376 + * An array of message objects representing the conversation history. 6377 + */ 6378 + messages: { 6379 + /** 6380 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 6381 + */ 6382 + role?: string 6383 + content?: 6384 + | string 6385 + | { 6386 + /** 6387 + * Type of the content provided 6388 + */ 6389 + type?: string 6390 + text?: string 6391 + image_url?: { 6392 + /** 6393 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6394 + */ 6395 + url?: string 6396 + } 6397 + }[] 6398 + }[] 6399 + functions?: { 6400 + name: string 6401 + code: string 6402 + }[] 6403 + /** 6404 + * A list of tools available for the assistant to use. 6405 + */ 6406 + tools?: ( 6407 + | { 6408 + /** 6409 + * The name of the tool. More descriptive the better. 6410 + */ 6411 + name: string 6412 + /** 6413 + * A brief description of what the tool does. 6414 + */ 6415 + description: string 6416 + /** 6417 + * Schema defining the parameters accepted by the tool. 6418 + */ 6419 + parameters: { 6420 + /** 6421 + * The type of the parameters object (usually 'object'). 6422 + */ 6423 + type: string 6424 + /** 6425 + * List of required parameter names. 6426 + */ 6427 + required?: string[] 6428 + /** 6429 + * Definitions of each parameter. 6430 + */ 6431 + properties: { 6432 + [k: string]: { 6433 + /** 6434 + * The data type of the parameter. 6435 + */ 6436 + type: string 6437 + /** 6438 + * A description of the expected parameter. 6439 + */ 6440 + description: string 6441 + } 6442 + } 6443 + } 6444 + } 6445 + | { 6446 + /** 6447 + * Specifies the type of tool (e.g., 'function'). 6448 + */ 6449 + type: string 6450 + /** 6451 + * Details of the function tool. 6452 + */ 6453 + function: { 6454 + /** 6455 + * The name of the function. 6456 + */ 6457 + name: string 6458 + /** 6459 + * A brief description of what the function does. 6460 + */ 6461 + description: string 6462 + /** 6463 + * Schema defining the parameters accepted by the function. 6464 + */ 6465 + parameters: { 6466 + /** 6467 + * The type of the parameters object (usually 'object'). 6468 + */ 6469 + type: string 6470 + /** 6471 + * List of required parameter names. 6472 + */ 6473 + required?: string[] 6474 + /** 6475 + * Definitions of each parameter. 6476 + */ 6477 + properties: { 6478 + [k: string]: { 6479 + /** 6480 + * The data type of the parameter. 6481 + */ 6482 + type: string 6483 + /** 6484 + * A description of the expected parameter. 6485 + */ 6486 + description: string 6487 + } 6488 + } 6489 + } 6490 + } 6491 + } 6492 + )[] 6493 + /** 6494 + * JSON schema that should be fufilled for the response. 6495 + */ 6496 + guided_json?: object 6497 + /** 6498 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6499 + */ 6500 + raw?: boolean 6501 + /** 6502 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6503 + */ 6504 + stream?: boolean 6505 + /** 6506 + * The maximum number of tokens to generate in the response. 6507 + */ 6508 + max_tokens?: number 6509 + /** 6510 + * Controls the randomness of the output; higher values produce more random results. 6511 + */ 6512 + temperature?: number 6513 + /** 6514 + * 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. 6515 + */ 6516 + top_p?: number 6517 + /** 6518 + * 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. 6519 + */ 6520 + top_k?: number 6521 + /** 6522 + * Random seed for reproducibility of the generation. 6523 + */ 6524 + seed?: number 6525 + /** 6526 + * Penalty for repeated tokens; higher values discourage repetition. 6527 + */ 6528 + repetition_penalty?: number 6529 + /** 6530 + * Decreases the likelihood of the model repeating the same lines verbatim. 6531 + */ 6532 + frequency_penalty?: number 6533 + /** 6534 + * Increases the likelihood of the model introducing new topics. 6535 + */ 6536 + presence_penalty?: number 6537 + } 6538 + type Ai_Cf_Google_Gemma_3_12B_It_Output = { 6539 + /** 6540 + * The generated text response from the model 6541 + */ 6542 + response: string 6543 + /** 6544 + * Usage statistics for the inference request 6545 + */ 6546 + usage?: { 6547 + /** 6548 + * Total number of tokens in input 6549 + */ 6550 + prompt_tokens?: number 6551 + /** 6552 + * Total number of tokens in output 6553 + */ 6554 + completion_tokens?: number 6555 + /** 6556 + * Total number of input and output tokens 6557 + */ 6558 + total_tokens?: number 6559 + } 6560 + /** 6561 + * An array of tool calls requests made during the response generation 6562 + */ 6563 + tool_calls?: { 6564 + /** 6565 + * The arguments passed to be passed to the tool call request 6566 + */ 6567 + arguments?: object 6568 + /** 6569 + * The name of the tool to be called 6570 + */ 6571 + name?: string 6572 + }[] 6573 + } 6574 + declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It { 6575 + inputs: Ai_Cf_Google_Gemma_3_12B_It_Input 6576 + postProcessedOutputs: Ai_Cf_Google_Gemma_3_12B_It_Output 6577 + } 6578 + type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input = 6579 + | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt 6580 + | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages 6581 + | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Async_Batch 6582 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt { 6583 + /** 6584 + * The input text prompt for the model to generate a response. 6585 + */ 6586 + prompt: string 6587 + /** 6588 + * JSON schema that should be fulfilled for the response. 6589 + */ 6590 + guided_json?: object 6591 + response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode 6592 + /** 6593 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6594 + */ 6595 + raw?: boolean 6596 + /** 6597 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6598 + */ 6599 + stream?: boolean 6600 + /** 6601 + * The maximum number of tokens to generate in the response. 6602 + */ 6603 + max_tokens?: number 6604 + /** 6605 + * Controls the randomness of the output; higher values produce more random results. 6606 + */ 6607 + temperature?: number 6608 + /** 6609 + * 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. 6610 + */ 6611 + top_p?: number 6612 + /** 6613 + * 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. 6614 + */ 6615 + top_k?: number 6616 + /** 6617 + * Random seed for reproducibility of the generation. 6618 + */ 6619 + seed?: number 6620 + /** 6621 + * Penalty for repeated tokens; higher values discourage repetition. 6622 + */ 6623 + repetition_penalty?: number 6624 + /** 6625 + * Decreases the likelihood of the model repeating the same lines verbatim. 6626 + */ 6627 + frequency_penalty?: number 6628 + /** 6629 + * Increases the likelihood of the model introducing new topics. 6630 + */ 6631 + presence_penalty?: number 6632 + } 6633 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode { 6634 + type?: 'json_object' | 'json_schema' 6635 + json_schema?: unknown 6636 + } 6637 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages { 6638 + /** 6639 + * An array of message objects representing the conversation history. 6640 + */ 6641 + messages: { 6642 + /** 6643 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 6644 + */ 6645 + role?: string 6646 + /** 6647 + * The tool call id. If you don't know what to put here you can fall back to 000000001 6648 + */ 6649 + tool_call_id?: string 6650 + content?: 6651 + | string 6652 + | { 6653 + /** 6654 + * Type of the content provided 6655 + */ 6656 + type?: string 6657 + text?: string 6658 + image_url?: { 6659 + /** 6660 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6661 + */ 6662 + url?: string 6663 + } 6664 + }[] 6665 + | { 6666 + /** 6667 + * Type of the content provided 6668 + */ 6669 + type?: string 6670 + text?: string 6671 + image_url?: { 6672 + /** 6673 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6674 + */ 6675 + url?: string 6676 + } 6677 + } 6678 + }[] 6679 + functions?: { 6680 + name: string 6681 + code: string 6682 + }[] 6683 + /** 6684 + * A list of tools available for the assistant to use. 6685 + */ 6686 + tools?: ( 6687 + | { 6688 + /** 6689 + * The name of the tool. More descriptive the better. 6690 + */ 6691 + name: string 6692 + /** 6693 + * A brief description of what the tool does. 6694 + */ 6695 + description: string 6696 + /** 6697 + * Schema defining the parameters accepted by the tool. 6698 + */ 6699 + parameters: { 6700 + /** 6701 + * The type of the parameters object (usually 'object'). 6702 + */ 6703 + type: string 6704 + /** 6705 + * List of required parameter names. 6706 + */ 6707 + required?: string[] 6708 + /** 6709 + * Definitions of each parameter. 6710 + */ 6711 + properties: { 6712 + [k: string]: { 6713 + /** 6714 + * The data type of the parameter. 6715 + */ 6716 + type: string 6717 + /** 6718 + * A description of the expected parameter. 6719 + */ 6720 + description: string 6721 + } 6722 + } 6723 + } 6724 + } 6725 + | { 6726 + /** 6727 + * Specifies the type of tool (e.g., 'function'). 6728 + */ 6729 + type: string 6730 + /** 6731 + * Details of the function tool. 6732 + */ 6733 + function: { 6734 + /** 6735 + * The name of the function. 6736 + */ 6737 + name: string 6738 + /** 6739 + * A brief description of what the function does. 6740 + */ 6741 + description: string 6742 + /** 6743 + * Schema defining the parameters accepted by the function. 6744 + */ 6745 + parameters: { 6746 + /** 6747 + * The type of the parameters object (usually 'object'). 6748 + */ 6749 + type: string 6750 + /** 6751 + * List of required parameter names. 6752 + */ 6753 + required?: string[] 6754 + /** 6755 + * Definitions of each parameter. 6756 + */ 6757 + properties: { 6758 + [k: string]: { 6759 + /** 6760 + * The data type of the parameter. 6761 + */ 6762 + type: string 6763 + /** 6764 + * A description of the expected parameter. 6765 + */ 6766 + description: string 6767 + } 6768 + } 6769 + } 6770 + } 6771 + } 6772 + )[] 6773 + response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode 6774 + /** 6775 + * JSON schema that should be fufilled for the response. 6776 + */ 6777 + guided_json?: object 6778 + /** 6779 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6780 + */ 6781 + raw?: boolean 6782 + /** 6783 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6784 + */ 6785 + stream?: boolean 6786 + /** 6787 + * The maximum number of tokens to generate in the response. 6788 + */ 6789 + max_tokens?: number 6790 + /** 6791 + * Controls the randomness of the output; higher values produce more random results. 6792 + */ 6793 + temperature?: number 6794 + /** 6795 + * 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. 6796 + */ 6797 + top_p?: number 6798 + /** 6799 + * 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. 6800 + */ 6801 + top_k?: number 6802 + /** 6803 + * Random seed for reproducibility of the generation. 6804 + */ 6805 + seed?: number 6806 + /** 6807 + * Penalty for repeated tokens; higher values discourage repetition. 6808 + */ 6809 + repetition_penalty?: number 6810 + /** 6811 + * Decreases the likelihood of the model repeating the same lines verbatim. 6812 + */ 6813 + frequency_penalty?: number 6814 + /** 6815 + * Increases the likelihood of the model introducing new topics. 6816 + */ 6817 + presence_penalty?: number 6818 + } 6819 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Async_Batch { 6820 + requests: ( 6821 + | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt_Inner 6822 + | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner 6823 + )[] 6824 + } 6825 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt_Inner { 6826 + /** 6827 + * The input text prompt for the model to generate a response. 6828 + */ 6829 + prompt: string 6830 + /** 6831 + * JSON schema that should be fulfilled for the response. 6832 + */ 6833 + guided_json?: object 6834 + response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode 6835 + /** 6836 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 6837 + */ 6838 + raw?: boolean 6839 + /** 6840 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 6841 + */ 6842 + stream?: boolean 6843 + /** 6844 + * The maximum number of tokens to generate in the response. 6845 + */ 6846 + max_tokens?: number 6847 + /** 6848 + * Controls the randomness of the output; higher values produce more random results. 6849 + */ 6850 + temperature?: number 6851 + /** 6852 + * 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. 6853 + */ 6854 + top_p?: number 6855 + /** 6856 + * 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. 6857 + */ 6858 + top_k?: number 6859 + /** 6860 + * Random seed for reproducibility of the generation. 6861 + */ 6862 + seed?: number 6863 + /** 6864 + * Penalty for repeated tokens; higher values discourage repetition. 6865 + */ 6866 + repetition_penalty?: number 6867 + /** 6868 + * Decreases the likelihood of the model repeating the same lines verbatim. 6869 + */ 6870 + frequency_penalty?: number 6871 + /** 6872 + * Increases the likelihood of the model introducing new topics. 6873 + */ 6874 + presence_penalty?: number 6875 + } 6876 + interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner { 6877 + /** 6878 + * An array of message objects representing the conversation history. 6879 + */ 6880 + messages: { 6881 + /** 6882 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 6883 + */ 6884 + role?: string 6885 + /** 6886 + * The tool call id. If you don't know what to put here you can fall back to 000000001 6887 + */ 6888 + tool_call_id?: string 6889 + content?: 6890 + | string 6891 + | { 6892 + /** 6893 + * Type of the content provided 6894 + */ 6895 + type?: string 6896 + text?: string 6897 + image_url?: { 6898 + /** 6899 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6900 + */ 6901 + url?: string 6902 + } 6903 + }[] 6904 + | { 6905 + /** 6906 + * Type of the content provided 6907 + */ 6908 + type?: string 6909 + text?: string 6910 + image_url?: { 6911 + /** 6912 + * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted 6913 + */ 6914 + url?: string 6915 + } 6916 + } 6917 + }[] 6918 + functions?: { 6919 + name: string 6920 + code: string 6921 + }[] 6922 + /** 6923 + * A list of tools available for the assistant to use. 6924 + */ 6925 + tools?: ( 6926 + | { 6927 + /** 6928 + * The name of the tool. More descriptive the better. 6929 + */ 6930 + name: string 6931 + /** 6932 + * A brief description of what the tool does. 6933 + */ 6934 + description: string 6935 + /** 6936 + * Schema defining the parameters accepted by the tool. 6937 + */ 6938 + parameters: { 6939 + /** 6940 + * The type of the parameters object (usually 'object'). 6941 + */ 6942 + type: string 6943 + /** 6944 + * List of required parameter names. 6945 + */ 6946 + required?: string[] 6947 + /** 6948 + * Definitions of each parameter. 6949 + */ 6950 + properties: { 6951 + [k: string]: { 6952 + /** 6953 + * The data type of the parameter. 6954 + */ 6955 + type: string 6956 + /** 6957 + * A description of the expected parameter. 6958 + */ 6959 + description: string 6960 + } 6961 + } 6962 + } 6963 + } 6964 + | { 6965 + /** 6966 + * Specifies the type of tool (e.g., 'function'). 6967 + */ 6968 + type: string 6969 + /** 6970 + * Details of the function tool. 6971 + */ 6972 + function: { 6973 + /** 6974 + * The name of the function. 6975 + */ 6976 + name: string 6977 + /** 6978 + * A brief description of what the function does. 6979 + */ 6980 + description: string 6981 + /** 6982 + * Schema defining the parameters accepted by the function. 6983 + */ 6984 + parameters: { 6985 + /** 6986 + * The type of the parameters object (usually 'object'). 6987 + */ 6988 + type: string 6989 + /** 6990 + * List of required parameter names. 6991 + */ 6992 + required?: string[] 6993 + /** 6994 + * Definitions of each parameter. 6995 + */ 6996 + properties: { 6997 + [k: string]: { 6998 + /** 6999 + * The data type of the parameter. 7000 + */ 7001 + type: string 7002 + /** 7003 + * A description of the expected parameter. 7004 + */ 7005 + description: string 7006 + } 7007 + } 7008 + } 7009 + } 7010 + } 7011 + )[] 7012 + response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode 7013 + /** 7014 + * JSON schema that should be fufilled for the response. 7015 + */ 7016 + guided_json?: object 7017 + /** 7018 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7019 + */ 7020 + raw?: boolean 7021 + /** 7022 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7023 + */ 7024 + stream?: boolean 7025 + /** 7026 + * The maximum number of tokens to generate in the response. 7027 + */ 7028 + max_tokens?: number 7029 + /** 7030 + * Controls the randomness of the output; higher values produce more random results. 7031 + */ 7032 + temperature?: number 7033 + /** 7034 + * 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. 7035 + */ 7036 + top_p?: number 7037 + /** 7038 + * 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. 7039 + */ 7040 + top_k?: number 7041 + /** 7042 + * Random seed for reproducibility of the generation. 7043 + */ 7044 + seed?: number 7045 + /** 7046 + * Penalty for repeated tokens; higher values discourage repetition. 7047 + */ 7048 + repetition_penalty?: number 7049 + /** 7050 + * Decreases the likelihood of the model repeating the same lines verbatim. 7051 + */ 7052 + frequency_penalty?: number 7053 + /** 7054 + * Increases the likelihood of the model introducing new topics. 7055 + */ 7056 + presence_penalty?: number 7057 + } 7058 + type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = { 7059 + /** 7060 + * The generated text response from the model 7061 + */ 7062 + response: string 7063 + /** 7064 + * Usage statistics for the inference request 7065 + */ 7066 + usage?: { 7067 + /** 7068 + * Total number of tokens in input 7069 + */ 7070 + prompt_tokens?: number 7071 + /** 7072 + * Total number of tokens in output 7073 + */ 7074 + completion_tokens?: number 7075 + /** 7076 + * Total number of input and output tokens 7077 + */ 7078 + total_tokens?: number 7079 + } 7080 + /** 7081 + * An array of tool calls requests made during the response generation 7082 + */ 7083 + tool_calls?: { 7084 + /** 7085 + * The tool call id. 7086 + */ 7087 + id?: string 7088 + /** 7089 + * Specifies the type of tool (e.g., 'function'). 7090 + */ 7091 + type?: string 7092 + /** 7093 + * Details of the function tool. 7094 + */ 7095 + function?: { 7096 + /** 7097 + * The name of the tool to be called 7098 + */ 7099 + name?: string 7100 + /** 7101 + * The arguments passed to be passed to the tool call request 7102 + */ 7103 + arguments?: object 7104 + } 7105 + }[] 7106 + } 7107 + declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct { 7108 + inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input 7109 + postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output 7110 + } 7111 + type Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Input = 7112 + | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt 7113 + | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages 7114 + | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Async_Batch 7115 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt { 7116 + /** 7117 + * The input text prompt for the model to generate a response. 7118 + */ 7119 + prompt: string 7120 + /** 7121 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 7122 + */ 7123 + lora?: string 7124 + response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode 7125 + /** 7126 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7127 + */ 7128 + raw?: boolean 7129 + /** 7130 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7131 + */ 7132 + stream?: boolean 7133 + /** 7134 + * The maximum number of tokens to generate in the response. 7135 + */ 7136 + max_tokens?: number 7137 + /** 7138 + * Controls the randomness of the output; higher values produce more random results. 7139 + */ 7140 + temperature?: number 7141 + /** 7142 + * 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. 7143 + */ 7144 + top_p?: number 7145 + /** 7146 + * 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. 7147 + */ 7148 + top_k?: number 7149 + /** 7150 + * Random seed for reproducibility of the generation. 7151 + */ 7152 + seed?: number 7153 + /** 7154 + * Penalty for repeated tokens; higher values discourage repetition. 7155 + */ 7156 + repetition_penalty?: number 7157 + /** 7158 + * Decreases the likelihood of the model repeating the same lines verbatim. 7159 + */ 7160 + frequency_penalty?: number 7161 + /** 7162 + * Increases the likelihood of the model introducing new topics. 7163 + */ 7164 + presence_penalty?: number 7165 + } 7166 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode { 7167 + type?: 'json_object' | 'json_schema' 7168 + json_schema?: unknown 7169 + } 7170 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages { 7171 + /** 7172 + * An array of message objects representing the conversation history. 7173 + */ 7174 + messages: { 7175 + /** 7176 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 7177 + */ 7178 + role: string 7179 + /** 7180 + * The content of the message as a string. 7181 + */ 7182 + content: string 7183 + }[] 7184 + functions?: { 7185 + name: string 7186 + code: string 7187 + }[] 7188 + /** 7189 + * A list of tools available for the assistant to use. 7190 + */ 7191 + tools?: ( 7192 + | { 7193 + /** 7194 + * The name of the tool. More descriptive the better. 7195 + */ 7196 + name: string 7197 + /** 7198 + * A brief description of what the tool does. 7199 + */ 7200 + description: string 7201 + /** 7202 + * Schema defining the parameters accepted by the tool. 7203 + */ 7204 + parameters: { 7205 + /** 7206 + * The type of the parameters object (usually 'object'). 7207 + */ 7208 + type: string 7209 + /** 7210 + * List of required parameter names. 7211 + */ 7212 + required?: string[] 7213 + /** 7214 + * Definitions of each parameter. 7215 + */ 7216 + properties: { 7217 + [k: string]: { 7218 + /** 7219 + * The data type of the parameter. 7220 + */ 7221 + type: string 7222 + /** 7223 + * A description of the expected parameter. 7224 + */ 7225 + description: string 7226 + } 7227 + } 7228 + } 7229 + } 7230 + | { 7231 + /** 7232 + * Specifies the type of tool (e.g., 'function'). 7233 + */ 7234 + type: string 7235 + /** 7236 + * Details of the function tool. 7237 + */ 7238 + function: { 7239 + /** 7240 + * The name of the function. 7241 + */ 7242 + name: string 7243 + /** 7244 + * A brief description of what the function does. 7245 + */ 7246 + description: string 7247 + /** 7248 + * Schema defining the parameters accepted by the function. 7249 + */ 7250 + parameters: { 7251 + /** 7252 + * The type of the parameters object (usually 'object'). 7253 + */ 7254 + type: string 7255 + /** 7256 + * List of required parameter names. 7257 + */ 7258 + required?: string[] 7259 + /** 7260 + * Definitions of each parameter. 7261 + */ 7262 + properties: { 7263 + [k: string]: { 7264 + /** 7265 + * The data type of the parameter. 7266 + */ 7267 + type: string 7268 + /** 7269 + * A description of the expected parameter. 7270 + */ 7271 + description: string 7272 + } 7273 + } 7274 + } 7275 + } 7276 + } 7277 + )[] 7278 + response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_1 7279 + /** 7280 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7281 + */ 7282 + raw?: boolean 7283 + /** 7284 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7285 + */ 7286 + stream?: boolean 7287 + /** 7288 + * The maximum number of tokens to generate in the response. 7289 + */ 7290 + max_tokens?: number 7291 + /** 7292 + * Controls the randomness of the output; higher values produce more random results. 7293 + */ 7294 + temperature?: number 7295 + /** 7296 + * 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. 7297 + */ 7298 + top_p?: number 7299 + /** 7300 + * 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. 7301 + */ 7302 + top_k?: number 7303 + /** 7304 + * Random seed for reproducibility of the generation. 7305 + */ 7306 + seed?: number 7307 + /** 7308 + * Penalty for repeated tokens; higher values discourage repetition. 7309 + */ 7310 + repetition_penalty?: number 7311 + /** 7312 + * Decreases the likelihood of the model repeating the same lines verbatim. 7313 + */ 7314 + frequency_penalty?: number 7315 + /** 7316 + * Increases the likelihood of the model introducing new topics. 7317 + */ 7318 + presence_penalty?: number 7319 + } 7320 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_1 { 7321 + type?: 'json_object' | 'json_schema' 7322 + json_schema?: unknown 7323 + } 7324 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Async_Batch { 7325 + requests: (Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt_1 | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1)[] 7326 + } 7327 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt_1 { 7328 + /** 7329 + * The input text prompt for the model to generate a response. 7330 + */ 7331 + prompt: string 7332 + /** 7333 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 7334 + */ 7335 + lora?: string 7336 + response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_2 7337 + /** 7338 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7339 + */ 7340 + raw?: boolean 7341 + /** 7342 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7343 + */ 7344 + stream?: boolean 7345 + /** 7346 + * The maximum number of tokens to generate in the response. 7347 + */ 7348 + max_tokens?: number 7349 + /** 7350 + * Controls the randomness of the output; higher values produce more random results. 7351 + */ 7352 + temperature?: number 7353 + /** 7354 + * 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. 7355 + */ 7356 + top_p?: number 7357 + /** 7358 + * 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. 7359 + */ 7360 + top_k?: number 7361 + /** 7362 + * Random seed for reproducibility of the generation. 7363 + */ 7364 + seed?: number 7365 + /** 7366 + * Penalty for repeated tokens; higher values discourage repetition. 7367 + */ 7368 + repetition_penalty?: number 7369 + /** 7370 + * Decreases the likelihood of the model repeating the same lines verbatim. 7371 + */ 7372 + frequency_penalty?: number 7373 + /** 7374 + * Increases the likelihood of the model introducing new topics. 7375 + */ 7376 + presence_penalty?: number 7377 + } 7378 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_2 { 7379 + type?: 'json_object' | 'json_schema' 7380 + json_schema?: unknown 7381 + } 7382 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1 { 7383 + /** 7384 + * An array of message objects representing the conversation history. 7385 + */ 7386 + messages: { 7387 + /** 7388 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 7389 + */ 7390 + role: string 7391 + /** 7392 + * The content of the message as a string. 7393 + */ 7394 + content: string 7395 + }[] 7396 + functions?: { 7397 + name: string 7398 + code: string 7399 + }[] 7400 + /** 7401 + * A list of tools available for the assistant to use. 7402 + */ 7403 + tools?: ( 7404 + | { 7405 + /** 7406 + * The name of the tool. More descriptive the better. 7407 + */ 7408 + name: string 7409 + /** 7410 + * A brief description of what the tool does. 7411 + */ 7412 + description: string 7413 + /** 7414 + * Schema defining the parameters accepted by the tool. 7415 + */ 7416 + parameters: { 7417 + /** 7418 + * The type of the parameters object (usually 'object'). 7419 + */ 7420 + type: string 7421 + /** 7422 + * List of required parameter names. 7423 + */ 7424 + required?: string[] 7425 + /** 7426 + * Definitions of each parameter. 7427 + */ 7428 + properties: { 7429 + [k: string]: { 7430 + /** 7431 + * The data type of the parameter. 7432 + */ 7433 + type: string 7434 + /** 7435 + * A description of the expected parameter. 7436 + */ 7437 + description: string 7438 + } 7439 + } 7440 + } 7441 + } 7442 + | { 7443 + /** 7444 + * Specifies the type of tool (e.g., 'function'). 7445 + */ 7446 + type: string 7447 + /** 7448 + * Details of the function tool. 7449 + */ 7450 + function: { 7451 + /** 7452 + * The name of the function. 7453 + */ 7454 + name: string 7455 + /** 7456 + * A brief description of what the function does. 7457 + */ 7458 + description: string 7459 + /** 7460 + * Schema defining the parameters accepted by the function. 7461 + */ 7462 + parameters: { 7463 + /** 7464 + * The type of the parameters object (usually 'object'). 7465 + */ 7466 + type: string 7467 + /** 7468 + * List of required parameter names. 7469 + */ 7470 + required?: string[] 7471 + /** 7472 + * Definitions of each parameter. 7473 + */ 7474 + properties: { 7475 + [k: string]: { 7476 + /** 7477 + * The data type of the parameter. 7478 + */ 7479 + type: string 7480 + /** 7481 + * A description of the expected parameter. 7482 + */ 7483 + description: string 7484 + } 7485 + } 7486 + } 7487 + } 7488 + } 7489 + )[] 7490 + response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_3 7491 + /** 7492 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 7493 + */ 7494 + raw?: boolean 7495 + /** 7496 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 7497 + */ 7498 + stream?: boolean 7499 + /** 7500 + * The maximum number of tokens to generate in the response. 7501 + */ 7502 + max_tokens?: number 7503 + /** 7504 + * Controls the randomness of the output; higher values produce more random results. 7505 + */ 7506 + temperature?: number 7507 + /** 7508 + * 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. 7509 + */ 7510 + top_p?: number 7511 + /** 7512 + * 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. 7513 + */ 7514 + top_k?: number 7515 + /** 7516 + * Random seed for reproducibility of the generation. 7517 + */ 7518 + seed?: number 7519 + /** 7520 + * Penalty for repeated tokens; higher values discourage repetition. 7521 + */ 7522 + repetition_penalty?: number 7523 + /** 7524 + * Decreases the likelihood of the model repeating the same lines verbatim. 7525 + */ 7526 + frequency_penalty?: number 7527 + /** 7528 + * Increases the likelihood of the model introducing new topics. 7529 + */ 7530 + presence_penalty?: number 7531 + } 7532 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_3 { 7533 + type?: 'json_object' | 'json_schema' 7534 + json_schema?: unknown 7535 + } 7536 + type Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Output = 7537 + | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Chat_Completion_Response 7538 + | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Text_Completion_Response 7539 + | string 7540 + | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_AsyncResponse 7541 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Chat_Completion_Response { 7542 + /** 7543 + * Unique identifier for the completion 7544 + */ 7545 + id?: string 7546 + /** 7547 + * Object type identifier 7548 + */ 7549 + object?: 'chat.completion' 7550 + /** 7551 + * Unix timestamp of when the completion was created 7552 + */ 7553 + created?: number 7554 + /** 7555 + * Model used for the completion 7556 + */ 7557 + model?: string 7558 + /** 7559 + * List of completion choices 7560 + */ 7561 + choices?: { 7562 + /** 7563 + * Index of the choice in the list 7564 + */ 7565 + index?: number 7566 + /** 7567 + * The message generated by the model 7568 + */ 7569 + message?: { 7570 + /** 7571 + * Role of the message author 7572 + */ 7573 + role: string 7574 + /** 7575 + * The content of the message 7576 + */ 7577 + content: string 7578 + /** 7579 + * Internal reasoning content (if available) 7580 + */ 7581 + reasoning_content?: string 7582 + /** 7583 + * Tool calls made by the assistant 7584 + */ 7585 + tool_calls?: { 7586 + /** 7587 + * Unique identifier for the tool call 7588 + */ 7589 + id: string 7590 + /** 7591 + * Type of tool call 7592 + */ 7593 + type: 'function' 7594 + function: { 7595 + /** 7596 + * Name of the function to call 7597 + */ 7598 + name: string 7599 + /** 7600 + * JSON string of arguments for the function 7601 + */ 7602 + arguments: string 7603 + } 7604 + }[] 7605 + } 7606 + /** 7607 + * Reason why the model stopped generating 7608 + */ 7609 + finish_reason?: string 7610 + /** 7611 + * Stop reason (may be null) 7612 + */ 7613 + stop_reason?: string | null 7614 + /** 7615 + * Log probabilities (if requested) 7616 + */ 7617 + logprobs?: {} | null 7618 + }[] 7619 + /** 7620 + * Usage statistics for the inference request 7621 + */ 7622 + usage?: { 7623 + /** 7624 + * Total number of tokens in input 7625 + */ 7626 + prompt_tokens?: number 7627 + /** 7628 + * Total number of tokens in output 7629 + */ 7630 + completion_tokens?: number 7631 + /** 7632 + * Total number of input and output tokens 7633 + */ 7634 + total_tokens?: number 7635 + } 7636 + /** 7637 + * Log probabilities for the prompt (if requested) 7638 + */ 7639 + prompt_logprobs?: {} | null 7640 + } 7641 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Text_Completion_Response { 7642 + /** 7643 + * Unique identifier for the completion 7644 + */ 7645 + id?: string 7646 + /** 7647 + * Object type identifier 7648 + */ 7649 + object?: 'text_completion' 7650 + /** 7651 + * Unix timestamp of when the completion was created 7652 + */ 7653 + created?: number 7654 + /** 7655 + * Model used for the completion 7656 + */ 7657 + model?: string 7658 + /** 7659 + * List of completion choices 7660 + */ 7661 + choices?: { 7662 + /** 7663 + * Index of the choice in the list 7664 + */ 7665 + index: number 7666 + /** 7667 + * The generated text completion 7668 + */ 7669 + text: string 7670 + /** 7671 + * Reason why the model stopped generating 7672 + */ 7673 + finish_reason: string 7674 + /** 7675 + * Stop reason (may be null) 7676 + */ 7677 + stop_reason?: string | null 7678 + /** 7679 + * Log probabilities (if requested) 7680 + */ 7681 + logprobs?: {} | null 7682 + /** 7683 + * Log probabilities for the prompt (if requested) 7684 + */ 7685 + prompt_logprobs?: {} | null 7686 + }[] 7687 + /** 7688 + * Usage statistics for the inference request 7689 + */ 7690 + usage?: { 7691 + /** 7692 + * Total number of tokens in input 7693 + */ 7694 + prompt_tokens?: number 7695 + /** 7696 + * Total number of tokens in output 7697 + */ 7698 + completion_tokens?: number 7699 + /** 7700 + * Total number of input and output tokens 7701 + */ 7702 + total_tokens?: number 7703 + } 7704 + } 7705 + interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_AsyncResponse { 7706 + /** 7707 + * The async request id that can be used to obtain the results. 7708 + */ 7709 + request_id?: string 7710 + } 7711 + declare abstract class Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8 { 7712 + inputs: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Input 7713 + postProcessedOutputs: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Output 7714 + } 7715 + interface Ai_Cf_Deepgram_Nova_3_Input { 7716 + audio: { 7717 + body: object 7718 + contentType: string 7719 + } 7720 + /** 7721 + * 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. 7722 + */ 7723 + custom_topic_mode?: 'extended' | 'strict' 7724 + /** 7725 + * Custom topics you want the model to detect within your input audio or text if present Submit up to 100 7726 + */ 7727 + custom_topic?: string 7728 + /** 7729 + * 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 7730 + */ 7731 + custom_intent_mode?: 'extended' | 'strict' 7732 + /** 7733 + * Custom intents you want the model to detect within your input audio if present 7734 + */ 7735 + custom_intent?: string 7736 + /** 7737 + * Identifies and extracts key entities from content in submitted audio 7738 + */ 7739 + detect_entities?: boolean 7740 + /** 7741 + * Identifies the dominant language spoken in submitted audio 7742 + */ 7743 + detect_language?: boolean 7744 + /** 7745 + * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0 7746 + */ 7747 + diarize?: boolean 7748 + /** 7749 + * Identify and extract key entities from content in submitted audio 7750 + */ 7751 + dictation?: boolean 7752 + /** 7753 + * Specify the expected encoding of your submitted audio 7754 + */ 7755 + encoding?: 'linear16' | 'flac' | 'mulaw' | 'amr-nb' | 'amr-wb' | 'opus' | 'speex' | 'g729' 7756 + /** 7757 + * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing 7758 + */ 7759 + extra?: string 7760 + /** 7761 + * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um' 7762 + */ 7763 + filler_words?: boolean 7764 + /** 7765 + * Key term prompting can boost or suppress specialized terminology and brands. 7766 + */ 7767 + keyterm?: string 7768 + /** 7769 + * Keywords can boost or suppress specialized terminology and brands. 7770 + */ 7771 + keywords?: string 7772 + /** 7773 + * 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. 7774 + */ 7775 + language?: string 7776 + /** 7777 + * Spoken measurements will be converted to their corresponding abbreviations. 7778 + */ 7779 + measurements?: boolean 7780 + /** 7781 + * 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. 7782 + */ 7783 + mip_opt_out?: boolean 7784 + /** 7785 + * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio 7786 + */ 7787 + mode?: 'general' | 'medical' | 'finance' 7788 + /** 7789 + * Transcribe each audio channel independently. 7790 + */ 7791 + multichannel?: boolean 7792 + /** 7793 + * Numerals converts numbers from written format to numerical format. 7794 + */ 7795 + numerals?: boolean 7796 + /** 7797 + * Splits audio into paragraphs to improve transcript readability. 7798 + */ 7799 + paragraphs?: boolean 7800 + /** 7801 + * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely. 7802 + */ 7803 + profanity_filter?: boolean 7804 + /** 7805 + * Add punctuation and capitalization to the transcript. 7806 + */ 7807 + punctuate?: boolean 7808 + /** 7809 + * Redaction removes sensitive information from your transcripts. 7810 + */ 7811 + redact?: string 7812 + /** 7813 + * Search for terms or phrases in submitted audio and replaces them. 7814 + */ 7815 + replace?: string 7816 + /** 7817 + * Search for terms or phrases in submitted audio. 7818 + */ 7819 + search?: string 7820 + /** 7821 + * Recognizes the sentiment throughout a transcript or text. 7822 + */ 7823 + sentiment?: boolean 7824 + /** 7825 + * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability. 7826 + */ 7827 + smart_format?: boolean 7828 + /** 7829 + * Detect topics throughout a transcript or text. 7830 + */ 7831 + topics?: boolean 7832 + /** 7833 + * Segments speech into meaningful semantic units. 7834 + */ 7835 + utterances?: boolean 7836 + /** 7837 + * Seconds to wait before detecting a pause between words in submitted audio. 7838 + */ 7839 + utt_split?: number 7840 + /** 7841 + * The number of channels in the submitted audio 7842 + */ 7843 + channels?: number 7844 + /** 7845 + * 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. 7846 + */ 7847 + interim_results?: boolean 7848 + /** 7849 + * 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 7850 + */ 7851 + endpointing?: string 7852 + /** 7853 + * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets. 7854 + */ 7855 + vad_events?: boolean 7856 + /** 7857 + * 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. 7858 + */ 7859 + utterance_end_ms?: boolean 7860 + } 7861 + interface Ai_Cf_Deepgram_Nova_3_Output { 7862 + results?: { 7863 + channels?: { 7864 + alternatives?: { 7865 + confidence?: number 7866 + transcript?: string 7867 + words?: { 7868 + confidence?: number 7869 + end?: number 7870 + start?: number 7871 + word?: string 7872 + }[] 7873 + }[] 7874 + }[] 7875 + summary?: { 7876 + result?: string 7877 + short?: string 7878 + } 7879 + sentiments?: { 7880 + segments?: { 7881 + text?: string 7882 + start_word?: number 7883 + end_word?: number 7884 + sentiment?: string 7885 + sentiment_score?: number 7886 + }[] 7887 + average?: { 7888 + sentiment?: string 7889 + sentiment_score?: number 7890 + } 7891 + } 7892 + } 7893 + } 7894 + declare abstract class Base_Ai_Cf_Deepgram_Nova_3 { 7895 + inputs: Ai_Cf_Deepgram_Nova_3_Input 7896 + postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output 7897 + } 7898 + interface Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input { 7899 + queries?: string | string[] 7900 + /** 7901 + * Optional instruction for the task 7902 + */ 7903 + instruction?: string 7904 + documents?: string | string[] 7905 + text?: string | string[] 7906 + } 7907 + interface Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Output { 7908 + data?: number[][] 7909 + shape?: number[] 7910 + } 7911 + declare abstract class Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B { 7912 + inputs: Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input 7913 + postProcessedOutputs: Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Output 7914 + } 7915 + type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input = 7916 + | { 7917 + /** 7918 + * readable stream with audio data and content-type specified for that data 7919 + */ 7920 + audio: { 7921 + body: object 7922 + contentType: string 7923 + } 7924 + /** 7925 + * type of data PCM data that's sent to the inference server as raw array 7926 + */ 7927 + dtype?: 'uint8' | 'float32' | 'float64' 7928 + } 7929 + | { 7930 + /** 7931 + * base64 encoded audio data 7932 + */ 7933 + audio: string 7934 + /** 7935 + * type of data PCM data that's sent to the inference server as raw array 7936 + */ 7937 + dtype?: 'uint8' | 'float32' | 'float64' 7938 + } 7939 + interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output { 7940 + /** 7941 + * if true, end-of-turn was detected 7942 + */ 7943 + is_complete?: boolean 7944 + /** 7945 + * probability of the end-of-turn detection 7946 + */ 7947 + probability?: number 7948 + } 7949 + declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 { 7950 + inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input 7951 + postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output 7952 + } 7953 + declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B { 7954 + inputs: ResponsesInput 7955 + postProcessedOutputs: ResponsesOutput 7956 + } 7957 + declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B { 7958 + inputs: ResponsesInput 7959 + postProcessedOutputs: ResponsesOutput 7960 + } 7961 + interface Ai_Cf_Leonardo_Phoenix_1_0_Input { 7962 + /** 7963 + * A text description of the image you want to generate. 7964 + */ 7965 + prompt: string 7966 + /** 7967 + * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt 7968 + */ 7969 + guidance?: number 7970 + /** 7971 + * Random seed for reproducibility of the image generation 7972 + */ 7973 + seed?: number 7974 + /** 7975 + * The height of the generated image in pixels 7976 + */ 7977 + height?: number 7978 + /** 7979 + * The width of the generated image in pixels 7980 + */ 7981 + width?: number 7982 + /** 7983 + * The number of diffusion steps; higher values can improve quality but take longer 7984 + */ 7985 + num_steps?: number 7986 + /** 7987 + * Specify what to exclude from the generated images 7988 + */ 7989 + negative_prompt?: string 7990 + } 7991 + /** 7992 + * The generated image in JPEG format 7993 + */ 7994 + type Ai_Cf_Leonardo_Phoenix_1_0_Output = string 7995 + declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 { 7996 + inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input 7997 + postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output 7998 + } 7999 + interface Ai_Cf_Leonardo_Lucid_Origin_Input { 8000 + /** 8001 + * A text description of the image you want to generate. 8002 + */ 8003 + prompt: string 8004 + /** 8005 + * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt 8006 + */ 8007 + guidance?: number 8008 + /** 8009 + * Random seed for reproducibility of the image generation 8010 + */ 8011 + seed?: number 8012 + /** 8013 + * The height of the generated image in pixels 8014 + */ 8015 + height?: number 8016 + /** 8017 + * The width of the generated image in pixels 8018 + */ 8019 + width?: number 8020 + /** 8021 + * The number of diffusion steps; higher values can improve quality but take longer 8022 + */ 8023 + num_steps?: number 8024 + /** 8025 + * The number of diffusion steps; higher values can improve quality but take longer 8026 + */ 8027 + steps?: number 8028 + } 8029 + interface Ai_Cf_Leonardo_Lucid_Origin_Output { 8030 + /** 8031 + * The generated image in Base64 format. 8032 + */ 8033 + image?: string 8034 + } 8035 + declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin { 8036 + inputs: Ai_Cf_Leonardo_Lucid_Origin_Input 8037 + postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output 8038 + } 8039 + interface Ai_Cf_Deepgram_Aura_1_Input { 8040 + /** 8041 + * Speaker used to produce the audio. 8042 + */ 8043 + speaker?: 8044 + | 'angus' 8045 + | 'asteria' 8046 + | 'arcas' 8047 + | 'orion' 8048 + | 'orpheus' 8049 + | 'athena' 8050 + | 'luna' 8051 + | 'zeus' 8052 + | 'perseus' 8053 + | 'helios' 8054 + | 'hera' 8055 + | 'stella' 8056 + /** 8057 + * Encoding of the output audio. 8058 + */ 8059 + encoding?: 'linear16' | 'flac' | 'mulaw' | 'alaw' | 'mp3' | 'opus' | 'aac' 8060 + /** 8061 + * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type.. 8062 + */ 8063 + container?: 'none' | 'wav' | 'ogg' 8064 + /** 8065 + * The text content to be converted to speech 8066 + */ 8067 + text: string 8068 + /** 8069 + * 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 8070 + */ 8071 + sample_rate?: number 8072 + /** 8073 + * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type. 8074 + */ 8075 + bit_rate?: number 8076 + } 8077 + /** 8078 + * The generated audio in MP3 format 8079 + */ 8080 + type Ai_Cf_Deepgram_Aura_1_Output = string 8081 + declare abstract class Base_Ai_Cf_Deepgram_Aura_1 { 8082 + inputs: Ai_Cf_Deepgram_Aura_1_Input 8083 + postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output 8084 + } 8085 + interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input { 8086 + /** 8087 + * Input text to translate. Can be a single string or a list of strings. 8088 + */ 8089 + text: string | string[] 8090 + /** 8091 + * Target langauge to translate to 8092 + */ 8093 + target_language: 8094 + | 'asm_Beng' 8095 + | 'awa_Deva' 8096 + | 'ben_Beng' 8097 + | 'bho_Deva' 8098 + | 'brx_Deva' 8099 + | 'doi_Deva' 8100 + | 'eng_Latn' 8101 + | 'gom_Deva' 8102 + | 'gon_Deva' 8103 + | 'guj_Gujr' 8104 + | 'hin_Deva' 8105 + | 'hne_Deva' 8106 + | 'kan_Knda' 8107 + | 'kas_Arab' 8108 + | 'kas_Deva' 8109 + | 'kha_Latn' 8110 + | 'lus_Latn' 8111 + | 'mag_Deva' 8112 + | 'mai_Deva' 8113 + | 'mal_Mlym' 8114 + | 'mar_Deva' 8115 + | 'mni_Beng' 8116 + | 'mni_Mtei' 8117 + | 'npi_Deva' 8118 + | 'ory_Orya' 8119 + | 'pan_Guru' 8120 + | 'san_Deva' 8121 + | 'sat_Olck' 8122 + | 'snd_Arab' 8123 + | 'snd_Deva' 8124 + | 'tam_Taml' 8125 + | 'tel_Telu' 8126 + | 'urd_Arab' 8127 + | 'unr_Deva' 8128 + } 8129 + interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Output { 8130 + /** 8131 + * Translated texts 8132 + */ 8133 + translations: string[] 8134 + } 8135 + declare abstract class Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B { 8136 + inputs: Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input 8137 + postProcessedOutputs: Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Output 8138 + } 8139 + type Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Input = 8140 + | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt 8141 + | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages 8142 + | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Async_Batch 8143 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt { 8144 + /** 8145 + * The input text prompt for the model to generate a response. 8146 + */ 8147 + prompt: string 8148 + /** 8149 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 8150 + */ 8151 + lora?: string 8152 + response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode 8153 + /** 8154 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 8155 + */ 8156 + raw?: boolean 8157 + /** 8158 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 8159 + */ 8160 + stream?: boolean 8161 + /** 8162 + * The maximum number of tokens to generate in the response. 8163 + */ 8164 + max_tokens?: number 8165 + /** 8166 + * Controls the randomness of the output; higher values produce more random results. 8167 + */ 8168 + temperature?: number 8169 + /** 8170 + * 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. 8171 + */ 8172 + top_p?: number 8173 + /** 8174 + * 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. 8175 + */ 8176 + top_k?: number 8177 + /** 8178 + * Random seed for reproducibility of the generation. 8179 + */ 8180 + seed?: number 8181 + /** 8182 + * Penalty for repeated tokens; higher values discourage repetition. 8183 + */ 8184 + repetition_penalty?: number 8185 + /** 8186 + * Decreases the likelihood of the model repeating the same lines verbatim. 8187 + */ 8188 + frequency_penalty?: number 8189 + /** 8190 + * Increases the likelihood of the model introducing new topics. 8191 + */ 8192 + presence_penalty?: number 8193 + } 8194 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode { 8195 + type?: 'json_object' | 'json_schema' 8196 + json_schema?: unknown 8197 + } 8198 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages { 8199 + /** 8200 + * An array of message objects representing the conversation history. 8201 + */ 8202 + messages: { 8203 + /** 8204 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 8205 + */ 8206 + role: string 8207 + /** 8208 + * The content of the message as a string. 8209 + */ 8210 + content: string 8211 + }[] 8212 + functions?: { 8213 + name: string 8214 + code: string 8215 + }[] 8216 + /** 8217 + * A list of tools available for the assistant to use. 8218 + */ 8219 + tools?: ( 8220 + | { 8221 + /** 8222 + * The name of the tool. More descriptive the better. 8223 + */ 8224 + name: string 8225 + /** 8226 + * A brief description of what the tool does. 8227 + */ 8228 + description: string 8229 + /** 8230 + * Schema defining the parameters accepted by the tool. 8231 + */ 8232 + parameters: { 8233 + /** 8234 + * The type of the parameters object (usually 'object'). 8235 + */ 8236 + type: string 8237 + /** 8238 + * List of required parameter names. 8239 + */ 8240 + required?: string[] 8241 + /** 8242 + * Definitions of each parameter. 8243 + */ 8244 + properties: { 8245 + [k: string]: { 8246 + /** 8247 + * The data type of the parameter. 8248 + */ 8249 + type: string 8250 + /** 8251 + * A description of the expected parameter. 8252 + */ 8253 + description: string 8254 + } 8255 + } 8256 + } 8257 + } 8258 + | { 8259 + /** 8260 + * Specifies the type of tool (e.g., 'function'). 8261 + */ 8262 + type: string 8263 + /** 8264 + * Details of the function tool. 8265 + */ 8266 + function: { 8267 + /** 8268 + * The name of the function. 8269 + */ 8270 + name: string 8271 + /** 8272 + * A brief description of what the function does. 8273 + */ 8274 + description: string 8275 + /** 8276 + * Schema defining the parameters accepted by the function. 8277 + */ 8278 + parameters: { 8279 + /** 8280 + * The type of the parameters object (usually 'object'). 8281 + */ 8282 + type: string 8283 + /** 8284 + * List of required parameter names. 8285 + */ 8286 + required?: string[] 8287 + /** 8288 + * Definitions of each parameter. 8289 + */ 8290 + properties: { 8291 + [k: string]: { 8292 + /** 8293 + * The data type of the parameter. 8294 + */ 8295 + type: string 8296 + /** 8297 + * A description of the expected parameter. 8298 + */ 8299 + description: string 8300 + } 8301 + } 8302 + } 8303 + } 8304 + } 8305 + )[] 8306 + response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_1 8307 + /** 8308 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 8309 + */ 8310 + raw?: boolean 8311 + /** 8312 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 8313 + */ 8314 + stream?: boolean 8315 + /** 8316 + * The maximum number of tokens to generate in the response. 8317 + */ 8318 + max_tokens?: number 8319 + /** 8320 + * Controls the randomness of the output; higher values produce more random results. 8321 + */ 8322 + temperature?: number 8323 + /** 8324 + * 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. 8325 + */ 8326 + top_p?: number 8327 + /** 8328 + * 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. 8329 + */ 8330 + top_k?: number 8331 + /** 8332 + * Random seed for reproducibility of the generation. 8333 + */ 8334 + seed?: number 8335 + /** 8336 + * Penalty for repeated tokens; higher values discourage repetition. 8337 + */ 8338 + repetition_penalty?: number 8339 + /** 8340 + * Decreases the likelihood of the model repeating the same lines verbatim. 8341 + */ 8342 + frequency_penalty?: number 8343 + /** 8344 + * Increases the likelihood of the model introducing new topics. 8345 + */ 8346 + presence_penalty?: number 8347 + } 8348 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_1 { 8349 + type?: 'json_object' | 'json_schema' 8350 + json_schema?: unknown 8351 + } 8352 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Async_Batch { 8353 + requests: ( 8354 + | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt_1 8355 + | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1 8356 + )[] 8357 + } 8358 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt_1 { 8359 + /** 8360 + * The input text prompt for the model to generate a response. 8361 + */ 8362 + prompt: string 8363 + /** 8364 + * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. 8365 + */ 8366 + lora?: string 8367 + response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_2 8368 + /** 8369 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 8370 + */ 8371 + raw?: boolean 8372 + /** 8373 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 8374 + */ 8375 + stream?: boolean 8376 + /** 8377 + * The maximum number of tokens to generate in the response. 8378 + */ 8379 + max_tokens?: number 8380 + /** 8381 + * Controls the randomness of the output; higher values produce more random results. 8382 + */ 8383 + temperature?: number 8384 + /** 8385 + * 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. 8386 + */ 8387 + top_p?: number 8388 + /** 8389 + * 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. 8390 + */ 8391 + top_k?: number 8392 + /** 8393 + * Random seed for reproducibility of the generation. 8394 + */ 8395 + seed?: number 8396 + /** 8397 + * Penalty for repeated tokens; higher values discourage repetition. 8398 + */ 8399 + repetition_penalty?: number 8400 + /** 8401 + * Decreases the likelihood of the model repeating the same lines verbatim. 8402 + */ 8403 + frequency_penalty?: number 8404 + /** 8405 + * Increases the likelihood of the model introducing new topics. 8406 + */ 8407 + presence_penalty?: number 8408 + } 8409 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_2 { 8410 + type?: 'json_object' | 'json_schema' 8411 + json_schema?: unknown 8412 + } 8413 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1 { 8414 + /** 8415 + * An array of message objects representing the conversation history. 8416 + */ 8417 + messages: { 8418 + /** 8419 + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). 8420 + */ 8421 + role: string 8422 + /** 8423 + * The content of the message as a string. 8424 + */ 8425 + content: string 8426 + }[] 8427 + functions?: { 8428 + name: string 8429 + code: string 8430 + }[] 8431 + /** 8432 + * A list of tools available for the assistant to use. 8433 + */ 8434 + tools?: ( 8435 + | { 8436 + /** 8437 + * The name of the tool. More descriptive the better. 8438 + */ 8439 + name: string 8440 + /** 8441 + * A brief description of what the tool does. 8442 + */ 8443 + description: string 8444 + /** 8445 + * Schema defining the parameters accepted by the tool. 8446 + */ 8447 + parameters: { 8448 + /** 8449 + * The type of the parameters object (usually 'object'). 8450 + */ 8451 + type: string 8452 + /** 8453 + * List of required parameter names. 8454 + */ 8455 + required?: string[] 8456 + /** 8457 + * Definitions of each parameter. 8458 + */ 8459 + properties: { 8460 + [k: string]: { 8461 + /** 8462 + * The data type of the parameter. 8463 + */ 8464 + type: string 8465 + /** 8466 + * A description of the expected parameter. 8467 + */ 8468 + description: string 8469 + } 8470 + } 8471 + } 8472 + } 8473 + | { 8474 + /** 8475 + * Specifies the type of tool (e.g., 'function'). 8476 + */ 8477 + type: string 8478 + /** 8479 + * Details of the function tool. 8480 + */ 8481 + function: { 8482 + /** 8483 + * The name of the function. 8484 + */ 8485 + name: string 8486 + /** 8487 + * A brief description of what the function does. 8488 + */ 8489 + description: string 8490 + /** 8491 + * Schema defining the parameters accepted by the function. 8492 + */ 8493 + parameters: { 8494 + /** 8495 + * The type of the parameters object (usually 'object'). 8496 + */ 8497 + type: string 8498 + /** 8499 + * List of required parameter names. 8500 + */ 8501 + required?: string[] 8502 + /** 8503 + * Definitions of each parameter. 8504 + */ 8505 + properties: { 8506 + [k: string]: { 8507 + /** 8508 + * The data type of the parameter. 8509 + */ 8510 + type: string 8511 + /** 8512 + * A description of the expected parameter. 8513 + */ 8514 + description: string 8515 + } 8516 + } 8517 + } 8518 + } 8519 + } 8520 + )[] 8521 + response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_3 8522 + /** 8523 + * If true, a chat template is not applied and you must adhere to the specific model's expected formatting. 8524 + */ 8525 + raw?: boolean 8526 + /** 8527 + * If true, the response will be streamed back incrementally using SSE, Server Sent Events. 8528 + */ 8529 + stream?: boolean 8530 + /** 8531 + * The maximum number of tokens to generate in the response. 8532 + */ 8533 + max_tokens?: number 8534 + /** 8535 + * Controls the randomness of the output; higher values produce more random results. 8536 + */ 8537 + temperature?: number 8538 + /** 8539 + * 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. 8540 + */ 8541 + top_p?: number 8542 + /** 8543 + * 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. 8544 + */ 8545 + top_k?: number 8546 + /** 8547 + * Random seed for reproducibility of the generation. 8548 + */ 8549 + seed?: number 8550 + /** 8551 + * Penalty for repeated tokens; higher values discourage repetition. 8552 + */ 8553 + repetition_penalty?: number 8554 + /** 8555 + * Decreases the likelihood of the model repeating the same lines verbatim. 8556 + */ 8557 + frequency_penalty?: number 8558 + /** 8559 + * Increases the likelihood of the model introducing new topics. 8560 + */ 8561 + presence_penalty?: number 8562 + } 8563 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_3 { 8564 + type?: 'json_object' | 'json_schema' 8565 + json_schema?: unknown 8566 + } 8567 + type Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Output = 8568 + | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Chat_Completion_Response 8569 + | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Text_Completion_Response 8570 + | string 8571 + | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_AsyncResponse 8572 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Chat_Completion_Response { 8573 + /** 8574 + * Unique identifier for the completion 8575 + */ 8576 + id?: string 8577 + /** 8578 + * Object type identifier 8579 + */ 8580 + object?: 'chat.completion' 8581 + /** 8582 + * Unix timestamp of when the completion was created 8583 + */ 8584 + created?: number 8585 + /** 8586 + * Model used for the completion 8587 + */ 8588 + model?: string 8589 + /** 8590 + * List of completion choices 8591 + */ 8592 + choices?: { 8593 + /** 8594 + * Index of the choice in the list 8595 + */ 8596 + index?: number 8597 + /** 8598 + * The message generated by the model 8599 + */ 8600 + message?: { 8601 + /** 8602 + * Role of the message author 8603 + */ 8604 + role: string 8605 + /** 8606 + * The content of the message 8607 + */ 8608 + content: string 8609 + /** 8610 + * Internal reasoning content (if available) 8611 + */ 8612 + reasoning_content?: string 8613 + /** 8614 + * Tool calls made by the assistant 8615 + */ 8616 + tool_calls?: { 8617 + /** 8618 + * Unique identifier for the tool call 8619 + */ 8620 + id: string 8621 + /** 8622 + * Type of tool call 8623 + */ 8624 + type: 'function' 8625 + function: { 8626 + /** 8627 + * Name of the function to call 8628 + */ 8629 + name: string 8630 + /** 8631 + * JSON string of arguments for the function 8632 + */ 8633 + arguments: string 8634 + } 8635 + }[] 8636 + } 8637 + /** 8638 + * Reason why the model stopped generating 8639 + */ 8640 + finish_reason?: string 8641 + /** 8642 + * Stop reason (may be null) 8643 + */ 8644 + stop_reason?: string | null 8645 + /** 8646 + * Log probabilities (if requested) 8647 + */ 8648 + logprobs?: {} | null 8649 + }[] 8650 + /** 8651 + * Usage statistics for the inference request 8652 + */ 8653 + usage?: { 8654 + /** 8655 + * Total number of tokens in input 8656 + */ 8657 + prompt_tokens?: number 8658 + /** 8659 + * Total number of tokens in output 8660 + */ 8661 + completion_tokens?: number 8662 + /** 8663 + * Total number of input and output tokens 8664 + */ 8665 + total_tokens?: number 8666 + } 8667 + /** 8668 + * Log probabilities for the prompt (if requested) 8669 + */ 8670 + prompt_logprobs?: {} | null 8671 + } 8672 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Text_Completion_Response { 8673 + /** 8674 + * Unique identifier for the completion 8675 + */ 8676 + id?: string 8677 + /** 8678 + * Object type identifier 8679 + */ 8680 + object?: 'text_completion' 8681 + /** 8682 + * Unix timestamp of when the completion was created 8683 + */ 8684 + created?: number 8685 + /** 8686 + * Model used for the completion 8687 + */ 8688 + model?: string 8689 + /** 8690 + * List of completion choices 8691 + */ 8692 + choices?: { 8693 + /** 8694 + * Index of the choice in the list 8695 + */ 8696 + index: number 8697 + /** 8698 + * The generated text completion 8699 + */ 8700 + text: string 8701 + /** 8702 + * Reason why the model stopped generating 8703 + */ 8704 + finish_reason: string 8705 + /** 8706 + * Stop reason (may be null) 8707 + */ 8708 + stop_reason?: string | null 8709 + /** 8710 + * Log probabilities (if requested) 8711 + */ 8712 + logprobs?: {} | null 8713 + /** 8714 + * Log probabilities for the prompt (if requested) 8715 + */ 8716 + prompt_logprobs?: {} | null 8717 + }[] 8718 + /** 8719 + * Usage statistics for the inference request 8720 + */ 8721 + usage?: { 8722 + /** 8723 + * Total number of tokens in input 8724 + */ 8725 + prompt_tokens?: number 8726 + /** 8727 + * Total number of tokens in output 8728 + */ 8729 + completion_tokens?: number 8730 + /** 8731 + * Total number of input and output tokens 8732 + */ 8733 + total_tokens?: number 8734 + } 8735 + } 8736 + interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_AsyncResponse { 8737 + /** 8738 + * The async request id that can be used to obtain the results. 8739 + */ 8740 + request_id?: string 8741 + } 8742 + declare abstract class Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It { 8743 + inputs: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Input 8744 + postProcessedOutputs: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Output 8745 + } 8746 + interface Ai_Cf_Pfnet_Plamo_Embedding_1B_Input { 8747 + /** 8748 + * Input text to embed. Can be a single string or a list of strings. 8749 + */ 8750 + text: string | string[] 8751 + } 8752 + interface Ai_Cf_Pfnet_Plamo_Embedding_1B_Output { 8753 + /** 8754 + * Embedding vectors, where each vector is a list of floats. 8755 + */ 8756 + data: number[][] 8757 + /** 8758 + * Shape of the embedding data as [number_of_embeddings, embedding_dimension]. 8759 + * 8760 + * @minItems 2 8761 + * @maxItems 2 8762 + */ 8763 + shape: [number, number] 8764 + } 8765 + declare abstract class Base_Ai_Cf_Pfnet_Plamo_Embedding_1B { 8766 + inputs: Ai_Cf_Pfnet_Plamo_Embedding_1B_Input 8767 + postProcessedOutputs: Ai_Cf_Pfnet_Plamo_Embedding_1B_Output 8768 + } 8769 + interface Ai_Cf_Deepgram_Flux_Input { 8770 + /** 8771 + * Encoding of the audio stream. Currently only supports raw signed little-endian 16-bit PCM. 8772 + */ 8773 + encoding: 'linear16' 8774 + /** 8775 + * Sample rate of the audio stream in Hz. 8776 + */ 8777 + sample_rate: string 8778 + /** 8779 + * 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. 8780 + */ 8781 + eager_eot_threshold?: string 8782 + /** 8783 + * End-of-turn confidence required to finish a turn. Valid Values 0.5 - 0.9. 8784 + */ 8785 + eot_threshold?: string 8786 + /** 8787 + * A turn will be finished when this much time has passed after speech, regardless of EOT confidence. 8788 + */ 8789 + eot_timeout_ms?: string 8790 + /** 8791 + * Keyterm prompting can improve recognition of specialized terminology. Pass multiple keyterm query parameters to boost multiple keyterms. 8792 + */ 8793 + keyterm?: string 8794 + /** 8795 + * 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 8796 + */ 8797 + mip_opt_out?: 'true' | 'false' 8798 + /** 8799 + * Label your requests for the purpose of identification during usage reporting 8800 + */ 8801 + tag?: string 8802 + } 8803 + /** 8804 + * Output will be returned as websocket messages. 8805 + */ 8806 + interface Ai_Cf_Deepgram_Flux_Output { 8807 + /** 8808 + * The unique identifier of the request (uuid) 8809 + */ 8810 + request_id?: string 8811 + /** 8812 + * Starts at 0 and increments for each message the server sends to the client. 8813 + */ 8814 + sequence_id?: number 8815 + /** 8816 + * The type of event being reported. 8817 + */ 8818 + event?: 'Update' | 'StartOfTurn' | 'EagerEndOfTurn' | 'TurnResumed' | 'EndOfTurn' 8819 + /** 8820 + * The index of the current turn 8821 + */ 8822 + turn_index?: number 8823 + /** 8824 + * Start time in seconds of the audio range that was transcribed 8825 + */ 8826 + audio_window_start?: number 8827 + /** 8828 + * End time in seconds of the audio range that was transcribed 8829 + */ 8830 + audio_window_end?: number 8831 + /** 8832 + * Text that was said over the course of the current turn 8833 + */ 8834 + transcript?: string 8835 + /** 8836 + * The words in the transcript 8837 + */ 8838 + words?: { 8839 + /** 8840 + * The individual punctuated, properly-cased word from the transcript 8841 + */ 8842 + word: string 8843 + /** 8844 + * Confidence that this word was transcribed correctly 8845 + */ 8846 + confidence: number 8847 + }[] 8848 + /** 8849 + * Confidence that no more speech is coming in this turn 8850 + */ 8851 + end_of_turn_confidence?: number 8852 + } 8853 + declare abstract class Base_Ai_Cf_Deepgram_Flux { 8854 + inputs: Ai_Cf_Deepgram_Flux_Input 8855 + postProcessedOutputs: Ai_Cf_Deepgram_Flux_Output 8856 + } 8857 + interface Ai_Cf_Deepgram_Aura_2_En_Input { 8858 + /** 8859 + * Speaker used to produce the audio. 8860 + */ 8861 + speaker?: 8862 + | 'amalthea' 8863 + | 'andromeda' 8864 + | 'apollo' 8865 + | 'arcas' 8866 + | 'aries' 8867 + | 'asteria' 8868 + | 'athena' 8869 + | 'atlas' 8870 + | 'aurora' 8871 + | 'callista' 8872 + | 'cora' 8873 + | 'cordelia' 8874 + | 'delia' 8875 + | 'draco' 8876 + | 'electra' 8877 + | 'harmonia' 8878 + | 'helena' 8879 + | 'hera' 8880 + | 'hermes' 8881 + | 'hyperion' 8882 + | 'iris' 8883 + | 'janus' 8884 + | 'juno' 8885 + | 'jupiter' 8886 + | 'luna' 8887 + | 'mars' 8888 + | 'minerva' 8889 + | 'neptune' 8890 + | 'odysseus' 8891 + | 'ophelia' 8892 + | 'orion' 8893 + | 'orpheus' 8894 + | 'pandora' 8895 + | 'phoebe' 8896 + | 'pluto' 8897 + | 'saturn' 8898 + | 'thalia' 8899 + | 'theia' 8900 + | 'vesta' 8901 + | 'zeus' 8902 + /** 8903 + * Encoding of the output audio. 8904 + */ 8905 + encoding?: 'linear16' | 'flac' | 'mulaw' | 'alaw' | 'mp3' | 'opus' | 'aac' 8906 + /** 8907 + * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type.. 8908 + */ 8909 + container?: 'none' | 'wav' | 'ogg' 8910 + /** 8911 + * The text content to be converted to speech 8912 + */ 8913 + text: string 8914 + /** 8915 + * 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 8916 + */ 8917 + sample_rate?: number 8918 + /** 8919 + * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type. 8920 + */ 8921 + bit_rate?: number 8922 + } 8923 + /** 8924 + * The generated audio in MP3 format 8925 + */ 8926 + type Ai_Cf_Deepgram_Aura_2_En_Output = string 8927 + declare abstract class Base_Ai_Cf_Deepgram_Aura_2_En { 8928 + inputs: Ai_Cf_Deepgram_Aura_2_En_Input 8929 + postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_En_Output 8930 + } 8931 + interface Ai_Cf_Deepgram_Aura_2_Es_Input { 8932 + /** 8933 + * Speaker used to produce the audio. 8934 + */ 8935 + speaker?: 8936 + | 'sirio' 8937 + | 'nestor' 8938 + | 'carina' 8939 + | 'celeste' 8940 + | 'alvaro' 8941 + | 'diana' 8942 + | 'aquila' 8943 + | 'selena' 8944 + | 'estrella' 8945 + | 'javier' 8946 + /** 8947 + * Encoding of the output audio. 8948 + */ 8949 + encoding?: 'linear16' | 'flac' | 'mulaw' | 'alaw' | 'mp3' | 'opus' | 'aac' 8950 + /** 8951 + * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type.. 8952 + */ 8953 + container?: 'none' | 'wav' | 'ogg' 8954 + /** 8955 + * The text content to be converted to speech 8956 + */ 8957 + text: string 8958 + /** 8959 + * 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 8960 + */ 8961 + sample_rate?: number 8962 + /** 8963 + * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type. 8964 + */ 8965 + bit_rate?: number 8966 + } 8967 + /** 8968 + * The generated audio in MP3 format 8969 + */ 8970 + type Ai_Cf_Deepgram_Aura_2_Es_Output = string 8971 + declare abstract class Base_Ai_Cf_Deepgram_Aura_2_Es { 8972 + inputs: Ai_Cf_Deepgram_Aura_2_Es_Input 8973 + postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_Es_Output 8974 + } 8975 + interface AiModels { 8976 + '@cf/huggingface/distilbert-sst-2-int8': BaseAiTextClassification 8977 + '@cf/stabilityai/stable-diffusion-xl-base-1.0': BaseAiTextToImage 8978 + '@cf/runwayml/stable-diffusion-v1-5-inpainting': BaseAiTextToImage 8979 + '@cf/runwayml/stable-diffusion-v1-5-img2img': BaseAiTextToImage 8980 + '@cf/lykon/dreamshaper-8-lcm': BaseAiTextToImage 8981 + '@cf/bytedance/stable-diffusion-xl-lightning': BaseAiTextToImage 8982 + '@cf/myshell-ai/melotts': BaseAiTextToSpeech 8983 + '@cf/google/embeddinggemma-300m': BaseAiTextEmbeddings 8984 + '@cf/microsoft/resnet-50': BaseAiImageClassification 8985 + '@cf/meta/llama-2-7b-chat-int8': BaseAiTextGeneration 8986 + '@cf/mistral/mistral-7b-instruct-v0.1': BaseAiTextGeneration 8987 + '@cf/meta/llama-2-7b-chat-fp16': BaseAiTextGeneration 8988 + '@hf/thebloke/llama-2-13b-chat-awq': BaseAiTextGeneration 8989 + '@hf/thebloke/mistral-7b-instruct-v0.1-awq': BaseAiTextGeneration 8990 + '@hf/thebloke/zephyr-7b-beta-awq': BaseAiTextGeneration 8991 + '@hf/thebloke/openhermes-2.5-mistral-7b-awq': BaseAiTextGeneration 8992 + '@hf/thebloke/neural-chat-7b-v3-1-awq': BaseAiTextGeneration 8993 + '@hf/thebloke/llamaguard-7b-awq': BaseAiTextGeneration 8994 + '@hf/thebloke/deepseek-coder-6.7b-base-awq': BaseAiTextGeneration 8995 + '@hf/thebloke/deepseek-coder-6.7b-instruct-awq': BaseAiTextGeneration 8996 + '@cf/deepseek-ai/deepseek-math-7b-instruct': BaseAiTextGeneration 8997 + '@cf/defog/sqlcoder-7b-2': BaseAiTextGeneration 8998 + '@cf/openchat/openchat-3.5-0106': BaseAiTextGeneration 8999 + '@cf/tiiuae/falcon-7b-instruct': BaseAiTextGeneration 9000 + '@cf/thebloke/discolm-german-7b-v1-awq': BaseAiTextGeneration 9001 + '@cf/qwen/qwen1.5-0.5b-chat': BaseAiTextGeneration 9002 + '@cf/qwen/qwen1.5-7b-chat-awq': BaseAiTextGeneration 9003 + '@cf/qwen/qwen1.5-14b-chat-awq': BaseAiTextGeneration 9004 + '@cf/tinyllama/tinyllama-1.1b-chat-v1.0': BaseAiTextGeneration 9005 + '@cf/microsoft/phi-2': BaseAiTextGeneration 9006 + '@cf/qwen/qwen1.5-1.8b-chat': BaseAiTextGeneration 9007 + '@cf/mistral/mistral-7b-instruct-v0.2-lora': BaseAiTextGeneration 9008 + '@hf/nousresearch/hermes-2-pro-mistral-7b': BaseAiTextGeneration 9009 + '@hf/nexusflow/starling-lm-7b-beta': BaseAiTextGeneration 9010 + '@hf/google/gemma-7b-it': BaseAiTextGeneration 9011 + '@cf/meta-llama/llama-2-7b-chat-hf-lora': BaseAiTextGeneration 9012 + '@cf/google/gemma-2b-it-lora': BaseAiTextGeneration 9013 + '@cf/google/gemma-7b-it-lora': BaseAiTextGeneration 9014 + '@hf/mistral/mistral-7b-instruct-v0.2': BaseAiTextGeneration 9015 + '@cf/meta/llama-3-8b-instruct': BaseAiTextGeneration 9016 + '@cf/fblgit/una-cybertron-7b-v2-bf16': BaseAiTextGeneration 9017 + '@cf/meta/llama-3-8b-instruct-awq': BaseAiTextGeneration 9018 + '@cf/meta/llama-3.1-8b-instruct-fp8': BaseAiTextGeneration 9019 + '@cf/meta/llama-3.1-8b-instruct-awq': BaseAiTextGeneration 9020 + '@cf/meta/llama-3.2-3b-instruct': BaseAiTextGeneration 9021 + '@cf/meta/llama-3.2-1b-instruct': BaseAiTextGeneration 9022 + '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b': BaseAiTextGeneration 9023 + '@cf/ibm-granite/granite-4.0-h-micro': BaseAiTextGeneration 9024 + '@cf/facebook/bart-large-cnn': BaseAiSummarization 9025 + '@cf/llava-hf/llava-1.5-7b-hf': BaseAiImageToText 9026 + '@cf/baai/bge-base-en-v1.5': Base_Ai_Cf_Baai_Bge_Base_En_V1_5 9027 + '@cf/openai/whisper': Base_Ai_Cf_Openai_Whisper 9028 + '@cf/meta/m2m100-1.2b': Base_Ai_Cf_Meta_M2M100_1_2B 9029 + '@cf/baai/bge-small-en-v1.5': Base_Ai_Cf_Baai_Bge_Small_En_V1_5 9030 + '@cf/baai/bge-large-en-v1.5': Base_Ai_Cf_Baai_Bge_Large_En_V1_5 9031 + '@cf/unum/uform-gen2-qwen-500m': Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M 9032 + '@cf/openai/whisper-tiny-en': Base_Ai_Cf_Openai_Whisper_Tiny_En 9033 + '@cf/openai/whisper-large-v3-turbo': Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo 9034 + '@cf/baai/bge-m3': Base_Ai_Cf_Baai_Bge_M3 9035 + '@cf/black-forest-labs/flux-1-schnell': Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell 9036 + '@cf/meta/llama-3.2-11b-vision-instruct': Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct 9037 + '@cf/meta/llama-3.3-70b-instruct-fp8-fast': Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast 9038 + '@cf/meta/llama-guard-3-8b': Base_Ai_Cf_Meta_Llama_Guard_3_8B 9039 + '@cf/baai/bge-reranker-base': Base_Ai_Cf_Baai_Bge_Reranker_Base 9040 + '@cf/qwen/qwen2.5-coder-32b-instruct': Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct 9041 + '@cf/qwen/qwq-32b': Base_Ai_Cf_Qwen_Qwq_32B 9042 + '@cf/mistralai/mistral-small-3.1-24b-instruct': Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct 9043 + '@cf/google/gemma-3-12b-it': Base_Ai_Cf_Google_Gemma_3_12B_It 9044 + '@cf/meta/llama-4-scout-17b-16e-instruct': Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct 9045 + '@cf/qwen/qwen3-30b-a3b-fp8': Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8 9046 + '@cf/deepgram/nova-3': Base_Ai_Cf_Deepgram_Nova_3 9047 + '@cf/qwen/qwen3-embedding-0.6b': Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B 9048 + '@cf/pipecat-ai/smart-turn-v2': Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 9049 + '@cf/openai/gpt-oss-120b': Base_Ai_Cf_Openai_Gpt_Oss_120B 9050 + '@cf/openai/gpt-oss-20b': Base_Ai_Cf_Openai_Gpt_Oss_20B 9051 + '@cf/leonardo/phoenix-1.0': Base_Ai_Cf_Leonardo_Phoenix_1_0 9052 + '@cf/leonardo/lucid-origin': Base_Ai_Cf_Leonardo_Lucid_Origin 9053 + '@cf/deepgram/aura-1': Base_Ai_Cf_Deepgram_Aura_1 9054 + '@cf/ai4bharat/indictrans2-en-indic-1B': Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B 9055 + '@cf/aisingapore/gemma-sea-lion-v4-27b-it': Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It 9056 + '@cf/pfnet/plamo-embedding-1b': Base_Ai_Cf_Pfnet_Plamo_Embedding_1B 9057 + '@cf/deepgram/flux': Base_Ai_Cf_Deepgram_Flux 9058 + '@cf/deepgram/aura-2-en': Base_Ai_Cf_Deepgram_Aura_2_En 9059 + '@cf/deepgram/aura-2-es': Base_Ai_Cf_Deepgram_Aura_2_Es 9060 + } 9061 + type AiOptions = { 9062 + /** 9063 + * Send requests as an asynchronous batch job, only works for supported models 9064 + * https://developers.cloudflare.com/workers-ai/features/batch-api 9065 + */ 9066 + queueRequest?: boolean 9067 + /** 9068 + * Establish websocket connections, only works for supported models 9069 + */ 9070 + websocket?: boolean 9071 + /** 9072 + * Tag your requests to group and view them in Cloudflare dashboard. 9073 + * 9074 + * Rules: 9075 + * Tags must only contain letters, numbers, and the symbols: : - . / @ 9076 + * Each tag can have maximum 50 characters. 9077 + * Maximum 5 tags are allowed each request. 9078 + * Duplicate tags will removed. 9079 + */ 9080 + tags?: string[] 9081 + gateway?: GatewayOptions 9082 + returnRawResponse?: boolean 9083 + prefix?: string 9084 + extraHeaders?: object 9085 + } 9086 + type AiModelsSearchParams = { 9087 + author?: string 9088 + hide_experimental?: boolean 9089 + page?: number 9090 + per_page?: number 9091 + search?: string 9092 + source?: number 9093 + task?: string 9094 + } 9095 + type AiModelsSearchObject = { 9096 + id: string 9097 + source: number 9098 + name: string 9099 + description: string 9100 + task: { 9101 + id: string 9102 + name: string 9103 + description: string 9104 + } 9105 + tags: string[] 9106 + properties: { 9107 + property_id: string 9108 + value: string 9109 + }[] 9110 + } 9111 + interface InferenceUpstreamError extends Error {} 9112 + interface AiInternalError extends Error {} 9113 + type AiModelListType = Record<string, any> 9114 + declare abstract class Ai<AiModelList extends AiModelListType = AiModels> { 9115 + aiGatewayLogId: string | null 9116 + gateway(gatewayId: string): AiGateway 9117 + autorag(autoragId: string): AutoRAG 9118 + run< 9119 + Name extends keyof AiModelList, 9120 + Options extends AiOptions, 9121 + InputOptions extends AiModelList[Name]['inputs'], 9122 + >( 9123 + model: Name, 9124 + inputs: InputOptions, 9125 + options?: Options, 9126 + ): Promise< 9127 + Options extends 9128 + | { 9129 + returnRawResponse: true 9130 + } 9131 + | { 9132 + websocket: true 9133 + } 9134 + ? Response 9135 + : InputOptions extends { 9136 + stream: true 9137 + } 9138 + ? ReadableStream 9139 + : AiModelList[Name]['postProcessedOutputs'] 9140 + > 9141 + models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]> 9142 + toMarkdown(): ToMarkdownService 9143 + toMarkdown( 9144 + files: MarkdownDocument[], 9145 + options?: ConversionRequestOptions, 9146 + ): Promise<ConversionResponse[]> 9147 + toMarkdown( 9148 + files: MarkdownDocument, 9149 + options?: ConversionRequestOptions, 9150 + ): Promise<ConversionResponse> 9151 + } 9152 + type GatewayRetries = { 9153 + maxAttempts?: 1 | 2 | 3 | 4 | 5 9154 + retryDelayMs?: number 9155 + backoff?: 'constant' | 'linear' | 'exponential' 9156 + } 9157 + type GatewayOptions = { 9158 + id: string 9159 + cacheKey?: string 9160 + cacheTtl?: number 9161 + skipCache?: boolean 9162 + metadata?: Record<string, number | string | boolean | null | bigint> 9163 + collectLog?: boolean 9164 + eventId?: string 9165 + requestTimeoutMs?: number 9166 + retries?: GatewayRetries 9167 + } 9168 + type UniversalGatewayOptions = Exclude<GatewayOptions, 'id'> & { 9169 + /** 9170 + ** @deprecated 9171 + */ 9172 + id?: string 9173 + } 9174 + type AiGatewayPatchLog = { 9175 + score?: number | null 9176 + feedback?: -1 | 1 | null 9177 + metadata?: Record<string, number | string | boolean | null | bigint> | null 9178 + } 9179 + type AiGatewayLog = { 9180 + id: string 9181 + provider: string 9182 + model: string 9183 + model_type?: string 9184 + path: string 9185 + duration: number 9186 + request_type?: string 9187 + request_content_type?: string 9188 + status_code: number 9189 + response_content_type?: string 9190 + success: boolean 9191 + cached: boolean 9192 + tokens_in?: number 9193 + tokens_out?: number 9194 + metadata?: Record<string, number | string | boolean | null | bigint> 9195 + step?: number 9196 + cost?: number 9197 + custom_cost?: boolean 9198 + request_size: number 9199 + request_head?: string 9200 + request_head_complete: boolean 9201 + response_size: number 9202 + response_head?: string 9203 + response_head_complete: boolean 9204 + created_at: Date 9205 + } 9206 + type AIGatewayProviders = 9207 + | 'workers-ai' 9208 + | 'anthropic' 9209 + | 'aws-bedrock' 9210 + | 'azure-openai' 9211 + | 'google-vertex-ai' 9212 + | 'huggingface' 9213 + | 'openai' 9214 + | 'perplexity-ai' 9215 + | 'replicate' 9216 + | 'groq' 9217 + | 'cohere' 9218 + | 'google-ai-studio' 9219 + | 'mistral' 9220 + | 'grok' 9221 + | 'openrouter' 9222 + | 'deepseek' 9223 + | 'cerebras' 9224 + | 'cartesia' 9225 + | 'elevenlabs' 9226 + | 'adobe-firefly' 9227 + type AIGatewayHeaders = { 9228 + 'cf-aig-metadata': Record<string, number | string | boolean | null | bigint> | string 9229 + 'cf-aig-custom-cost': 9230 + | { 9231 + per_token_in?: number 9232 + per_token_out?: number 9233 + } 9234 + | { 9235 + total_cost?: number 9236 + } 9237 + | string 9238 + 'cf-aig-cache-ttl': number | string 9239 + 'cf-aig-skip-cache': boolean | string 9240 + 'cf-aig-cache-key': string 9241 + 'cf-aig-event-id': string 9242 + 'cf-aig-request-timeout': number | string 9243 + 'cf-aig-max-attempts': number | string 9244 + 'cf-aig-retry-delay': number | string 9245 + 'cf-aig-backoff': string 9246 + 'cf-aig-collect-log': boolean | string 9247 + Authorization: string 9248 + 'Content-Type': string 9249 + [key: string]: string | number | boolean | object 9250 + } 9251 + type AIGatewayUniversalRequest = { 9252 + provider: AIGatewayProviders | string // eslint-disable-line 9253 + endpoint: string 9254 + headers: Partial<AIGatewayHeaders> 9255 + query: unknown 9256 + } 9257 + interface AiGatewayInternalError extends Error {} 9258 + interface AiGatewayLogNotFound extends Error {} 9259 + declare abstract class AiGateway { 9260 + patchLog(logId: string, data: AiGatewayPatchLog): Promise<void> 9261 + getLog(logId: string): Promise<AiGatewayLog> 9262 + run( 9263 + data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[], 9264 + options?: { 9265 + gateway?: UniversalGatewayOptions 9266 + extraHeaders?: object 9267 + }, 9268 + ): Promise<Response> 9269 + getUrl(provider?: AIGatewayProviders | string): Promise<string> // eslint-disable-line 9270 + } 9271 + interface AutoRAGInternalError extends Error {} 9272 + interface AutoRAGNotFoundError extends Error {} 9273 + interface AutoRAGUnauthorizedError extends Error {} 9274 + interface AutoRAGNameNotSetError extends Error {} 9275 + type ComparisonFilter = { 9276 + key: string 9277 + type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' 9278 + value: string | number | boolean 9279 + } 9280 + type CompoundFilter = { 9281 + type: 'and' | 'or' 9282 + filters: ComparisonFilter[] 9283 + } 9284 + type AutoRagSearchRequest = { 9285 + query: string 9286 + filters?: CompoundFilter | ComparisonFilter 9287 + max_num_results?: number 9288 + ranking_options?: { 9289 + ranker?: string 9290 + score_threshold?: number 9291 + } 9292 + reranking?: { 9293 + enabled?: boolean 9294 + model?: string 9295 + } 9296 + rewrite_query?: boolean 9297 + } 9298 + type AutoRagAiSearchRequest = AutoRagSearchRequest & { 9299 + stream?: boolean 9300 + system_prompt?: string 9301 + } 9302 + type AutoRagAiSearchRequestStreaming = Omit<AutoRagAiSearchRequest, 'stream'> & { 9303 + stream: true 9304 + } 9305 + type AutoRagSearchResponse = { 9306 + object: 'vector_store.search_results.page' 9307 + search_query: string 9308 + data: { 9309 + file_id: string 9310 + filename: string 9311 + score: number 9312 + attributes: Record<string, string | number | boolean | null> 9313 + content: { 9314 + type: 'text' 9315 + text: string 9316 + }[] 9317 + }[] 9318 + has_more: boolean 9319 + next_page: string | null 9320 + } 9321 + type AutoRagListResponse = { 9322 + id: string 9323 + enable: boolean 9324 + type: string 9325 + source: string 9326 + vectorize_name: string 9327 + paused: boolean 9328 + status: string 9329 + }[] 9330 + type AutoRagAiSearchResponse = AutoRagSearchResponse & { 9331 + response: string 9332 + } 9333 + declare abstract class AutoRAG { 9334 + list(): Promise<AutoRagListResponse> 9335 + search(params: AutoRagSearchRequest): Promise<AutoRagSearchResponse> 9336 + aiSearch(params: AutoRagAiSearchRequestStreaming): Promise<Response> 9337 + aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse> 9338 + aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse | Response> 9339 + } 9340 + interface BasicImageTransformations { 9341 + /** 9342 + * Maximum width in image pixels. The value must be an integer. 9343 + */ 9344 + width?: number 9345 + /** 9346 + * Maximum height in image pixels. The value must be an integer. 9347 + */ 9348 + height?: number 9349 + /** 9350 + * Resizing mode as a string. It affects interpretation of width and height 9351 + * options: 9352 + * - scale-down: Similar to contain, but the image is never enlarged. If 9353 + * the image is larger than given width or height, it will be resized. 9354 + * Otherwise its original size will be kept. 9355 + * - contain: Resizes to maximum size that fits within the given width and 9356 + * height. If only a single dimension is given (e.g. only width), the 9357 + * image will be shrunk or enlarged to exactly match that dimension. 9358 + * Aspect ratio is always preserved. 9359 + * - cover: Resizes (shrinks or enlarges) to fill the entire area of width 9360 + * and height. If the image has an aspect ratio different from the ratio 9361 + * of width and height, it will be cropped to fit. 9362 + * - crop: The image will be shrunk and cropped to fit within the area 9363 + * specified by width and height. The image will not be enlarged. For images 9364 + * smaller than the given dimensions it's the same as scale-down. For 9365 + * images larger than the given dimensions, it's the same as cover. 9366 + * See also trim. 9367 + * - pad: Resizes to the maximum size that fits within the given width and 9368 + * height, and then fills the remaining area with a background color 9369 + * (white by default). Use of this mode is not recommended, as the same 9370 + * effect can be more efficiently achieved with the contain mode and the 9371 + * CSS object-fit: contain property. 9372 + * - squeeze: Stretches and deforms to the width and height given, even if it 9373 + * breaks aspect ratio 9374 + */ 9375 + fit?: 'scale-down' | 'contain' | 'cover' | 'crop' | 'pad' | 'squeeze' 9376 + /** 9377 + * Image segmentation using artificial intelligence models. Sets pixels not 9378 + * within selected segment area to transparent e.g "foreground" sets every 9379 + * background pixel as transparent. 9380 + */ 9381 + segment?: 'foreground' 9382 + /** 9383 + * When cropping with fit: "cover", this defines the side or point that should 9384 + * be left uncropped. The value is either a string 9385 + * "left", "right", "top", "bottom", "auto", or "center" (the default), 9386 + * or an object {x, y} containing focal point coordinates in the original 9387 + * image expressed as fractions ranging from 0.0 (top or left) to 1.0 9388 + * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will 9389 + * crop bottom or left and right sides as necessary, but won’t crop anything 9390 + * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to 9391 + * preserve as much as possible around a point at 20% of the height of the 9392 + * source image. 9393 + */ 9394 + gravity?: 9395 + | 'face' 9396 + | 'left' 9397 + | 'right' 9398 + | 'top' 9399 + | 'bottom' 9400 + | 'center' 9401 + | 'auto' 9402 + | 'entropy' 9403 + | BasicImageTransformationsGravityCoordinates 9404 + /** 9405 + * Background color to add underneath the image. Applies only to images with 9406 + * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…), 9407 + * hsl(…), etc.) 9408 + */ 9409 + background?: string 9410 + /** 9411 + * Number of degrees (90, 180, 270) to rotate the image by. width and height 9412 + * options refer to axes after rotation. 9413 + */ 9414 + rotate?: 0 | 90 | 180 | 270 | 360 9415 + } 9416 + interface BasicImageTransformationsGravityCoordinates { 9417 + x?: number 9418 + y?: number 9419 + mode?: 'remainder' | 'box-center' 9420 + } 9421 + /** 9422 + * In addition to the properties you can set in the RequestInit dict 9423 + * that you pass as an argument to the Request constructor, you can 9424 + * set certain properties of a `cf` object to control how Cloudflare 9425 + * features are applied to that new Request. 9426 + * 9427 + * Note: Currently, these properties cannot be tested in the 9428 + * playground. 9429 + */ 9430 + interface RequestInitCfProperties extends Record<string, unknown> { 9431 + cacheEverything?: boolean 9432 + /** 9433 + * A request's cache key is what determines if two requests are 9434 + * "the same" for caching purposes. If a request has the same cache key 9435 + * as some previous request, then we can serve the same cached response for 9436 + * both. (e.g. 'some-key') 9437 + * 9438 + * Only available for Enterprise customers. 9439 + */ 9440 + cacheKey?: string 9441 + /** 9442 + * This allows you to append additional Cache-Tag response headers 9443 + * to the origin response without modifications to the origin server. 9444 + * This will allow for greater control over the Purge by Cache Tag feature 9445 + * utilizing changes only in the Workers process. 9446 + * 9447 + * Only available for Enterprise customers. 9448 + */ 9449 + cacheTags?: string[] 9450 + /** 9451 + * Force response to be cached for a given number of seconds. (e.g. 300) 9452 + */ 9453 + cacheTtl?: number 9454 + /** 9455 + * Force response to be cached for a given number of seconds based on the Origin status code. 9456 + * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 }) 9457 + */ 9458 + cacheTtlByStatus?: Record<string, number> 9459 + scrapeShield?: boolean 9460 + apps?: boolean 9461 + image?: RequestInitCfPropertiesImage 9462 + minify?: RequestInitCfPropertiesImageMinify 9463 + mirage?: boolean 9464 + polish?: 'lossy' | 'lossless' | 'off' 9465 + r2?: RequestInitCfPropertiesR2 9466 + /** 9467 + * Redirects the request to an alternate origin server. You can use this, 9468 + * for example, to implement load balancing across several origins. 9469 + * (e.g.us-east.example.com) 9470 + * 9471 + * Note - For security reasons, the hostname set in resolveOverride must 9472 + * be proxied on the same Cloudflare zone of the incoming request. 9473 + * Otherwise, the setting is ignored. CNAME hosts are allowed, so to 9474 + * resolve to a host under a different domain or a DNS only domain first 9475 + * declare a CNAME record within your own zone’s DNS mapping to the 9476 + * external hostname, set proxy on Cloudflare, then set resolveOverride 9477 + * to point to that CNAME record. 9478 + */ 9479 + resolveOverride?: string 9480 + } 9481 + interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations { 9482 + /** 9483 + * Absolute URL of the image file to use for the drawing. It can be any of 9484 + * the supported file formats. For drawing of watermarks or non-rectangular 9485 + * overlays we recommend using PNG or WebP images. 9486 + */ 9487 + url: string 9488 + /** 9489 + * Floating-point number between 0 (transparent) and 1 (opaque). 9490 + * For example, opacity: 0.5 makes overlay semitransparent. 9491 + */ 9492 + opacity?: number 9493 + /** 9494 + * - If set to true, the overlay image will be tiled to cover the entire 9495 + * area. This is useful for stock-photo-like watermarks. 9496 + * - If set to "x", the overlay image will be tiled horizontally only 9497 + * (form a line). 9498 + * - If set to "y", the overlay image will be tiled vertically only 9499 + * (form a line). 9500 + */ 9501 + repeat?: true | 'x' | 'y' 9502 + /** 9503 + * Position of the overlay image relative to a given edge. Each property is 9504 + * an offset in pixels. 0 aligns exactly to the edge. For example, left: 10 9505 + * positions left side of the overlay 10 pixels from the left edge of the 9506 + * image it's drawn over. bottom: 0 aligns bottom of the overlay with bottom 9507 + * of the background image. 9508 + * 9509 + * Setting both left & right, or both top & bottom is an error. 9510 + * 9511 + * If no position is specified, the image will be centered. 9512 + */ 9513 + top?: number 9514 + left?: number 9515 + bottom?: number 9516 + right?: number 9517 + } 9518 + interface RequestInitCfPropertiesImage extends BasicImageTransformations { 9519 + /** 9520 + * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it 9521 + * easier to specify higher-DPI sizes in <img srcset>. 9522 + */ 9523 + dpr?: number 9524 + /** 9525 + * Allows you to trim your image. Takes dpr into account and is performed before 9526 + * resizing or rotation. 9527 + * 9528 + * It can be used as: 9529 + * - left, top, right, bottom - it will specify the number of pixels to cut 9530 + * off each side 9531 + * - width, height - the width/height you'd like to end up with - can be used 9532 + * in combination with the properties above 9533 + * - border - this will automatically trim the surroundings of an image based on 9534 + * it's color. It consists of three properties: 9535 + * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit) 9536 + * - tolerance: difference from color to treat as color 9537 + * - keep: the number of pixels of border to keep 9538 + */ 9539 + trim?: 9540 + | 'border' 9541 + | { 9542 + top?: number 9543 + bottom?: number 9544 + left?: number 9545 + right?: number 9546 + width?: number 9547 + height?: number 9548 + border?: 9549 + | boolean 9550 + | { 9551 + color?: string 9552 + tolerance?: number 9553 + keep?: number 9554 + } 9555 + } 9556 + /** 9557 + * Quality setting from 1-100 (useful values are in 60-90 range). Lower values 9558 + * make images look worse, but load faster. The default is 85. It applies only 9559 + * to JPEG and WebP images. It doesn’t have any effect on PNG. 9560 + */ 9561 + quality?: number | 'low' | 'medium-low' | 'medium-high' | 'high' 9562 + /** 9563 + * Output format to generate. It can be: 9564 + * - avif: generate images in AVIF format. 9565 + * - webp: generate images in Google WebP format. Set quality to 100 to get 9566 + * the WebP-lossless format. 9567 + * - json: instead of generating an image, outputs information about the 9568 + * image, in JSON format. The JSON object will contain image size 9569 + * (before and after resizing), source image’s MIME type, file size, etc. 9570 + * - jpeg: generate images in JPEG format. 9571 + * - png: generate images in PNG format. 9572 + */ 9573 + format?: 'avif' | 'webp' | 'json' | 'jpeg' | 'png' | 'baseline-jpeg' | 'png-force' | 'svg' 9574 + /** 9575 + * Whether to preserve animation frames from input files. Default is true. 9576 + * Setting it to false reduces animations to still images. This setting is 9577 + * recommended when enlarging images or processing arbitrary user content, 9578 + * because large GIF animations can weigh tens or even hundreds of megabytes. 9579 + * It is also useful to set anim:false when using format:"json" to get the 9580 + * response quicker without the number of frames. 9581 + */ 9582 + anim?: boolean 9583 + /** 9584 + * What EXIF data should be preserved in the output image. Note that EXIF 9585 + * rotation and embedded color profiles are always applied ("baked in" into 9586 + * the image), and aren't affected by this option. Note that if the Polish 9587 + * feature is enabled, all metadata may have been removed already and this 9588 + * option may have no effect. 9589 + * - keep: Preserve most of EXIF metadata, including GPS location if there's 9590 + * any. 9591 + * - copyright: Only keep the copyright tag, and discard everything else. 9592 + * This is the default behavior for JPEG files. 9593 + * - none: Discard all invisible EXIF metadata. Currently WebP and PNG 9594 + * output formats always discard metadata. 9595 + */ 9596 + metadata?: 'keep' | 'copyright' | 'none' 9597 + /** 9598 + * Strength of sharpening filter to apply to the image. Floating-point 9599 + * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a 9600 + * recommended value for downscaled images. 9601 + */ 9602 + sharpen?: number 9603 + /** 9604 + * Radius of a blur filter (approximate gaussian). Maximum supported radius 9605 + * is 250. 9606 + */ 9607 + blur?: number 9608 + /** 9609 + * Overlays are drawn in the order they appear in the array (last array 9610 + * entry is the topmost layer). 9611 + */ 9612 + draw?: RequestInitCfPropertiesImageDraw[] 9613 + /** 9614 + * Fetching image from authenticated origin. Setting this property will 9615 + * pass authentication headers (Authorization, Cookie, etc.) through to 9616 + * the origin. 9617 + */ 9618 + 'origin-auth'?: 'share-publicly' 9619 + /** 9620 + * Adds a border around the image. The border is added after resizing. Border 9621 + * width takes dpr into account, and can be specified either using a single 9622 + * width property, or individually for each side. 9623 + */ 9624 + border?: 9625 + | { 9626 + color: string 9627 + width: number 9628 + } 9629 + | { 9630 + color: string 9631 + top: number 9632 + right: number 9633 + bottom: number 9634 + left: number 9635 + } 9636 + /** 9637 + * Increase brightness by a factor. A value of 1.0 equals no change, a value 9638 + * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright. 9639 + * 0 is ignored. 9640 + */ 9641 + brightness?: number 9642 + /** 9643 + * Increase contrast by a factor. A value of 1.0 equals no change, a value of 9644 + * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is 9645 + * ignored. 9646 + */ 9647 + contrast?: number 9648 + /** 9649 + * Increase exposure by a factor. A value of 1.0 equals no change, a value of 9650 + * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored. 9651 + */ 9652 + gamma?: number 9653 + /** 9654 + * Increase contrast by a factor. A value of 1.0 equals no change, a value of 9655 + * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is 9656 + * ignored. 9657 + */ 9658 + saturation?: number 9659 + /** 9660 + * Flips the images horizontally, vertically, or both. Flipping is applied before 9661 + * rotation, so if you apply flip=h,rotate=90 then the image will be flipped 9662 + * horizontally, then rotated by 90 degrees. 9663 + */ 9664 + flip?: 'h' | 'v' | 'hv' 9665 + /** 9666 + * Slightly reduces latency on a cache miss by selecting a 9667 + * quickest-to-compress file format, at a cost of increased file size and 9668 + * lower image quality. It will usually override the format option and choose 9669 + * JPEG over WebP or AVIF. We do not recommend using this option, except in 9670 + * unusual circumstances like resizing uncacheable dynamically-generated 9671 + * images. 9672 + */ 9673 + compression?: 'fast' 9674 + } 9675 + interface RequestInitCfPropertiesImageMinify { 9676 + javascript?: boolean 9677 + css?: boolean 9678 + html?: boolean 9679 + } 9680 + interface RequestInitCfPropertiesR2 { 9681 + /** 9682 + * Colo id of bucket that an object is stored in 9683 + */ 9684 + bucketColoId?: number 9685 + } 9686 + /** 9687 + * Request metadata provided by Cloudflare's edge. 9688 + */ 9689 + type IncomingRequestCfProperties<HostMetadata = unknown> = IncomingRequestCfPropertiesBase & 9690 + IncomingRequestCfPropertiesBotManagementEnterprise & 9691 + IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> & 9692 + IncomingRequestCfPropertiesGeographicInformation & 9693 + IncomingRequestCfPropertiesCloudflareAccessOrApiShield 9694 + interface IncomingRequestCfPropertiesBase extends Record<string, unknown> { 9695 + /** 9696 + * [ASN](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) of the incoming request. 9697 + * 9698 + * @example 395747 9699 + */ 9700 + asn?: number 9701 + /** 9702 + * The organization which owns the ASN of the incoming request. 9703 + * 9704 + * @example "Google Cloud" 9705 + */ 9706 + asOrganization?: string 9707 + /** 9708 + * The original value of the `Accept-Encoding` header if Cloudflare modified it. 9709 + * 9710 + * @example "gzip, deflate, br" 9711 + */ 9712 + clientAcceptEncoding?: string 9713 + /** 9714 + * The number of milliseconds it took for the request to reach your worker. 9715 + * 9716 + * @example 22 9717 + */ 9718 + clientTcpRtt?: number 9719 + /** 9720 + * The three-letter [IATA](https://en.wikipedia.org/wiki/IATA_airport_code) 9721 + * airport code of the data center that the request hit. 9722 + * 9723 + * @example "DFW" 9724 + */ 9725 + colo: string 9726 + /** 9727 + * Represents the upstream's response to a 9728 + * [TCP `keepalive` message](https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html) 9729 + * from cloudflare. 9730 + * 9731 + * For workers with no upstream, this will always be `1`. 9732 + * 9733 + * @example 3 9734 + */ 9735 + edgeRequestKeepAliveStatus: IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus 9736 + /** 9737 + * The HTTP Protocol the request used. 9738 + * 9739 + * @example "HTTP/2" 9740 + */ 9741 + httpProtocol: string 9742 + /** 9743 + * The browser-requested prioritization information in the request object. 9744 + * 9745 + * If no information was set, defaults to the empty string `""` 9746 + * 9747 + * @example "weight=192;exclusive=0;group=3;group-weight=127" 9748 + * @default "" 9749 + */ 9750 + requestPriority: string 9751 + /** 9752 + * The TLS version of the connection to Cloudflare. 9753 + * In requests served over plaintext (without TLS), this property is the empty string `""`. 9754 + * 9755 + * @example "TLSv1.3" 9756 + */ 9757 + tlsVersion: string 9758 + /** 9759 + * The cipher for the connection to Cloudflare. 9760 + * In requests served over plaintext (without TLS), this property is the empty string `""`. 9761 + * 9762 + * @example "AEAD-AES128-GCM-SHA256" 9763 + */ 9764 + tlsCipher: string 9765 + /** 9766 + * 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. 9767 + * 9768 + * If the incoming request was served over plaintext (without TLS) this field is undefined. 9769 + */ 9770 + tlsExportedAuthenticator?: IncomingRequestCfPropertiesExportedAuthenticatorMetadata 9771 + } 9772 + interface IncomingRequestCfPropertiesBotManagementBase { 9773 + /** 9774 + * Cloudflare’s [level of certainty](https://developers.cloudflare.com/bots/concepts/bot-score/) that a request comes from a bot, 9775 + * represented as an integer percentage between `1` (almost certainly a bot) and `99` (almost certainly human). 9776 + * 9777 + * @example 54 9778 + */ 9779 + score: number 9780 + /** 9781 + * A boolean value that is true if the request comes from a good bot, like Google or Bing. 9782 + * 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). 9783 + */ 9784 + verifiedBot: boolean 9785 + /** 9786 + * A boolean value that is true if the request originates from a 9787 + * Cloudflare-verified proxy service. 9788 + */ 9789 + corporateProxy: boolean 9790 + /** 9791 + * 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. 9792 + */ 9793 + staticResource: boolean 9794 + /** 9795 + * 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). 9796 + */ 9797 + detectionIds: number[] 9798 + } 9799 + interface IncomingRequestCfPropertiesBotManagement { 9800 + /** 9801 + * Results of Cloudflare's Bot Management analysis 9802 + */ 9803 + botManagement: IncomingRequestCfPropertiesBotManagementBase 9804 + /** 9805 + * Duplicate of `botManagement.score`. 9806 + * 9807 + * @deprecated 9808 + */ 9809 + clientTrustScore: number 9810 + } 9811 + interface IncomingRequestCfPropertiesBotManagementEnterprise extends IncomingRequestCfPropertiesBotManagement { 9812 + /** 9813 + * Results of Cloudflare's Bot Management analysis 9814 + */ 9815 + botManagement: IncomingRequestCfPropertiesBotManagementBase & { 9816 + /** 9817 + * A [JA3 Fingerprint](https://developers.cloudflare.com/bots/concepts/ja3-fingerprint/) to help profile specific SSL/TLS clients 9818 + * across different destination IPs, Ports, and X509 certificates. 9819 + */ 9820 + ja3Hash: string 9821 + } 9822 + } 9823 + interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<HostMetadata> { 9824 + /** 9825 + * Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/). 9826 + * 9827 + * This field is only present if you have Cloudflare for SaaS enabled on your account 9828 + * and you have followed the [required steps to enable it]((https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/)). 9829 + */ 9830 + hostMetadata?: HostMetadata 9831 + } 9832 + interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield { 9833 + /** 9834 + * Information about the client certificate presented to Cloudflare. 9835 + * 9836 + * This is populated when the incoming request is served over TLS using 9837 + * either Cloudflare Access or API Shield (mTLS) 9838 + * and the presented SSL certificate has a valid 9839 + * [Certificate Serial Number](https://ldapwiki.com/wiki/Certificate%20Serial%20Number) 9840 + * (i.e., not `null` or `""`). 9841 + * 9842 + * Otherwise, a set of placeholder values are used. 9843 + * 9844 + * The property `certPresented` will be set to `"1"` when 9845 + * the object is populated (i.e. the above conditions were met). 9846 + */ 9847 + tlsClientAuth: 9848 + | IncomingRequestCfPropertiesTLSClientAuth 9849 + | IncomingRequestCfPropertiesTLSClientAuthPlaceholder 9850 + } 9851 + /** 9852 + * Metadata about the request's TLS handshake 9853 + */ 9854 + interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata { 9855 + /** 9856 + * The client's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal 9857 + * 9858 + * @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d" 9859 + */ 9860 + clientHandshake: string 9861 + /** 9862 + * The server's [`HELLO` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.1.2), encoded in hexadecimal 9863 + * 9864 + * @example "44372ba35fa1270921d318f34c12f155dc87b682cf36a790cfaa3ba8737a1b5d" 9865 + */ 9866 + serverHandshake: string 9867 + /** 9868 + * The client's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal 9869 + * 9870 + * @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b" 9871 + */ 9872 + clientFinished: string 9873 + /** 9874 + * The server's [`FINISHED` message](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.9), encoded in hexadecimal 9875 + * 9876 + * @example "084ee802fe1348f688220e2a6040a05b2199a761f33cf753abb1b006792d3f8b" 9877 + */ 9878 + serverFinished: string 9879 + } 9880 + /** 9881 + * Geographic data about the request's origin. 9882 + */ 9883 + interface IncomingRequestCfPropertiesGeographicInformation { 9884 + /** 9885 + * The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from. 9886 + * 9887 + * 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. 9888 + * 9889 + * If Cloudflare is unable to determine where the request originated this property is omitted. 9890 + * 9891 + * The country code `"T1"` is used for requests originating on TOR. 9892 + * 9893 + * @example "GB" 9894 + */ 9895 + country?: Iso3166Alpha2Code | 'T1' 9896 + /** 9897 + * If present, this property indicates that the request originated in the EU 9898 + * 9899 + * @example "1" 9900 + */ 9901 + isEUCountry?: '1' 9902 + /** 9903 + * A two-letter code indicating the continent the request originated from. 9904 + * 9905 + * @example "AN" 9906 + */ 9907 + continent?: ContinentCode 9908 + /** 9909 + * The city the request originated from 9910 + * 9911 + * @example "Austin" 9912 + */ 9913 + city?: string 9914 + /** 9915 + * Postal code of the incoming request 9916 + * 9917 + * @example "78701" 9918 + */ 9919 + postalCode?: string 9920 + /** 9921 + * Latitude of the incoming request 9922 + * 9923 + * @example "30.27130" 9924 + */ 9925 + latitude?: string 9926 + /** 9927 + * Longitude of the incoming request 9928 + * 9929 + * @example "-97.74260" 9930 + */ 9931 + longitude?: string 9932 + /** 9933 + * Timezone of the incoming request 9934 + * 9935 + * @example "America/Chicago" 9936 + */ 9937 + timezone?: string 9938 + /** 9939 + * If known, the ISO 3166-2 name for the first level region associated with 9940 + * the IP address of the incoming request 9941 + * 9942 + * @example "Texas" 9943 + */ 9944 + region?: string 9945 + /** 9946 + * If known, the ISO 3166-2 code for the first-level region associated with 9947 + * the IP address of the incoming request 9948 + * 9949 + * @example "TX" 9950 + */ 9951 + regionCode?: string 9952 + /** 9953 + * Metro code (DMA) of the incoming request 9954 + * 9955 + * @example "635" 9956 + */ 9957 + metroCode?: string 9958 + } 9959 + /** Data about the incoming request's TLS certificate */ 9960 + interface IncomingRequestCfPropertiesTLSClientAuth { 9961 + /** Always `"1"`, indicating that the certificate was presented */ 9962 + certPresented: '1' 9963 + /** 9964 + * Result of certificate verification. 9965 + * 9966 + * @example "FAILED:self signed certificate" 9967 + */ 9968 + certVerified: Exclude<CertVerificationStatus, 'NONE'> 9969 + /** The presented certificate's revokation status. 9970 + * 9971 + * - A value of `"1"` indicates the certificate has been revoked 9972 + * - A value of `"0"` indicates the certificate has not been revoked 9973 + */ 9974 + certRevoked: '1' | '0' 9975 + /** 9976 + * The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) 9977 + * 9978 + * @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare" 9979 + */ 9980 + certIssuerDN: string 9981 + /** 9982 + * The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) 9983 + * 9984 + * @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare" 9985 + */ 9986 + certSubjectDN: string 9987 + /** 9988 + * The certificate issuer's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted) 9989 + * 9990 + * @example "CN=cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare" 9991 + */ 9992 + certIssuerDNRFC2253: string 9993 + /** 9994 + * The certificate subject's [distinguished name](https://knowledge.digicert.com/generalinformation/INFO1745.html) ([RFC 2253](https://www.rfc-editor.org/rfc/rfc2253.html) formatted) 9995 + * 9996 + * @example "CN=*.cloudflareaccess.com, C=US, ST=Texas, L=Austin, O=Cloudflare" 9997 + */ 9998 + certSubjectDNRFC2253: string 9999 + /** The certificate issuer's distinguished name (legacy policies) */ 10000 + certIssuerDNLegacy: string 10001 + /** The certificate subject's distinguished name (legacy policies) */ 10002 + certSubjectDNLegacy: string 10003 + /** 10004 + * The certificate's serial number 10005 + * 10006 + * @example "00936EACBE07F201DF" 10007 + */ 10008 + certSerial: string 10009 + /** 10010 + * The certificate issuer's serial number 10011 + * 10012 + * @example "2489002934BDFEA34" 10013 + */ 10014 + certIssuerSerial: string 10015 + /** 10016 + * The certificate's Subject Key Identifier 10017 + * 10018 + * @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4" 10019 + */ 10020 + certSKI: string 10021 + /** 10022 + * The certificate issuer's Subject Key Identifier 10023 + * 10024 + * @example "BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4" 10025 + */ 10026 + certIssuerSKI: string 10027 + /** 10028 + * The certificate's SHA-1 fingerprint 10029 + * 10030 + * @example "6b9109f323999e52259cda7373ff0b4d26bd232e" 10031 + */ 10032 + certFingerprintSHA1: string 10033 + /** 10034 + * The certificate's SHA-256 fingerprint 10035 + * 10036 + * @example "acf77cf37b4156a2708e34c4eb755f9b5dbbe5ebb55adfec8f11493438d19e6ad3f157f81fa3b98278453d5652b0c1fd1d71e5695ae4d709803a4d3f39de9dea" 10037 + */ 10038 + certFingerprintSHA256: string 10039 + /** 10040 + * The effective starting date of the certificate 10041 + * 10042 + * @example "Dec 22 19:39:00 2018 GMT" 10043 + */ 10044 + certNotBefore: string 10045 + /** 10046 + * The effective expiration date of the certificate 10047 + * 10048 + * @example "Dec 22 19:39:00 2018 GMT" 10049 + */ 10050 + certNotAfter: string 10051 + } 10052 + /** Placeholder values for TLS Client Authorization */ 10053 + interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder { 10054 + certPresented: '0' 10055 + certVerified: 'NONE' 10056 + certRevoked: '0' 10057 + certIssuerDN: '' 10058 + certSubjectDN: '' 10059 + certIssuerDNRFC2253: '' 10060 + certSubjectDNRFC2253: '' 10061 + certIssuerDNLegacy: '' 10062 + certSubjectDNLegacy: '' 10063 + certSerial: '' 10064 + certIssuerSerial: '' 10065 + certSKI: '' 10066 + certIssuerSKI: '' 10067 + certFingerprintSHA1: '' 10068 + certFingerprintSHA256: '' 10069 + certNotBefore: '' 10070 + certNotAfter: '' 10071 + } 10072 + /** Possible outcomes of TLS verification */ 10073 + declare type CertVerificationStatus = 10074 + /** Authentication succeeded */ 10075 + | 'SUCCESS' 10076 + /** No certificate was presented */ 10077 + | 'NONE' 10078 + /** Failed because the certificate was self-signed */ 10079 + | 'FAILED:self signed certificate' 10080 + /** Failed because the certificate failed a trust chain check */ 10081 + | 'FAILED:unable to verify the first certificate' 10082 + /** Failed because the certificate not yet valid */ 10083 + | 'FAILED:certificate is not yet valid' 10084 + /** Failed because the certificate is expired */ 10085 + | 'FAILED:certificate has expired' 10086 + /** Failed for another unspecified reason */ 10087 + | 'FAILED' 10088 + /** 10089 + * An upstream endpoint's response to a TCP `keepalive` message from Cloudflare. 10090 + */ 10091 + declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus = 10092 + | 0 /** Unknown */ 10093 + | 1 /** no keepalives (not found) */ 10094 + | 2 /** no connection re-use, opening keepalive connection failed */ 10095 + | 3 /** no connection re-use, keepalive accepted and saved */ 10096 + | 4 /** connection re-use, refused by the origin server (`TCP FIN`) */ 10097 + | 5 /** connection re-use, accepted by the origin server */ 10098 + /** ISO 3166-1 Alpha-2 codes */ 10099 + declare type Iso3166Alpha2Code = 10100 + | 'AD' 10101 + | 'AE' 10102 + | 'AF' 10103 + | 'AG' 10104 + | 'AI' 10105 + | 'AL' 10106 + | 'AM' 10107 + | 'AO' 10108 + | 'AQ' 10109 + | 'AR' 10110 + | 'AS' 10111 + | 'AT' 10112 + | 'AU' 10113 + | 'AW' 10114 + | 'AX' 10115 + | 'AZ' 10116 + | 'BA' 10117 + | 'BB' 10118 + | 'BD' 10119 + | 'BE' 10120 + | 'BF' 10121 + | 'BG' 10122 + | 'BH' 10123 + | 'BI' 10124 + | 'BJ' 10125 + | 'BL' 10126 + | 'BM' 10127 + | 'BN' 10128 + | 'BO' 10129 + | 'BQ' 10130 + | 'BR' 10131 + | 'BS' 10132 + | 'BT' 10133 + | 'BV' 10134 + | 'BW' 10135 + | 'BY' 10136 + | 'BZ' 10137 + | 'CA' 10138 + | 'CC' 10139 + | 'CD' 10140 + | 'CF' 10141 + | 'CG' 10142 + | 'CH' 10143 + | 'CI' 10144 + | 'CK' 10145 + | 'CL' 10146 + | 'CM' 10147 + | 'CN' 10148 + | 'CO' 10149 + | 'CR' 10150 + | 'CU' 10151 + | 'CV' 10152 + | 'CW' 10153 + | 'CX' 10154 + | 'CY' 10155 + | 'CZ' 10156 + | 'DE' 10157 + | 'DJ' 10158 + | 'DK' 10159 + | 'DM' 10160 + | 'DO' 10161 + | 'DZ' 10162 + | 'EC' 10163 + | 'EE' 10164 + | 'EG' 10165 + | 'EH' 10166 + | 'ER' 10167 + | 'ES' 10168 + | 'ET' 10169 + | 'FI' 10170 + | 'FJ' 10171 + | 'FK' 10172 + | 'FM' 10173 + | 'FO' 10174 + | 'FR' 10175 + | 'GA' 10176 + | 'GB' 10177 + | 'GD' 10178 + | 'GE' 10179 + | 'GF' 10180 + | 'GG' 10181 + | 'GH' 10182 + | 'GI' 10183 + | 'GL' 10184 + | 'GM' 10185 + | 'GN' 10186 + | 'GP' 10187 + | 'GQ' 10188 + | 'GR' 10189 + | 'GS' 10190 + | 'GT' 10191 + | 'GU' 10192 + | 'GW' 10193 + | 'GY' 10194 + | 'HK' 10195 + | 'HM' 10196 + | 'HN' 10197 + | 'HR' 10198 + | 'HT' 10199 + | 'HU' 10200 + | 'ID' 10201 + | 'IE' 10202 + | 'IL' 10203 + | 'IM' 10204 + | 'IN' 10205 + | 'IO' 10206 + | 'IQ' 10207 + | 'IR' 10208 + | 'IS' 10209 + | 'IT' 10210 + | 'JE' 10211 + | 'JM' 10212 + | 'JO' 10213 + | 'JP' 10214 + | 'KE' 10215 + | 'KG' 10216 + | 'KH' 10217 + | 'KI' 10218 + | 'KM' 10219 + | 'KN' 10220 + | 'KP' 10221 + | 'KR' 10222 + | 'KW' 10223 + | 'KY' 10224 + | 'KZ' 10225 + | 'LA' 10226 + | 'LB' 10227 + | 'LC' 10228 + | 'LI' 10229 + | 'LK' 10230 + | 'LR' 10231 + | 'LS' 10232 + | 'LT' 10233 + | 'LU' 10234 + | 'LV' 10235 + | 'LY' 10236 + | 'MA' 10237 + | 'MC' 10238 + | 'MD' 10239 + | 'ME' 10240 + | 'MF' 10241 + | 'MG' 10242 + | 'MH' 10243 + | 'MK' 10244 + | 'ML' 10245 + | 'MM' 10246 + | 'MN' 10247 + | 'MO' 10248 + | 'MP' 10249 + | 'MQ' 10250 + | 'MR' 10251 + | 'MS' 10252 + | 'MT' 10253 + | 'MU' 10254 + | 'MV' 10255 + | 'MW' 10256 + | 'MX' 10257 + | 'MY' 10258 + | 'MZ' 10259 + | 'NA' 10260 + | 'NC' 10261 + | 'NE' 10262 + | 'NF' 10263 + | 'NG' 10264 + | 'NI' 10265 + | 'NL' 10266 + | 'NO' 10267 + | 'NP' 10268 + | 'NR' 10269 + | 'NU' 10270 + | 'NZ' 10271 + | 'OM' 10272 + | 'PA' 10273 + | 'PE' 10274 + | 'PF' 10275 + | 'PG' 10276 + | 'PH' 10277 + | 'PK' 10278 + | 'PL' 10279 + | 'PM' 10280 + | 'PN' 10281 + | 'PR' 10282 + | 'PS' 10283 + | 'PT' 10284 + | 'PW' 10285 + | 'PY' 10286 + | 'QA' 10287 + | 'RE' 10288 + | 'RO' 10289 + | 'RS' 10290 + | 'RU' 10291 + | 'RW' 10292 + | 'SA' 10293 + | 'SB' 10294 + | 'SC' 10295 + | 'SD' 10296 + | 'SE' 10297 + | 'SG' 10298 + | 'SH' 10299 + | 'SI' 10300 + | 'SJ' 10301 + | 'SK' 10302 + | 'SL' 10303 + | 'SM' 10304 + | 'SN' 10305 + | 'SO' 10306 + | 'SR' 10307 + | 'SS' 10308 + | 'ST' 10309 + | 'SV' 10310 + | 'SX' 10311 + | 'SY' 10312 + | 'SZ' 10313 + | 'TC' 10314 + | 'TD' 10315 + | 'TF' 10316 + | 'TG' 10317 + | 'TH' 10318 + | 'TJ' 10319 + | 'TK' 10320 + | 'TL' 10321 + | 'TM' 10322 + | 'TN' 10323 + | 'TO' 10324 + | 'TR' 10325 + | 'TT' 10326 + | 'TV' 10327 + | 'TW' 10328 + | 'TZ' 10329 + | 'UA' 10330 + | 'UG' 10331 + | 'UM' 10332 + | 'US' 10333 + | 'UY' 10334 + | 'UZ' 10335 + | 'VA' 10336 + | 'VC' 10337 + | 'VE' 10338 + | 'VG' 10339 + | 'VI' 10340 + | 'VN' 10341 + | 'VU' 10342 + | 'WF' 10343 + | 'WS' 10344 + | 'YE' 10345 + | 'YT' 10346 + | 'ZA' 10347 + | 'ZM' 10348 + | 'ZW' 10349 + /** The 2-letter continent codes Cloudflare uses */ 10350 + declare type ContinentCode = 'AF' | 'AN' | 'AS' | 'EU' | 'NA' | 'OC' | 'SA' 10351 + type CfProperties<HostMetadata = unknown> = 10352 + | IncomingRequestCfProperties<HostMetadata> 10353 + | RequestInitCfProperties 10354 + interface D1Meta { 10355 + duration: number 10356 + size_after: number 10357 + rows_read: number 10358 + rows_written: number 10359 + last_row_id: number 10360 + changed_db: boolean 10361 + changes: number 10362 + /** 10363 + * The region of the database instance that executed the query. 10364 + */ 10365 + served_by_region?: string 10366 + /** 10367 + * True if-and-only-if the database instance that executed the query was the primary. 10368 + */ 10369 + served_by_primary?: boolean 10370 + timings?: { 10371 + /** 10372 + * The duration of the SQL query execution by the database instance. It doesn't include any network time. 10373 + */ 10374 + sql_duration_ms: number 10375 + } 10376 + /** 10377 + * Number of total attempts to execute the query, due to automatic retries. 10378 + * Note: All other fields in the response like `timings` only apply to the last attempt. 10379 + */ 10380 + total_attempts?: number 10381 + } 10382 + interface D1Response { 10383 + success: true 10384 + meta: D1Meta & Record<string, unknown> 10385 + error?: never 10386 + } 10387 + type D1Result<T = unknown> = D1Response & { 10388 + results: T[] 10389 + } 10390 + interface D1ExecResult { 10391 + count: number 10392 + duration: number 10393 + } 10394 + type D1SessionConstraint = 10395 + // Indicates that the first query should go to the primary, and the rest queries 10396 + // using the same D1DatabaseSession will go to any replica that is consistent with 10397 + // the bookmark maintained by the session (returned by the first query). 10398 + | 'first-primary' 10399 + // Indicates that the first query can go anywhere (primary or replica), and the rest queries 10400 + // using the same D1DatabaseSession will go to any replica that is consistent with 10401 + // the bookmark maintained by the session (returned by the first query). 10402 + | 'first-unconstrained' 10403 + type D1SessionBookmark = string 10404 + declare abstract class D1Database { 10405 + prepare(query: string): D1PreparedStatement 10406 + batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]> 10407 + exec(query: string): Promise<D1ExecResult> 10408 + /** 10409 + * Creates a new D1 Session anchored at the given constraint or the bookmark. 10410 + * All queries executed using the created session will have sequential consistency, 10411 + * meaning that all writes done through the session will be visible in subsequent reads. 10412 + * 10413 + * @param constraintOrBookmark Either the session constraint or the explicit bookmark to anchor the created session. 10414 + */ 10415 + withSession(constraintOrBookmark?: D1SessionBookmark | D1SessionConstraint): D1DatabaseSession 10416 + /** 10417 + * @deprecated dump() will be removed soon, only applies to deprecated alpha v1 databases. 10418 + */ 10419 + dump(): Promise<ArrayBuffer> 10420 + } 10421 + declare abstract class D1DatabaseSession { 10422 + prepare(query: string): D1PreparedStatement 10423 + batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]> 10424 + /** 10425 + * @returns The latest session bookmark across all executed queries on the session. 10426 + * If no query has been executed yet, `null` is returned. 10427 + */ 10428 + getBookmark(): D1SessionBookmark | null 10429 + } 10430 + declare abstract class D1PreparedStatement { 10431 + bind(...values: unknown[]): D1PreparedStatement 10432 + first<T = unknown>(colName: string): Promise<T | null> 10433 + first<T = Record<string, unknown>>(): Promise<T | null> 10434 + run<T = Record<string, unknown>>(): Promise<D1Result<T>> 10435 + all<T = Record<string, unknown>>(): Promise<D1Result<T>> 10436 + raw<T = unknown[]>(options: { columnNames: true }): Promise<[string[], ...T[]]> 10437 + raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]> 10438 + } 10439 + // `Disposable` was added to TypeScript's standard lib types in version 5.2. 10440 + // To support older TypeScript versions, define an empty `Disposable` interface. 10441 + // Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2, 10442 + // but this will ensure type checking on older versions still passes. 10443 + // TypeScript's interface merging will ensure our empty interface is effectively 10444 + // ignored when `Disposable` is included in the standard lib. 10445 + interface Disposable {} 10446 + /** 10447 + * An email message that can be sent from a Worker. 10448 + */ 10449 + interface EmailMessage { 10450 + /** 10451 + * Envelope From attribute of the email message. 10452 + */ 10453 + readonly from: string 10454 + /** 10455 + * Envelope To attribute of the email message. 10456 + */ 10457 + readonly to: string 10458 + } 10459 + /** 10460 + * An email message that is sent to a consumer Worker and can be rejected/forwarded. 10461 + */ 10462 + interface ForwardableEmailMessage extends EmailMessage { 10463 + /** 10464 + * Stream of the email message content. 10465 + */ 10466 + readonly raw: ReadableStream<Uint8Array> 10467 + /** 10468 + * An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers). 10469 + */ 10470 + readonly headers: Headers 10471 + /** 10472 + * Size of the email message content. 10473 + */ 10474 + readonly rawSize: number 10475 + /** 10476 + * Reject this email message by returning a permanent SMTP error back to the connecting client including the given reason. 10477 + * @param reason The reject reason. 10478 + * @returns void 10479 + */ 10480 + setReject(reason: string): void 10481 + /** 10482 + * Forward this email message to a verified destination address of the account. 10483 + * @param rcptTo Verified destination address. 10484 + * @param headers A [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers). 10485 + * @returns A promise that resolves when the email message is forwarded. 10486 + */ 10487 + forward(rcptTo: string, headers?: Headers): Promise<void> 10488 + /** 10489 + * Reply to the sender of this email message with a new EmailMessage object. 10490 + * @param message The reply message. 10491 + * @returns A promise that resolves when the email message is replied. 10492 + */ 10493 + reply(message: EmailMessage): Promise<void> 10494 + } 10495 + /** 10496 + * A binding that allows a Worker to send email messages. 10497 + */ 10498 + interface SendEmail { 10499 + send(message: EmailMessage): Promise<void> 10500 + } 10501 + declare abstract class EmailEvent extends ExtendableEvent { 10502 + readonly message: ForwardableEmailMessage 10503 + } 10504 + declare type EmailExportedHandler<Env = unknown> = ( 10505 + message: ForwardableEmailMessage, 10506 + env: Env, 10507 + ctx: ExecutionContext, 10508 + ) => void | Promise<void> 10509 + declare module 'cloudflare:email' { 10510 + let _EmailMessage: { 10511 + prototype: EmailMessage 10512 + new (from: string, to: string, raw: ReadableStream | string): EmailMessage 10513 + } 10514 + export { _EmailMessage as EmailMessage } 10515 + } 10516 + /** 10517 + * Hello World binding to serve as an explanatory example. DO NOT USE 10518 + */ 10519 + interface HelloWorldBinding { 10520 + /** 10521 + * Retrieve the current stored value 10522 + */ 10523 + get(): Promise<{ 10524 + value: string 10525 + ms?: number 10526 + }> 10527 + /** 10528 + * Set a new stored value 10529 + */ 10530 + set(value: string): Promise<void> 10531 + } 10532 + interface Hyperdrive { 10533 + /** 10534 + * Connect directly to Hyperdrive as if it's your database, returning a TCP socket. 10535 + * 10536 + * Calling this method returns an idential socket to if you call 10537 + * `connect("host:port")` using the `host` and `port` fields from this object. 10538 + * Pick whichever approach works better with your preferred DB client library. 10539 + * 10540 + * Note that this socket is not yet authenticated -- it's expected that your 10541 + * code (or preferably, the client library of your choice) will authenticate 10542 + * using the information in this class's readonly fields. 10543 + */ 10544 + connect(): Socket 10545 + /** 10546 + * A valid DB connection string that can be passed straight into the typical 10547 + * client library/driver/ORM. This will typically be the easiest way to use 10548 + * Hyperdrive. 10549 + */ 10550 + readonly connectionString: string 10551 + /* 10552 + * A randomly generated hostname that is only valid within the context of the 10553 + * currently running Worker which, when passed into `connect()` function from 10554 + * the "cloudflare:sockets" module, will connect to the Hyperdrive instance 10555 + * for your database. 10556 + */ 10557 + readonly host: string 10558 + /* 10559 + * The port that must be paired the the host field when connecting. 10560 + */ 10561 + readonly port: number 10562 + /* 10563 + * The username to use when authenticating to your database via Hyperdrive. 10564 + * Unlike the host and password, this will be the same every time 10565 + */ 10566 + readonly user: string 10567 + /* 10568 + * The randomly generated password to use when authenticating to your 10569 + * database via Hyperdrive. Like the host field, this password is only valid 10570 + * within the context of the currently running Worker instance from which 10571 + * it's read. 10572 + */ 10573 + readonly password: string 10574 + /* 10575 + * The name of the database to connect to. 10576 + */ 10577 + readonly database: string 10578 + } 10579 + // Copyright (c) 2024 Cloudflare, Inc. 10580 + // Licensed under the Apache 2.0 license found in the LICENSE file or at: 10581 + // https://opensource.org/licenses/Apache-2.0 10582 + type ImageInfoResponse = 10583 + | { 10584 + format: 'image/svg+xml' 10585 + } 10586 + | { 10587 + format: string 10588 + fileSize: number 10589 + width: number 10590 + height: number 10591 + } 10592 + type ImageTransform = { 10593 + width?: number 10594 + height?: number 10595 + background?: string 10596 + blur?: number 10597 + border?: 10598 + | { 10599 + color?: string 10600 + width?: number 10601 + } 10602 + | { 10603 + top?: number 10604 + bottom?: number 10605 + left?: number 10606 + right?: number 10607 + } 10608 + brightness?: number 10609 + contrast?: number 10610 + fit?: 'scale-down' | 'contain' | 'pad' | 'squeeze' | 'cover' | 'crop' 10611 + flip?: 'h' | 'v' | 'hv' 10612 + gamma?: number 10613 + segment?: 'foreground' 10614 + gravity?: 10615 + | 'face' 10616 + | 'left' 10617 + | 'right' 10618 + | 'top' 10619 + | 'bottom' 10620 + | 'center' 10621 + | 'auto' 10622 + | 'entropy' 10623 + | { 10624 + x?: number 10625 + y?: number 10626 + mode: 'remainder' | 'box-center' 10627 + } 10628 + rotate?: 0 | 90 | 180 | 270 10629 + saturation?: number 10630 + sharpen?: number 10631 + trim?: 10632 + | 'border' 10633 + | { 10634 + top?: number 10635 + bottom?: number 10636 + left?: number 10637 + right?: number 10638 + width?: number 10639 + height?: number 10640 + border?: 10641 + | boolean 10642 + | { 10643 + color?: string 10644 + tolerance?: number 10645 + keep?: number 10646 + } 10647 + } 10648 + } 10649 + type ImageDrawOptions = { 10650 + opacity?: number 10651 + repeat?: boolean | string 10652 + top?: number 10653 + left?: number 10654 + bottom?: number 10655 + right?: number 10656 + } 10657 + type ImageInputOptions = { 10658 + encoding?: 'base64' 10659 + } 10660 + type ImageOutputOptions = { 10661 + format: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/avif' | 'rgb' | 'rgba' 10662 + quality?: number 10663 + background?: string 10664 + anim?: boolean 10665 + } 10666 + interface ImagesBinding { 10667 + /** 10668 + * Get image metadata (type, width and height) 10669 + * @throws {@link ImagesError} with code 9412 if input is not an image 10670 + * @param stream The image bytes 10671 + */ 10672 + info(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): Promise<ImageInfoResponse> 10673 + /** 10674 + * Begin applying a series of transformations to an image 10675 + * @param stream The image bytes 10676 + * @returns A transform handle 10677 + */ 10678 + input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer 10679 + } 10680 + interface ImageTransformer { 10681 + /** 10682 + * Apply transform next, returning a transform handle. 10683 + * You can then apply more transformations, draw, or retrieve the output. 10684 + * @param transform 10685 + */ 10686 + transform(transform: ImageTransform): ImageTransformer 10687 + /** 10688 + * Draw an image on this transformer, returning a transform handle. 10689 + * You can then apply more transformations, draw, or retrieve the output. 10690 + * @param image The image (or transformer that will give the image) to draw 10691 + * @param options The options configuring how to draw the image 10692 + */ 10693 + draw( 10694 + image: ReadableStream<Uint8Array> | ImageTransformer, 10695 + options?: ImageDrawOptions, 10696 + ): ImageTransformer 10697 + /** 10698 + * Retrieve the image that results from applying the transforms to the 10699 + * provided input 10700 + * @param options Options that apply to the output e.g. output format 10701 + */ 10702 + output(options: ImageOutputOptions): Promise<ImageTransformationResult> 10703 + } 10704 + type ImageTransformationOutputOptions = { 10705 + encoding?: 'base64' 10706 + } 10707 + interface ImageTransformationResult { 10708 + /** 10709 + * The image as a response, ready to store in cache or return to users 10710 + */ 10711 + response(): Response 10712 + /** 10713 + * The content type of the returned image 10714 + */ 10715 + contentType(): string 10716 + /** 10717 + * The bytes of the response 10718 + */ 10719 + image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array> 10720 + } 10721 + interface ImagesError extends Error { 10722 + readonly code: number 10723 + readonly message: string 10724 + readonly stack?: string 10725 + } 10726 + /** 10727 + * Media binding for transforming media streams. 10728 + * Provides the entry point for media transformation operations. 10729 + */ 10730 + interface MediaBinding { 10731 + /** 10732 + * Creates a media transformer from an input stream. 10733 + * @param media - The input media bytes 10734 + * @returns A MediaTransformer instance for applying transformations 10735 + */ 10736 + input(media: ReadableStream<Uint8Array>): MediaTransformer 10737 + } 10738 + /** 10739 + * Media transformer for applying transformation operations to media content. 10740 + * Handles sizing, fitting, and other input transformation parameters. 10741 + */ 10742 + interface MediaTransformer { 10743 + /** 10744 + * Applies transformation options to the media content. 10745 + * @param transform - Configuration for how the media should be transformed 10746 + * @returns A generator for producing the transformed media output 10747 + */ 10748 + transform(transform: MediaTransformationInputOptions): MediaTransformationGenerator 10749 + } 10750 + /** 10751 + * Generator for producing media transformation results. 10752 + * Configures the output format and parameters for the transformed media. 10753 + */ 10754 + interface MediaTransformationGenerator { 10755 + /** 10756 + * Generates the final media output with specified options. 10757 + * @param output - Configuration for the output format and parameters 10758 + * @returns The final transformation result containing the transformed media 10759 + */ 10760 + output(output: MediaTransformationOutputOptions): MediaTransformationResult 10761 + } 10762 + /** 10763 + * Result of a media transformation operation. 10764 + * Provides multiple ways to access the transformed media content. 10765 + */ 10766 + interface MediaTransformationResult { 10767 + /** 10768 + * Returns the transformed media as a readable stream of bytes. 10769 + * @returns A stream containing the transformed media data 10770 + */ 10771 + media(): ReadableStream<Uint8Array> 10772 + /** 10773 + * Returns the transformed media as an HTTP response object. 10774 + * @returns The transformed media as a Response, ready to store in cache or return to users 10775 + */ 10776 + response(): Response 10777 + /** 10778 + * Returns the MIME type of the transformed media. 10779 + * @returns The content type string (e.g., 'image/jpeg', 'video/mp4') 10780 + */ 10781 + contentType(): string 10782 + } 10783 + /** 10784 + * Configuration options for transforming media input. 10785 + * Controls how the media should be resized and fitted. 10786 + */ 10787 + type MediaTransformationInputOptions = { 10788 + /** How the media should be resized to fit the specified dimensions */ 10789 + fit?: 'contain' | 'cover' | 'scale-down' 10790 + /** Target width in pixels */ 10791 + width?: number 10792 + /** Target height in pixels */ 10793 + height?: number 10794 + } 10795 + /** 10796 + * Configuration options for Media Transformations output. 10797 + * Controls the format, timing, and type of the generated output. 10798 + */ 10799 + type MediaTransformationOutputOptions = { 10800 + /** 10801 + * Output mode determining the type of media to generate 10802 + */ 10803 + mode?: 'video' | 'spritesheet' | 'frame' | 'audio' 10804 + /** Whether to include audio in the output */ 10805 + audio?: boolean 10806 + /** 10807 + * Starting timestamp for frame extraction or start time for clips. (e.g. '2s'). 10808 + */ 10809 + time?: string 10810 + /** 10811 + * Duration for video clips, audio extraction, and spritesheet generation (e.g. '5s'). 10812 + */ 10813 + duration?: string 10814 + /** 10815 + * Number of frames in the spritesheet. 10816 + */ 10817 + imageCount?: number 10818 + /** 10819 + * Output format for the generated media. 10820 + */ 10821 + format?: 'jpg' | 'png' | 'm4a' 10822 + } 10823 + /** 10824 + * Error object for media transformation operations. 10825 + * Extends the standard Error interface with additional media-specific information. 10826 + */ 10827 + interface MediaError extends Error { 10828 + readonly code: number 10829 + readonly message: string 10830 + readonly stack?: string 10831 + } 10832 + declare module 'cloudflare:node' { 10833 + interface NodeStyleServer { 10834 + listen(...args: unknown[]): this 10835 + address(): { 10836 + port?: number | null | undefined 10837 + } 10838 + } 10839 + export function httpServerHandler(port: number): ExportedHandler 10840 + export function httpServerHandler(options: { port: number }): ExportedHandler 10841 + export function httpServerHandler(server: NodeStyleServer): ExportedHandler 10842 + } 10843 + type Params<P extends string = any> = Record<P, string | string[]> 10844 + type EventContext<Env, P extends string, Data> = { 10845 + request: Request<unknown, IncomingRequestCfProperties<unknown>> 10846 + functionPath: string 10847 + waitUntil: (promise: Promise<any>) => void 10848 + passThroughOnException: () => void 10849 + next: (input?: Request | string, init?: RequestInit) => Promise<Response> 10850 + env: Env & { 10851 + ASSETS: { 10852 + fetch: typeof fetch 10853 + } 10854 + } 10855 + params: Params<P> 10856 + data: Data 10857 + } 10858 + type PagesFunction< 10859 + Env = unknown, 10860 + Params extends string = any, 10861 + Data extends Record<string, unknown> = Record<string, unknown>, 10862 + > = (context: EventContext<Env, Params, Data>) => Response | Promise<Response> 10863 + type EventPluginContext<Env, P extends string, Data, PluginArgs> = { 10864 + request: Request<unknown, IncomingRequestCfProperties<unknown>> 10865 + functionPath: string 10866 + waitUntil: (promise: Promise<any>) => void 10867 + passThroughOnException: () => void 10868 + next: (input?: Request | string, init?: RequestInit) => Promise<Response> 10869 + env: Env & { 10870 + ASSETS: { 10871 + fetch: typeof fetch 10872 + } 10873 + } 10874 + params: Params<P> 10875 + data: Data 10876 + pluginArgs: PluginArgs 10877 + } 10878 + type PagesPluginFunction< 10879 + Env = unknown, 10880 + Params extends string = any, 10881 + Data extends Record<string, unknown> = Record<string, unknown>, 10882 + PluginArgs = unknown, 10883 + > = (context: EventPluginContext<Env, Params, Data, PluginArgs>) => Response | Promise<Response> 10884 + declare module 'assets:*' { 10885 + export const onRequest: PagesFunction 10886 + } 10887 + // Copyright (c) 2022-2023 Cloudflare, Inc. 10888 + // Licensed under the Apache 2.0 license found in the LICENSE file or at: 10889 + // https://opensource.org/licenses/Apache-2.0 10890 + declare module 'cloudflare:pipelines' { 10891 + export abstract class PipelineTransformationEntrypoint< 10892 + Env = unknown, 10893 + I extends PipelineRecord = PipelineRecord, 10894 + O extends PipelineRecord = PipelineRecord, 10895 + > { 10896 + protected env: Env 10897 + protected ctx: ExecutionContext 10898 + constructor(ctx: ExecutionContext, env: Env) 10899 + /** 10900 + * run recieves an array of PipelineRecord which can be 10901 + * transformed and returned to the pipeline 10902 + * @param records Incoming records from the pipeline to be transformed 10903 + * @param metadata Information about the specific pipeline calling the transformation entrypoint 10904 + * @returns A promise containing the transformed PipelineRecord array 10905 + */ 10906 + public run(records: I[], metadata: PipelineBatchMetadata): Promise<O[]> 10907 + } 10908 + export type PipelineRecord = Record<string, unknown> 10909 + export type PipelineBatchMetadata = { 10910 + pipelineId: string 10911 + pipelineName: string 10912 + } 10913 + export interface Pipeline<T extends PipelineRecord = PipelineRecord> { 10914 + /** 10915 + * The Pipeline interface represents the type of a binding to a Pipeline 10916 + * 10917 + * @param records The records to send to the pipeline 10918 + */ 10919 + send(records: T[]): Promise<void> 10920 + } 10921 + } 10922 + // PubSubMessage represents an incoming PubSub message. 10923 + // The message includes metadata about the broker, the client, and the payload 10924 + // itself. 10925 + // https://developers.cloudflare.com/pub-sub/ 10926 + interface PubSubMessage { 10927 + // Message ID 10928 + readonly mid: number 10929 + // MQTT broker FQDN in the form mqtts://BROKER.NAMESPACE.cloudflarepubsub.com:PORT 10930 + readonly broker: string 10931 + // The MQTT topic the message was sent on. 10932 + readonly topic: string 10933 + // The client ID of the client that published this message. 10934 + readonly clientId: string 10935 + // The unique identifier (JWT ID) used by the client to authenticate, if token 10936 + // auth was used. 10937 + readonly jti?: string 10938 + // A Unix timestamp (seconds from Jan 1, 1970), set when the Pub/Sub Broker 10939 + // received the message from the client. 10940 + readonly receivedAt: number 10941 + // An (optional) string with the MIME type of the payload, if set by the 10942 + // client. 10943 + readonly contentType: string 10944 + // Set to 1 when the payload is a UTF-8 string 10945 + // https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901063 10946 + readonly payloadFormatIndicator: number 10947 + // Pub/Sub (MQTT) payloads can be UTF-8 strings, or byte arrays. 10948 + // You can use payloadFormatIndicator to inspect this before decoding. 10949 + payload: string | Uint8Array 10950 + } 10951 + // JsonWebKey extended by kid parameter 10952 + interface JsonWebKeyWithKid extends JsonWebKey { 10953 + // Key Identifier of the JWK 10954 + readonly kid: string 10955 + } 10956 + interface RateLimitOptions { 10957 + key: string 10958 + } 10959 + interface RateLimitOutcome { 10960 + success: boolean 10961 + } 10962 + interface RateLimit { 10963 + /** 10964 + * Rate limit a request based on the provided options. 10965 + * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/ 10966 + * @returns A promise that resolves with the outcome of the rate limit. 10967 + */ 10968 + limit(options: RateLimitOptions): Promise<RateLimitOutcome> 10969 + } 10970 + // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need 10971 + // to referenced by `Fetcher`. This is included in the "importable" version of the types which 10972 + // strips all `module` blocks. 10973 + declare namespace Rpc { 10974 + // Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s. 10975 + // TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`. 10976 + // For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to 10977 + // accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape) 10978 + export const __RPC_STUB_BRAND: '__RPC_STUB_BRAND' 10979 + export const __RPC_TARGET_BRAND: '__RPC_TARGET_BRAND' 10980 + export const __WORKER_ENTRYPOINT_BRAND: '__WORKER_ENTRYPOINT_BRAND' 10981 + export const __DURABLE_OBJECT_BRAND: '__DURABLE_OBJECT_BRAND' 10982 + export const __WORKFLOW_ENTRYPOINT_BRAND: '__WORKFLOW_ENTRYPOINT_BRAND' 10983 + export interface RpcTargetBranded { 10984 + [__RPC_TARGET_BRAND]: never 10985 + } 10986 + export interface WorkerEntrypointBranded { 10987 + [__WORKER_ENTRYPOINT_BRAND]: never 10988 + } 10989 + export interface DurableObjectBranded { 10990 + [__DURABLE_OBJECT_BRAND]: never 10991 + } 10992 + export interface WorkflowEntrypointBranded { 10993 + [__WORKFLOW_ENTRYPOINT_BRAND]: never 10994 + } 10995 + export type EntrypointBranded = 10996 + | WorkerEntrypointBranded 10997 + | DurableObjectBranded 10998 + | WorkflowEntrypointBranded 10999 + // Types that can be used through `Stub`s 11000 + export type Stubable = RpcTargetBranded | ((...args: any[]) => any) 11001 + // Types that can be passed over RPC 11002 + // The reason for using a generic type here is to build a serializable subset of structured 11003 + // cloneable composite types. This allows types defined with the "interface" keyword to pass the 11004 + // serializable check as well. Otherwise, only types defined with the "type" keyword would pass. 11005 + type Serializable<T> = 11006 + // Structured cloneables 11007 + | BaseType 11008 + // Structured cloneable composites 11009 + | Map< 11010 + T extends Map<infer U, unknown> ? Serializable<U> : never, 11011 + T extends Map<unknown, infer U> ? Serializable<U> : never 11012 + > 11013 + | Set<T extends Set<infer U> ? Serializable<U> : never> 11014 + | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never> 11015 + | { 11016 + [K in keyof T]: K extends number | string ? Serializable<T[K]> : never 11017 + } 11018 + // Special types 11019 + | Stub<Stubable> 11020 + // Serialized as stubs, see `Stubify` 11021 + | Stubable 11022 + // Base type for all RPC stubs, including common memory management methods. 11023 + // `T` is used as a marker type for unwrapping `Stub`s later. 11024 + interface StubBase<T extends Stubable> extends Disposable { 11025 + [__RPC_STUB_BRAND]: T 11026 + dup(): this 11027 + } 11028 + export type Stub<T extends Stubable> = Provider<T> & StubBase<T> 11029 + // This represents all the types that can be sent as-is over an RPC boundary 11030 + type BaseType = 11031 + | void 11032 + | undefined 11033 + | null 11034 + | boolean 11035 + | number 11036 + | bigint 11037 + | string 11038 + | TypedArray 11039 + | ArrayBuffer 11040 + | DataView 11041 + | Date 11042 + | Error 11043 + | RegExp 11044 + | ReadableStream<Uint8Array> 11045 + | WritableStream<Uint8Array> 11046 + | Request 11047 + | Response 11048 + | Headers 11049 + // Recursively rewrite all `Stubable` types with `Stub`s 11050 + // prettier-ignore 11051 + 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 { 11052 + [key: string | number]: any; 11053 + } ? { 11054 + [K in keyof T]: Stubify<T[K]>; 11055 + } : T; 11056 + // Recursively rewrite all `Stub<T>`s with the corresponding `T`s. 11057 + // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies: 11058 + // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`. 11059 + // prettier-ignore 11060 + 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 { 11061 + [key: string | number]: unknown; 11062 + } ? { 11063 + [K in keyof T]: Unstubify<T[K]>; 11064 + } : T; 11065 + type UnstubifyAll<A extends any[]> = { 11066 + [I in keyof A]: Unstubify<A[I]> 11067 + } 11068 + // Utility type for adding `Provider`/`Disposable`s to `object` types only. 11069 + // Note `unknown & T` is equivalent to `T`. 11070 + type MaybeProvider<T> = T extends object ? Provider<T> : unknown 11071 + type MaybeDisposable<T> = T extends object ? Disposable : unknown 11072 + // Type for method return or property on an RPC interface. 11073 + // - Stubable types are replaced by stubs. 11074 + // - Serializable types are passed by value, with stubable types replaced by stubs 11075 + // and a top-level `Disposer`. 11076 + // Everything else can't be passed over PRC. 11077 + // Technically, we use custom thenables here, but they quack like `Promise`s. 11078 + // Intersecting with `(Maybe)Provider` allows pipelining. 11079 + // prettier-ignore 11080 + type Result<R> = R extends Stubable ? Promise<Stub<R>> & Provider<R> : R extends Serializable<R> ? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R> : never; 11081 + // Type for method or property on an RPC interface. 11082 + // For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s. 11083 + // Unwrapping `Stub`s allows calling with `Stubable` arguments. 11084 + // For properties, rewrite types to be `Result`s. 11085 + // In each case, unwrap `Promise`s. 11086 + type MethodOrProperty<V> = V extends (...args: infer P) => infer R 11087 + ? (...args: UnstubifyAll<P>) => Result<Awaited<R>> 11088 + : Result<Awaited<V>> 11089 + // Type for the callable part of an `Provider` if `T` is callable. 11090 + // This is intersected with methods/properties. 11091 + type MaybeCallableProvider<T> = T extends (...args: any[]) => any ? MethodOrProperty<T> : unknown 11092 + // Base type for all other types providing RPC-like interfaces. 11093 + // Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types. 11094 + // `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC. 11095 + export type Provider< 11096 + T extends object, 11097 + Reserved extends string = never, 11098 + > = MaybeCallableProvider<T> & 11099 + Pick< 11100 + { 11101 + [K in keyof T]: MethodOrProperty<T[K]> 11102 + }, 11103 + Exclude<keyof T, Reserved | symbol | keyof StubBase<never>> 11104 + > 11105 + } 11106 + declare namespace Cloudflare { 11107 + // Type of `env`. 11108 + // 11109 + // The specific project can extend `Env` by redeclaring it in project-specific files. Typescript 11110 + // will merge all declarations. 11111 + // 11112 + // You can use `wrangler types` to generate the `Env` type automatically. 11113 + interface Env {} 11114 + // Project-specific parameters used to inform types. 11115 + // 11116 + // This interface is, again, intended to be declared in project-specific files, and then that 11117 + // declaration will be merged with this one. 11118 + // 11119 + // A project should have a declaration like this: 11120 + // 11121 + // interface GlobalProps { 11122 + // // Declares the main module's exports. Used to populate Cloudflare.Exports aka the type 11123 + // // of `ctx.exports`. 11124 + // mainModule: typeof import("my-main-module"); 11125 + // 11126 + // // Declares which of the main module's exports are configured with durable storage, and 11127 + // // thus should behave as Durable Object namsepace bindings. 11128 + // durableNamespaces: "MyDurableObject" | "AnotherDurableObject"; 11129 + // } 11130 + // 11131 + // You can use `wrangler types` to generate `GlobalProps` automatically. 11132 + interface GlobalProps {} 11133 + // Evaluates to the type of a property in GlobalProps, defaulting to `Default` if it is not 11134 + // present. 11135 + type GlobalProp<K extends string, Default> = K extends keyof GlobalProps 11136 + ? GlobalProps[K] 11137 + : Default 11138 + // The type of the program's main module exports, if known. Requires `GlobalProps` to declare the 11139 + // `mainModule` property. 11140 + type MainModule = GlobalProp<'mainModule', {}> 11141 + // The type of ctx.exports, which contains loopback bindings for all top-level exports. 11142 + type Exports = { 11143 + [K in keyof MainModule]: LoopbackForExport<MainModule[K]> & 11144 + // If the export is listed in `durableNamespaces`, then it is also a 11145 + // DurableObjectNamespace. 11146 + (K extends GlobalProp<'durableNamespaces', never> 11147 + ? MainModule[K] extends new (...args: any[]) => infer DoInstance 11148 + ? DoInstance extends Rpc.DurableObjectBranded 11149 + ? DurableObjectNamespace<DoInstance> 11150 + : DurableObjectNamespace<undefined> 11151 + : DurableObjectNamespace<undefined> 11152 + : {}) 11153 + } 11154 + } 11155 + declare namespace CloudflareWorkersModule { 11156 + export type RpcStub<T extends Rpc.Stubable> = Rpc.Stub<T> 11157 + export const RpcStub: { 11158 + new <T extends Rpc.Stubable>(value: T): Rpc.Stub<T> 11159 + } 11160 + export abstract class RpcTarget implements Rpc.RpcTargetBranded { 11161 + [Rpc.__RPC_TARGET_BRAND]: never 11162 + } 11163 + // `protected` fields don't appear in `keyof`s, so can't be accessed over RPC 11164 + export abstract class WorkerEntrypoint<Env = Cloudflare.Env, Props = {}> 11165 + implements Rpc.WorkerEntrypointBranded 11166 + { 11167 + [Rpc.__WORKER_ENTRYPOINT_BRAND]: never 11168 + protected ctx: ExecutionContext<Props> 11169 + protected env: Env 11170 + constructor(ctx: ExecutionContext, env: Env) 11171 + email?(message: ForwardableEmailMessage): void | Promise<void> 11172 + fetch?(request: Request): Response | Promise<Response> 11173 + queue?(batch: MessageBatch<unknown>): void | Promise<void> 11174 + scheduled?(controller: ScheduledController): void | Promise<void> 11175 + tail?(events: TraceItem[]): void | Promise<void> 11176 + tailStream?( 11177 + event: TailStream.TailEvent<TailStream.Onset>, 11178 + ): TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType> 11179 + test?(controller: TestController): void | Promise<void> 11180 + trace?(traces: TraceItem[]): void | Promise<void> 11181 + } 11182 + export abstract class DurableObject<Env = Cloudflare.Env, Props = {}> 11183 + implements Rpc.DurableObjectBranded 11184 + { 11185 + [Rpc.__DURABLE_OBJECT_BRAND]: never 11186 + protected ctx: DurableObjectState<Props> 11187 + protected env: Env 11188 + constructor(ctx: DurableObjectState, env: Env) 11189 + alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void> 11190 + fetch?(request: Request): Response | Promise<Response> 11191 + webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void> 11192 + webSocketClose?( 11193 + ws: WebSocket, 11194 + code: number, 11195 + reason: string, 11196 + wasClean: boolean, 11197 + ): void | Promise<void> 11198 + webSocketError?(ws: WebSocket, error: unknown): void | Promise<void> 11199 + } 11200 + export type WorkflowDurationLabel = 11201 + | 'second' 11202 + | 'minute' 11203 + | 'hour' 11204 + | 'day' 11205 + | 'week' 11206 + | 'month' 11207 + | 'year' 11208 + export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number 11209 + export type WorkflowDelayDuration = WorkflowSleepDuration 11210 + export type WorkflowTimeoutDuration = WorkflowSleepDuration 11211 + export type WorkflowRetentionDuration = WorkflowSleepDuration 11212 + export type WorkflowBackoff = 'constant' | 'linear' | 'exponential' 11213 + export type WorkflowStepConfig = { 11214 + retries?: { 11215 + limit: number 11216 + delay: WorkflowDelayDuration | number 11217 + backoff?: WorkflowBackoff 11218 + } 11219 + timeout?: WorkflowTimeoutDuration | number 11220 + } 11221 + export type WorkflowEvent<T> = { 11222 + payload: Readonly<T> 11223 + timestamp: Date 11224 + instanceId: string 11225 + } 11226 + export type WorkflowStepEvent<T> = { 11227 + payload: Readonly<T> 11228 + timestamp: Date 11229 + type: string 11230 + } 11231 + export abstract class WorkflowStep { 11232 + do<T extends Rpc.Serializable<T>>(name: string, callback: () => Promise<T>): Promise<T> 11233 + do<T extends Rpc.Serializable<T>>( 11234 + name: string, 11235 + config: WorkflowStepConfig, 11236 + callback: () => Promise<T>, 11237 + ): Promise<T> 11238 + sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void> 11239 + sleepUntil: (name: string, timestamp: Date | number) => Promise<void> 11240 + waitForEvent<T extends Rpc.Serializable<T>>( 11241 + name: string, 11242 + options: { 11243 + type: string 11244 + timeout?: WorkflowTimeoutDuration | number 11245 + }, 11246 + ): Promise<WorkflowStepEvent<T>> 11247 + } 11248 + export abstract class WorkflowEntrypoint< 11249 + Env = unknown, 11250 + T extends Rpc.Serializable<T> | unknown = unknown, 11251 + > 11252 + implements Rpc.WorkflowEntrypointBranded 11253 + { 11254 + [Rpc.__WORKFLOW_ENTRYPOINT_BRAND]: never 11255 + protected ctx: ExecutionContext 11256 + protected env: Env 11257 + constructor(ctx: ExecutionContext, env: Env) 11258 + run(event: Readonly<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown> 11259 + } 11260 + export function waitUntil(promise: Promise<unknown>): void 11261 + export function withEnv(newEnv: unknown, fn: () => unknown): unknown 11262 + export function withExports(newExports: unknown, fn: () => unknown): unknown 11263 + export function withEnvAndExports( 11264 + newEnv: unknown, 11265 + newExports: unknown, 11266 + fn: () => unknown, 11267 + ): unknown 11268 + export const env: Cloudflare.Env 11269 + export const exports: Cloudflare.Exports 11270 + } 11271 + declare module 'cloudflare:workers' { 11272 + export = CloudflareWorkersModule 11273 + } 11274 + interface SecretsStoreSecret { 11275 + /** 11276 + * Get a secret from the Secrets Store, returning a string of the secret value 11277 + * if it exists, or throws an error if it does not exist 11278 + */ 11279 + get(): Promise<string> 11280 + } 11281 + declare module 'cloudflare:sockets' { 11282 + function _connect(address: string | SocketAddress, options?: SocketOptions): Socket 11283 + export { _connect as connect } 11284 + } 11285 + type MarkdownDocument = { 11286 + name: string 11287 + blob: Blob 11288 + } 11289 + type ConversionResponse = 11290 + | { 11291 + name: string 11292 + mimeType: string 11293 + format: 'markdown' 11294 + tokens: number 11295 + data: string 11296 + } 11297 + | { 11298 + name: string 11299 + mimeType: string 11300 + format: 'error' 11301 + error: string 11302 + } 11303 + type ImageConversionOptions = { 11304 + descriptionLanguage?: 'en' | 'es' | 'fr' | 'it' | 'pt' | 'de' 11305 + } 11306 + type EmbeddedImageConversionOptions = ImageConversionOptions & { 11307 + convert?: boolean 11308 + maxConvertedImages?: number 11309 + } 11310 + type ConversionOptions = { 11311 + html?: { 11312 + images?: EmbeddedImageConversionOptions & { 11313 + convertOGImage?: boolean 11314 + } 11315 + } 11316 + docx?: { 11317 + images?: EmbeddedImageConversionOptions 11318 + } 11319 + image?: ImageConversionOptions 11320 + pdf?: { 11321 + images?: EmbeddedImageConversionOptions 11322 + metadata?: boolean 11323 + } 11324 + } 11325 + type ConversionRequestOptions = { 11326 + gateway?: GatewayOptions 11327 + extraHeaders?: object 11328 + conversionOptions?: ConversionOptions 11329 + } 11330 + type SupportedFileFormat = { 11331 + mimeType: string 11332 + extension: string 11333 + } 11334 + declare abstract class ToMarkdownService { 11335 + transform( 11336 + files: MarkdownDocument[], 11337 + options?: ConversionRequestOptions, 11338 + ): Promise<ConversionResponse[]> 11339 + transform( 11340 + files: MarkdownDocument, 11341 + options?: ConversionRequestOptions, 11342 + ): Promise<ConversionResponse> 11343 + supported(): Promise<SupportedFileFormat[]> 11344 + } 11345 + declare namespace TailStream { 11346 + interface Header { 11347 + readonly name: string 11348 + readonly value: string 11349 + } 11350 + interface FetchEventInfo { 11351 + readonly type: 'fetch' 11352 + readonly method: string 11353 + readonly url: string 11354 + readonly cfJson?: object 11355 + readonly headers: Header[] 11356 + } 11357 + interface JsRpcEventInfo { 11358 + readonly type: 'jsrpc' 11359 + } 11360 + interface ScheduledEventInfo { 11361 + readonly type: 'scheduled' 11362 + readonly scheduledTime: Date 11363 + readonly cron: string 11364 + } 11365 + interface AlarmEventInfo { 11366 + readonly type: 'alarm' 11367 + readonly scheduledTime: Date 11368 + } 11369 + interface QueueEventInfo { 11370 + readonly type: 'queue' 11371 + readonly queueName: string 11372 + readonly batchSize: number 11373 + } 11374 + interface EmailEventInfo { 11375 + readonly type: 'email' 11376 + readonly mailFrom: string 11377 + readonly rcptTo: string 11378 + readonly rawSize: number 11379 + } 11380 + interface TraceEventInfo { 11381 + readonly type: 'trace' 11382 + readonly traces: (string | null)[] 11383 + } 11384 + interface HibernatableWebSocketEventInfoMessage { 11385 + readonly type: 'message' 11386 + } 11387 + interface HibernatableWebSocketEventInfoError { 11388 + readonly type: 'error' 11389 + } 11390 + interface HibernatableWebSocketEventInfoClose { 11391 + readonly type: 'close' 11392 + readonly code: number 11393 + readonly wasClean: boolean 11394 + } 11395 + interface HibernatableWebSocketEventInfo { 11396 + readonly type: 'hibernatableWebSocket' 11397 + readonly info: 11398 + | HibernatableWebSocketEventInfoClose 11399 + | HibernatableWebSocketEventInfoError 11400 + | HibernatableWebSocketEventInfoMessage 11401 + } 11402 + interface CustomEventInfo { 11403 + readonly type: 'custom' 11404 + } 11405 + interface FetchResponseInfo { 11406 + readonly type: 'fetch' 11407 + readonly statusCode: number 11408 + } 11409 + type EventOutcome = 11410 + | 'ok' 11411 + | 'canceled' 11412 + | 'exception' 11413 + | 'unknown' 11414 + | 'killSwitch' 11415 + | 'daemonDown' 11416 + | 'exceededCpu' 11417 + | 'exceededMemory' 11418 + | 'loadShed' 11419 + | 'responseStreamDisconnected' 11420 + | 'scriptNotFound' 11421 + interface ScriptVersion { 11422 + readonly id: string 11423 + readonly tag?: string 11424 + readonly message?: string 11425 + } 11426 + interface Onset { 11427 + readonly type: 'onset' 11428 + readonly attributes: Attribute[] 11429 + // id for the span being opened by this Onset event. 11430 + readonly spanId: string 11431 + readonly dispatchNamespace?: string 11432 + readonly entrypoint?: string 11433 + readonly executionModel: string 11434 + readonly scriptName?: string 11435 + readonly scriptTags?: string[] 11436 + readonly scriptVersion?: ScriptVersion 11437 + readonly info: 11438 + | FetchEventInfo 11439 + | JsRpcEventInfo 11440 + | ScheduledEventInfo 11441 + | AlarmEventInfo 11442 + | QueueEventInfo 11443 + | EmailEventInfo 11444 + | TraceEventInfo 11445 + | HibernatableWebSocketEventInfo 11446 + | CustomEventInfo 11447 + } 11448 + interface Outcome { 11449 + readonly type: 'outcome' 11450 + readonly outcome: EventOutcome 11451 + readonly cpuTime: number 11452 + readonly wallTime: number 11453 + } 11454 + interface SpanOpen { 11455 + readonly type: 'spanOpen' 11456 + readonly name: string 11457 + // id for the span being opened by this SpanOpen event. 11458 + readonly spanId: string 11459 + readonly info?: FetchEventInfo | JsRpcEventInfo | Attributes 11460 + } 11461 + interface SpanClose { 11462 + readonly type: 'spanClose' 11463 + readonly outcome: EventOutcome 11464 + } 11465 + interface DiagnosticChannelEvent { 11466 + readonly type: 'diagnosticChannel' 11467 + readonly channel: string 11468 + readonly message: any 11469 + } 11470 + interface Exception { 11471 + readonly type: 'exception' 11472 + readonly name: string 11473 + readonly message: string 11474 + readonly stack?: string 11475 + } 11476 + interface Log { 11477 + readonly type: 'log' 11478 + readonly level: 'debug' | 'error' | 'info' | 'log' | 'warn' 11479 + readonly message: object 11480 + } 11481 + // This marks the worker handler return information. 11482 + // This is separate from Outcome because the worker invocation can live for a long time after 11483 + // returning. For example - Websockets that return an http upgrade response but then continue 11484 + // streaming information or SSE http connections. 11485 + interface Return { 11486 + readonly type: 'return' 11487 + readonly info?: FetchResponseInfo 11488 + } 11489 + interface Attribute { 11490 + readonly name: string 11491 + readonly value: string | string[] | boolean | boolean[] | number | number[] | bigint | bigint[] 11492 + } 11493 + interface Attributes { 11494 + readonly type: 'attributes' 11495 + readonly info: Attribute[] 11496 + } 11497 + type EventType = 11498 + | Onset 11499 + | Outcome 11500 + | SpanOpen 11501 + | SpanClose 11502 + | DiagnosticChannelEvent 11503 + | Exception 11504 + | Log 11505 + | Return 11506 + | Attributes 11507 + // Context in which this trace event lives. 11508 + interface SpanContext { 11509 + // Single id for the entire top-level invocation 11510 + // This should be a new traceId for the first worker stage invoked in the eyeball request and then 11511 + // same-account service-bindings should reuse the same traceId but cross-account service-bindings 11512 + // should use a new traceId. 11513 + readonly traceId: string 11514 + // spanId in which this event is handled 11515 + // for Onset and SpanOpen events this would be the parent span id 11516 + // for Outcome and SpanClose these this would be the span id of the opening Onset and SpanOpen events 11517 + // For Hibernate and Mark this would be the span under which they were emitted. 11518 + // spanId is not set ONLY if: 11519 + // 1. This is an Onset event 11520 + // 2. We are not inherting any SpanContext. (e.g. this is a cross-account service binding or a new top-level invocation) 11521 + readonly spanId?: string 11522 + } 11523 + interface TailEvent<Event extends EventType> { 11524 + // invocation id of the currently invoked worker stage. 11525 + // invocation id will always be unique to every Onset event and will be the same until the Outcome event. 11526 + readonly invocationId: string 11527 + // Inherited spanContext for this event. 11528 + readonly spanContext: SpanContext 11529 + readonly timestamp: Date 11530 + readonly sequence: number 11531 + readonly event: Event 11532 + } 11533 + type TailEventHandler<Event extends EventType = EventType> = ( 11534 + event: TailEvent<Event>, 11535 + ) => void | Promise<void> 11536 + type TailEventHandlerObject = { 11537 + outcome?: TailEventHandler<Outcome> 11538 + spanOpen?: TailEventHandler<SpanOpen> 11539 + spanClose?: TailEventHandler<SpanClose> 11540 + diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent> 11541 + exception?: TailEventHandler<Exception> 11542 + log?: TailEventHandler<Log> 11543 + return?: TailEventHandler<Return> 11544 + attributes?: TailEventHandler<Attributes> 11545 + } 11546 + type TailEventHandlerType = TailEventHandler | TailEventHandlerObject 11547 + } 11548 + // Copyright (c) 2022-2023 Cloudflare, Inc. 11549 + // Licensed under the Apache 2.0 license found in the LICENSE file or at: 11550 + // https://opensource.org/licenses/Apache-2.0 11551 + /** 11552 + * Data types supported for holding vector metadata. 11553 + */ 11554 + type VectorizeVectorMetadataValue = string | number | boolean | string[] 11555 + /** 11556 + * Additional information to associate with a vector. 11557 + */ 11558 + type VectorizeVectorMetadata = 11559 + | VectorizeVectorMetadataValue 11560 + | Record<string, VectorizeVectorMetadataValue> 11561 + type VectorFloatArray = Float32Array | Float64Array 11562 + interface VectorizeError { 11563 + code?: number 11564 + error: string 11565 + } 11566 + /** 11567 + * Comparison logic/operation to use for metadata filtering. 11568 + * 11569 + * This list is expected to grow as support for more operations are released. 11570 + */ 11571 + type VectorizeVectorMetadataFilterOp = '$eq' | '$ne' | '$lt' | '$lte' | '$gt' | '$gte' 11572 + type VectorizeVectorMetadataFilterCollectionOp = '$in' | '$nin' 11573 + /** 11574 + * Filter criteria for vector metadata used to limit the retrieved query result set. 11575 + */ 11576 + type VectorizeVectorMetadataFilter = { 11577 + [field: string]: 11578 + | Exclude<VectorizeVectorMetadataValue, string[]> 11579 + | null 11580 + | { 11581 + [Op in VectorizeVectorMetadataFilterOp]?: Exclude< 11582 + VectorizeVectorMetadataValue, 11583 + string[] 11584 + > | null 11585 + } 11586 + | { 11587 + [Op in VectorizeVectorMetadataFilterCollectionOp]?: Exclude< 11588 + VectorizeVectorMetadataValue, 11589 + string[] 11590 + >[] 11591 + } 11592 + } 11593 + /** 11594 + * Supported distance metrics for an index. 11595 + * Distance metrics determine how other "similar" vectors are determined. 11596 + */ 11597 + type VectorizeDistanceMetric = 'euclidean' | 'cosine' | 'dot-product' 11598 + /** 11599 + * Metadata return levels for a Vectorize query. 11600 + * 11601 + * Default to "none". 11602 + * 11603 + * @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. 11604 + * @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). 11605 + * @property none No indexed metadata will be returned. 11606 + */ 11607 + type VectorizeMetadataRetrievalLevel = 'all' | 'indexed' | 'none' 11608 + interface VectorizeQueryOptions { 11609 + topK?: number 11610 + namespace?: string 11611 + returnValues?: boolean 11612 + returnMetadata?: boolean | VectorizeMetadataRetrievalLevel 11613 + filter?: VectorizeVectorMetadataFilter 11614 + } 11615 + /** 11616 + * Information about the configuration of an index. 11617 + */ 11618 + type VectorizeIndexConfig = 11619 + | { 11620 + dimensions: number 11621 + metric: VectorizeDistanceMetric 11622 + } 11623 + | { 11624 + preset: string // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity 11625 + } 11626 + /** 11627 + * Metadata about an existing index. 11628 + * 11629 + * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released. 11630 + * See {@link VectorizeIndexInfo} for its post-beta equivalent. 11631 + */ 11632 + interface VectorizeIndexDetails { 11633 + /** The unique ID of the index */ 11634 + readonly id: string 11635 + /** The name of the index. */ 11636 + name: string 11637 + /** (optional) A human readable description for the index. */ 11638 + description?: string 11639 + /** The index configuration, including the dimension size and distance metric. */ 11640 + config: VectorizeIndexConfig 11641 + /** The number of records containing vectors within the index. */ 11642 + vectorsCount: number 11643 + } 11644 + /** 11645 + * Metadata about an existing index. 11646 + */ 11647 + interface VectorizeIndexInfo { 11648 + /** The number of records containing vectors within the index. */ 11649 + vectorCount: number 11650 + /** Number of dimensions the index has been configured for. */ 11651 + dimensions: number 11652 + /** ISO 8601 datetime of the last processed mutation on in the index. All changes before this mutation will be reflected in the index state. */ 11653 + processedUpToDatetime: number 11654 + /** UUIDv4 of the last mutation processed by the index. All changes before this mutation will be reflected in the index state. */ 11655 + processedUpToMutation: number 11656 + } 11657 + /** 11658 + * Represents a single vector value set along with its associated metadata. 11659 + */ 11660 + interface VectorizeVector { 11661 + /** 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. */ 11662 + id: string 11663 + /** The vector values */ 11664 + values: VectorFloatArray | number[] 11665 + /** The namespace this vector belongs to. */ 11666 + namespace?: string 11667 + /** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */ 11668 + metadata?: Record<string, VectorizeVectorMetadata> 11669 + } 11670 + /** 11671 + * Represents a matched vector for a query along with its score and (if specified) the matching vector information. 11672 + */ 11673 + type VectorizeMatch = Pick<Partial<VectorizeVector>, 'values'> & 11674 + Omit<VectorizeVector, 'values'> & { 11675 + /** The score or rank for similarity, when returned as a result */ 11676 + score: number 11677 + } 11678 + /** 11679 + * A set of matching {@link VectorizeMatch} for a particular query. 11680 + */ 11681 + interface VectorizeMatches { 11682 + matches: VectorizeMatch[] 11683 + count: number 11684 + } 11685 + /** 11686 + * Results of an operation that performed a mutation on a set of vectors. 11687 + * Here, `ids` is a list of vectors that were successfully processed. 11688 + * 11689 + * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released. 11690 + * See {@link VectorizeAsyncMutation} for its post-beta equivalent. 11691 + */ 11692 + interface VectorizeVectorMutation { 11693 + /* List of ids of vectors that were successfully processed. */ 11694 + ids: string[] 11695 + /* Total count of the number of processed vectors. */ 11696 + count: number 11697 + } 11698 + /** 11699 + * Result type indicating a mutation on the Vectorize Index. 11700 + * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation. 11701 + */ 11702 + interface VectorizeAsyncMutation { 11703 + /** The unique identifier for the async mutation operation containing the changeset. */ 11704 + mutationId: string 11705 + } 11706 + /** 11707 + * A Vectorize Vector Search Index for querying vectors/embeddings. 11708 + * 11709 + * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released. 11710 + * See {@link Vectorize} for its new implementation. 11711 + */ 11712 + declare abstract class VectorizeIndex { 11713 + /** 11714 + * Get information about the currently bound index. 11715 + * @returns A promise that resolves with information about the current index. 11716 + */ 11717 + public describe(): Promise<VectorizeIndexDetails> 11718 + /** 11719 + * Use the provided vector to perform a similarity search across the index. 11720 + * @param vector Input vector that will be used to drive the similarity search. 11721 + * @param options Configuration options to massage the returned data. 11722 + * @returns A promise that resolves with matched and scored vectors. 11723 + */ 11724 + public query( 11725 + vector: VectorFloatArray | number[], 11726 + options?: VectorizeQueryOptions, 11727 + ): Promise<VectorizeMatches> 11728 + /** 11729 + * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown. 11730 + * @param vectors List of vectors that will be inserted. 11731 + * @returns A promise that resolves with the ids & count of records that were successfully processed. 11732 + */ 11733 + public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation> 11734 + /** 11735 + * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values. 11736 + * @param vectors List of vectors that will be upserted. 11737 + * @returns A promise that resolves with the ids & count of records that were successfully processed. 11738 + */ 11739 + public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation> 11740 + /** 11741 + * Delete a list of vectors with a matching id. 11742 + * @param ids List of vector ids that should be deleted. 11743 + * @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted). 11744 + */ 11745 + public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation> 11746 + /** 11747 + * Get a list of vectors with a matching id. 11748 + * @param ids List of vector ids that should be returned. 11749 + * @returns A promise that resolves with the raw unscored vectors matching the id set. 11750 + */ 11751 + public getByIds(ids: string[]): Promise<VectorizeVector[]> 11752 + } 11753 + /** 11754 + * A Vectorize Vector Search Index for querying vectors/embeddings. 11755 + * 11756 + * Mutations in this version are async, returning a mutation id. 11757 + */ 11758 + declare abstract class Vectorize { 11759 + /** 11760 + * Get information about the currently bound index. 11761 + * @returns A promise that resolves with information about the current index. 11762 + */ 11763 + public describe(): Promise<VectorizeIndexInfo> 11764 + /** 11765 + * Use the provided vector to perform a similarity search across the index. 11766 + * @param vector Input vector that will be used to drive the similarity search. 11767 + * @param options Configuration options to massage the returned data. 11768 + * @returns A promise that resolves with matched and scored vectors. 11769 + */ 11770 + public query( 11771 + vector: VectorFloatArray | number[], 11772 + options?: VectorizeQueryOptions, 11773 + ): Promise<VectorizeMatches> 11774 + /** 11775 + * Use the provided vector-id to perform a similarity search across the index. 11776 + * @param vectorId Id for a vector in the index against which the index should be queried. 11777 + * @param options Configuration options to massage the returned data. 11778 + * @returns A promise that resolves with matched and scored vectors. 11779 + */ 11780 + public queryById(vectorId: string, options?: VectorizeQueryOptions): Promise<VectorizeMatches> 11781 + /** 11782 + * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown. 11783 + * @param vectors List of vectors that will be inserted. 11784 + * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset. 11785 + */ 11786 + public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation> 11787 + /** 11788 + * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values. 11789 + * @param vectors List of vectors that will be upserted. 11790 + * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset. 11791 + */ 11792 + public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation> 11793 + /** 11794 + * Delete a list of vectors with a matching id. 11795 + * @param ids List of vector ids that should be deleted. 11796 + * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset. 11797 + */ 11798 + public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation> 11799 + /** 11800 + * Get a list of vectors with a matching id. 11801 + * @param ids List of vector ids that should be returned. 11802 + * @returns A promise that resolves with the raw unscored vectors matching the id set. 11803 + */ 11804 + public getByIds(ids: string[]): Promise<VectorizeVector[]> 11805 + } 11806 + /** 11807 + * The interface for "version_metadata" binding 11808 + * providing metadata about the Worker Version using this binding. 11809 + */ 11810 + type WorkerVersionMetadata = { 11811 + /** The ID of the Worker Version using this binding */ 11812 + id: string 11813 + /** The tag of the Worker Version using this binding */ 11814 + tag: string 11815 + /** The timestamp of when the Worker Version was uploaded */ 11816 + timestamp: string 11817 + } 11818 + interface DynamicDispatchLimits { 11819 + /** 11820 + * Limit CPU time in milliseconds. 11821 + */ 11822 + cpuMs?: number 11823 + /** 11824 + * Limit number of subrequests. 11825 + */ 11826 + subRequests?: number 11827 + } 11828 + interface DynamicDispatchOptions { 11829 + /** 11830 + * Limit resources of invoked Worker script. 11831 + */ 11832 + limits?: DynamicDispatchLimits 11833 + /** 11834 + * Arguments for outbound Worker script, if configured. 11835 + */ 11836 + outbound?: { 11837 + [key: string]: any 11838 + } 11839 + } 11840 + interface DispatchNamespace { 11841 + /** 11842 + * @param name Name of the Worker script. 11843 + * @param args Arguments to Worker script. 11844 + * @param options Options for Dynamic Dispatch invocation. 11845 + * @returns A Fetcher object that allows you to send requests to the Worker script. 11846 + * @throws If the Worker script does not exist in this dispatch namespace, an error will be thrown. 11847 + */ 11848 + get( 11849 + name: string, 11850 + args?: { 11851 + [key: string]: any 11852 + }, 11853 + options?: DynamicDispatchOptions, 11854 + ): Fetcher 11855 + } 11856 + declare module 'cloudflare:workflows' { 11857 + /** 11858 + * NonRetryableError allows for a user to throw a fatal error 11859 + * that makes a Workflow instance fail immediately without triggering a retry 11860 + */ 11861 + export class NonRetryableError extends Error { 11862 + public constructor(message: string, name?: string) 11863 + } 11864 + } 11865 + declare abstract class Workflow<PARAMS = unknown> { 11866 + /** 11867 + * Get a handle to an existing instance of the Workflow. 11868 + * @param id Id for the instance of this Workflow 11869 + * @returns A promise that resolves with a handle for the Instance 11870 + */ 11871 + public get(id: string): Promise<WorkflowInstance> 11872 + /** 11873 + * Create a new instance and return a handle to it. If a provided id exists, an error will be thrown. 11874 + * @param options Options when creating an instance including id and params 11875 + * @returns A promise that resolves with a handle for the Instance 11876 + */ 11877 + public create(options?: WorkflowInstanceCreateOptions<PARAMS>): Promise<WorkflowInstance> 11878 + /** 11879 + * Create a batch of instances and return handle for all of them. If a provided id exists, an error will be thrown. 11880 + * `createBatch` is limited at 100 instances at a time or when the RPC limit for the batch (1MiB) is reached. 11881 + * @param batch List of Options when creating an instance including name and params 11882 + * @returns A promise that resolves with a list of handles for the created instances. 11883 + */ 11884 + public createBatch(batch: WorkflowInstanceCreateOptions<PARAMS>[]): Promise<WorkflowInstance[]> 11885 + } 11886 + type WorkflowDurationLabel = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' 11887 + type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${'s' | ''}` | number 11888 + type WorkflowRetentionDuration = WorkflowSleepDuration 11889 + interface WorkflowInstanceCreateOptions<PARAMS = unknown> { 11890 + /** 11891 + * An id for your Workflow instance. Must be unique within the Workflow. 11892 + */ 11893 + id?: string 11894 + /** 11895 + * The event payload the Workflow instance is triggered with 11896 + */ 11897 + params?: PARAMS 11898 + /** 11899 + * The retention policy for Workflow instance. 11900 + * Defaults to the maximum retention period available for the owner's account. 11901 + */ 11902 + retention?: { 11903 + successRetention?: WorkflowRetentionDuration 11904 + errorRetention?: WorkflowRetentionDuration 11905 + } 11906 + } 11907 + type InstanceStatus = { 11908 + status: 11909 + | 'queued' // means that instance is waiting to be started (see concurrency limits) 11910 + | 'running' 11911 + | 'paused' 11912 + | 'errored' 11913 + | 'terminated' // user terminated the instance while it was running 11914 + | 'complete' 11915 + | 'waiting' // instance is hibernating and waiting for sleep or event to finish 11916 + | 'waitingForPause' // instance is finishing the current work to pause 11917 + | 'unknown' 11918 + error?: { 11919 + name: string 11920 + message: string 11921 + } 11922 + output?: unknown 11923 + } 11924 + interface WorkflowError { 11925 + code?: number 11926 + message: string 11927 + } 11928 + declare abstract class WorkflowInstance { 11929 + public id: string 11930 + /** 11931 + * Pause the instance. 11932 + */ 11933 + public pause(): Promise<void> 11934 + /** 11935 + * Resume the instance. If it is already running, an error will be thrown. 11936 + */ 11937 + public resume(): Promise<void> 11938 + /** 11939 + * Terminate the instance. If it is errored, terminated or complete, an error will be thrown. 11940 + */ 11941 + public terminate(): Promise<void> 11942 + /** 11943 + * Restart the instance. 11944 + */ 11945 + public restart(): Promise<void> 11946 + /** 11947 + * Returns the current status of the instance. 11948 + */ 11949 + public status(): Promise<InstanceStatus> 11950 + /** 11951 + * Send an event to this instance. 11952 + */ 11953 + public sendEvent({ type, payload }: { type: string; payload: unknown }): Promise<void> 11954 + }
+51 -50
package-lock.json
··· 22 22 "@storybook/addon-vitest": "^10.1.10", 23 23 "@storybook/svelte": "^10.1.10", 24 24 "@storybook/sveltekit": "^10.1.10", 25 - "@types/node": "^25", 25 + "@types/node": "^25.0.3", 26 26 "@vitest/coverage-v8": "^4.0.16", 27 27 "@vitest/ui": "^4.0.16", 28 28 "eslint-plugin-svelte": "^3.13.1", ··· 35 35 "tsdown": "^0.18.1", 36 36 "typescript": "^5.9.3", 37 37 "vite": "^7.3.0", 38 - "vitest": "^4.0.15" 38 + "vitest": "^4.0.15", 39 + "wrangler": "^4.56.0" 39 40 } 40 41 }, 41 42 "app": { 42 43 "name": "@starlight/website", 43 44 "version": "0.0.1", 44 45 "dependencies": { 45 - "@cloudflare/workers-types": "^4.20251217.0", 46 46 "@lucide/svelte": "^0.562.0", 47 47 "@starlight/color": "file:../packages/color", 48 48 "@starlight/icons": "file:../packages/icons", ··· 199 199 } 200 200 }, 201 201 "node_modules/@cloudflare/unenv-preset": { 202 - "version": "2.7.12", 203 - "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.7.12.tgz", 204 - "integrity": "sha512-SIBo+k58R9OyBsxF1jL6GdL7XHbzatT86c0be+UY5v5tg6TAuJ1/2QsRuC3pHgKVHile1HcJqEEORoS9hv8hNw==", 202 + "version": "2.7.13", 203 + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.7.13.tgz", 204 + "integrity": "sha512-NulO1H8R/DzsJguLC0ndMuk4Ufv0KSlN+E54ay9rn9ZCQo0kpAPwwh3LhgpZ96a3Dr6L9LqW57M4CqC34iLOvw==", 205 205 "dev": true, 206 206 "license": "MIT OR Apache-2.0", 207 207 "peerDependencies": { 208 208 "unenv": "2.0.0-rc.24", 209 - "workerd": "^1.20251125.0" 209 + "workerd": "^1.20251202.0" 210 210 }, 211 211 "peerDependenciesMeta": { 212 212 "workerd": { ··· 215 215 } 216 216 }, 217 217 "node_modules/@cloudflare/workerd-darwin-64": { 218 - "version": "1.20251202.0", 219 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20251202.0.tgz", 220 - "integrity": "sha512-/uvEAWEukTWb1geHhbjGUeZqcSSSyYzp0mvoPUBl+l0ont4NVGao3fgwM0q8wtKvgoKCHSG6zcG23wj9Opj3Nw==", 218 + "version": "1.20251217.0", 219 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20251217.0.tgz", 220 + "integrity": "sha512-DN6vT+9ho61d/1/YuILW4VS+N1JBLaixWRL1vqNmhgbf8J8VHwWWotrRruEUYigJKx2yZyw6YsasE+yLXgx/Fw==", 221 221 "cpu": [ 222 222 "x64" 223 223 ], ··· 232 232 } 233 233 }, 234 234 "node_modules/@cloudflare/workerd-darwin-arm64": { 235 - "version": "1.20251202.0", 236 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20251202.0.tgz", 237 - "integrity": "sha512-f52xRvcI9cWRd6400EZStRtXiRC5XKEud7K5aFIbbUv0VeINltujFQQ9nHWtsF6g1quIXWkjhh5u01gPAYNNXA==", 235 + "version": "1.20251217.0", 236 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20251217.0.tgz", 237 + "integrity": "sha512-5nZOpRTkHmtcTc4Wbr1mj/O3dLb6aHZSiJuVBgtdbVcVmOXueSay3hnw1PXEyR+vpTKGUPkM+omUIslKHWnXDw==", 238 238 "cpu": [ 239 239 "arm64" 240 240 ], ··· 249 249 } 250 250 }, 251 251 "node_modules/@cloudflare/workerd-linux-64": { 252 - "version": "1.20251202.0", 253 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20251202.0.tgz", 254 - "integrity": "sha512-HYXinF5RBH7oXbsFUMmwKCj+WltpYbf5mRKUBG5v3EuPhUjSIFB84U+58pDyfBJjcynHdy3EtvTWcvh/+lcgow==", 252 + "version": "1.20251217.0", 253 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20251217.0.tgz", 254 + "integrity": "sha512-uoPGhMaZVXPpCsU0oG3HQzyVpXCGi5rU+jcHRjUI7DXM4EwctBGvZ380Knkja36qtl+ZvSKVR1pUFSGdK+45Pg==", 255 255 "cpu": [ 256 256 "x64" 257 257 ], ··· 266 266 } 267 267 }, 268 268 "node_modules/@cloudflare/workerd-linux-arm64": { 269 - "version": "1.20251202.0", 270 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20251202.0.tgz", 271 - "integrity": "sha512-++L02Jdoxz7hEA9qDaQjbVU1RzQS+S+eqIi22DkPe2Tgiq2M3UfNpeu+75k5L9DGRIkZPYvwMBMbcmKvQqdIIg==", 269 + "version": "1.20251217.0", 270 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20251217.0.tgz", 271 + "integrity": "sha512-ixHnHKsiz1Xko+eDgCJOZ7EEUZKtmnYq3AjW3nkVcLFypSLks4C29E45zVewdaN4wq8sCLeyQCl6r1kS17+DQQ==", 272 272 "cpu": [ 273 273 "arm64" 274 274 ], ··· 283 283 } 284 284 }, 285 285 "node_modules/@cloudflare/workerd-windows-64": { 286 - "version": "1.20251202.0", 287 - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20251202.0.tgz", 288 - "integrity": "sha512-gzeU6eDydTi7ib+Q9DD/c0hpXtqPucnHk2tfGU03mljPObYxzMkkPGgB5qxpksFvub3y4K0ChjqYxGJB4F+j3g==", 286 + "version": "1.20251217.0", 287 + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20251217.0.tgz", 288 + "integrity": "sha512-rP6USX+7ctynz3AtmKi+EvlLP3Xdr1ETrSdcnv693/I5QdUwBxq4yE1Lj6CV7GJizX6opXKYg8QMq0Q4eB9zRQ==", 289 289 "cpu": [ 290 290 "x64" 291 291 ], ··· 303 303 "version": "4.20251217.0", 304 304 "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20251217.0.tgz", 305 305 "integrity": "sha512-qdVSqCza5Bv23E0DFET+8SEl9fM1F16WHC0HGoYLlDAyWF7rK2HhkPCdUEOp8DsJXwANWvNOkFdJfE1kLYGHYg==", 306 - "license": "MIT OR Apache-2.0", 307 - "peer": true 306 + "dev": true, 307 + "license": "MIT OR Apache-2.0" 308 308 }, 309 309 "node_modules/@cspotcode/source-map-support": { 310 310 "version": "0.8.1", ··· 1809 1809 "license": "MIT" 1810 1810 }, 1811 1811 "node_modules/@poppinss/colors": { 1812 - "version": "4.1.5", 1813 - "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.5.tgz", 1814 - "integrity": "sha512-FvdDqtcRCtz6hThExcFOgW0cWX+xwSMWcRuQe5ZEb2m7cVQOAVZOIMt+/v9RxGiD9/OY16qJBXK4CVKWAPalBw==", 1812 + "version": "4.1.6", 1813 + "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", 1814 + "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", 1815 1815 "dev": true, 1816 1816 "license": "MIT", 1817 1817 "dependencies": { ··· 1844 1844 } 1845 1845 }, 1846 1846 "node_modules/@poppinss/exception": { 1847 - "version": "1.2.2", 1848 - "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.2.tgz", 1849 - "integrity": "sha512-m7bpKCD4QMlFCjA/nKTs23fuvoVFoA83brRKmObCUNmi/9tVu8Ve3w4YQAnJu4q3Tjf5fr685HYIC/IA2zHRSg==", 1847 + "version": "1.2.3", 1848 + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", 1849 + "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", 1850 1850 "dev": true, 1851 1851 "license": "MIT" 1852 1852 }, ··· 5873 5873 } 5874 5874 }, 5875 5875 "node_modules/miniflare": { 5876 - "version": "4.20251202.0", 5877 - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20251202.0.tgz", 5878 - "integrity": "sha512-Pa5iBAVzzVT/yr7rcyr75ETm5IGCpdT61foGx+6jDj+vzISNfWZgEcSxWk1nlJboJumUJ10kC498hQudpdbDWg==", 5876 + "version": "4.20251217.0", 5877 + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20251217.0.tgz", 5878 + "integrity": "sha512-8xsTQbPS6YV+ABZl9qiJIbsum6hbpbhqiyKpOVdzZrhK+1N8EFpT8R6aBZff7kezGmxYZSntjgjqTwJmj3JLgA==", 5879 5879 "dev": true, 5880 5880 "license": "MIT", 5881 5881 "dependencies": { ··· 5887 5887 "sharp": "^0.33.5", 5888 5888 "stoppable": "1.1.0", 5889 5889 "undici": "7.14.0", 5890 - "workerd": "1.20251202.0", 5890 + "workerd": "1.20251217.0", 5891 5891 "ws": "8.18.0", 5892 5892 "youch": "4.1.0-beta.10", 5893 5893 "zod": "3.22.3" ··· 8551 8551 } 8552 8552 }, 8553 8553 "node_modules/workerd": { 8554 - "version": "1.20251202.0", 8555 - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20251202.0.tgz", 8556 - "integrity": "sha512-p08YfrUMHkjCECNdT36r+6DpJIZX4kixbZ4n6GMUcLR5Gh18fakSCsiQrh72iOm4M9QHv/rM7P8YvCrUPWT5sg==", 8554 + "version": "1.20251217.0", 8555 + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20251217.0.tgz", 8556 + "integrity": "sha512-s3mHDSWwHTduyY8kpHOsl27ZJ4ziDBJlc18PfBvNMqNnhO7yBeemlxH7bo7yQyU1foJrIZ6IENHDDg0Z9N8zQA==", 8557 8557 "dev": true, 8558 8558 "hasInstallScript": true, 8559 8559 "license": "Apache-2.0", ··· 8565 8565 "node": ">=16" 8566 8566 }, 8567 8567 "optionalDependencies": { 8568 - "@cloudflare/workerd-darwin-64": "1.20251202.0", 8569 - "@cloudflare/workerd-darwin-arm64": "1.20251202.0", 8570 - "@cloudflare/workerd-linux-64": "1.20251202.0", 8571 - "@cloudflare/workerd-linux-arm64": "1.20251202.0", 8572 - "@cloudflare/workerd-windows-64": "1.20251202.0" 8568 + "@cloudflare/workerd-darwin-64": "1.20251217.0", 8569 + "@cloudflare/workerd-darwin-arm64": "1.20251217.0", 8570 + "@cloudflare/workerd-linux-64": "1.20251217.0", 8571 + "@cloudflare/workerd-linux-arm64": "1.20251217.0", 8572 + "@cloudflare/workerd-windows-64": "1.20251217.0" 8573 8573 } 8574 8574 }, 8575 8575 "node_modules/worktop": { ··· 8587 8587 } 8588 8588 }, 8589 8589 "node_modules/wrangler": { 8590 - "version": "4.52.1", 8591 - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.52.1.tgz", 8592 - "integrity": "sha512-rIzDxzPnLAaqBF+SdHGd9Az0ELEWtIBwPp5diCR58p2F4C+KgNGGpPMFswMntuViQ2RKRgGbk4jIzStJoUUfjQ==", 8590 + "version": "4.56.0", 8591 + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.56.0.tgz", 8592 + "integrity": "sha512-Nqi8duQeRbA+31QrD6QlWHW3IZVnuuRxMy7DEg46deUzywivmaRV/euBN5KKXDPtA24VyhYsK7I0tkb7P5DM2w==", 8593 8593 "dev": true, 8594 8594 "license": "MIT OR Apache-2.0", 8595 + "peer": true, 8595 8596 "dependencies": { 8596 8597 "@cloudflare/kv-asset-handler": "0.4.1", 8597 - "@cloudflare/unenv-preset": "2.7.12", 8598 + "@cloudflare/unenv-preset": "2.7.13", 8598 8599 "blake3-wasm": "2.1.5", 8599 8600 "esbuild": "0.27.0", 8600 - "miniflare": "4.20251202.0", 8601 + "miniflare": "4.20251217.0", 8601 8602 "path-to-regexp": "6.3.0", 8602 8603 "unenv": "2.0.0-rc.24", 8603 - "workerd": "1.20251202.0" 8604 + "workerd": "1.20251217.0" 8604 8605 }, 8605 8606 "bin": { 8606 8607 "wrangler": "bin/wrangler.js", ··· 8613 8614 "fsevents": "~2.3.2" 8614 8615 }, 8615 8616 "peerDependencies": { 8616 - "@cloudflare/workers-types": "^4.20251202.0" 8617 + "@cloudflare/workers-types": "^4.20251217.0" 8617 8618 }, 8618 8619 "peerDependenciesMeta": { 8619 8620 "@cloudflare/workers-types": { ··· 9212 9213 "@sveltejs/package": "^2.5.4", 9213 9214 "@sveltejs/vite-plugin-svelte": "^6.2.1", 9214 9215 "@tailwindcss/vite": "^4.1.18", 9215 - "svelte": "^5.46.0", 9216 + "svelte": "^5.45.10", 9216 9217 "svelte-check": "^4.3.3", 9217 9218 "tailwindcss": "^4.1.18" 9218 9219 },
+3 -2
package.json
··· 35 35 "@storybook/addon-vitest": "^10.1.10", 36 36 "@storybook/svelte": "^10.1.10", 37 37 "@storybook/sveltekit": "^10.1.10", 38 - "@types/node": "^25", 38 + "@types/node": "^25.0.3", 39 39 "@vitest/coverage-v8": "^4.0.16", 40 40 "@vitest/ui": "^4.0.16", 41 41 "eslint-plugin-svelte": "^3.13.1", ··· 48 48 "tsdown": "^0.18.1", 49 49 "typescript": "^5.9.3", 50 50 "vite": "^7.3.0", 51 - "vitest": "^4.0.15" 51 + "vitest": "^4.0.15", 52 + "wrangler": "^4.56.0" 52 53 }, 53 54 "engineStrict": true 54 55 }
+1 -1
wrangler.toml
··· 1 1 name = "drifting-starlight-campaign" 2 2 account_id = "680161f1e9b893b9ad4bef9b1ee7047e" 3 3 main = "app/.svelte-kit/.cloudflare/_worker.js" 4 - compatibility_date = "2025-10-10" 4 + compatibility_date = "2025-11-17" 5 5 compatibility_flags = ["nodejs_compat"] 6 6 7 7 [assets]