@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 03:37 UTC

next
ts 7,331 lines 281 KB
Raw
1 /* eslint-disable */
2 // Generated by Wrangler by running `wrangler types` (hash: 869ac3b4ce0f52ba3b2e0bc70c49089e)
3 // Runtime types generated with workerd@1.20250617.0 2025-06-20
4 declare namespace Cloudflare {
5 interface Env {
6 }
7 }
8 interface Env extends Cloudflare.Env {}
9
10 // Begin runtime types
11 /*! *****************************************************************************
12 Copyright (c) Cloudflare. All rights reserved.
13 Copyright (c) Microsoft Corporation. All rights reserved.
14
15 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
16 this file except in compliance with the License. You may obtain a copy of the
17 License at http://www.apache.org/licenses/LICENSE-2.0
18 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
20 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
21 MERCHANTABLITY OR NON-INFRINGEMENT.
22 See the Apache Version 2.0 License for specific language governing permissions
23 and limitations under the License.
24 ***************************************************************************** */
25 /* eslint-disable */
26 // noinspection JSUnusedGlobalSymbols
27 declare var onmessage: never;
28 /**
29 * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
30 *
31 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
32 */
33 declare class DOMException extends Error {
34 constructor(message?: string, name?: string);
35 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
36 readonly message: string;
37 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
38 readonly name: string;
39 /**
40 * @deprecated
41 *
42 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
43 */
44 readonly code: number;
45 static readonly INDEX_SIZE_ERR: number;
46 static readonly DOMSTRING_SIZE_ERR: number;
47 static readonly HIERARCHY_REQUEST_ERR: number;
48 static readonly WRONG_DOCUMENT_ERR: number;
49 static readonly INVALID_CHARACTER_ERR: number;
50 static readonly NO_DATA_ALLOWED_ERR: number;
51 static readonly NO_MODIFICATION_ALLOWED_ERR: number;
52 static readonly NOT_FOUND_ERR: number;
53 static readonly NOT_SUPPORTED_ERR: number;
54 static readonly INUSE_ATTRIBUTE_ERR: number;
55 static readonly INVALID_STATE_ERR: number;
56 static readonly SYNTAX_ERR: number;
57 static readonly INVALID_MODIFICATION_ERR: number;
58 static readonly NAMESPACE_ERR: number;
59 static readonly INVALID_ACCESS_ERR: number;
60 static readonly VALIDATION_ERR: number;
61 static readonly TYPE_MISMATCH_ERR: number;
62 static readonly SECURITY_ERR: number;
63 static readonly NETWORK_ERR: number;
64 static readonly ABORT_ERR: number;
65 static readonly URL_MISMATCH_ERR: number;
66 static readonly QUOTA_EXCEEDED_ERR: number;
67 static readonly TIMEOUT_ERR: number;
68 static readonly INVALID_NODE_TYPE_ERR: number;
69 static readonly DATA_CLONE_ERR: number;
70 get stack(): any;
71 set stack(value: any);
72 }
73 type WorkerGlobalScopeEventMap = {
74 fetch: FetchEvent;
75 scheduled: ScheduledEvent;
76 queue: QueueEvent;
77 unhandledrejection: PromiseRejectionEvent;
78 rejectionhandled: PromiseRejectionEvent;
79 };
80 declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
81 EventTarget: typeof EventTarget;
82 }
83 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
84 interface Console {
85 "assert"(condition?: boolean, ...data: any[]): void;
86 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
87 clear(): void;
88 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
89 count(label?: string): void;
90 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
91 countReset(label?: string): void;
92 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
93 debug(...data: any[]): void;
94 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
95 dir(item?: any, options?: any): void;
96 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
97 dirxml(...data: any[]): void;
98 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
99 error(...data: any[]): void;
100 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
101 group(...data: any[]): void;
102 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
103 groupCollapsed(...data: any[]): void;
104 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
105 groupEnd(): void;
106 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
107 info(...data: any[]): void;
108 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
109 log(...data: any[]): void;
110 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
111 table(tabularData?: any, properties?: string[]): void;
112 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
113 time(label?: string): void;
114 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
115 timeEnd(label?: string): void;
116 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
117 timeLog(label?: string, ...data: any[]): void;
118 timeStamp(label?: string): void;
119 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
120 trace(...data: any[]): void;
121 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
122 warn(...data: any[]): void;
123 }
124 declare const console: Console;
125 type BufferSource = ArrayBufferView | ArrayBuffer;
126 type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
127 declare namespace WebAssembly {
128 class CompileError extends Error {
129 constructor(message?: string);
130 }
131 class RuntimeError extends Error {
132 constructor(message?: string);
133 }
134 type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
135 interface GlobalDescriptor {
136 value: ValueType;
137 mutable?: boolean;
138 }
139 class Global {
140 constructor(descriptor: GlobalDescriptor, value?: any);
141 value: any;
142 valueOf(): any;
143 }
144 type ImportValue = ExportValue | number;
145 type ModuleImports = Record<string, ImportValue>;
146 type Imports = Record<string, ModuleImports>;
147 type ExportValue = Function | Global | Memory | Table;
148 type Exports = Record<string, ExportValue>;
149 class Instance {
150 constructor(module: Module, imports?: Imports);
151 readonly exports: Exports;
152 }
153 interface MemoryDescriptor {
154 initial: number;
155 maximum?: number;
156 shared?: boolean;
157 }
158 class Memory {
159 constructor(descriptor: MemoryDescriptor);
160 readonly buffer: ArrayBuffer;
161 grow(delta: number): number;
162 }
163 type ImportExportKind = "function" | "global" | "memory" | "table";
164 interface ModuleExportDescriptor {
165 kind: ImportExportKind;
166 name: string;
167 }
168 interface ModuleImportDescriptor {
169 kind: ImportExportKind;
170 module: string;
171 name: string;
172 }
173 abstract class Module {
174 static customSections(module: Module, sectionName: string): ArrayBuffer[];
175 static exports(module: Module): ModuleExportDescriptor[];
176 static imports(module: Module): ModuleImportDescriptor[];
177 }
178 type TableKind = "anyfunc" | "externref";
179 interface TableDescriptor {
180 element: TableKind;
181 initial: number;
182 maximum?: number;
183 }
184 class Table {
185 constructor(descriptor: TableDescriptor, value?: any);
186 readonly length: number;
187 get(index: number): any;
188 grow(delta: number, value?: any): number;
189 set(index: number, value?: any): void;
190 }
191 function instantiate(module: Module, imports?: Imports): Promise<Instance>;
192 function validate(bytes: BufferSource): boolean;
193 }
194 /**
195 * This ServiceWorker API interface represents the global execution context of a service worker.
196 * Available only in secure contexts.
197 *
198 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
199 */
200 interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
201 DOMException: typeof DOMException;
202 WorkerGlobalScope: typeof WorkerGlobalScope;
203 btoa(data: string): string;
204 atob(data: string): string;
205 setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
206 setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
207 clearTimeout(timeoutId: number | null): void;
208 setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
209 setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
210 clearInterval(timeoutId: number | null): void;
211 queueMicrotask(task: Function): void;
212 structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
213 reportError(error: any): void;
214 fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;
215 self: ServiceWorkerGlobalScope;
216 crypto: Crypto;
217 caches: CacheStorage;
218 scheduler: Scheduler;
219 performance: Performance;
220 Cloudflare: Cloudflare;
221 readonly origin: string;
222 Event: typeof Event;
223 ExtendableEvent: typeof ExtendableEvent;
224 CustomEvent: typeof CustomEvent;
225 PromiseRejectionEvent: typeof PromiseRejectionEvent;
226 FetchEvent: typeof FetchEvent;
227 TailEvent: typeof TailEvent;
228 TraceEvent: typeof TailEvent;
229 ScheduledEvent: typeof ScheduledEvent;
230 MessageEvent: typeof MessageEvent;
231 CloseEvent: typeof CloseEvent;
232 ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;
233 ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;
234 ReadableStream: typeof ReadableStream;
235 WritableStream: typeof WritableStream;
236 WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;
237 TransformStream: typeof TransformStream;
238 ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
239 CountQueuingStrategy: typeof CountQueuingStrategy;
240 ErrorEvent: typeof ErrorEvent;
241 EventSource: typeof EventSource;
242 ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
243 ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
244 ReadableByteStreamController: typeof ReadableByteStreamController;
245 WritableStreamDefaultController: typeof WritableStreamDefaultController;
246 TransformStreamDefaultController: typeof TransformStreamDefaultController;
247 CompressionStream: typeof CompressionStream;
248 DecompressionStream: typeof DecompressionStream;
249 TextEncoderStream: typeof TextEncoderStream;
250 TextDecoderStream: typeof TextDecoderStream;
251 Headers: typeof Headers;
252 Body: typeof Body;
253 Request: typeof Request;
254 Response: typeof Response;
255 WebSocket: typeof WebSocket;
256 WebSocketPair: typeof WebSocketPair;
257 WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
258 AbortController: typeof AbortController;
259 AbortSignal: typeof AbortSignal;
260 TextDecoder: typeof TextDecoder;
261 TextEncoder: typeof TextEncoder;
262 navigator: Navigator;
263 Navigator: typeof Navigator;
264 URL: typeof URL;
265 URLSearchParams: typeof URLSearchParams;
266 URLPattern: typeof URLPattern;
267 Blob: typeof Blob;
268 File: typeof File;
269 FormData: typeof FormData;
270 Crypto: typeof Crypto;
271 SubtleCrypto: typeof SubtleCrypto;
272 CryptoKey: typeof CryptoKey;
273 CacheStorage: typeof CacheStorage;
274 Cache: typeof Cache;
275 FixedLengthStream: typeof FixedLengthStream;
276 IdentityTransformStream: typeof IdentityTransformStream;
277 HTMLRewriter: typeof HTMLRewriter;
278 }
279 declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
280 declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
281 /**
282 * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
283 *
284 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
285 */
286 declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean;
287 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
288 declare function btoa(data: string): string;
289 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
290 declare function atob(data: string): string;
291 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
292 declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
293 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
294 declare function setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
295 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */
296 declare function clearTimeout(timeoutId: number | null): void;
297 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
298 declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
299 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
300 declare function setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
301 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */
302 declare function clearInterval(timeoutId: number | null): void;
303 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */
304 declare function queueMicrotask(task: Function): void;
305 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
306 declare function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
307 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */
308 declare function reportError(error: any): void;
309 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */
310 declare function fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;
311 declare const self: ServiceWorkerGlobalScope;
312 /**
313 * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
314 * The Workers runtime implements the full surface of this API, but with some differences in
315 * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
316 * compared to those implemented in most browsers.
317 *
318 * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
319 */
320 declare const crypto: Crypto;
321 /**
322 * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
323 *
324 * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
325 */
326 declare const caches: CacheStorage;
327 declare const scheduler: Scheduler;
328 /**
329 * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
330 * as well as timing of subrequests and other operations.
331 *
332 * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
333 */
334 declare const performance: Performance;
335 declare const Cloudflare: Cloudflare;
336 declare const origin: string;
337 declare const navigator: Navigator;
338 interface TestController {
339 }
340 interface ExecutionContext {
341 waitUntil(promise: Promise<any>): void;
342 passThroughOnException(): void;
343 props: any;
344 }
345 type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Response | Promise<Response>;
346 type ExportedHandlerTailHandler<Env = unknown> = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;
347 type ExportedHandlerTraceHandler<Env = unknown> = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;
348 type ExportedHandlerTailStreamHandler<Env = unknown> = (event: TailStream.TailEvent, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
349 type ExportedHandlerScheduledHandler<Env = unknown> = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise<void>;
350 type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (batch: MessageBatch<Message>, env: Env, ctx: ExecutionContext) => void | Promise<void>;
351 type ExportedHandlerTestHandler<Env = unknown> = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise<void>;
352 interface ExportedHandler<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown> {
353 fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
354 tail?: ExportedHandlerTailHandler<Env>;
355 trace?: ExportedHandlerTraceHandler<Env>;
356 tailStream?: ExportedHandlerTailStreamHandler<Env>;
357 scheduled?: ExportedHandlerScheduledHandler<Env>;
358 test?: ExportedHandlerTestHandler<Env>;
359 email?: EmailExportedHandler<Env>;
360 queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
361 }
362 interface StructuredSerializeOptions {
363 transfer?: any[];
364 }
365 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
366 declare abstract class PromiseRejectionEvent extends Event {
367 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
368 readonly promise: Promise<any>;
369 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
370 readonly reason: any;
371 }
372 declare abstract class Navigator {
373 sendBeacon(url: string, body?: (ReadableStream | string | (ArrayBuffer | ArrayBufferView) | Blob | FormData | URLSearchParams | URLSearchParams)): boolean;
374 readonly userAgent: string;
375 readonly hardwareConcurrency: number;
376 readonly language: string;
377 readonly languages: string[];
378 }
379 /**
380 * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
381 * as well as timing of subrequests and other operations.
382 *
383 * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
384 */
385 interface Performance {
386 /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
387 readonly timeOrigin: number;
388 /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
389 now(): number;
390 }
391 interface AlarmInvocationInfo {
392 readonly isRetry: boolean;
393 readonly retryCount: number;
394 }
395 interface Cloudflare {
396 readonly compatibilityFlags: Record<string, boolean>;
397 }
398 interface DurableObject {
399 fetch(request: Request): Response | Promise<Response>;
400 alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
401 webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>;
402 webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>;
403 webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
404 }
405 type DurableObjectStub<T extends Rpc.DurableObjectBranded | undefined = undefined> = Fetcher<T, "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"> & {
406 readonly id: DurableObjectId;
407 readonly name?: string;
408 };
409 interface DurableObjectId {
410 toString(): string;
411 equals(other: DurableObjectId): boolean;
412 readonly name?: string;
413 }
414 interface DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {
415 newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
416 idFromName(name: string): DurableObjectId;
417 idFromString(id: string): DurableObjectId;
418 get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
419 jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
420 }
421 type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
422 interface DurableObjectNamespaceNewUniqueIdOptions {
423 jurisdiction?: DurableObjectJurisdiction;
424 }
425 type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
426 interface DurableObjectNamespaceGetDurableObjectOptions {
427 locationHint?: DurableObjectLocationHint;
428 }
429 interface DurableObjectState {
430 waitUntil(promise: Promise<any>): void;
431 readonly id: DurableObjectId;
432 readonly storage: DurableObjectStorage;
433 container?: Container;
434 blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
435 acceptWebSocket(ws: WebSocket, tags?: string[]): void;
436 getWebSockets(tag?: string): WebSocket[];
437 setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
438 getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
439 getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
440 setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
441 getHibernatableWebSocketEventTimeout(): number | null;
442 getTags(ws: WebSocket): string[];
443 abort(reason?: string): void;
444 }
445 interface DurableObjectTransaction {
446 get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
447 get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>;
448 list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>;
449 put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>;
450 put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>;
451 delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
452 delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
453 rollback(): void;
454 getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
455 setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
456 deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
457 }
458 interface DurableObjectStorage {
459 get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
460 get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>;
461 list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>;
462 put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>;
463 put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>;
464 delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
465 delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
466 deleteAll(options?: DurableObjectPutOptions): Promise<void>;
467 transaction<T>(closure: (txn: DurableObjectTransaction) => Promise<T>): Promise<T>;
468 getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
469 setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
470 deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
471 sync(): Promise<void>;
472 sql: SqlStorage;
473 transactionSync<T>(closure: () => T): T;
474 getCurrentBookmark(): Promise<string>;
475 getBookmarkForTime(timestamp: number | Date): Promise<string>;
476 onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
477 }
478 interface DurableObjectListOptions {
479 start?: string;
480 startAfter?: string;
481 end?: string;
482 prefix?: string;
483 reverse?: boolean;
484 limit?: number;
485 allowConcurrency?: boolean;
486 noCache?: boolean;
487 }
488 interface DurableObjectGetOptions {
489 allowConcurrency?: boolean;
490 noCache?: boolean;
491 }
492 interface DurableObjectGetAlarmOptions {
493 allowConcurrency?: boolean;
494 }
495 interface DurableObjectPutOptions {
496 allowConcurrency?: boolean;
497 allowUnconfirmed?: boolean;
498 noCache?: boolean;
499 }
500 interface DurableObjectSetAlarmOptions {
501 allowConcurrency?: boolean;
502 allowUnconfirmed?: boolean;
503 }
504 declare class WebSocketRequestResponsePair {
505 constructor(request: string, response: string);
506 get request(): string;
507 get response(): string;
508 }
509 interface AnalyticsEngineDataset {
510 writeDataPoint(event?: AnalyticsEngineDataPoint): void;
511 }
512 interface AnalyticsEngineDataPoint {
513 indexes?: ((ArrayBuffer | string) | null)[];
514 doubles?: number[];
515 blobs?: ((ArrayBuffer | string) | null)[];
516 }
517 /**
518 * An event which takes place in the DOM.
519 *
520 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
521 */
522 declare class Event {
523 constructor(type: string, init?: EventInit);
524 /**
525 * Returns the type of event, e.g. "click", "hashchange", or "submit".
526 *
527 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
528 */
529 get type(): string;
530 /**
531 * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
532 *
533 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
534 */
535 get eventPhase(): number;
536 /**
537 * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
538 *
539 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
540 */
541 get composed(): boolean;
542 /**
543 * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
544 *
545 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
546 */
547 get bubbles(): boolean;
548 /**
549 * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
550 *
551 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
552 */
553 get cancelable(): boolean;
554 /**
555 * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
556 *
557 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
558 */
559 get defaultPrevented(): boolean;
560 /**
561 * @deprecated
562 *
563 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
564 */
565 get returnValue(): boolean;
566 /**
567 * Returns the object whose event listener's callback is currently being invoked.
568 *
569 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
570 */
571 get currentTarget(): EventTarget | undefined;
572 /**
573 * Returns the object to which event is dispatched (its target).
574 *
575 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
576 */
577 get target(): EventTarget | undefined;
578 /**
579 * @deprecated
580 *
581 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
582 */
583 get srcElement(): EventTarget | undefined;
584 /**
585 * Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
586 *
587 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
588 */
589 get timeStamp(): number;
590 /**
591 * Returns true if event was dispatched by the user agent, and false otherwise.
592 *
593 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
594 */
595 get isTrusted(): boolean;
596 /**
597 * @deprecated
598 *
599 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
600 */
601 get cancelBubble(): boolean;
602 /**
603 * @deprecated
604 *
605 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
606 */
607 set cancelBubble(value: boolean);
608 /**
609 * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
610 *
611 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
612 */
613 stopImmediatePropagation(): void;
614 /**
615 * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
616 *
617 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
618 */
619 preventDefault(): void;
620 /**
621 * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
622 *
623 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
624 */
625 stopPropagation(): void;
626 /**
627 * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
628 *
629 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
630 */
631 composedPath(): EventTarget[];
632 static readonly NONE: number;
633 static readonly CAPTURING_PHASE: number;
634 static readonly AT_TARGET: number;
635 static readonly BUBBLING_PHASE: number;
636 }
637 interface EventInit {
638 bubbles?: boolean;
639 cancelable?: boolean;
640 composed?: boolean;
641 }
642 type EventListener<EventType extends Event = Event> = (event: EventType) => void;
643 interface EventListenerObject<EventType extends Event = Event> {
644 handleEvent(event: EventType): void;
645 }
646 type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
647 /**
648 * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
649 *
650 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
651 */
652 declare class EventTarget<EventMap extends Record<string, Event> = Record<string, Event>> {
653 constructor();
654 /**
655 * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
656 *
657 * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
658 *
659 * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
660 *
661 * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
662 *
663 * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
664 *
665 * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
666 *
667 * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
668 *
669 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
670 */
671 addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
672 /**
673 * Removes the event listener in target's event listener list with the same type, callback, and options.
674 *
675 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
676 */
677 removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
678 /**
679 * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
680 *
681 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
682 */
683 dispatchEvent(event: EventMap[keyof EventMap]): boolean;
684 }
685 interface EventTargetEventListenerOptions {
686 capture?: boolean;
687 }
688 interface EventTargetAddEventListenerOptions {
689 capture?: boolean;
690 passive?: boolean;
691 once?: boolean;
692 signal?: AbortSignal;
693 }
694 interface EventTargetHandlerObject {
695 handleEvent: (event: Event) => any | undefined;
696 }
697 /**
698 * A controller object that allows you to abort one or more DOM requests as and when desired.
699 *
700 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
701 */
702 declare class AbortController {
703 constructor();
704 /**
705 * Returns the AbortSignal object associated with this object.
706 *
707 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
708 */
709 get signal(): AbortSignal;
710 /**
711 * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
712 *
713 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
714 */
715 abort(reason?: any): void;
716 }
717 /**
718 * A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
719 *
720 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
721 */
722 declare abstract class AbortSignal extends EventTarget {
723 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
724 static abort(reason?: any): AbortSignal;
725 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
726 static timeout(delay: number): AbortSignal;
727 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
728 static any(signals: AbortSignal[]): AbortSignal;
729 /**
730 * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
731 *
732 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
733 */
734 get aborted(): boolean;
735 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
736 get reason(): any;
737 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
738 get onabort(): any | null;
739 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
740 set onabort(value: any | null);
741 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
742 throwIfAborted(): void;
743 }
744 interface Scheduler {
745 wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
746 }
747 interface SchedulerWaitOptions {
748 signal?: AbortSignal;
749 }
750 /**
751 * Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
752 *
753 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
754 */
755 declare abstract class ExtendableEvent extends Event {
756 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
757 waitUntil(promise: Promise<any>): void;
758 }
759 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
760 declare class CustomEvent<T = any> extends Event {
761 constructor(type: string, init?: CustomEventCustomEventInit);
762 /**
763 * Returns any custom data event was created with. Typically used for synthetic events.
764 *
765 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
766 */
767 get detail(): T;
768 }
769 interface CustomEventCustomEventInit {
770 bubbles?: boolean;
771 cancelable?: boolean;
772 composed?: boolean;
773 detail?: any;
774 }
775 /**
776 * A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.
777 *
778 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
779 */
780 declare class Blob {
781 constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
782 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
783 get size(): number;
784 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
785 get type(): string;
786 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
787 slice(start?: number, end?: number, type?: string): Blob;
788 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
789 arrayBuffer(): Promise<ArrayBuffer>;
790 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */
791 bytes(): Promise<Uint8Array>;
792 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
793 text(): Promise<string>;
794 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
795 stream(): ReadableStream;
796 }
797 interface BlobOptions {
798 type?: string;
799 }
800 /**
801 * Provides information about files and allows JavaScript in a web page to access their content.
802 *
803 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
804 */
805 declare class File extends Blob {
806 constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
807 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
808 get name(): string;
809 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
810 get lastModified(): number;
811 }
812 interface FileOptions {
813 type?: string;
814 lastModified?: number;
815 }
816 /**
817 * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
818 *
819 * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
820 */
821 declare abstract class CacheStorage {
822 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
823 open(cacheName: string): Promise<Cache>;
824 readonly default: Cache;
825 }
826 /**
827 * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
828 *
829 * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
830 */
831 declare abstract class Cache {
832 /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
833 delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>;
834 /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
835 match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>;
836 /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
837 put(request: RequestInfo | URL, response: Response): Promise<void>;
838 }
839 interface CacheQueryOptions {
840 ignoreMethod?: boolean;
841 }
842 /**
843 * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
844 * The Workers runtime implements the full surface of this API, but with some differences in
845 * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
846 * compared to those implemented in most browsers.
847 *
848 * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
849 */
850 declare abstract class Crypto {
851 /**
852 * Available only in secure contexts.
853 *
854 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
855 */
856 get subtle(): SubtleCrypto;
857 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
858 getRandomValues<T extends Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array>(buffer: T): T;
859 /**
860 * Available only in secure contexts.
861 *
862 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
863 */
864 randomUUID(): string;
865 DigestStream: typeof DigestStream;
866 }
867 /**
868 * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
869 * Available only in secure contexts.
870 *
871 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
872 */
873 declare abstract class SubtleCrypto {
874 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
875 encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
876 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
877 decrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, cipherText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
878 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
879 sign(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
880 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
881 verify(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, signature: ArrayBuffer | ArrayBufferView, data: ArrayBuffer | ArrayBufferView): Promise<boolean>;
882 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
883 digest(algorithm: string | SubtleCryptoHashAlgorithm, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
884 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
885 generateKey(algorithm: string | SubtleCryptoGenerateKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey | CryptoKeyPair>;
886 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
887 deriveKey(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
888 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
889 deriveBits(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
890 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
891 importKey(format: string, keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey, algorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
892 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
893 exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
894 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
895 wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
896 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
897 unwrapKey(format: string, wrappedKey: ArrayBuffer | ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm, unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
898 timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
899 }
900 /**
901 * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
902 * Available only in secure contexts.
903 *
904 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
905 */
906 declare abstract class CryptoKey {
907 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
908 readonly type: string;
909 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
910 readonly extractable: boolean;
911 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
912 readonly algorithm: CryptoKeyKeyAlgorithm | CryptoKeyAesKeyAlgorithm | CryptoKeyHmacKeyAlgorithm | CryptoKeyRsaKeyAlgorithm | CryptoKeyEllipticKeyAlgorithm | CryptoKeyArbitraryKeyAlgorithm;
913 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
914 readonly usages: string[];
915 }
916 interface CryptoKeyPair {
917 publicKey: CryptoKey;
918 privateKey: CryptoKey;
919 }
920 interface JsonWebKey {
921 kty: string;
922 use?: string;
923 key_ops?: string[];
924 alg?: string;
925 ext?: boolean;
926 crv?: string;
927 x?: string;
928 y?: string;
929 d?: string;
930 n?: string;
931 e?: string;
932 p?: string;
933 q?: string;
934 dp?: string;
935 dq?: string;
936 qi?: string;
937 oth?: RsaOtherPrimesInfo[];
938 k?: string;
939 }
940 interface RsaOtherPrimesInfo {
941 r?: string;
942 d?: string;
943 t?: string;
944 }
945 interface SubtleCryptoDeriveKeyAlgorithm {
946 name: string;
947 salt?: (ArrayBuffer | ArrayBufferView);
948 iterations?: number;
949 hash?: (string | SubtleCryptoHashAlgorithm);
950 $public?: CryptoKey;
951 info?: (ArrayBuffer | ArrayBufferView);
952 }
953 interface SubtleCryptoEncryptAlgorithm {
954 name: string;
955 iv?: (ArrayBuffer | ArrayBufferView);
956 additionalData?: (ArrayBuffer | ArrayBufferView);
957 tagLength?: number;
958 counter?: (ArrayBuffer | ArrayBufferView);
959 length?: number;
960 label?: (ArrayBuffer | ArrayBufferView);
961 }
962 interface SubtleCryptoGenerateKeyAlgorithm {
963 name: string;
964 hash?: (string | SubtleCryptoHashAlgorithm);
965 modulusLength?: number;
966 publicExponent?: (ArrayBuffer | ArrayBufferView);
967 length?: number;
968 namedCurve?: string;
969 }
970 interface SubtleCryptoHashAlgorithm {
971 name: string;
972 }
973 interface SubtleCryptoImportKeyAlgorithm {
974 name: string;
975 hash?: (string | SubtleCryptoHashAlgorithm);
976 length?: number;
977 namedCurve?: string;
978 compressed?: boolean;
979 }
980 interface SubtleCryptoSignAlgorithm {
981 name: string;
982 hash?: (string | SubtleCryptoHashAlgorithm);
983 dataLength?: number;
984 saltLength?: number;
985 }
986 interface CryptoKeyKeyAlgorithm {
987 name: string;
988 }
989 interface CryptoKeyAesKeyAlgorithm {
990 name: string;
991 length: number;
992 }
993 interface CryptoKeyHmacKeyAlgorithm {
994 name: string;
995 hash: CryptoKeyKeyAlgorithm;
996 length: number;
997 }
998 interface CryptoKeyRsaKeyAlgorithm {
999 name: string;
1000 modulusLength: number;
1001 publicExponent: ArrayBuffer | ArrayBufferView;
1002 hash?: CryptoKeyKeyAlgorithm;
1003 }
1004 interface CryptoKeyEllipticKeyAlgorithm {
1005 name: string;
1006 namedCurve: string;
1007 }
1008 interface CryptoKeyArbitraryKeyAlgorithm {
1009 name: string;
1010 hash?: CryptoKeyKeyAlgorithm;
1011 namedCurve?: string;
1012 length?: number;
1013 }
1014 declare class DigestStream extends WritableStream<ArrayBuffer | ArrayBufferView> {
1015 constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1016 readonly digest: Promise<ArrayBuffer>;
1017 get bytesWritten(): number | bigint;
1018 }
1019 /**
1020 * A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
1021 *
1022 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1023 */
1024 declare class TextDecoder {
1025 constructor(label?: string, options?: TextDecoderConstructorOptions);
1026 /**
1027 * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
1028 *
1029 * ```
1030 * var string = "", decoder = new TextDecoder(encoding), buffer;
1031 * while(buffer = next_chunk()) {
1032 * string += decoder.decode(buffer, {stream:true});
1033 * }
1034 * string += decoder.decode(); // end-of-queue
1035 * ```
1036 *
1037 * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
1038 *
1039 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
1040 */
1041 decode(input?: (ArrayBuffer | ArrayBufferView), options?: TextDecoderDecodeOptions): string;
1042 get encoding(): string;
1043 get fatal(): boolean;
1044 get ignoreBOM(): boolean;
1045 }
1046 /**
1047 * TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.
1048 *
1049 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
1050 */
1051 declare class TextEncoder {
1052 constructor();
1053 /**
1054 * Returns the result of running UTF-8's encoder.
1055 *
1056 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
1057 */
1058 encode(input?: string): Uint8Array;
1059 /**
1060 * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.
1061 *
1062 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
1063 */
1064 encodeInto(input: string, buffer: ArrayBuffer | ArrayBufferView): TextEncoderEncodeIntoResult;
1065 get encoding(): string;
1066 }
1067 interface TextDecoderConstructorOptions {
1068 fatal: boolean;
1069 ignoreBOM: boolean;
1070 }
1071 interface TextDecoderDecodeOptions {
1072 stream: boolean;
1073 }
1074 interface TextEncoderEncodeIntoResult {
1075 read: number;
1076 written: number;
1077 }
1078 /**
1079 * Events providing information related to errors in scripts or in files.
1080 *
1081 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
1082 */
1083 declare class ErrorEvent extends Event {
1084 constructor(type: string, init?: ErrorEventErrorEventInit);
1085 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1086 get filename(): string;
1087 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1088 get message(): string;
1089 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1090 get lineno(): number;
1091 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1092 get colno(): number;
1093 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1094 get error(): any;
1095 }
1096 interface ErrorEventErrorEventInit {
1097 message?: string;
1098 filename?: string;
1099 lineno?: number;
1100 colno?: number;
1101 error?: any;
1102 }
1103 /**
1104 * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
1105 *
1106 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
1107 */
1108 declare class FormData {
1109 constructor();
1110 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1111 append(name: string, value: string): void;
1112 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1113 append(name: string, value: Blob, filename?: string): void;
1114 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
1115 delete(name: string): void;
1116 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
1117 get(name: string): (File | string) | null;
1118 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
1119 getAll(name: string): (File | string)[];
1120 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
1121 has(name: string): boolean;
1122 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1123 set(name: string, value: string): void;
1124 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1125 set(name: string, value: Blob, filename?: string): void;
1126 /* Returns an array of key, value pairs for every entry in the list. */
1127 entries(): IterableIterator<[
1128 key: string,
1129 value: File | string
1130 ]>;
1131 /* Returns a list of keys in the list. */
1132 keys(): IterableIterator<string>;
1133 /* Returns a list of values in the list. */
1134 values(): IterableIterator<(File | string)>;
1135 forEach<This = unknown>(callback: (this: This, value: File | string, key: string, parent: FormData) => void, thisArg?: This): void;
1136 [Symbol.iterator](): IterableIterator<[
1137 key: string,
1138 value: File | string
1139 ]>;
1140 }
1141 interface ContentOptions {
1142 html?: boolean;
1143 }
1144 declare class HTMLRewriter {
1145 constructor();
1146 on(selector: string, handlers: HTMLRewriterElementContentHandlers): HTMLRewriter;
1147 onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
1148 transform(response: Response): Response;
1149 }
1150 interface HTMLRewriterElementContentHandlers {
1151 element?(element: Element): void | Promise<void>;
1152 comments?(comment: Comment): void | Promise<void>;
1153 text?(element: Text): void | Promise<void>;
1154 }
1155 interface HTMLRewriterDocumentContentHandlers {
1156 doctype?(doctype: Doctype): void | Promise<void>;
1157 comments?(comment: Comment): void | Promise<void>;
1158 text?(text: Text): void | Promise<void>;
1159 end?(end: DocumentEnd): void | Promise<void>;
1160 }
1161 interface Doctype {
1162 readonly name: string | null;
1163 readonly publicId: string | null;
1164 readonly systemId: string | null;
1165 }
1166 interface Element {
1167 tagName: string;
1168 readonly attributes: IterableIterator<string[]>;
1169 readonly removed: boolean;
1170 readonly namespaceURI: string;
1171 getAttribute(name: string): string | null;
1172 hasAttribute(name: string): boolean;
1173 setAttribute(name: string, value: string): Element;
1174 removeAttribute(name: string): Element;
1175 before(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1176 after(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1177 prepend(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1178 append(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1179 replace(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1180 remove(): Element;
1181 removeAndKeepContent(): Element;
1182 setInnerContent(content: string | ReadableStream | Response, options?: ContentOptions): Element;
1183 onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
1184 }
1185 interface EndTag {
1186 name: string;
1187 before(content: string | ReadableStream | Response, options?: ContentOptions): EndTag;
1188 after(content: string | ReadableStream | Response, options?: ContentOptions): EndTag;
1189 remove(): EndTag;
1190 }
1191 interface Comment {
1192 text: string;
1193 readonly removed: boolean;
1194 before(content: string, options?: ContentOptions): Comment;
1195 after(content: string, options?: ContentOptions): Comment;
1196 replace(content: string, options?: ContentOptions): Comment;
1197 remove(): Comment;
1198 }
1199 interface Text {
1200 readonly text: string;
1201 readonly lastInTextNode: boolean;
1202 readonly removed: boolean;
1203 before(content: string | ReadableStream | Response, options?: ContentOptions): Text;
1204 after(content: string | ReadableStream | Response, options?: ContentOptions): Text;
1205 replace(content: string | ReadableStream | Response, options?: ContentOptions): Text;
1206 remove(): Text;
1207 }
1208 interface DocumentEnd {
1209 append(content: string, options?: ContentOptions): DocumentEnd;
1210 }
1211 /**
1212 * This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.
1213 *
1214 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
1215 */
1216 declare abstract class FetchEvent extends ExtendableEvent {
1217 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1218 readonly request: Request;
1219 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1220 respondWith(promise: Response | Promise<Response>): void;
1221 passThroughOnException(): void;
1222 }
1223 type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
1224 /**
1225 * This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence.
1226 *
1227 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
1228 */
1229 declare class Headers {
1230 constructor(init?: HeadersInit);
1231 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
1232 get(name: string): string | null;
1233 getAll(name: string): string[];
1234 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */
1235 getSetCookie(): string[];
1236 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
1237 has(name: string): boolean;
1238 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
1239 set(name: string, value: string): void;
1240 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
1241 append(name: string, value: string): void;
1242 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
1243 delete(name: string): void;
1244 forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
1245 /* Returns an iterator allowing to go through all key/value pairs contained in this object. */
1246 entries(): IterableIterator<[
1247 key: string,
1248 value: string
1249 ]>;
1250 /* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1251 keys(): IterableIterator<string>;
1252 /* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1253 values(): IterableIterator<string>;
1254 [Symbol.iterator](): IterableIterator<[
1255 key: string,
1256 value: string
1257 ]>;
1258 }
1259 type BodyInit = ReadableStream<Uint8Array> | string | ArrayBuffer | ArrayBufferView | Blob | URLSearchParams | FormData;
1260 declare abstract class Body {
1261 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
1262 get body(): ReadableStream | null;
1263 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
1264 get bodyUsed(): boolean;
1265 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
1266 arrayBuffer(): Promise<ArrayBuffer>;
1267 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */
1268 bytes(): Promise<Uint8Array>;
1269 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
1270 text(): Promise<string>;
1271 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
1272 json<T>(): Promise<T>;
1273 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
1274 formData(): Promise<FormData>;
1275 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
1276 blob(): Promise<Blob>;
1277 }
1278 /**
1279 * This Fetch API interface represents the response to a request.
1280 *
1281 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1282 */
1283 declare var Response: {
1284 prototype: Response;
1285 new (body?: BodyInit | null, init?: ResponseInit): Response;
1286 error(): Response;
1287 redirect(url: string, status?: number): Response;
1288 json(any: any, maybeInit?: (ResponseInit | Response)): Response;
1289 };
1290 /**
1291 * This Fetch API interface represents the response to a request.
1292 *
1293 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1294 */
1295 interface Response extends Body {
1296 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1297 clone(): Response;
1298 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1299 status: number;
1300 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1301 statusText: string;
1302 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1303 headers: Headers;
1304 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1305 ok: boolean;
1306 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1307 redirected: boolean;
1308 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1309 url: string;
1310 webSocket: WebSocket | null;
1311 cf: any | undefined;
1312 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type) */
1313 type: "default" | "error";
1314 }
1315 interface ResponseInit {
1316 status?: number;
1317 statusText?: string;
1318 headers?: HeadersInit;
1319 cf?: any;
1320 webSocket?: (WebSocket | null);
1321 encodeBody?: "automatic" | "manual";
1322 }
1323 type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> = Request<CfHostMetadata, Cf> | string;
1324 /**
1325 * This Fetch API interface represents a resource request.
1326 *
1327 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1328 */
1329 declare var Request: {
1330 prototype: Request;
1331 new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(input: RequestInfo<CfProperties> | URL, init?: RequestInit<Cf>): Request<CfHostMetadata, Cf>;
1332 };
1333 /**
1334 * This Fetch API interface represents a resource request.
1335 *
1336 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1337 */
1338 interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
1339 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1340 clone(): Request<CfHostMetadata, Cf>;
1341 /**
1342 * Returns request's HTTP method, which is "GET" by default.
1343 *
1344 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1345 */
1346 method: string;
1347 /**
1348 * Returns the URL of request as a string.
1349 *
1350 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
1351 */
1352 url: string;
1353 /**
1354 * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
1355 *
1356 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1357 */
1358 headers: Headers;
1359 /**
1360 * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
1361 *
1362 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
1363 */
1364 redirect: string;
1365 fetcher: Fetcher | null;
1366 /**
1367 * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
1368 *
1369 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
1370 */
1371 signal: AbortSignal;
1372 cf: Cf | undefined;
1373 /**
1374 * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
1375 *
1376 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
1377 */
1378 integrity: string;
1379 /**
1380 * Returns a boolean indicating whether or not request can outlive the global in which it was created.
1381 *
1382 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1383 */
1384 keepalive: boolean;
1385 /**
1386 * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
1387 *
1388 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
1389 */
1390 cache?: "no-store";
1391 }
1392 interface RequestInit<Cf = CfProperties> {
1393 /* A string to set request's method. */
1394 method?: string;
1395 /* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
1396 headers?: HeadersInit;
1397 /* A BodyInit object or null to set request's body. */
1398 body?: BodyInit | null;
1399 /* 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. */
1400 redirect?: string;
1401 fetcher?: (Fetcher | null);
1402 cf?: Cf;
1403 /* A string indicating how the request will interact with the browser's cache to set request's cache. */
1404 cache?: "no-store";
1405 /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1406 integrity?: string;
1407 /* An AbortSignal to set request's signal. */
1408 signal?: (AbortSignal | null);
1409 encodeResponseBody?: "automatic" | "manual";
1410 }
1411 type Service<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = Fetcher<T>;
1412 type Fetcher<T extends Rpc.EntrypointBranded | undefined = undefined, Reserved extends string = never> = (T extends Rpc.EntrypointBranded ? Rpc.Provider<T, Reserved | "fetch" | "connect"> : unknown) & {
1413 fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
1414 connect(address: SocketAddress | string, options?: SocketOptions): Socket;
1415 };
1416 interface KVNamespaceListKey<Metadata, Key extends string = string> {
1417 name: Key;
1418 expiration?: number;
1419 metadata?: Metadata;
1420 }
1421 type KVNamespaceListResult<Metadata, Key extends string = string> = {
1422 list_complete: false;
1423 keys: KVNamespaceListKey<Metadata, Key>[];
1424 cursor: string;
1425 cacheStatus: string | null;
1426 } | {
1427 list_complete: true;
1428 keys: KVNamespaceListKey<Metadata, Key>[];
1429 cacheStatus: string | null;
1430 };
1431 interface KVNamespace<Key extends string = string> {
1432 get(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<string | null>;
1433 get(key: Key, type: "text"): Promise<string | null>;
1434 get<ExpectedValue = unknown>(key: Key, type: "json"): Promise<ExpectedValue | null>;
1435 get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
1436 get(key: Key, type: "stream"): Promise<ReadableStream | null>;
1437 get(key: Key, options?: KVNamespaceGetOptions<"text">): Promise<string | null>;
1438 get<ExpectedValue = unknown>(key: Key, options?: KVNamespaceGetOptions<"json">): Promise<ExpectedValue | null>;
1439 get(key: Key, options?: KVNamespaceGetOptions<"arrayBuffer">): Promise<ArrayBuffer | null>;
1440 get(key: Key, options?: KVNamespaceGetOptions<"stream">): Promise<ReadableStream | null>;
1441 get(key: Array<Key>, type: "text"): Promise<Map<string, string | null>>;
1442 get<ExpectedValue = unknown>(key: Array<Key>, type: "json"): Promise<Map<string, ExpectedValue | null>>;
1443 get(key: Array<Key>, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<Map<string, string | null>>;
1444 get(key: Array<Key>, options?: KVNamespaceGetOptions<"text">): Promise<Map<string, string | null>>;
1445 get<ExpectedValue = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"json">): Promise<Map<string, ExpectedValue | null>>;
1446 list<Metadata = unknown>(options?: KVNamespaceListOptions): Promise<KVNamespaceListResult<Metadata, Key>>;
1447 put(key: Key, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: KVNamespacePutOptions): Promise<void>;
1448 getWithMetadata<Metadata = unknown>(key: Key, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1449 getWithMetadata<Metadata = unknown>(key: Key, type: "text"): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1450 getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, type: "json"): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1451 getWithMetadata<Metadata = unknown>(key: Key, type: "arrayBuffer"): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1452 getWithMetadata<Metadata = unknown>(key: Key, type: "stream"): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1453 getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"text">): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1454 getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"json">): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1455 getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"arrayBuffer">): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1456 getWithMetadata<Metadata = unknown>(key: Key, options: KVNamespaceGetOptions<"stream">): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1457 getWithMetadata<Metadata = unknown>(key: Array<Key>, type: "text"): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1458 getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Array<Key>, type: "json"): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>;
1459 getWithMetadata<Metadata = unknown>(key: Array<Key>, options?: Partial<KVNamespaceGetOptions<undefined>>): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1460 getWithMetadata<Metadata = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"text">): Promise<Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>>;
1461 getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(key: Array<Key>, options?: KVNamespaceGetOptions<"json">): Promise<Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>>;
1462 delete(key: Key): Promise<void>;
1463 }
1464 interface KVNamespaceListOptions {
1465 limit?: number;
1466 prefix?: (string | null);
1467 cursor?: (string | null);
1468 }
1469 interface KVNamespaceGetOptions<Type> {
1470 type: Type;
1471 cacheTtl?: number;
1472 }
1473 interface KVNamespacePutOptions {
1474 expiration?: number;
1475 expirationTtl?: number;
1476 metadata?: (any | null);
1477 }
1478 interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
1479 value: Value | null;
1480 metadata: Metadata | null;
1481 cacheStatus: string | null;
1482 }
1483 type QueueContentType = "text" | "bytes" | "json" | "v8";
1484 interface Queue<Body = unknown> {
1485 send(message: Body, options?: QueueSendOptions): Promise<void>;
1486 sendBatch(messages: Iterable<MessageSendRequest<Body>>, options?: QueueSendBatchOptions): Promise<void>;
1487 }
1488 interface QueueSendOptions {
1489 contentType?: QueueContentType;
1490 delaySeconds?: number;
1491 }
1492 interface QueueSendBatchOptions {
1493 delaySeconds?: number;
1494 }
1495 interface MessageSendRequest<Body = unknown> {
1496 body: Body;
1497 contentType?: QueueContentType;
1498 delaySeconds?: number;
1499 }
1500 interface QueueRetryOptions {
1501 delaySeconds?: number;
1502 }
1503 interface Message<Body = unknown> {
1504 readonly id: string;
1505 readonly timestamp: Date;
1506 readonly body: Body;
1507 readonly attempts: number;
1508 retry(options?: QueueRetryOptions): void;
1509 ack(): void;
1510 }
1511 interface QueueEvent<Body = unknown> extends ExtendableEvent {
1512 readonly messages: readonly Message<Body>[];
1513 readonly queue: string;
1514 retryAll(options?: QueueRetryOptions): void;
1515 ackAll(): void;
1516 }
1517 interface MessageBatch<Body = unknown> {
1518 readonly messages: readonly Message<Body>[];
1519 readonly queue: string;
1520 retryAll(options?: QueueRetryOptions): void;
1521 ackAll(): void;
1522 }
1523 interface R2Error extends Error {
1524 readonly name: string;
1525 readonly code: number;
1526 readonly message: string;
1527 readonly action: string;
1528 readonly stack: any;
1529 }
1530 interface R2ListOptions {
1531 limit?: number;
1532 prefix?: string;
1533 cursor?: string;
1534 delimiter?: string;
1535 startAfter?: string;
1536 include?: ("httpMetadata" | "customMetadata")[];
1537 }
1538 declare abstract class R2Bucket {
1539 head(key: string): Promise<R2Object | null>;
1540 get(key: string, options: R2GetOptions & {
1541 onlyIf: R2Conditional | Headers;
1542 }): Promise<R2ObjectBody | R2Object | null>;
1543 get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
1544 put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions & {
1545 onlyIf: R2Conditional | Headers;
1546 }): Promise<R2Object | null>;
1547 put(key: string, value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, options?: R2PutOptions): Promise<R2Object>;
1548 createMultipartUpload(key: string, options?: R2MultipartOptions): Promise<R2MultipartUpload>;
1549 resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
1550 delete(keys: string | string[]): Promise<void>;
1551 list(options?: R2ListOptions): Promise<R2Objects>;
1552 }
1553 interface R2MultipartUpload {
1554 readonly key: string;
1555 readonly uploadId: string;
1556 uploadPart(partNumber: number, value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob, options?: R2UploadPartOptions): Promise<R2UploadedPart>;
1557 abort(): Promise<void>;
1558 complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
1559 }
1560 interface R2UploadedPart {
1561 partNumber: number;
1562 etag: string;
1563 }
1564 declare abstract class R2Object {
1565 readonly key: string;
1566 readonly version: string;
1567 readonly size: number;
1568 readonly etag: string;
1569 readonly httpEtag: string;
1570 readonly checksums: R2Checksums;
1571 readonly uploaded: Date;
1572 readonly httpMetadata?: R2HTTPMetadata;
1573 readonly customMetadata?: Record<string, string>;
1574 readonly range?: R2Range;
1575 readonly storageClass: string;
1576 readonly ssecKeyMd5?: string;
1577 writeHttpMetadata(headers: Headers): void;
1578 }
1579 interface R2ObjectBody extends R2Object {
1580 get body(): ReadableStream;
1581 get bodyUsed(): boolean;
1582 arrayBuffer(): Promise<ArrayBuffer>;
1583 bytes(): Promise<Uint8Array>;
1584 text(): Promise<string>;
1585 json<T>(): Promise<T>;
1586 blob(): Promise<Blob>;
1587 }
1588 type R2Range = {
1589 offset: number;
1590 length?: number;
1591 } | {
1592 offset?: number;
1593 length: number;
1594 } | {
1595 suffix: number;
1596 };
1597 interface R2Conditional {
1598 etagMatches?: string;
1599 etagDoesNotMatch?: string;
1600 uploadedBefore?: Date;
1601 uploadedAfter?: Date;
1602 secondsGranularity?: boolean;
1603 }
1604 interface R2GetOptions {
1605 onlyIf?: (R2Conditional | Headers);
1606 range?: (R2Range | Headers);
1607 ssecKey?: (ArrayBuffer | string);
1608 }
1609 interface R2PutOptions {
1610 onlyIf?: (R2Conditional | Headers);
1611 httpMetadata?: (R2HTTPMetadata | Headers);
1612 customMetadata?: Record<string, string>;
1613 md5?: ((ArrayBuffer | ArrayBufferView) | string);
1614 sha1?: ((ArrayBuffer | ArrayBufferView) | string);
1615 sha256?: ((ArrayBuffer | ArrayBufferView) | string);
1616 sha384?: ((ArrayBuffer | ArrayBufferView) | string);
1617 sha512?: ((ArrayBuffer | ArrayBufferView) | string);
1618 storageClass?: string;
1619 ssecKey?: (ArrayBuffer | string);
1620 }
1621 interface R2MultipartOptions {
1622 httpMetadata?: (R2HTTPMetadata | Headers);
1623 customMetadata?: Record<string, string>;
1624 storageClass?: string;
1625 ssecKey?: (ArrayBuffer | string);
1626 }
1627 interface R2Checksums {
1628 readonly md5?: ArrayBuffer;
1629 readonly sha1?: ArrayBuffer;
1630 readonly sha256?: ArrayBuffer;
1631 readonly sha384?: ArrayBuffer;
1632 readonly sha512?: ArrayBuffer;
1633 toJSON(): R2StringChecksums;
1634 }
1635 interface R2StringChecksums {
1636 md5?: string;
1637 sha1?: string;
1638 sha256?: string;
1639 sha384?: string;
1640 sha512?: string;
1641 }
1642 interface R2HTTPMetadata {
1643 contentType?: string;
1644 contentLanguage?: string;
1645 contentDisposition?: string;
1646 contentEncoding?: string;
1647 cacheControl?: string;
1648 cacheExpiry?: Date;
1649 }
1650 type R2Objects = {
1651 objects: R2Object[];
1652 delimitedPrefixes: string[];
1653 } & ({
1654 truncated: true;
1655 cursor: string;
1656 } | {
1657 truncated: false;
1658 });
1659 interface R2UploadPartOptions {
1660 ssecKey?: (ArrayBuffer | string);
1661 }
1662 declare abstract class ScheduledEvent extends ExtendableEvent {
1663 readonly scheduledTime: number;
1664 readonly cron: string;
1665 noRetry(): void;
1666 }
1667 interface ScheduledController {
1668 readonly scheduledTime: number;
1669 readonly cron: string;
1670 noRetry(): void;
1671 }
1672 interface QueuingStrategy<T = any> {
1673 highWaterMark?: (number | bigint);
1674 size?: (chunk: T) => number | bigint;
1675 }
1676 interface UnderlyingSink<W = any> {
1677 type?: string;
1678 start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
1679 write?: (chunk: W, controller: WritableStreamDefaultController) => void | Promise<void>;
1680 abort?: (reason: any) => void | Promise<void>;
1681 close?: () => void | Promise<void>;
1682 }
1683 interface UnderlyingByteSource {
1684 type: "bytes";
1685 autoAllocateChunkSize?: number;
1686 start?: (controller: ReadableByteStreamController) => void | Promise<void>;
1687 pull?: (controller: ReadableByteStreamController) => void | Promise<void>;
1688 cancel?: (reason: any) => void | Promise<void>;
1689 }
1690 interface UnderlyingSource<R = any> {
1691 type?: "" | undefined;
1692 start?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>;
1693 pull?: (controller: ReadableStreamDefaultController<R>) => void | Promise<void>;
1694 cancel?: (reason: any) => void | Promise<void>;
1695 expectedLength?: (number | bigint);
1696 }
1697 interface Transformer<I = any, O = any> {
1698 readableType?: string;
1699 writableType?: string;
1700 start?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>;
1701 transform?: (chunk: I, controller: TransformStreamDefaultController<O>) => void | Promise<void>;
1702 flush?: (controller: TransformStreamDefaultController<O>) => void | Promise<void>;
1703 cancel?: (reason: any) => void | Promise<void>;
1704 expectedLength?: number;
1705 }
1706 interface StreamPipeOptions {
1707 /**
1708 * 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.
1709 *
1710 * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
1711 *
1712 * Errors and closures of the source and destination streams propagate as follows:
1713 *
1714 * 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.
1715 *
1716 * 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.
1717 *
1718 * 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.
1719 *
1720 * 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.
1721 *
1722 * 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.
1723 */
1724 preventClose?: boolean;
1725 preventAbort?: boolean;
1726 preventCancel?: boolean;
1727 signal?: AbortSignal;
1728 }
1729 type ReadableStreamReadResult<R = any> = {
1730 done: false;
1731 value: R;
1732 } | {
1733 done: true;
1734 value?: undefined;
1735 };
1736 /**
1737 * This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
1738 *
1739 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1740 */
1741 interface ReadableStream<R = any> {
1742 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
1743 get locked(): boolean;
1744 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
1745 cancel(reason?: any): Promise<void>;
1746 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1747 getReader(): ReadableStreamDefaultReader<R>;
1748 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1749 getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
1750 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
1751 pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
1752 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
1753 pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
1754 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
1755 tee(): [
1756 ReadableStream<R>,
1757 ReadableStream<R>
1758 ];
1759 values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1760 [Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1761 }
1762 /**
1763 * This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
1764 *
1765 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1766 */
1767 declare const ReadableStream: {
1768 prototype: ReadableStream;
1769 new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
1770 new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
1771 };
1772 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
1773 declare class ReadableStreamDefaultReader<R = any> {
1774 constructor(stream: ReadableStream);
1775 get closed(): Promise<void>;
1776 cancel(reason?: any): Promise<void>;
1777 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
1778 read(): Promise<ReadableStreamReadResult<R>>;
1779 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
1780 releaseLock(): void;
1781 }
1782 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
1783 declare class ReadableStreamBYOBReader {
1784 constructor(stream: ReadableStream);
1785 get closed(): Promise<void>;
1786 cancel(reason?: any): Promise<void>;
1787 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
1788 read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
1789 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
1790 releaseLock(): void;
1791 readAtLeast<T extends ArrayBufferView>(minElements: number, view: T): Promise<ReadableStreamReadResult<T>>;
1792 }
1793 interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
1794 min?: number;
1795 }
1796 interface ReadableStreamGetReaderOptions {
1797 /**
1798 * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
1799 *
1800 * 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.
1801 */
1802 mode: "byob";
1803 }
1804 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
1805 declare abstract class ReadableStreamBYOBRequest {
1806 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
1807 get view(): Uint8Array | null;
1808 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
1809 respond(bytesWritten: number): void;
1810 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
1811 respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
1812 get atLeast(): number | null;
1813 }
1814 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
1815 declare abstract class ReadableStreamDefaultController<R = any> {
1816 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
1817 get desiredSize(): number | null;
1818 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
1819 close(): void;
1820 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
1821 enqueue(chunk?: R): void;
1822 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
1823 error(reason: any): void;
1824 }
1825 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
1826 declare abstract class ReadableByteStreamController {
1827 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
1828 get byobRequest(): ReadableStreamBYOBRequest | null;
1829 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
1830 get desiredSize(): number | null;
1831 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
1832 close(): void;
1833 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
1834 enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
1835 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
1836 error(reason: any): void;
1837 }
1838 /**
1839 * This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.
1840 *
1841 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
1842 */
1843 declare abstract class WritableStreamDefaultController {
1844 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
1845 get signal(): AbortSignal;
1846 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
1847 error(reason?: any): void;
1848 }
1849 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
1850 declare abstract class TransformStreamDefaultController<O = any> {
1851 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
1852 get desiredSize(): number | null;
1853 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
1854 enqueue(chunk?: O): void;
1855 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
1856 error(reason: any): void;
1857 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
1858 terminate(): void;
1859 }
1860 interface ReadableWritablePair<R = any, W = any> {
1861 /**
1862 * 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.
1863 *
1864 * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
1865 */
1866 writable: WritableStream<W>;
1867 readable: ReadableStream<R>;
1868 }
1869 /**
1870 * This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
1871 *
1872 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
1873 */
1874 declare class WritableStream<W = any> {
1875 constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
1876 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
1877 get locked(): boolean;
1878 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
1879 abort(reason?: any): Promise<void>;
1880 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
1881 close(): Promise<void>;
1882 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
1883 getWriter(): WritableStreamDefaultWriter<W>;
1884 }
1885 /**
1886 * This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink.
1887 *
1888 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
1889 */
1890 declare class WritableStreamDefaultWriter<W = any> {
1891 constructor(stream: WritableStream);
1892 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
1893 get closed(): Promise<void>;
1894 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
1895 get ready(): Promise<void>;
1896 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
1897 get desiredSize(): number | null;
1898 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
1899 abort(reason?: any): Promise<void>;
1900 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
1901 close(): Promise<void>;
1902 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
1903 write(chunk?: W): Promise<void>;
1904 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
1905 releaseLock(): void;
1906 }
1907 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
1908 declare class TransformStream<I = any, O = any> {
1909 constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
1910 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
1911 get readable(): ReadableStream<O>;
1912 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
1913 get writable(): WritableStream<I>;
1914 }
1915 declare class FixedLengthStream extends IdentityTransformStream {
1916 constructor(expectedLength: number | bigint, queuingStrategy?: IdentityTransformStreamQueuingStrategy);
1917 }
1918 declare class IdentityTransformStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
1919 constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
1920 }
1921 interface IdentityTransformStreamQueuingStrategy {
1922 highWaterMark?: (number | bigint);
1923 }
1924 interface ReadableStreamValuesOptions {
1925 preventCancel?: boolean;
1926 }
1927 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
1928 declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
1929 constructor(format: "gzip" | "deflate" | "deflate-raw");
1930 }
1931 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
1932 declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
1933 constructor(format: "gzip" | "deflate" | "deflate-raw");
1934 }
1935 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
1936 declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
1937 constructor();
1938 get encoding(): string;
1939 }
1940 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
1941 declare class TextDecoderStream extends TransformStream<ArrayBuffer | ArrayBufferView, string> {
1942 constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
1943 get encoding(): string;
1944 get fatal(): boolean;
1945 get ignoreBOM(): boolean;
1946 }
1947 interface TextDecoderStreamTextDecoderStreamInit {
1948 fatal?: boolean;
1949 ignoreBOM?: boolean;
1950 }
1951 /**
1952 * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
1953 *
1954 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
1955 */
1956 declare class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> {
1957 constructor(init: QueuingStrategyInit);
1958 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
1959 get highWaterMark(): number;
1960 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
1961 get size(): (chunk?: any) => number;
1962 }
1963 /**
1964 * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
1965 *
1966 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
1967 */
1968 declare class CountQueuingStrategy implements QueuingStrategy {
1969 constructor(init: QueuingStrategyInit);
1970 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
1971 get highWaterMark(): number;
1972 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
1973 get size(): (chunk?: any) => number;
1974 }
1975 interface QueuingStrategyInit {
1976 /**
1977 * Creates a new ByteLengthQueuingStrategy with the provided high water mark.
1978 *
1979 * 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.
1980 */
1981 highWaterMark: number;
1982 }
1983 interface ScriptVersion {
1984 id?: string;
1985 tag?: string;
1986 message?: string;
1987 }
1988 declare abstract class TailEvent extends ExtendableEvent {
1989 readonly events: TraceItem[];
1990 readonly traces: TraceItem[];
1991 }
1992 interface TraceItem {
1993 readonly event: (TraceItemFetchEventInfo | TraceItemJsRpcEventInfo | TraceItemScheduledEventInfo | TraceItemAlarmEventInfo | TraceItemQueueEventInfo | TraceItemEmailEventInfo | TraceItemTailEventInfo | TraceItemCustomEventInfo | TraceItemHibernatableWebSocketEventInfo) | null;
1994 readonly eventTimestamp: number | null;
1995 readonly logs: TraceLog[];
1996 readonly exceptions: TraceException[];
1997 readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
1998 readonly scriptName: string | null;
1999 readonly entrypoint?: string;
2000 readonly scriptVersion?: ScriptVersion;
2001 readonly dispatchNamespace?: string;
2002 readonly scriptTags?: string[];
2003 readonly outcome: string;
2004 readonly executionModel: string;
2005 readonly truncated: boolean;
2006 readonly cpuTime: number;
2007 readonly wallTime: number;
2008 }
2009 interface TraceItemAlarmEventInfo {
2010 readonly scheduledTime: Date;
2011 }
2012 interface TraceItemCustomEventInfo {
2013 }
2014 interface TraceItemScheduledEventInfo {
2015 readonly scheduledTime: number;
2016 readonly cron: string;
2017 }
2018 interface TraceItemQueueEventInfo {
2019 readonly queue: string;
2020 readonly batchSize: number;
2021 }
2022 interface TraceItemEmailEventInfo {
2023 readonly mailFrom: string;
2024 readonly rcptTo: string;
2025 readonly rawSize: number;
2026 }
2027 interface TraceItemTailEventInfo {
2028 readonly consumedEvents: TraceItemTailEventInfoTailItem[];
2029 }
2030 interface TraceItemTailEventInfoTailItem {
2031 readonly scriptName: string | null;
2032 }
2033 interface TraceItemFetchEventInfo {
2034 readonly response?: TraceItemFetchEventInfoResponse;
2035 readonly request: TraceItemFetchEventInfoRequest;
2036 }
2037 interface TraceItemFetchEventInfoRequest {
2038 readonly cf?: any;
2039 readonly headers: Record<string, string>;
2040 readonly method: string;
2041 readonly url: string;
2042 getUnredacted(): TraceItemFetchEventInfoRequest;
2043 }
2044 interface TraceItemFetchEventInfoResponse {
2045 readonly status: number;
2046 }
2047 interface TraceItemJsRpcEventInfo {
2048 readonly rpcMethod: string;
2049 }
2050 interface TraceItemHibernatableWebSocketEventInfo {
2051 readonly getWebSocketEvent: TraceItemHibernatableWebSocketEventInfoMessage | TraceItemHibernatableWebSocketEventInfoClose | TraceItemHibernatableWebSocketEventInfoError;
2052 }
2053 interface TraceItemHibernatableWebSocketEventInfoMessage {
2054 readonly webSocketEventType: string;
2055 }
2056 interface TraceItemHibernatableWebSocketEventInfoClose {
2057 readonly webSocketEventType: string;
2058 readonly code: number;
2059 readonly wasClean: boolean;
2060 }
2061 interface TraceItemHibernatableWebSocketEventInfoError {
2062 readonly webSocketEventType: string;
2063 }
2064 interface TraceLog {
2065 readonly timestamp: number;
2066 readonly level: string;
2067 readonly message: any;
2068 }
2069 interface TraceException {
2070 readonly timestamp: number;
2071 readonly message: string;
2072 readonly name: string;
2073 readonly stack?: string;
2074 }
2075 interface TraceDiagnosticChannelEvent {
2076 readonly timestamp: number;
2077 readonly channel: string;
2078 readonly message: any;
2079 }
2080 interface TraceMetrics {
2081 readonly cpuTime: number;
2082 readonly wallTime: number;
2083 }
2084 interface UnsafeTraceMetrics {
2085 fromTrace(item: TraceItem): TraceMetrics;
2086 }
2087 /**
2088 * The URL interface represents an object providing static methods used for creating object URLs.
2089 *
2090 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
2091 */
2092 declare class URL {
2093 constructor(url: string | URL, base?: string | URL);
2094 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
2095 get origin(): string;
2096 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2097 get href(): string;
2098 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2099 set href(value: string);
2100 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2101 get protocol(): string;
2102 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2103 set protocol(value: string);
2104 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2105 get username(): string;
2106 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2107 set username(value: string);
2108 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2109 get password(): string;
2110 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2111 set password(value: string);
2112 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2113 get host(): string;
2114 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2115 set host(value: string);
2116 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2117 get hostname(): string;
2118 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2119 set hostname(value: string);
2120 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2121 get port(): string;
2122 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2123 set port(value: string);
2124 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2125 get pathname(): string;
2126 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2127 set pathname(value: string);
2128 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2129 get search(): string;
2130 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2131 set search(value: string);
2132 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2133 get hash(): string;
2134 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2135 set hash(value: string);
2136 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
2137 get searchParams(): URLSearchParams;
2138 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
2139 toJSON(): string;
2140 /*function toString() { [native code] }*/
2141 toString(): string;
2142 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
2143 static canParse(url: string, base?: string): boolean;
2144 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
2145 static parse(url: string, base?: string): URL | null;
2146 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
2147 static createObjectURL(object: File | Blob): string;
2148 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
2149 static revokeObjectURL(object_url: string): void;
2150 }
2151 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
2152 declare class URLSearchParams {
2153 constructor(init?: (Iterable<Iterable<string>> | Record<string, string> | string));
2154 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
2155 get size(): number;
2156 /**
2157 * Appends a specified key/value pair as a new search parameter.
2158 *
2159 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
2160 */
2161 append(name: string, value: string): void;
2162 /**
2163 * Deletes the given search parameter, and its associated value, from the list of all search parameters.
2164 *
2165 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
2166 */
2167 delete(name: string, value?: string): void;
2168 /**
2169 * Returns the first value associated to the given search parameter.
2170 *
2171 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
2172 */
2173 get(name: string): string | null;
2174 /**
2175 * Returns all the values association with a given search parameter.
2176 *
2177 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
2178 */
2179 getAll(name: string): string[];
2180 /**
2181 * Returns a Boolean indicating if such a search parameter exists.
2182 *
2183 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
2184 */
2185 has(name: string, value?: string): boolean;
2186 /**
2187 * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
2188 *
2189 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
2190 */
2191 set(name: string, value: string): void;
2192 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
2193 sort(): void;
2194 /* Returns an array of key, value pairs for every entry in the search params. */
2195 entries(): IterableIterator<[
2196 key: string,
2197 value: string
2198 ]>;
2199 /* Returns a list of keys in the search params. */
2200 keys(): IterableIterator<string>;
2201 /* Returns a list of values in the search params. */
2202 values(): IterableIterator<string>;
2203 forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: URLSearchParams) => void, thisArg?: This): void;
2204 /*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
2205 toString(): string;
2206 [Symbol.iterator](): IterableIterator<[
2207 key: string,
2208 value: string
2209 ]>;
2210 }
2211 declare class URLPattern {
2212 constructor(input?: (string | URLPatternInit), baseURL?: (string | URLPatternOptions), patternOptions?: URLPatternOptions);
2213 get protocol(): string;
2214 get username(): string;
2215 get password(): string;
2216 get hostname(): string;
2217 get port(): string;
2218 get pathname(): string;
2219 get search(): string;
2220 get hash(): string;
2221 get hasRegExpGroups(): boolean;
2222 test(input?: (string | URLPatternInit), baseURL?: string): boolean;
2223 exec(input?: (string | URLPatternInit), baseURL?: string): URLPatternResult | null;
2224 }
2225 interface URLPatternInit {
2226 protocol?: string;
2227 username?: string;
2228 password?: string;
2229 hostname?: string;
2230 port?: string;
2231 pathname?: string;
2232 search?: string;
2233 hash?: string;
2234 baseURL?: string;
2235 }
2236 interface URLPatternComponentResult {
2237 input: string;
2238 groups: Record<string, string>;
2239 }
2240 interface URLPatternResult {
2241 inputs: (string | URLPatternInit)[];
2242 protocol: URLPatternComponentResult;
2243 username: URLPatternComponentResult;
2244 password: URLPatternComponentResult;
2245 hostname: URLPatternComponentResult;
2246 port: URLPatternComponentResult;
2247 pathname: URLPatternComponentResult;
2248 search: URLPatternComponentResult;
2249 hash: URLPatternComponentResult;
2250 }
2251 interface URLPatternOptions {
2252 ignoreCase?: boolean;
2253 }
2254 /**
2255 * A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.
2256 *
2257 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
2258 */
2259 declare class CloseEvent extends Event {
2260 constructor(type: string, initializer?: CloseEventInit);
2261 /**
2262 * Returns the WebSocket connection close code provided by the server.
2263 *
2264 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
2265 */
2266 readonly code: number;
2267 /**
2268 * Returns the WebSocket connection close reason provided by the server.
2269 *
2270 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
2271 */
2272 readonly reason: string;
2273 /**
2274 * Returns true if the connection closed cleanly; false otherwise.
2275 *
2276 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
2277 */
2278 readonly wasClean: boolean;
2279 }
2280 interface CloseEventInit {
2281 code?: number;
2282 reason?: string;
2283 wasClean?: boolean;
2284 }
2285 /**
2286 * A message received by a target object.
2287 *
2288 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
2289 */
2290 declare class MessageEvent extends Event {
2291 constructor(type: string, initializer: MessageEventInit);
2292 /**
2293 * Returns the data of the message.
2294 *
2295 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
2296 */
2297 readonly data: ArrayBuffer | string;
2298 }
2299 interface MessageEventInit {
2300 data: ArrayBuffer | string;
2301 }
2302 type WebSocketEventMap = {
2303 close: CloseEvent;
2304 message: MessageEvent;
2305 open: Event;
2306 error: ErrorEvent;
2307 };
2308 /**
2309 * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2310 *
2311 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2312 */
2313 declare var WebSocket: {
2314 prototype: WebSocket;
2315 new (url: string, protocols?: (string[] | string)): WebSocket;
2316 readonly READY_STATE_CONNECTING: number;
2317 readonly CONNECTING: number;
2318 readonly READY_STATE_OPEN: number;
2319 readonly OPEN: number;
2320 readonly READY_STATE_CLOSING: number;
2321 readonly CLOSING: number;
2322 readonly READY_STATE_CLOSED: number;
2323 readonly CLOSED: number;
2324 };
2325 /**
2326 * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2327 *
2328 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2329 */
2330 interface WebSocket extends EventTarget<WebSocketEventMap> {
2331 accept(): void;
2332 /**
2333 * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
2334 *
2335 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
2336 */
2337 send(message: (ArrayBuffer | ArrayBufferView) | string): void;
2338 /**
2339 * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
2340 *
2341 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
2342 */
2343 close(code?: number, reason?: string): void;
2344 serializeAttachment(attachment: any): void;
2345 deserializeAttachment(): any | null;
2346 /**
2347 * Returns the state of the WebSocket object's connection. It can have the values described below.
2348 *
2349 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2350 */
2351 readyState: number;
2352 /**
2353 * Returns the URL that was used to establish the WebSocket connection.
2354 *
2355 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2356 */
2357 url: string | null;
2358 /**
2359 * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
2360 *
2361 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2362 */
2363 protocol: string | null;
2364 /**
2365 * Returns the extensions selected by the server, if any.
2366 *
2367 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2368 */
2369 extensions: string | null;
2370 }
2371 declare const WebSocketPair: {
2372 new (): {
2373 0: WebSocket;
2374 1: WebSocket;
2375 };
2376 };
2377 interface SqlStorage {
2378 exec<T extends Record<string, SqlStorageValue>>(query: string, ...bindings: any[]): SqlStorageCursor<T>;
2379 get databaseSize(): number;
2380 Cursor: typeof SqlStorageCursor;
2381 Statement: typeof SqlStorageStatement;
2382 }
2383 declare abstract class SqlStorageStatement {
2384 }
2385 type SqlStorageValue = ArrayBuffer | string | number | null;
2386 declare abstract class SqlStorageCursor<T extends Record<string, SqlStorageValue>> {
2387 next(): {
2388 done?: false;
2389 value: T;
2390 } | {
2391 done: true;
2392 value?: never;
2393 };
2394 toArray(): T[];
2395 one(): T;
2396 raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
2397 columnNames: string[];
2398 get rowsRead(): number;
2399 get rowsWritten(): number;
2400 [Symbol.iterator](): IterableIterator<T>;
2401 }
2402 interface Socket {
2403 get readable(): ReadableStream;
2404 get writable(): WritableStream;
2405 get closed(): Promise<void>;
2406 get opened(): Promise<SocketInfo>;
2407 get upgraded(): boolean;
2408 get secureTransport(): "on" | "off" | "starttls";
2409 close(): Promise<void>;
2410 startTls(options?: TlsOptions): Socket;
2411 }
2412 interface SocketOptions {
2413 secureTransport?: string;
2414 allowHalfOpen: boolean;
2415 highWaterMark?: (number | bigint);
2416 }
2417 interface SocketAddress {
2418 hostname: string;
2419 port: number;
2420 }
2421 interface TlsOptions {
2422 expectedServerHostname?: string;
2423 }
2424 interface SocketInfo {
2425 remoteAddress?: string;
2426 localAddress?: string;
2427 }
2428 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
2429 declare class EventSource extends EventTarget {
2430 constructor(url: string, init?: EventSourceEventSourceInit);
2431 /**
2432 * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
2433 *
2434 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
2435 */
2436 close(): void;
2437 /**
2438 * Returns the URL providing the event stream.
2439 *
2440 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
2441 */
2442 get url(): string;
2443 /**
2444 * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
2445 *
2446 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
2447 */
2448 get withCredentials(): boolean;
2449 /**
2450 * Returns the state of this EventSource object's connection. It can have the values described below.
2451 *
2452 * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
2453 */
2454 get readyState(): number;
2455 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
2456 get onopen(): any | null;
2457 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
2458 set onopen(value: any | null);
2459 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
2460 get onmessage(): any | null;
2461 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
2462 set onmessage(value: any | null);
2463 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
2464 get onerror(): any | null;
2465 /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
2466 set onerror(value: any | null);
2467 static readonly CONNECTING: number;
2468 static readonly OPEN: number;
2469 static readonly CLOSED: number;
2470 static from(stream: ReadableStream): EventSource;
2471 }
2472 interface EventSourceEventSourceInit {
2473 withCredentials?: boolean;
2474 fetcher?: Fetcher;
2475 }
2476 interface Container {
2477 get running(): boolean;
2478 start(options?: ContainerStartupOptions): void;
2479 monitor(): Promise<void>;
2480 destroy(error?: any): Promise<void>;
2481 signal(signo: number): void;
2482 getTcpPort(port: number): Fetcher;
2483 }
2484 interface ContainerStartupOptions {
2485 entrypoint?: string[];
2486 enableInternet: boolean;
2487 env?: Record<string, string>;
2488 }
2489 type AiImageClassificationInput = {
2490 image: number[];
2491 };
2492 type AiImageClassificationOutput = {
2493 score?: number;
2494 label?: string;
2495 }[];
2496 declare abstract class BaseAiImageClassification {
2497 inputs: AiImageClassificationInput;
2498 postProcessedOutputs: AiImageClassificationOutput;
2499 }
2500 type AiImageToTextInput = {
2501 image: number[];
2502 prompt?: string;
2503 max_tokens?: number;
2504 temperature?: number;
2505 top_p?: number;
2506 top_k?: number;
2507 seed?: number;
2508 repetition_penalty?: number;
2509 frequency_penalty?: number;
2510 presence_penalty?: number;
2511 raw?: boolean;
2512 messages?: RoleScopedChatInput[];
2513 };
2514 type AiImageToTextOutput = {
2515 description: string;
2516 };
2517 declare abstract class BaseAiImageToText {
2518 inputs: AiImageToTextInput;
2519 postProcessedOutputs: AiImageToTextOutput;
2520 }
2521 type AiImageTextToTextInput = {
2522 image: string;
2523 prompt?: string;
2524 max_tokens?: number;
2525 temperature?: number;
2526 ignore_eos?: boolean;
2527 top_p?: number;
2528 top_k?: number;
2529 seed?: number;
2530 repetition_penalty?: number;
2531 frequency_penalty?: number;
2532 presence_penalty?: number;
2533 raw?: boolean;
2534 messages?: RoleScopedChatInput[];
2535 };
2536 type AiImageTextToTextOutput = {
2537 description: string;
2538 };
2539 declare abstract class BaseAiImageTextToText {
2540 inputs: AiImageTextToTextInput;
2541 postProcessedOutputs: AiImageTextToTextOutput;
2542 }
2543 type AiObjectDetectionInput = {
2544 image: number[];
2545 };
2546 type AiObjectDetectionOutput = {
2547 score?: number;
2548 label?: string;
2549 }[];
2550 declare abstract class BaseAiObjectDetection {
2551 inputs: AiObjectDetectionInput;
2552 postProcessedOutputs: AiObjectDetectionOutput;
2553 }
2554 type AiSentenceSimilarityInput = {
2555 source: string;
2556 sentences: string[];
2557 };
2558 type AiSentenceSimilarityOutput = number[];
2559 declare abstract class BaseAiSentenceSimilarity {
2560 inputs: AiSentenceSimilarityInput;
2561 postProcessedOutputs: AiSentenceSimilarityOutput;
2562 }
2563 type AiAutomaticSpeechRecognitionInput = {
2564 audio: number[];
2565 };
2566 type AiAutomaticSpeechRecognitionOutput = {
2567 text?: string;
2568 words?: {
2569 word: string;
2570 start: number;
2571 end: number;
2572 }[];
2573 vtt?: string;
2574 };
2575 declare abstract class BaseAiAutomaticSpeechRecognition {
2576 inputs: AiAutomaticSpeechRecognitionInput;
2577 postProcessedOutputs: AiAutomaticSpeechRecognitionOutput;
2578 }
2579 type AiSummarizationInput = {
2580 input_text: string;
2581 max_length?: number;
2582 };
2583 type AiSummarizationOutput = {
2584 summary: string;
2585 };
2586 declare abstract class BaseAiSummarization {
2587 inputs: AiSummarizationInput;
2588 postProcessedOutputs: AiSummarizationOutput;
2589 }
2590 type AiTextClassificationInput = {
2591 text: string;
2592 };
2593 type AiTextClassificationOutput = {
2594 score?: number;
2595 label?: string;
2596 }[];
2597 declare abstract class BaseAiTextClassification {
2598 inputs: AiTextClassificationInput;
2599 postProcessedOutputs: AiTextClassificationOutput;
2600 }
2601 type AiTextEmbeddingsInput = {
2602 text: string | string[];
2603 };
2604 type AiTextEmbeddingsOutput = {
2605 shape: number[];
2606 data: number[][];
2607 };
2608 declare abstract class BaseAiTextEmbeddings {
2609 inputs: AiTextEmbeddingsInput;
2610 postProcessedOutputs: AiTextEmbeddingsOutput;
2611 }
2612 type RoleScopedChatInput = {
2613 role: "user" | "assistant" | "system" | "tool" | (string & NonNullable<unknown>);
2614 content: string;
2615 name?: string;
2616 };
2617 type AiTextGenerationToolLegacyInput = {
2618 name: string;
2619 description: string;
2620 parameters?: {
2621 type: "object" | (string & NonNullable<unknown>);
2622 properties: {
2623 [key: string]: {
2624 type: string;
2625 description?: string;
2626 };
2627 };
2628 required: string[];
2629 };
2630 };
2631 type AiTextGenerationToolInput = {
2632 type: "function" | (string & NonNullable<unknown>);
2633 function: {
2634 name: string;
2635 description: string;
2636 parameters?: {
2637 type: "object" | (string & NonNullable<unknown>);
2638 properties: {
2639 [key: string]: {
2640 type: string;
2641 description?: string;
2642 };
2643 };
2644 required: string[];
2645 };
2646 };
2647 };
2648 type AiTextGenerationFunctionsInput = {
2649 name: string;
2650 code: string;
2651 };
2652 type AiTextGenerationResponseFormat = {
2653 type: string;
2654 json_schema?: any;
2655 };
2656 type AiTextGenerationInput = {
2657 prompt?: string;
2658 raw?: boolean;
2659 stream?: boolean;
2660 max_tokens?: number;
2661 temperature?: number;
2662 top_p?: number;
2663 top_k?: number;
2664 seed?: number;
2665 repetition_penalty?: number;
2666 frequency_penalty?: number;
2667 presence_penalty?: number;
2668 messages?: RoleScopedChatInput[];
2669 response_format?: AiTextGenerationResponseFormat;
2670 tools?: AiTextGenerationToolInput[] | AiTextGenerationToolLegacyInput[] | (object & NonNullable<unknown>);
2671 functions?: AiTextGenerationFunctionsInput[];
2672 };
2673 type AiTextGenerationOutput = {
2674 response?: string;
2675 tool_calls?: {
2676 name: string;
2677 arguments: unknown;
2678 }[];
2679 };
2680 declare abstract class BaseAiTextGeneration {
2681 inputs: AiTextGenerationInput;
2682 postProcessedOutputs: AiTextGenerationOutput;
2683 }
2684 type AiTextToSpeechInput = {
2685 prompt: string;
2686 lang?: string;
2687 };
2688 type AiTextToSpeechOutput = Uint8Array | {
2689 audio: string;
2690 };
2691 declare abstract class BaseAiTextToSpeech {
2692 inputs: AiTextToSpeechInput;
2693 postProcessedOutputs: AiTextToSpeechOutput;
2694 }
2695 type AiTextToImageInput = {
2696 prompt: string;
2697 negative_prompt?: string;
2698 height?: number;
2699 width?: number;
2700 image?: number[];
2701 image_b64?: string;
2702 mask?: number[];
2703 num_steps?: number;
2704 strength?: number;
2705 guidance?: number;
2706 seed?: number;
2707 };
2708 type AiTextToImageOutput = ReadableStream<Uint8Array>;
2709 declare abstract class BaseAiTextToImage {
2710 inputs: AiTextToImageInput;
2711 postProcessedOutputs: AiTextToImageOutput;
2712 }
2713 type AiTranslationInput = {
2714 text: string;
2715 target_lang: string;
2716 source_lang?: string;
2717 };
2718 type AiTranslationOutput = {
2719 translated_text?: string;
2720 };
2721 declare abstract class BaseAiTranslation {
2722 inputs: AiTranslationInput;
2723 postProcessedOutputs: AiTranslationOutput;
2724 }
2725 type Ai_Cf_Baai_Bge_Base_En_V1_5_Input = {
2726 text: string | string[];
2727 /**
2728 * 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.
2729 */
2730 pooling?: "mean" | "cls";
2731 } | {
2732 /**
2733 * Batch of the embeddings requests to run using async-queue
2734 */
2735 requests: {
2736 text: string | string[];
2737 /**
2738 * 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.
2739 */
2740 pooling?: "mean" | "cls";
2741 }[];
2742 };
2743 type Ai_Cf_Baai_Bge_Base_En_V1_5_Output = {
2744 shape?: number[];
2745 /**
2746 * Embeddings of the requested text values
2747 */
2748 data?: number[][];
2749 /**
2750 * The pooling method used in the embedding process.
2751 */
2752 pooling?: "mean" | "cls";
2753 } | AsyncResponse;
2754 interface AsyncResponse {
2755 /**
2756 * The async request id that can be used to obtain the results.
2757 */
2758 request_id?: string;
2759 }
2760 declare abstract class Base_Ai_Cf_Baai_Bge_Base_En_V1_5 {
2761 inputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Input;
2762 postProcessedOutputs: Ai_Cf_Baai_Bge_Base_En_V1_5_Output;
2763 }
2764 type Ai_Cf_Openai_Whisper_Input = string | {
2765 /**
2766 * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
2767 */
2768 audio: number[];
2769 };
2770 interface Ai_Cf_Openai_Whisper_Output {
2771 /**
2772 * The transcription
2773 */
2774 text: string;
2775 word_count?: number;
2776 words?: {
2777 word?: string;
2778 /**
2779 * The second this word begins in the recording
2780 */
2781 start?: number;
2782 /**
2783 * The ending second when the word completes
2784 */
2785 end?: number;
2786 }[];
2787 vtt?: string;
2788 }
2789 declare abstract class Base_Ai_Cf_Openai_Whisper {
2790 inputs: Ai_Cf_Openai_Whisper_Input;
2791 postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
2792 }
2793 type Ai_Cf_Meta_M2M100_1_2B_Input = {
2794 /**
2795 * The text to be translated
2796 */
2797 text: string;
2798 /**
2799 * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
2800 */
2801 source_lang?: string;
2802 /**
2803 * The language code to translate the text into (e.g., 'es' for Spanish)
2804 */
2805 target_lang: string;
2806 } | {
2807 /**
2808 * Batch of the embeddings requests to run using async-queue
2809 */
2810 requests: {
2811 /**
2812 * The text to be translated
2813 */
2814 text: string;
2815 /**
2816 * The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
2817 */
2818 source_lang?: string;
2819 /**
2820 * The language code to translate the text into (e.g., 'es' for Spanish)
2821 */
2822 target_lang: string;
2823 }[];
2824 };
2825 type Ai_Cf_Meta_M2M100_1_2B_Output = {
2826 /**
2827 * The translated text in the target language
2828 */
2829 translated_text?: string;
2830 } | AsyncResponse;
2831 declare abstract class Base_Ai_Cf_Meta_M2M100_1_2B {
2832 inputs: Ai_Cf_Meta_M2M100_1_2B_Input;
2833 postProcessedOutputs: Ai_Cf_Meta_M2M100_1_2B_Output;
2834 }
2835 type Ai_Cf_Baai_Bge_Small_En_V1_5_Input = {
2836 text: string | string[];
2837 /**
2838 * 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.
2839 */
2840 pooling?: "mean" | "cls";
2841 } | {
2842 /**
2843 * Batch of the embeddings requests to run using async-queue
2844 */
2845 requests: {
2846 text: string | string[];
2847 /**
2848 * 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.
2849 */
2850 pooling?: "mean" | "cls";
2851 }[];
2852 };
2853 type Ai_Cf_Baai_Bge_Small_En_V1_5_Output = {
2854 shape?: number[];
2855 /**
2856 * Embeddings of the requested text values
2857 */
2858 data?: number[][];
2859 /**
2860 * The pooling method used in the embedding process.
2861 */
2862 pooling?: "mean" | "cls";
2863 } | AsyncResponse;
2864 declare abstract class Base_Ai_Cf_Baai_Bge_Small_En_V1_5 {
2865 inputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Input;
2866 postProcessedOutputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Output;
2867 }
2868 type Ai_Cf_Baai_Bge_Large_En_V1_5_Input = {
2869 text: string | string[];
2870 /**
2871 * 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.
2872 */
2873 pooling?: "mean" | "cls";
2874 } | {
2875 /**
2876 * Batch of the embeddings requests to run using async-queue
2877 */
2878 requests: {
2879 text: string | string[];
2880 /**
2881 * 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.
2882 */
2883 pooling?: "mean" | "cls";
2884 }[];
2885 };
2886 type Ai_Cf_Baai_Bge_Large_En_V1_5_Output = {
2887 shape?: number[];
2888 /**
2889 * Embeddings of the requested text values
2890 */
2891 data?: number[][];
2892 /**
2893 * The pooling method used in the embedding process.
2894 */
2895 pooling?: "mean" | "cls";
2896 } | AsyncResponse;
2897 declare abstract class Base_Ai_Cf_Baai_Bge_Large_En_V1_5 {
2898 inputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Input;
2899 postProcessedOutputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Output;
2900 }
2901 type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input = string | {
2902 /**
2903 * The input text prompt for the model to generate a response.
2904 */
2905 prompt?: string;
2906 /**
2907 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
2908 */
2909 raw?: boolean;
2910 /**
2911 * 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.
2912 */
2913 top_p?: number;
2914 /**
2915 * 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.
2916 */
2917 top_k?: number;
2918 /**
2919 * Random seed for reproducibility of the generation.
2920 */
2921 seed?: number;
2922 /**
2923 * Penalty for repeated tokens; higher values discourage repetition.
2924 */
2925 repetition_penalty?: number;
2926 /**
2927 * Decreases the likelihood of the model repeating the same lines verbatim.
2928 */
2929 frequency_penalty?: number;
2930 /**
2931 * Increases the likelihood of the model introducing new topics.
2932 */
2933 presence_penalty?: number;
2934 image: number[] | (string & NonNullable<unknown>);
2935 /**
2936 * The maximum number of tokens to generate in the response.
2937 */
2938 max_tokens?: number;
2939 };
2940 interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {
2941 description?: string;
2942 }
2943 declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {
2944 inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input;
2945 postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output;
2946 }
2947 type Ai_Cf_Openai_Whisper_Tiny_En_Input = string | {
2948 /**
2949 * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
2950 */
2951 audio: number[];
2952 };
2953 interface Ai_Cf_Openai_Whisper_Tiny_En_Output {
2954 /**
2955 * The transcription
2956 */
2957 text: string;
2958 word_count?: number;
2959 words?: {
2960 word?: string;
2961 /**
2962 * The second this word begins in the recording
2963 */
2964 start?: number;
2965 /**
2966 * The ending second when the word completes
2967 */
2968 end?: number;
2969 }[];
2970 vtt?: string;
2971 }
2972 declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
2973 inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input;
2974 postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;
2975 }
2976 interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
2977 /**
2978 * Base64 encoded value of the audio data.
2979 */
2980 audio: string;
2981 /**
2982 * Supported tasks are 'translate' or 'transcribe'.
2983 */
2984 task?: string;
2985 /**
2986 * The language of the audio being transcribed or translated.
2987 */
2988 language?: string;
2989 /**
2990 * Preprocess the audio with a voice activity detection model.
2991 */
2992 vad_filter?: boolean;
2993 /**
2994 * A text prompt to help provide context to the model on the contents of the audio.
2995 */
2996 initial_prompt?: string;
2997 /**
2998 * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
2999 */
3000 prefix?: string;
3001 }
3002 interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
3003 transcription_info?: {
3004 /**
3005 * The language of the audio being transcribed or translated.
3006 */
3007 language?: string;
3008 /**
3009 * The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1.
3010 */
3011 language_probability?: number;
3012 /**
3013 * The total duration of the original audio file, in seconds.
3014 */
3015 duration?: number;
3016 /**
3017 * The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds.
3018 */
3019 duration_after_vad?: number;
3020 };
3021 /**
3022 * The complete transcription of the audio.
3023 */
3024 text: string;
3025 /**
3026 * The total number of words in the transcription.
3027 */
3028 word_count?: number;
3029 segments?: {
3030 /**
3031 * The starting time of the segment within the audio, in seconds.
3032 */
3033 start?: number;
3034 /**
3035 * The ending time of the segment within the audio, in seconds.
3036 */
3037 end?: number;
3038 /**
3039 * The transcription of the segment.
3040 */
3041 text?: string;
3042 /**
3043 * The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs.
3044 */
3045 temperature?: number;
3046 /**
3047 * The average log probability of the predictions for the words in this segment, indicating overall confidence.
3048 */
3049 avg_logprob?: number;
3050 /**
3051 * The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process.
3052 */
3053 compression_ratio?: number;
3054 /**
3055 * The probability that the segment contains no speech, represented as a decimal between 0 and 1.
3056 */
3057 no_speech_prob?: number;
3058 words?: {
3059 /**
3060 * The individual word transcribed from the audio.
3061 */
3062 word?: string;
3063 /**
3064 * The starting time of the word within the audio, in seconds.
3065 */
3066 start?: number;
3067 /**
3068 * The ending time of the word within the audio, in seconds.
3069 */
3070 end?: number;
3071 }[];
3072 }[];
3073 /**
3074 * The transcription in WebVTT format, which includes timing and text information for use in subtitles.
3075 */
3076 vtt?: string;
3077 }
3078 declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
3079 inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
3080 postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
3081 }
3082 type Ai_Cf_Baai_Bge_M3_Input = BGEM3InputQueryAndContexts | BGEM3InputEmbedding | {
3083 /**
3084 * Batch of the embeddings requests to run using async-queue
3085 */
3086 requests: (BGEM3InputQueryAndContexts1 | BGEM3InputEmbedding1)[];
3087 };
3088 interface BGEM3InputQueryAndContexts {
3089 /**
3090 * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3091 */
3092 query?: string;
3093 /**
3094 * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3095 */
3096 contexts: {
3097 /**
3098 * One of the provided context content
3099 */
3100 text?: string;
3101 }[];
3102 /**
3103 * When provided with too long context should the model error out or truncate the context to fit?
3104 */
3105 truncate_inputs?: boolean;
3106 }
3107 interface BGEM3InputEmbedding {
3108 text: string | string[];
3109 /**
3110 * When provided with too long context should the model error out or truncate the context to fit?
3111 */
3112 truncate_inputs?: boolean;
3113 }
3114 interface BGEM3InputQueryAndContexts1 {
3115 /**
3116 * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3117 */
3118 query?: string;
3119 /**
3120 * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3121 */
3122 contexts: {
3123 /**
3124 * One of the provided context content
3125 */
3126 text?: string;
3127 }[];
3128 /**
3129 * When provided with too long context should the model error out or truncate the context to fit?
3130 */
3131 truncate_inputs?: boolean;
3132 }
3133 interface BGEM3InputEmbedding1 {
3134 text: string | string[];
3135 /**
3136 * When provided with too long context should the model error out or truncate the context to fit?
3137 */
3138 truncate_inputs?: boolean;
3139 }
3140 type Ai_Cf_Baai_Bge_M3_Output = BGEM3OuputQuery | BGEM3OutputEmbeddingForContexts | BGEM3OuputEmbedding | AsyncResponse;
3141 interface BGEM3OuputQuery {
3142 response?: {
3143 /**
3144 * Index of the context in the request
3145 */
3146 id?: number;
3147 /**
3148 * Score of the context under the index.
3149 */
3150 score?: number;
3151 }[];
3152 }
3153 interface BGEM3OutputEmbeddingForContexts {
3154 response?: number[][];
3155 shape?: number[];
3156 /**
3157 * The pooling method used in the embedding process.
3158 */
3159 pooling?: "mean" | "cls";
3160 }
3161 interface BGEM3OuputEmbedding {
3162 shape?: number[];
3163 /**
3164 * Embeddings of the requested text values
3165 */
3166 data?: number[][];
3167 /**
3168 * The pooling method used in the embedding process.
3169 */
3170 pooling?: "mean" | "cls";
3171 }
3172 declare abstract class Base_Ai_Cf_Baai_Bge_M3 {
3173 inputs: Ai_Cf_Baai_Bge_M3_Input;
3174 postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output;
3175 }
3176 interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
3177 /**
3178 * A text description of the image you want to generate.
3179 */
3180 prompt: string;
3181 /**
3182 * The number of diffusion steps; higher values can improve quality but take longer.
3183 */
3184 steps?: number;
3185 }
3186 interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output {
3187 /**
3188 * The generated image in Base64 format.
3189 */
3190 image?: string;
3191 }
3192 declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell {
3193 inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input;
3194 postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output;
3195 }
3196 type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Prompt | Messages;
3197 interface Prompt {
3198 /**
3199 * The input text prompt for the model to generate a response.
3200 */
3201 prompt: string;
3202 image?: number[] | (string & NonNullable<unknown>);
3203 /**
3204 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3205 */
3206 raw?: boolean;
3207 /**
3208 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3209 */
3210 stream?: boolean;
3211 /**
3212 * The maximum number of tokens to generate in the response.
3213 */
3214 max_tokens?: number;
3215 /**
3216 * Controls the randomness of the output; higher values produce more random results.
3217 */
3218 temperature?: number;
3219 /**
3220 * 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.
3221 */
3222 top_p?: number;
3223 /**
3224 * 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.
3225 */
3226 top_k?: number;
3227 /**
3228 * Random seed for reproducibility of the generation.
3229 */
3230 seed?: number;
3231 /**
3232 * Penalty for repeated tokens; higher values discourage repetition.
3233 */
3234 repetition_penalty?: number;
3235 /**
3236 * Decreases the likelihood of the model repeating the same lines verbatim.
3237 */
3238 frequency_penalty?: number;
3239 /**
3240 * Increases the likelihood of the model introducing new topics.
3241 */
3242 presence_penalty?: number;
3243 /**
3244 * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3245 */
3246 lora?: string;
3247 }
3248 interface Messages {
3249 /**
3250 * An array of message objects representing the conversation history.
3251 */
3252 messages: {
3253 /**
3254 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3255 */
3256 role?: string;
3257 /**
3258 * 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
3259 */
3260 tool_call_id?: string;
3261 content?: string | {
3262 /**
3263 * Type of the content provided
3264 */
3265 type?: string;
3266 text?: string;
3267 image_url?: {
3268 /**
3269 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3270 */
3271 url?: string;
3272 };
3273 }[] | {
3274 /**
3275 * Type of the content provided
3276 */
3277 type?: string;
3278 text?: string;
3279 image_url?: {
3280 /**
3281 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3282 */
3283 url?: string;
3284 };
3285 };
3286 }[];
3287 image?: number[] | (string & NonNullable<unknown>);
3288 functions?: {
3289 name: string;
3290 code: string;
3291 }[];
3292 /**
3293 * A list of tools available for the assistant to use.
3294 */
3295 tools?: ({
3296 /**
3297 * The name of the tool. More descriptive the better.
3298 */
3299 name: string;
3300 /**
3301 * A brief description of what the tool does.
3302 */
3303 description: string;
3304 /**
3305 * Schema defining the parameters accepted by the tool.
3306 */
3307 parameters: {
3308 /**
3309 * The type of the parameters object (usually 'object').
3310 */
3311 type: string;
3312 /**
3313 * List of required parameter names.
3314 */
3315 required?: string[];
3316 /**
3317 * Definitions of each parameter.
3318 */
3319 properties: {
3320 [k: string]: {
3321 /**
3322 * The data type of the parameter.
3323 */
3324 type: string;
3325 /**
3326 * A description of the expected parameter.
3327 */
3328 description: string;
3329 };
3330 };
3331 };
3332 } | {
3333 /**
3334 * Specifies the type of tool (e.g., 'function').
3335 */
3336 type: string;
3337 /**
3338 * Details of the function tool.
3339 */
3340 function: {
3341 /**
3342 * The name of the function.
3343 */
3344 name: string;
3345 /**
3346 * A brief description of what the function does.
3347 */
3348 description: string;
3349 /**
3350 * Schema defining the parameters accepted by the function.
3351 */
3352 parameters: {
3353 /**
3354 * The type of the parameters object (usually 'object').
3355 */
3356 type: string;
3357 /**
3358 * List of required parameter names.
3359 */
3360 required?: string[];
3361 /**
3362 * Definitions of each parameter.
3363 */
3364 properties: {
3365 [k: string]: {
3366 /**
3367 * The data type of the parameter.
3368 */
3369 type: string;
3370 /**
3371 * A description of the expected parameter.
3372 */
3373 description: string;
3374 };
3375 };
3376 };
3377 };
3378 })[];
3379 /**
3380 * If true, the response will be streamed back incrementally.
3381 */
3382 stream?: boolean;
3383 /**
3384 * The maximum number of tokens to generate in the response.
3385 */
3386 max_tokens?: number;
3387 /**
3388 * Controls the randomness of the output; higher values produce more random results.
3389 */
3390 temperature?: number;
3391 /**
3392 * 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.
3393 */
3394 top_p?: number;
3395 /**
3396 * 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.
3397 */
3398 top_k?: number;
3399 /**
3400 * Random seed for reproducibility of the generation.
3401 */
3402 seed?: number;
3403 /**
3404 * Penalty for repeated tokens; higher values discourage repetition.
3405 */
3406 repetition_penalty?: number;
3407 /**
3408 * Decreases the likelihood of the model repeating the same lines verbatim.
3409 */
3410 frequency_penalty?: number;
3411 /**
3412 * Increases the likelihood of the model introducing new topics.
3413 */
3414 presence_penalty?: number;
3415 }
3416 type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output = {
3417 /**
3418 * The generated text response from the model
3419 */
3420 response?: string;
3421 /**
3422 * An array of tool calls requests made during the response generation
3423 */
3424 tool_calls?: {
3425 /**
3426 * The arguments passed to be passed to the tool call request
3427 */
3428 arguments?: object;
3429 /**
3430 * The name of the tool to be called
3431 */
3432 name?: string;
3433 }[];
3434 };
3435 declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct {
3436 inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input;
3437 postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output;
3438 }
3439 type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input = Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt | Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages | AsyncBatch;
3440 interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt {
3441 /**
3442 * The input text prompt for the model to generate a response.
3443 */
3444 prompt: string;
3445 /**
3446 * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3447 */
3448 lora?: string;
3449 response_format?: JSONMode;
3450 /**
3451 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3452 */
3453 raw?: boolean;
3454 /**
3455 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3456 */
3457 stream?: boolean;
3458 /**
3459 * The maximum number of tokens to generate in the response.
3460 */
3461 max_tokens?: number;
3462 /**
3463 * Controls the randomness of the output; higher values produce more random results.
3464 */
3465 temperature?: number;
3466 /**
3467 * 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.
3468 */
3469 top_p?: number;
3470 /**
3471 * 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.
3472 */
3473 top_k?: number;
3474 /**
3475 * Random seed for reproducibility of the generation.
3476 */
3477 seed?: number;
3478 /**
3479 * Penalty for repeated tokens; higher values discourage repetition.
3480 */
3481 repetition_penalty?: number;
3482 /**
3483 * Decreases the likelihood of the model repeating the same lines verbatim.
3484 */
3485 frequency_penalty?: number;
3486 /**
3487 * Increases the likelihood of the model introducing new topics.
3488 */
3489 presence_penalty?: number;
3490 }
3491 interface JSONMode {
3492 type?: "json_object" | "json_schema";
3493 json_schema?: unknown;
3494 }
3495 interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {
3496 /**
3497 * An array of message objects representing the conversation history.
3498 */
3499 messages: {
3500 /**
3501 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3502 */
3503 role: string;
3504 /**
3505 * The content of the message as a string.
3506 */
3507 content: string;
3508 }[];
3509 functions?: {
3510 name: string;
3511 code: string;
3512 }[];
3513 /**
3514 * A list of tools available for the assistant to use.
3515 */
3516 tools?: ({
3517 /**
3518 * The name of the tool. More descriptive the better.
3519 */
3520 name: string;
3521 /**
3522 * A brief description of what the tool does.
3523 */
3524 description: string;
3525 /**
3526 * Schema defining the parameters accepted by the tool.
3527 */
3528 parameters: {
3529 /**
3530 * The type of the parameters object (usually 'object').
3531 */
3532 type: string;
3533 /**
3534 * List of required parameter names.
3535 */
3536 required?: string[];
3537 /**
3538 * Definitions of each parameter.
3539 */
3540 properties: {
3541 [k: string]: {
3542 /**
3543 * The data type of the parameter.
3544 */
3545 type: string;
3546 /**
3547 * A description of the expected parameter.
3548 */
3549 description: string;
3550 };
3551 };
3552 };
3553 } | {
3554 /**
3555 * Specifies the type of tool (e.g., 'function').
3556 */
3557 type: string;
3558 /**
3559 * Details of the function tool.
3560 */
3561 function: {
3562 /**
3563 * The name of the function.
3564 */
3565 name: string;
3566 /**
3567 * A brief description of what the function does.
3568 */
3569 description: string;
3570 /**
3571 * Schema defining the parameters accepted by the function.
3572 */
3573 parameters: {
3574 /**
3575 * The type of the parameters object (usually 'object').
3576 */
3577 type: string;
3578 /**
3579 * List of required parameter names.
3580 */
3581 required?: string[];
3582 /**
3583 * Definitions of each parameter.
3584 */
3585 properties: {
3586 [k: string]: {
3587 /**
3588 * The data type of the parameter.
3589 */
3590 type: string;
3591 /**
3592 * A description of the expected parameter.
3593 */
3594 description: string;
3595 };
3596 };
3597 };
3598 };
3599 })[];
3600 response_format?: JSONMode;
3601 /**
3602 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3603 */
3604 raw?: boolean;
3605 /**
3606 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3607 */
3608 stream?: boolean;
3609 /**
3610 * The maximum number of tokens to generate in the response.
3611 */
3612 max_tokens?: number;
3613 /**
3614 * Controls the randomness of the output; higher values produce more random results.
3615 */
3616 temperature?: number;
3617 /**
3618 * 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.
3619 */
3620 top_p?: number;
3621 /**
3622 * 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.
3623 */
3624 top_k?: number;
3625 /**
3626 * Random seed for reproducibility of the generation.
3627 */
3628 seed?: number;
3629 /**
3630 * Penalty for repeated tokens; higher values discourage repetition.
3631 */
3632 repetition_penalty?: number;
3633 /**
3634 * Decreases the likelihood of the model repeating the same lines verbatim.
3635 */
3636 frequency_penalty?: number;
3637 /**
3638 * Increases the likelihood of the model introducing new topics.
3639 */
3640 presence_penalty?: number;
3641 }
3642 interface AsyncBatch {
3643 requests?: {
3644 /**
3645 * 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.
3646 */
3647 external_reference?: string;
3648 /**
3649 * Prompt for the text generation model
3650 */
3651 prompt?: string;
3652 /**
3653 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3654 */
3655 stream?: boolean;
3656 /**
3657 * The maximum number of tokens to generate in the response.
3658 */
3659 max_tokens?: number;
3660 /**
3661 * Controls the randomness of the output; higher values produce more random results.
3662 */
3663 temperature?: number;
3664 /**
3665 * 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.
3666 */
3667 top_p?: number;
3668 /**
3669 * Random seed for reproducibility of the generation.
3670 */
3671 seed?: number;
3672 /**
3673 * Penalty for repeated tokens; higher values discourage repetition.
3674 */
3675 repetition_penalty?: number;
3676 /**
3677 * Decreases the likelihood of the model repeating the same lines verbatim.
3678 */
3679 frequency_penalty?: number;
3680 /**
3681 * Increases the likelihood of the model introducing new topics.
3682 */
3683 presence_penalty?: number;
3684 response_format?: JSONMode;
3685 }[];
3686 }
3687 type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output = {
3688 /**
3689 * The generated text response from the model
3690 */
3691 response: string;
3692 /**
3693 * Usage statistics for the inference request
3694 */
3695 usage?: {
3696 /**
3697 * Total number of tokens in input
3698 */
3699 prompt_tokens?: number;
3700 /**
3701 * Total number of tokens in output
3702 */
3703 completion_tokens?: number;
3704 /**
3705 * Total number of input and output tokens
3706 */
3707 total_tokens?: number;
3708 };
3709 /**
3710 * An array of tool calls requests made during the response generation
3711 */
3712 tool_calls?: {
3713 /**
3714 * The arguments passed to be passed to the tool call request
3715 */
3716 arguments?: object;
3717 /**
3718 * The name of the tool to be called
3719 */
3720 name?: string;
3721 }[];
3722 } | AsyncResponse;
3723 declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
3724 inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
3725 postProcessedOutputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output;
3726 }
3727 interface Ai_Cf_Meta_Llama_Guard_3_8B_Input {
3728 /**
3729 * An array of message objects representing the conversation history.
3730 */
3731 messages: {
3732 /**
3733 * The role of the message sender must alternate between 'user' and 'assistant'.
3734 */
3735 role: "user" | "assistant";
3736 /**
3737 * The content of the message as a string.
3738 */
3739 content: string;
3740 }[];
3741 /**
3742 * The maximum number of tokens to generate in the response.
3743 */
3744 max_tokens?: number;
3745 /**
3746 * Controls the randomness of the output; higher values produce more random results.
3747 */
3748 temperature?: number;
3749 /**
3750 * Dictate the output format of the generated response.
3751 */
3752 response_format?: {
3753 /**
3754 * Set to json_object to process and output generated text as JSON.
3755 */
3756 type?: string;
3757 };
3758 }
3759 interface Ai_Cf_Meta_Llama_Guard_3_8B_Output {
3760 response?: string | {
3761 /**
3762 * Whether the conversation is safe or not.
3763 */
3764 safe?: boolean;
3765 /**
3766 * A list of what hazard categories predicted for the conversation, if the conversation is deemed unsafe.
3767 */
3768 categories?: string[];
3769 };
3770 /**
3771 * Usage statistics for the inference request
3772 */
3773 usage?: {
3774 /**
3775 * Total number of tokens in input
3776 */
3777 prompt_tokens?: number;
3778 /**
3779 * Total number of tokens in output
3780 */
3781 completion_tokens?: number;
3782 /**
3783 * Total number of input and output tokens
3784 */
3785 total_tokens?: number;
3786 };
3787 }
3788 declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B {
3789 inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input;
3790 postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output;
3791 }
3792 interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
3793 /**
3794 * A query you wish to perform against the provided contexts.
3795 */
3796 query: string;
3797 /**
3798 * Number of returned results starting with the best score.
3799 */
3800 top_k?: number;
3801 /**
3802 * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3803 */
3804 contexts: {
3805 /**
3806 * One of the provided context content
3807 */
3808 text?: string;
3809 }[];
3810 }
3811 interface Ai_Cf_Baai_Bge_Reranker_Base_Output {
3812 response?: {
3813 /**
3814 * Index of the context in the request
3815 */
3816 id?: number;
3817 /**
3818 * Score of the context under the index.
3819 */
3820 score?: number;
3821 }[];
3822 }
3823 declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {
3824 inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;
3825 postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;
3826 }
3827 type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input = Qwen2_5_Coder_32B_Instruct_Prompt | Qwen2_5_Coder_32B_Instruct_Messages;
3828 interface Qwen2_5_Coder_32B_Instruct_Prompt {
3829 /**
3830 * The input text prompt for the model to generate a response.
3831 */
3832 prompt: string;
3833 /**
3834 * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3835 */
3836 lora?: string;
3837 response_format?: JSONMode;
3838 /**
3839 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3840 */
3841 raw?: boolean;
3842 /**
3843 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3844 */
3845 stream?: boolean;
3846 /**
3847 * The maximum number of tokens to generate in the response.
3848 */
3849 max_tokens?: number;
3850 /**
3851 * Controls the randomness of the output; higher values produce more random results.
3852 */
3853 temperature?: number;
3854 /**
3855 * 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.
3856 */
3857 top_p?: number;
3858 /**
3859 * 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.
3860 */
3861 top_k?: number;
3862 /**
3863 * Random seed for reproducibility of the generation.
3864 */
3865 seed?: number;
3866 /**
3867 * Penalty for repeated tokens; higher values discourage repetition.
3868 */
3869 repetition_penalty?: number;
3870 /**
3871 * Decreases the likelihood of the model repeating the same lines verbatim.
3872 */
3873 frequency_penalty?: number;
3874 /**
3875 * Increases the likelihood of the model introducing new topics.
3876 */
3877 presence_penalty?: number;
3878 }
3879 interface Qwen2_5_Coder_32B_Instruct_Messages {
3880 /**
3881 * An array of message objects representing the conversation history.
3882 */
3883 messages: {
3884 /**
3885 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3886 */
3887 role: string;
3888 /**
3889 * The content of the message as a string.
3890 */
3891 content: string;
3892 }[];
3893 functions?: {
3894 name: string;
3895 code: string;
3896 }[];
3897 /**
3898 * A list of tools available for the assistant to use.
3899 */
3900 tools?: ({
3901 /**
3902 * The name of the tool. More descriptive the better.
3903 */
3904 name: string;
3905 /**
3906 * A brief description of what the tool does.
3907 */
3908 description: string;
3909 /**
3910 * Schema defining the parameters accepted by the tool.
3911 */
3912 parameters: {
3913 /**
3914 * The type of the parameters object (usually 'object').
3915 */
3916 type: string;
3917 /**
3918 * List of required parameter names.
3919 */
3920 required?: string[];
3921 /**
3922 * Definitions of each parameter.
3923 */
3924 properties: {
3925 [k: string]: {
3926 /**
3927 * The data type of the parameter.
3928 */
3929 type: string;
3930 /**
3931 * A description of the expected parameter.
3932 */
3933 description: string;
3934 };
3935 };
3936 };
3937 } | {
3938 /**
3939 * Specifies the type of tool (e.g., 'function').
3940 */
3941 type: string;
3942 /**
3943 * Details of the function tool.
3944 */
3945 function: {
3946 /**
3947 * The name of the function.
3948 */
3949 name: string;
3950 /**
3951 * A brief description of what the function does.
3952 */
3953 description: string;
3954 /**
3955 * Schema defining the parameters accepted by the function.
3956 */
3957 parameters: {
3958 /**
3959 * The type of the parameters object (usually 'object').
3960 */
3961 type: string;
3962 /**
3963 * List of required parameter names.
3964 */
3965 required?: string[];
3966 /**
3967 * Definitions of each parameter.
3968 */
3969 properties: {
3970 [k: string]: {
3971 /**
3972 * The data type of the parameter.
3973 */
3974 type: string;
3975 /**
3976 * A description of the expected parameter.
3977 */
3978 description: string;
3979 };
3980 };
3981 };
3982 };
3983 })[];
3984 response_format?: JSONMode;
3985 /**
3986 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3987 */
3988 raw?: boolean;
3989 /**
3990 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3991 */
3992 stream?: boolean;
3993 /**
3994 * The maximum number of tokens to generate in the response.
3995 */
3996 max_tokens?: number;
3997 /**
3998 * Controls the randomness of the output; higher values produce more random results.
3999 */
4000 temperature?: number;
4001 /**
4002 * 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.
4003 */
4004 top_p?: number;
4005 /**
4006 * 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.
4007 */
4008 top_k?: number;
4009 /**
4010 * Random seed for reproducibility of the generation.
4011 */
4012 seed?: number;
4013 /**
4014 * Penalty for repeated tokens; higher values discourage repetition.
4015 */
4016 repetition_penalty?: number;
4017 /**
4018 * Decreases the likelihood of the model repeating the same lines verbatim.
4019 */
4020 frequency_penalty?: number;
4021 /**
4022 * Increases the likelihood of the model introducing new topics.
4023 */
4024 presence_penalty?: number;
4025 }
4026 type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output = {
4027 /**
4028 * The generated text response from the model
4029 */
4030 response: string;
4031 /**
4032 * Usage statistics for the inference request
4033 */
4034 usage?: {
4035 /**
4036 * Total number of tokens in input
4037 */
4038 prompt_tokens?: number;
4039 /**
4040 * Total number of tokens in output
4041 */
4042 completion_tokens?: number;
4043 /**
4044 * Total number of input and output tokens
4045 */
4046 total_tokens?: number;
4047 };
4048 /**
4049 * An array of tool calls requests made during the response generation
4050 */
4051 tool_calls?: {
4052 /**
4053 * The arguments passed to be passed to the tool call request
4054 */
4055 arguments?: object;
4056 /**
4057 * The name of the tool to be called
4058 */
4059 name?: string;
4060 }[];
4061 };
4062 declare abstract class Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct {
4063 inputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input;
4064 postProcessedOutputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output;
4065 }
4066 type Ai_Cf_Qwen_Qwq_32B_Input = Qwen_Qwq_32B_Prompt | Qwen_Qwq_32B_Messages;
4067 interface Qwen_Qwq_32B_Prompt {
4068 /**
4069 * The input text prompt for the model to generate a response.
4070 */
4071 prompt: string;
4072 /**
4073 * JSON schema that should be fulfilled for the response.
4074 */
4075 guided_json?: object;
4076 /**
4077 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4078 */
4079 raw?: boolean;
4080 /**
4081 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4082 */
4083 stream?: boolean;
4084 /**
4085 * The maximum number of tokens to generate in the response.
4086 */
4087 max_tokens?: number;
4088 /**
4089 * Controls the randomness of the output; higher values produce more random results.
4090 */
4091 temperature?: number;
4092 /**
4093 * 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.
4094 */
4095 top_p?: number;
4096 /**
4097 * 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.
4098 */
4099 top_k?: number;
4100 /**
4101 * Random seed for reproducibility of the generation.
4102 */
4103 seed?: number;
4104 /**
4105 * Penalty for repeated tokens; higher values discourage repetition.
4106 */
4107 repetition_penalty?: number;
4108 /**
4109 * Decreases the likelihood of the model repeating the same lines verbatim.
4110 */
4111 frequency_penalty?: number;
4112 /**
4113 * Increases the likelihood of the model introducing new topics.
4114 */
4115 presence_penalty?: number;
4116 }
4117 interface Qwen_Qwq_32B_Messages {
4118 /**
4119 * An array of message objects representing the conversation history.
4120 */
4121 messages: {
4122 /**
4123 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4124 */
4125 role?: string;
4126 /**
4127 * 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
4128 */
4129 tool_call_id?: string;
4130 content?: string | {
4131 /**
4132 * Type of the content provided
4133 */
4134 type?: string;
4135 text?: string;
4136 image_url?: {
4137 /**
4138 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4139 */
4140 url?: string;
4141 };
4142 }[] | {
4143 /**
4144 * Type of the content provided
4145 */
4146 type?: string;
4147 text?: string;
4148 image_url?: {
4149 /**
4150 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4151 */
4152 url?: string;
4153 };
4154 };
4155 }[];
4156 functions?: {
4157 name: string;
4158 code: string;
4159 }[];
4160 /**
4161 * A list of tools available for the assistant to use.
4162 */
4163 tools?: ({
4164 /**
4165 * The name of the tool. More descriptive the better.
4166 */
4167 name: string;
4168 /**
4169 * A brief description of what the tool does.
4170 */
4171 description: string;
4172 /**
4173 * Schema defining the parameters accepted by the tool.
4174 */
4175 parameters: {
4176 /**
4177 * The type of the parameters object (usually 'object').
4178 */
4179 type: string;
4180 /**
4181 * List of required parameter names.
4182 */
4183 required?: string[];
4184 /**
4185 * Definitions of each parameter.
4186 */
4187 properties: {
4188 [k: string]: {
4189 /**
4190 * The data type of the parameter.
4191 */
4192 type: string;
4193 /**
4194 * A description of the expected parameter.
4195 */
4196 description: string;
4197 };
4198 };
4199 };
4200 } | {
4201 /**
4202 * Specifies the type of tool (e.g., 'function').
4203 */
4204 type: string;
4205 /**
4206 * Details of the function tool.
4207 */
4208 function: {
4209 /**
4210 * The name of the function.
4211 */
4212 name: string;
4213 /**
4214 * A brief description of what the function does.
4215 */
4216 description: string;
4217 /**
4218 * Schema defining the parameters accepted by the function.
4219 */
4220 parameters: {
4221 /**
4222 * The type of the parameters object (usually 'object').
4223 */
4224 type: string;
4225 /**
4226 * List of required parameter names.
4227 */
4228 required?: string[];
4229 /**
4230 * Definitions of each parameter.
4231 */
4232 properties: {
4233 [k: string]: {
4234 /**
4235 * The data type of the parameter.
4236 */
4237 type: string;
4238 /**
4239 * A description of the expected parameter.
4240 */
4241 description: string;
4242 };
4243 };
4244 };
4245 };
4246 })[];
4247 /**
4248 * JSON schema that should be fufilled for the response.
4249 */
4250 guided_json?: object;
4251 /**
4252 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4253 */
4254 raw?: boolean;
4255 /**
4256 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4257 */
4258 stream?: boolean;
4259 /**
4260 * The maximum number of tokens to generate in the response.
4261 */
4262 max_tokens?: number;
4263 /**
4264 * Controls the randomness of the output; higher values produce more random results.
4265 */
4266 temperature?: number;
4267 /**
4268 * 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.
4269 */
4270 top_p?: number;
4271 /**
4272 * 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.
4273 */
4274 top_k?: number;
4275 /**
4276 * Random seed for reproducibility of the generation.
4277 */
4278 seed?: number;
4279 /**
4280 * Penalty for repeated tokens; higher values discourage repetition.
4281 */
4282 repetition_penalty?: number;
4283 /**
4284 * Decreases the likelihood of the model repeating the same lines verbatim.
4285 */
4286 frequency_penalty?: number;
4287 /**
4288 * Increases the likelihood of the model introducing new topics.
4289 */
4290 presence_penalty?: number;
4291 }
4292 type Ai_Cf_Qwen_Qwq_32B_Output = {
4293 /**
4294 * The generated text response from the model
4295 */
4296 response: string;
4297 /**
4298 * Usage statistics for the inference request
4299 */
4300 usage?: {
4301 /**
4302 * Total number of tokens in input
4303 */
4304 prompt_tokens?: number;
4305 /**
4306 * Total number of tokens in output
4307 */
4308 completion_tokens?: number;
4309 /**
4310 * Total number of input and output tokens
4311 */
4312 total_tokens?: number;
4313 };
4314 /**
4315 * An array of tool calls requests made during the response generation
4316 */
4317 tool_calls?: {
4318 /**
4319 * The arguments passed to be passed to the tool call request
4320 */
4321 arguments?: object;
4322 /**
4323 * The name of the tool to be called
4324 */
4325 name?: string;
4326 }[];
4327 };
4328 declare abstract class Base_Ai_Cf_Qwen_Qwq_32B {
4329 inputs: Ai_Cf_Qwen_Qwq_32B_Input;
4330 postProcessedOutputs: Ai_Cf_Qwen_Qwq_32B_Output;
4331 }
4332 type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input = Mistral_Small_3_1_24B_Instruct_Prompt | Mistral_Small_3_1_24B_Instruct_Messages;
4333 interface Mistral_Small_3_1_24B_Instruct_Prompt {
4334 /**
4335 * The input text prompt for the model to generate a response.
4336 */
4337 prompt: string;
4338 /**
4339 * JSON schema that should be fulfilled for the response.
4340 */
4341 guided_json?: object;
4342 /**
4343 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4344 */
4345 raw?: boolean;
4346 /**
4347 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4348 */
4349 stream?: boolean;
4350 /**
4351 * The maximum number of tokens to generate in the response.
4352 */
4353 max_tokens?: number;
4354 /**
4355 * Controls the randomness of the output; higher values produce more random results.
4356 */
4357 temperature?: number;
4358 /**
4359 * 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.
4360 */
4361 top_p?: number;
4362 /**
4363 * 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.
4364 */
4365 top_k?: number;
4366 /**
4367 * Random seed for reproducibility of the generation.
4368 */
4369 seed?: number;
4370 /**
4371 * Penalty for repeated tokens; higher values discourage repetition.
4372 */
4373 repetition_penalty?: number;
4374 /**
4375 * Decreases the likelihood of the model repeating the same lines verbatim.
4376 */
4377 frequency_penalty?: number;
4378 /**
4379 * Increases the likelihood of the model introducing new topics.
4380 */
4381 presence_penalty?: number;
4382 }
4383 interface Mistral_Small_3_1_24B_Instruct_Messages {
4384 /**
4385 * An array of message objects representing the conversation history.
4386 */
4387 messages: {
4388 /**
4389 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4390 */
4391 role?: string;
4392 /**
4393 * 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
4394 */
4395 tool_call_id?: string;
4396 content?: string | {
4397 /**
4398 * Type of the content provided
4399 */
4400 type?: string;
4401 text?: string;
4402 image_url?: {
4403 /**
4404 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4405 */
4406 url?: string;
4407 };
4408 }[] | {
4409 /**
4410 * Type of the content provided
4411 */
4412 type?: string;
4413 text?: string;
4414 image_url?: {
4415 /**
4416 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4417 */
4418 url?: string;
4419 };
4420 };
4421 }[];
4422 functions?: {
4423 name: string;
4424 code: string;
4425 }[];
4426 /**
4427 * A list of tools available for the assistant to use.
4428 */
4429 tools?: ({
4430 /**
4431 * The name of the tool. More descriptive the better.
4432 */
4433 name: string;
4434 /**
4435 * A brief description of what the tool does.
4436 */
4437 description: string;
4438 /**
4439 * Schema defining the parameters accepted by the tool.
4440 */
4441 parameters: {
4442 /**
4443 * The type of the parameters object (usually 'object').
4444 */
4445 type: string;
4446 /**
4447 * List of required parameter names.
4448 */
4449 required?: string[];
4450 /**
4451 * Definitions of each parameter.
4452 */
4453 properties: {
4454 [k: string]: {
4455 /**
4456 * The data type of the parameter.
4457 */
4458 type: string;
4459 /**
4460 * A description of the expected parameter.
4461 */
4462 description: string;
4463 };
4464 };
4465 };
4466 } | {
4467 /**
4468 * Specifies the type of tool (e.g., 'function').
4469 */
4470 type: string;
4471 /**
4472 * Details of the function tool.
4473 */
4474 function: {
4475 /**
4476 * The name of the function.
4477 */
4478 name: string;
4479 /**
4480 * A brief description of what the function does.
4481 */
4482 description: string;
4483 /**
4484 * Schema defining the parameters accepted by the function.
4485 */
4486 parameters: {
4487 /**
4488 * The type of the parameters object (usually 'object').
4489 */
4490 type: string;
4491 /**
4492 * List of required parameter names.
4493 */
4494 required?: string[];
4495 /**
4496 * Definitions of each parameter.
4497 */
4498 properties: {
4499 [k: string]: {
4500 /**
4501 * The data type of the parameter.
4502 */
4503 type: string;
4504 /**
4505 * A description of the expected parameter.
4506 */
4507 description: string;
4508 };
4509 };
4510 };
4511 };
4512 })[];
4513 /**
4514 * JSON schema that should be fufilled for the response.
4515 */
4516 guided_json?: object;
4517 /**
4518 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4519 */
4520 raw?: boolean;
4521 /**
4522 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4523 */
4524 stream?: boolean;
4525 /**
4526 * The maximum number of tokens to generate in the response.
4527 */
4528 max_tokens?: number;
4529 /**
4530 * Controls the randomness of the output; higher values produce more random results.
4531 */
4532 temperature?: number;
4533 /**
4534 * 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.
4535 */
4536 top_p?: number;
4537 /**
4538 * 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.
4539 */
4540 top_k?: number;
4541 /**
4542 * Random seed for reproducibility of the generation.
4543 */
4544 seed?: number;
4545 /**
4546 * Penalty for repeated tokens; higher values discourage repetition.
4547 */
4548 repetition_penalty?: number;
4549 /**
4550 * Decreases the likelihood of the model repeating the same lines verbatim.
4551 */
4552 frequency_penalty?: number;
4553 /**
4554 * Increases the likelihood of the model introducing new topics.
4555 */
4556 presence_penalty?: number;
4557 }
4558 type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output = {
4559 /**
4560 * The generated text response from the model
4561 */
4562 response: string;
4563 /**
4564 * Usage statistics for the inference request
4565 */
4566 usage?: {
4567 /**
4568 * Total number of tokens in input
4569 */
4570 prompt_tokens?: number;
4571 /**
4572 * Total number of tokens in output
4573 */
4574 completion_tokens?: number;
4575 /**
4576 * Total number of input and output tokens
4577 */
4578 total_tokens?: number;
4579 };
4580 /**
4581 * An array of tool calls requests made during the response generation
4582 */
4583 tool_calls?: {
4584 /**
4585 * The arguments passed to be passed to the tool call request
4586 */
4587 arguments?: object;
4588 /**
4589 * The name of the tool to be called
4590 */
4591 name?: string;
4592 }[];
4593 };
4594 declare abstract class Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct {
4595 inputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input;
4596 postProcessedOutputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output;
4597 }
4598 type Ai_Cf_Google_Gemma_3_12B_It_Input = Google_Gemma_3_12B_It_Prompt | Google_Gemma_3_12B_It_Messages;
4599 interface Google_Gemma_3_12B_It_Prompt {
4600 /**
4601 * The input text prompt for the model to generate a response.
4602 */
4603 prompt: string;
4604 /**
4605 * JSON schema that should be fufilled for the response.
4606 */
4607 guided_json?: object;
4608 /**
4609 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4610 */
4611 raw?: boolean;
4612 /**
4613 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4614 */
4615 stream?: boolean;
4616 /**
4617 * The maximum number of tokens to generate in the response.
4618 */
4619 max_tokens?: number;
4620 /**
4621 * Controls the randomness of the output; higher values produce more random results.
4622 */
4623 temperature?: number;
4624 /**
4625 * 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.
4626 */
4627 top_p?: number;
4628 /**
4629 * 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.
4630 */
4631 top_k?: number;
4632 /**
4633 * Random seed for reproducibility of the generation.
4634 */
4635 seed?: number;
4636 /**
4637 * Penalty for repeated tokens; higher values discourage repetition.
4638 */
4639 repetition_penalty?: number;
4640 /**
4641 * Decreases the likelihood of the model repeating the same lines verbatim.
4642 */
4643 frequency_penalty?: number;
4644 /**
4645 * Increases the likelihood of the model introducing new topics.
4646 */
4647 presence_penalty?: number;
4648 }
4649 interface Google_Gemma_3_12B_It_Messages {
4650 /**
4651 * An array of message objects representing the conversation history.
4652 */
4653 messages: {
4654 /**
4655 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4656 */
4657 role?: string;
4658 content?: string | {
4659 /**
4660 * Type of the content provided
4661 */
4662 type?: string;
4663 text?: string;
4664 image_url?: {
4665 /**
4666 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4667 */
4668 url?: string;
4669 };
4670 }[] | {
4671 /**
4672 * Type of the content provided
4673 */
4674 type?: string;
4675 text?: string;
4676 image_url?: {
4677 /**
4678 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4679 */
4680 url?: string;
4681 };
4682 };
4683 }[];
4684 functions?: {
4685 name: string;
4686 code: string;
4687 }[];
4688 /**
4689 * A list of tools available for the assistant to use.
4690 */
4691 tools?: ({
4692 /**
4693 * The name of the tool. More descriptive the better.
4694 */
4695 name: string;
4696 /**
4697 * A brief description of what the tool does.
4698 */
4699 description: string;
4700 /**
4701 * Schema defining the parameters accepted by the tool.
4702 */
4703 parameters: {
4704 /**
4705 * The type of the parameters object (usually 'object').
4706 */
4707 type: string;
4708 /**
4709 * List of required parameter names.
4710 */
4711 required?: string[];
4712 /**
4713 * Definitions of each parameter.
4714 */
4715 properties: {
4716 [k: string]: {
4717 /**
4718 * The data type of the parameter.
4719 */
4720 type: string;
4721 /**
4722 * A description of the expected parameter.
4723 */
4724 description: string;
4725 };
4726 };
4727 };
4728 } | {
4729 /**
4730 * Specifies the type of tool (e.g., 'function').
4731 */
4732 type: string;
4733 /**
4734 * Details of the function tool.
4735 */
4736 function: {
4737 /**
4738 * The name of the function.
4739 */
4740 name: string;
4741 /**
4742 * A brief description of what the function does.
4743 */
4744 description: string;
4745 /**
4746 * Schema defining the parameters accepted by the function.
4747 */
4748 parameters: {
4749 /**
4750 * The type of the parameters object (usually 'object').
4751 */
4752 type: string;
4753 /**
4754 * List of required parameter names.
4755 */
4756 required?: string[];
4757 /**
4758 * Definitions of each parameter.
4759 */
4760 properties: {
4761 [k: string]: {
4762 /**
4763 * The data type of the parameter.
4764 */
4765 type: string;
4766 /**
4767 * A description of the expected parameter.
4768 */
4769 description: string;
4770 };
4771 };
4772 };
4773 };
4774 })[];
4775 /**
4776 * JSON schema that should be fufilled for the response.
4777 */
4778 guided_json?: object;
4779 /**
4780 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4781 */
4782 raw?: boolean;
4783 /**
4784 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4785 */
4786 stream?: boolean;
4787 /**
4788 * The maximum number of tokens to generate in the response.
4789 */
4790 max_tokens?: number;
4791 /**
4792 * Controls the randomness of the output; higher values produce more random results.
4793 */
4794 temperature?: number;
4795 /**
4796 * 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.
4797 */
4798 top_p?: number;
4799 /**
4800 * 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.
4801 */
4802 top_k?: number;
4803 /**
4804 * Random seed for reproducibility of the generation.
4805 */
4806 seed?: number;
4807 /**
4808 * Penalty for repeated tokens; higher values discourage repetition.
4809 */
4810 repetition_penalty?: number;
4811 /**
4812 * Decreases the likelihood of the model repeating the same lines verbatim.
4813 */
4814 frequency_penalty?: number;
4815 /**
4816 * Increases the likelihood of the model introducing new topics.
4817 */
4818 presence_penalty?: number;
4819 }
4820 type Ai_Cf_Google_Gemma_3_12B_It_Output = {
4821 /**
4822 * The generated text response from the model
4823 */
4824 response: string;
4825 /**
4826 * Usage statistics for the inference request
4827 */
4828 usage?: {
4829 /**
4830 * Total number of tokens in input
4831 */
4832 prompt_tokens?: number;
4833 /**
4834 * Total number of tokens in output
4835 */
4836 completion_tokens?: number;
4837 /**
4838 * Total number of input and output tokens
4839 */
4840 total_tokens?: number;
4841 };
4842 /**
4843 * An array of tool calls requests made during the response generation
4844 */
4845 tool_calls?: {
4846 /**
4847 * The arguments passed to be passed to the tool call request
4848 */
4849 arguments?: object;
4850 /**
4851 * The name of the tool to be called
4852 */
4853 name?: string;
4854 }[];
4855 };
4856 declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
4857 inputs: Ai_Cf_Google_Gemma_3_12B_It_Input;
4858 postProcessedOutputs: Ai_Cf_Google_Gemma_3_12B_It_Output;
4859 }
4860 type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input = Ai_Cf_Meta_Llama_4_Prompt | Ai_Cf_Meta_Llama_4_Messages;
4861 interface Ai_Cf_Meta_Llama_4_Prompt {
4862 /**
4863 * The input text prompt for the model to generate a response.
4864 */
4865 prompt: string;
4866 /**
4867 * JSON schema that should be fulfilled for the response.
4868 */
4869 guided_json?: object;
4870 response_format?: JSONMode;
4871 /**
4872 * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4873 */
4874 raw?: boolean;
4875 /**
4876 * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4877 */
4878 stream?: boolean;
4879 /**
4880 * The maximum number of tokens to generate in the response.
4881 */
4882 max_tokens?: number;
4883 /**
4884 * Controls the randomness of the output; higher values produce more random results.
4885 */
4886 temperature?: number;
4887 /**
4888 * 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.
4889 */
4890 top_p?: number;
4891 /**
4892 * 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.
4893 */
4894 top_k?: number;
4895 /**
4896 * Random seed for reproducibility of the generation.
4897 */
4898 seed?: number;
4899 /**
4900 * Penalty for repeated tokens; higher values discourage repetition.
4901 */
4902 repetition_penalty?: number;
4903 /**
4904 * Decreases the likelihood of the model repeating the same lines verbatim.
4905 */
4906 frequency_penalty?: number;
4907 /**
4908 * Increases the likelihood of the model introducing new topics.
4909 */
4910 presence_penalty?: number;
4911 }
4912 interface Ai_Cf_Meta_Llama_4_Messages {
4913 /**
4914 * An array of message objects representing the conversation history.
4915 */
4916 messages: {
4917 /**
4918 * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4919 */
4920 role?: string;
4921 /**
4922 * The tool call id. If you don't know what to put here you can fall back to 000000001
4923 */
4924 tool_call_id?: string;
4925 content?: string | {
4926 /**
4927 * Type of the content provided
4928 */
4929 type?: string;
4930 text?: string;
4931 image_url?: {
4932 /**
4933 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4934 */
4935 url?: string;
4936 };
4937 }[] | {
4938 /**
4939 * Type of the content provided
4940 */
4941 type?: string;
4942 text?: string;
4943 image_url?: {
4944 /**
4945 * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
4946 */
4947 url?: string;
4948 };
4949 };
4950 }[];
4951 functions?: {
4952 name: string;
4953 code: string;
4954 }[];
4955 /**
4956 * A list of tools available for the assistant to use.
4957 */
4958 tools?: ({
4959 /**
4960 * The name of the tool. More descriptive the better.
4961 */
4962 name: string;
4963 /**
4964 * A brief description of what the tool does.
4965 */
4966 description: string;
4967 /**
4968 * Schema defining the parameters accepted by the tool.
4969 */
4970 parameters: {
4971 /**
4972 * The type of the parameters object (usually 'object').
4973 */
4974 type: string;
4975 /**
4976 * List of required parameter names.
4977 */
4978 required?: string[];
4979 /**
4980 * Definitions of each parameter.
4981 */
4982 properties: {
4983 [k: string]: {
4984 /**
4985 * The data type of the parameter.
4986 */
4987 type: string;
4988 /**
4989 * A description of the expected parameter.
4990 */
4991 description: string;
4992 };
4993 };
4994 };
4995 } | {
4996 /**
4997 * Specifies the type of tool (e.g., 'function').
4998 */
4999 type: string;
5000 /**
Showing first 5,000 of 7,331 lines. View raw