+3987
-471
worker-configuration.d.ts
+3987
-471
worker-configuration.d.ts
···
1
1
/* eslint-disable */
2
-
// Generated by Wrangler by running `wrangler types` (hash: 869ac3b4ce0f52ba3b2e0bc70c49089e)
3
-
// Runtime types generated with workerd@1.20250617.0 2025-08-25
2
+
// Generated by Wrangler by running `wrangler types` (hash: eeaa8440f56ab30c6a4f65cb191015f2)
3
+
// Runtime types generated with workerd@1.20251202.0 2025-08-16
4
4
declare namespace Cloudflare {
5
+
interface GlobalProps {
6
+
mainModule: typeof import("./server/index");
7
+
}
5
8
interface Env {
9
+
VITE_APP_NAME: string;
6
10
}
7
11
}
8
12
interface Env extends Cloudflare.Env {}
···
26
30
// noinspection JSUnusedGlobalSymbols
27
31
declare var onmessage: never;
28
32
/**
29
-
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
33
+
* The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
30
34
*
31
35
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
32
36
*/
33
37
declare class DOMException extends Error {
34
38
constructor(message?: string, name?: string);
35
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
39
+
/**
40
+
* The **`message`** read-only property of the a message or description associated with the given error name.
41
+
*
42
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
43
+
*/
36
44
readonly message: string;
37
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
45
+
/**
46
+
* The **`name`** read-only property of the one of the strings associated with an error name.
47
+
*
48
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
49
+
*/
38
50
readonly name: string;
39
51
/**
52
+
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
40
53
* @deprecated
41
54
*
42
55
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
···
80
93
declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
81
94
EventTarget: typeof EventTarget;
82
95
}
83
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
96
+
/* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). *
97
+
* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox).
98
+
*
99
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console)
100
+
*/
84
101
interface Console {
85
102
"assert"(condition?: boolean, ...data: any[]): void;
86
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
103
+
/**
104
+
* The **`console.clear()`** static method clears the console if possible.
105
+
*
106
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static)
107
+
*/
87
108
clear(): void;
88
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
109
+
/**
110
+
* The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
111
+
*
112
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
113
+
*/
89
114
count(label?: string): void;
90
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
115
+
/**
116
+
* The **`console.countReset()`** static method resets counter used with console/count_static.
117
+
*
118
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
119
+
*/
91
120
countReset(label?: string): void;
92
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
121
+
/**
122
+
* The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
123
+
*
124
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
125
+
*/
93
126
debug(...data: any[]): void;
94
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
127
+
/**
128
+
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
129
+
*
130
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
131
+
*/
95
132
dir(item?: any, options?: any): void;
96
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
133
+
/**
134
+
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
135
+
*
136
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
137
+
*/
97
138
dirxml(...data: any[]): void;
98
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
139
+
/**
140
+
* The **`console.error()`** static method outputs a message to the console at the 'error' log level.
141
+
*
142
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
143
+
*/
99
144
error(...data: any[]): void;
100
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
145
+
/**
146
+
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
147
+
*
148
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
149
+
*/
101
150
group(...data: any[]): void;
102
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
151
+
/**
152
+
* The **`console.groupCollapsed()`** static method creates a new inline group in the console.
153
+
*
154
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
155
+
*/
103
156
groupCollapsed(...data: any[]): void;
104
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
157
+
/**
158
+
* The **`console.groupEnd()`** static method exits the current inline group in the console.
159
+
*
160
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
161
+
*/
105
162
groupEnd(): void;
106
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
163
+
/**
164
+
* The **`console.info()`** static method outputs a message to the console at the 'info' log level.
165
+
*
166
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
167
+
*/
107
168
info(...data: any[]): void;
108
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
169
+
/**
170
+
* The **`console.log()`** static method outputs a message to the console.
171
+
*
172
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
173
+
*/
109
174
log(...data: any[]): void;
110
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
175
+
/**
176
+
* The **`console.table()`** static method displays tabular data as a table.
177
+
*
178
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static)
179
+
*/
111
180
table(tabularData?: any, properties?: string[]): void;
112
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
181
+
/**
182
+
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
183
+
*
184
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
185
+
*/
113
186
time(label?: string): void;
114
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
187
+
/**
188
+
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
189
+
*
190
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
191
+
*/
115
192
timeEnd(label?: string): void;
116
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
193
+
/**
194
+
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
195
+
*
196
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
197
+
*/
117
198
timeLog(label?: string, ...data: any[]): void;
118
199
timeStamp(label?: string): void;
119
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
200
+
/**
201
+
* The **`console.trace()`** static method outputs a stack trace to the console.
202
+
*
203
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static)
204
+
*/
120
205
trace(...data: any[]): void;
121
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
206
+
/**
207
+
* The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
208
+
*
209
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
210
+
*/
122
211
warn(...data: any[]): void;
123
212
}
124
213
declare const console: Console;
···
192
281
function validate(bytes: BufferSource): boolean;
193
282
}
194
283
/**
195
-
* This ServiceWorker API interface represents the global execution context of a service worker.
284
+
* The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker.
196
285
* Available only in secure contexts.
197
286
*
198
287
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
···
238
327
ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
239
328
CountQueuingStrategy: typeof CountQueuingStrategy;
240
329
ErrorEvent: typeof ErrorEvent;
330
+
MessageChannel: typeof MessageChannel;
331
+
MessagePort: typeof MessagePort;
241
332
EventSource: typeof EventSource;
242
333
ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
243
334
ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
···
279
370
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
280
371
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
281
372
/**
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.
373
+
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
283
374
*
284
375
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
285
376
*/
···
337
428
declare const navigator: Navigator;
338
429
interface TestController {
339
430
}
340
-
interface ExecutionContext {
431
+
interface ExecutionContext<Props = unknown> {
341
432
waitUntil(promise: Promise<any>): void;
342
433
passThroughOnException(): void;
343
-
props: any;
434
+
readonly props: Props;
344
435
}
345
436
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Response | Promise<Response>;
346
437
type ExportedHandlerTailHandler<Env = unknown> = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;
347
438
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>;
439
+
type ExportedHandlerTailStreamHandler<Env = unknown> = (event: TailStream.TailEvent<TailStream.Onset>, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
349
440
type ExportedHandlerScheduledHandler<Env = unknown> = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise<void>;
350
441
type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (batch: MessageBatch<Message>, env: Env, ctx: ExecutionContext) => void | Promise<void>;
351
442
type ExportedHandlerTestHandler<Env = unknown> = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise<void>;
···
362
453
interface StructuredSerializeOptions {
363
454
transfer?: any[];
364
455
}
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
456
declare abstract class Navigator {
373
-
sendBeacon(url: string, body?: (ReadableStream | string | (ArrayBuffer | ArrayBufferView) | Blob | FormData | URLSearchParams | URLSearchParams)): boolean;
457
+
sendBeacon(url: string, body?: BodyInit): boolean;
374
458
readonly userAgent: string;
375
459
readonly hardwareConcurrency: number;
376
460
readonly language: string;
377
461
readonly languages: string[];
378
462
}
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
463
interface AlarmInvocationInfo {
392
464
readonly isRetry: boolean;
393
465
readonly retryCount: number;
···
411
483
equals(other: DurableObjectId): boolean;
412
484
readonly name?: string;
413
485
}
414
-
interface DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {
486
+
declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {
415
487
newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
416
488
idFromName(name: string): DurableObjectId;
417
489
idFromString(id: string): DurableObjectId;
418
490
get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
491
+
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
419
492
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
420
493
}
421
494
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
···
426
499
interface DurableObjectNamespaceGetDurableObjectOptions {
427
500
locationHint?: DurableObjectLocationHint;
428
501
}
429
-
interface DurableObjectState {
502
+
interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {
503
+
}
504
+
interface DurableObjectState<Props = unknown> {
430
505
waitUntil(promise: Promise<any>): void;
506
+
readonly props: Props;
431
507
readonly id: DurableObjectId;
432
508
readonly storage: DurableObjectStorage;
433
509
container?: Container;
···
470
546
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
471
547
sync(): Promise<void>;
472
548
sql: SqlStorage;
549
+
kv: SyncKvStorage;
473
550
transactionSync<T>(closure: () => T): T;
474
551
getCurrentBookmark(): Promise<string>;
475
552
getBookmarkForTime(timestamp: number | Date): Promise<string>;
···
515
592
blobs?: ((ArrayBuffer | string) | null)[];
516
593
}
517
594
/**
518
-
* An event which takes place in the DOM.
595
+
* The **`Event`** interface represents an event which takes place on an `EventTarget`.
519
596
*
520
597
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
521
598
*/
522
599
declare class Event {
523
600
constructor(type: string, init?: EventInit);
524
601
/**
525
-
* Returns the type of event, e.g. "click", "hashchange", or "submit".
602
+
* The **`type`** read-only property of the Event interface returns a string containing the event's type.
526
603
*
527
604
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
528
605
*/
529
606
get type(): string;
530
607
/**
531
-
* Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
608
+
* The **`eventPhase`** read-only property of the being evaluated.
532
609
*
533
610
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
534
611
*/
535
612
get eventPhase(): number;
536
613
/**
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.
614
+
* The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
538
615
*
539
616
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
540
617
*/
541
618
get composed(): boolean;
542
619
/**
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.
620
+
* The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not.
544
621
*
545
622
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
546
623
*/
547
624
get bubbles(): boolean;
548
625
/**
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.
626
+
* The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.
550
627
*
551
628
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
552
629
*/
553
630
get cancelable(): boolean;
554
631
/**
555
-
* Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
632
+
* The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event.
556
633
*
557
634
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
558
635
*/
559
636
get defaultPrevented(): boolean;
560
637
/**
638
+
* The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not.
561
639
* @deprecated
562
640
*
563
641
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
564
642
*/
565
643
get returnValue(): boolean;
566
644
/**
567
-
* Returns the object whose event listener's callback is currently being invoked.
645
+
* The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached.
568
646
*
569
647
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
570
648
*/
571
649
get currentTarget(): EventTarget | undefined;
572
650
/**
573
-
* Returns the object to which event is dispatched (its target).
651
+
* The read-only **`target`** property of the dispatched.
574
652
*
575
653
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
576
654
*/
577
655
get target(): EventTarget | undefined;
578
656
/**
657
+
* The deprecated **`Event.srcElement`** is an alias for the Event.target property.
579
658
* @deprecated
580
659
*
581
660
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
582
661
*/
583
662
get srcElement(): EventTarget | undefined;
584
663
/**
585
-
* Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
664
+
* The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created.
586
665
*
587
666
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
588
667
*/
589
668
get timeStamp(): number;
590
669
/**
591
-
* Returns true if event was dispatched by the user agent, and false otherwise.
670
+
* The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
592
671
*
593
672
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
594
673
*/
595
674
get isTrusted(): boolean;
596
675
/**
676
+
* The **`cancelBubble`** property of the Event interface is deprecated.
597
677
* @deprecated
598
678
*
599
679
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
600
680
*/
601
681
get cancelBubble(): boolean;
602
682
/**
683
+
* The **`cancelBubble`** property of the Event interface is deprecated.
603
684
* @deprecated
604
685
*
605
686
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
606
687
*/
607
688
set cancelBubble(value: boolean);
608
689
/**
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.
690
+
* The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
610
691
*
611
692
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
612
693
*/
613
694
stopImmediatePropagation(): void;
614
695
/**
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.
696
+
* The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
616
697
*
617
698
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
618
699
*/
619
700
preventDefault(): void;
620
701
/**
621
-
* When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
702
+
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
622
703
*
623
704
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
624
705
*/
625
706
stopPropagation(): void;
626
707
/**
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.
708
+
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
628
709
*
629
710
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
630
711
*/
···
645
726
}
646
727
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
647
728
/**
648
-
* EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
729
+
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
649
730
*
650
731
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
651
732
*/
652
733
declare class EventTarget<EventMap extends Record<string, Event> = Record<string, Event>> {
653
734
constructor();
654
735
/**
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.
736
+
* The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
668
737
*
669
738
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
670
739
*/
671
740
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
672
741
/**
673
-
* Removes the event listener in target's event listener list with the same type, callback, and options.
742
+
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
674
743
*
675
744
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
676
745
*/
677
746
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
678
747
/**
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.
748
+
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
680
749
*
681
750
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
682
751
*/
···
695
764
handleEvent: (event: Event) => any | undefined;
696
765
}
697
766
/**
698
-
* A controller object that allows you to abort one or more DOM requests as and when desired.
767
+
* The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired.
699
768
*
700
769
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
701
770
*/
702
771
declare class AbortController {
703
772
constructor();
704
773
/**
705
-
* Returns the AbortSignal object associated with this object.
774
+
* The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired.
706
775
*
707
776
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
708
777
*/
709
778
get signal(): AbortSignal;
710
779
/**
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.
780
+
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
712
781
*
713
782
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
714
783
*/
715
784
abort(reason?: any): void;
716
785
}
717
786
/**
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.
787
+
* The **`AbortSignal`** interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object.
719
788
*
720
789
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
721
790
*/
722
791
declare abstract class AbortSignal extends EventTarget {
723
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
792
+
/**
793
+
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
794
+
*
795
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
796
+
*/
724
797
static abort(reason?: any): AbortSignal;
725
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
798
+
/**
799
+
* The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time.
800
+
*
801
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static)
802
+
*/
726
803
static timeout(delay: number): AbortSignal;
727
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
804
+
/**
805
+
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
806
+
*
807
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
808
+
*/
728
809
static any(signals: AbortSignal[]): AbortSignal;
729
810
/**
730
-
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
811
+
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
731
812
*
732
813
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
733
814
*/
734
815
get aborted(): boolean;
735
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
816
+
/**
817
+
* The **`reason`** read-only property returns a JavaScript value that indicates the abort reason.
818
+
*
819
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason)
820
+
*/
736
821
get reason(): any;
737
822
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
738
823
get onabort(): any | null;
739
824
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
740
825
set onabort(value: any | null);
741
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
826
+
/**
827
+
* The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
828
+
*
829
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
830
+
*/
742
831
throwIfAborted(): void;
743
832
}
744
833
interface Scheduler {
···
748
837
signal?: AbortSignal;
749
838
}
750
839
/**
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.
840
+
* The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
752
841
*
753
842
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
754
843
*/
755
844
declare abstract class ExtendableEvent extends Event {
756
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
845
+
/**
846
+
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
847
+
*
848
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
849
+
*/
757
850
waitUntil(promise: Promise<any>): void;
758
851
}
759
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
852
+
/**
853
+
* The **`CustomEvent`** interface represents events initialized by an application for any purpose.
854
+
*
855
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
856
+
*/
760
857
declare class CustomEvent<T = any> extends Event {
761
858
constructor(type: string, init?: CustomEventCustomEventInit);
762
859
/**
763
-
* Returns any custom data event was created with. Typically used for synthetic events.
860
+
* The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event.
764
861
*
765
862
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
766
863
*/
···
773
870
detail?: any;
774
871
}
775
872
/**
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.
873
+
* The **`Blob`** interface represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a ReadableStream so its methods can be used for processing the data.
777
874
*
778
875
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
779
876
*/
780
877
declare class Blob {
781
878
constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
782
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
879
+
/**
880
+
* The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes.
881
+
*
882
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size)
883
+
*/
783
884
get size(): number;
784
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
885
+
/**
886
+
* The **`type`** read-only property of the Blob interface returns the MIME type of the file.
887
+
*
888
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type)
889
+
*/
785
890
get type(): string;
786
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
891
+
/**
892
+
* The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
893
+
*
894
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
895
+
*/
787
896
slice(start?: number, end?: number, type?: string): Blob;
788
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
897
+
/**
898
+
* The **`arrayBuffer()`** method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer.
899
+
*
900
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer)
901
+
*/
789
902
arrayBuffer(): Promise<ArrayBuffer>;
790
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */
903
+
/**
904
+
* The **`bytes()`** method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.
905
+
*
906
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes)
907
+
*/
791
908
bytes(): Promise<Uint8Array>;
792
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
909
+
/**
910
+
* The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
911
+
*
912
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
913
+
*/
793
914
text(): Promise<string>;
794
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
915
+
/**
916
+
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
917
+
*
918
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
919
+
*/
795
920
stream(): ReadableStream;
796
921
}
797
922
interface BlobOptions {
798
923
type?: string;
799
924
}
800
925
/**
801
-
* Provides information about files and allows JavaScript in a web page to access their content.
926
+
* The **`File`** interface provides information about files and allows JavaScript in a web page to access their content.
802
927
*
803
928
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
804
929
*/
805
930
declare class File extends Blob {
806
931
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
807
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
932
+
/**
933
+
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
934
+
*
935
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
936
+
*/
808
937
get name(): string;
809
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
938
+
/**
939
+
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
940
+
*
941
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
942
+
*/
810
943
get lastModified(): number;
811
944
}
812
945
interface FileOptions {
···
819
952
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
820
953
*/
821
954
declare abstract class CacheStorage {
822
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
955
+
/**
956
+
* The **`open()`** method of the the Cache object matching the `cacheName`.
957
+
*
958
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
959
+
*/
823
960
open(cacheName: string): Promise<Cache>;
824
961
readonly default: Cache;
825
962
}
···
849
986
*/
850
987
declare abstract class Crypto {
851
988
/**
989
+
* The **`Crypto.subtle`** read-only property returns a cryptographic operations.
852
990
* Available only in secure contexts.
853
991
*
854
992
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
855
993
*/
856
994
get subtle(): SubtleCrypto;
857
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
995
+
/**
996
+
* The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
997
+
*
998
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
999
+
*/
858
1000
getRandomValues<T extends Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array>(buffer: T): T;
859
1001
/**
1002
+
* The **`randomUUID()`** method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator.
860
1003
* Available only in secure contexts.
861
1004
*
862
1005
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
···
865
1008
DigestStream: typeof DigestStream;
866
1009
}
867
1010
/**
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).
1011
+
* The **`SubtleCrypto`** interface of the Web Crypto API provides a number of low-level cryptographic functions.
869
1012
* Available only in secure contexts.
870
1013
*
871
1014
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
872
1015
*/
873
1016
declare abstract class SubtleCrypto {
874
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
1017
+
/**
1018
+
* The **`encrypt()`** method of the SubtleCrypto interface encrypts data.
1019
+
*
1020
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt)
1021
+
*/
875
1022
encrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, plainText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
876
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
1023
+
/**
1024
+
* The **`decrypt()`** method of the SubtleCrypto interface decrypts some encrypted data.
1025
+
*
1026
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt)
1027
+
*/
877
1028
decrypt(algorithm: string | SubtleCryptoEncryptAlgorithm, key: CryptoKey, cipherText: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
878
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
1029
+
/**
1030
+
* The **`sign()`** method of the SubtleCrypto interface generates a digital signature.
1031
+
*
1032
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign)
1033
+
*/
879
1034
sign(algorithm: string | SubtleCryptoSignAlgorithm, key: CryptoKey, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
880
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
1035
+
/**
1036
+
* The **`verify()`** method of the SubtleCrypto interface verifies a digital signature.
1037
+
*
1038
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify)
1039
+
*/
881
1040
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) */
1041
+
/**
1042
+
* The **`digest()`** method of the SubtleCrypto interface generates a _digest_ of the given data, using the specified hash function.
1043
+
*
1044
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest)
1045
+
*/
883
1046
digest(algorithm: string | SubtleCryptoHashAlgorithm, data: ArrayBuffer | ArrayBufferView): Promise<ArrayBuffer>;
884
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
1047
+
/**
1048
+
* The **`generateKey()`** method of the SubtleCrypto interface is used to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms).
1049
+
*
1050
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey)
1051
+
*/
885
1052
generateKey(algorithm: string | SubtleCryptoGenerateKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey | CryptoKeyPair>;
886
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
1053
+
/**
1054
+
* The **`deriveKey()`** method of the SubtleCrypto interface can be used to derive a secret key from a master key.
1055
+
*
1056
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey)
1057
+
*/
887
1058
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) */
1059
+
/**
1060
+
* The **`deriveBits()`** method of the key.
1061
+
*
1062
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
1063
+
*/
889
1064
deriveBits(algorithm: string | SubtleCryptoDeriveKeyAlgorithm, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
890
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
1065
+
/**
1066
+
* The **`importKey()`** method of the SubtleCrypto interface imports a key: that is, it takes as input a key in an external, portable format and gives you a CryptoKey object that you can use in the Web Crypto API.
1067
+
*
1068
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey)
1069
+
*/
891
1070
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) */
1071
+
/**
1072
+
* The **`exportKey()`** method of the SubtleCrypto interface exports a key: that is, it takes as input a CryptoKey object and gives you the key in an external, portable format.
1073
+
*
1074
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey)
1075
+
*/
893
1076
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
894
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
1077
+
/**
1078
+
* The **`wrapKey()`** method of the SubtleCrypto interface 'wraps' a key.
1079
+
*
1080
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
1081
+
*/
895
1082
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm): Promise<ArrayBuffer>;
896
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
1083
+
/**
1084
+
* The **`unwrapKey()`** method of the SubtleCrypto interface 'unwraps' a key.
1085
+
*
1086
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey)
1087
+
*/
897
1088
unwrapKey(format: string, wrappedKey: ArrayBuffer | ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm, unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm, extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
898
1089
timingSafeEqual(a: ArrayBuffer | ArrayBufferView, b: ArrayBuffer | ArrayBufferView): boolean;
899
1090
}
900
1091
/**
901
-
* The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
1092
+
* The **`CryptoKey`** interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.importKey, or SubtleCrypto.unwrapKey.
902
1093
* Available only in secure contexts.
903
1094
*
904
1095
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
905
1096
*/
906
1097
declare abstract class CryptoKey {
907
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
1098
+
/**
1099
+
* The read-only **`type`** property of the CryptoKey interface indicates which kind of key is represented by the object.
1100
+
*
1101
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type)
1102
+
*/
908
1103
readonly type: string;
909
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
1104
+
/**
1105
+
* The read-only **`extractable`** property of the CryptoKey interface indicates whether or not the key may be extracted using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey()`.
1106
+
*
1107
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable)
1108
+
*/
910
1109
readonly extractable: boolean;
911
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
1110
+
/**
1111
+
* The read-only **`algorithm`** property of the CryptoKey interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters.
1112
+
*
1113
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm)
1114
+
*/
912
1115
readonly algorithm: CryptoKeyKeyAlgorithm | CryptoKeyAesKeyAlgorithm | CryptoKeyHmacKeyAlgorithm | CryptoKeyRsaKeyAlgorithm | CryptoKeyEllipticKeyAlgorithm | CryptoKeyArbitraryKeyAlgorithm;
913
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
1116
+
/**
1117
+
* The read-only **`usages`** property of the CryptoKey interface indicates what can be done with the key.
1118
+
*
1119
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages)
1120
+
*/
914
1121
readonly usages: string[];
915
1122
}
916
1123
interface CryptoKeyPair {
···
1017
1224
get bytesWritten(): number | bigint;
1018
1225
}
1019
1226
/**
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.
1227
+
* The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as `UTF-8`, `ISO-8859-2`, `KOI8-R`, `GBK`, etc.
1021
1228
*
1022
1229
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1023
1230
*/
1024
1231
declare class TextDecoder {
1025
1232
constructor(label?: string, options?: TextDecoderConstructorOptions);
1026
1233
/**
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.
1234
+
* The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter.
1038
1235
*
1039
1236
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
1040
1237
*/
···
1044
1241
get ignoreBOM(): boolean;
1045
1242
}
1046
1243
/**
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.
1244
+
* The **`TextEncoder`** interface takes a stream of code points as input and emits a stream of UTF-8 bytes.
1048
1245
*
1049
1246
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
1050
1247
*/
1051
1248
declare class TextEncoder {
1052
1249
constructor();
1053
1250
/**
1054
-
* Returns the result of running UTF-8's encoder.
1251
+
* The **`TextEncoder.encode()`** method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
1055
1252
*
1056
1253
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
1057
1254
*/
1058
1255
encode(input?: string): Uint8Array;
1059
1256
/**
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.
1257
+
* The **`TextEncoder.encodeInto()`** method takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
1061
1258
*
1062
1259
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
1063
1260
*/
1064
-
encodeInto(input: string, buffer: ArrayBuffer | ArrayBufferView): TextEncoderEncodeIntoResult;
1261
+
encodeInto(input: string, buffer: Uint8Array): TextEncoderEncodeIntoResult;
1065
1262
get encoding(): string;
1066
1263
}
1067
1264
interface TextDecoderConstructorOptions {
···
1076
1273
written: number;
1077
1274
}
1078
1275
/**
1079
-
* Events providing information related to errors in scripts or in files.
1276
+
* The **`ErrorEvent`** interface represents events providing information related to errors in scripts or in files.
1080
1277
*
1081
1278
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
1082
1279
*/
1083
1280
declare class ErrorEvent extends Event {
1084
1281
constructor(type: string, init?: ErrorEventErrorEventInit);
1085
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1282
+
/**
1283
+
* The **`filename`** read-only property of the ErrorEvent interface returns a string containing the name of the script file in which the error occurred.
1284
+
*
1285
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename)
1286
+
*/
1086
1287
get filename(): string;
1087
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1288
+
/**
1289
+
* The **`message`** read-only property of the ErrorEvent interface returns a string containing a human-readable error message describing the problem.
1290
+
*
1291
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message)
1292
+
*/
1088
1293
get message(): string;
1089
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1294
+
/**
1295
+
* The **`lineno`** read-only property of the ErrorEvent interface returns an integer containing the line number of the script file on which the error occurred.
1296
+
*
1297
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno)
1298
+
*/
1090
1299
get lineno(): number;
1091
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1300
+
/**
1301
+
* The **`colno`** read-only property of the ErrorEvent interface returns an integer containing the column number of the script file on which the error occurred.
1302
+
*
1303
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno)
1304
+
*/
1092
1305
get colno(): number;
1093
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1306
+
/**
1307
+
* The **`error`** read-only property of the ErrorEvent interface returns a JavaScript value, such as an Error or DOMException, representing the error associated with this event.
1308
+
*
1309
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error)
1310
+
*/
1094
1311
get error(): any;
1095
1312
}
1096
1313
interface ErrorEventErrorEventInit {
···
1101
1318
error?: any;
1102
1319
}
1103
1320
/**
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".
1321
+
* The **`MessageEvent`** interface represents a message received by a target object.
1322
+
*
1323
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
1324
+
*/
1325
+
declare class MessageEvent extends Event {
1326
+
constructor(type: string, initializer: MessageEventInit);
1327
+
/**
1328
+
* The **`data`** read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.
1329
+
*
1330
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
1331
+
*/
1332
+
readonly data: any;
1333
+
/**
1334
+
* The **`origin`** read-only property of the origin of the message emitter.
1335
+
*
1336
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/origin)
1337
+
*/
1338
+
readonly origin: string | null;
1339
+
/**
1340
+
* The **`lastEventId`** read-only property of the unique ID for the event.
1341
+
*
1342
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/lastEventId)
1343
+
*/
1344
+
readonly lastEventId: string;
1345
+
/**
1346
+
* The **`source`** read-only property of the a WindowProxy, MessagePort, or a `MessageEventSource` (which can be a WindowProxy, message emitter.
1347
+
*
1348
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
1349
+
*/
1350
+
readonly source: MessagePort | null;
1351
+
/**
1352
+
* The **`ports`** read-only property of the containing all MessagePort objects sent with the message, in order.
1353
+
*
1354
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/ports)
1355
+
*/
1356
+
readonly ports: MessagePort[];
1357
+
}
1358
+
interface MessageEventInit {
1359
+
data: ArrayBuffer | string;
1360
+
}
1361
+
/**
1362
+
* The **`PromiseRejectionEvent`** interface represents events which are sent to the global script context when JavaScript Promises are rejected.
1363
+
*
1364
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent)
1365
+
*/
1366
+
declare abstract class PromiseRejectionEvent extends Event {
1367
+
/**
1368
+
* The PromiseRejectionEvent interface's **`promise`** read-only property indicates the JavaScript rejected.
1369
+
*
1370
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise)
1371
+
*/
1372
+
readonly promise: Promise<any>;
1373
+
/**
1374
+
* The PromiseRejectionEvent **`reason`** read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject().
1375
+
*
1376
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason)
1377
+
*/
1378
+
readonly reason: any;
1379
+
}
1380
+
/**
1381
+
* The **`FormData`** interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the Window/fetch, XMLHttpRequest.send() or navigator.sendBeacon() methods.
1105
1382
*
1106
1383
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
1107
1384
*/
1108
1385
declare class FormData {
1109
1386
constructor();
1110
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1387
+
/**
1388
+
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
1389
+
*
1390
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
1391
+
*/
1111
1392
append(name: string, value: string): void;
1112
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1393
+
/**
1394
+
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
1395
+
*
1396
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
1397
+
*/
1113
1398
append(name: string, value: Blob, filename?: string): void;
1114
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
1399
+
/**
1400
+
* The **`delete()`** method of the FormData interface deletes a key and its value(s) from a `FormData` object.
1401
+
*
1402
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete)
1403
+
*/
1115
1404
delete(name: string): void;
1116
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
1405
+
/**
1406
+
* The **`get()`** method of the FormData interface returns the first value associated with a given key from within a `FormData` object.
1407
+
*
1408
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get)
1409
+
*/
1117
1410
get(name: string): (File | string) | null;
1118
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
1411
+
/**
1412
+
* The **`getAll()`** method of the FormData interface returns all the values associated with a given key from within a `FormData` object.
1413
+
*
1414
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll)
1415
+
*/
1119
1416
getAll(name: string): (File | string)[];
1120
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
1417
+
/**
1418
+
* The **`has()`** method of the FormData interface returns whether a `FormData` object contains a certain key.
1419
+
*
1420
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
1421
+
*/
1121
1422
has(name: string): boolean;
1122
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1423
+
/**
1424
+
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
1425
+
*
1426
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
1427
+
*/
1123
1428
set(name: string, value: string): void;
1124
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1429
+
/**
1430
+
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
1431
+
*
1432
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
1433
+
*/
1125
1434
set(name: string, value: Blob, filename?: string): void;
1126
1435
/* Returns an array of key, value pairs for every entry in the list. */
1127
1436
entries(): IterableIterator<[
···
1209
1518
append(content: string, options?: ContentOptions): DocumentEnd;
1210
1519
}
1211
1520
/**
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.
1521
+
* This is the event type for `fetch` events dispatched on the ServiceWorkerGlobalScope.
1213
1522
*
1214
1523
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
1215
1524
*/
1216
1525
declare abstract class FetchEvent extends ExtendableEvent {
1217
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1526
+
/**
1527
+
* The **`request`** read-only property of the the event handler.
1528
+
*
1529
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request)
1530
+
*/
1218
1531
readonly request: Request;
1219
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1532
+
/**
1533
+
* The **`respondWith()`** method of allows you to provide a promise for a Response yourself.
1534
+
*
1535
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith)
1536
+
*/
1220
1537
respondWith(promise: Response | Promise<Response>): void;
1221
1538
passThroughOnException(): void;
1222
1539
}
1223
1540
type HeadersInit = Headers | Iterable<Iterable<string>> | Record<string, string>;
1224
1541
/**
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.
1542
+
* The **`Headers`** interface of the Fetch API allows you to perform various actions on HTTP request and response headers.
1226
1543
*
1227
1544
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
1228
1545
*/
1229
1546
declare class Headers {
1230
1547
constructor(init?: HeadersInit);
1231
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
1548
+
/**
1549
+
* The **`get()`** method of the Headers interface returns a byte string of all the values of a header within a `Headers` object with a given name.
1550
+
*
1551
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get)
1552
+
*/
1232
1553
get(name: string): string | null;
1233
1554
getAll(name: string): string[];
1234
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */
1555
+
/**
1556
+
* The **`getSetCookie()`** method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response.
1557
+
*
1558
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie)
1559
+
*/
1235
1560
getSetCookie(): string[];
1236
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
1561
+
/**
1562
+
* The **`has()`** method of the Headers interface returns a boolean stating whether a `Headers` object contains a certain header.
1563
+
*
1564
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has)
1565
+
*/
1237
1566
has(name: string): boolean;
1238
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
1567
+
/**
1568
+
* The **`set()`** method of the Headers interface sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
1569
+
*
1570
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set)
1571
+
*/
1239
1572
set(name: string, value: string): void;
1240
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
1573
+
/**
1574
+
* The **`append()`** method of the Headers interface appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
1575
+
*
1576
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append)
1577
+
*/
1241
1578
append(name: string, value: string): void;
1242
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
1579
+
/**
1580
+
* The **`delete()`** method of the Headers interface deletes a header from the current `Headers` object.
1581
+
*
1582
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete)
1583
+
*/
1243
1584
delete(name: string): void;
1244
1585
forEach<This = unknown>(callback: (this: This, value: string, key: string, parent: Headers) => void, thisArg?: This): void;
1245
1586
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
···
1276
1617
blob(): Promise<Blob>;
1277
1618
}
1278
1619
/**
1279
-
* This Fetch API interface represents the response to a request.
1620
+
* The **`Response`** interface of the Fetch API represents the response to a request.
1280
1621
*
1281
1622
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1282
1623
*/
···
1288
1629
json(any: any, maybeInit?: (ResponseInit | Response)): Response;
1289
1630
};
1290
1631
/**
1291
-
* This Fetch API interface represents the response to a request.
1632
+
* The **`Response`** interface of the Fetch API represents the response to a request.
1292
1633
*
1293
1634
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1294
1635
*/
1295
1636
interface Response extends Body {
1296
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1637
+
/**
1638
+
* The **`clone()`** method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable.
1639
+
*
1640
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone)
1641
+
*/
1297
1642
clone(): Response;
1298
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1643
+
/**
1644
+
* The **`status`** read-only property of the Response interface contains the HTTP status codes of the response.
1645
+
*
1646
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status)
1647
+
*/
1299
1648
status: number;
1300
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1649
+
/**
1650
+
* The **`statusText`** read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status.
1651
+
*
1652
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText)
1653
+
*/
1301
1654
statusText: string;
1302
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1655
+
/**
1656
+
* The **`headers`** read-only property of the with the response.
1657
+
*
1658
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers)
1659
+
*/
1303
1660
headers: Headers;
1304
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1661
+
/**
1662
+
* The **`ok`** read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not.
1663
+
*
1664
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok)
1665
+
*/
1305
1666
ok: boolean;
1306
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1667
+
/**
1668
+
* The **`redirected`** read-only property of the Response interface indicates whether or not the response is the result of a request you made which was redirected.
1669
+
*
1670
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected)
1671
+
*/
1307
1672
redirected: boolean;
1308
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1673
+
/**
1674
+
* The **`url`** read-only property of the Response interface contains the URL of the response.
1675
+
*
1676
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url)
1677
+
*/
1309
1678
url: string;
1310
1679
webSocket: WebSocket | null;
1311
1680
cf: any | undefined;
1312
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type) */
1681
+
/**
1682
+
* The **`type`** read-only property of the Response interface contains the type of the response.
1683
+
*
1684
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type)
1685
+
*/
1313
1686
type: "default" | "error";
1314
1687
}
1315
1688
interface ResponseInit {
···
1322
1695
}
1323
1696
type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> = Request<CfHostMetadata, Cf> | string;
1324
1697
/**
1325
-
* This Fetch API interface represents a resource request.
1698
+
* The **`Request`** interface of the Fetch API represents a resource request.
1326
1699
*
1327
1700
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1328
1701
*/
···
1331
1704
new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(input: RequestInfo<CfProperties> | URL, init?: RequestInit<Cf>): Request<CfHostMetadata, Cf>;
1332
1705
};
1333
1706
/**
1334
-
* This Fetch API interface represents a resource request.
1707
+
* The **`Request`** interface of the Fetch API represents a resource request.
1335
1708
*
1336
1709
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1337
1710
*/
1338
1711
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> extends Body {
1339
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1712
+
/**
1713
+
* The **`clone()`** method of the Request interface creates a copy of the current `Request` object.
1714
+
*
1715
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone)
1716
+
*/
1340
1717
clone(): Request<CfHostMetadata, Cf>;
1341
1718
/**
1342
-
* Returns request's HTTP method, which is "GET" by default.
1719
+
* The **`method`** read-only property of the `POST`, etc.) A String indicating the method of the request.
1343
1720
*
1344
1721
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1345
1722
*/
1346
1723
method: string;
1347
1724
/**
1348
-
* Returns the URL of request as a string.
1725
+
* The **`url`** read-only property of the Request interface contains the URL of the request.
1349
1726
*
1350
1727
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
1351
1728
*/
1352
1729
url: string;
1353
1730
/**
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.
1731
+
* The **`headers`** read-only property of the with the request.
1355
1732
*
1356
1733
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1357
1734
*/
1358
1735
headers: Headers;
1359
1736
/**
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.
1737
+
* The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled.
1361
1738
*
1362
1739
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
1363
1740
*/
1364
1741
redirect: string;
1365
1742
fetcher: Fetcher | null;
1366
1743
/**
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.
1744
+
* The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request.
1368
1745
*
1369
1746
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
1370
1747
*/
1371
1748
signal: AbortSignal;
1372
1749
cf: Cf | undefined;
1373
1750
/**
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]
1751
+
* The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request.
1375
1752
*
1376
1753
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
1377
1754
*/
1378
1755
integrity: string;
1379
1756
/**
1380
-
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
1757
+
* The **`keepalive`** read-only property of the Request interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.
1381
1758
*
1382
1759
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1383
1760
*/
1384
1761
keepalive: boolean;
1385
1762
/**
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.
1763
+
* The **`cache`** read-only property of the Request interface contains the cache mode of the request.
1387
1764
*
1388
1765
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
1389
1766
*/
1390
-
cache?: "no-store";
1767
+
cache?: "no-store" | "no-cache";
1391
1768
}
1392
1769
interface RequestInit<Cf = CfProperties> {
1393
1770
/* A string to set request's method. */
···
1401
1778
fetcher?: (Fetcher | null);
1402
1779
cf?: Cf;
1403
1780
/* A string indicating how the request will interact with the browser's cache to set request's cache. */
1404
-
cache?: "no-store";
1781
+
cache?: "no-store" | "no-cache";
1405
1782
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1406
1783
integrity?: string;
1407
1784
/* An AbortSignal to set request's signal. */
1408
1785
signal?: (AbortSignal | null);
1409
1786
encodeResponseBody?: "automatic" | "manual";
1410
1787
}
1411
-
type Service<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = Fetcher<T>;
1788
+
type Service<T extends (new (...args: any[]) => Rpc.WorkerEntrypointBranded) | Rpc.WorkerEntrypointBranded | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? Fetcher<InstanceType<T>> : T extends Rpc.WorkerEntrypointBranded ? Fetcher<T> : T extends Exclude<Rpc.EntrypointBranded, Rpc.WorkerEntrypointBranded> ? never : Fetcher<undefined>;
1412
1789
type Fetcher<T extends Rpc.EntrypointBranded | undefined = undefined, Reserved extends string = never> = (T extends Rpc.EntrypointBranded ? Rpc.Provider<T, Reserved | "fetch" | "connect"> : unknown) & {
1413
1790
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
1414
1791
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
···
1734
2111
value?: undefined;
1735
2112
};
1736
2113
/**
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.
2114
+
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
1738
2115
*
1739
2116
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1740
2117
*/
1741
2118
interface ReadableStream<R = any> {
1742
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
2119
+
/**
2120
+
* The **`locked`** read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.
2121
+
*
2122
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked)
2123
+
*/
1743
2124
get locked(): boolean;
1744
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
2125
+
/**
2126
+
* The **`cancel()`** method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.
2127
+
*
2128
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel)
2129
+
*/
1745
2130
cancel(reason?: any): Promise<void>;
1746
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
2131
+
/**
2132
+
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
2133
+
*
2134
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
2135
+
*/
1747
2136
getReader(): ReadableStreamDefaultReader<R>;
1748
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
2137
+
/**
2138
+
* The **`getReader()`** method of the ReadableStream interface creates a reader and locks the stream to it.
2139
+
*
2140
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
2141
+
*/
1749
2142
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
1750
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
2143
+
/**
2144
+
* The **`pipeThrough()`** method of the ReadableStream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
2145
+
*
2146
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough)
2147
+
*/
1751
2148
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
1752
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
2149
+
/**
2150
+
* The **`pipeTo()`** method of the ReadableStream interface pipes the current `ReadableStream` to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
2151
+
*
2152
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
2153
+
*/
1753
2154
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
1754
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
2155
+
/**
2156
+
* The **`tee()`** method of the two-element array containing the two resulting branches as new ReadableStream instances.
2157
+
*
2158
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
2159
+
*/
1755
2160
tee(): [
1756
2161
ReadableStream<R>,
1757
2162
ReadableStream<R>
···
1760
2165
[Symbol.asyncIterator](options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1761
2166
}
1762
2167
/**
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.
2168
+
* The `ReadableStream` interface of the Streams API represents a readable stream of byte data.
1764
2169
*
1765
2170
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1766
2171
*/
···
1769
2174
new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
1770
2175
new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
1771
2176
};
1772
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
2177
+
/**
2178
+
* The **`ReadableStreamDefaultReader`** interface of the Streams API represents a default reader that can be used to read stream data supplied from a network (such as a fetch request).
2179
+
*
2180
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader)
2181
+
*/
1773
2182
declare class ReadableStreamDefaultReader<R = any> {
1774
2183
constructor(stream: ReadableStream);
1775
2184
get closed(): Promise<void>;
1776
2185
cancel(reason?: any): Promise<void>;
1777
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
2186
+
/**
2187
+
* The **`read()`** method of the ReadableStreamDefaultReader interface returns a Promise providing access to the next chunk in the stream's internal queue.
2188
+
*
2189
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read)
2190
+
*/
1778
2191
read(): Promise<ReadableStreamReadResult<R>>;
1779
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
2192
+
/**
2193
+
* The **`releaseLock()`** method of the ReadableStreamDefaultReader interface releases the reader's lock on the stream.
2194
+
*
2195
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock)
2196
+
*/
1780
2197
releaseLock(): void;
1781
2198
}
1782
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
2199
+
/**
2200
+
* The `ReadableStreamBYOBReader` interface of the Streams API defines a reader for a ReadableStream that supports zero-copy reading from an underlying byte source.
2201
+
*
2202
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader)
2203
+
*/
1783
2204
declare class ReadableStreamBYOBReader {
1784
2205
constructor(stream: ReadableStream);
1785
2206
get closed(): Promise<void>;
1786
2207
cancel(reason?: any): Promise<void>;
1787
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
2208
+
/**
2209
+
* The **`read()`** method of the ReadableStreamBYOBReader interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream.
2210
+
*
2211
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
2212
+
*/
1788
2213
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
1789
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
2214
+
/**
2215
+
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
2216
+
*
2217
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock)
2218
+
*/
1790
2219
releaseLock(): void;
1791
2220
readAtLeast<T extends ArrayBufferView>(minElements: number, view: T): Promise<ReadableStreamReadResult<T>>;
1792
2221
}
···
1801
2230
*/
1802
2231
mode: "byob";
1803
2232
}
1804
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
2233
+
/**
2234
+
* The **`ReadableStreamBYOBRequest`** interface of the Streams API represents a 'pull request' for data from an underlying source that will made as a zero-copy transfer to a consumer (bypassing the stream's internal queues).
2235
+
*
2236
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest)
2237
+
*/
1805
2238
declare abstract class ReadableStreamBYOBRequest {
1806
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
2239
+
/**
2240
+
* The **`view`** getter property of the ReadableStreamBYOBRequest interface returns the current view.
2241
+
*
2242
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view)
2243
+
*/
1807
2244
get view(): Uint8Array | null;
1808
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
2245
+
/**
2246
+
* The **`respond()`** method of the ReadableStreamBYOBRequest interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the ReadableStreamBYOBRequest.view.
2247
+
*
2248
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond)
2249
+
*/
1809
2250
respond(bytesWritten: number): void;
1810
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
2251
+
/**
2252
+
* The **`respondWithNewView()`** method of the ReadableStreamBYOBRequest interface specifies a new view that the consumer of the associated readable byte stream should write to instead of ReadableStreamBYOBRequest.view.
2253
+
*
2254
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)
2255
+
*/
1811
2256
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
1812
2257
get atLeast(): number | null;
1813
2258
}
1814
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
2259
+
/**
2260
+
* The **`ReadableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.
2261
+
*
2262
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController)
2263
+
*/
1815
2264
declare abstract class ReadableStreamDefaultController<R = any> {
1816
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
2265
+
/**
2266
+
* The **`desiredSize`** read-only property of the required to fill the stream's internal queue.
2267
+
*
2268
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize)
2269
+
*/
1817
2270
get desiredSize(): number | null;
1818
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
2271
+
/**
2272
+
* The **`close()`** method of the ReadableStreamDefaultController interface closes the associated stream.
2273
+
*
2274
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close)
2275
+
*/
1819
2276
close(): void;
1820
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
2277
+
/**
2278
+
* The **`enqueue()`** method of the ```js-nolint enqueue(chunk) ``` - `chunk` - : The chunk to enqueue.
2279
+
*
2280
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue)
2281
+
*/
1821
2282
enqueue(chunk?: R): void;
1822
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
2283
+
/**
2284
+
* The **`error()`** method of the with the associated stream to error.
2285
+
*
2286
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error)
2287
+
*/
1823
2288
error(reason: any): void;
1824
2289
}
1825
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
2290
+
/**
2291
+
* The **`ReadableByteStreamController`** interface of the Streams API represents a controller for a readable byte stream.
2292
+
*
2293
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController)
2294
+
*/
1826
2295
declare abstract class ReadableByteStreamController {
1827
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
2296
+
/**
2297
+
* The **`byobRequest`** read-only property of the ReadableByteStreamController interface returns the current BYOB request, or `null` if there are no pending requests.
2298
+
*
2299
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest)
2300
+
*/
1828
2301
get byobRequest(): ReadableStreamBYOBRequest | null;
1829
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
2302
+
/**
2303
+
* The **`desiredSize`** read-only property of the ReadableByteStreamController interface returns the number of bytes required to fill the stream's internal queue to its 'desired size'.
2304
+
*
2305
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize)
2306
+
*/
1830
2307
get desiredSize(): number | null;
1831
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
2308
+
/**
2309
+
* The **`close()`** method of the ReadableByteStreamController interface closes the associated stream.
2310
+
*
2311
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close)
2312
+
*/
1832
2313
close(): void;
1833
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
2314
+
/**
2315
+
* The **`enqueue()`** method of the ReadableByteStreamController interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues).
2316
+
*
2317
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue)
2318
+
*/
1834
2319
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
1835
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
2320
+
/**
2321
+
* The **`error()`** method of the ReadableByteStreamController interface causes any future interactions with the associated stream to error with the specified reason.
2322
+
*
2323
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error)
2324
+
*/
1836
2325
error(reason: any): void;
1837
2326
}
1838
2327
/**
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.
2328
+
* The **`WritableStreamDefaultController`** interface of the Streams API represents a controller allowing control of a WritableStream's state.
1840
2329
*
1841
2330
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
1842
2331
*/
1843
2332
declare abstract class WritableStreamDefaultController {
1844
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
2333
+
/**
2334
+
* The read-only **`signal`** property of the WritableStreamDefaultController interface returns the AbortSignal associated with the controller.
2335
+
*
2336
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal)
2337
+
*/
1845
2338
get signal(): AbortSignal;
1846
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
2339
+
/**
2340
+
* The **`error()`** method of the with the associated stream to error.
2341
+
*
2342
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
2343
+
*/
1847
2344
error(reason?: any): void;
1848
2345
}
1849
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
2346
+
/**
2347
+
* The **`TransformStreamDefaultController`** interface of the Streams API provides methods to manipulate the associated ReadableStream and WritableStream.
2348
+
*
2349
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController)
2350
+
*/
1850
2351
declare abstract class TransformStreamDefaultController<O = any> {
1851
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
2352
+
/**
2353
+
* The **`desiredSize`** read-only property of the TransformStreamDefaultController interface returns the desired size to fill the queue of the associated ReadableStream.
2354
+
*
2355
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize)
2356
+
*/
1852
2357
get desiredSize(): number | null;
1853
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
2358
+
/**
2359
+
* The **`enqueue()`** method of the TransformStreamDefaultController interface enqueues the given chunk in the readable side of the stream.
2360
+
*
2361
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue)
2362
+
*/
1854
2363
enqueue(chunk?: O): void;
1855
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
2364
+
/**
2365
+
* The **`error()`** method of the TransformStreamDefaultController interface errors both sides of the stream.
2366
+
*
2367
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error)
2368
+
*/
1856
2369
error(reason: any): void;
1857
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
2370
+
/**
2371
+
* The **`terminate()`** method of the TransformStreamDefaultController interface closes the readable side and errors the writable side of the stream.
2372
+
*
2373
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate)
2374
+
*/
1858
2375
terminate(): void;
1859
2376
}
1860
2377
interface ReadableWritablePair<R = any, W = any> {
···
1867
2384
readable: ReadableStream<R>;
1868
2385
}
1869
2386
/**
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.
2387
+
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
1871
2388
*
1872
2389
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
1873
2390
*/
1874
2391
declare class WritableStream<W = any> {
1875
2392
constructor(underlyingSink?: UnderlyingSink, queuingStrategy?: QueuingStrategy);
1876
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
2393
+
/**
2394
+
* The **`locked`** read-only property of the WritableStream interface returns a boolean indicating whether the `WritableStream` is locked to a writer.
2395
+
*
2396
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked)
2397
+
*/
1877
2398
get locked(): boolean;
1878
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
2399
+
/**
2400
+
* The **`abort()`** method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
2401
+
*
2402
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
2403
+
*/
1879
2404
abort(reason?: any): Promise<void>;
1880
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
2405
+
/**
2406
+
* The **`close()`** method of the WritableStream interface closes the associated stream.
2407
+
*
2408
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
2409
+
*/
1881
2410
close(): Promise<void>;
1882
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
2411
+
/**
2412
+
* The **`getWriter()`** method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
2413
+
*
2414
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
2415
+
*/
1883
2416
getWriter(): WritableStreamDefaultWriter<W>;
1884
2417
}
1885
2418
/**
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.
2419
+
* The **`WritableStreamDefaultWriter`** interface of the Streams API is the object returned by WritableStream.getWriter() and once created locks the writer to the `WritableStream` ensuring that no other streams can write to the underlying sink.
1887
2420
*
1888
2421
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
1889
2422
*/
1890
2423
declare class WritableStreamDefaultWriter<W = any> {
1891
2424
constructor(stream: WritableStream);
1892
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
2425
+
/**
2426
+
* The **`closed`** read-only property of the the stream errors or the writer's lock is released.
2427
+
*
2428
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed)
2429
+
*/
1893
2430
get closed(): Promise<void>;
1894
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
2431
+
/**
2432
+
* The **`ready`** read-only property of the that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
2433
+
*
2434
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready)
2435
+
*/
1895
2436
get ready(): Promise<void>;
1896
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
2437
+
/**
2438
+
* The **`desiredSize`** read-only property of the to fill the stream's internal queue.
2439
+
*
2440
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize)
2441
+
*/
1897
2442
get desiredSize(): number | null;
1898
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
2443
+
/**
2444
+
* The **`abort()`** method of the the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
2445
+
*
2446
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort)
2447
+
*/
1899
2448
abort(reason?: any): Promise<void>;
1900
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
2449
+
/**
2450
+
* The **`close()`** method of the stream.
2451
+
*
2452
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close)
2453
+
*/
1901
2454
close(): Promise<void>;
1902
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
2455
+
/**
2456
+
* The **`write()`** method of the operation.
2457
+
*
2458
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write)
2459
+
*/
1903
2460
write(chunk?: W): Promise<void>;
1904
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
2461
+
/**
2462
+
* The **`releaseLock()`** method of the corresponding stream.
2463
+
*
2464
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
2465
+
*/
1905
2466
releaseLock(): void;
1906
2467
}
1907
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
2468
+
/**
2469
+
* The **`TransformStream`** interface of the Streams API represents a concrete implementation of the pipe chain _transform stream_ concept.
2470
+
*
2471
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream)
2472
+
*/
1908
2473
declare class TransformStream<I = any, O = any> {
1909
2474
constructor(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>);
1910
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
2475
+
/**
2476
+
* The **`readable`** read-only property of the TransformStream interface returns the ReadableStream instance controlled by this `TransformStream`.
2477
+
*
2478
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable)
2479
+
*/
1911
2480
get readable(): ReadableStream<O>;
1912
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
2481
+
/**
2482
+
* The **`writable`** read-only property of the TransformStream interface returns the WritableStream instance controlled by this `TransformStream`.
2483
+
*
2484
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable)
2485
+
*/
1913
2486
get writable(): WritableStream<I>;
1914
2487
}
1915
2488
declare class FixedLengthStream extends IdentityTransformStream {
···
1924
2497
interface ReadableStreamValuesOptions {
1925
2498
preventCancel?: boolean;
1926
2499
}
1927
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
2500
+
/**
2501
+
* The **`CompressionStream`** interface of the Compression Streams API is an API for compressing a stream of data.
2502
+
*
2503
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream)
2504
+
*/
1928
2505
declare class CompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
1929
2506
constructor(format: "gzip" | "deflate" | "deflate-raw");
1930
2507
}
1931
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
2508
+
/**
2509
+
* The **`DecompressionStream`** interface of the Compression Streams API is an API for decompressing a stream of data.
2510
+
*
2511
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream)
2512
+
*/
1932
2513
declare class DecompressionStream extends TransformStream<ArrayBuffer | ArrayBufferView, Uint8Array> {
1933
2514
constructor(format: "gzip" | "deflate" | "deflate-raw");
1934
2515
}
1935
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
2516
+
/**
2517
+
* The **`TextEncoderStream`** interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding.
2518
+
*
2519
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream)
2520
+
*/
1936
2521
declare class TextEncoderStream extends TransformStream<string, Uint8Array> {
1937
2522
constructor();
1938
2523
get encoding(): string;
1939
2524
}
1940
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
2525
+
/**
2526
+
* The **`TextDecoderStream`** interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
2527
+
*
2528
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream)
2529
+
*/
1941
2530
declare class TextDecoderStream extends TransformStream<ArrayBuffer | ArrayBufferView, string> {
1942
2531
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
1943
2532
get encoding(): string;
···
1949
2538
ignoreBOM?: boolean;
1950
2539
}
1951
2540
/**
1952
-
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
2541
+
* The **`ByteLengthQueuingStrategy`** interface of the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams.
1953
2542
*
1954
2543
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
1955
2544
*/
1956
2545
declare class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> {
1957
2546
constructor(init: QueuingStrategyInit);
1958
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
2547
+
/**
2548
+
* The read-only **`ByteLengthQueuingStrategy.highWaterMark`** property returns the total number of bytes that can be contained in the internal queue before backpressure is applied.
2549
+
*
2550
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark)
2551
+
*/
1959
2552
get highWaterMark(): number;
1960
2553
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
1961
2554
get size(): (chunk?: any) => number;
1962
2555
}
1963
2556
/**
1964
-
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
2557
+
* The **`CountQueuingStrategy`** interface of the Streams API provides a built-in chunk counting queuing strategy that can be used when constructing streams.
1965
2558
*
1966
2559
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
1967
2560
*/
1968
2561
declare class CountQueuingStrategy implements QueuingStrategy {
1969
2562
constructor(init: QueuingStrategyInit);
1970
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
2563
+
/**
2564
+
* The read-only **`CountQueuingStrategy.highWaterMark`** property returns the total number of chunks that can be contained in the internal queue before backpressure is applied.
2565
+
*
2566
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark)
2567
+
*/
1971
2568
get highWaterMark(): number;
1972
2569
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
1973
2570
get size(): (chunk?: any) => number;
···
2000
2597
readonly scriptVersion?: ScriptVersion;
2001
2598
readonly dispatchNamespace?: string;
2002
2599
readonly scriptTags?: string[];
2600
+
readonly durableObjectId?: string;
2003
2601
readonly outcome: string;
2004
2602
readonly executionModel: string;
2005
2603
readonly truncated: boolean;
···
2085
2683
fromTrace(item: TraceItem): TraceMetrics;
2086
2684
}
2087
2685
/**
2088
-
* The URL interface represents an object providing static methods used for creating object URLs.
2686
+
* The **`URL`** interface is used to parse, construct, normalize, and encode URL.
2089
2687
*
2090
2688
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
2091
2689
*/
2092
2690
declare class URL {
2093
2691
constructor(url: string | URL, base?: string | URL);
2094
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
2692
+
/**
2693
+
* The **`origin`** read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL.
2694
+
*
2695
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin)
2696
+
*/
2095
2697
get origin(): string;
2096
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2698
+
/**
2699
+
* The **`href`** property of the URL interface is a string containing the whole URL.
2700
+
*
2701
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href)
2702
+
*/
2097
2703
get href(): string;
2098
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2704
+
/**
2705
+
* The **`href`** property of the URL interface is a string containing the whole URL.
2706
+
*
2707
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href)
2708
+
*/
2099
2709
set href(value: string);
2100
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2710
+
/**
2711
+
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
2712
+
*
2713
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
2714
+
*/
2101
2715
get protocol(): string;
2102
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2716
+
/**
2717
+
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final `':'`.
2718
+
*
2719
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
2720
+
*/
2103
2721
set protocol(value: string);
2104
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2722
+
/**
2723
+
* The **`username`** property of the URL interface is a string containing the username component of the URL.
2724
+
*
2725
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
2726
+
*/
2105
2727
get username(): string;
2106
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2728
+
/**
2729
+
* The **`username`** property of the URL interface is a string containing the username component of the URL.
2730
+
*
2731
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
2732
+
*/
2107
2733
set username(value: string);
2108
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2734
+
/**
2735
+
* The **`password`** property of the URL interface is a string containing the password component of the URL.
2736
+
*
2737
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
2738
+
*/
2109
2739
get password(): string;
2110
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2740
+
/**
2741
+
* The **`password`** property of the URL interface is a string containing the password component of the URL.
2742
+
*
2743
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
2744
+
*/
2111
2745
set password(value: string);
2112
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2746
+
/**
2747
+
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
2748
+
*
2749
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
2750
+
*/
2113
2751
get host(): string;
2114
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2752
+
/**
2753
+
* The **`host`** property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a `':'`, followed by the URL.port of the URL.
2754
+
*
2755
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
2756
+
*/
2115
2757
set host(value: string);
2116
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2758
+
/**
2759
+
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
2760
+
*
2761
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
2762
+
*/
2117
2763
get hostname(): string;
2118
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2764
+
/**
2765
+
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL.
2766
+
*
2767
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
2768
+
*/
2119
2769
set hostname(value: string);
2120
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2770
+
/**
2771
+
* The **`port`** property of the URL interface is a string containing the port number of the URL.
2772
+
*
2773
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
2774
+
*/
2121
2775
get port(): string;
2122
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2776
+
/**
2777
+
* The **`port`** property of the URL interface is a string containing the port number of the URL.
2778
+
*
2779
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
2780
+
*/
2123
2781
set port(value: string);
2124
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2782
+
/**
2783
+
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
2784
+
*
2785
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
2786
+
*/
2125
2787
get pathname(): string;
2126
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2788
+
/**
2789
+
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure.
2790
+
*
2791
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
2792
+
*/
2127
2793
set pathname(value: string);
2128
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2794
+
/**
2795
+
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
2796
+
*
2797
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
2798
+
*/
2129
2799
get search(): string;
2130
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2800
+
/**
2801
+
* The **`search`** property of the URL interface is a search string, also called a _query string_, that is a string containing a `'?'` followed by the parameters of the URL.
2802
+
*
2803
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
2804
+
*/
2131
2805
set search(value: string);
2132
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2806
+
/**
2807
+
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
2808
+
*
2809
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
2810
+
*/
2133
2811
get hash(): string;
2134
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2812
+
/**
2813
+
* The **`hash`** property of the URL interface is a string containing a `'#'` followed by the fragment identifier of the URL.
2814
+
*
2815
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
2816
+
*/
2135
2817
set hash(value: string);
2136
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
2818
+
/**
2819
+
* The **`searchParams`** read-only property of the access to the [MISSING: httpmethod('GET')] decoded query arguments contained in the URL.
2820
+
*
2821
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
2822
+
*/
2137
2823
get searchParams(): URLSearchParams;
2138
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
2824
+
/**
2825
+
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as ```js-nolint toJSON() ``` None.
2826
+
*
2827
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
2828
+
*/
2139
2829
toJSON(): string;
2140
2830
/*function toString() { [native code] }*/
2141
2831
toString(): string;
2142
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
2832
+
/**
2833
+
* The **`URL.canParse()`** static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid.
2834
+
*
2835
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static)
2836
+
*/
2143
2837
static canParse(url: string, base?: string): boolean;
2144
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
2838
+
/**
2839
+
* The **`URL.parse()`** static method of the URL interface returns a newly created URL object representing the URL defined by the parameters.
2840
+
*
2841
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static)
2842
+
*/
2145
2843
static parse(url: string, base?: string): URL | null;
2146
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
2844
+
/**
2845
+
* The **`createObjectURL()`** static method of the URL interface creates a string containing a URL representing the object given in the parameter.
2846
+
*
2847
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
2848
+
*/
2147
2849
static createObjectURL(object: File | Blob): string;
2148
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
2850
+
/**
2851
+
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.
2852
+
*
2853
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
2854
+
*/
2149
2855
static revokeObjectURL(object_url: string): void;
2150
2856
}
2151
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
2857
+
/**
2858
+
* The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL.
2859
+
*
2860
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
2861
+
*/
2152
2862
declare class URLSearchParams {
2153
2863
constructor(init?: (Iterable<Iterable<string>> | Record<string, string> | string));
2154
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
2864
+
/**
2865
+
* The **`size`** read-only property of the URLSearchParams interface indicates the total number of search parameter entries.
2866
+
*
2867
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size)
2868
+
*/
2155
2869
get size(): number;
2156
2870
/**
2157
-
* Appends a specified key/value pair as a new search parameter.
2871
+
* The **`append()`** method of the URLSearchParams interface appends a specified key/value pair as a new search parameter.
2158
2872
*
2159
2873
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
2160
2874
*/
2161
2875
append(name: string, value: string): void;
2162
2876
/**
2163
-
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
2877
+
* The **`delete()`** method of the URLSearchParams interface deletes specified parameters and their associated value(s) from the list of all search parameters.
2164
2878
*
2165
2879
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
2166
2880
*/
2167
2881
delete(name: string, value?: string): void;
2168
2882
/**
2169
-
* Returns the first value associated to the given search parameter.
2883
+
* The **`get()`** method of the URLSearchParams interface returns the first value associated to the given search parameter.
2170
2884
*
2171
2885
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
2172
2886
*/
2173
2887
get(name: string): string | null;
2174
2888
/**
2175
-
* Returns all the values association with a given search parameter.
2889
+
* The **`getAll()`** method of the URLSearchParams interface returns all the values associated with a given search parameter as an array.
2176
2890
*
2177
2891
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
2178
2892
*/
2179
2893
getAll(name: string): string[];
2180
2894
/**
2181
-
* Returns a Boolean indicating if such a search parameter exists.
2895
+
* The **`has()`** method of the URLSearchParams interface returns a boolean value that indicates whether the specified parameter is in the search parameters.
2182
2896
*
2183
2897
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
2184
2898
*/
2185
2899
has(name: string, value?: string): boolean;
2186
2900
/**
2187
-
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
2901
+
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value.
2188
2902
*
2189
2903
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
2190
2904
*/
2191
2905
set(name: string, value: string): void;
2192
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
2906
+
/**
2907
+
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns `undefined`.
2908
+
*
2909
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
2910
+
*/
2193
2911
sort(): void;
2194
2912
/* Returns an array of key, value pairs for every entry in the search params. */
2195
2913
entries(): IterableIterator<[
···
2201
2919
/* Returns a list of values in the search params. */
2202
2920
values(): IterableIterator<string>;
2203
2921
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. */
2922
+
/*function toString() { [native code] }*/
2205
2923
toString(): string;
2206
2924
[Symbol.iterator](): IterableIterator<[
2207
2925
key: string,
···
2252
2970
ignoreCase?: boolean;
2253
2971
}
2254
2972
/**
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.
2973
+
* A `CloseEvent` is sent to clients using WebSockets when the connection is closed.
2256
2974
*
2257
2975
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
2258
2976
*/
2259
2977
declare class CloseEvent extends Event {
2260
2978
constructor(type: string, initializer?: CloseEventInit);
2261
2979
/**
2262
-
* Returns the WebSocket connection close code provided by the server.
2980
+
* The **`code`** read-only property of the CloseEvent interface returns a WebSocket connection close code indicating the reason the connection was closed.
2263
2981
*
2264
2982
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
2265
2983
*/
2266
2984
readonly code: number;
2267
2985
/**
2268
-
* Returns the WebSocket connection close reason provided by the server.
2986
+
* The **`reason`** read-only property of the CloseEvent interface returns the WebSocket connection close reason the server gave for closing the connection; that is, a concise human-readable prose explanation for the closure.
2269
2987
*
2270
2988
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
2271
2989
*/
2272
2990
readonly reason: string;
2273
2991
/**
2274
-
* Returns true if the connection closed cleanly; false otherwise.
2992
+
* The **`wasClean`** read-only property of the CloseEvent interface returns `true` if the connection closed cleanly.
2275
2993
*
2276
2994
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
2277
2995
*/
···
2282
3000
reason?: string;
2283
3001
wasClean?: boolean;
2284
3002
}
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
3003
type WebSocketEventMap = {
2303
3004
close: CloseEvent;
2304
3005
message: MessageEvent;
···
2306
3007
error: ErrorEvent;
2307
3008
};
2308
3009
/**
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.
3010
+
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2310
3011
*
2311
3012
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2312
3013
*/
···
2323
3024
readonly CLOSED: number;
2324
3025
};
2325
3026
/**
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.
3027
+
* The `WebSocket` object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2327
3028
*
2328
3029
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2329
3030
*/
2330
3031
interface WebSocket extends EventTarget<WebSocketEventMap> {
2331
3032
accept(): void;
2332
3033
/**
2333
-
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
3034
+
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
2334
3035
*
2335
3036
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
2336
3037
*/
2337
3038
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
2338
3039
/**
2339
-
* Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
3040
+
* The **`WebSocket.close()`** method closes the already `CLOSED`, this method does nothing.
2340
3041
*
2341
3042
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
2342
3043
*/
···
2344
3045
serializeAttachment(attachment: any): void;
2345
3046
deserializeAttachment(): any | null;
2346
3047
/**
2347
-
* Returns the state of the WebSocket object's connection. It can have the values described below.
3048
+
* The **`WebSocket.readyState`** read-only property returns the current state of the WebSocket connection.
2348
3049
*
2349
3050
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2350
3051
*/
2351
3052
readyState: number;
2352
3053
/**
2353
-
* Returns the URL that was used to establish the WebSocket connection.
3054
+
* The **`WebSocket.url`** read-only property returns the absolute URL of the WebSocket as resolved by the constructor.
2354
3055
*
2355
3056
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2356
3057
*/
2357
3058
url: string | null;
2358
3059
/**
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.
3060
+
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the `protocols` parameter when creating the WebSocket object, or the empty string if no connection is established.
2360
3061
*
2361
3062
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2362
3063
*/
2363
3064
protocol: string | null;
2364
3065
/**
2365
-
* Returns the extensions selected by the server, if any.
3066
+
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server.
2366
3067
*
2367
3068
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2368
3069
*/
···
2425
3126
remoteAddress?: string;
2426
3127
localAddress?: string;
2427
3128
}
2428
-
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
3129
+
/**
3130
+
* The **`EventSource`** interface is web content's interface to server-sent events.
3131
+
*
3132
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource)
3133
+
*/
2429
3134
declare class EventSource extends EventTarget {
2430
3135
constructor(url: string, init?: EventSourceEventSourceInit);
2431
3136
/**
2432
-
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3137
+
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the ```js-nolint close() ``` None.
2433
3138
*
2434
3139
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
2435
3140
*/
2436
3141
close(): void;
2437
3142
/**
2438
-
* Returns the URL providing the event stream.
3143
+
* The **`url`** read-only property of the URL of the source.
2439
3144
*
2440
3145
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
2441
3146
*/
2442
3147
get url(): string;
2443
3148
/**
2444
-
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3149
+
* The **`withCredentials`** read-only property of the the `EventSource` object was instantiated with CORS credentials set.
2445
3150
*
2446
3151
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
2447
3152
*/
2448
3153
get withCredentials(): boolean;
2449
3154
/**
2450
-
* Returns the state of this EventSource object's connection. It can have the values described below.
3155
+
* The **`readyState`** read-only property of the connection.
2451
3156
*
2452
3157
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
2453
3158
*/
···
2480
3185
destroy(error?: any): Promise<void>;
2481
3186
signal(signo: number): void;
2482
3187
getTcpPort(port: number): Fetcher;
3188
+
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
2483
3189
}
2484
3190
interface ContainerStartupOptions {
2485
3191
entrypoint?: string[];
2486
3192
enableInternet: boolean;
2487
3193
env?: Record<string, string>;
3194
+
hardTimeout?: (number | bigint);
3195
+
}
3196
+
/**
3197
+
* The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
3198
+
*
3199
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort)
3200
+
*/
3201
+
declare abstract class MessagePort extends EventTarget {
3202
+
/**
3203
+
* The **`postMessage()`** method of the transfers ownership of objects to other browsing contexts.
3204
+
*
3205
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
3206
+
*/
3207
+
postMessage(data?: any, options?: (any[] | MessagePortPostMessageOptions)): void;
3208
+
/**
3209
+
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active.
3210
+
*
3211
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
3212
+
*/
3213
+
close(): void;
3214
+
/**
3215
+
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port.
3216
+
*
3217
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
3218
+
*/
3219
+
start(): void;
3220
+
get onmessage(): any | null;
3221
+
set onmessage(value: any | null);
3222
+
}
3223
+
/**
3224
+
* The **`MessageChannel`** interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties.
3225
+
*
3226
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel)
3227
+
*/
3228
+
declare class MessageChannel {
3229
+
constructor();
3230
+
/**
3231
+
* The **`port1`** read-only property of the the port attached to the context that originated the channel.
3232
+
*
3233
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
3234
+
*/
3235
+
readonly port1: MessagePort;
3236
+
/**
3237
+
* The **`port2`** read-only property of the the port attached to the context at the other end of the channel, which the message is initially sent to.
3238
+
*
3239
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
3240
+
*/
3241
+
readonly port2: MessagePort;
3242
+
}
3243
+
interface MessagePortPostMessageOptions {
3244
+
transfer?: any[];
3245
+
}
3246
+
type LoopbackForExport<T extends (new (...args: any[]) => Rpc.EntrypointBranded) | ExportedHandler<any, any, any> | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? LoopbackServiceStub<InstanceType<T>> : T extends new (...args: any[]) => Rpc.DurableObjectBranded ? LoopbackDurableObjectClass<InstanceType<T>> : T extends ExportedHandler<any, any, any> ? LoopbackServiceStub<undefined> : undefined;
3247
+
type LoopbackServiceStub<T extends Rpc.WorkerEntrypointBranded | undefined = undefined> = Fetcher<T> & (T extends CloudflareWorkersModule.WorkerEntrypoint<any, infer Props> ? (opts: {
3248
+
props?: Props;
3249
+
}) => Fetcher<T> : (opts: {
3250
+
props?: any;
3251
+
}) => Fetcher<T>);
3252
+
type LoopbackDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined = undefined> = DurableObjectClass<T> & (T extends CloudflareWorkersModule.DurableObject<any, infer Props> ? (opts: {
3253
+
props?: Props;
3254
+
}) => DurableObjectClass<T> : (opts: {
3255
+
props?: any;
3256
+
}) => DurableObjectClass<T>);
3257
+
interface SyncKvStorage {
3258
+
get<T = unknown>(key: string): T | undefined;
3259
+
list<T = unknown>(options?: SyncKvListOptions): Iterable<[
3260
+
string,
3261
+
T
3262
+
]>;
3263
+
put<T>(key: string, value: T): void;
3264
+
delete(key: string): boolean;
3265
+
}
3266
+
interface SyncKvListOptions {
3267
+
start?: string;
3268
+
startAfter?: string;
3269
+
end?: string;
3270
+
prefix?: string;
3271
+
reverse?: boolean;
3272
+
limit?: number;
3273
+
}
3274
+
interface WorkerStub {
3275
+
getEntrypoint<T extends Rpc.WorkerEntrypointBranded | undefined>(name?: string, options?: WorkerStubEntrypointOptions): Fetcher<T>;
3276
+
}
3277
+
interface WorkerStubEntrypointOptions {
3278
+
props?: any;
3279
+
}
3280
+
interface WorkerLoader {
3281
+
get(name: string, getCode: () => WorkerLoaderWorkerCode | Promise<WorkerLoaderWorkerCode>): WorkerStub;
3282
+
}
3283
+
interface WorkerLoaderModule {
3284
+
js?: string;
3285
+
cjs?: string;
3286
+
text?: string;
3287
+
data?: ArrayBuffer;
3288
+
json?: any;
3289
+
py?: string;
3290
+
wasm?: ArrayBuffer;
3291
+
}
3292
+
interface WorkerLoaderWorkerCode {
3293
+
compatibilityDate: string;
3294
+
compatibilityFlags?: string[];
3295
+
allowExperimental?: boolean;
3296
+
mainModule: string;
3297
+
modules: Record<string, WorkerLoaderModule | string>;
3298
+
env?: any;
3299
+
globalOutbound?: (Fetcher | null);
3300
+
tails?: Fetcher[];
3301
+
streamingTails?: Fetcher[];
3302
+
}
3303
+
/**
3304
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3305
+
* as well as timing of subrequests and other operations.
3306
+
*
3307
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3308
+
*/
3309
+
declare abstract class Performance {
3310
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3311
+
get timeOrigin(): number;
3312
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3313
+
now(): number;
2488
3314
}
2489
3315
type AiImageClassificationInput = {
2490
3316
image: number[];
···
2537
3363
description: string;
2538
3364
};
2539
3365
declare abstract class BaseAiImageTextToText {
3366
+
inputs: AiImageTextToTextInput;
3367
+
postProcessedOutputs: AiImageTextToTextOutput;
3368
+
}
3369
+
type AiMultimodalEmbeddingsInput = {
3370
+
image: string;
3371
+
text: string[];
3372
+
};
3373
+
type AiIMultimodalEmbeddingsOutput = {
3374
+
data: number[][];
3375
+
shape: number[];
3376
+
};
3377
+
declare abstract class BaseAiMultimodalEmbeddings {
2540
3378
inputs: AiImageTextToTextInput;
2541
3379
postProcessedOutputs: AiImageTextToTextOutput;
2542
3380
}
···
2670
3508
tools?: AiTextGenerationToolInput[] | AiTextGenerationToolLegacyInput[] | (object & NonNullable<unknown>);
2671
3509
functions?: AiTextGenerationFunctionsInput[];
2672
3510
};
3511
+
type AiTextGenerationToolLegacyOutput = {
3512
+
name: string;
3513
+
arguments: unknown;
3514
+
};
3515
+
type AiTextGenerationToolOutput = {
3516
+
id: string;
3517
+
type: "function";
3518
+
function: {
3519
+
name: string;
3520
+
arguments: string;
3521
+
};
3522
+
};
3523
+
type UsageTags = {
3524
+
prompt_tokens: number;
3525
+
completion_tokens: number;
3526
+
total_tokens: number;
3527
+
};
2673
3528
type AiTextGenerationOutput = {
2674
3529
response?: string;
2675
-
tool_calls?: {
2676
-
name: string;
2677
-
arguments: unknown;
2678
-
}[];
3530
+
tool_calls?: AiTextGenerationToolLegacyOutput[] & AiTextGenerationToolOutput[];
3531
+
usage?: UsageTags;
2679
3532
};
2680
3533
declare abstract class BaseAiTextGeneration {
2681
3534
inputs: AiTextGenerationInput;
···
2722
3575
inputs: AiTranslationInput;
2723
3576
postProcessedOutputs: AiTranslationOutput;
2724
3577
}
3578
+
/**
3579
+
* Workers AI support for OpenAI's Responses API
3580
+
* Reference: https://github.com/openai/openai-node/blob/master/src/resources/responses/responses.ts
3581
+
*
3582
+
* It's a stripped down version from its source.
3583
+
* It currently supports basic function calling, json mode and accepts images as input.
3584
+
*
3585
+
* It does not include types for WebSearch, CodeInterpreter, FileInputs, MCP, CustomTools.
3586
+
* We plan to add those incrementally as model + platform capabilities evolve.
3587
+
*/
3588
+
type ResponsesInput = {
3589
+
background?: boolean | null;
3590
+
conversation?: string | ResponseConversationParam | null;
3591
+
include?: Array<ResponseIncludable> | null;
3592
+
input?: string | ResponseInput;
3593
+
instructions?: string | null;
3594
+
max_output_tokens?: number | null;
3595
+
parallel_tool_calls?: boolean | null;
3596
+
previous_response_id?: string | null;
3597
+
prompt_cache_key?: string;
3598
+
reasoning?: Reasoning | null;
3599
+
safety_identifier?: string;
3600
+
service_tier?: "auto" | "default" | "flex" | "scale" | "priority" | null;
3601
+
stream?: boolean | null;
3602
+
stream_options?: StreamOptions | null;
3603
+
temperature?: number | null;
3604
+
text?: ResponseTextConfig;
3605
+
tool_choice?: ToolChoiceOptions | ToolChoiceFunction;
3606
+
tools?: Array<Tool>;
3607
+
top_p?: number | null;
3608
+
truncation?: "auto" | "disabled" | null;
3609
+
};
3610
+
type ResponsesOutput = {
3611
+
id?: string;
3612
+
created_at?: number;
3613
+
output_text?: string;
3614
+
error?: ResponseError | null;
3615
+
incomplete_details?: ResponseIncompleteDetails | null;
3616
+
instructions?: string | Array<ResponseInputItem> | null;
3617
+
object?: "response";
3618
+
output?: Array<ResponseOutputItem>;
3619
+
parallel_tool_calls?: boolean;
3620
+
temperature?: number | null;
3621
+
tool_choice?: ToolChoiceOptions | ToolChoiceFunction;
3622
+
tools?: Array<Tool>;
3623
+
top_p?: number | null;
3624
+
max_output_tokens?: number | null;
3625
+
previous_response_id?: string | null;
3626
+
prompt?: ResponsePrompt | null;
3627
+
reasoning?: Reasoning | null;
3628
+
safety_identifier?: string;
3629
+
service_tier?: "auto" | "default" | "flex" | "scale" | "priority" | null;
3630
+
status?: ResponseStatus;
3631
+
text?: ResponseTextConfig;
3632
+
truncation?: "auto" | "disabled" | null;
3633
+
usage?: ResponseUsage;
3634
+
};
3635
+
type EasyInputMessage = {
3636
+
content: string | ResponseInputMessageContentList;
3637
+
role: "user" | "assistant" | "system" | "developer";
3638
+
type?: "message";
3639
+
};
3640
+
type ResponsesFunctionTool = {
3641
+
name: string;
3642
+
parameters: {
3643
+
[key: string]: unknown;
3644
+
} | null;
3645
+
strict: boolean | null;
3646
+
type: "function";
3647
+
description?: string | null;
3648
+
};
3649
+
type ResponseIncompleteDetails = {
3650
+
reason?: "max_output_tokens" | "content_filter";
3651
+
};
3652
+
type ResponsePrompt = {
3653
+
id: string;
3654
+
variables?: {
3655
+
[key: string]: string | ResponseInputText | ResponseInputImage;
3656
+
} | null;
3657
+
version?: string | null;
3658
+
};
3659
+
type Reasoning = {
3660
+
effort?: ReasoningEffort | null;
3661
+
generate_summary?: "auto" | "concise" | "detailed" | null;
3662
+
summary?: "auto" | "concise" | "detailed" | null;
3663
+
};
3664
+
type ResponseContent = ResponseInputText | ResponseInputImage | ResponseOutputText | ResponseOutputRefusal | ResponseContentReasoningText;
3665
+
type ResponseContentReasoningText = {
3666
+
text: string;
3667
+
type: "reasoning_text";
3668
+
};
3669
+
type ResponseConversationParam = {
3670
+
id: string;
3671
+
};
3672
+
type ResponseCreatedEvent = {
3673
+
response: Response;
3674
+
sequence_number: number;
3675
+
type: "response.created";
3676
+
};
3677
+
type ResponseCustomToolCallOutput = {
3678
+
call_id: string;
3679
+
output: string | Array<ResponseInputText | ResponseInputImage>;
3680
+
type: "custom_tool_call_output";
3681
+
id?: string;
3682
+
};
3683
+
type ResponseError = {
3684
+
code: "server_error" | "rate_limit_exceeded" | "invalid_prompt" | "vector_store_timeout" | "invalid_image" | "invalid_image_format" | "invalid_base64_image" | "invalid_image_url" | "image_too_large" | "image_too_small" | "image_parse_error" | "image_content_policy_violation" | "invalid_image_mode" | "image_file_too_large" | "unsupported_image_media_type" | "empty_image_file" | "failed_to_download_image" | "image_file_not_found";
3685
+
message: string;
3686
+
};
3687
+
type ResponseErrorEvent = {
3688
+
code: string | null;
3689
+
message: string;
3690
+
param: string | null;
3691
+
sequence_number: number;
3692
+
type: "error";
3693
+
};
3694
+
type ResponseFailedEvent = {
3695
+
response: Response;
3696
+
sequence_number: number;
3697
+
type: "response.failed";
3698
+
};
3699
+
type ResponseFormatText = {
3700
+
type: "text";
3701
+
};
3702
+
type ResponseFormatJSONObject = {
3703
+
type: "json_object";
3704
+
};
3705
+
type ResponseFormatTextConfig = ResponseFormatText | ResponseFormatTextJSONSchemaConfig | ResponseFormatJSONObject;
3706
+
type ResponseFormatTextJSONSchemaConfig = {
3707
+
name: string;
3708
+
schema: {
3709
+
[key: string]: unknown;
3710
+
};
3711
+
type: "json_schema";
3712
+
description?: string;
3713
+
strict?: boolean | null;
3714
+
};
3715
+
type ResponseFunctionCallArgumentsDeltaEvent = {
3716
+
delta: string;
3717
+
item_id: string;
3718
+
output_index: number;
3719
+
sequence_number: number;
3720
+
type: "response.function_call_arguments.delta";
3721
+
};
3722
+
type ResponseFunctionCallArgumentsDoneEvent = {
3723
+
arguments: string;
3724
+
item_id: string;
3725
+
name: string;
3726
+
output_index: number;
3727
+
sequence_number: number;
3728
+
type: "response.function_call_arguments.done";
3729
+
};
3730
+
type ResponseFunctionCallOutputItem = ResponseInputTextContent | ResponseInputImageContent;
3731
+
type ResponseFunctionCallOutputItemList = Array<ResponseFunctionCallOutputItem>;
3732
+
type ResponseFunctionToolCall = {
3733
+
arguments: string;
3734
+
call_id: string;
3735
+
name: string;
3736
+
type: "function_call";
3737
+
id?: string;
3738
+
status?: "in_progress" | "completed" | "incomplete";
3739
+
};
3740
+
interface ResponseFunctionToolCallItem extends ResponseFunctionToolCall {
3741
+
id: string;
3742
+
}
3743
+
type ResponseFunctionToolCallOutputItem = {
3744
+
id: string;
3745
+
call_id: string;
3746
+
output: string | Array<ResponseInputText | ResponseInputImage>;
3747
+
type: "function_call_output";
3748
+
status?: "in_progress" | "completed" | "incomplete";
3749
+
};
3750
+
type ResponseIncludable = "message.input_image.image_url" | "message.output_text.logprobs";
3751
+
type ResponseIncompleteEvent = {
3752
+
response: Response;
3753
+
sequence_number: number;
3754
+
type: "response.incomplete";
3755
+
};
3756
+
type ResponseInput = Array<ResponseInputItem>;
3757
+
type ResponseInputContent = ResponseInputText | ResponseInputImage;
3758
+
type ResponseInputImage = {
3759
+
detail: "low" | "high" | "auto";
3760
+
type: "input_image";
3761
+
/**
3762
+
* Base64 encoded image
3763
+
*/
3764
+
image_url?: string | null;
3765
+
};
3766
+
type ResponseInputImageContent = {
3767
+
type: "input_image";
3768
+
detail?: "low" | "high" | "auto" | null;
3769
+
/**
3770
+
* Base64 encoded image
3771
+
*/
3772
+
image_url?: string | null;
3773
+
};
3774
+
type ResponseInputItem = EasyInputMessage | ResponseInputItemMessage | ResponseOutputMessage | ResponseFunctionToolCall | ResponseInputItemFunctionCallOutput | ResponseReasoningItem;
3775
+
type ResponseInputItemFunctionCallOutput = {
3776
+
call_id: string;
3777
+
output: string | ResponseFunctionCallOutputItemList;
3778
+
type: "function_call_output";
3779
+
id?: string | null;
3780
+
status?: "in_progress" | "completed" | "incomplete" | null;
3781
+
};
3782
+
type ResponseInputItemMessage = {
3783
+
content: ResponseInputMessageContentList;
3784
+
role: "user" | "system" | "developer";
3785
+
status?: "in_progress" | "completed" | "incomplete";
3786
+
type?: "message";
3787
+
};
3788
+
type ResponseInputMessageContentList = Array<ResponseInputContent>;
3789
+
type ResponseInputMessageItem = {
3790
+
id: string;
3791
+
content: ResponseInputMessageContentList;
3792
+
role: "user" | "system" | "developer";
3793
+
status?: "in_progress" | "completed" | "incomplete";
3794
+
type?: "message";
3795
+
};
3796
+
type ResponseInputText = {
3797
+
text: string;
3798
+
type: "input_text";
3799
+
};
3800
+
type ResponseInputTextContent = {
3801
+
text: string;
3802
+
type: "input_text";
3803
+
};
3804
+
type ResponseItem = ResponseInputMessageItem | ResponseOutputMessage | ResponseFunctionToolCallItem | ResponseFunctionToolCallOutputItem;
3805
+
type ResponseOutputItem = ResponseOutputMessage | ResponseFunctionToolCall | ResponseReasoningItem;
3806
+
type ResponseOutputItemAddedEvent = {
3807
+
item: ResponseOutputItem;
3808
+
output_index: number;
3809
+
sequence_number: number;
3810
+
type: "response.output_item.added";
3811
+
};
3812
+
type ResponseOutputItemDoneEvent = {
3813
+
item: ResponseOutputItem;
3814
+
output_index: number;
3815
+
sequence_number: number;
3816
+
type: "response.output_item.done";
3817
+
};
3818
+
type ResponseOutputMessage = {
3819
+
id: string;
3820
+
content: Array<ResponseOutputText | ResponseOutputRefusal>;
3821
+
role: "assistant";
3822
+
status: "in_progress" | "completed" | "incomplete";
3823
+
type: "message";
3824
+
};
3825
+
type ResponseOutputRefusal = {
3826
+
refusal: string;
3827
+
type: "refusal";
3828
+
};
3829
+
type ResponseOutputText = {
3830
+
text: string;
3831
+
type: "output_text";
3832
+
logprobs?: Array<Logprob>;
3833
+
};
3834
+
type ResponseReasoningItem = {
3835
+
id: string;
3836
+
summary: Array<ResponseReasoningSummaryItem>;
3837
+
type: "reasoning";
3838
+
content?: Array<ResponseReasoningContentItem>;
3839
+
encrypted_content?: string | null;
3840
+
status?: "in_progress" | "completed" | "incomplete";
3841
+
};
3842
+
type ResponseReasoningSummaryItem = {
3843
+
text: string;
3844
+
type: "summary_text";
3845
+
};
3846
+
type ResponseReasoningContentItem = {
3847
+
text: string;
3848
+
type: "reasoning_text";
3849
+
};
3850
+
type ResponseReasoningTextDeltaEvent = {
3851
+
content_index: number;
3852
+
delta: string;
3853
+
item_id: string;
3854
+
output_index: number;
3855
+
sequence_number: number;
3856
+
type: "response.reasoning_text.delta";
3857
+
};
3858
+
type ResponseReasoningTextDoneEvent = {
3859
+
content_index: number;
3860
+
item_id: string;
3861
+
output_index: number;
3862
+
sequence_number: number;
3863
+
text: string;
3864
+
type: "response.reasoning_text.done";
3865
+
};
3866
+
type ResponseRefusalDeltaEvent = {
3867
+
content_index: number;
3868
+
delta: string;
3869
+
item_id: string;
3870
+
output_index: number;
3871
+
sequence_number: number;
3872
+
type: "response.refusal.delta";
3873
+
};
3874
+
type ResponseRefusalDoneEvent = {
3875
+
content_index: number;
3876
+
item_id: string;
3877
+
output_index: number;
3878
+
refusal: string;
3879
+
sequence_number: number;
3880
+
type: "response.refusal.done";
3881
+
};
3882
+
type ResponseStatus = "completed" | "failed" | "in_progress" | "cancelled" | "queued" | "incomplete";
3883
+
type ResponseStreamEvent = ResponseCompletedEvent | ResponseCreatedEvent | ResponseErrorEvent | ResponseFunctionCallArgumentsDeltaEvent | ResponseFunctionCallArgumentsDoneEvent | ResponseFailedEvent | ResponseIncompleteEvent | ResponseOutputItemAddedEvent | ResponseOutputItemDoneEvent | ResponseReasoningTextDeltaEvent | ResponseReasoningTextDoneEvent | ResponseRefusalDeltaEvent | ResponseRefusalDoneEvent | ResponseTextDeltaEvent | ResponseTextDoneEvent;
3884
+
type ResponseCompletedEvent = {
3885
+
response: Response;
3886
+
sequence_number: number;
3887
+
type: "response.completed";
3888
+
};
3889
+
type ResponseTextConfig = {
3890
+
format?: ResponseFormatTextConfig;
3891
+
verbosity?: "low" | "medium" | "high" | null;
3892
+
};
3893
+
type ResponseTextDeltaEvent = {
3894
+
content_index: number;
3895
+
delta: string;
3896
+
item_id: string;
3897
+
logprobs: Array<Logprob>;
3898
+
output_index: number;
3899
+
sequence_number: number;
3900
+
type: "response.output_text.delta";
3901
+
};
3902
+
type ResponseTextDoneEvent = {
3903
+
content_index: number;
3904
+
item_id: string;
3905
+
logprobs: Array<Logprob>;
3906
+
output_index: number;
3907
+
sequence_number: number;
3908
+
text: string;
3909
+
type: "response.output_text.done";
3910
+
};
3911
+
type Logprob = {
3912
+
token: string;
3913
+
logprob: number;
3914
+
top_logprobs?: Array<TopLogprob>;
3915
+
};
3916
+
type TopLogprob = {
3917
+
token?: string;
3918
+
logprob?: number;
3919
+
};
3920
+
type ResponseUsage = {
3921
+
input_tokens: number;
3922
+
output_tokens: number;
3923
+
total_tokens: number;
3924
+
};
3925
+
type Tool = ResponsesFunctionTool;
3926
+
type ToolChoiceFunction = {
3927
+
name: string;
3928
+
type: "function";
3929
+
};
3930
+
type ToolChoiceOptions = "none";
3931
+
type ReasoningEffort = "minimal" | "low" | "medium" | "high" | null;
3932
+
type StreamOptions = {
3933
+
include_obfuscation?: boolean;
3934
+
};
2725
3935
type Ai_Cf_Baai_Bge_Base_En_V1_5_Input = {
2726
3936
text: string | string[];
2727
3937
/**
···
2750
3960
* The pooling method used in the embedding process.
2751
3961
*/
2752
3962
pooling?: "mean" | "cls";
2753
-
} | AsyncResponse;
2754
-
interface AsyncResponse {
3963
+
} | Ai_Cf_Baai_Bge_Base_En_V1_5_AsyncResponse;
3964
+
interface Ai_Cf_Baai_Bge_Base_En_V1_5_AsyncResponse {
2755
3965
/**
2756
3966
* The async request id that can be used to obtain the results.
2757
3967
*/
···
2827
4037
* The translated text in the target language
2828
4038
*/
2829
4039
translated_text?: string;
2830
-
} | AsyncResponse;
4040
+
} | Ai_Cf_Meta_M2M100_1_2B_AsyncResponse;
4041
+
interface Ai_Cf_Meta_M2M100_1_2B_AsyncResponse {
4042
+
/**
4043
+
* The async request id that can be used to obtain the results.
4044
+
*/
4045
+
request_id?: string;
4046
+
}
2831
4047
declare abstract class Base_Ai_Cf_Meta_M2M100_1_2B {
2832
4048
inputs: Ai_Cf_Meta_M2M100_1_2B_Input;
2833
4049
postProcessedOutputs: Ai_Cf_Meta_M2M100_1_2B_Output;
···
2860
4076
* The pooling method used in the embedding process.
2861
4077
*/
2862
4078
pooling?: "mean" | "cls";
2863
-
} | AsyncResponse;
4079
+
} | Ai_Cf_Baai_Bge_Small_En_V1_5_AsyncResponse;
4080
+
interface Ai_Cf_Baai_Bge_Small_En_V1_5_AsyncResponse {
4081
+
/**
4082
+
* The async request id that can be used to obtain the results.
4083
+
*/
4084
+
request_id?: string;
4085
+
}
2864
4086
declare abstract class Base_Ai_Cf_Baai_Bge_Small_En_V1_5 {
2865
4087
inputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Input;
2866
4088
postProcessedOutputs: Ai_Cf_Baai_Bge_Small_En_V1_5_Output;
···
2893
4115
* The pooling method used in the embedding process.
2894
4116
*/
2895
4117
pooling?: "mean" | "cls";
2896
-
} | AsyncResponse;
4118
+
} | Ai_Cf_Baai_Bge_Large_En_V1_5_AsyncResponse;
4119
+
interface Ai_Cf_Baai_Bge_Large_En_V1_5_AsyncResponse {
4120
+
/**
4121
+
* The async request id that can be used to obtain the results.
4122
+
*/
4123
+
request_id?: string;
4124
+
}
2897
4125
declare abstract class Base_Ai_Cf_Baai_Bge_Large_En_V1_5 {
2898
4126
inputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Input;
2899
4127
postProcessedOutputs: Ai_Cf_Baai_Bge_Large_En_V1_5_Output;
···
3079
4307
inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
3080
4308
postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
3081
4309
}
3082
-
type Ai_Cf_Baai_Bge_M3_Input = BGEM3InputQueryAndContexts | BGEM3InputEmbedding | {
4310
+
type Ai_Cf_Baai_Bge_M3_Input = Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts | Ai_Cf_Baai_Bge_M3_Input_Embedding | {
3083
4311
/**
3084
4312
* Batch of the embeddings requests to run using async-queue
3085
4313
*/
3086
-
requests: (BGEM3InputQueryAndContexts1 | BGEM3InputEmbedding1)[];
4314
+
requests: (Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts_1 | Ai_Cf_Baai_Bge_M3_Input_Embedding_1)[];
3087
4315
};
3088
-
interface BGEM3InputQueryAndContexts {
4316
+
interface Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts {
3089
4317
/**
3090
4318
* A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3091
4319
*/
···
3104
4332
*/
3105
4333
truncate_inputs?: boolean;
3106
4334
}
3107
-
interface BGEM3InputEmbedding {
4335
+
interface Ai_Cf_Baai_Bge_M3_Input_Embedding {
3108
4336
text: string | string[];
3109
4337
/**
3110
4338
* When provided with too long context should the model error out or truncate the context to fit?
3111
4339
*/
3112
4340
truncate_inputs?: boolean;
3113
4341
}
3114
-
interface BGEM3InputQueryAndContexts1 {
4342
+
interface Ai_Cf_Baai_Bge_M3_Input_QueryAnd_Contexts_1 {
3115
4343
/**
3116
4344
* A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3117
4345
*/
···
3130
4358
*/
3131
4359
truncate_inputs?: boolean;
3132
4360
}
3133
-
interface BGEM3InputEmbedding1 {
4361
+
interface Ai_Cf_Baai_Bge_M3_Input_Embedding_1 {
3134
4362
text: string | string[];
3135
4363
/**
3136
4364
* When provided with too long context should the model error out or truncate the context to fit?
3137
4365
*/
3138
4366
truncate_inputs?: boolean;
3139
4367
}
3140
-
type Ai_Cf_Baai_Bge_M3_Output = BGEM3OuputQuery | BGEM3OutputEmbeddingForContexts | BGEM3OuputEmbedding | AsyncResponse;
3141
-
interface BGEM3OuputQuery {
4368
+
type Ai_Cf_Baai_Bge_M3_Output = Ai_Cf_Baai_Bge_M3_Ouput_Query | Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts | Ai_Cf_Baai_Bge_M3_Ouput_Embedding | Ai_Cf_Baai_Bge_M3_AsyncResponse;
4369
+
interface Ai_Cf_Baai_Bge_M3_Ouput_Query {
3142
4370
response?: {
3143
4371
/**
3144
4372
* Index of the context in the request
···
3150
4378
score?: number;
3151
4379
}[];
3152
4380
}
3153
-
interface BGEM3OutputEmbeddingForContexts {
4381
+
interface Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts {
3154
4382
response?: number[][];
3155
4383
shape?: number[];
3156
4384
/**
···
3158
4386
*/
3159
4387
pooling?: "mean" | "cls";
3160
4388
}
3161
-
interface BGEM3OuputEmbedding {
4389
+
interface Ai_Cf_Baai_Bge_M3_Ouput_Embedding {
3162
4390
shape?: number[];
3163
4391
/**
3164
4392
* Embeddings of the requested text values
···
3168
4396
* The pooling method used in the embedding process.
3169
4397
*/
3170
4398
pooling?: "mean" | "cls";
4399
+
}
4400
+
interface Ai_Cf_Baai_Bge_M3_AsyncResponse {
4401
+
/**
4402
+
* The async request id that can be used to obtain the results.
4403
+
*/
4404
+
request_id?: string;
3171
4405
}
3172
4406
declare abstract class Base_Ai_Cf_Baai_Bge_M3 {
3173
4407
inputs: Ai_Cf_Baai_Bge_M3_Input;
···
3193
4427
inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input;
3194
4428
postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output;
3195
4429
}
3196
-
type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Prompt | Messages;
3197
-
interface Prompt {
4430
+
type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Prompt | Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages;
4431
+
interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Prompt {
3198
4432
/**
3199
4433
* The input text prompt for the model to generate a response.
3200
4434
*/
···
3245
4479
*/
3246
4480
lora?: string;
3247
4481
}
3248
-
interface Messages {
4482
+
interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages {
3249
4483
/**
3250
4484
* An array of message objects representing the conversation history.
3251
4485
*/
···
3436
4670
inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input;
3437
4671
postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output;
3438
4672
}
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 {
4673
+
type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input = Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Async_Batch;
4674
+
interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Prompt {
3441
4675
/**
3442
4676
* The input text prompt for the model to generate a response.
3443
4677
*/
···
3446
4680
* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3447
4681
*/
3448
4682
lora?: string;
3449
-
response_format?: JSONMode;
4683
+
response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode;
3450
4684
/**
3451
4685
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3452
4686
*/
···
3488
4722
*/
3489
4723
presence_penalty?: number;
3490
4724
}
3491
-
interface JSONMode {
4725
+
interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode {
3492
4726
type?: "json_object" | "json_schema";
3493
4727
json_schema?: unknown;
3494
4728
}
3495
-
interface Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {
4729
+
interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {
3496
4730
/**
3497
4731
* An array of message objects representing the conversation history.
3498
4732
*/
···
3597
4831
};
3598
4832
};
3599
4833
})[];
3600
-
response_format?: JSONMode;
4834
+
response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_1;
3601
4835
/**
3602
4836
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3603
4837
*/
···
3639
4873
*/
3640
4874
presence_penalty?: number;
3641
4875
}
3642
-
interface AsyncBatch {
4876
+
interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_1 {
4877
+
type?: "json_object" | "json_schema";
4878
+
json_schema?: unknown;
4879
+
}
4880
+
interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Async_Batch {
3643
4881
requests?: {
3644
4882
/**
3645
4883
* 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.
···
3681
4919
* Increases the likelihood of the model introducing new topics.
3682
4920
*/
3683
4921
presence_penalty?: number;
3684
-
response_format?: JSONMode;
4922
+
response_format?: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_2;
3685
4923
}[];
3686
4924
}
4925
+
interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_JSON_Mode_2 {
4926
+
type?: "json_object" | "json_schema";
4927
+
json_schema?: unknown;
4928
+
}
3687
4929
type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output = {
3688
4930
/**
3689
4931
* The generated text response from the model
···
3719
4961
*/
3720
4962
name?: string;
3721
4963
}[];
3722
-
} | AsyncResponse;
4964
+
} | string | Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_AsyncResponse;
4965
+
interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_AsyncResponse {
4966
+
/**
4967
+
* The async request id that can be used to obtain the results.
4968
+
*/
4969
+
request_id?: string;
4970
+
}
3723
4971
declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
3724
4972
inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
3725
4973
postProcessedOutputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output;
···
3793
5041
/**
3794
5042
* A query you wish to perform against the provided contexts.
3795
5043
*/
3796
-
query: string;
3797
5044
/**
3798
5045
* Number of returned results starting with the best score.
3799
5046
*/
···
3824
5071
inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;
3825
5072
postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;
3826
5073
}
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 {
5074
+
type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input = Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Prompt | Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Messages;
5075
+
interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Prompt {
3829
5076
/**
3830
5077
* The input text prompt for the model to generate a response.
3831
5078
*/
···
3834
5081
* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
3835
5082
*/
3836
5083
lora?: string;
3837
-
response_format?: JSONMode;
5084
+
response_format?: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode;
3838
5085
/**
3839
5086
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3840
5087
*/
···
3876
5123
*/
3877
5124
presence_penalty?: number;
3878
5125
}
3879
-
interface Qwen2_5_Coder_32B_Instruct_Messages {
5126
+
interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode {
5127
+
type?: "json_object" | "json_schema";
5128
+
json_schema?: unknown;
5129
+
}
5130
+
interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Messages {
3880
5131
/**
3881
5132
* An array of message objects representing the conversation history.
3882
5133
*/
···
3981
5232
};
3982
5233
};
3983
5234
})[];
3984
-
response_format?: JSONMode;
5235
+
response_format?: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode_1;
3985
5236
/**
3986
5237
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3987
5238
*/
···
4023
5274
*/
4024
5275
presence_penalty?: number;
4025
5276
}
5277
+
interface Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_JSON_Mode_1 {
5278
+
type?: "json_object" | "json_schema";
5279
+
json_schema?: unknown;
5280
+
}
4026
5281
type Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output = {
4027
5282
/**
4028
5283
* The generated text response from the model
···
4063
5318
inputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Input;
4064
5319
postProcessedOutputs: Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct_Output;
4065
5320
}
4066
-
type Ai_Cf_Qwen_Qwq_32B_Input = Qwen_Qwq_32B_Prompt | Qwen_Qwq_32B_Messages;
4067
-
interface Qwen_Qwq_32B_Prompt {
5321
+
type Ai_Cf_Qwen_Qwq_32B_Input = Ai_Cf_Qwen_Qwq_32B_Prompt | Ai_Cf_Qwen_Qwq_32B_Messages;
5322
+
interface Ai_Cf_Qwen_Qwq_32B_Prompt {
4068
5323
/**
4069
5324
* The input text prompt for the model to generate a response.
4070
5325
*/
···
4114
5369
*/
4115
5370
presence_penalty?: number;
4116
5371
}
4117
-
interface Qwen_Qwq_32B_Messages {
5372
+
interface Ai_Cf_Qwen_Qwq_32B_Messages {
4118
5373
/**
4119
5374
* An array of message objects representing the conversation history.
4120
5375
*/
···
4329
5584
inputs: Ai_Cf_Qwen_Qwq_32B_Input;
4330
5585
postProcessedOutputs: Ai_Cf_Qwen_Qwq_32B_Output;
4331
5586
}
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 {
5587
+
type Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input = Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Prompt | Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages;
5588
+
interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Prompt {
4334
5589
/**
4335
5590
* The input text prompt for the model to generate a response.
4336
5591
*/
···
4380
5635
*/
4381
5636
presence_penalty?: number;
4382
5637
}
4383
-
interface Mistral_Small_3_1_24B_Instruct_Messages {
5638
+
interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages {
4384
5639
/**
4385
5640
* An array of message objects representing the conversation history.
4386
5641
*/
···
4595
5850
inputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Input;
4596
5851
postProcessedOutputs: Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Output;
4597
5852
}
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 {
5853
+
type Ai_Cf_Google_Gemma_3_12B_It_Input = Ai_Cf_Google_Gemma_3_12B_It_Prompt | Ai_Cf_Google_Gemma_3_12B_It_Messages;
5854
+
interface Ai_Cf_Google_Gemma_3_12B_It_Prompt {
4600
5855
/**
4601
5856
* The input text prompt for the model to generate a response.
4602
5857
*/
···
4646
5901
*/
4647
5902
presence_penalty?: number;
4648
5903
}
4649
-
interface Google_Gemma_3_12B_It_Messages {
5904
+
interface Ai_Cf_Google_Gemma_3_12B_It_Messages {
4650
5905
/**
4651
5906
* An array of message objects representing the conversation history.
4652
5907
*/
···
4667
5922
*/
4668
5923
url?: string;
4669
5924
};
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
-
};
5925
+
}[];
4683
5926
}[];
4684
5927
functions?: {
4685
5928
name: string;
···
4857
6100
inputs: Ai_Cf_Google_Gemma_3_12B_It_Input;
4858
6101
postProcessedOutputs: Ai_Cf_Google_Gemma_3_12B_It_Output;
4859
6102
}
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 {
6103
+
type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input = Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Async_Batch;
6104
+
interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt {
4862
6105
/**
4863
6106
* The input text prompt for the model to generate a response.
4864
6107
*/
···
4867
6110
* JSON schema that should be fulfilled for the response.
4868
6111
*/
4869
6112
guided_json?: object;
4870
-
response_format?: JSONMode;
6113
+
response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
4871
6114
/**
4872
6115
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4873
6116
*/
···
4909
6152
*/
4910
6153
presence_penalty?: number;
4911
6154
}
4912
-
interface Ai_Cf_Meta_Llama_4_Messages {
6155
+
interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode {
6156
+
type?: "json_object" | "json_schema";
6157
+
json_schema?: unknown;
6158
+
}
6159
+
interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages {
4913
6160
/**
4914
6161
* An array of message objects representing the conversation history.
4915
6162
*/
···
5039
6286
};
5040
6287
};
5041
6288
})[];
5042
-
response_format?: JSONMode;
6289
+
response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
6290
+
/**
6291
+
* JSON schema that should be fufilled for the response.
6292
+
*/
6293
+
guided_json?: object;
6294
+
/**
6295
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6296
+
*/
6297
+
raw?: boolean;
6298
+
/**
6299
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6300
+
*/
6301
+
stream?: boolean;
6302
+
/**
6303
+
* The maximum number of tokens to generate in the response.
6304
+
*/
6305
+
max_tokens?: number;
6306
+
/**
6307
+
* Controls the randomness of the output; higher values produce more random results.
6308
+
*/
6309
+
temperature?: number;
6310
+
/**
6311
+
* 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.
6312
+
*/
6313
+
top_p?: number;
6314
+
/**
6315
+
* 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.
6316
+
*/
6317
+
top_k?: number;
6318
+
/**
6319
+
* Random seed for reproducibility of the generation.
6320
+
*/
6321
+
seed?: number;
6322
+
/**
6323
+
* Penalty for repeated tokens; higher values discourage repetition.
6324
+
*/
6325
+
repetition_penalty?: number;
6326
+
/**
6327
+
* Decreases the likelihood of the model repeating the same lines verbatim.
6328
+
*/
6329
+
frequency_penalty?: number;
6330
+
/**
6331
+
* Increases the likelihood of the model introducing new topics.
6332
+
*/
6333
+
presence_penalty?: number;
6334
+
}
6335
+
interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Async_Batch {
6336
+
requests: (Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt_Inner | Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner)[];
6337
+
}
6338
+
interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Prompt_Inner {
6339
+
/**
6340
+
* The input text prompt for the model to generate a response.
6341
+
*/
6342
+
prompt: string;
6343
+
/**
6344
+
* JSON schema that should be fulfilled for the response.
6345
+
*/
6346
+
guided_json?: object;
6347
+
response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
6348
+
/**
6349
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6350
+
*/
6351
+
raw?: boolean;
6352
+
/**
6353
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6354
+
*/
6355
+
stream?: boolean;
6356
+
/**
6357
+
* The maximum number of tokens to generate in the response.
6358
+
*/
6359
+
max_tokens?: number;
6360
+
/**
6361
+
* Controls the randomness of the output; higher values produce more random results.
6362
+
*/
6363
+
temperature?: number;
6364
+
/**
6365
+
* 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.
6366
+
*/
6367
+
top_p?: number;
6368
+
/**
6369
+
* 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.
6370
+
*/
6371
+
top_k?: number;
6372
+
/**
6373
+
* Random seed for reproducibility of the generation.
6374
+
*/
6375
+
seed?: number;
6376
+
/**
6377
+
* Penalty for repeated tokens; higher values discourage repetition.
6378
+
*/
6379
+
repetition_penalty?: number;
6380
+
/**
6381
+
* Decreases the likelihood of the model repeating the same lines verbatim.
6382
+
*/
6383
+
frequency_penalty?: number;
6384
+
/**
6385
+
* Increases the likelihood of the model introducing new topics.
6386
+
*/
6387
+
presence_penalty?: number;
6388
+
}
6389
+
interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner {
6390
+
/**
6391
+
* An array of message objects representing the conversation history.
6392
+
*/
6393
+
messages: {
6394
+
/**
6395
+
* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
6396
+
*/
6397
+
role?: string;
6398
+
/**
6399
+
* The tool call id. If you don't know what to put here you can fall back to 000000001
6400
+
*/
6401
+
tool_call_id?: string;
6402
+
content?: string | {
6403
+
/**
6404
+
* Type of the content provided
6405
+
*/
6406
+
type?: string;
6407
+
text?: string;
6408
+
image_url?: {
6409
+
/**
6410
+
* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
6411
+
*/
6412
+
url?: string;
6413
+
};
6414
+
}[] | {
6415
+
/**
6416
+
* Type of the content provided
6417
+
*/
6418
+
type?: string;
6419
+
text?: string;
6420
+
image_url?: {
6421
+
/**
6422
+
* image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
6423
+
*/
6424
+
url?: string;
6425
+
};
6426
+
};
6427
+
}[];
6428
+
functions?: {
6429
+
name: string;
6430
+
code: string;
6431
+
}[];
6432
+
/**
6433
+
* A list of tools available for the assistant to use.
6434
+
*/
6435
+
tools?: ({
6436
+
/**
6437
+
* The name of the tool. More descriptive the better.
6438
+
*/
6439
+
name: string;
6440
+
/**
6441
+
* A brief description of what the tool does.
6442
+
*/
6443
+
description: string;
6444
+
/**
6445
+
* Schema defining the parameters accepted by the tool.
6446
+
*/
6447
+
parameters: {
6448
+
/**
6449
+
* The type of the parameters object (usually 'object').
6450
+
*/
6451
+
type: string;
6452
+
/**
6453
+
* List of required parameter names.
6454
+
*/
6455
+
required?: string[];
6456
+
/**
6457
+
* Definitions of each parameter.
6458
+
*/
6459
+
properties: {
6460
+
[k: string]: {
6461
+
/**
6462
+
* The data type of the parameter.
6463
+
*/
6464
+
type: string;
6465
+
/**
6466
+
* A description of the expected parameter.
6467
+
*/
6468
+
description: string;
6469
+
};
6470
+
};
6471
+
};
6472
+
} | {
6473
+
/**
6474
+
* Specifies the type of tool (e.g., 'function').
6475
+
*/
6476
+
type: string;
6477
+
/**
6478
+
* Details of the function tool.
6479
+
*/
6480
+
function: {
6481
+
/**
6482
+
* The name of the function.
6483
+
*/
6484
+
name: string;
6485
+
/**
6486
+
* A brief description of what the function does.
6487
+
*/
6488
+
description: string;
6489
+
/**
6490
+
* Schema defining the parameters accepted by the function.
6491
+
*/
6492
+
parameters: {
6493
+
/**
6494
+
* The type of the parameters object (usually 'object').
6495
+
*/
6496
+
type: string;
6497
+
/**
6498
+
* List of required parameter names.
6499
+
*/
6500
+
required?: string[];
6501
+
/**
6502
+
* Definitions of each parameter.
6503
+
*/
6504
+
properties: {
6505
+
[k: string]: {
6506
+
/**
6507
+
* The data type of the parameter.
6508
+
*/
6509
+
type: string;
6510
+
/**
6511
+
* A description of the expected parameter.
6512
+
*/
6513
+
description: string;
6514
+
};
6515
+
};
6516
+
};
6517
+
};
6518
+
})[];
6519
+
response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
5043
6520
/**
5044
6521
* JSON schema that should be fufilled for the response.
5045
6522
*/
···
5138
6615
inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5139
6616
postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5140
6617
}
6618
+
type Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Input = Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Async_Batch;
6619
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt {
6620
+
/**
6621
+
* The input text prompt for the model to generate a response.
6622
+
*/
6623
+
prompt: string;
6624
+
/**
6625
+
* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
6626
+
*/
6627
+
lora?: string;
6628
+
response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode;
6629
+
/**
6630
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6631
+
*/
6632
+
raw?: boolean;
6633
+
/**
6634
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6635
+
*/
6636
+
stream?: boolean;
6637
+
/**
6638
+
* The maximum number of tokens to generate in the response.
6639
+
*/
6640
+
max_tokens?: number;
6641
+
/**
6642
+
* Controls the randomness of the output; higher values produce more random results.
6643
+
*/
6644
+
temperature?: number;
6645
+
/**
6646
+
* 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.
6647
+
*/
6648
+
top_p?: number;
6649
+
/**
6650
+
* 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.
6651
+
*/
6652
+
top_k?: number;
6653
+
/**
6654
+
* Random seed for reproducibility of the generation.
6655
+
*/
6656
+
seed?: number;
6657
+
/**
6658
+
* Penalty for repeated tokens; higher values discourage repetition.
6659
+
*/
6660
+
repetition_penalty?: number;
6661
+
/**
6662
+
* Decreases the likelihood of the model repeating the same lines verbatim.
6663
+
*/
6664
+
frequency_penalty?: number;
6665
+
/**
6666
+
* Increases the likelihood of the model introducing new topics.
6667
+
*/
6668
+
presence_penalty?: number;
6669
+
}
6670
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode {
6671
+
type?: "json_object" | "json_schema";
6672
+
json_schema?: unknown;
6673
+
}
6674
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages {
6675
+
/**
6676
+
* An array of message objects representing the conversation history.
6677
+
*/
6678
+
messages: {
6679
+
/**
6680
+
* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
6681
+
*/
6682
+
role: string;
6683
+
/**
6684
+
* The content of the message as a string.
6685
+
*/
6686
+
content: string;
6687
+
}[];
6688
+
functions?: {
6689
+
name: string;
6690
+
code: string;
6691
+
}[];
6692
+
/**
6693
+
* A list of tools available for the assistant to use.
6694
+
*/
6695
+
tools?: ({
6696
+
/**
6697
+
* The name of the tool. More descriptive the better.
6698
+
*/
6699
+
name: string;
6700
+
/**
6701
+
* A brief description of what the tool does.
6702
+
*/
6703
+
description: string;
6704
+
/**
6705
+
* Schema defining the parameters accepted by the tool.
6706
+
*/
6707
+
parameters: {
6708
+
/**
6709
+
* The type of the parameters object (usually 'object').
6710
+
*/
6711
+
type: string;
6712
+
/**
6713
+
* List of required parameter names.
6714
+
*/
6715
+
required?: string[];
6716
+
/**
6717
+
* Definitions of each parameter.
6718
+
*/
6719
+
properties: {
6720
+
[k: string]: {
6721
+
/**
6722
+
* The data type of the parameter.
6723
+
*/
6724
+
type: string;
6725
+
/**
6726
+
* A description of the expected parameter.
6727
+
*/
6728
+
description: string;
6729
+
};
6730
+
};
6731
+
};
6732
+
} | {
6733
+
/**
6734
+
* Specifies the type of tool (e.g., 'function').
6735
+
*/
6736
+
type: string;
6737
+
/**
6738
+
* Details of the function tool.
6739
+
*/
6740
+
function: {
6741
+
/**
6742
+
* The name of the function.
6743
+
*/
6744
+
name: string;
6745
+
/**
6746
+
* A brief description of what the function does.
6747
+
*/
6748
+
description: string;
6749
+
/**
6750
+
* Schema defining the parameters accepted by the function.
6751
+
*/
6752
+
parameters: {
6753
+
/**
6754
+
* The type of the parameters object (usually 'object').
6755
+
*/
6756
+
type: string;
6757
+
/**
6758
+
* List of required parameter names.
6759
+
*/
6760
+
required?: string[];
6761
+
/**
6762
+
* Definitions of each parameter.
6763
+
*/
6764
+
properties: {
6765
+
[k: string]: {
6766
+
/**
6767
+
* The data type of the parameter.
6768
+
*/
6769
+
type: string;
6770
+
/**
6771
+
* A description of the expected parameter.
6772
+
*/
6773
+
description: string;
6774
+
};
6775
+
};
6776
+
};
6777
+
};
6778
+
})[];
6779
+
response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_1;
6780
+
/**
6781
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6782
+
*/
6783
+
raw?: boolean;
6784
+
/**
6785
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6786
+
*/
6787
+
stream?: boolean;
6788
+
/**
6789
+
* The maximum number of tokens to generate in the response.
6790
+
*/
6791
+
max_tokens?: number;
6792
+
/**
6793
+
* Controls the randomness of the output; higher values produce more random results.
6794
+
*/
6795
+
temperature?: number;
6796
+
/**
6797
+
* 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.
6798
+
*/
6799
+
top_p?: number;
6800
+
/**
6801
+
* 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.
6802
+
*/
6803
+
top_k?: number;
6804
+
/**
6805
+
* Random seed for reproducibility of the generation.
6806
+
*/
6807
+
seed?: number;
6808
+
/**
6809
+
* Penalty for repeated tokens; higher values discourage repetition.
6810
+
*/
6811
+
repetition_penalty?: number;
6812
+
/**
6813
+
* Decreases the likelihood of the model repeating the same lines verbatim.
6814
+
*/
6815
+
frequency_penalty?: number;
6816
+
/**
6817
+
* Increases the likelihood of the model introducing new topics.
6818
+
*/
6819
+
presence_penalty?: number;
6820
+
}
6821
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_1 {
6822
+
type?: "json_object" | "json_schema";
6823
+
json_schema?: unknown;
6824
+
}
6825
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Async_Batch {
6826
+
requests: (Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt_1 | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1)[];
6827
+
}
6828
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Prompt_1 {
6829
+
/**
6830
+
* The input text prompt for the model to generate a response.
6831
+
*/
6832
+
prompt: string;
6833
+
/**
6834
+
* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
6835
+
*/
6836
+
lora?: string;
6837
+
response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_2;
6838
+
/**
6839
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6840
+
*/
6841
+
raw?: boolean;
6842
+
/**
6843
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6844
+
*/
6845
+
stream?: boolean;
6846
+
/**
6847
+
* The maximum number of tokens to generate in the response.
6848
+
*/
6849
+
max_tokens?: number;
6850
+
/**
6851
+
* Controls the randomness of the output; higher values produce more random results.
6852
+
*/
6853
+
temperature?: number;
6854
+
/**
6855
+
* 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.
6856
+
*/
6857
+
top_p?: number;
6858
+
/**
6859
+
* 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.
6860
+
*/
6861
+
top_k?: number;
6862
+
/**
6863
+
* Random seed for reproducibility of the generation.
6864
+
*/
6865
+
seed?: number;
6866
+
/**
6867
+
* Penalty for repeated tokens; higher values discourage repetition.
6868
+
*/
6869
+
repetition_penalty?: number;
6870
+
/**
6871
+
* Decreases the likelihood of the model repeating the same lines verbatim.
6872
+
*/
6873
+
frequency_penalty?: number;
6874
+
/**
6875
+
* Increases the likelihood of the model introducing new topics.
6876
+
*/
6877
+
presence_penalty?: number;
6878
+
}
6879
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_2 {
6880
+
type?: "json_object" | "json_schema";
6881
+
json_schema?: unknown;
6882
+
}
6883
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1 {
6884
+
/**
6885
+
* An array of message objects representing the conversation history.
6886
+
*/
6887
+
messages: {
6888
+
/**
6889
+
* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
6890
+
*/
6891
+
role: string;
6892
+
/**
6893
+
* The content of the message as a string.
6894
+
*/
6895
+
content: string;
6896
+
}[];
6897
+
functions?: {
6898
+
name: string;
6899
+
code: string;
6900
+
}[];
6901
+
/**
6902
+
* A list of tools available for the assistant to use.
6903
+
*/
6904
+
tools?: ({
6905
+
/**
6906
+
* The name of the tool. More descriptive the better.
6907
+
*/
6908
+
name: string;
6909
+
/**
6910
+
* A brief description of what the tool does.
6911
+
*/
6912
+
description: string;
6913
+
/**
6914
+
* Schema defining the parameters accepted by the tool.
6915
+
*/
6916
+
parameters: {
6917
+
/**
6918
+
* The type of the parameters object (usually 'object').
6919
+
*/
6920
+
type: string;
6921
+
/**
6922
+
* List of required parameter names.
6923
+
*/
6924
+
required?: string[];
6925
+
/**
6926
+
* Definitions of each parameter.
6927
+
*/
6928
+
properties: {
6929
+
[k: string]: {
6930
+
/**
6931
+
* The data type of the parameter.
6932
+
*/
6933
+
type: string;
6934
+
/**
6935
+
* A description of the expected parameter.
6936
+
*/
6937
+
description: string;
6938
+
};
6939
+
};
6940
+
};
6941
+
} | {
6942
+
/**
6943
+
* Specifies the type of tool (e.g., 'function').
6944
+
*/
6945
+
type: string;
6946
+
/**
6947
+
* Details of the function tool.
6948
+
*/
6949
+
function: {
6950
+
/**
6951
+
* The name of the function.
6952
+
*/
6953
+
name: string;
6954
+
/**
6955
+
* A brief description of what the function does.
6956
+
*/
6957
+
description: string;
6958
+
/**
6959
+
* Schema defining the parameters accepted by the function.
6960
+
*/
6961
+
parameters: {
6962
+
/**
6963
+
* The type of the parameters object (usually 'object').
6964
+
*/
6965
+
type: string;
6966
+
/**
6967
+
* List of required parameter names.
6968
+
*/
6969
+
required?: string[];
6970
+
/**
6971
+
* Definitions of each parameter.
6972
+
*/
6973
+
properties: {
6974
+
[k: string]: {
6975
+
/**
6976
+
* The data type of the parameter.
6977
+
*/
6978
+
type: string;
6979
+
/**
6980
+
* A description of the expected parameter.
6981
+
*/
6982
+
description: string;
6983
+
};
6984
+
};
6985
+
};
6986
+
};
6987
+
})[];
6988
+
response_format?: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_3;
6989
+
/**
6990
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6991
+
*/
6992
+
raw?: boolean;
6993
+
/**
6994
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6995
+
*/
6996
+
stream?: boolean;
6997
+
/**
6998
+
* The maximum number of tokens to generate in the response.
6999
+
*/
7000
+
max_tokens?: number;
7001
+
/**
7002
+
* Controls the randomness of the output; higher values produce more random results.
7003
+
*/
7004
+
temperature?: number;
7005
+
/**
7006
+
* 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.
7007
+
*/
7008
+
top_p?: number;
7009
+
/**
7010
+
* 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.
7011
+
*/
7012
+
top_k?: number;
7013
+
/**
7014
+
* Random seed for reproducibility of the generation.
7015
+
*/
7016
+
seed?: number;
7017
+
/**
7018
+
* Penalty for repeated tokens; higher values discourage repetition.
7019
+
*/
7020
+
repetition_penalty?: number;
7021
+
/**
7022
+
* Decreases the likelihood of the model repeating the same lines verbatim.
7023
+
*/
7024
+
frequency_penalty?: number;
7025
+
/**
7026
+
* Increases the likelihood of the model introducing new topics.
7027
+
*/
7028
+
presence_penalty?: number;
7029
+
}
7030
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_JSON_Mode_3 {
7031
+
type?: "json_object" | "json_schema";
7032
+
json_schema?: unknown;
7033
+
}
7034
+
type Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Output = Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Chat_Completion_Response | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Text_Completion_Response | string | Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_AsyncResponse;
7035
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Chat_Completion_Response {
7036
+
/**
7037
+
* Unique identifier for the completion
7038
+
*/
7039
+
id?: string;
7040
+
/**
7041
+
* Object type identifier
7042
+
*/
7043
+
object?: "chat.completion";
7044
+
/**
7045
+
* Unix timestamp of when the completion was created
7046
+
*/
7047
+
created?: number;
7048
+
/**
7049
+
* Model used for the completion
7050
+
*/
7051
+
model?: string;
7052
+
/**
7053
+
* List of completion choices
7054
+
*/
7055
+
choices?: {
7056
+
/**
7057
+
* Index of the choice in the list
7058
+
*/
7059
+
index?: number;
7060
+
/**
7061
+
* The message generated by the model
7062
+
*/
7063
+
message?: {
7064
+
/**
7065
+
* Role of the message author
7066
+
*/
7067
+
role: string;
7068
+
/**
7069
+
* The content of the message
7070
+
*/
7071
+
content: string;
7072
+
/**
7073
+
* Internal reasoning content (if available)
7074
+
*/
7075
+
reasoning_content?: string;
7076
+
/**
7077
+
* Tool calls made by the assistant
7078
+
*/
7079
+
tool_calls?: {
7080
+
/**
7081
+
* Unique identifier for the tool call
7082
+
*/
7083
+
id: string;
7084
+
/**
7085
+
* Type of tool call
7086
+
*/
7087
+
type: "function";
7088
+
function: {
7089
+
/**
7090
+
* Name of the function to call
7091
+
*/
7092
+
name: string;
7093
+
/**
7094
+
* JSON string of arguments for the function
7095
+
*/
7096
+
arguments: string;
7097
+
};
7098
+
}[];
7099
+
};
7100
+
/**
7101
+
* Reason why the model stopped generating
7102
+
*/
7103
+
finish_reason?: string;
7104
+
/**
7105
+
* Stop reason (may be null)
7106
+
*/
7107
+
stop_reason?: string | null;
7108
+
/**
7109
+
* Log probabilities (if requested)
7110
+
*/
7111
+
logprobs?: {} | null;
7112
+
}[];
7113
+
/**
7114
+
* Usage statistics for the inference request
7115
+
*/
7116
+
usage?: {
7117
+
/**
7118
+
* Total number of tokens in input
7119
+
*/
7120
+
prompt_tokens?: number;
7121
+
/**
7122
+
* Total number of tokens in output
7123
+
*/
7124
+
completion_tokens?: number;
7125
+
/**
7126
+
* Total number of input and output tokens
7127
+
*/
7128
+
total_tokens?: number;
7129
+
};
7130
+
/**
7131
+
* Log probabilities for the prompt (if requested)
7132
+
*/
7133
+
prompt_logprobs?: {} | null;
7134
+
}
7135
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Text_Completion_Response {
7136
+
/**
7137
+
* Unique identifier for the completion
7138
+
*/
7139
+
id?: string;
7140
+
/**
7141
+
* Object type identifier
7142
+
*/
7143
+
object?: "text_completion";
7144
+
/**
7145
+
* Unix timestamp of when the completion was created
7146
+
*/
7147
+
created?: number;
7148
+
/**
7149
+
* Model used for the completion
7150
+
*/
7151
+
model?: string;
7152
+
/**
7153
+
* List of completion choices
7154
+
*/
7155
+
choices?: {
7156
+
/**
7157
+
* Index of the choice in the list
7158
+
*/
7159
+
index: number;
7160
+
/**
7161
+
* The generated text completion
7162
+
*/
7163
+
text: string;
7164
+
/**
7165
+
* Reason why the model stopped generating
7166
+
*/
7167
+
finish_reason: string;
7168
+
/**
7169
+
* Stop reason (may be null)
7170
+
*/
7171
+
stop_reason?: string | null;
7172
+
/**
7173
+
* Log probabilities (if requested)
7174
+
*/
7175
+
logprobs?: {} | null;
7176
+
/**
7177
+
* Log probabilities for the prompt (if requested)
7178
+
*/
7179
+
prompt_logprobs?: {} | null;
7180
+
}[];
7181
+
/**
7182
+
* Usage statistics for the inference request
7183
+
*/
7184
+
usage?: {
7185
+
/**
7186
+
* Total number of tokens in input
7187
+
*/
7188
+
prompt_tokens?: number;
7189
+
/**
7190
+
* Total number of tokens in output
7191
+
*/
7192
+
completion_tokens?: number;
7193
+
/**
7194
+
* Total number of input and output tokens
7195
+
*/
7196
+
total_tokens?: number;
7197
+
};
7198
+
}
7199
+
interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_AsyncResponse {
7200
+
/**
7201
+
* The async request id that can be used to obtain the results.
7202
+
*/
7203
+
request_id?: string;
7204
+
}
7205
+
declare abstract class Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8 {
7206
+
inputs: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Input;
7207
+
postProcessedOutputs: Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Output;
7208
+
}
7209
+
interface Ai_Cf_Deepgram_Nova_3_Input {
7210
+
audio: {
7211
+
body: object;
7212
+
contentType: string;
7213
+
};
7214
+
/**
7215
+
* Sets how the model will interpret strings submitted to the custom_topic param. When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param.
7216
+
*/
7217
+
custom_topic_mode?: "extended" | "strict";
7218
+
/**
7219
+
* Custom topics you want the model to detect within your input audio or text if present Submit up to 100
7220
+
*/
7221
+
custom_topic?: string;
7222
+
/**
7223
+
* Sets how the model will interpret intents submitted to the custom_intent param. When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition those submitted using the custom_intents param
7224
+
*/
7225
+
custom_intent_mode?: "extended" | "strict";
7226
+
/**
7227
+
* Custom intents you want the model to detect within your input audio if present
7228
+
*/
7229
+
custom_intent?: string;
7230
+
/**
7231
+
* Identifies and extracts key entities from content in submitted audio
7232
+
*/
7233
+
detect_entities?: boolean;
7234
+
/**
7235
+
* Identifies the dominant language spoken in submitted audio
7236
+
*/
7237
+
detect_language?: boolean;
7238
+
/**
7239
+
* Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
7240
+
*/
7241
+
diarize?: boolean;
7242
+
/**
7243
+
* Identify and extract key entities from content in submitted audio
7244
+
*/
7245
+
dictation?: boolean;
7246
+
/**
7247
+
* Specify the expected encoding of your submitted audio
7248
+
*/
7249
+
encoding?: "linear16" | "flac" | "mulaw" | "amr-nb" | "amr-wb" | "opus" | "speex" | "g729";
7250
+
/**
7251
+
* Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
7252
+
*/
7253
+
extra?: string;
7254
+
/**
7255
+
* Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
7256
+
*/
7257
+
filler_words?: boolean;
7258
+
/**
7259
+
* Key term prompting can boost or suppress specialized terminology and brands.
7260
+
*/
7261
+
keyterm?: string;
7262
+
/**
7263
+
* Keywords can boost or suppress specialized terminology and brands.
7264
+
*/
7265
+
keywords?: string;
7266
+
/**
7267
+
* The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available.
7268
+
*/
7269
+
language?: string;
7270
+
/**
7271
+
* Spoken measurements will be converted to their corresponding abbreviations.
7272
+
*/
7273
+
measurements?: boolean;
7274
+
/**
7275
+
* Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip.
7276
+
*/
7277
+
mip_opt_out?: boolean;
7278
+
/**
7279
+
* Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
7280
+
*/
7281
+
mode?: "general" | "medical" | "finance";
7282
+
/**
7283
+
* Transcribe each audio channel independently.
7284
+
*/
7285
+
multichannel?: boolean;
7286
+
/**
7287
+
* Numerals converts numbers from written format to numerical format.
7288
+
*/
7289
+
numerals?: boolean;
7290
+
/**
7291
+
* Splits audio into paragraphs to improve transcript readability.
7292
+
*/
7293
+
paragraphs?: boolean;
7294
+
/**
7295
+
* Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
7296
+
*/
7297
+
profanity_filter?: boolean;
7298
+
/**
7299
+
* Add punctuation and capitalization to the transcript.
7300
+
*/
7301
+
punctuate?: boolean;
7302
+
/**
7303
+
* Redaction removes sensitive information from your transcripts.
7304
+
*/
7305
+
redact?: string;
7306
+
/**
7307
+
* Search for terms or phrases in submitted audio and replaces them.
7308
+
*/
7309
+
replace?: string;
7310
+
/**
7311
+
* Search for terms or phrases in submitted audio.
7312
+
*/
7313
+
search?: string;
7314
+
/**
7315
+
* Recognizes the sentiment throughout a transcript or text.
7316
+
*/
7317
+
sentiment?: boolean;
7318
+
/**
7319
+
* Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
7320
+
*/
7321
+
smart_format?: boolean;
7322
+
/**
7323
+
* Detect topics throughout a transcript or text.
7324
+
*/
7325
+
topics?: boolean;
7326
+
/**
7327
+
* Segments speech into meaningful semantic units.
7328
+
*/
7329
+
utterances?: boolean;
7330
+
/**
7331
+
* Seconds to wait before detecting a pause between words in submitted audio.
7332
+
*/
7333
+
utt_split?: number;
7334
+
/**
7335
+
* The number of channels in the submitted audio
7336
+
*/
7337
+
channels?: number;
7338
+
/**
7339
+
* Specifies whether the streaming endpoint should provide ongoing transcription updates as more audio is received. When set to true, the endpoint sends continuous updates, meaning transcription results may evolve over time. Note: Supported only for webosockets.
7340
+
*/
7341
+
interim_results?: boolean;
7342
+
/**
7343
+
* Indicates how long model will wait to detect whether a speaker has finished speaking or pauses for a significant period of time. When set to a value, the streaming endpoint immediately finalizes the transcription for the processed time range and returns the transcript with a speech_final parameter set to true. Can also be set to false to disable endpointing
7344
+
*/
7345
+
endpointing?: string;
7346
+
/**
7347
+
* Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
7348
+
*/
7349
+
vad_events?: boolean;
7350
+
/**
7351
+
* Indicates how long model will wait to send an UtteranceEnd message after a word has been transcribed. Use with interim_results. Note: Supported only for webosockets.
7352
+
*/
7353
+
utterance_end_ms?: boolean;
7354
+
}
7355
+
interface Ai_Cf_Deepgram_Nova_3_Output {
7356
+
results?: {
7357
+
channels?: {
7358
+
alternatives?: {
7359
+
confidence?: number;
7360
+
transcript?: string;
7361
+
words?: {
7362
+
confidence?: number;
7363
+
end?: number;
7364
+
start?: number;
7365
+
word?: string;
7366
+
}[];
7367
+
}[];
7368
+
}[];
7369
+
summary?: {
7370
+
result?: string;
7371
+
short?: string;
7372
+
};
7373
+
sentiments?: {
7374
+
segments?: {
7375
+
text?: string;
7376
+
start_word?: number;
7377
+
end_word?: number;
7378
+
sentiment?: string;
7379
+
sentiment_score?: number;
7380
+
}[];
7381
+
average?: {
7382
+
sentiment?: string;
7383
+
sentiment_score?: number;
7384
+
};
7385
+
};
7386
+
};
7387
+
}
7388
+
declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
7389
+
inputs: Ai_Cf_Deepgram_Nova_3_Input;
7390
+
postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
7391
+
}
7392
+
interface Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input {
7393
+
queries?: string | string[];
7394
+
/**
7395
+
* Optional instruction for the task
7396
+
*/
7397
+
instruction?: string;
7398
+
documents?: string | string[];
7399
+
text?: string | string[];
7400
+
}
7401
+
interface Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Output {
7402
+
data?: number[][];
7403
+
shape?: number[];
7404
+
}
7405
+
declare abstract class Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B {
7406
+
inputs: Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input;
7407
+
postProcessedOutputs: Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Output;
7408
+
}
7409
+
type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input = {
7410
+
/**
7411
+
* readable stream with audio data and content-type specified for that data
7412
+
*/
7413
+
audio: {
7414
+
body: object;
7415
+
contentType: string;
7416
+
};
7417
+
/**
7418
+
* type of data PCM data that's sent to the inference server as raw array
7419
+
*/
7420
+
dtype?: "uint8" | "float32" | "float64";
7421
+
} | {
7422
+
/**
7423
+
* base64 encoded audio data
7424
+
*/
7425
+
audio: string;
7426
+
/**
7427
+
* type of data PCM data that's sent to the inference server as raw array
7428
+
*/
7429
+
dtype?: "uint8" | "float32" | "float64";
7430
+
};
7431
+
interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
7432
+
/**
7433
+
* if true, end-of-turn was detected
7434
+
*/
7435
+
is_complete?: boolean;
7436
+
/**
7437
+
* probability of the end-of-turn detection
7438
+
*/
7439
+
probability?: number;
7440
+
}
7441
+
declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
7442
+
inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
7443
+
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
7444
+
}
7445
+
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
7446
+
inputs: ResponsesInput;
7447
+
postProcessedOutputs: ResponsesOutput;
7448
+
}
7449
+
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
7450
+
inputs: ResponsesInput;
7451
+
postProcessedOutputs: ResponsesOutput;
7452
+
}
7453
+
interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
7454
+
/**
7455
+
* A text description of the image you want to generate.
7456
+
*/
7457
+
prompt: string;
7458
+
/**
7459
+
* Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
7460
+
*/
7461
+
guidance?: number;
7462
+
/**
7463
+
* Random seed for reproducibility of the image generation
7464
+
*/
7465
+
seed?: number;
7466
+
/**
7467
+
* The height of the generated image in pixels
7468
+
*/
7469
+
height?: number;
7470
+
/**
7471
+
* The width of the generated image in pixels
7472
+
*/
7473
+
width?: number;
7474
+
/**
7475
+
* The number of diffusion steps; higher values can improve quality but take longer
7476
+
*/
7477
+
num_steps?: number;
7478
+
/**
7479
+
* Specify what to exclude from the generated images
7480
+
*/
7481
+
negative_prompt?: string;
7482
+
}
7483
+
/**
7484
+
* The generated image in JPEG format
7485
+
*/
7486
+
type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
7487
+
declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
7488
+
inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
7489
+
postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
7490
+
}
7491
+
interface Ai_Cf_Leonardo_Lucid_Origin_Input {
7492
+
/**
7493
+
* A text description of the image you want to generate.
7494
+
*/
7495
+
prompt: string;
7496
+
/**
7497
+
* Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
7498
+
*/
7499
+
guidance?: number;
7500
+
/**
7501
+
* Random seed for reproducibility of the image generation
7502
+
*/
7503
+
seed?: number;
7504
+
/**
7505
+
* The height of the generated image in pixels
7506
+
*/
7507
+
height?: number;
7508
+
/**
7509
+
* The width of the generated image in pixels
7510
+
*/
7511
+
width?: number;
7512
+
/**
7513
+
* The number of diffusion steps; higher values can improve quality but take longer
7514
+
*/
7515
+
num_steps?: number;
7516
+
/**
7517
+
* The number of diffusion steps; higher values can improve quality but take longer
7518
+
*/
7519
+
steps?: number;
7520
+
}
7521
+
interface Ai_Cf_Leonardo_Lucid_Origin_Output {
7522
+
/**
7523
+
* The generated image in Base64 format.
7524
+
*/
7525
+
image?: string;
7526
+
}
7527
+
declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
7528
+
inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
7529
+
postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
7530
+
}
7531
+
interface Ai_Cf_Deepgram_Aura_1_Input {
7532
+
/**
7533
+
* Speaker used to produce the audio.
7534
+
*/
7535
+
speaker?: "angus" | "asteria" | "arcas" | "orion" | "orpheus" | "athena" | "luna" | "zeus" | "perseus" | "helios" | "hera" | "stella";
7536
+
/**
7537
+
* Encoding of the output audio.
7538
+
*/
7539
+
encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
7540
+
/**
7541
+
* Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
7542
+
*/
7543
+
container?: "none" | "wav" | "ogg";
7544
+
/**
7545
+
* The text content to be converted to speech
7546
+
*/
7547
+
text: string;
7548
+
/**
7549
+
* Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable
7550
+
*/
7551
+
sample_rate?: number;
7552
+
/**
7553
+
* The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
7554
+
*/
7555
+
bit_rate?: number;
7556
+
}
7557
+
/**
7558
+
* The generated audio in MP3 format
7559
+
*/
7560
+
type Ai_Cf_Deepgram_Aura_1_Output = string;
7561
+
declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
7562
+
inputs: Ai_Cf_Deepgram_Aura_1_Input;
7563
+
postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
7564
+
}
7565
+
interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input {
7566
+
/**
7567
+
* Input text to translate. Can be a single string or a list of strings.
7568
+
*/
7569
+
text: string | string[];
7570
+
/**
7571
+
* Target langauge to translate to
7572
+
*/
7573
+
target_language: "asm_Beng" | "awa_Deva" | "ben_Beng" | "bho_Deva" | "brx_Deva" | "doi_Deva" | "eng_Latn" | "gom_Deva" | "gon_Deva" | "guj_Gujr" | "hin_Deva" | "hne_Deva" | "kan_Knda" | "kas_Arab" | "kas_Deva" | "kha_Latn" | "lus_Latn" | "mag_Deva" | "mai_Deva" | "mal_Mlym" | "mar_Deva" | "mni_Beng" | "mni_Mtei" | "npi_Deva" | "ory_Orya" | "pan_Guru" | "san_Deva" | "sat_Olck" | "snd_Arab" | "snd_Deva" | "tam_Taml" | "tel_Telu" | "urd_Arab" | "unr_Deva";
7574
+
}
7575
+
interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Output {
7576
+
/**
7577
+
* Translated texts
7578
+
*/
7579
+
translations: string[];
7580
+
}
7581
+
declare abstract class Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B {
7582
+
inputs: Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input;
7583
+
postProcessedOutputs: Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Output;
7584
+
}
7585
+
type Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Input = Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Async_Batch;
7586
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt {
7587
+
/**
7588
+
* The input text prompt for the model to generate a response.
7589
+
*/
7590
+
prompt: string;
7591
+
/**
7592
+
* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
7593
+
*/
7594
+
lora?: string;
7595
+
response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode;
7596
+
/**
7597
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
7598
+
*/
7599
+
raw?: boolean;
7600
+
/**
7601
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
7602
+
*/
7603
+
stream?: boolean;
7604
+
/**
7605
+
* The maximum number of tokens to generate in the response.
7606
+
*/
7607
+
max_tokens?: number;
7608
+
/**
7609
+
* Controls the randomness of the output; higher values produce more random results.
7610
+
*/
7611
+
temperature?: number;
7612
+
/**
7613
+
* 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.
7614
+
*/
7615
+
top_p?: number;
7616
+
/**
7617
+
* 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.
7618
+
*/
7619
+
top_k?: number;
7620
+
/**
7621
+
* Random seed for reproducibility of the generation.
7622
+
*/
7623
+
seed?: number;
7624
+
/**
7625
+
* Penalty for repeated tokens; higher values discourage repetition.
7626
+
*/
7627
+
repetition_penalty?: number;
7628
+
/**
7629
+
* Decreases the likelihood of the model repeating the same lines verbatim.
7630
+
*/
7631
+
frequency_penalty?: number;
7632
+
/**
7633
+
* Increases the likelihood of the model introducing new topics.
7634
+
*/
7635
+
presence_penalty?: number;
7636
+
}
7637
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode {
7638
+
type?: "json_object" | "json_schema";
7639
+
json_schema?: unknown;
7640
+
}
7641
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages {
7642
+
/**
7643
+
* An array of message objects representing the conversation history.
7644
+
*/
7645
+
messages: {
7646
+
/**
7647
+
* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
7648
+
*/
7649
+
role: string;
7650
+
/**
7651
+
* The content of the message as a string.
7652
+
*/
7653
+
content: string;
7654
+
}[];
7655
+
functions?: {
7656
+
name: string;
7657
+
code: string;
7658
+
}[];
7659
+
/**
7660
+
* A list of tools available for the assistant to use.
7661
+
*/
7662
+
tools?: ({
7663
+
/**
7664
+
* The name of the tool. More descriptive the better.
7665
+
*/
7666
+
name: string;
7667
+
/**
7668
+
* A brief description of what the tool does.
7669
+
*/
7670
+
description: string;
7671
+
/**
7672
+
* Schema defining the parameters accepted by the tool.
7673
+
*/
7674
+
parameters: {
7675
+
/**
7676
+
* The type of the parameters object (usually 'object').
7677
+
*/
7678
+
type: string;
7679
+
/**
7680
+
* List of required parameter names.
7681
+
*/
7682
+
required?: string[];
7683
+
/**
7684
+
* Definitions of each parameter.
7685
+
*/
7686
+
properties: {
7687
+
[k: string]: {
7688
+
/**
7689
+
* The data type of the parameter.
7690
+
*/
7691
+
type: string;
7692
+
/**
7693
+
* A description of the expected parameter.
7694
+
*/
7695
+
description: string;
7696
+
};
7697
+
};
7698
+
};
7699
+
} | {
7700
+
/**
7701
+
* Specifies the type of tool (e.g., 'function').
7702
+
*/
7703
+
type: string;
7704
+
/**
7705
+
* Details of the function tool.
7706
+
*/
7707
+
function: {
7708
+
/**
7709
+
* The name of the function.
7710
+
*/
7711
+
name: string;
7712
+
/**
7713
+
* A brief description of what the function does.
7714
+
*/
7715
+
description: string;
7716
+
/**
7717
+
* Schema defining the parameters accepted by the function.
7718
+
*/
7719
+
parameters: {
7720
+
/**
7721
+
* The type of the parameters object (usually 'object').
7722
+
*/
7723
+
type: string;
7724
+
/**
7725
+
* List of required parameter names.
7726
+
*/
7727
+
required?: string[];
7728
+
/**
7729
+
* Definitions of each parameter.
7730
+
*/
7731
+
properties: {
7732
+
[k: string]: {
7733
+
/**
7734
+
* The data type of the parameter.
7735
+
*/
7736
+
type: string;
7737
+
/**
7738
+
* A description of the expected parameter.
7739
+
*/
7740
+
description: string;
7741
+
};
7742
+
};
7743
+
};
7744
+
};
7745
+
})[];
7746
+
response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_1;
7747
+
/**
7748
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
7749
+
*/
7750
+
raw?: boolean;
7751
+
/**
7752
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
7753
+
*/
7754
+
stream?: boolean;
7755
+
/**
7756
+
* The maximum number of tokens to generate in the response.
7757
+
*/
7758
+
max_tokens?: number;
7759
+
/**
7760
+
* Controls the randomness of the output; higher values produce more random results.
7761
+
*/
7762
+
temperature?: number;
7763
+
/**
7764
+
* 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.
7765
+
*/
7766
+
top_p?: number;
7767
+
/**
7768
+
* 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.
7769
+
*/
7770
+
top_k?: number;
7771
+
/**
7772
+
* Random seed for reproducibility of the generation.
7773
+
*/
7774
+
seed?: number;
7775
+
/**
7776
+
* Penalty for repeated tokens; higher values discourage repetition.
7777
+
*/
7778
+
repetition_penalty?: number;
7779
+
/**
7780
+
* Decreases the likelihood of the model repeating the same lines verbatim.
7781
+
*/
7782
+
frequency_penalty?: number;
7783
+
/**
7784
+
* Increases the likelihood of the model introducing new topics.
7785
+
*/
7786
+
presence_penalty?: number;
7787
+
}
7788
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_1 {
7789
+
type?: "json_object" | "json_schema";
7790
+
json_schema?: unknown;
7791
+
}
7792
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Async_Batch {
7793
+
requests: (Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt_1 | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1)[];
7794
+
}
7795
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Prompt_1 {
7796
+
/**
7797
+
* The input text prompt for the model to generate a response.
7798
+
*/
7799
+
prompt: string;
7800
+
/**
7801
+
* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
7802
+
*/
7803
+
lora?: string;
7804
+
response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_2;
7805
+
/**
7806
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
7807
+
*/
7808
+
raw?: boolean;
7809
+
/**
7810
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
7811
+
*/
7812
+
stream?: boolean;
7813
+
/**
7814
+
* The maximum number of tokens to generate in the response.
7815
+
*/
7816
+
max_tokens?: number;
7817
+
/**
7818
+
* Controls the randomness of the output; higher values produce more random results.
7819
+
*/
7820
+
temperature?: number;
7821
+
/**
7822
+
* 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.
7823
+
*/
7824
+
top_p?: number;
7825
+
/**
7826
+
* 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.
7827
+
*/
7828
+
top_k?: number;
7829
+
/**
7830
+
* Random seed for reproducibility of the generation.
7831
+
*/
7832
+
seed?: number;
7833
+
/**
7834
+
* Penalty for repeated tokens; higher values discourage repetition.
7835
+
*/
7836
+
repetition_penalty?: number;
7837
+
/**
7838
+
* Decreases the likelihood of the model repeating the same lines verbatim.
7839
+
*/
7840
+
frequency_penalty?: number;
7841
+
/**
7842
+
* Increases the likelihood of the model introducing new topics.
7843
+
*/
7844
+
presence_penalty?: number;
7845
+
}
7846
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_2 {
7847
+
type?: "json_object" | "json_schema";
7848
+
json_schema?: unknown;
7849
+
}
7850
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1 {
7851
+
/**
7852
+
* An array of message objects representing the conversation history.
7853
+
*/
7854
+
messages: {
7855
+
/**
7856
+
* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
7857
+
*/
7858
+
role: string;
7859
+
/**
7860
+
* The content of the message as a string.
7861
+
*/
7862
+
content: string;
7863
+
}[];
7864
+
functions?: {
7865
+
name: string;
7866
+
code: string;
7867
+
}[];
7868
+
/**
7869
+
* A list of tools available for the assistant to use.
7870
+
*/
7871
+
tools?: ({
7872
+
/**
7873
+
* The name of the tool. More descriptive the better.
7874
+
*/
7875
+
name: string;
7876
+
/**
7877
+
* A brief description of what the tool does.
7878
+
*/
7879
+
description: string;
7880
+
/**
7881
+
* Schema defining the parameters accepted by the tool.
7882
+
*/
7883
+
parameters: {
7884
+
/**
7885
+
* The type of the parameters object (usually 'object').
7886
+
*/
7887
+
type: string;
7888
+
/**
7889
+
* List of required parameter names.
7890
+
*/
7891
+
required?: string[];
7892
+
/**
7893
+
* Definitions of each parameter.
7894
+
*/
7895
+
properties: {
7896
+
[k: string]: {
7897
+
/**
7898
+
* The data type of the parameter.
7899
+
*/
7900
+
type: string;
7901
+
/**
7902
+
* A description of the expected parameter.
7903
+
*/
7904
+
description: string;
7905
+
};
7906
+
};
7907
+
};
7908
+
} | {
7909
+
/**
7910
+
* Specifies the type of tool (e.g., 'function').
7911
+
*/
7912
+
type: string;
7913
+
/**
7914
+
* Details of the function tool.
7915
+
*/
7916
+
function: {
7917
+
/**
7918
+
* The name of the function.
7919
+
*/
7920
+
name: string;
7921
+
/**
7922
+
* A brief description of what the function does.
7923
+
*/
7924
+
description: string;
7925
+
/**
7926
+
* Schema defining the parameters accepted by the function.
7927
+
*/
7928
+
parameters: {
7929
+
/**
7930
+
* The type of the parameters object (usually 'object').
7931
+
*/
7932
+
type: string;
7933
+
/**
7934
+
* List of required parameter names.
7935
+
*/
7936
+
required?: string[];
7937
+
/**
7938
+
* Definitions of each parameter.
7939
+
*/
7940
+
properties: {
7941
+
[k: string]: {
7942
+
/**
7943
+
* The data type of the parameter.
7944
+
*/
7945
+
type: string;
7946
+
/**
7947
+
* A description of the expected parameter.
7948
+
*/
7949
+
description: string;
7950
+
};
7951
+
};
7952
+
};
7953
+
};
7954
+
})[];
7955
+
response_format?: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_3;
7956
+
/**
7957
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
7958
+
*/
7959
+
raw?: boolean;
7960
+
/**
7961
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
7962
+
*/
7963
+
stream?: boolean;
7964
+
/**
7965
+
* The maximum number of tokens to generate in the response.
7966
+
*/
7967
+
max_tokens?: number;
7968
+
/**
7969
+
* Controls the randomness of the output; higher values produce more random results.
7970
+
*/
7971
+
temperature?: number;
7972
+
/**
7973
+
* 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.
7974
+
*/
7975
+
top_p?: number;
7976
+
/**
7977
+
* 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.
7978
+
*/
7979
+
top_k?: number;
7980
+
/**
7981
+
* Random seed for reproducibility of the generation.
7982
+
*/
7983
+
seed?: number;
7984
+
/**
7985
+
* Penalty for repeated tokens; higher values discourage repetition.
7986
+
*/
7987
+
repetition_penalty?: number;
7988
+
/**
7989
+
* Decreases the likelihood of the model repeating the same lines verbatim.
7990
+
*/
7991
+
frequency_penalty?: number;
7992
+
/**
7993
+
* Increases the likelihood of the model introducing new topics.
7994
+
*/
7995
+
presence_penalty?: number;
7996
+
}
7997
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_JSON_Mode_3 {
7998
+
type?: "json_object" | "json_schema";
7999
+
json_schema?: unknown;
8000
+
}
8001
+
type Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Output = Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Chat_Completion_Response | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Text_Completion_Response | string | Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_AsyncResponse;
8002
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Chat_Completion_Response {
8003
+
/**
8004
+
* Unique identifier for the completion
8005
+
*/
8006
+
id?: string;
8007
+
/**
8008
+
* Object type identifier
8009
+
*/
8010
+
object?: "chat.completion";
8011
+
/**
8012
+
* Unix timestamp of when the completion was created
8013
+
*/
8014
+
created?: number;
8015
+
/**
8016
+
* Model used for the completion
8017
+
*/
8018
+
model?: string;
8019
+
/**
8020
+
* List of completion choices
8021
+
*/
8022
+
choices?: {
8023
+
/**
8024
+
* Index of the choice in the list
8025
+
*/
8026
+
index?: number;
8027
+
/**
8028
+
* The message generated by the model
8029
+
*/
8030
+
message?: {
8031
+
/**
8032
+
* Role of the message author
8033
+
*/
8034
+
role: string;
8035
+
/**
8036
+
* The content of the message
8037
+
*/
8038
+
content: string;
8039
+
/**
8040
+
* Internal reasoning content (if available)
8041
+
*/
8042
+
reasoning_content?: string;
8043
+
/**
8044
+
* Tool calls made by the assistant
8045
+
*/
8046
+
tool_calls?: {
8047
+
/**
8048
+
* Unique identifier for the tool call
8049
+
*/
8050
+
id: string;
8051
+
/**
8052
+
* Type of tool call
8053
+
*/
8054
+
type: "function";
8055
+
function: {
8056
+
/**
8057
+
* Name of the function to call
8058
+
*/
8059
+
name: string;
8060
+
/**
8061
+
* JSON string of arguments for the function
8062
+
*/
8063
+
arguments: string;
8064
+
};
8065
+
}[];
8066
+
};
8067
+
/**
8068
+
* Reason why the model stopped generating
8069
+
*/
8070
+
finish_reason?: string;
8071
+
/**
8072
+
* Stop reason (may be null)
8073
+
*/
8074
+
stop_reason?: string | null;
8075
+
/**
8076
+
* Log probabilities (if requested)
8077
+
*/
8078
+
logprobs?: {} | null;
8079
+
}[];
8080
+
/**
8081
+
* Usage statistics for the inference request
8082
+
*/
8083
+
usage?: {
8084
+
/**
8085
+
* Total number of tokens in input
8086
+
*/
8087
+
prompt_tokens?: number;
8088
+
/**
8089
+
* Total number of tokens in output
8090
+
*/
8091
+
completion_tokens?: number;
8092
+
/**
8093
+
* Total number of input and output tokens
8094
+
*/
8095
+
total_tokens?: number;
8096
+
};
8097
+
/**
8098
+
* Log probabilities for the prompt (if requested)
8099
+
*/
8100
+
prompt_logprobs?: {} | null;
8101
+
}
8102
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Text_Completion_Response {
8103
+
/**
8104
+
* Unique identifier for the completion
8105
+
*/
8106
+
id?: string;
8107
+
/**
8108
+
* Object type identifier
8109
+
*/
8110
+
object?: "text_completion";
8111
+
/**
8112
+
* Unix timestamp of when the completion was created
8113
+
*/
8114
+
created?: number;
8115
+
/**
8116
+
* Model used for the completion
8117
+
*/
8118
+
model?: string;
8119
+
/**
8120
+
* List of completion choices
8121
+
*/
8122
+
choices?: {
8123
+
/**
8124
+
* Index of the choice in the list
8125
+
*/
8126
+
index: number;
8127
+
/**
8128
+
* The generated text completion
8129
+
*/
8130
+
text: string;
8131
+
/**
8132
+
* Reason why the model stopped generating
8133
+
*/
8134
+
finish_reason: string;
8135
+
/**
8136
+
* Stop reason (may be null)
8137
+
*/
8138
+
stop_reason?: string | null;
8139
+
/**
8140
+
* Log probabilities (if requested)
8141
+
*/
8142
+
logprobs?: {} | null;
8143
+
/**
8144
+
* Log probabilities for the prompt (if requested)
8145
+
*/
8146
+
prompt_logprobs?: {} | null;
8147
+
}[];
8148
+
/**
8149
+
* Usage statistics for the inference request
8150
+
*/
8151
+
usage?: {
8152
+
/**
8153
+
* Total number of tokens in input
8154
+
*/
8155
+
prompt_tokens?: number;
8156
+
/**
8157
+
* Total number of tokens in output
8158
+
*/
8159
+
completion_tokens?: number;
8160
+
/**
8161
+
* Total number of input and output tokens
8162
+
*/
8163
+
total_tokens?: number;
8164
+
};
8165
+
}
8166
+
interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_AsyncResponse {
8167
+
/**
8168
+
* The async request id that can be used to obtain the results.
8169
+
*/
8170
+
request_id?: string;
8171
+
}
8172
+
declare abstract class Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It {
8173
+
inputs: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Input;
8174
+
postProcessedOutputs: Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Output;
8175
+
}
8176
+
interface Ai_Cf_Pfnet_Plamo_Embedding_1B_Input {
8177
+
/**
8178
+
* Input text to embed. Can be a single string or a list of strings.
8179
+
*/
8180
+
text: string | string[];
8181
+
}
8182
+
interface Ai_Cf_Pfnet_Plamo_Embedding_1B_Output {
8183
+
/**
8184
+
* Embedding vectors, where each vector is a list of floats.
8185
+
*/
8186
+
data: number[][];
8187
+
/**
8188
+
* Shape of the embedding data as [number_of_embeddings, embedding_dimension].
8189
+
*
8190
+
* @minItems 2
8191
+
* @maxItems 2
8192
+
*/
8193
+
shape: [
8194
+
number,
8195
+
number
8196
+
];
8197
+
}
8198
+
declare abstract class Base_Ai_Cf_Pfnet_Plamo_Embedding_1B {
8199
+
inputs: Ai_Cf_Pfnet_Plamo_Embedding_1B_Input;
8200
+
postProcessedOutputs: Ai_Cf_Pfnet_Plamo_Embedding_1B_Output;
8201
+
}
8202
+
interface Ai_Cf_Deepgram_Flux_Input {
8203
+
/**
8204
+
* Encoding of the audio stream. Currently only supports raw signed little-endian 16-bit PCM.
8205
+
*/
8206
+
encoding: "linear16";
8207
+
/**
8208
+
* Sample rate of the audio stream in Hz.
8209
+
*/
8210
+
sample_rate: string;
8211
+
/**
8212
+
* End-of-turn confidence required to fire an eager end-of-turn event. When set, enables EagerEndOfTurn and TurnResumed events. Valid Values 0.3 - 0.9.
8213
+
*/
8214
+
eager_eot_threshold?: string;
8215
+
/**
8216
+
* End-of-turn confidence required to finish a turn. Valid Values 0.5 - 0.9.
8217
+
*/
8218
+
eot_threshold?: string;
8219
+
/**
8220
+
* A turn will be finished when this much time has passed after speech, regardless of EOT confidence.
8221
+
*/
8222
+
eot_timeout_ms?: string;
8223
+
/**
8224
+
* Keyterm prompting can improve recognition of specialized terminology. Pass multiple keyterm query parameters to boost multiple keyterms.
8225
+
*/
8226
+
keyterm?: string;
8227
+
/**
8228
+
* Opts out requests from the Deepgram Model Improvement Program. Refer to Deepgram Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip
8229
+
*/
8230
+
mip_opt_out?: "true" | "false";
8231
+
/**
8232
+
* Label your requests for the purpose of identification during usage reporting
8233
+
*/
8234
+
tag?: string;
8235
+
}
8236
+
/**
8237
+
* Output will be returned as websocket messages.
8238
+
*/
8239
+
interface Ai_Cf_Deepgram_Flux_Output {
8240
+
/**
8241
+
* The unique identifier of the request (uuid)
8242
+
*/
8243
+
request_id?: string;
8244
+
/**
8245
+
* Starts at 0 and increments for each message the server sends to the client.
8246
+
*/
8247
+
sequence_id?: number;
8248
+
/**
8249
+
* The type of event being reported.
8250
+
*/
8251
+
event?: "Update" | "StartOfTurn" | "EagerEndOfTurn" | "TurnResumed" | "EndOfTurn";
8252
+
/**
8253
+
* The index of the current turn
8254
+
*/
8255
+
turn_index?: number;
8256
+
/**
8257
+
* Start time in seconds of the audio range that was transcribed
8258
+
*/
8259
+
audio_window_start?: number;
8260
+
/**
8261
+
* End time in seconds of the audio range that was transcribed
8262
+
*/
8263
+
audio_window_end?: number;
8264
+
/**
8265
+
* Text that was said over the course of the current turn
8266
+
*/
8267
+
transcript?: string;
8268
+
/**
8269
+
* The words in the transcript
8270
+
*/
8271
+
words?: {
8272
+
/**
8273
+
* The individual punctuated, properly-cased word from the transcript
8274
+
*/
8275
+
word: string;
8276
+
/**
8277
+
* Confidence that this word was transcribed correctly
8278
+
*/
8279
+
confidence: number;
8280
+
}[];
8281
+
/**
8282
+
* Confidence that no more speech is coming in this turn
8283
+
*/
8284
+
end_of_turn_confidence?: number;
8285
+
}
8286
+
declare abstract class Base_Ai_Cf_Deepgram_Flux {
8287
+
inputs: Ai_Cf_Deepgram_Flux_Input;
8288
+
postProcessedOutputs: Ai_Cf_Deepgram_Flux_Output;
8289
+
}
8290
+
interface Ai_Cf_Deepgram_Aura_2_En_Input {
8291
+
/**
8292
+
* Speaker used to produce the audio.
8293
+
*/
8294
+
speaker?: "amalthea" | "andromeda" | "apollo" | "arcas" | "aries" | "asteria" | "athena" | "atlas" | "aurora" | "callista" | "cora" | "cordelia" | "delia" | "draco" | "electra" | "harmonia" | "helena" | "hera" | "hermes" | "hyperion" | "iris" | "janus" | "juno" | "jupiter" | "luna" | "mars" | "minerva" | "neptune" | "odysseus" | "ophelia" | "orion" | "orpheus" | "pandora" | "phoebe" | "pluto" | "saturn" | "thalia" | "theia" | "vesta" | "zeus";
8295
+
/**
8296
+
* Encoding of the output audio.
8297
+
*/
8298
+
encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
8299
+
/**
8300
+
* Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
8301
+
*/
8302
+
container?: "none" | "wav" | "ogg";
8303
+
/**
8304
+
* The text content to be converted to speech
8305
+
*/
8306
+
text: string;
8307
+
/**
8308
+
* Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable
8309
+
*/
8310
+
sample_rate?: number;
8311
+
/**
8312
+
* The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
8313
+
*/
8314
+
bit_rate?: number;
8315
+
}
8316
+
/**
8317
+
* The generated audio in MP3 format
8318
+
*/
8319
+
type Ai_Cf_Deepgram_Aura_2_En_Output = string;
8320
+
declare abstract class Base_Ai_Cf_Deepgram_Aura_2_En {
8321
+
inputs: Ai_Cf_Deepgram_Aura_2_En_Input;
8322
+
postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_En_Output;
8323
+
}
8324
+
interface Ai_Cf_Deepgram_Aura_2_Es_Input {
8325
+
/**
8326
+
* Speaker used to produce the audio.
8327
+
*/
8328
+
speaker?: "sirio" | "nestor" | "carina" | "celeste" | "alvaro" | "diana" | "aquila" | "selena" | "estrella" | "javier";
8329
+
/**
8330
+
* Encoding of the output audio.
8331
+
*/
8332
+
encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
8333
+
/**
8334
+
* Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
8335
+
*/
8336
+
container?: "none" | "wav" | "ogg";
8337
+
/**
8338
+
* The text content to be converted to speech
8339
+
*/
8340
+
text: string;
8341
+
/**
8342
+
* Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable
8343
+
*/
8344
+
sample_rate?: number;
8345
+
/**
8346
+
* The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
8347
+
*/
8348
+
bit_rate?: number;
8349
+
}
8350
+
/**
8351
+
* The generated audio in MP3 format
8352
+
*/
8353
+
type Ai_Cf_Deepgram_Aura_2_Es_Output = string;
8354
+
declare abstract class Base_Ai_Cf_Deepgram_Aura_2_Es {
8355
+
inputs: Ai_Cf_Deepgram_Aura_2_Es_Input;
8356
+
postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_Es_Output;
8357
+
}
5141
8358
interface AiModels {
5142
8359
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5143
8360
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
···
5146
8363
"@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5147
8364
"@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5148
8365
"@cf/myshell-ai/melotts": BaseAiTextToSpeech;
8366
+
"@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
5149
8367
"@cf/microsoft/resnet-50": BaseAiImageClassification;
5150
-
"@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5151
8368
"@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5152
8369
"@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5153
8370
"@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
···
5181
8398
"@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
5182
8399
"@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5183
8400
"@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5184
-
"@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5185
-
"@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5186
8401
"@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5187
8402
"@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
5188
8403
"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
5189
8404
"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
5190
8405
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
8406
+
"@cf/ibm-granite/granite-4.0-h-micro": BaseAiTextGeneration;
5191
8407
"@cf/facebook/bart-large-cnn": BaseAiSummarization;
5192
8408
"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
5193
8409
"@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;
···
5209
8425
"@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
5210
8426
"@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
5211
8427
"@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
8428
+
"@cf/qwen/qwen3-30b-a3b-fp8": Base_Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8;
8429
+
"@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
8430
+
"@cf/qwen/qwen3-embedding-0.6b": Base_Ai_Cf_Qwen_Qwen3_Embedding_0_6B;
8431
+
"@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
8432
+
"@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
8433
+
"@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
8434
+
"@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
8435
+
"@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
8436
+
"@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
8437
+
"@cf/ai4bharat/indictrans2-en-indic-1B": Base_Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B;
8438
+
"@cf/aisingapore/gemma-sea-lion-v4-27b-it": Base_Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It;
8439
+
"@cf/pfnet/plamo-embedding-1b": Base_Ai_Cf_Pfnet_Plamo_Embedding_1B;
8440
+
"@cf/deepgram/flux": Base_Ai_Cf_Deepgram_Flux;
8441
+
"@cf/deepgram/aura-2-en": Base_Ai_Cf_Deepgram_Aura_2_En;
8442
+
"@cf/deepgram/aura-2-es": Base_Ai_Cf_Deepgram_Aura_2_Es;
5212
8443
}
5213
8444
type AiOptions = {
5214
8445
/**
···
5216
8447
* https://developers.cloudflare.com/workers-ai/features/batch-api
5217
8448
*/
5218
8449
queueRequest?: boolean;
8450
+
/**
8451
+
* Establish websocket connections, only works for supported models
8452
+
*/
8453
+
websocket?: boolean;
8454
+
/**
8455
+
* Tag your requests to group and view them in Cloudflare dashboard.
8456
+
*
8457
+
* Rules:
8458
+
* Tags must only contain letters, numbers, and the symbols: : - . / @
8459
+
* Each tag can have maximum 50 characters.
8460
+
* Maximum 5 tags are allowed each request.
8461
+
* Duplicate tags will removed.
8462
+
*/
8463
+
tags: string[];
5219
8464
gateway?: GatewayOptions;
5220
8465
returnRawResponse?: boolean;
5221
8466
prefix?: string;
5222
8467
extraHeaders?: object;
5223
-
};
5224
-
type ConversionResponse = {
5225
-
name: string;
5226
-
mimeType: string;
5227
-
format: "markdown";
5228
-
tokens: number;
5229
-
data: string;
5230
8468
};
5231
8469
type AiModelsSearchParams = {
5232
8470
author?: string;
···
5264
8502
autorag(autoragId: string): AutoRAG;
5265
8503
run<Name extends keyof AiModelList, Options extends AiOptions, InputOptions extends AiModelList[Name]["inputs"]>(model: Name, inputs: InputOptions, options?: Options): Promise<Options extends {
5266
8504
returnRawResponse: true;
8505
+
} | {
8506
+
websocket: true;
5267
8507
} ? Response : InputOptions extends {
5268
8508
stream: true;
5269
8509
} ? ReadableStream : AiModelList[Name]["postProcessedOutputs"]>;
5270
8510
models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
5271
-
toMarkdown(files: {
5272
-
name: string;
5273
-
blob: Blob;
5274
-
}[], options?: {
5275
-
gateway?: GatewayOptions;
5276
-
extraHeaders?: object;
5277
-
}): Promise<ConversionResponse[]>;
5278
-
toMarkdown(files: {
5279
-
name: string;
5280
-
blob: Blob;
5281
-
}, options?: {
5282
-
gateway?: GatewayOptions;
5283
-
extraHeaders?: object;
5284
-
}): Promise<ConversionResponse>;
8511
+
toMarkdown(): ToMarkdownService;
8512
+
toMarkdown(files: MarkdownDocument[], options?: ConversionRequestOptions): Promise<ConversionResponse[]>;
8513
+
toMarkdown(files: MarkdownDocument, options?: ConversionRequestOptions): Promise<ConversionResponse>;
5285
8514
}
5286
8515
type GatewayRetries = {
5287
8516
maxAttempts?: 1 | 2 | 3 | 4 | 5;
···
5299
8528
requestTimeoutMs?: number;
5300
8529
retries?: GatewayRetries;
5301
8530
};
8531
+
type UniversalGatewayOptions = Exclude<GatewayOptions, 'id'> & {
8532
+
/**
8533
+
** @deprecated
8534
+
*/
8535
+
id?: string;
8536
+
};
5302
8537
type AiGatewayPatchLog = {
5303
8538
score?: number | null;
5304
8539
feedback?: -1 | 1 | null;
···
5367
8602
patchLog(logId: string, data: AiGatewayPatchLog): Promise<void>;
5368
8603
getLog(logId: string): Promise<AiGatewayLog>;
5369
8604
run(data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[], options?: {
5370
-
gateway?: GatewayOptions;
8605
+
gateway?: UniversalGatewayOptions;
5371
8606
extraHeaders?: object;
5372
8607
}): Promise<Response>;
5373
8608
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
···
5397
8632
ranker?: string;
5398
8633
score_threshold?: number;
5399
8634
};
8635
+
reranking?: {
8636
+
enabled?: boolean;
8637
+
model?: string;
8638
+
};
5400
8639
rewrite_query?: boolean;
5401
8640
};
5402
8641
type AutoRagAiSearchRequest = AutoRagSearchRequest & {
5403
8642
stream?: boolean;
8643
+
system_prompt?: string;
5404
8644
};
5405
8645
type AutoRagAiSearchRequestStreaming = Omit<AutoRagAiSearchRequest, 'stream'> & {
5406
8646
stream: true;
···
5476
8716
* breaks aspect ratio
5477
8717
*/
5478
8718
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
8719
+
/**
8720
+
* Image segmentation using artificial intelligence models. Sets pixels not
8721
+
* within selected segment area to transparent e.g "foreground" sets every
8722
+
* background pixel as transparent.
8723
+
*/
8724
+
segment?: "foreground";
5479
8725
/**
5480
8726
* When cropping with fit: "cover", this defines the side or point that should
5481
8727
* be left uncropped. The value is either a string
···
5488
8734
* preserve as much as possible around a point at 20% of the height of the
5489
8735
* source image.
5490
8736
*/
5491
-
gravity?: 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | BasicImageTransformationsGravityCoordinates;
8737
+
gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | BasicImageTransformationsGravityCoordinates;
5492
8738
/**
5493
8739
* Background color to add underneath the image. Applies only to images with
5494
8740
* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
···
5775
9021
*
5776
9022
* @example 395747
5777
9023
*/
5778
-
asn: number;
9024
+
asn?: number;
5779
9025
/**
5780
9026
* The organization which owns the ASN of the incoming request.
5781
9027
*
5782
9028
* @example "Google Cloud"
5783
9029
*/
5784
-
asOrganization: string;
9030
+
asOrganization?: string;
5785
9031
/**
5786
9032
* The original value of the `Accept-Encoding` header if Cloudflare modified it.
5787
9033
*
···
5905
9151
* This field is only present if you have Cloudflare for SaaS enabled on your account
5906
9152
* and you have followed the [required steps to enable it]((https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/)).
5907
9153
*/
5908
-
hostMetadata: HostMetadata;
9154
+
hostMetadata?: HostMetadata;
5909
9155
}
5910
9156
interface IncomingRequestCfPropertiesCloudflareAccessOrApiShield {
5911
9157
/**
···
6192
9438
*/
6193
9439
sql_duration_ms: number;
6194
9440
};
9441
+
/**
9442
+
* Number of total attempts to execute the query, due to automatic retries.
9443
+
* Note: All other fields in the response like `timings` only apply to the last attempt.
9444
+
*/
9445
+
total_attempts?: number;
6195
9446
}
6196
9447
interface D1Response {
6197
9448
success: true;
···
6209
9460
// Indicates that the first query should go to the primary, and the rest queries
6210
9461
// using the same D1DatabaseSession will go to any replica that is consistent with
6211
9462
// the bookmark maintained by the session (returned by the first query).
6212
-
"first-primary"
9463
+
'first-primary'
6213
9464
// Indicates that the first query can go anywhere (primary or replica), and the rest queries
6214
9465
// using the same D1DatabaseSession will go to any replica that is consistent with
6215
9466
// the bookmark maintained by the session (returned by the first query).
6216
-
| "first-unconstrained";
9467
+
| 'first-unconstrained';
6217
9468
type D1SessionBookmark = string;
6218
9469
declare abstract class D1Database {
6219
9470
prepare(query: string): D1PreparedStatement;
···
6331
9582
};
6332
9583
export { _EmailMessage as EmailMessage };
6333
9584
}
9585
+
/**
9586
+
* Hello World binding to serve as an explanatory example. DO NOT USE
9587
+
*/
9588
+
interface HelloWorldBinding {
9589
+
/**
9590
+
* Retrieve the current stored value
9591
+
*/
9592
+
get(): Promise<{
9593
+
value: string;
9594
+
ms?: number;
9595
+
}>;
9596
+
/**
9597
+
* Set a new stored value
9598
+
*/
9599
+
set(value: string): Promise<void>;
9600
+
}
6334
9601
interface Hyperdrive {
6335
9602
/**
6336
9603
* Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
···
6408
9675
fit?: 'scale-down' | 'contain' | 'pad' | 'squeeze' | 'cover' | 'crop';
6409
9676
flip?: 'h' | 'v' | 'hv';
6410
9677
gamma?: number;
6411
-
gravity?: 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | {
9678
+
segment?: 'foreground';
9679
+
gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | {
6412
9680
x?: number;
6413
9681
y?: number;
6414
9682
mode: 'remainder' | 'box-center';
···
6416
9684
rotate?: 0 | 90 | 180 | 270;
6417
9685
saturation?: number;
6418
9686
sharpen?: number;
6419
-
trim?: "border" | {
9687
+
trim?: 'border' | {
6420
9688
top?: number;
6421
9689
bottom?: number;
6422
9690
left?: number;
···
6438
9706
bottom?: number;
6439
9707
right?: number;
6440
9708
};
9709
+
type ImageInputOptions = {
9710
+
encoding?: 'base64';
9711
+
};
6441
9712
type ImageOutputOptions = {
6442
9713
format: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/avif' | 'rgb' | 'rgba';
6443
9714
quality?: number;
6444
9715
background?: string;
9716
+
anim?: boolean;
6445
9717
};
6446
9718
interface ImagesBinding {
6447
9719
/**
···
6449
9721
* @throws {@link ImagesError} with code 9412 if input is not an image
6450
9722
* @param stream The image bytes
6451
9723
*/
6452
-
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
9724
+
info(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): Promise<ImageInfoResponse>;
6453
9725
/**
6454
9726
* Begin applying a series of transformations to an image
6455
9727
* @param stream The image bytes
6456
9728
* @returns A transform handle
6457
9729
*/
6458
-
input(stream: ReadableStream<Uint8Array>): ImageTransformer;
9730
+
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
6459
9731
}
6460
9732
interface ImageTransformer {
6461
9733
/**
···
6478
9750
*/
6479
9751
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
6480
9752
}
9753
+
type ImageTransformationOutputOptions = {
9754
+
encoding?: 'base64';
9755
+
};
6481
9756
interface ImageTransformationResult {
6482
9757
/**
6483
9758
* The image as a response, ready to store in cache or return to users
···
6490
9765
/**
6491
9766
* The bytes of the response
6492
9767
*/
6493
-
image(): ReadableStream<Uint8Array>;
9768
+
image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array>;
6494
9769
}
6495
9770
interface ImagesError extends Error {
6496
9771
readonly code: number;
6497
9772
readonly message: string;
6498
9773
readonly stack?: string;
6499
9774
}
9775
+
/**
9776
+
* Media binding for transforming media streams.
9777
+
* Provides the entry point for media transformation operations.
9778
+
*/
9779
+
interface MediaBinding {
9780
+
/**
9781
+
* Creates a media transformer from an input stream.
9782
+
* @param media - The input media bytes
9783
+
* @returns A MediaTransformer instance for applying transformations
9784
+
*/
9785
+
input(media: ReadableStream<Uint8Array>): MediaTransformer;
9786
+
}
9787
+
/**
9788
+
* Media transformer for applying transformation operations to media content.
9789
+
* Handles sizing, fitting, and other input transformation parameters.
9790
+
*/
9791
+
interface MediaTransformer {
9792
+
/**
9793
+
* Applies transformation options to the media content.
9794
+
* @param transform - Configuration for how the media should be transformed
9795
+
* @returns A generator for producing the transformed media output
9796
+
*/
9797
+
transform(transform: MediaTransformationInputOptions): MediaTransformationGenerator;
9798
+
}
9799
+
/**
9800
+
* Generator for producing media transformation results.
9801
+
* Configures the output format and parameters for the transformed media.
9802
+
*/
9803
+
interface MediaTransformationGenerator {
9804
+
/**
9805
+
* Generates the final media output with specified options.
9806
+
* @param output - Configuration for the output format and parameters
9807
+
* @returns The final transformation result containing the transformed media
9808
+
*/
9809
+
output(output: MediaTransformationOutputOptions): MediaTransformationResult;
9810
+
}
9811
+
/**
9812
+
* Result of a media transformation operation.
9813
+
* Provides multiple ways to access the transformed media content.
9814
+
*/
9815
+
interface MediaTransformationResult {
9816
+
/**
9817
+
* Returns the transformed media as a readable stream of bytes.
9818
+
* @returns A stream containing the transformed media data
9819
+
*/
9820
+
media(): ReadableStream<Uint8Array>;
9821
+
/**
9822
+
* Returns the transformed media as an HTTP response object.
9823
+
* @returns The transformed media as a Response, ready to store in cache or return to users
9824
+
*/
9825
+
response(): Response;
9826
+
/**
9827
+
* Returns the MIME type of the transformed media.
9828
+
* @returns The content type string (e.g., 'image/jpeg', 'video/mp4')
9829
+
*/
9830
+
contentType(): string;
9831
+
}
9832
+
/**
9833
+
* Configuration options for transforming media input.
9834
+
* Controls how the media should be resized and fitted.
9835
+
*/
9836
+
type MediaTransformationInputOptions = {
9837
+
/** How the media should be resized to fit the specified dimensions */
9838
+
fit?: 'contain' | 'cover' | 'scale-down';
9839
+
/** Target width in pixels */
9840
+
width?: number;
9841
+
/** Target height in pixels */
9842
+
height?: number;
9843
+
};
9844
+
/**
9845
+
* Configuration options for Media Transformations output.
9846
+
* Controls the format, timing, and type of the generated output.
9847
+
*/
9848
+
type MediaTransformationOutputOptions = {
9849
+
/**
9850
+
* Output mode determining the type of media to generate
9851
+
*/
9852
+
mode?: 'video' | 'spritesheet' | 'frame' | 'audio';
9853
+
/** Whether to include audio in the output */
9854
+
audio?: boolean;
9855
+
/**
9856
+
* Starting timestamp for frame extraction or start time for clips. (e.g. '2s').
9857
+
*/
9858
+
time?: string;
9859
+
/**
9860
+
* Duration for video clips, audio extraction, and spritesheet generation (e.g. '5s').
9861
+
*/
9862
+
duration?: string;
9863
+
/**
9864
+
* Number of frames in the spritesheet.
9865
+
*/
9866
+
imageCount?: number;
9867
+
/**
9868
+
* Output format for the generated media.
9869
+
*/
9870
+
format?: 'jpg' | 'png' | 'm4a';
9871
+
};
9872
+
/**
9873
+
* Error object for media transformation operations.
9874
+
* Extends the standard Error interface with additional media-specific information.
9875
+
*/
9876
+
interface MediaError extends Error {
9877
+
readonly code: number;
9878
+
readonly message: string;
9879
+
readonly stack?: string;
9880
+
}
9881
+
declare module 'cloudflare:node' {
9882
+
interface NodeStyleServer {
9883
+
listen(...args: unknown[]): this;
9884
+
address(): {
9885
+
port?: number | null | undefined;
9886
+
};
9887
+
}
9888
+
export function httpServerHandler(port: number): ExportedHandler;
9889
+
export function httpServerHandler(options: {
9890
+
port: number;
9891
+
}): ExportedHandler;
9892
+
export function httpServerHandler(server: NodeStyleServer): ExportedHandler;
9893
+
}
6500
9894
type Params<P extends string = any> = Record<P, string | string[]>;
6501
9895
type EventContext<Env, P extends string, Data> = {
6502
9896
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
···
6707
10101
// Base type for all other types providing RPC-like interfaces.
6708
10102
// Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
6709
10103
// `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
6710
-
export type Provider<T extends object, Reserved extends string = never> = MaybeCallableProvider<T> & {
6711
-
[K in Exclude<keyof T, Reserved | symbol | keyof StubBase<never>>]: MethodOrProperty<T[K]>;
6712
-
};
10104
+
export type Provider<T extends object, Reserved extends string = never> = MaybeCallableProvider<T> & Pick<{
10105
+
[K in keyof T]: MethodOrProperty<T[K]>;
10106
+
}, Exclude<keyof T, Reserved | symbol | keyof StubBase<never>>>;
6713
10107
}
6714
10108
declare namespace Cloudflare {
10109
+
// Type of `env`.
10110
+
//
10111
+
// The specific project can extend `Env` by redeclaring it in project-specific files. Typescript
10112
+
// will merge all declarations.
10113
+
//
10114
+
// You can use `wrangler types` to generate the `Env` type automatically.
6715
10115
interface Env {
6716
10116
}
10117
+
// Project-specific parameters used to inform types.
10118
+
//
10119
+
// This interface is, again, intended to be declared in project-specific files, and then that
10120
+
// declaration will be merged with this one.
10121
+
//
10122
+
// A project should have a declaration like this:
10123
+
//
10124
+
// interface GlobalProps {
10125
+
// // Declares the main module's exports. Used to populate Cloudflare.Exports aka the type
10126
+
// // of `ctx.exports`.
10127
+
// mainModule: typeof import("my-main-module");
10128
+
//
10129
+
// // Declares which of the main module's exports are configured with durable storage, and
10130
+
// // thus should behave as Durable Object namsepace bindings.
10131
+
// durableNamespaces: "MyDurableObject" | "AnotherDurableObject";
10132
+
// }
10133
+
//
10134
+
// You can use `wrangler types` to generate `GlobalProps` automatically.
10135
+
interface GlobalProps {
10136
+
}
10137
+
// Evaluates to the type of a property in GlobalProps, defaulting to `Default` if it is not
10138
+
// present.
10139
+
type GlobalProp<K extends string, Default> = K extends keyof GlobalProps ? GlobalProps[K] : Default;
10140
+
// The type of the program's main module exports, if known. Requires `GlobalProps` to declare the
10141
+
// `mainModule` property.
10142
+
type MainModule = GlobalProp<"mainModule", {}>;
10143
+
// The type of ctx.exports, which contains loopback bindings for all top-level exports.
10144
+
type Exports = {
10145
+
[K in keyof MainModule]: LoopbackForExport<MainModule[K]>
10146
+
// If the export is listed in `durableNamespaces`, then it is also a
10147
+
// DurableObjectNamespace.
10148
+
& (K extends GlobalProp<"durableNamespaces", never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace<DoInstance> : DurableObjectNamespace<undefined> : DurableObjectNamespace<undefined> : {});
10149
+
};
6717
10150
}
6718
-
declare module 'cloudflare:workers' {
10151
+
declare namespace CloudflareWorkersModule {
6719
10152
export type RpcStub<T extends Rpc.Stubable> = Rpc.Stub<T>;
6720
10153
export const RpcStub: {
6721
10154
new <T extends Rpc.Stubable>(value: T): Rpc.Stub<T>;
···
6724
10157
[Rpc.__RPC_TARGET_BRAND]: never;
6725
10158
}
6726
10159
// `protected` fields don't appear in `keyof`s, so can't be accessed over RPC
6727
-
export abstract class WorkerEntrypoint<Env = unknown> implements Rpc.WorkerEntrypointBranded {
10160
+
export abstract class WorkerEntrypoint<Env = Cloudflare.Env, Props = {}> implements Rpc.WorkerEntrypointBranded {
6728
10161
[Rpc.__WORKER_ENTRYPOINT_BRAND]: never;
6729
-
protected ctx: ExecutionContext;
10162
+
protected ctx: ExecutionContext<Props>;
6730
10163
protected env: Env;
6731
10164
constructor(ctx: ExecutionContext, env: Env);
10165
+
email?(message: ForwardableEmailMessage): void | Promise<void>;
6732
10166
fetch?(request: Request): Response | Promise<Response>;
6733
-
tail?(events: TraceItem[]): void | Promise<void>;
6734
-
trace?(traces: TraceItem[]): void | Promise<void>;
6735
-
scheduled?(controller: ScheduledController): void | Promise<void>;
6736
10167
queue?(batch: MessageBatch<unknown>): void | Promise<void>;
10168
+
scheduled?(controller: ScheduledController): void | Promise<void>;
10169
+
tail?(events: TraceItem[]): void | Promise<void>;
10170
+
tailStream?(event: TailStream.TailEvent<TailStream.Onset>): TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
6737
10171
test?(controller: TestController): void | Promise<void>;
10172
+
trace?(traces: TraceItem[]): void | Promise<void>;
6738
10173
}
6739
-
export abstract class DurableObject<Env = unknown> implements Rpc.DurableObjectBranded {
10174
+
export abstract class DurableObject<Env = Cloudflare.Env, Props = {}> implements Rpc.DurableObjectBranded {
6740
10175
[Rpc.__DURABLE_OBJECT_BRAND]: never;
6741
-
protected ctx: DurableObjectState;
10176
+
protected ctx: DurableObjectState<Props>;
6742
10177
protected env: Env;
6743
10178
constructor(ctx: DurableObjectState, env: Env);
6744
-
fetch?(request: Request): Response | Promise<Response>;
6745
10179
alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
10180
+
fetch?(request: Request): Response | Promise<Response>;
6746
10181
webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>;
6747
10182
webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>;
6748
10183
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
···
6788
10223
constructor(ctx: ExecutionContext, env: Env);
6789
10224
run(event: Readonly<WorkflowEvent<T>>, step: WorkflowStep): Promise<unknown>;
6790
10225
}
10226
+
export function waitUntil(promise: Promise<unknown>): void;
10227
+
export function withEnv(newEnv: unknown, fn: () => unknown): unknown;
10228
+
export function withExports(newExports: unknown, fn: () => unknown): unknown;
10229
+
export function withEnvAndExports(newEnv: unknown, newExports: unknown, fn: () => unknown): unknown;
6791
10230
export const env: Cloudflare.Env;
10231
+
export const exports: Cloudflare.Exports;
10232
+
}
10233
+
declare module 'cloudflare:workers' {
10234
+
export = CloudflareWorkersModule;
6792
10235
}
6793
10236
interface SecretsStoreSecret {
6794
10237
/**
···
6801
10244
function _connect(address: string | SocketAddress, options?: SocketOptions): Socket;
6802
10245
export { _connect as connect };
6803
10246
}
10247
+
type MarkdownDocument = {
10248
+
name: string;
10249
+
blob: Blob;
10250
+
};
10251
+
type ConversionResponse = {
10252
+
name: string;
10253
+
mimeType: string;
10254
+
format: 'markdown';
10255
+
tokens: number;
10256
+
data: string;
10257
+
} | {
10258
+
name: string;
10259
+
mimeType: string;
10260
+
format: 'error';
10261
+
error: string;
10262
+
};
10263
+
type ImageConversionOptions = {
10264
+
descriptionLanguage?: 'en' | 'es' | 'fr' | 'it' | 'pt' | 'de';
10265
+
};
10266
+
type EmbeddedImageConversionOptions = ImageConversionOptions & {
10267
+
convert?: boolean;
10268
+
maxConvertedImages?: number;
10269
+
};
10270
+
type ConversionOptions = {
10271
+
html?: {
10272
+
images?: EmbeddedImageConversionOptions & {
10273
+
convertOGImage?: boolean;
10274
+
};
10275
+
};
10276
+
docx?: {
10277
+
images?: EmbeddedImageConversionOptions;
10278
+
};
10279
+
image?: ImageConversionOptions;
10280
+
pdf?: {
10281
+
images?: EmbeddedImageConversionOptions;
10282
+
metadata?: boolean;
10283
+
};
10284
+
};
10285
+
type ConversionRequestOptions = {
10286
+
gateway?: GatewayOptions;
10287
+
extraHeaders?: object;
10288
+
conversionOptions?: ConversionOptions;
10289
+
};
10290
+
type SupportedFileFormat = {
10291
+
mimeType: string;
10292
+
extension: string;
10293
+
};
10294
+
declare abstract class ToMarkdownService {
10295
+
transform(files: MarkdownDocument[], options?: ConversionRequestOptions): Promise<ConversionResponse[]>;
10296
+
transform(files: MarkdownDocument, options?: ConversionRequestOptions): Promise<ConversionResponse>;
10297
+
supported(): Promise<SupportedFileFormat[]>;
10298
+
}
6804
10299
declare namespace TailStream {
6805
10300
interface Header {
6806
10301
readonly name: string;
···
6810
10305
readonly type: "fetch";
6811
10306
readonly method: string;
6812
10307
readonly url: string;
6813
-
readonly cfJson: string;
10308
+
readonly cfJson?: object;
6814
10309
readonly headers: Header[];
6815
10310
}
6816
10311
interface JsRpcEventInfo {
6817
10312
readonly type: "jsrpc";
6818
-
readonly methodName: string;
6819
10313
}
6820
10314
interface ScheduledEventInfo {
6821
10315
readonly type: "scheduled";
···
6856
10350
readonly type: "hibernatableWebSocket";
6857
10351
readonly info: HibernatableWebSocketEventInfoClose | HibernatableWebSocketEventInfoError | HibernatableWebSocketEventInfoMessage;
6858
10352
}
6859
-
interface Resume {
6860
-
readonly type: "resume";
6861
-
readonly attachment?: any;
6862
-
}
6863
10353
interface CustomEventInfo {
6864
10354
readonly type: "custom";
6865
10355
}
···
6873
10363
readonly tag?: string;
6874
10364
readonly message?: string;
6875
10365
}
6876
-
interface Trigger {
6877
-
readonly traceId: string;
6878
-
readonly invocationId: string;
6879
-
readonly spanId: string;
6880
-
}
6881
10366
interface Onset {
6882
10367
readonly type: "onset";
10368
+
readonly attributes: Attribute[];
10369
+
// id for the span being opened by this Onset event.
10370
+
readonly spanId: string;
6883
10371
readonly dispatchNamespace?: string;
6884
10372
readonly entrypoint?: string;
6885
10373
readonly executionModel: string;
6886
10374
readonly scriptName?: string;
6887
10375
readonly scriptTags?: string[];
6888
10376
readonly scriptVersion?: ScriptVersion;
6889
-
readonly trigger?: Trigger;
6890
-
readonly info: FetchEventInfo | JsRpcEventInfo | ScheduledEventInfo | AlarmEventInfo | QueueEventInfo | EmailEventInfo | TraceEventInfo | HibernatableWebSocketEventInfo | Resume | CustomEventInfo;
10377
+
readonly info: FetchEventInfo | JsRpcEventInfo | ScheduledEventInfo | AlarmEventInfo | QueueEventInfo | EmailEventInfo | TraceEventInfo | HibernatableWebSocketEventInfo | CustomEventInfo;
6891
10378
}
6892
10379
interface Outcome {
6893
10380
readonly type: "outcome";
···
6895
10382
readonly cpuTime: number;
6896
10383
readonly wallTime: number;
6897
10384
}
6898
-
interface Hibernate {
6899
-
readonly type: "hibernate";
6900
-
}
6901
10385
interface SpanOpen {
6902
10386
readonly type: "spanOpen";
6903
10387
readonly name: string;
10388
+
// id for the span being opened by this SpanOpen event.
10389
+
readonly spanId: string;
6904
10390
readonly info?: FetchEventInfo | JsRpcEventInfo | Attributes;
6905
10391
}
6906
10392
interface SpanClose {
···
6921
10407
interface Log {
6922
10408
readonly type: "log";
6923
10409
readonly level: "debug" | "error" | "info" | "log" | "warn";
6924
-
readonly message: string;
10410
+
readonly message: object;
6925
10411
}
10412
+
// This marks the worker handler return information.
10413
+
// This is separate from Outcome because the worker invocation can live for a long time after
10414
+
// returning. For example - Websockets that return an http upgrade response but then continue
10415
+
// streaming information or SSE http connections.
6926
10416
interface Return {
6927
10417
readonly type: "return";
6928
10418
readonly info?: FetchResponseInfo;
6929
10419
}
6930
-
interface Link {
6931
-
readonly type: "link";
6932
-
readonly label?: string;
6933
-
readonly traceId: string;
6934
-
readonly invocationId: string;
6935
-
readonly spanId: string;
6936
-
}
6937
10420
interface Attribute {
6938
10421
readonly name: string;
6939
10422
readonly value: string | string[] | boolean | boolean[] | number | number[] | bigint | bigint[];
···
6942
10425
readonly type: "attributes";
6943
10426
readonly info: Attribute[];
6944
10427
}
6945
-
interface TailEvent {
10428
+
type EventType = Onset | Outcome | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | Return | Attributes;
10429
+
// Context in which this trace event lives.
10430
+
interface SpanContext {
10431
+
// Single id for the entire top-level invocation
10432
+
// This should be a new traceId for the first worker stage invoked in the eyeball request and then
10433
+
// same-account service-bindings should reuse the same traceId but cross-account service-bindings
10434
+
// should use a new traceId.
6946
10435
readonly traceId: string;
10436
+
// spanId in which this event is handled
10437
+
// for Onset and SpanOpen events this would be the parent span id
10438
+
// for Outcome and SpanClose these this would be the span id of the opening Onset and SpanOpen events
10439
+
// For Hibernate and Mark this would be the span under which they were emitted.
10440
+
// spanId is not set ONLY if:
10441
+
// 1. This is an Onset event
10442
+
// 2. We are not inherting any SpanContext. (e.g. this is a cross-account service binding or a new top-level invocation)
10443
+
readonly spanId?: string;
10444
+
}
10445
+
interface TailEvent<Event extends EventType> {
10446
+
// invocation id of the currently invoked worker stage.
10447
+
// invocation id will always be unique to every Onset event and will be the same until the Outcome event.
6947
10448
readonly invocationId: string;
6948
-
readonly spanId: string;
10449
+
// Inherited spanContext for this event.
10450
+
readonly spanContext: SpanContext;
6949
10451
readonly timestamp: Date;
6950
10452
readonly sequence: number;
6951
-
readonly event: Onset | Outcome | Hibernate | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | Return | Link | Attributes;
10453
+
readonly event: Event;
6952
10454
}
6953
-
type TailEventHandler = (event: TailEvent) => void | Promise<void>;
6954
-
type TailEventHandlerName = "outcome" | "hibernate" | "spanOpen" | "spanClose" | "diagnosticChannel" | "exception" | "log" | "return" | "link" | "attributes";
6955
-
type TailEventHandlerObject = Record<TailEventHandlerName, TailEventHandler>;
10455
+
type TailEventHandler<Event extends EventType = EventType> = (event: TailEvent<Event>) => void | Promise<void>;
10456
+
type TailEventHandlerObject = {
10457
+
outcome?: TailEventHandler<Outcome>;
10458
+
spanOpen?: TailEventHandler<SpanOpen>;
10459
+
spanClose?: TailEventHandler<SpanClose>;
10460
+
diagnosticChannel?: TailEventHandler<DiagnosticChannelEvent>;
10461
+
exception?: TailEventHandler<Exception>;
10462
+
log?: TailEventHandler<Log>;
10463
+
return?: TailEventHandler<Return>;
10464
+
attributes?: TailEventHandler<Attributes>;
10465
+
};
6956
10466
type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;
6957
10467
}
6958
10468
// Copyright (c) 2022-2023 Cloudflare, Inc.
···
6976
10486
*
6977
10487
* This list is expected to grow as support for more operations are released.
6978
10488
*/
6979
-
type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
10489
+
type VectorizeVectorMetadataFilterOp = '$eq' | '$ne' | '$lt' | '$lte' | '$gt' | '$gte';
10490
+
type VectorizeVectorMetadataFilterCollectionOp = '$in' | '$nin';
6980
10491
/**
6981
10492
* Filter criteria for vector metadata used to limit the retrieved query result set.
6982
10493
*/
6983
10494
type VectorizeVectorMetadataFilter = {
6984
10495
[field: string]: Exclude<VectorizeVectorMetadataValue, string[]> | null | {
6985
10496
[Op in VectorizeVectorMetadataFilterOp]?: Exclude<VectorizeVectorMetadataValue, string[]> | null;
10497
+
} | {
10498
+
[Op in VectorizeVectorMetadataFilterCollectionOp]?: Exclude<VectorizeVectorMetadataValue, string[]>[];
6986
10499
};
6987
10500
};
6988
10501
/**
···
7292
10805
| 'complete' | 'waiting' // instance is hibernating and waiting for sleep or event to finish
7293
10806
| 'waitingForPause' // instance is finishing the current work to pause
7294
10807
| 'unknown';
7295
-
error?: string;
7296
-
output?: object;
10808
+
error?: {
10809
+
name: string;
10810
+
message: string;
10811
+
};
10812
+
output?: unknown;
7297
10813
};
7298
10814
interface WorkflowError {
7299
10815
code?: number;