@cloudflare/workers-types 0.20240405.1 → 0.20250124.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2021-11-03/index.d.ts +2593 -739
- package/2021-11-03/index.ts +2321 -505
- package/2022-01-31/index.d.ts +2610 -756
- package/2022-01-31/index.ts +2338 -522
- package/2022-03-21/index.d.ts +2616 -763
- package/2022-03-21/index.ts +2344 -529
- package/2022-08-04/index.d.ts +2616 -763
- package/2022-08-04/index.ts +2344 -529
- package/2022-10-31/index.d.ts +2621 -764
- package/2022-10-31/index.ts +2349 -530
- package/2022-11-30/index.d.ts +2620 -754
- package/2022-11-30/index.ts +2353 -525
- package/2023-03-01/index.d.ts +2621 -754
- package/2023-03-01/index.ts +2354 -525
- package/2023-07-01/index.d.ts +2621 -754
- package/2023-07-01/index.ts +2354 -525
- package/experimental/index.d.ts +2639 -762
- package/experimental/index.ts +2367 -528
- package/index.d.ts +2593 -739
- package/index.ts +2321 -505
- package/oldest/index.d.ts +2593 -739
- package/oldest/index.ts +2321 -505
- package/package.json +1 -1
package/2023-07-01/index.ts
CHANGED
|
@@ -14,11 +14,17 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
// noinspection JSUnusedGlobalSymbols
|
|
17
|
+
export declare var onmessage: never;
|
|
18
|
+
/**
|
|
19
|
+
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
|
|
20
|
+
*
|
|
21
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
|
22
|
+
*/
|
|
17
23
|
export declare class DOMException extends Error {
|
|
18
24
|
constructor(message?: string, name?: string);
|
|
19
|
-
|
|
25
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
|
|
20
26
|
readonly message: string;
|
|
21
|
-
|
|
27
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
|
|
22
28
|
readonly name: string;
|
|
23
29
|
/**
|
|
24
30
|
* @deprecated
|
|
@@ -26,7 +32,6 @@ export declare class DOMException extends Error {
|
|
|
26
32
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
|
27
33
|
*/
|
|
28
34
|
readonly code: number;
|
|
29
|
-
readonly stack: any;
|
|
30
35
|
static readonly INDEX_SIZE_ERR: number;
|
|
31
36
|
static readonly DOMSTRING_SIZE_ERR: number;
|
|
32
37
|
static readonly HIERARCHY_REQUEST_ERR: number;
|
|
@@ -52,6 +57,8 @@ export declare class DOMException extends Error {
|
|
|
52
57
|
static readonly TIMEOUT_ERR: number;
|
|
53
58
|
static readonly INVALID_NODE_TYPE_ERR: number;
|
|
54
59
|
static readonly DATA_CLONE_ERR: number;
|
|
60
|
+
get stack(): any;
|
|
61
|
+
set stack(value: any);
|
|
55
62
|
}
|
|
56
63
|
export type WorkerGlobalScopeEventMap = {
|
|
57
64
|
fetch: FetchEvent;
|
|
@@ -63,45 +70,45 @@ export type WorkerGlobalScopeEventMap = {
|
|
|
63
70
|
export declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
|
|
64
71
|
EventTarget: typeof EventTarget;
|
|
65
72
|
}
|
|
66
|
-
|
|
73
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
|
|
67
74
|
export interface Console {
|
|
68
75
|
"assert"(condition?: boolean, ...data: any[]): void;
|
|
69
|
-
|
|
76
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
|
|
70
77
|
clear(): void;
|
|
71
|
-
|
|
78
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
|
|
72
79
|
count(label?: string): void;
|
|
73
|
-
|
|
80
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
|
|
74
81
|
countReset(label?: string): void;
|
|
75
|
-
|
|
82
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
|
|
76
83
|
debug(...data: any[]): void;
|
|
77
|
-
|
|
84
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
|
|
78
85
|
dir(item?: any, options?: any): void;
|
|
79
|
-
|
|
86
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
|
|
80
87
|
dirxml(...data: any[]): void;
|
|
81
|
-
|
|
88
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
|
|
82
89
|
error(...data: any[]): void;
|
|
83
|
-
|
|
90
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
|
|
84
91
|
group(...data: any[]): void;
|
|
85
|
-
|
|
92
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
|
|
86
93
|
groupCollapsed(...data: any[]): void;
|
|
87
|
-
|
|
94
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
|
|
88
95
|
groupEnd(): void;
|
|
89
|
-
|
|
96
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
|
|
90
97
|
info(...data: any[]): void;
|
|
91
|
-
|
|
98
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
|
|
92
99
|
log(...data: any[]): void;
|
|
93
|
-
|
|
100
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
|
|
94
101
|
table(tabularData?: any, properties?: string[]): void;
|
|
95
|
-
|
|
102
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
|
|
96
103
|
time(label?: string): void;
|
|
97
|
-
|
|
104
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
|
|
98
105
|
timeEnd(label?: string): void;
|
|
99
|
-
|
|
106
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
|
|
100
107
|
timeLog(label?: string, ...data: any[]): void;
|
|
101
108
|
timeStamp(label?: string): void;
|
|
102
|
-
|
|
109
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
|
|
103
110
|
trace(...data: any[]): void;
|
|
104
|
-
|
|
111
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
|
|
105
112
|
warn(...data: any[]): void;
|
|
106
113
|
}
|
|
107
114
|
export declare const console: Console;
|
|
@@ -194,6 +201,7 @@ export declare namespace WebAssembly {
|
|
|
194
201
|
}
|
|
195
202
|
/**
|
|
196
203
|
* This ServiceWorker API interface represents the global execution context of a service worker.
|
|
204
|
+
* Available only in secure contexts.
|
|
197
205
|
*
|
|
198
206
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
|
|
199
207
|
*/
|
|
@@ -218,8 +226,9 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
218
226
|
clearInterval(timeoutId: number | null): void;
|
|
219
227
|
queueMicrotask(task: Function): void;
|
|
220
228
|
structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
|
|
229
|
+
reportError(error: any): void;
|
|
221
230
|
fetch(
|
|
222
|
-
input: RequestInfo,
|
|
231
|
+
input: RequestInfo | URL,
|
|
223
232
|
init?: RequestInit<RequestInitCfProperties>,
|
|
224
233
|
): Promise<Response>;
|
|
225
234
|
self: ServiceWorkerGlobalScope;
|
|
@@ -227,6 +236,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
227
236
|
caches: CacheStorage;
|
|
228
237
|
scheduler: Scheduler;
|
|
229
238
|
performance: Performance;
|
|
239
|
+
Cloudflare: Cloudflare;
|
|
230
240
|
readonly origin: string;
|
|
231
241
|
Event: typeof Event;
|
|
232
242
|
ExtendableEvent: typeof ExtendableEvent;
|
|
@@ -246,10 +256,13 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
246
256
|
TransformStream: typeof TransformStream;
|
|
247
257
|
ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
|
|
248
258
|
CountQueuingStrategy: typeof CountQueuingStrategy;
|
|
259
|
+
ErrorEvent: typeof ErrorEvent;
|
|
260
|
+
EventSource: typeof EventSource;
|
|
249
261
|
ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
|
|
250
262
|
ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
|
|
251
263
|
ReadableByteStreamController: typeof ReadableByteStreamController;
|
|
252
264
|
WritableStreamDefaultController: typeof WritableStreamDefaultController;
|
|
265
|
+
TransformStreamDefaultController: typeof TransformStreamDefaultController;
|
|
253
266
|
CompressionStream: typeof CompressionStream;
|
|
254
267
|
DecompressionStream: typeof DecompressionStream;
|
|
255
268
|
TextEncoderStream: typeof TextEncoderStream;
|
|
@@ -281,16 +294,16 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
281
294
|
FixedLengthStream: typeof FixedLengthStream;
|
|
282
295
|
IdentityTransformStream: typeof IdentityTransformStream;
|
|
283
296
|
HTMLRewriter: typeof HTMLRewriter;
|
|
284
|
-
GPUAdapter: typeof
|
|
285
|
-
GPUOutOfMemoryError: typeof
|
|
286
|
-
GPUValidationError: typeof
|
|
287
|
-
GPUInternalError: typeof
|
|
288
|
-
GPUDeviceLostInfo: typeof
|
|
289
|
-
GPUBufferUsage: typeof
|
|
290
|
-
GPUShaderStage: typeof
|
|
291
|
-
GPUMapMode: typeof
|
|
292
|
-
GPUTextureUsage: typeof
|
|
293
|
-
GPUColorWrite: typeof
|
|
297
|
+
GPUAdapter: typeof GPUAdapter;
|
|
298
|
+
GPUOutOfMemoryError: typeof GPUOutOfMemoryError;
|
|
299
|
+
GPUValidationError: typeof GPUValidationError;
|
|
300
|
+
GPUInternalError: typeof GPUInternalError;
|
|
301
|
+
GPUDeviceLostInfo: typeof GPUDeviceLostInfo;
|
|
302
|
+
GPUBufferUsage: typeof GPUBufferUsage;
|
|
303
|
+
GPUShaderStage: typeof GPUShaderStage;
|
|
304
|
+
GPUMapMode: typeof GPUMapMode;
|
|
305
|
+
GPUTextureUsage: typeof GPUTextureUsage;
|
|
306
|
+
GPUColorWrite: typeof GPUColorWrite;
|
|
294
307
|
}
|
|
295
308
|
export declare function addEventListener<
|
|
296
309
|
Type extends keyof WorkerGlobalScopeEventMap,
|
|
@@ -314,59 +327,82 @@ export declare function removeEventListener<
|
|
|
314
327
|
export declare function dispatchEvent(
|
|
315
328
|
event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
|
|
316
329
|
): boolean;
|
|
317
|
-
|
|
330
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
|
|
318
331
|
export declare function btoa(data: string): string;
|
|
319
|
-
|
|
332
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
|
320
333
|
export declare function atob(data: string): string;
|
|
321
|
-
|
|
334
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
322
335
|
export declare function setTimeout(
|
|
323
336
|
callback: (...args: any[]) => void,
|
|
324
337
|
msDelay?: number,
|
|
325
338
|
): number;
|
|
326
|
-
|
|
339
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
|
|
327
340
|
export declare function setTimeout<Args extends any[]>(
|
|
328
341
|
callback: (...args: Args) => void,
|
|
329
342
|
msDelay?: number,
|
|
330
343
|
...args: Args
|
|
331
344
|
): number;
|
|
332
|
-
|
|
345
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
|
|
333
346
|
export declare function clearTimeout(timeoutId: number | null): void;
|
|
334
|
-
|
|
347
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
335
348
|
export declare function setInterval(
|
|
336
349
|
callback: (...args: any[]) => void,
|
|
337
350
|
msDelay?: number,
|
|
338
351
|
): number;
|
|
339
|
-
|
|
352
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
|
|
340
353
|
export declare function setInterval<Args extends any[]>(
|
|
341
354
|
callback: (...args: Args) => void,
|
|
342
355
|
msDelay?: number,
|
|
343
356
|
...args: Args
|
|
344
357
|
): number;
|
|
345
|
-
|
|
358
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
|
|
346
359
|
export declare function clearInterval(timeoutId: number | null): void;
|
|
347
|
-
|
|
360
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
|
|
348
361
|
export declare function queueMicrotask(task: Function): void;
|
|
349
|
-
|
|
362
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
|
|
350
363
|
export declare function structuredClone<T>(
|
|
351
364
|
value: T,
|
|
352
365
|
options?: StructuredSerializeOptions,
|
|
353
366
|
): T;
|
|
354
|
-
|
|
367
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/reportError) */
|
|
368
|
+
export declare function reportError(error: any): void;
|
|
369
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
|
|
355
370
|
export declare function fetch(
|
|
356
|
-
input: RequestInfo,
|
|
371
|
+
input: RequestInfo | URL,
|
|
357
372
|
init?: RequestInit<RequestInitCfProperties>,
|
|
358
373
|
): Promise<Response>;
|
|
359
374
|
export declare const self: ServiceWorkerGlobalScope;
|
|
375
|
+
/**
|
|
376
|
+
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
|
|
377
|
+
* The Workers runtime implements the full surface of this API, but with some differences in
|
|
378
|
+
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
|
|
379
|
+
* compared to those implemented in most browsers.
|
|
380
|
+
*
|
|
381
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
|
|
382
|
+
*/
|
|
360
383
|
export declare const crypto: Crypto;
|
|
384
|
+
/**
|
|
385
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
386
|
+
*
|
|
387
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
388
|
+
*/
|
|
361
389
|
export declare const caches: CacheStorage;
|
|
362
390
|
export declare const scheduler: Scheduler;
|
|
391
|
+
/**
|
|
392
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
393
|
+
* as well as timing of subrequests and other operations.
|
|
394
|
+
*
|
|
395
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
396
|
+
*/
|
|
363
397
|
export declare const performance: Performance;
|
|
398
|
+
export declare const Cloudflare: Cloudflare;
|
|
364
399
|
export declare const origin: string;
|
|
365
400
|
export declare const navigator: Navigator;
|
|
366
401
|
export interface TestController {}
|
|
367
402
|
export interface ExecutionContext {
|
|
368
403
|
waitUntil(promise: Promise<any>): void;
|
|
369
404
|
passThroughOnException(): void;
|
|
405
|
+
props: any;
|
|
370
406
|
}
|
|
371
407
|
export type ExportedHandlerFetchHandler<
|
|
372
408
|
Env = unknown,
|
|
@@ -386,6 +422,11 @@ export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
|
386
422
|
env: Env,
|
|
387
423
|
ctx: ExecutionContext,
|
|
388
424
|
) => void | Promise<void>;
|
|
425
|
+
export type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
426
|
+
event: TailStream.TailEvent,
|
|
427
|
+
env: Env,
|
|
428
|
+
ctx: ExecutionContext,
|
|
429
|
+
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
389
430
|
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
390
431
|
controller: ScheduledController,
|
|
391
432
|
env: Env,
|
|
@@ -409,6 +450,7 @@ export interface ExportedHandler<
|
|
|
409
450
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
410
451
|
tail?: ExportedHandlerTailHandler<Env>;
|
|
411
452
|
trace?: ExportedHandlerTraceHandler<Env>;
|
|
453
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
412
454
|
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
413
455
|
test?: ExportedHandlerTestHandler<Env>;
|
|
414
456
|
email?: EmailExportedHandler<Env>;
|
|
@@ -417,10 +459,11 @@ export interface ExportedHandler<
|
|
|
417
459
|
export interface StructuredSerializeOptions {
|
|
418
460
|
transfer?: any[];
|
|
419
461
|
}
|
|
462
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
|
|
420
463
|
export declare abstract class PromiseRejectionEvent extends Event {
|
|
421
|
-
|
|
464
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
|
|
422
465
|
readonly promise: Promise<any>;
|
|
423
|
-
|
|
466
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
|
|
424
467
|
readonly reason: any;
|
|
425
468
|
}
|
|
426
469
|
export declare abstract class Navigator {
|
|
@@ -431,30 +474,35 @@ export declare abstract class Navigator {
|
|
|
431
474
|
| string
|
|
432
475
|
| (ArrayBuffer | ArrayBufferView)
|
|
433
476
|
| Blob
|
|
477
|
+
| FormData
|
|
434
478
|
| URLSearchParams
|
|
435
|
-
|
|
|
479
|
+
| URLSearchParams,
|
|
436
480
|
): boolean;
|
|
437
481
|
readonly userAgent: string;
|
|
438
|
-
readonly gpu:
|
|
482
|
+
readonly gpu: GPU;
|
|
439
483
|
}
|
|
440
484
|
/**
|
|
441
|
-
*
|
|
485
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
486
|
+
* as well as timing of subrequests and other operations.
|
|
442
487
|
*
|
|
443
|
-
* [
|
|
488
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
444
489
|
*/
|
|
445
490
|
export interface Performance {
|
|
446
|
-
|
|
491
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
|
|
447
492
|
readonly timeOrigin: number;
|
|
448
|
-
|
|
493
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
449
494
|
now(): number;
|
|
450
495
|
}
|
|
451
496
|
export interface AlarmInvocationInfo {
|
|
452
497
|
readonly isRetry: boolean;
|
|
453
498
|
readonly retryCount: number;
|
|
454
499
|
}
|
|
500
|
+
export interface Cloudflare {
|
|
501
|
+
readonly compatibilityFlags: Record<string, boolean>;
|
|
502
|
+
}
|
|
455
503
|
export interface DurableObject {
|
|
456
504
|
fetch(request: Request): Response | Promise<Response>;
|
|
457
|
-
alarm?(): void | Promise<void>;
|
|
505
|
+
alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
|
|
458
506
|
webSocketMessage?(
|
|
459
507
|
ws: WebSocket,
|
|
460
508
|
message: string | ArrayBuffer,
|
|
@@ -527,6 +575,7 @@ export interface DurableObjectState {
|
|
|
527
575
|
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
|
528
576
|
getHibernatableWebSocketEventTimeout(): number | null;
|
|
529
577
|
getTags(ws: WebSocket): string[];
|
|
578
|
+
abort(reason?: string): void;
|
|
530
579
|
}
|
|
531
580
|
export interface DurableObjectTransaction {
|
|
532
581
|
get<T = unknown>(
|
|
@@ -593,7 +642,11 @@ export interface DurableObjectStorage {
|
|
|
593
642
|
): Promise<void>;
|
|
594
643
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
595
644
|
sync(): Promise<void>;
|
|
645
|
+
sql: SqlStorage;
|
|
596
646
|
transactionSync<T>(closure: () => T): T;
|
|
647
|
+
getCurrentBookmark(): Promise<string>;
|
|
648
|
+
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
|
649
|
+
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
|
597
650
|
}
|
|
598
651
|
export interface DurableObjectListOptions {
|
|
599
652
|
start?: string;
|
|
@@ -634,6 +687,11 @@ export interface AnalyticsEngineDataPoint {
|
|
|
634
687
|
doubles?: number[];
|
|
635
688
|
blobs?: ((ArrayBuffer | string) | null)[];
|
|
636
689
|
}
|
|
690
|
+
/**
|
|
691
|
+
* An event which takes place in the DOM.
|
|
692
|
+
*
|
|
693
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
|
|
694
|
+
*/
|
|
637
695
|
export declare class Event {
|
|
638
696
|
constructor(type: string, init?: EventInit);
|
|
639
697
|
/**
|
|
@@ -757,6 +815,11 @@ export interface EventListenerObject<EventType extends Event = Event> {
|
|
|
757
815
|
export type EventListenerOrEventListenerObject<
|
|
758
816
|
EventType extends Event = Event,
|
|
759
817
|
> = EventListener<EventType> | EventListenerObject<EventType>;
|
|
818
|
+
/**
|
|
819
|
+
* EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
|
|
820
|
+
*
|
|
821
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
|
|
822
|
+
*/
|
|
760
823
|
export declare class EventTarget<
|
|
761
824
|
EventMap extends Record<string, Event> = Record<string, Event>,
|
|
762
825
|
> {
|
|
@@ -812,6 +875,11 @@ export interface EventTargetAddEventListenerOptions {
|
|
|
812
875
|
export interface EventTargetHandlerObject {
|
|
813
876
|
handleEvent: (event: Event) => any | undefined;
|
|
814
877
|
}
|
|
878
|
+
/**
|
|
879
|
+
* A controller object that allows you to abort one or more DOM requests as and when desired.
|
|
880
|
+
*
|
|
881
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
|
|
882
|
+
*/
|
|
815
883
|
export declare class AbortController {
|
|
816
884
|
constructor();
|
|
817
885
|
/**
|
|
@@ -827,11 +895,17 @@ export declare class AbortController {
|
|
|
827
895
|
*/
|
|
828
896
|
abort(reason?: any): void;
|
|
829
897
|
}
|
|
898
|
+
/**
|
|
899
|
+
* 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.
|
|
900
|
+
*
|
|
901
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
|
|
902
|
+
*/
|
|
830
903
|
export declare abstract class AbortSignal extends EventTarget {
|
|
831
|
-
|
|
904
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
|
|
832
905
|
static abort(reason?: any): AbortSignal;
|
|
833
|
-
|
|
906
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
|
|
834
907
|
static timeout(delay: number): AbortSignal;
|
|
908
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
|
|
835
909
|
static any(signals: AbortSignal[]): AbortSignal;
|
|
836
910
|
/**
|
|
837
911
|
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
@@ -839,13 +913,13 @@ export declare abstract class AbortSignal extends EventTarget {
|
|
|
839
913
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
|
|
840
914
|
*/
|
|
841
915
|
get aborted(): boolean;
|
|
842
|
-
|
|
916
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
|
|
843
917
|
get reason(): any;
|
|
844
|
-
|
|
918
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
845
919
|
get onabort(): any | null;
|
|
846
|
-
|
|
920
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
|
|
847
921
|
set onabort(value: any | null);
|
|
848
|
-
|
|
922
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
|
|
849
923
|
throwIfAborted(): void;
|
|
850
924
|
}
|
|
851
925
|
export interface Scheduler {
|
|
@@ -854,10 +928,16 @@ export interface Scheduler {
|
|
|
854
928
|
export interface SchedulerWaitOptions {
|
|
855
929
|
signal?: AbortSignal;
|
|
856
930
|
}
|
|
931
|
+
/**
|
|
932
|
+
* 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.
|
|
933
|
+
*
|
|
934
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
|
|
935
|
+
*/
|
|
857
936
|
export declare abstract class ExtendableEvent extends Event {
|
|
858
|
-
|
|
937
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
|
|
859
938
|
waitUntil(promise: Promise<any>): void;
|
|
860
939
|
}
|
|
940
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
|
|
861
941
|
export declare class CustomEvent<T = any> extends Event {
|
|
862
942
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
863
943
|
/**
|
|
@@ -873,58 +953,93 @@ export interface CustomEventCustomEventInit {
|
|
|
873
953
|
composed?: boolean;
|
|
874
954
|
detail?: any;
|
|
875
955
|
}
|
|
956
|
+
/**
|
|
957
|
+
* 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.
|
|
958
|
+
*
|
|
959
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
|
|
960
|
+
*/
|
|
876
961
|
export declare class Blob {
|
|
877
962
|
constructor(
|
|
878
|
-
|
|
963
|
+
type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
|
|
879
964
|
options?: BlobOptions,
|
|
880
965
|
);
|
|
881
|
-
|
|
966
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
882
967
|
get size(): number;
|
|
883
|
-
|
|
968
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
884
969
|
get type(): string;
|
|
885
|
-
|
|
970
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
886
971
|
slice(start?: number, end?: number, type?: string): Blob;
|
|
887
|
-
|
|
972
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
|
|
888
973
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
889
|
-
|
|
974
|
+
bytes(): Promise<Uint8Array>;
|
|
975
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
890
976
|
text(): Promise<string>;
|
|
891
|
-
|
|
977
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
|
|
892
978
|
stream(): ReadableStream;
|
|
893
979
|
}
|
|
894
980
|
export interface BlobOptions {
|
|
895
981
|
type?: string;
|
|
896
982
|
}
|
|
983
|
+
/**
|
|
984
|
+
* Provides information about files and allows JavaScript in a web page to access their content.
|
|
985
|
+
*
|
|
986
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
|
|
987
|
+
*/
|
|
897
988
|
export declare class File extends Blob {
|
|
898
989
|
constructor(
|
|
899
990
|
bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
|
|
900
991
|
name: string,
|
|
901
992
|
options?: FileOptions,
|
|
902
993
|
);
|
|
903
|
-
|
|
994
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
904
995
|
get name(): string;
|
|
905
|
-
|
|
996
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
906
997
|
get lastModified(): number;
|
|
907
998
|
}
|
|
908
999
|
export interface FileOptions {
|
|
909
1000
|
type?: string;
|
|
910
1001
|
lastModified?: number;
|
|
911
1002
|
}
|
|
1003
|
+
/**
|
|
1004
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
1005
|
+
*
|
|
1006
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
1007
|
+
*/
|
|
912
1008
|
export declare abstract class CacheStorage {
|
|
913
|
-
|
|
1009
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
|
|
914
1010
|
open(cacheName: string): Promise<Cache>;
|
|
915
1011
|
readonly default: Cache;
|
|
916
1012
|
}
|
|
1013
|
+
/**
|
|
1014
|
+
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
|
|
1015
|
+
*
|
|
1016
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
|
|
1017
|
+
*/
|
|
917
1018
|
export declare abstract class Cache {
|
|
918
|
-
|
|
1019
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
|
|
1020
|
+
delete(
|
|
1021
|
+
request: RequestInfo | URL,
|
|
1022
|
+
options?: CacheQueryOptions,
|
|
1023
|
+
): Promise<boolean>;
|
|
1024
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
|
|
919
1025
|
match(
|
|
920
|
-
request: RequestInfo,
|
|
1026
|
+
request: RequestInfo | URL,
|
|
921
1027
|
options?: CacheQueryOptions,
|
|
922
1028
|
): Promise<Response | undefined>;
|
|
923
|
-
|
|
1029
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
|
|
1030
|
+
put(request: RequestInfo | URL, response: Response): Promise<void>;
|
|
924
1031
|
}
|
|
925
1032
|
export interface CacheQueryOptions {
|
|
926
1033
|
ignoreMethod?: boolean;
|
|
927
1034
|
}
|
|
1035
|
+
/**
|
|
1036
|
+
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
|
|
1037
|
+
* The Workers runtime implements the full surface of this API, but with some differences in
|
|
1038
|
+
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
|
|
1039
|
+
* compared to those implemented in most browsers.
|
|
1040
|
+
*
|
|
1041
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
|
|
1042
|
+
*/
|
|
928
1043
|
export declare abstract class Crypto {
|
|
929
1044
|
/**
|
|
930
1045
|
* Available only in secure contexts.
|
|
@@ -932,7 +1047,7 @@ export declare abstract class Crypto {
|
|
|
932
1047
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
|
|
933
1048
|
*/
|
|
934
1049
|
get subtle(): SubtleCrypto;
|
|
935
|
-
|
|
1050
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
936
1051
|
getRandomValues<
|
|
937
1052
|
T extends
|
|
938
1053
|
| Int8Array
|
|
@@ -952,39 +1067,50 @@ export declare abstract class Crypto {
|
|
|
952
1067
|
randomUUID(): string;
|
|
953
1068
|
DigestStream: typeof DigestStream;
|
|
954
1069
|
}
|
|
1070
|
+
/**
|
|
1071
|
+
* 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).
|
|
1072
|
+
* Available only in secure contexts.
|
|
1073
|
+
*
|
|
1074
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
|
|
1075
|
+
*/
|
|
955
1076
|
export declare abstract class SubtleCrypto {
|
|
1077
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
|
|
956
1078
|
encrypt(
|
|
957
1079
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
958
1080
|
key: CryptoKey,
|
|
959
1081
|
plainText: ArrayBuffer | ArrayBufferView,
|
|
960
1082
|
): Promise<ArrayBuffer>;
|
|
1083
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
|
|
961
1084
|
decrypt(
|
|
962
1085
|
algorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
963
1086
|
key: CryptoKey,
|
|
964
1087
|
cipherText: ArrayBuffer | ArrayBufferView,
|
|
965
1088
|
): Promise<ArrayBuffer>;
|
|
1089
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
|
|
966
1090
|
sign(
|
|
967
1091
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
968
1092
|
key: CryptoKey,
|
|
969
1093
|
data: ArrayBuffer | ArrayBufferView,
|
|
970
1094
|
): Promise<ArrayBuffer>;
|
|
1095
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
|
|
971
1096
|
verify(
|
|
972
1097
|
algorithm: string | SubtleCryptoSignAlgorithm,
|
|
973
1098
|
key: CryptoKey,
|
|
974
1099
|
signature: ArrayBuffer | ArrayBufferView,
|
|
975
1100
|
data: ArrayBuffer | ArrayBufferView,
|
|
976
1101
|
): Promise<boolean>;
|
|
1102
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
|
|
977
1103
|
digest(
|
|
978
1104
|
algorithm: string | SubtleCryptoHashAlgorithm,
|
|
979
1105
|
data: ArrayBuffer | ArrayBufferView,
|
|
980
1106
|
): Promise<ArrayBuffer>;
|
|
981
|
-
|
|
1107
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
982
1108
|
generateKey(
|
|
983
1109
|
algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
|
|
984
1110
|
extractable: boolean,
|
|
985
1111
|
keyUsages: string[],
|
|
986
1112
|
): Promise<CryptoKey | CryptoKeyPair>;
|
|
987
|
-
|
|
1113
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
|
|
988
1114
|
deriveKey(
|
|
989
1115
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
990
1116
|
baseKey: CryptoKey,
|
|
@@ -992,12 +1118,13 @@ export declare abstract class SubtleCrypto {
|
|
|
992
1118
|
extractable: boolean,
|
|
993
1119
|
keyUsages: string[],
|
|
994
1120
|
): Promise<CryptoKey>;
|
|
1121
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
|
|
995
1122
|
deriveBits(
|
|
996
1123
|
algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
|
|
997
1124
|
baseKey: CryptoKey,
|
|
998
|
-
length
|
|
1125
|
+
length?: number | null,
|
|
999
1126
|
): Promise<ArrayBuffer>;
|
|
1000
|
-
|
|
1127
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
|
|
1001
1128
|
importKey(
|
|
1002
1129
|
format: string,
|
|
1003
1130
|
keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
|
|
@@ -1005,14 +1132,16 @@ export declare abstract class SubtleCrypto {
|
|
|
1005
1132
|
extractable: boolean,
|
|
1006
1133
|
keyUsages: string[],
|
|
1007
1134
|
): Promise<CryptoKey>;
|
|
1135
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
|
|
1008
1136
|
exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
1137
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
|
|
1009
1138
|
wrapKey(
|
|
1010
1139
|
format: string,
|
|
1011
1140
|
key: CryptoKey,
|
|
1012
1141
|
wrappingKey: CryptoKey,
|
|
1013
1142
|
wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
|
|
1014
1143
|
): Promise<ArrayBuffer>;
|
|
1015
|
-
|
|
1144
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
|
|
1016
1145
|
unwrapKey(
|
|
1017
1146
|
format: string,
|
|
1018
1147
|
wrappedKey: ArrayBuffer | ArrayBufferView,
|
|
@@ -1027,12 +1156,18 @@ export declare abstract class SubtleCrypto {
|
|
|
1027
1156
|
b: ArrayBuffer | ArrayBufferView,
|
|
1028
1157
|
): boolean;
|
|
1029
1158
|
}
|
|
1159
|
+
/**
|
|
1160
|
+
* The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
|
|
1161
|
+
* Available only in secure contexts.
|
|
1162
|
+
*
|
|
1163
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
|
|
1164
|
+
*/
|
|
1030
1165
|
export declare abstract class CryptoKey {
|
|
1031
|
-
|
|
1166
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
|
|
1032
1167
|
readonly type: string;
|
|
1033
|
-
|
|
1168
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
|
|
1034
1169
|
readonly extractable: boolean;
|
|
1035
|
-
|
|
1170
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
|
|
1036
1171
|
readonly algorithm:
|
|
1037
1172
|
| CryptoKeyKeyAlgorithm
|
|
1038
1173
|
| CryptoKeyAesKeyAlgorithm
|
|
@@ -1040,7 +1175,7 @@ export declare abstract class CryptoKey {
|
|
|
1040
1175
|
| CryptoKeyRsaKeyAlgorithm
|
|
1041
1176
|
| CryptoKeyEllipticKeyAlgorithm
|
|
1042
1177
|
| CryptoKeyArbitraryKeyAlgorithm;
|
|
1043
|
-
|
|
1178
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
|
|
1044
1179
|
readonly usages: string[];
|
|
1045
1180
|
}
|
|
1046
1181
|
export interface CryptoKeyPair {
|
|
@@ -1146,7 +1281,13 @@ export declare class DigestStream extends WritableStream<
|
|
|
1146
1281
|
> {
|
|
1147
1282
|
constructor(algorithm: string | SubtleCryptoHashAlgorithm);
|
|
1148
1283
|
get digest(): Promise<ArrayBuffer>;
|
|
1284
|
+
get bytesWritten(): number | bigint;
|
|
1149
1285
|
}
|
|
1286
|
+
/**
|
|
1287
|
+
* 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.
|
|
1288
|
+
*
|
|
1289
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
|
|
1290
|
+
*/
|
|
1150
1291
|
export declare class TextDecoder {
|
|
1151
1292
|
constructor(decoder?: string, options?: TextDecoderConstructorOptions);
|
|
1152
1293
|
/**
|
|
@@ -1172,6 +1313,11 @@ export declare class TextDecoder {
|
|
|
1172
1313
|
get fatal(): boolean;
|
|
1173
1314
|
get ignoreBOM(): boolean;
|
|
1174
1315
|
}
|
|
1316
|
+
/**
|
|
1317
|
+
* 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.
|
|
1318
|
+
*
|
|
1319
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
|
|
1320
|
+
*/
|
|
1175
1321
|
export declare class TextEncoder {
|
|
1176
1322
|
constructor();
|
|
1177
1323
|
/**
|
|
@@ -1202,21 +1348,59 @@ export interface TextEncoderEncodeIntoResult {
|
|
|
1202
1348
|
read: number;
|
|
1203
1349
|
written: number;
|
|
1204
1350
|
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Events providing information related to errors in scripts or in files.
|
|
1353
|
+
*
|
|
1354
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
1355
|
+
*/
|
|
1356
|
+
export declare class ErrorEvent extends Event {
|
|
1357
|
+
constructor(type: string, init?: ErrorEventErrorEventInit);
|
|
1358
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
1359
|
+
get filename(): string;
|
|
1360
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
1361
|
+
get message(): string;
|
|
1362
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
1363
|
+
get lineno(): number;
|
|
1364
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
1365
|
+
get colno(): number;
|
|
1366
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
1367
|
+
get error(): any;
|
|
1368
|
+
}
|
|
1369
|
+
export interface ErrorEventErrorEventInit {
|
|
1370
|
+
message?: string;
|
|
1371
|
+
filename?: string;
|
|
1372
|
+
lineno?: number;
|
|
1373
|
+
colno?: number;
|
|
1374
|
+
error?: any;
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* 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".
|
|
1378
|
+
*
|
|
1379
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
|
|
1380
|
+
*/
|
|
1205
1381
|
export declare class FormData {
|
|
1206
1382
|
constructor();
|
|
1383
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1207
1384
|
append(name: string, value: string): void;
|
|
1385
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
|
|
1208
1386
|
append(name: string, value: Blob, filename?: string): void;
|
|
1387
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
|
|
1209
1388
|
delete(name: string): void;
|
|
1389
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
|
|
1210
1390
|
get(name: string): (File | string) | null;
|
|
1391
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
|
|
1211
1392
|
getAll(name: string): (File | string)[];
|
|
1393
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
|
|
1212
1394
|
has(name: string): boolean;
|
|
1395
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
|
|
1213
1396
|
set(name: string, value: string): void;
|
|
1397
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
|
|
1214
1398
|
set(name: string, value: Blob, filename?: string): void;
|
|
1215
|
-
|
|
1399
|
+
/* Returns an array of key, value pairs for every entry in the list. */
|
|
1216
1400
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
1217
|
-
|
|
1401
|
+
/* Returns a list of keys in the list. */
|
|
1218
1402
|
keys(): IterableIterator<string>;
|
|
1219
|
-
|
|
1403
|
+
/* Returns a list of values in the list. */
|
|
1220
1404
|
values(): IterableIterator<File | string>;
|
|
1221
1405
|
forEach<This = unknown>(
|
|
1222
1406
|
callback: (
|
|
@@ -1266,20 +1450,44 @@ export interface Element {
|
|
|
1266
1450
|
hasAttribute(name: string): boolean;
|
|
1267
1451
|
setAttribute(name: string, value: string): Element;
|
|
1268
1452
|
removeAttribute(name: string): Element;
|
|
1269
|
-
before(
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1453
|
+
before(
|
|
1454
|
+
content: string | ReadableStream | Response,
|
|
1455
|
+
options?: ContentOptions,
|
|
1456
|
+
): Element;
|
|
1457
|
+
after(
|
|
1458
|
+
content: string | ReadableStream | Response,
|
|
1459
|
+
options?: ContentOptions,
|
|
1460
|
+
): Element;
|
|
1461
|
+
prepend(
|
|
1462
|
+
content: string | ReadableStream | Response,
|
|
1463
|
+
options?: ContentOptions,
|
|
1464
|
+
): Element;
|
|
1465
|
+
append(
|
|
1466
|
+
content: string | ReadableStream | Response,
|
|
1467
|
+
options?: ContentOptions,
|
|
1468
|
+
): Element;
|
|
1469
|
+
replace(
|
|
1470
|
+
content: string | ReadableStream | Response,
|
|
1471
|
+
options?: ContentOptions,
|
|
1472
|
+
): Element;
|
|
1274
1473
|
remove(): Element;
|
|
1275
1474
|
removeAndKeepContent(): Element;
|
|
1276
|
-
setInnerContent(
|
|
1475
|
+
setInnerContent(
|
|
1476
|
+
content: string | ReadableStream | Response,
|
|
1477
|
+
options?: ContentOptions,
|
|
1478
|
+
): Element;
|
|
1277
1479
|
onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
|
|
1278
1480
|
}
|
|
1279
1481
|
export interface EndTag {
|
|
1280
1482
|
name: string;
|
|
1281
|
-
before(
|
|
1282
|
-
|
|
1483
|
+
before(
|
|
1484
|
+
content: string | ReadableStream | Response,
|
|
1485
|
+
options?: ContentOptions,
|
|
1486
|
+
): EndTag;
|
|
1487
|
+
after(
|
|
1488
|
+
content: string | ReadableStream | Response,
|
|
1489
|
+
options?: ContentOptions,
|
|
1490
|
+
): EndTag;
|
|
1283
1491
|
remove(): EndTag;
|
|
1284
1492
|
}
|
|
1285
1493
|
export interface Comment {
|
|
@@ -1294,18 +1502,32 @@ export interface Text {
|
|
|
1294
1502
|
readonly text: string;
|
|
1295
1503
|
readonly lastInTextNode: boolean;
|
|
1296
1504
|
readonly removed: boolean;
|
|
1297
|
-
before(
|
|
1298
|
-
|
|
1299
|
-
|
|
1505
|
+
before(
|
|
1506
|
+
content: string | ReadableStream | Response,
|
|
1507
|
+
options?: ContentOptions,
|
|
1508
|
+
): Text;
|
|
1509
|
+
after(
|
|
1510
|
+
content: string | ReadableStream | Response,
|
|
1511
|
+
options?: ContentOptions,
|
|
1512
|
+
): Text;
|
|
1513
|
+
replace(
|
|
1514
|
+
content: string | ReadableStream | Response,
|
|
1515
|
+
options?: ContentOptions,
|
|
1516
|
+
): Text;
|
|
1300
1517
|
remove(): Text;
|
|
1301
1518
|
}
|
|
1302
1519
|
export interface DocumentEnd {
|
|
1303
1520
|
append(content: string, options?: ContentOptions): DocumentEnd;
|
|
1304
1521
|
}
|
|
1522
|
+
/**
|
|
1523
|
+
* 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.
|
|
1524
|
+
*
|
|
1525
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
|
|
1526
|
+
*/
|
|
1305
1527
|
export declare abstract class FetchEvent extends ExtendableEvent {
|
|
1306
|
-
|
|
1528
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
|
|
1307
1529
|
readonly request: Request;
|
|
1308
|
-
|
|
1530
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
|
|
1309
1531
|
respondWith(promise: Response | Promise<Response>): void;
|
|
1310
1532
|
passThroughOnException(): void;
|
|
1311
1533
|
}
|
|
@@ -1313,24 +1535,35 @@ export type HeadersInit =
|
|
|
1313
1535
|
| Headers
|
|
1314
1536
|
| Iterable<Iterable<string>>
|
|
1315
1537
|
| Record<string, string>;
|
|
1538
|
+
/**
|
|
1539
|
+
* 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.
|
|
1540
|
+
*
|
|
1541
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
|
|
1542
|
+
*/
|
|
1316
1543
|
export declare class Headers {
|
|
1317
1544
|
constructor(init?: HeadersInit);
|
|
1545
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
|
|
1318
1546
|
get(name: string): string | null;
|
|
1319
1547
|
getAll(name: string): string[];
|
|
1548
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */
|
|
1320
1549
|
getSetCookie(): string[];
|
|
1550
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
|
|
1321
1551
|
has(name: string): boolean;
|
|
1552
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
|
|
1322
1553
|
set(name: string, value: string): void;
|
|
1554
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
|
|
1323
1555
|
append(name: string, value: string): void;
|
|
1556
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
|
|
1324
1557
|
delete(name: string): void;
|
|
1325
1558
|
forEach<This = unknown>(
|
|
1326
1559
|
callback: (this: This, value: string, key: string, parent: Headers) => void,
|
|
1327
1560
|
thisArg?: This,
|
|
1328
1561
|
): void;
|
|
1329
|
-
|
|
1562
|
+
/* Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
|
1330
1563
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
1331
|
-
|
|
1564
|
+
/* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
|
1332
1565
|
keys(): IterableIterator<string>;
|
|
1333
|
-
|
|
1566
|
+
/* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
|
1334
1567
|
values(): IterableIterator<string>;
|
|
1335
1568
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1336
1569
|
}
|
|
@@ -1343,36 +1576,55 @@ export type BodyInit =
|
|
|
1343
1576
|
| URLSearchParams
|
|
1344
1577
|
| FormData;
|
|
1345
1578
|
export declare abstract class Body {
|
|
1579
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
|
|
1346
1580
|
get body(): ReadableStream | null;
|
|
1581
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
1347
1582
|
get bodyUsed(): boolean;
|
|
1583
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
1348
1584
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1585
|
+
bytes(): Promise<Uint8Array>;
|
|
1586
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
|
|
1349
1587
|
text(): Promise<string>;
|
|
1588
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
|
|
1350
1589
|
json<T>(): Promise<T>;
|
|
1590
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
|
|
1351
1591
|
formData(): Promise<FormData>;
|
|
1592
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
1352
1593
|
blob(): Promise<Blob>;
|
|
1353
1594
|
}
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1595
|
+
/**
|
|
1596
|
+
* This Fetch API interface represents the response to a request.
|
|
1597
|
+
*
|
|
1598
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1599
|
+
*/
|
|
1600
|
+
export declare var Response: {
|
|
1601
|
+
prototype: Response;
|
|
1602
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
1603
|
+
redirect(url: string, status?: number): Response;
|
|
1604
|
+
json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1605
|
+
};
|
|
1606
|
+
/**
|
|
1607
|
+
* This Fetch API interface represents the response to a request.
|
|
1608
|
+
*
|
|
1609
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1610
|
+
*/
|
|
1611
|
+
export interface Response extends Body {
|
|
1612
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1361
1613
|
clone(): Response;
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1614
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1615
|
+
status: number;
|
|
1616
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1617
|
+
statusText: string;
|
|
1618
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1619
|
+
headers: Headers;
|
|
1620
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1621
|
+
ok: boolean;
|
|
1622
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1623
|
+
redirected: boolean;
|
|
1624
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1625
|
+
url: string;
|
|
1626
|
+
webSocket: WebSocket | null;
|
|
1627
|
+
cf: any | undefined;
|
|
1376
1628
|
}
|
|
1377
1629
|
export interface ResponseInit {
|
|
1378
1630
|
status?: number;
|
|
@@ -1385,73 +1637,89 @@ export interface ResponseInit {
|
|
|
1385
1637
|
export type RequestInfo<
|
|
1386
1638
|
CfHostMetadata = unknown,
|
|
1387
1639
|
Cf = CfProperties<CfHostMetadata>,
|
|
1388
|
-
> = Request<CfHostMetadata, Cf> | string
|
|
1389
|
-
|
|
1640
|
+
> = Request<CfHostMetadata, Cf> | string;
|
|
1641
|
+
/**
|
|
1642
|
+
* This Fetch API interface represents a resource request.
|
|
1643
|
+
*
|
|
1644
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1645
|
+
*/
|
|
1646
|
+
export declare var Request: {
|
|
1647
|
+
prototype: Request;
|
|
1648
|
+
new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
|
|
1649
|
+
input: RequestInfo<CfProperties> | URL,
|
|
1650
|
+
init?: RequestInit<Cf>,
|
|
1651
|
+
): Request<CfHostMetadata, Cf>;
|
|
1652
|
+
};
|
|
1653
|
+
/**
|
|
1654
|
+
* This Fetch API interface represents a resource request.
|
|
1655
|
+
*
|
|
1656
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1657
|
+
*/
|
|
1658
|
+
export interface Request<
|
|
1390
1659
|
CfHostMetadata = unknown,
|
|
1391
1660
|
Cf = CfProperties<CfHostMetadata>,
|
|
1392
1661
|
> extends Body {
|
|
1393
|
-
|
|
1394
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1662
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1395
1663
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1396
1664
|
/**
|
|
1397
1665
|
* Returns request's HTTP method, which is "GET" by default.
|
|
1398
1666
|
*
|
|
1399
1667
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1400
1668
|
*/
|
|
1401
|
-
|
|
1669
|
+
method: string;
|
|
1402
1670
|
/**
|
|
1403
1671
|
* Returns the URL of request as a string.
|
|
1404
1672
|
*
|
|
1405
1673
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1406
1674
|
*/
|
|
1407
|
-
|
|
1675
|
+
url: string;
|
|
1408
1676
|
/**
|
|
1409
1677
|
* 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.
|
|
1410
1678
|
*
|
|
1411
1679
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1412
1680
|
*/
|
|
1413
|
-
|
|
1681
|
+
headers: Headers;
|
|
1414
1682
|
/**
|
|
1415
1683
|
* 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.
|
|
1416
1684
|
*
|
|
1417
1685
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1418
1686
|
*/
|
|
1419
|
-
|
|
1420
|
-
|
|
1687
|
+
redirect: string;
|
|
1688
|
+
fetcher: Fetcher | null;
|
|
1421
1689
|
/**
|
|
1422
1690
|
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1423
1691
|
*
|
|
1424
1692
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1425
1693
|
*/
|
|
1426
|
-
|
|
1427
|
-
|
|
1694
|
+
signal: AbortSignal;
|
|
1695
|
+
cf: Cf | undefined;
|
|
1428
1696
|
/**
|
|
1429
1697
|
* 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]
|
|
1430
1698
|
*
|
|
1431
1699
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1432
1700
|
*/
|
|
1433
|
-
|
|
1701
|
+
integrity: string;
|
|
1434
1702
|
/**
|
|
1435
1703
|
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1436
1704
|
*
|
|
1437
1705
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1438
1706
|
*/
|
|
1439
|
-
|
|
1707
|
+
keepalive: boolean;
|
|
1440
1708
|
}
|
|
1441
1709
|
export interface RequestInit<Cf = CfProperties> {
|
|
1442
|
-
|
|
1710
|
+
/* A string to set request's method. */
|
|
1443
1711
|
method?: string;
|
|
1444
|
-
|
|
1712
|
+
/* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
|
|
1445
1713
|
headers?: HeadersInit;
|
|
1446
|
-
|
|
1714
|
+
/* A BodyInit object or null to set request's body. */
|
|
1447
1715
|
body?: BodyInit | null;
|
|
1448
|
-
|
|
1716
|
+
/* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */
|
|
1449
1717
|
redirect?: string;
|
|
1450
1718
|
fetcher?: Fetcher | null;
|
|
1451
1719
|
cf?: Cf;
|
|
1452
|
-
|
|
1720
|
+
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
|
|
1453
1721
|
integrity?: string;
|
|
1454
|
-
|
|
1722
|
+
/* An AbortSignal to set request's signal. */
|
|
1455
1723
|
signal?: AbortSignal | null;
|
|
1456
1724
|
}
|
|
1457
1725
|
export type Service<
|
|
@@ -1463,7 +1731,7 @@ export type Fetcher<
|
|
|
1463
1731
|
> = (T extends Rpc.EntrypointBranded
|
|
1464
1732
|
? Rpc.Provider<T, Reserved | "fetch" | "connect">
|
|
1465
1733
|
: unknown) & {
|
|
1466
|
-
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1734
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
1467
1735
|
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1468
1736
|
};
|
|
1469
1737
|
export interface FetcherPutOptions {
|
|
@@ -1685,6 +1953,7 @@ export interface R2MultipartUpload {
|
|
|
1685
1953
|
uploadPart(
|
|
1686
1954
|
partNumber: number,
|
|
1687
1955
|
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
|
|
1956
|
+
options?: R2UploadPartOptions,
|
|
1688
1957
|
): Promise<R2UploadedPart>;
|
|
1689
1958
|
abort(): Promise<void>;
|
|
1690
1959
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
@@ -1705,6 +1974,7 @@ export declare abstract class R2Object {
|
|
|
1705
1974
|
readonly customMetadata?: Record<string, string>;
|
|
1706
1975
|
readonly range?: R2Range;
|
|
1707
1976
|
readonly storageClass: string;
|
|
1977
|
+
readonly ssecKeyMd5?: string;
|
|
1708
1978
|
writeHttpMetadata(headers: Headers): void;
|
|
1709
1979
|
}
|
|
1710
1980
|
export interface R2ObjectBody extends R2Object {
|
|
@@ -1737,6 +2007,7 @@ export interface R2Conditional {
|
|
|
1737
2007
|
export interface R2GetOptions {
|
|
1738
2008
|
onlyIf?: R2Conditional | Headers;
|
|
1739
2009
|
range?: R2Range | Headers;
|
|
2010
|
+
ssecKey?: ArrayBuffer | string;
|
|
1740
2011
|
}
|
|
1741
2012
|
export interface R2PutOptions {
|
|
1742
2013
|
onlyIf?: R2Conditional | Headers;
|
|
@@ -1748,11 +2019,13 @@ export interface R2PutOptions {
|
|
|
1748
2019
|
sha384?: ArrayBuffer | string;
|
|
1749
2020
|
sha512?: ArrayBuffer | string;
|
|
1750
2021
|
storageClass?: string;
|
|
2022
|
+
ssecKey?: ArrayBuffer | string;
|
|
1751
2023
|
}
|
|
1752
2024
|
export interface R2MultipartOptions {
|
|
1753
2025
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1754
2026
|
customMetadata?: Record<string, string>;
|
|
1755
2027
|
storageClass?: string;
|
|
2028
|
+
ssecKey?: ArrayBuffer | string;
|
|
1756
2029
|
}
|
|
1757
2030
|
export interface R2Checksums {
|
|
1758
2031
|
readonly md5?: ArrayBuffer;
|
|
@@ -1789,6 +2062,9 @@ export type R2Objects = {
|
|
|
1789
2062
|
truncated: false;
|
|
1790
2063
|
}
|
|
1791
2064
|
);
|
|
2065
|
+
export interface R2UploadPartOptions {
|
|
2066
|
+
ssecKey?: ArrayBuffer | string;
|
|
2067
|
+
}
|
|
1792
2068
|
export declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1793
2069
|
readonly scheduledTime: number;
|
|
1794
2070
|
readonly cron: string;
|
|
@@ -1885,31 +2161,36 @@ export type ReadableStreamReadResult<R = any> =
|
|
|
1885
2161
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
1886
2162
|
*/
|
|
1887
2163
|
export interface ReadableStream<R = any> {
|
|
1888
|
-
|
|
2164
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
|
|
1889
2165
|
get locked(): boolean;
|
|
1890
|
-
|
|
2166
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
|
|
1891
2167
|
cancel(reason?: any): Promise<void>;
|
|
1892
|
-
|
|
2168
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1893
2169
|
getReader(): ReadableStreamDefaultReader<R>;
|
|
1894
|
-
|
|
2170
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
|
|
1895
2171
|
getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
|
|
1896
|
-
|
|
2172
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
|
|
1897
2173
|
pipeThrough<T>(
|
|
1898
2174
|
transform: ReadableWritablePair<T, R>,
|
|
1899
2175
|
options?: StreamPipeOptions,
|
|
1900
2176
|
): ReadableStream<T>;
|
|
1901
|
-
|
|
2177
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
|
|
1902
2178
|
pipeTo(
|
|
1903
2179
|
destination: WritableStream<R>,
|
|
1904
2180
|
options?: StreamPipeOptions,
|
|
1905
2181
|
): Promise<void>;
|
|
1906
|
-
|
|
2182
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
|
|
1907
2183
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
1908
2184
|
values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
|
|
1909
2185
|
[Symbol.asyncIterator](
|
|
1910
2186
|
options?: ReadableStreamValuesOptions,
|
|
1911
2187
|
): AsyncIterableIterator<R>;
|
|
1912
2188
|
}
|
|
2189
|
+
/**
|
|
2190
|
+
* 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.
|
|
2191
|
+
*
|
|
2192
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
2193
|
+
*/
|
|
1913
2194
|
export declare const ReadableStream: {
|
|
1914
2195
|
prototype: ReadableStream;
|
|
1915
2196
|
new (
|
|
@@ -1921,24 +2202,26 @@ export declare const ReadableStream: {
|
|
|
1921
2202
|
strategy?: QueuingStrategy<R>,
|
|
1922
2203
|
): ReadableStream<R>;
|
|
1923
2204
|
};
|
|
2205
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
|
|
1924
2206
|
export declare class ReadableStreamDefaultReader<R = any> {
|
|
1925
2207
|
constructor(stream: ReadableStream);
|
|
1926
2208
|
get closed(): Promise<void>;
|
|
1927
2209
|
cancel(reason?: any): Promise<void>;
|
|
1928
|
-
|
|
2210
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
|
|
1929
2211
|
read(): Promise<ReadableStreamReadResult<R>>;
|
|
1930
|
-
|
|
2212
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
|
|
1931
2213
|
releaseLock(): void;
|
|
1932
2214
|
}
|
|
2215
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
|
|
1933
2216
|
export declare class ReadableStreamBYOBReader {
|
|
1934
2217
|
constructor(stream: ReadableStream);
|
|
1935
2218
|
get closed(): Promise<void>;
|
|
1936
2219
|
cancel(reason?: any): Promise<void>;
|
|
1937
|
-
|
|
2220
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
|
1938
2221
|
read<T extends ArrayBufferView>(
|
|
1939
2222
|
view: T,
|
|
1940
2223
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1941
|
-
|
|
2224
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
|
1942
2225
|
releaseLock(): void;
|
|
1943
2226
|
readAtLeast<T extends ArrayBufferView>(
|
|
1944
2227
|
minElements: number,
|
|
@@ -1956,52 +2239,60 @@ export interface ReadableStreamGetReaderOptions {
|
|
|
1956
2239
|
*/
|
|
1957
2240
|
mode: "byob";
|
|
1958
2241
|
}
|
|
2242
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
|
1959
2243
|
export declare abstract class ReadableStreamBYOBRequest {
|
|
1960
|
-
|
|
2244
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
|
1961
2245
|
get view(): Uint8Array | null;
|
|
1962
|
-
|
|
2246
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
|
1963
2247
|
respond(bytesWritten: number): void;
|
|
1964
|
-
|
|
2248
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
|
1965
2249
|
respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
|
|
1966
2250
|
get atLeast(): number | null;
|
|
1967
2251
|
}
|
|
2252
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
|
|
1968
2253
|
export declare abstract class ReadableStreamDefaultController<R = any> {
|
|
1969
|
-
|
|
2254
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
|
|
1970
2255
|
get desiredSize(): number | null;
|
|
1971
|
-
|
|
2256
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
|
|
1972
2257
|
close(): void;
|
|
1973
|
-
|
|
2258
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
|
|
1974
2259
|
enqueue(chunk?: R): void;
|
|
1975
|
-
|
|
2260
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
|
|
1976
2261
|
error(reason: any): void;
|
|
1977
2262
|
}
|
|
2263
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
|
|
1978
2264
|
export declare abstract class ReadableByteStreamController {
|
|
1979
|
-
|
|
2265
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
|
|
1980
2266
|
get byobRequest(): ReadableStreamBYOBRequest | null;
|
|
1981
|
-
|
|
2267
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
|
|
1982
2268
|
get desiredSize(): number | null;
|
|
1983
|
-
|
|
2269
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
|
|
1984
2270
|
close(): void;
|
|
1985
|
-
|
|
2271
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
|
|
1986
2272
|
enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
1987
|
-
|
|
2273
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
|
|
1988
2274
|
error(reason: any): void;
|
|
1989
2275
|
}
|
|
2276
|
+
/**
|
|
2277
|
+
* 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.
|
|
2278
|
+
*
|
|
2279
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
|
|
2280
|
+
*/
|
|
1990
2281
|
export declare abstract class WritableStreamDefaultController {
|
|
1991
|
-
|
|
2282
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
|
|
1992
2283
|
get signal(): AbortSignal;
|
|
1993
|
-
|
|
2284
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
|
|
1994
2285
|
error(reason?: any): void;
|
|
1995
2286
|
}
|
|
1996
|
-
|
|
1997
|
-
export
|
|
1998
|
-
|
|
2287
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
|
|
2288
|
+
export declare abstract class TransformStreamDefaultController<O = any> {
|
|
2289
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
|
|
1999
2290
|
get desiredSize(): number | null;
|
|
2000
|
-
|
|
2291
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
|
|
2001
2292
|
enqueue(chunk?: O): void;
|
|
2002
|
-
|
|
2293
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
|
|
2003
2294
|
error(reason: any): void;
|
|
2004
|
-
|
|
2295
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
|
|
2005
2296
|
terminate(): void;
|
|
2006
2297
|
}
|
|
2007
2298
|
export interface ReadableWritablePair<R = any, W = any> {
|
|
@@ -2013,46 +2304,57 @@ export interface ReadableWritablePair<R = any, W = any> {
|
|
|
2013
2304
|
writable: WritableStream<W>;
|
|
2014
2305
|
readable: ReadableStream<R>;
|
|
2015
2306
|
}
|
|
2307
|
+
/**
|
|
2308
|
+
* 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.
|
|
2309
|
+
*
|
|
2310
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
|
2311
|
+
*/
|
|
2016
2312
|
export declare class WritableStream<W = any> {
|
|
2017
2313
|
constructor(
|
|
2018
2314
|
underlyingSink?: UnderlyingSink,
|
|
2019
2315
|
queuingStrategy?: QueuingStrategy,
|
|
2020
2316
|
);
|
|
2021
|
-
|
|
2317
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
|
|
2022
2318
|
get locked(): boolean;
|
|
2023
|
-
|
|
2319
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
|
|
2024
2320
|
abort(reason?: any): Promise<void>;
|
|
2025
|
-
|
|
2321
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
|
|
2026
2322
|
close(): Promise<void>;
|
|
2027
|
-
|
|
2323
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
|
|
2028
2324
|
getWriter(): WritableStreamDefaultWriter<W>;
|
|
2029
2325
|
}
|
|
2326
|
+
/**
|
|
2327
|
+
* 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.
|
|
2328
|
+
*
|
|
2329
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
|
|
2330
|
+
*/
|
|
2030
2331
|
export declare class WritableStreamDefaultWriter<W = any> {
|
|
2031
2332
|
constructor(stream: WritableStream);
|
|
2032
|
-
|
|
2333
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
|
|
2033
2334
|
get closed(): Promise<void>;
|
|
2034
|
-
|
|
2335
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
|
|
2035
2336
|
get ready(): Promise<void>;
|
|
2036
|
-
|
|
2337
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
|
|
2037
2338
|
get desiredSize(): number | null;
|
|
2038
|
-
|
|
2339
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
|
|
2039
2340
|
abort(reason?: any): Promise<void>;
|
|
2040
|
-
|
|
2341
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
|
|
2041
2342
|
close(): Promise<void>;
|
|
2042
|
-
|
|
2343
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
|
|
2043
2344
|
write(chunk?: W): Promise<void>;
|
|
2044
|
-
|
|
2345
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
|
|
2045
2346
|
releaseLock(): void;
|
|
2046
2347
|
}
|
|
2348
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
|
|
2047
2349
|
export declare class TransformStream<I = any, O = any> {
|
|
2048
2350
|
constructor(
|
|
2049
2351
|
transformer?: Transformer<I, O>,
|
|
2050
2352
|
writableStrategy?: QueuingStrategy<I>,
|
|
2051
2353
|
readableStrategy?: QueuingStrategy<O>,
|
|
2052
2354
|
);
|
|
2053
|
-
|
|
2355
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
|
|
2054
2356
|
get readable(): ReadableStream<O>;
|
|
2055
|
-
|
|
2357
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
|
|
2056
2358
|
get writable(): WritableStream<I>;
|
|
2057
2359
|
}
|
|
2058
2360
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
@@ -2073,18 +2375,21 @@ export interface IdentityTransformStreamQueuingStrategy {
|
|
|
2073
2375
|
export interface ReadableStreamValuesOptions {
|
|
2074
2376
|
preventCancel?: boolean;
|
|
2075
2377
|
}
|
|
2378
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
|
|
2076
2379
|
export declare class CompressionStream extends TransformStream<
|
|
2077
2380
|
ArrayBuffer | ArrayBufferView,
|
|
2078
2381
|
Uint8Array
|
|
2079
2382
|
> {
|
|
2080
2383
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2081
2384
|
}
|
|
2385
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
|
|
2082
2386
|
export declare class DecompressionStream extends TransformStream<
|
|
2083
2387
|
ArrayBuffer | ArrayBufferView,
|
|
2084
2388
|
Uint8Array
|
|
2085
2389
|
> {
|
|
2086
2390
|
constructor(format: "gzip" | "deflate" | "deflate-raw");
|
|
2087
2391
|
}
|
|
2392
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
|
|
2088
2393
|
export declare class TextEncoderStream extends TransformStream<
|
|
2089
2394
|
string,
|
|
2090
2395
|
Uint8Array
|
|
@@ -2092,6 +2397,7 @@ export declare class TextEncoderStream extends TransformStream<
|
|
|
2092
2397
|
constructor();
|
|
2093
2398
|
get encoding(): string;
|
|
2094
2399
|
}
|
|
2400
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
|
|
2095
2401
|
export declare class TextDecoderStream extends TransformStream<
|
|
2096
2402
|
ArrayBuffer | ArrayBufferView,
|
|
2097
2403
|
string
|
|
@@ -2105,20 +2411,30 @@ export interface TextDecoderStreamTextDecoderStreamInit {
|
|
|
2105
2411
|
fatal?: boolean;
|
|
2106
2412
|
ignoreBOM?: boolean;
|
|
2107
2413
|
}
|
|
2414
|
+
/**
|
|
2415
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2416
|
+
*
|
|
2417
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
|
|
2418
|
+
*/
|
|
2108
2419
|
export declare class ByteLengthQueuingStrategy
|
|
2109
2420
|
implements QueuingStrategy<ArrayBufferView>
|
|
2110
2421
|
{
|
|
2111
2422
|
constructor(init: QueuingStrategyInit);
|
|
2112
|
-
|
|
2423
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
|
|
2113
2424
|
get highWaterMark(): number;
|
|
2114
|
-
|
|
2425
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
|
|
2115
2426
|
get size(): (chunk?: any) => number;
|
|
2116
2427
|
}
|
|
2428
|
+
/**
|
|
2429
|
+
* This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
|
|
2430
|
+
*
|
|
2431
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
|
|
2432
|
+
*/
|
|
2117
2433
|
export declare class CountQueuingStrategy implements QueuingStrategy {
|
|
2118
2434
|
constructor(init: QueuingStrategyInit);
|
|
2119
|
-
|
|
2435
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
|
|
2120
2436
|
get highWaterMark(): number;
|
|
2121
|
-
|
|
2437
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
|
|
2122
2438
|
get size(): (chunk?: any) => number;
|
|
2123
2439
|
}
|
|
2124
2440
|
export interface QueuingStrategyInit {
|
|
@@ -2162,6 +2478,8 @@ export interface TraceItem {
|
|
|
2162
2478
|
readonly dispatchNamespace?: string;
|
|
2163
2479
|
readonly scriptTags?: string[];
|
|
2164
2480
|
readonly outcome: string;
|
|
2481
|
+
readonly executionModel: string;
|
|
2482
|
+
readonly truncated: boolean;
|
|
2165
2483
|
}
|
|
2166
2484
|
export interface TraceItemAlarmEventInfo {
|
|
2167
2485
|
readonly scheduledTime: Date;
|
|
@@ -2243,76 +2561,119 @@ export interface TraceMetrics {
|
|
|
2243
2561
|
export interface UnsafeTraceMetrics {
|
|
2244
2562
|
fromTrace(item: TraceItem): TraceMetrics;
|
|
2245
2563
|
}
|
|
2564
|
+
/**
|
|
2565
|
+
* The URL interface represents an object providing static methods used for creating object URLs.
|
|
2566
|
+
*
|
|
2567
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
|
2568
|
+
*/
|
|
2246
2569
|
export declare class URL {
|
|
2247
2570
|
constructor(url: string | URL, base?: string | URL);
|
|
2248
|
-
|
|
2571
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
|
|
2249
2572
|
get origin(): string;
|
|
2250
|
-
|
|
2573
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2251
2574
|
get href(): string;
|
|
2252
|
-
|
|
2575
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
|
|
2253
2576
|
set href(value: string);
|
|
2254
|
-
|
|
2577
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2255
2578
|
get protocol(): string;
|
|
2256
|
-
|
|
2579
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
|
|
2257
2580
|
set protocol(value: string);
|
|
2258
|
-
|
|
2581
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2259
2582
|
get username(): string;
|
|
2260
|
-
|
|
2583
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
|
|
2261
2584
|
set username(value: string);
|
|
2262
|
-
|
|
2585
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2263
2586
|
get password(): string;
|
|
2264
|
-
|
|
2587
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
|
|
2265
2588
|
set password(value: string);
|
|
2266
|
-
|
|
2589
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2267
2590
|
get host(): string;
|
|
2268
|
-
|
|
2591
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
|
|
2269
2592
|
set host(value: string);
|
|
2270
|
-
|
|
2593
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2271
2594
|
get hostname(): string;
|
|
2272
|
-
|
|
2595
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
|
|
2273
2596
|
set hostname(value: string);
|
|
2274
|
-
|
|
2597
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2275
2598
|
get port(): string;
|
|
2276
|
-
|
|
2599
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
|
|
2277
2600
|
set port(value: string);
|
|
2278
|
-
|
|
2601
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2279
2602
|
get pathname(): string;
|
|
2280
|
-
|
|
2603
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
|
|
2281
2604
|
set pathname(value: string);
|
|
2282
|
-
|
|
2605
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2283
2606
|
get search(): string;
|
|
2284
|
-
|
|
2607
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
|
|
2285
2608
|
set search(value: string);
|
|
2286
|
-
|
|
2609
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2287
2610
|
get hash(): string;
|
|
2288
|
-
|
|
2611
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
|
|
2289
2612
|
set hash(value: string);
|
|
2290
|
-
|
|
2613
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
|
|
2291
2614
|
get searchParams(): URLSearchParams;
|
|
2292
|
-
|
|
2615
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
|
|
2293
2616
|
toJSON(): string;
|
|
2617
|
+
/*function toString() { [native code] }*/
|
|
2294
2618
|
toString(): string;
|
|
2295
|
-
|
|
2619
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2296
2620
|
static canParse(url: string, base?: string): boolean;
|
|
2297
2621
|
static parse(url: string, base?: string): URL | null;
|
|
2622
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
|
|
2623
|
+
static createObjectURL(object: File | Blob): string;
|
|
2624
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
|
|
2625
|
+
static revokeObjectURL(object_url: string): void;
|
|
2298
2626
|
}
|
|
2627
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2299
2628
|
export declare class URLSearchParams {
|
|
2300
2629
|
constructor(
|
|
2301
2630
|
init?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
2302
2631
|
);
|
|
2632
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
|
|
2303
2633
|
get size(): number;
|
|
2634
|
+
/**
|
|
2635
|
+
* Appends a specified key/value pair as a new search parameter.
|
|
2636
|
+
*
|
|
2637
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
2638
|
+
*/
|
|
2304
2639
|
append(name: string, value: string): void;
|
|
2640
|
+
/**
|
|
2641
|
+
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
2642
|
+
*
|
|
2643
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
2644
|
+
*/
|
|
2305
2645
|
delete(name: string, value?: string): void;
|
|
2646
|
+
/**
|
|
2647
|
+
* Returns the first value associated to the given search parameter.
|
|
2648
|
+
*
|
|
2649
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
2650
|
+
*/
|
|
2306
2651
|
get(name: string): string | null;
|
|
2652
|
+
/**
|
|
2653
|
+
* Returns all the values association with a given search parameter.
|
|
2654
|
+
*
|
|
2655
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
2656
|
+
*/
|
|
2307
2657
|
getAll(name: string): string[];
|
|
2658
|
+
/**
|
|
2659
|
+
* Returns a Boolean indicating if such a search parameter exists.
|
|
2660
|
+
*
|
|
2661
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
2662
|
+
*/
|
|
2308
2663
|
has(name: string, value?: string): boolean;
|
|
2664
|
+
/**
|
|
2665
|
+
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
2666
|
+
*
|
|
2667
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
2668
|
+
*/
|
|
2309
2669
|
set(name: string, value: string): void;
|
|
2670
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
|
|
2310
2671
|
sort(): void;
|
|
2311
|
-
|
|
2672
|
+
/* Returns an array of key, value pairs for every entry in the search params. */
|
|
2312
2673
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
2313
|
-
|
|
2674
|
+
/* Returns a list of keys in the search params. */
|
|
2314
2675
|
keys(): IterableIterator<string>;
|
|
2315
|
-
|
|
2676
|
+
/* Returns a list of values in the search params. */
|
|
2316
2677
|
values(): IterableIterator<string>;
|
|
2317
2678
|
forEach<This = unknown>(
|
|
2318
2679
|
callback: (
|
|
@@ -2323,6 +2684,7 @@ export declare class URLSearchParams {
|
|
|
2323
2684
|
) => void,
|
|
2324
2685
|
thisArg?: This,
|
|
2325
2686
|
): void;
|
|
2687
|
+
/*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
|
|
2326
2688
|
toString(): string;
|
|
2327
2689
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
2328
2690
|
}
|
|
@@ -2375,6 +2737,11 @@ export interface URLPatternURLPatternResult {
|
|
|
2375
2737
|
export interface URLPatternURLPatternOptions {
|
|
2376
2738
|
ignoreCase?: boolean;
|
|
2377
2739
|
}
|
|
2740
|
+
/**
|
|
2741
|
+
* 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.
|
|
2742
|
+
*
|
|
2743
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
|
|
2744
|
+
*/
|
|
2378
2745
|
export declare class CloseEvent extends Event {
|
|
2379
2746
|
constructor(type: string, initializer?: CloseEventInit);
|
|
2380
2747
|
/**
|
|
@@ -2401,38 +2768,52 @@ export interface CloseEventInit {
|
|
|
2401
2768
|
reason?: string;
|
|
2402
2769
|
wasClean?: boolean;
|
|
2403
2770
|
}
|
|
2771
|
+
/**
|
|
2772
|
+
* A message received by a target object.
|
|
2773
|
+
*
|
|
2774
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
|
|
2775
|
+
*/
|
|
2404
2776
|
export declare class MessageEvent extends Event {
|
|
2405
2777
|
constructor(type: string, initializer: MessageEventInit);
|
|
2778
|
+
/**
|
|
2779
|
+
* Returns the data of the message.
|
|
2780
|
+
*
|
|
2781
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
|
|
2782
|
+
*/
|
|
2406
2783
|
readonly data: ArrayBuffer | string;
|
|
2407
2784
|
}
|
|
2408
2785
|
export interface MessageEventInit {
|
|
2409
2786
|
data: ArrayBuffer | string;
|
|
2410
2787
|
}
|
|
2411
|
-
/**
|
|
2412
|
-
* Events providing information related to errors in scripts or in files.
|
|
2413
|
-
*
|
|
2414
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
|
2415
|
-
*/
|
|
2416
|
-
export interface ErrorEvent extends Event {
|
|
2417
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
|
2418
|
-
readonly filename: string;
|
|
2419
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
|
2420
|
-
readonly message: string;
|
|
2421
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
|
2422
|
-
readonly lineno: number;
|
|
2423
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
|
2424
|
-
readonly colno: number;
|
|
2425
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
|
2426
|
-
readonly error: any;
|
|
2427
|
-
}
|
|
2428
2788
|
export type WebSocketEventMap = {
|
|
2429
2789
|
close: CloseEvent;
|
|
2430
2790
|
message: MessageEvent;
|
|
2431
2791
|
open: Event;
|
|
2432
2792
|
error: ErrorEvent;
|
|
2433
2793
|
};
|
|
2434
|
-
|
|
2435
|
-
|
|
2794
|
+
/**
|
|
2795
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2796
|
+
*
|
|
2797
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2798
|
+
*/
|
|
2799
|
+
export declare var WebSocket: {
|
|
2800
|
+
prototype: WebSocket;
|
|
2801
|
+
new (url: string, protocols?: string[] | string): WebSocket;
|
|
2802
|
+
readonly READY_STATE_CONNECTING: number;
|
|
2803
|
+
readonly CONNECTING: number;
|
|
2804
|
+
readonly READY_STATE_OPEN: number;
|
|
2805
|
+
readonly OPEN: number;
|
|
2806
|
+
readonly READY_STATE_CLOSING: number;
|
|
2807
|
+
readonly CLOSING: number;
|
|
2808
|
+
readonly READY_STATE_CLOSED: number;
|
|
2809
|
+
readonly CLOSED: number;
|
|
2810
|
+
};
|
|
2811
|
+
/**
|
|
2812
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2813
|
+
*
|
|
2814
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2815
|
+
*/
|
|
2816
|
+
export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2436
2817
|
accept(): void;
|
|
2437
2818
|
/**
|
|
2438
2819
|
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
@@ -2448,38 +2829,30 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
2448
2829
|
close(code?: number, reason?: string): void;
|
|
2449
2830
|
serializeAttachment(attachment: any): void;
|
|
2450
2831
|
deserializeAttachment(): any | null;
|
|
2451
|
-
static readonly READY_STATE_CONNECTING: number;
|
|
2452
|
-
static readonly CONNECTING: number;
|
|
2453
|
-
static readonly READY_STATE_OPEN: number;
|
|
2454
|
-
static readonly OPEN: number;
|
|
2455
|
-
static readonly READY_STATE_CLOSING: number;
|
|
2456
|
-
static readonly CLOSING: number;
|
|
2457
|
-
static readonly READY_STATE_CLOSED: number;
|
|
2458
|
-
static readonly CLOSED: number;
|
|
2459
2832
|
/**
|
|
2460
2833
|
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2461
2834
|
*
|
|
2462
2835
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2463
2836
|
*/
|
|
2464
|
-
|
|
2837
|
+
readyState: number;
|
|
2465
2838
|
/**
|
|
2466
2839
|
* Returns the URL that was used to establish the WebSocket connection.
|
|
2467
2840
|
*
|
|
2468
2841
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2469
2842
|
*/
|
|
2470
|
-
|
|
2843
|
+
url: string | null;
|
|
2471
2844
|
/**
|
|
2472
2845
|
* 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.
|
|
2473
2846
|
*
|
|
2474
2847
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2475
2848
|
*/
|
|
2476
|
-
|
|
2849
|
+
protocol: string | null;
|
|
2477
2850
|
/**
|
|
2478
2851
|
* Returns the extensions selected by the server, if any.
|
|
2479
2852
|
*
|
|
2480
2853
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2481
2854
|
*/
|
|
2482
|
-
|
|
2855
|
+
extensions: string | null;
|
|
2483
2856
|
}
|
|
2484
2857
|
export declare const WebSocketPair: {
|
|
2485
2858
|
new (): {
|
|
@@ -2487,6 +2860,37 @@ export declare const WebSocketPair: {
|
|
|
2487
2860
|
1: WebSocket;
|
|
2488
2861
|
};
|
|
2489
2862
|
};
|
|
2863
|
+
export interface SqlStorage {
|
|
2864
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2865
|
+
query: string,
|
|
2866
|
+
...bindings: any[]
|
|
2867
|
+
): SqlStorageCursor<T>;
|
|
2868
|
+
get databaseSize(): number;
|
|
2869
|
+
Cursor: typeof SqlStorageCursor;
|
|
2870
|
+
Statement: typeof SqlStorageStatement;
|
|
2871
|
+
}
|
|
2872
|
+
export declare abstract class SqlStorageStatement {}
|
|
2873
|
+
export type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2874
|
+
export declare abstract class SqlStorageCursor<
|
|
2875
|
+
T extends Record<string, SqlStorageValue>,
|
|
2876
|
+
> {
|
|
2877
|
+
next():
|
|
2878
|
+
| {
|
|
2879
|
+
done?: false;
|
|
2880
|
+
value: T;
|
|
2881
|
+
}
|
|
2882
|
+
| {
|
|
2883
|
+
done: true;
|
|
2884
|
+
value?: never;
|
|
2885
|
+
};
|
|
2886
|
+
toArray(): T[];
|
|
2887
|
+
one(): T;
|
|
2888
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2889
|
+
columnNames: string[];
|
|
2890
|
+
get rowsRead(): number;
|
|
2891
|
+
get rowsWritten(): number;
|
|
2892
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2893
|
+
}
|
|
2490
2894
|
export interface Socket {
|
|
2491
2895
|
get readable(): ReadableStream;
|
|
2492
2896
|
get writable(): WritableStream;
|
|
@@ -2498,6 +2902,7 @@ export interface Socket {
|
|
|
2498
2902
|
export interface SocketOptions {
|
|
2499
2903
|
secureTransport?: string;
|
|
2500
2904
|
allowHalfOpen: boolean;
|
|
2905
|
+
highWaterMark?: number | bigint;
|
|
2501
2906
|
}
|
|
2502
2907
|
export interface SocketAddress {
|
|
2503
2908
|
hostname: string;
|
|
@@ -2510,65 +2915,61 @@ export interface SocketInfo {
|
|
|
2510
2915
|
remoteAddress?: string;
|
|
2511
2916
|
localAddress?: string;
|
|
2512
2917
|
}
|
|
2513
|
-
export interface
|
|
2514
|
-
requestAdapter(
|
|
2515
|
-
param1?: gpuGPURequestAdapterOptions,
|
|
2516
|
-
): Promise<gpuGPUAdapter | null>;
|
|
2918
|
+
export interface GPU {
|
|
2919
|
+
requestAdapter(param1?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
2517
2920
|
}
|
|
2518
|
-
export declare abstract class
|
|
2519
|
-
requestDevice(param1?:
|
|
2520
|
-
requestAdapterInfo(unmaskHints?: string[]): Promise<
|
|
2521
|
-
get features():
|
|
2522
|
-
get limits():
|
|
2921
|
+
export declare abstract class GPUAdapter {
|
|
2922
|
+
requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
2923
|
+
requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
|
|
2924
|
+
get features(): GPUSupportedFeatures;
|
|
2925
|
+
get limits(): GPUSupportedLimits;
|
|
2523
2926
|
}
|
|
2524
|
-
export interface
|
|
2525
|
-
createBuffer(param1:
|
|
2927
|
+
export interface GPUDevice extends EventTarget {
|
|
2928
|
+
createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
|
|
2526
2929
|
createBindGroupLayout(
|
|
2527
|
-
descriptor:
|
|
2528
|
-
):
|
|
2529
|
-
createBindGroup(descriptor:
|
|
2530
|
-
createSampler(descriptor:
|
|
2531
|
-
createShaderModule(
|
|
2532
|
-
descriptor: gpuGPUShaderModuleDescriptor,
|
|
2533
|
-
): gpuGPUShaderModule;
|
|
2930
|
+
descriptor: GPUBindGroupLayoutDescriptor,
|
|
2931
|
+
): GPUBindGroupLayout;
|
|
2932
|
+
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
2933
|
+
createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
|
|
2934
|
+
createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
|
|
2534
2935
|
createPipelineLayout(
|
|
2535
|
-
descriptor:
|
|
2536
|
-
):
|
|
2936
|
+
descriptor: GPUPipelineLayoutDescriptor,
|
|
2937
|
+
): GPUPipelineLayout;
|
|
2537
2938
|
createComputePipeline(
|
|
2538
|
-
descriptor:
|
|
2539
|
-
):
|
|
2939
|
+
descriptor: GPUComputePipelineDescriptor,
|
|
2940
|
+
): GPUComputePipeline;
|
|
2540
2941
|
createRenderPipeline(
|
|
2541
|
-
descriptor:
|
|
2542
|
-
):
|
|
2942
|
+
descriptor: GPURenderPipelineDescriptor,
|
|
2943
|
+
): GPURenderPipeline;
|
|
2543
2944
|
createCommandEncoder(
|
|
2544
|
-
descriptor?:
|
|
2545
|
-
):
|
|
2546
|
-
createTexture(param1:
|
|
2945
|
+
descriptor?: GPUCommandEncoderDescriptor,
|
|
2946
|
+
): GPUCommandEncoder;
|
|
2947
|
+
createTexture(param1: GPUTextureDescriptor): GPUTexture;
|
|
2547
2948
|
destroy(): void;
|
|
2548
|
-
createQuerySet(descriptor:
|
|
2949
|
+
createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
|
|
2549
2950
|
pushErrorScope(filter: string): void;
|
|
2550
|
-
popErrorScope(): Promise<
|
|
2551
|
-
get queue():
|
|
2552
|
-
get lost(): Promise<
|
|
2553
|
-
get features():
|
|
2554
|
-
get limits():
|
|
2951
|
+
popErrorScope(): Promise<GPUError | null>;
|
|
2952
|
+
get queue(): GPUQueue;
|
|
2953
|
+
get lost(): Promise<GPUDeviceLostInfo>;
|
|
2954
|
+
get features(): GPUSupportedFeatures;
|
|
2955
|
+
get limits(): GPUSupportedLimits;
|
|
2555
2956
|
}
|
|
2556
|
-
export interface
|
|
2957
|
+
export interface GPUDeviceDescriptor {
|
|
2557
2958
|
label?: string;
|
|
2558
2959
|
requiredFeatures?: string[];
|
|
2559
2960
|
requiredLimits?: Record<string, number | bigint>;
|
|
2560
|
-
defaultQueue?:
|
|
2961
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
2561
2962
|
}
|
|
2562
|
-
export interface
|
|
2963
|
+
export interface GPUBufferDescriptor {
|
|
2563
2964
|
label: string;
|
|
2564
2965
|
size: number | bigint;
|
|
2565
2966
|
usage: number;
|
|
2566
2967
|
mappedAtCreation: boolean;
|
|
2567
2968
|
}
|
|
2568
|
-
export interface
|
|
2969
|
+
export interface GPUQueueDescriptor {
|
|
2569
2970
|
label?: string;
|
|
2570
2971
|
}
|
|
2571
|
-
export declare abstract class
|
|
2972
|
+
export declare abstract class GPUBufferUsage {
|
|
2572
2973
|
static readonly MAP_READ: number;
|
|
2573
2974
|
static readonly MAP_WRITE: number;
|
|
2574
2975
|
static readonly COPY_SRC: number;
|
|
@@ -2580,7 +2981,7 @@ export declare abstract class gpuGPUBufferUsage {
|
|
|
2580
2981
|
static readonly INDIRECT: number;
|
|
2581
2982
|
static readonly QUERY_RESOLVE: number;
|
|
2582
2983
|
}
|
|
2583
|
-
export interface
|
|
2984
|
+
export interface GPUBuffer {
|
|
2584
2985
|
getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
|
|
2585
2986
|
unmap(): void;
|
|
2586
2987
|
destroy(): void;
|
|
@@ -2593,59 +2994,59 @@ export interface gpuGPUBuffer {
|
|
|
2593
2994
|
get usage(): number;
|
|
2594
2995
|
get mapState(): string;
|
|
2595
2996
|
}
|
|
2596
|
-
export declare abstract class
|
|
2997
|
+
export declare abstract class GPUShaderStage {
|
|
2597
2998
|
static readonly VERTEX: number;
|
|
2598
2999
|
static readonly FRAGMENT: number;
|
|
2599
3000
|
static readonly COMPUTE: number;
|
|
2600
3001
|
}
|
|
2601
|
-
export interface
|
|
3002
|
+
export interface GPUBindGroupLayoutDescriptor {
|
|
2602
3003
|
label?: string;
|
|
2603
|
-
entries:
|
|
3004
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
2604
3005
|
}
|
|
2605
|
-
export interface
|
|
3006
|
+
export interface GPUBindGroupLayoutEntry {
|
|
2606
3007
|
binding: number;
|
|
2607
3008
|
visibility: number;
|
|
2608
|
-
buffer?:
|
|
2609
|
-
sampler?:
|
|
2610
|
-
texture?:
|
|
2611
|
-
storageTexture?:
|
|
3009
|
+
buffer?: GPUBufferBindingLayout;
|
|
3010
|
+
sampler?: GPUSamplerBindingLayout;
|
|
3011
|
+
texture?: GPUTextureBindingLayout;
|
|
3012
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
2612
3013
|
}
|
|
2613
|
-
export interface
|
|
3014
|
+
export interface GPUStorageTextureBindingLayout {
|
|
2614
3015
|
access?: string;
|
|
2615
3016
|
format: string;
|
|
2616
3017
|
viewDimension?: string;
|
|
2617
3018
|
}
|
|
2618
|
-
export interface
|
|
3019
|
+
export interface GPUTextureBindingLayout {
|
|
2619
3020
|
sampleType?: string;
|
|
2620
3021
|
viewDimension?: string;
|
|
2621
3022
|
multisampled?: boolean;
|
|
2622
3023
|
}
|
|
2623
|
-
export interface
|
|
3024
|
+
export interface GPUSamplerBindingLayout {
|
|
2624
3025
|
type?: string;
|
|
2625
3026
|
}
|
|
2626
|
-
export interface
|
|
3027
|
+
export interface GPUBufferBindingLayout {
|
|
2627
3028
|
type?: string;
|
|
2628
3029
|
hasDynamicOffset?: boolean;
|
|
2629
3030
|
minBindingSize?: number | bigint;
|
|
2630
3031
|
}
|
|
2631
|
-
export interface
|
|
2632
|
-
export interface
|
|
2633
|
-
export interface
|
|
3032
|
+
export interface GPUBindGroupLayout {}
|
|
3033
|
+
export interface GPUBindGroup {}
|
|
3034
|
+
export interface GPUBindGroupDescriptor {
|
|
2634
3035
|
label?: string;
|
|
2635
|
-
layout:
|
|
2636
|
-
entries:
|
|
3036
|
+
layout: GPUBindGroupLayout;
|
|
3037
|
+
entries: GPUBindGroupEntry[];
|
|
2637
3038
|
}
|
|
2638
|
-
export interface
|
|
3039
|
+
export interface GPUBindGroupEntry {
|
|
2639
3040
|
binding: number;
|
|
2640
|
-
resource:
|
|
3041
|
+
resource: GPUBufferBinding | GPUSampler;
|
|
2641
3042
|
}
|
|
2642
|
-
export interface
|
|
2643
|
-
buffer:
|
|
3043
|
+
export interface GPUBufferBinding {
|
|
3044
|
+
buffer: GPUBuffer;
|
|
2644
3045
|
offset?: number | bigint;
|
|
2645
3046
|
size?: number | bigint;
|
|
2646
3047
|
}
|
|
2647
|
-
export interface
|
|
2648
|
-
export interface
|
|
3048
|
+
export interface GPUSampler {}
|
|
3049
|
+
export interface GPUSamplerDescriptor {
|
|
2649
3050
|
label?: string;
|
|
2650
3051
|
addressModeU?: string;
|
|
2651
3052
|
addressModeV?: string;
|
|
@@ -2658,76 +3059,74 @@ export interface gpuGPUSamplerDescriptor {
|
|
|
2658
3059
|
compare: string;
|
|
2659
3060
|
maxAnisotropy?: number;
|
|
2660
3061
|
}
|
|
2661
|
-
export interface
|
|
2662
|
-
getCompilationInfo(): Promise<
|
|
3062
|
+
export interface GPUShaderModule {
|
|
3063
|
+
getCompilationInfo(): Promise<GPUCompilationInfo>;
|
|
2663
3064
|
}
|
|
2664
|
-
export interface
|
|
3065
|
+
export interface GPUShaderModuleDescriptor {
|
|
2665
3066
|
label?: string;
|
|
2666
3067
|
code: string;
|
|
2667
3068
|
}
|
|
2668
|
-
export interface
|
|
2669
|
-
export interface
|
|
3069
|
+
export interface GPUPipelineLayout {}
|
|
3070
|
+
export interface GPUPipelineLayoutDescriptor {
|
|
2670
3071
|
label?: string;
|
|
2671
|
-
bindGroupLayouts:
|
|
3072
|
+
bindGroupLayouts: GPUBindGroupLayout[];
|
|
2672
3073
|
}
|
|
2673
|
-
export interface
|
|
2674
|
-
getBindGroupLayout(index: number):
|
|
3074
|
+
export interface GPUComputePipeline {
|
|
3075
|
+
getBindGroupLayout(index: number): GPUBindGroupLayout;
|
|
2675
3076
|
}
|
|
2676
|
-
export interface
|
|
3077
|
+
export interface GPUComputePipelineDescriptor {
|
|
2677
3078
|
label?: string;
|
|
2678
|
-
compute:
|
|
2679
|
-
layout: string |
|
|
3079
|
+
compute: GPUProgrammableStage;
|
|
3080
|
+
layout: string | GPUPipelineLayout;
|
|
2680
3081
|
}
|
|
2681
|
-
export interface
|
|
2682
|
-
module:
|
|
3082
|
+
export interface GPUProgrammableStage {
|
|
3083
|
+
module: GPUShaderModule;
|
|
2683
3084
|
entryPoint: string;
|
|
2684
3085
|
constants?: Record<string, number>;
|
|
2685
3086
|
}
|
|
2686
|
-
export interface
|
|
3087
|
+
export interface GPUCommandEncoder {
|
|
2687
3088
|
get label(): string;
|
|
2688
3089
|
beginComputePass(
|
|
2689
|
-
descriptor?:
|
|
2690
|
-
):
|
|
2691
|
-
beginRenderPass(
|
|
2692
|
-
descriptor: gpuGPURenderPassDescriptor,
|
|
2693
|
-
): gpuGPURenderPassEncoder;
|
|
3090
|
+
descriptor?: GPUComputePassDescriptor,
|
|
3091
|
+
): GPUComputePassEncoder;
|
|
3092
|
+
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
|
|
2694
3093
|
copyBufferToBuffer(
|
|
2695
|
-
source:
|
|
3094
|
+
source: GPUBuffer,
|
|
2696
3095
|
sourceOffset: number | bigint,
|
|
2697
|
-
destination:
|
|
3096
|
+
destination: GPUBuffer,
|
|
2698
3097
|
destinationOffset: number | bigint,
|
|
2699
3098
|
size: number | bigint,
|
|
2700
3099
|
): void;
|
|
2701
|
-
finish(param0?:
|
|
3100
|
+
finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
|
|
2702
3101
|
copyTextureToBuffer(
|
|
2703
|
-
source:
|
|
2704
|
-
destination:
|
|
2705
|
-
copySize: Iterable<number> |
|
|
3102
|
+
source: GPUImageCopyTexture,
|
|
3103
|
+
destination: GPUImageCopyBuffer,
|
|
3104
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2706
3105
|
): void;
|
|
2707
3106
|
copyBufferToTexture(
|
|
2708
|
-
source:
|
|
2709
|
-
destination:
|
|
2710
|
-
copySize: Iterable<number> |
|
|
3107
|
+
source: GPUImageCopyBuffer,
|
|
3108
|
+
destination: GPUImageCopyTexture,
|
|
3109
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2711
3110
|
): void;
|
|
2712
3111
|
copyTextureToTexture(
|
|
2713
|
-
source:
|
|
2714
|
-
destination:
|
|
2715
|
-
copySize: Iterable<number> |
|
|
3112
|
+
source: GPUImageCopyTexture,
|
|
3113
|
+
destination: GPUImageCopyTexture,
|
|
3114
|
+
copySize: Iterable<number> | GPUExtent3DDict,
|
|
2716
3115
|
): void;
|
|
2717
3116
|
clearBuffer(
|
|
2718
|
-
buffer:
|
|
3117
|
+
buffer: GPUBuffer,
|
|
2719
3118
|
offset?: number | bigint,
|
|
2720
3119
|
size?: number | bigint,
|
|
2721
3120
|
): void;
|
|
2722
3121
|
}
|
|
2723
|
-
export interface
|
|
3122
|
+
export interface GPUCommandEncoderDescriptor {
|
|
2724
3123
|
label?: string;
|
|
2725
3124
|
}
|
|
2726
|
-
export interface
|
|
2727
|
-
setPipeline(pipeline:
|
|
3125
|
+
export interface GPUComputePassEncoder {
|
|
3126
|
+
setPipeline(pipeline: GPUComputePipeline): void;
|
|
2728
3127
|
setBindGroup(
|
|
2729
3128
|
index: number,
|
|
2730
|
-
bindGroup:
|
|
3129
|
+
bindGroup: GPUBindGroup | null,
|
|
2731
3130
|
dynamicOffsets?: Iterable<number>,
|
|
2732
3131
|
): void;
|
|
2733
3132
|
dispatchWorkgroups(
|
|
@@ -2737,52 +3136,52 @@ export interface gpuGPUComputePassEncoder {
|
|
|
2737
3136
|
): void;
|
|
2738
3137
|
end(): void;
|
|
2739
3138
|
}
|
|
2740
|
-
export interface
|
|
3139
|
+
export interface GPUComputePassDescriptor {
|
|
2741
3140
|
label?: string;
|
|
2742
|
-
timestampWrites?:
|
|
3141
|
+
timestampWrites?: GPUComputePassTimestampWrites;
|
|
2743
3142
|
}
|
|
2744
|
-
export interface
|
|
2745
|
-
export interface
|
|
3143
|
+
export interface GPUQuerySet {}
|
|
3144
|
+
export interface GPUQuerySetDescriptor {
|
|
2746
3145
|
label?: string;
|
|
2747
3146
|
}
|
|
2748
|
-
export interface
|
|
2749
|
-
querySet:
|
|
3147
|
+
export interface GPUComputePassTimestampWrites {
|
|
3148
|
+
querySet: GPUQuerySet;
|
|
2750
3149
|
beginningOfPassWriteIndex?: number;
|
|
2751
3150
|
endOfPassWriteIndex?: number;
|
|
2752
3151
|
}
|
|
2753
|
-
export interface
|
|
3152
|
+
export interface GPUCommandBufferDescriptor {
|
|
2754
3153
|
label?: string;
|
|
2755
3154
|
}
|
|
2756
|
-
export interface
|
|
2757
|
-
export interface
|
|
2758
|
-
submit(commandBuffers:
|
|
3155
|
+
export interface GPUCommandBuffer {}
|
|
3156
|
+
export interface GPUQueue {
|
|
3157
|
+
submit(commandBuffers: GPUCommandBuffer[]): void;
|
|
2759
3158
|
writeBuffer(
|
|
2760
|
-
buffer:
|
|
3159
|
+
buffer: GPUBuffer,
|
|
2761
3160
|
bufferOffset: number | bigint,
|
|
2762
3161
|
data: ArrayBuffer | ArrayBufferView,
|
|
2763
3162
|
dataOffset?: number | bigint,
|
|
2764
3163
|
size?: number | bigint,
|
|
2765
3164
|
): void;
|
|
2766
3165
|
}
|
|
2767
|
-
export declare abstract class
|
|
3166
|
+
export declare abstract class GPUMapMode {
|
|
2768
3167
|
static readonly READ: number;
|
|
2769
3168
|
static readonly WRITE: number;
|
|
2770
3169
|
}
|
|
2771
|
-
export interface
|
|
3170
|
+
export interface GPURequestAdapterOptions {
|
|
2772
3171
|
powerPreference: string;
|
|
2773
3172
|
forceFallbackAdapter?: boolean;
|
|
2774
3173
|
}
|
|
2775
|
-
export interface
|
|
3174
|
+
export interface GPUAdapterInfo {
|
|
2776
3175
|
get vendor(): string;
|
|
2777
3176
|
get architecture(): string;
|
|
2778
3177
|
get device(): string;
|
|
2779
3178
|
get description(): string;
|
|
2780
3179
|
}
|
|
2781
|
-
export interface
|
|
3180
|
+
export interface GPUSupportedFeatures {
|
|
2782
3181
|
has(name: string): boolean;
|
|
2783
3182
|
keys(): string[];
|
|
2784
3183
|
}
|
|
2785
|
-
export interface
|
|
3184
|
+
export interface GPUSupportedLimits {
|
|
2786
3185
|
get maxTextureDimension1D(): number;
|
|
2787
3186
|
get maxTextureDimension2D(): number;
|
|
2788
3187
|
get maxTextureDimension3D(): number;
|
|
@@ -2815,17 +3214,17 @@ export interface gpuGPUSupportedLimits {
|
|
|
2815
3214
|
get maxComputeWorkgroupSizeZ(): number;
|
|
2816
3215
|
get maxComputeWorkgroupsPerDimension(): number;
|
|
2817
3216
|
}
|
|
2818
|
-
export declare abstract class
|
|
3217
|
+
export declare abstract class GPUError {
|
|
2819
3218
|
get message(): string;
|
|
2820
3219
|
}
|
|
2821
|
-
export declare abstract class
|
|
2822
|
-
export declare abstract class
|
|
2823
|
-
export declare abstract class
|
|
2824
|
-
export declare abstract class
|
|
3220
|
+
export declare abstract class GPUOutOfMemoryError extends GPUError {}
|
|
3221
|
+
export declare abstract class GPUInternalError extends GPUError {}
|
|
3222
|
+
export declare abstract class GPUValidationError extends GPUError {}
|
|
3223
|
+
export declare abstract class GPUDeviceLostInfo {
|
|
2825
3224
|
get message(): string;
|
|
2826
3225
|
get reason(): string;
|
|
2827
3226
|
}
|
|
2828
|
-
export interface
|
|
3227
|
+
export interface GPUCompilationMessage {
|
|
2829
3228
|
get message(): string;
|
|
2830
3229
|
get type(): string;
|
|
2831
3230
|
get lineNum(): number;
|
|
@@ -2833,19 +3232,19 @@ export interface gpuGPUCompilationMessage {
|
|
|
2833
3232
|
get offset(): number;
|
|
2834
3233
|
get length(): number;
|
|
2835
3234
|
}
|
|
2836
|
-
export interface
|
|
2837
|
-
get messages():
|
|
3235
|
+
export interface GPUCompilationInfo {
|
|
3236
|
+
get messages(): GPUCompilationMessage[];
|
|
2838
3237
|
}
|
|
2839
|
-
export declare abstract class
|
|
3238
|
+
export declare abstract class GPUTextureUsage {
|
|
2840
3239
|
static readonly COPY_SRC: number;
|
|
2841
3240
|
static readonly COPY_DST: number;
|
|
2842
3241
|
static readonly TEXTURE_BINDING: number;
|
|
2843
3242
|
static readonly STORAGE_BINDING: number;
|
|
2844
3243
|
static readonly RENDER_ATTACHMENT: number;
|
|
2845
3244
|
}
|
|
2846
|
-
export interface
|
|
3245
|
+
export interface GPUTextureDescriptor {
|
|
2847
3246
|
label: string;
|
|
2848
|
-
size: number[] |
|
|
3247
|
+
size: number[] | GPUExtent3DDict;
|
|
2849
3248
|
mipLevelCount?: number;
|
|
2850
3249
|
sampleCount?: number;
|
|
2851
3250
|
dimension?: string;
|
|
@@ -2853,13 +3252,13 @@ export interface gpuGPUTextureDescriptor {
|
|
|
2853
3252
|
usage: number;
|
|
2854
3253
|
viewFormats?: string[];
|
|
2855
3254
|
}
|
|
2856
|
-
export interface
|
|
3255
|
+
export interface GPUExtent3DDict {
|
|
2857
3256
|
width: number;
|
|
2858
3257
|
height?: number;
|
|
2859
3258
|
depthOrArrayLayers?: number;
|
|
2860
3259
|
}
|
|
2861
|
-
export interface
|
|
2862
|
-
createView(descriptor?:
|
|
3260
|
+
export interface GPUTexture {
|
|
3261
|
+
createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
2863
3262
|
destroy(): void;
|
|
2864
3263
|
get width(): number;
|
|
2865
3264
|
get height(): number;
|
|
@@ -2869,8 +3268,8 @@ export interface gpuGPUTexture {
|
|
|
2869
3268
|
get format(): string;
|
|
2870
3269
|
get usage(): number;
|
|
2871
3270
|
}
|
|
2872
|
-
export interface
|
|
2873
|
-
export interface
|
|
3271
|
+
export interface GPUTextureView {}
|
|
3272
|
+
export interface GPUTextureViewDescriptor {
|
|
2874
3273
|
label: string;
|
|
2875
3274
|
format: string;
|
|
2876
3275
|
dimension: string;
|
|
@@ -2880,91 +3279,91 @@ export interface gpuGPUTextureViewDescriptor {
|
|
|
2880
3279
|
baseArrayLayer?: number;
|
|
2881
3280
|
arrayLayerCount: number;
|
|
2882
3281
|
}
|
|
2883
|
-
export declare abstract class
|
|
3282
|
+
export declare abstract class GPUColorWrite {
|
|
2884
3283
|
static readonly RED: number;
|
|
2885
3284
|
static readonly GREEN: number;
|
|
2886
3285
|
static readonly BLUE: number;
|
|
2887
3286
|
static readonly ALPHA: number;
|
|
2888
3287
|
static readonly ALL: number;
|
|
2889
3288
|
}
|
|
2890
|
-
export interface
|
|
2891
|
-
export interface
|
|
3289
|
+
export interface GPURenderPipeline {}
|
|
3290
|
+
export interface GPURenderPipelineDescriptor {
|
|
2892
3291
|
label?: string;
|
|
2893
|
-
layout: string |
|
|
2894
|
-
vertex:
|
|
2895
|
-
primitive?:
|
|
2896
|
-
depthStencil?:
|
|
2897
|
-
multisample?:
|
|
2898
|
-
fragment?:
|
|
2899
|
-
}
|
|
2900
|
-
export interface
|
|
2901
|
-
module:
|
|
3292
|
+
layout: string | GPUPipelineLayout;
|
|
3293
|
+
vertex: GPUVertexState;
|
|
3294
|
+
primitive?: GPUPrimitiveState;
|
|
3295
|
+
depthStencil?: GPUDepthStencilState;
|
|
3296
|
+
multisample?: GPUMultisampleState;
|
|
3297
|
+
fragment?: GPUFragmentState;
|
|
3298
|
+
}
|
|
3299
|
+
export interface GPUVertexState {
|
|
3300
|
+
module: GPUShaderModule;
|
|
2902
3301
|
entryPoint: string;
|
|
2903
3302
|
constants?: Record<string, number>;
|
|
2904
|
-
buffers?:
|
|
3303
|
+
buffers?: GPUVertexBufferLayout[];
|
|
2905
3304
|
}
|
|
2906
|
-
export interface
|
|
3305
|
+
export interface GPUVertexBufferLayout {
|
|
2907
3306
|
arrayStride: number | bigint;
|
|
2908
3307
|
stepMode?: string;
|
|
2909
|
-
attributes:
|
|
3308
|
+
attributes: GPUVertexAttribute[];
|
|
2910
3309
|
}
|
|
2911
|
-
export interface
|
|
3310
|
+
export interface GPUVertexAttribute {
|
|
2912
3311
|
format: string;
|
|
2913
3312
|
offset: number | bigint;
|
|
2914
3313
|
shaderLocation: number;
|
|
2915
3314
|
}
|
|
2916
|
-
export interface
|
|
3315
|
+
export interface GPUPrimitiveState {
|
|
2917
3316
|
topology?: string;
|
|
2918
3317
|
stripIndexFormat?: string;
|
|
2919
3318
|
frontFace?: string;
|
|
2920
3319
|
cullMode?: string;
|
|
2921
3320
|
unclippedDepth?: boolean;
|
|
2922
3321
|
}
|
|
2923
|
-
export interface
|
|
3322
|
+
export interface GPUStencilFaceState {
|
|
2924
3323
|
compare?: string;
|
|
2925
3324
|
failOp?: string;
|
|
2926
3325
|
depthFailOp?: string;
|
|
2927
3326
|
passOp?: string;
|
|
2928
3327
|
}
|
|
2929
|
-
export interface
|
|
3328
|
+
export interface GPUDepthStencilState {
|
|
2930
3329
|
format: string;
|
|
2931
3330
|
depthWriteEnabled: boolean;
|
|
2932
3331
|
depthCompare: string;
|
|
2933
|
-
stencilFront?:
|
|
2934
|
-
stencilBack?:
|
|
3332
|
+
stencilFront?: GPUStencilFaceState;
|
|
3333
|
+
stencilBack?: GPUStencilFaceState;
|
|
2935
3334
|
stencilReadMask?: number;
|
|
2936
3335
|
stencilWriteMask?: number;
|
|
2937
3336
|
depthBias?: number;
|
|
2938
3337
|
depthBiasSlopeScale?: number;
|
|
2939
3338
|
depthBiasClamp?: number;
|
|
2940
3339
|
}
|
|
2941
|
-
export interface
|
|
3340
|
+
export interface GPUMultisampleState {
|
|
2942
3341
|
count?: number;
|
|
2943
3342
|
mask?: number;
|
|
2944
3343
|
alphaToCoverageEnabled?: boolean;
|
|
2945
3344
|
}
|
|
2946
|
-
export interface
|
|
2947
|
-
module:
|
|
3345
|
+
export interface GPUFragmentState {
|
|
3346
|
+
module: GPUShaderModule;
|
|
2948
3347
|
entryPoint: string;
|
|
2949
3348
|
constants?: Record<string, number>;
|
|
2950
|
-
targets:
|
|
3349
|
+
targets: GPUColorTargetState[];
|
|
2951
3350
|
}
|
|
2952
|
-
export interface
|
|
3351
|
+
export interface GPUColorTargetState {
|
|
2953
3352
|
format: string;
|
|
2954
|
-
blend:
|
|
3353
|
+
blend: GPUBlendState;
|
|
2955
3354
|
writeMask?: number;
|
|
2956
3355
|
}
|
|
2957
|
-
export interface
|
|
2958
|
-
color:
|
|
2959
|
-
alpha:
|
|
3356
|
+
export interface GPUBlendState {
|
|
3357
|
+
color: GPUBlendComponent;
|
|
3358
|
+
alpha: GPUBlendComponent;
|
|
2960
3359
|
}
|
|
2961
|
-
export interface
|
|
3360
|
+
export interface GPUBlendComponent {
|
|
2962
3361
|
operation?: string;
|
|
2963
3362
|
srcFactor?: string;
|
|
2964
3363
|
dstFactor?: string;
|
|
2965
3364
|
}
|
|
2966
|
-
export interface
|
|
2967
|
-
setPipeline(pipeline:
|
|
3365
|
+
export interface GPURenderPassEncoder {
|
|
3366
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2968
3367
|
draw(
|
|
2969
3368
|
vertexCount: number,
|
|
2970
3369
|
instanceCount?: number,
|
|
@@ -2973,30 +3372,30 @@ export interface gpuGPURenderPassEncoder {
|
|
|
2973
3372
|
): void;
|
|
2974
3373
|
end(): void;
|
|
2975
3374
|
}
|
|
2976
|
-
export interface
|
|
3375
|
+
export interface GPURenderPassDescriptor {
|
|
2977
3376
|
label?: string;
|
|
2978
|
-
colorAttachments:
|
|
2979
|
-
depthStencilAttachment?:
|
|
2980
|
-
occlusionQuerySet?:
|
|
2981
|
-
timestampWrites?:
|
|
3377
|
+
colorAttachments: GPURenderPassColorAttachment[];
|
|
3378
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
3379
|
+
occlusionQuerySet?: GPUQuerySet;
|
|
3380
|
+
timestampWrites?: GPURenderPassTimestampWrites;
|
|
2982
3381
|
maxDrawCount?: number | bigint;
|
|
2983
3382
|
}
|
|
2984
|
-
export interface
|
|
2985
|
-
view:
|
|
3383
|
+
export interface GPURenderPassColorAttachment {
|
|
3384
|
+
view: GPUTextureView;
|
|
2986
3385
|
depthSlice?: number;
|
|
2987
|
-
resolveTarget?:
|
|
2988
|
-
clearValue?: number[] |
|
|
3386
|
+
resolveTarget?: GPUTextureView;
|
|
3387
|
+
clearValue?: number[] | GPUColorDict;
|
|
2989
3388
|
loadOp: string;
|
|
2990
3389
|
storeOp: string;
|
|
2991
3390
|
}
|
|
2992
|
-
export interface
|
|
3391
|
+
export interface GPUColorDict {
|
|
2993
3392
|
r: number;
|
|
2994
3393
|
g: number;
|
|
2995
3394
|
b: number;
|
|
2996
3395
|
a: number;
|
|
2997
3396
|
}
|
|
2998
|
-
export interface
|
|
2999
|
-
view:
|
|
3397
|
+
export interface GPURenderPassDepthStencilAttachment {
|
|
3398
|
+
view: GPUTextureView;
|
|
3000
3399
|
depthClearValue?: number;
|
|
3001
3400
|
depthLoadOp?: string;
|
|
3002
3401
|
depthStoreOp?: string;
|
|
@@ -3006,112 +3405,991 @@ export interface gpuGPURenderPassDepthStencilAttachment {
|
|
|
3006
3405
|
stencilStoreOp?: string;
|
|
3007
3406
|
stencilReadOnly?: boolean;
|
|
3008
3407
|
}
|
|
3009
|
-
export interface
|
|
3010
|
-
querySet:
|
|
3408
|
+
export interface GPURenderPassTimestampWrites {
|
|
3409
|
+
querySet: GPUQuerySet;
|
|
3011
3410
|
beginningOfPassWriteIndex?: number;
|
|
3012
3411
|
endOfPassWriteIndex?: number;
|
|
3013
3412
|
}
|
|
3014
|
-
export interface
|
|
3015
|
-
texture:
|
|
3413
|
+
export interface GPUImageCopyTexture {
|
|
3414
|
+
texture: GPUTexture;
|
|
3016
3415
|
mipLevel?: number;
|
|
3017
|
-
origin?: number[] |
|
|
3416
|
+
origin?: number[] | GPUOrigin3DDict;
|
|
3018
3417
|
aspect?: string;
|
|
3019
3418
|
}
|
|
3020
|
-
export interface
|
|
3021
|
-
buffer:
|
|
3419
|
+
export interface GPUImageCopyBuffer {
|
|
3420
|
+
buffer: GPUBuffer;
|
|
3022
3421
|
offset?: number | bigint;
|
|
3023
3422
|
bytesPerRow?: number;
|
|
3024
3423
|
rowsPerImage?: number;
|
|
3025
3424
|
}
|
|
3026
|
-
export interface
|
|
3425
|
+
export interface GPUOrigin3DDict {
|
|
3027
3426
|
x?: number;
|
|
3028
3427
|
y?: number;
|
|
3029
3428
|
z?: number;
|
|
3030
3429
|
}
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
*/
|
|
3035
|
-
width?: number;
|
|
3036
|
-
/**
|
|
3037
|
-
* Maximum height in image pixels. The value must be an integer.
|
|
3038
|
-
*/
|
|
3039
|
-
height?: number;
|
|
3430
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3431
|
+
export declare class EventSource extends EventTarget {
|
|
3432
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3040
3433
|
/**
|
|
3041
|
-
*
|
|
3042
|
-
*
|
|
3043
|
-
*
|
|
3044
|
-
* the image is larger than given width or height, it will be resized.
|
|
3045
|
-
* Otherwise its original size will be kept.
|
|
3046
|
-
* - contain: Resizes to maximum size that fits within the given width and
|
|
3047
|
-
* height. If only a single dimension is given (e.g. only width), the
|
|
3048
|
-
* image will be shrunk or enlarged to exactly match that dimension.
|
|
3049
|
-
* Aspect ratio is always preserved.
|
|
3050
|
-
* - cover: Resizes (shrinks or enlarges) to fill the entire area of width
|
|
3051
|
-
* and height. If the image has an aspect ratio different from the ratio
|
|
3052
|
-
* of width and height, it will be cropped to fit.
|
|
3053
|
-
* - crop: The image will be shrunk and cropped to fit within the area
|
|
3054
|
-
* specified by width and height. The image will not be enlarged. For images
|
|
3055
|
-
* smaller than the given dimensions it's the same as scale-down. For
|
|
3056
|
-
* images larger than the given dimensions, it's the same as cover.
|
|
3057
|
-
* See also trim.
|
|
3058
|
-
* - pad: Resizes to the maximum size that fits within the given width and
|
|
3059
|
-
* height, and then fills the remaining area with a background color
|
|
3060
|
-
* (white by default). Use of this mode is not recommended, as the same
|
|
3061
|
-
* effect can be more efficiently achieved with the contain mode and the
|
|
3062
|
-
* CSS object-fit: contain property.
|
|
3434
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
3435
|
+
*
|
|
3436
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3063
3437
|
*/
|
|
3064
|
-
|
|
3438
|
+
close(): void;
|
|
3065
3439
|
/**
|
|
3066
|
-
*
|
|
3067
|
-
*
|
|
3068
|
-
*
|
|
3069
|
-
* or an object {x, y} containing focal point coordinates in the original
|
|
3070
|
-
* image expressed as fractions ranging from 0.0 (top or left) to 1.0
|
|
3071
|
-
* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
|
|
3072
|
-
* crop bottom or left and right sides as necessary, but won’t crop anything
|
|
3073
|
-
* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
|
|
3074
|
-
* preserve as much as possible around a point at 20% of the height of the
|
|
3075
|
-
* source image.
|
|
3440
|
+
* Returns the URL providing the event stream.
|
|
3441
|
+
*
|
|
3442
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3076
3443
|
*/
|
|
3077
|
-
|
|
3078
|
-
| "left"
|
|
3079
|
-
| "right"
|
|
3080
|
-
| "top"
|
|
3081
|
-
| "bottom"
|
|
3082
|
-
| "center"
|
|
3083
|
-
| "auto"
|
|
3084
|
-
| BasicImageTransformationsGravityCoordinates;
|
|
3444
|
+
get url(): string;
|
|
3085
3445
|
/**
|
|
3086
|
-
*
|
|
3087
|
-
*
|
|
3088
|
-
*
|
|
3446
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3447
|
+
*
|
|
3448
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3089
3449
|
*/
|
|
3090
|
-
|
|
3450
|
+
get withCredentials(): boolean;
|
|
3091
3451
|
/**
|
|
3092
|
-
*
|
|
3093
|
-
*
|
|
3452
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3453
|
+
*
|
|
3454
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3094
3455
|
*/
|
|
3095
|
-
|
|
3456
|
+
get readyState(): number;
|
|
3457
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3458
|
+
get onopen(): any | null;
|
|
3459
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3460
|
+
set onopen(value: any | null);
|
|
3461
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3462
|
+
get onmessage(): any | null;
|
|
3463
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3464
|
+
set onmessage(value: any | null);
|
|
3465
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3466
|
+
get onerror(): any | null;
|
|
3467
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3468
|
+
set onerror(value: any | null);
|
|
3469
|
+
static readonly CONNECTING: number;
|
|
3470
|
+
static readonly OPEN: number;
|
|
3471
|
+
static readonly CLOSED: number;
|
|
3472
|
+
static from(stream: ReadableStream): EventSource;
|
|
3096
3473
|
}
|
|
3097
|
-
export interface
|
|
3098
|
-
|
|
3099
|
-
|
|
3474
|
+
export interface EventSourceEventSourceInit {
|
|
3475
|
+
withCredentials?: boolean;
|
|
3476
|
+
fetcher?: Fetcher;
|
|
3100
3477
|
}
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3478
|
+
export type AiImageClassificationInput = {
|
|
3479
|
+
image: number[];
|
|
3480
|
+
};
|
|
3481
|
+
export type AiImageClassificationOutput = {
|
|
3482
|
+
score?: number;
|
|
3483
|
+
label?: string;
|
|
3484
|
+
}[];
|
|
3485
|
+
export declare abstract class BaseAiImageClassification {
|
|
3486
|
+
inputs: AiImageClassificationInput;
|
|
3487
|
+
postProcessedOutputs: AiImageClassificationOutput;
|
|
3488
|
+
}
|
|
3489
|
+
export type AiImageToTextInput = {
|
|
3490
|
+
image: number[];
|
|
3491
|
+
prompt?: string;
|
|
3492
|
+
max_tokens?: number;
|
|
3493
|
+
temperature?: number;
|
|
3494
|
+
top_p?: number;
|
|
3495
|
+
top_k?: number;
|
|
3496
|
+
seed?: number;
|
|
3497
|
+
repetition_penalty?: number;
|
|
3498
|
+
frequency_penalty?: number;
|
|
3499
|
+
presence_penalty?: number;
|
|
3500
|
+
raw?: boolean;
|
|
3501
|
+
messages?: RoleScopedChatInput[];
|
|
3502
|
+
};
|
|
3503
|
+
export type AiImageToTextOutput = {
|
|
3504
|
+
description: string;
|
|
3505
|
+
};
|
|
3506
|
+
export declare abstract class BaseAiImageToText {
|
|
3507
|
+
inputs: AiImageToTextInput;
|
|
3508
|
+
postProcessedOutputs: AiImageToTextOutput;
|
|
3509
|
+
}
|
|
3510
|
+
export type AiObjectDetectionInput = {
|
|
3511
|
+
image: number[];
|
|
3512
|
+
};
|
|
3513
|
+
export type AiObjectDetectionOutput = {
|
|
3514
|
+
score?: number;
|
|
3515
|
+
label?: string;
|
|
3516
|
+
}[];
|
|
3517
|
+
export declare abstract class BaseAiObjectDetection {
|
|
3518
|
+
inputs: AiObjectDetectionInput;
|
|
3519
|
+
postProcessedOutputs: AiObjectDetectionOutput;
|
|
3520
|
+
}
|
|
3521
|
+
export type AiSentenceSimilarityInput = {
|
|
3522
|
+
source: string;
|
|
3523
|
+
sentences: string[];
|
|
3524
|
+
};
|
|
3525
|
+
export type AiSentenceSimilarityOutput = number[];
|
|
3526
|
+
export declare abstract class BaseAiSentenceSimilarity {
|
|
3527
|
+
inputs: AiSentenceSimilarityInput;
|
|
3528
|
+
postProcessedOutputs: AiSentenceSimilarityOutput;
|
|
3529
|
+
}
|
|
3530
|
+
export type AiAutomaticSpeechRecognitionInput = {
|
|
3531
|
+
audio: number[];
|
|
3532
|
+
};
|
|
3533
|
+
export type AiAutomaticSpeechRecognitionOutput = {
|
|
3534
|
+
text?: string;
|
|
3535
|
+
words?: {
|
|
3536
|
+
word: string;
|
|
3537
|
+
start: number;
|
|
3538
|
+
end: number;
|
|
3539
|
+
}[];
|
|
3540
|
+
vtt?: string;
|
|
3541
|
+
};
|
|
3542
|
+
export declare abstract class BaseAiAutomaticSpeechRecognition {
|
|
3543
|
+
inputs: AiAutomaticSpeechRecognitionInput;
|
|
3544
|
+
postProcessedOutputs: AiAutomaticSpeechRecognitionOutput;
|
|
3545
|
+
}
|
|
3546
|
+
export type AiSummarizationInput = {
|
|
3547
|
+
input_text: string;
|
|
3548
|
+
max_length?: number;
|
|
3549
|
+
};
|
|
3550
|
+
export type AiSummarizationOutput = {
|
|
3551
|
+
summary: string;
|
|
3552
|
+
};
|
|
3553
|
+
export declare abstract class BaseAiSummarization {
|
|
3554
|
+
inputs: AiSummarizationInput;
|
|
3555
|
+
postProcessedOutputs: AiSummarizationOutput;
|
|
3556
|
+
}
|
|
3557
|
+
export type AiTextClassificationInput = {
|
|
3558
|
+
text: string;
|
|
3559
|
+
};
|
|
3560
|
+
export type AiTextClassificationOutput = {
|
|
3561
|
+
score?: number;
|
|
3562
|
+
label?: string;
|
|
3563
|
+
}[];
|
|
3564
|
+
export declare abstract class BaseAiTextClassification {
|
|
3565
|
+
inputs: AiTextClassificationInput;
|
|
3566
|
+
postProcessedOutputs: AiTextClassificationOutput;
|
|
3567
|
+
}
|
|
3568
|
+
export type AiTextEmbeddingsInput = {
|
|
3569
|
+
text: string | string[];
|
|
3570
|
+
};
|
|
3571
|
+
export type AiTextEmbeddingsOutput = {
|
|
3572
|
+
shape: number[];
|
|
3573
|
+
data: number[][];
|
|
3574
|
+
};
|
|
3575
|
+
export declare abstract class BaseAiTextEmbeddings {
|
|
3576
|
+
inputs: AiTextEmbeddingsInput;
|
|
3577
|
+
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3578
|
+
}
|
|
3579
|
+
export type RoleScopedChatInput = {
|
|
3580
|
+
role:
|
|
3581
|
+
| "user"
|
|
3582
|
+
| "assistant"
|
|
3583
|
+
| "system"
|
|
3584
|
+
| "tool"
|
|
3585
|
+
| (string & NonNullable<unknown>);
|
|
3586
|
+
content: string;
|
|
3587
|
+
name?: string;
|
|
3588
|
+
};
|
|
3589
|
+
export type AiTextGenerationToolLegacyInput = {
|
|
3590
|
+
name: string;
|
|
3591
|
+
description: string;
|
|
3592
|
+
parameters?: {
|
|
3593
|
+
type: "object" | (string & NonNullable<unknown>);
|
|
3594
|
+
properties: {
|
|
3595
|
+
[key: string]: {
|
|
3596
|
+
type: string;
|
|
3597
|
+
description?: string;
|
|
3598
|
+
};
|
|
3599
|
+
};
|
|
3600
|
+
required: string[];
|
|
3601
|
+
};
|
|
3602
|
+
};
|
|
3603
|
+
export type AiTextGenerationToolInput = {
|
|
3604
|
+
type: "function" | (string & NonNullable<unknown>);
|
|
3605
|
+
function: {
|
|
3606
|
+
name: string;
|
|
3607
|
+
description: string;
|
|
3608
|
+
parameters?: {
|
|
3609
|
+
type: "object" | (string & NonNullable<unknown>);
|
|
3610
|
+
properties: {
|
|
3611
|
+
[key: string]: {
|
|
3612
|
+
type: string;
|
|
3613
|
+
description?: string;
|
|
3614
|
+
};
|
|
3615
|
+
};
|
|
3616
|
+
required: string[];
|
|
3617
|
+
};
|
|
3618
|
+
};
|
|
3619
|
+
};
|
|
3620
|
+
export type AiTextGenerationFunctionsInput = {
|
|
3621
|
+
name: string;
|
|
3622
|
+
code: string;
|
|
3623
|
+
};
|
|
3624
|
+
export type AiTextGenerationInput = {
|
|
3625
|
+
prompt?: string;
|
|
3626
|
+
raw?: boolean;
|
|
3627
|
+
stream?: boolean;
|
|
3628
|
+
max_tokens?: number;
|
|
3629
|
+
temperature?: number;
|
|
3630
|
+
top_p?: number;
|
|
3631
|
+
top_k?: number;
|
|
3632
|
+
seed?: number;
|
|
3633
|
+
repetition_penalty?: number;
|
|
3634
|
+
frequency_penalty?: number;
|
|
3635
|
+
presence_penalty?: number;
|
|
3636
|
+
messages?: RoleScopedChatInput[];
|
|
3637
|
+
tools?:
|
|
3638
|
+
| AiTextGenerationToolInput[]
|
|
3639
|
+
| AiTextGenerationToolLegacyInput[]
|
|
3640
|
+
| (object & NonNullable<unknown>);
|
|
3641
|
+
functions?: AiTextGenerationFunctionsInput[];
|
|
3642
|
+
};
|
|
3643
|
+
export type AiTextGenerationOutput =
|
|
3644
|
+
| {
|
|
3645
|
+
response?: string;
|
|
3646
|
+
tool_calls?: {
|
|
3647
|
+
name: string;
|
|
3648
|
+
arguments: unknown;
|
|
3649
|
+
}[];
|
|
3650
|
+
}
|
|
3651
|
+
| ReadableStream;
|
|
3652
|
+
export declare abstract class BaseAiTextGeneration {
|
|
3653
|
+
inputs: AiTextGenerationInput;
|
|
3654
|
+
postProcessedOutputs: AiTextGenerationOutput;
|
|
3655
|
+
}
|
|
3656
|
+
export type AiTextToSpeechInput = {
|
|
3657
|
+
prompt: string;
|
|
3658
|
+
lang?: string;
|
|
3659
|
+
};
|
|
3660
|
+
export type AiTextToSpeechOutput =
|
|
3661
|
+
| Uint8Array
|
|
3662
|
+
| {
|
|
3663
|
+
audio: string;
|
|
3664
|
+
};
|
|
3665
|
+
export declare abstract class BaseAiTextToSpeech {
|
|
3666
|
+
inputs: AiTextToSpeechInput;
|
|
3667
|
+
postProcessedOutputs: AiTextToSpeechOutput;
|
|
3668
|
+
}
|
|
3669
|
+
export type AiTextToImageInput = {
|
|
3670
|
+
prompt: string;
|
|
3671
|
+
negative_prompt?: string;
|
|
3672
|
+
height?: number;
|
|
3673
|
+
width?: number;
|
|
3674
|
+
image?: number[];
|
|
3675
|
+
image_b64?: string;
|
|
3676
|
+
mask?: number[];
|
|
3677
|
+
num_steps?: number;
|
|
3678
|
+
strength?: number;
|
|
3679
|
+
guidance?: number;
|
|
3680
|
+
seed?: number;
|
|
3681
|
+
};
|
|
3682
|
+
export type AiTextToImageOutput = ReadableStream<Uint8Array>;
|
|
3683
|
+
export declare abstract class BaseAiTextToImage {
|
|
3684
|
+
inputs: AiTextToImageInput;
|
|
3685
|
+
postProcessedOutputs: AiTextToImageOutput;
|
|
3686
|
+
}
|
|
3687
|
+
export type AiTranslationInput = {
|
|
3688
|
+
text: string;
|
|
3689
|
+
target_lang: string;
|
|
3690
|
+
source_lang?: string;
|
|
3691
|
+
};
|
|
3692
|
+
export type AiTranslationOutput = {
|
|
3693
|
+
translated_text?: string;
|
|
3694
|
+
};
|
|
3695
|
+
export declare abstract class BaseAiTranslation {
|
|
3696
|
+
inputs: AiTranslationInput;
|
|
3697
|
+
postProcessedOutputs: AiTranslationOutput;
|
|
3698
|
+
}
|
|
3699
|
+
export type Ai_Cf_Openai_Whisper_Input =
|
|
3700
|
+
| string
|
|
3701
|
+
| {
|
|
3702
|
+
/**
|
|
3703
|
+
* An array of integers that represent the audio data constrained to 8-bit unsigned integer values
|
|
3704
|
+
*/
|
|
3705
|
+
audio: number[];
|
|
3706
|
+
};
|
|
3707
|
+
export interface Ai_Cf_Openai_Whisper_Output {
|
|
3708
|
+
/**
|
|
3709
|
+
* The transcription
|
|
3710
|
+
*/
|
|
3711
|
+
text: string;
|
|
3712
|
+
word_count?: number;
|
|
3713
|
+
words?: {
|
|
3714
|
+
word?: string;
|
|
3715
|
+
/**
|
|
3716
|
+
* The second this word begins in the recording
|
|
3717
|
+
*/
|
|
3718
|
+
start?: number;
|
|
3719
|
+
/**
|
|
3720
|
+
* The ending second when the word completes
|
|
3721
|
+
*/
|
|
3722
|
+
end?: number;
|
|
3723
|
+
}[];
|
|
3724
|
+
vtt?: string;
|
|
3725
|
+
}
|
|
3726
|
+
export declare abstract class Base_Ai_Cf_Openai_Whisper {
|
|
3727
|
+
inputs: Ai_Cf_Openai_Whisper_Input;
|
|
3728
|
+
postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
|
|
3729
|
+
}
|
|
3730
|
+
export type Ai_Cf_Openai_Whisper_Tiny_En_Input =
|
|
3731
|
+
| string
|
|
3732
|
+
| {
|
|
3733
|
+
/**
|
|
3734
|
+
* An array of integers that represent the audio data constrained to 8-bit unsigned integer values
|
|
3735
|
+
*/
|
|
3736
|
+
audio: number[];
|
|
3737
|
+
};
|
|
3738
|
+
export interface Ai_Cf_Openai_Whisper_Tiny_En_Output {
|
|
3739
|
+
/**
|
|
3740
|
+
* The transcription
|
|
3741
|
+
*/
|
|
3742
|
+
text: string;
|
|
3743
|
+
word_count?: number;
|
|
3744
|
+
words?: {
|
|
3745
|
+
word?: string;
|
|
3746
|
+
/**
|
|
3747
|
+
* The second this word begins in the recording
|
|
3748
|
+
*/
|
|
3749
|
+
start?: number;
|
|
3750
|
+
/**
|
|
3751
|
+
* The ending second when the word completes
|
|
3752
|
+
*/
|
|
3753
|
+
end?: number;
|
|
3754
|
+
}[];
|
|
3755
|
+
vtt?: string;
|
|
3756
|
+
}
|
|
3757
|
+
export declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
|
|
3758
|
+
inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input;
|
|
3759
|
+
postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;
|
|
3760
|
+
}
|
|
3761
|
+
export interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
|
|
3762
|
+
/**
|
|
3763
|
+
* Base64 encoded value of the audio data.
|
|
3764
|
+
*/
|
|
3765
|
+
audio: string;
|
|
3766
|
+
/**
|
|
3767
|
+
* Supported tasks are 'translate' or 'transcribe'.
|
|
3768
|
+
*/
|
|
3769
|
+
task?: string;
|
|
3770
|
+
/**
|
|
3771
|
+
* The language of the audio being transcribed or translated.
|
|
3772
|
+
*/
|
|
3773
|
+
language?: string;
|
|
3774
|
+
/**
|
|
3775
|
+
* Preprocess the audio with a voice activity detection model.
|
|
3776
|
+
*/
|
|
3777
|
+
vad_filter?: string;
|
|
3778
|
+
/**
|
|
3779
|
+
* A text prompt to help provide context to the model on the contents of the audio.
|
|
3780
|
+
*/
|
|
3781
|
+
initial_prompt?: string;
|
|
3782
|
+
/**
|
|
3783
|
+
* The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
|
|
3784
|
+
*/
|
|
3785
|
+
prefix?: string;
|
|
3786
|
+
}
|
|
3787
|
+
export interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
|
|
3788
|
+
transcription_info?: {
|
|
3789
|
+
/**
|
|
3790
|
+
* The language of the audio being transcribed or translated.
|
|
3791
|
+
*/
|
|
3792
|
+
language?: string;
|
|
3793
|
+
/**
|
|
3794
|
+
* The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1.
|
|
3795
|
+
*/
|
|
3796
|
+
language_probability?: number;
|
|
3797
|
+
/**
|
|
3798
|
+
* The total duration of the original audio file, in seconds.
|
|
3799
|
+
*/
|
|
3800
|
+
duration?: number;
|
|
3801
|
+
/**
|
|
3802
|
+
* The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds.
|
|
3803
|
+
*/
|
|
3804
|
+
duration_after_vad?: number;
|
|
3805
|
+
};
|
|
3806
|
+
/**
|
|
3807
|
+
* The complete transcription of the audio.
|
|
3808
|
+
*/
|
|
3809
|
+
text: string;
|
|
3810
|
+
/**
|
|
3811
|
+
* The total number of words in the transcription.
|
|
3812
|
+
*/
|
|
3813
|
+
word_count?: number;
|
|
3814
|
+
segments?: {
|
|
3815
|
+
/**
|
|
3816
|
+
* The starting time of the segment within the audio, in seconds.
|
|
3817
|
+
*/
|
|
3818
|
+
start?: number;
|
|
3819
|
+
/**
|
|
3820
|
+
* The ending time of the segment within the audio, in seconds.
|
|
3821
|
+
*/
|
|
3822
|
+
end?: number;
|
|
3823
|
+
/**
|
|
3824
|
+
* The transcription of the segment.
|
|
3825
|
+
*/
|
|
3826
|
+
text?: string;
|
|
3827
|
+
/**
|
|
3828
|
+
* The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs.
|
|
3829
|
+
*/
|
|
3830
|
+
temperature?: number;
|
|
3831
|
+
/**
|
|
3832
|
+
* The average log probability of the predictions for the words in this segment, indicating overall confidence.
|
|
3833
|
+
*/
|
|
3834
|
+
avg_logprob?: number;
|
|
3835
|
+
/**
|
|
3836
|
+
* The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process.
|
|
3837
|
+
*/
|
|
3838
|
+
compression_ratio?: number;
|
|
3839
|
+
/**
|
|
3840
|
+
* The probability that the segment contains no speech, represented as a decimal between 0 and 1.
|
|
3841
|
+
*/
|
|
3842
|
+
no_speech_prob?: number;
|
|
3843
|
+
words?: {
|
|
3844
|
+
/**
|
|
3845
|
+
* The individual word transcribed from the audio.
|
|
3846
|
+
*/
|
|
3847
|
+
word?: string;
|
|
3848
|
+
/**
|
|
3849
|
+
* The starting time of the word within the audio, in seconds.
|
|
3850
|
+
*/
|
|
3851
|
+
start?: number;
|
|
3852
|
+
/**
|
|
3853
|
+
* The ending time of the word within the audio, in seconds.
|
|
3854
|
+
*/
|
|
3855
|
+
end?: number;
|
|
3856
|
+
}[];
|
|
3857
|
+
};
|
|
3858
|
+
/**
|
|
3859
|
+
* The transcription in WebVTT format, which includes timing and text information for use in subtitles.
|
|
3860
|
+
*/
|
|
3861
|
+
vtt?: string;
|
|
3862
|
+
}
|
|
3863
|
+
export declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
|
|
3864
|
+
inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
|
|
3865
|
+
postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
|
|
3866
|
+
}
|
|
3867
|
+
export interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
|
|
3868
|
+
/**
|
|
3869
|
+
* A text description of the image you want to generate.
|
|
3870
|
+
*/
|
|
3871
|
+
prompt: string;
|
|
3872
|
+
/**
|
|
3873
|
+
* The number of diffusion steps; higher values can improve quality but take longer.
|
|
3874
|
+
*/
|
|
3875
|
+
steps?: number;
|
|
3876
|
+
}
|
|
3877
|
+
export interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output {
|
|
3878
|
+
/**
|
|
3879
|
+
* The generated image in Base64 format.
|
|
3880
|
+
*/
|
|
3881
|
+
image?: string;
|
|
3882
|
+
}
|
|
3883
|
+
export declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell {
|
|
3884
|
+
inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input;
|
|
3885
|
+
postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output;
|
|
3886
|
+
}
|
|
3887
|
+
export type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Prompt | Messages;
|
|
3888
|
+
export interface Prompt {
|
|
3889
|
+
/**
|
|
3890
|
+
* The input text prompt for the model to generate a response.
|
|
3891
|
+
*/
|
|
3892
|
+
prompt: string;
|
|
3893
|
+
image?: number[] | (string & NonNullable<unknown>);
|
|
3894
|
+
/**
|
|
3895
|
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
|
|
3896
|
+
*/
|
|
3897
|
+
raw?: boolean;
|
|
3898
|
+
/**
|
|
3899
|
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
|
|
3900
|
+
*/
|
|
3901
|
+
stream?: boolean;
|
|
3902
|
+
/**
|
|
3903
|
+
* The maximum number of tokens to generate in the response.
|
|
3904
|
+
*/
|
|
3905
|
+
max_tokens?: number;
|
|
3906
|
+
/**
|
|
3907
|
+
* Controls the randomness of the output; higher values produce more random results.
|
|
3908
|
+
*/
|
|
3909
|
+
temperature?: number;
|
|
3910
|
+
/**
|
|
3911
|
+
* 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.
|
|
3912
|
+
*/
|
|
3913
|
+
top_p?: number;
|
|
3914
|
+
/**
|
|
3915
|
+
* 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.
|
|
3916
|
+
*/
|
|
3917
|
+
top_k?: number;
|
|
3918
|
+
/**
|
|
3919
|
+
* Random seed for reproducibility of the generation.
|
|
3920
|
+
*/
|
|
3921
|
+
seed?: number;
|
|
3922
|
+
/**
|
|
3923
|
+
* Penalty for repeated tokens; higher values discourage repetition.
|
|
3924
|
+
*/
|
|
3925
|
+
repetition_penalty?: number;
|
|
3926
|
+
/**
|
|
3927
|
+
* Decreases the likelihood of the model repeating the same lines verbatim.
|
|
3928
|
+
*/
|
|
3929
|
+
frequency_penalty?: number;
|
|
3930
|
+
/**
|
|
3931
|
+
* Increases the likelihood of the model introducing new topics.
|
|
3932
|
+
*/
|
|
3933
|
+
presence_penalty?: number;
|
|
3934
|
+
/**
|
|
3935
|
+
* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
|
|
3936
|
+
*/
|
|
3937
|
+
lora?: string;
|
|
3938
|
+
}
|
|
3939
|
+
export interface Messages {
|
|
3940
|
+
/**
|
|
3941
|
+
* An array of message objects representing the conversation history.
|
|
3942
|
+
*/
|
|
3943
|
+
messages: {
|
|
3944
|
+
/**
|
|
3945
|
+
* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
|
|
3946
|
+
*/
|
|
3947
|
+
role: string;
|
|
3948
|
+
/**
|
|
3949
|
+
* The content of the message as a string.
|
|
3950
|
+
*/
|
|
3951
|
+
content: string;
|
|
3952
|
+
}[];
|
|
3953
|
+
image?: number[] | string;
|
|
3954
|
+
functions?: {
|
|
3955
|
+
name: string;
|
|
3956
|
+
code: string;
|
|
3957
|
+
}[];
|
|
3958
|
+
/**
|
|
3959
|
+
* A list of tools available for the assistant to use.
|
|
3960
|
+
*/
|
|
3961
|
+
tools?: (
|
|
3962
|
+
| {
|
|
3963
|
+
/**
|
|
3964
|
+
* The name of the tool. More descriptive the better.
|
|
3965
|
+
*/
|
|
3966
|
+
name: string;
|
|
3967
|
+
/**
|
|
3968
|
+
* A brief description of what the tool does.
|
|
3969
|
+
*/
|
|
3970
|
+
description: string;
|
|
3971
|
+
/**
|
|
3972
|
+
* Schema defining the parameters accepted by the tool.
|
|
3973
|
+
*/
|
|
3974
|
+
parameters: {
|
|
3975
|
+
/**
|
|
3976
|
+
* The type of the parameters object (usually 'object').
|
|
3977
|
+
*/
|
|
3978
|
+
type: string;
|
|
3979
|
+
/**
|
|
3980
|
+
* List of required parameter names.
|
|
3981
|
+
*/
|
|
3982
|
+
required?: string[];
|
|
3983
|
+
/**
|
|
3984
|
+
* Definitions of each parameter.
|
|
3985
|
+
*/
|
|
3986
|
+
properties: {
|
|
3987
|
+
[k: string]: {
|
|
3988
|
+
/**
|
|
3989
|
+
* The data type of the parameter.
|
|
3990
|
+
*/
|
|
3991
|
+
type: string;
|
|
3992
|
+
/**
|
|
3993
|
+
* A description of the expected parameter.
|
|
3994
|
+
*/
|
|
3995
|
+
description: string;
|
|
3996
|
+
};
|
|
3997
|
+
};
|
|
3998
|
+
};
|
|
3999
|
+
}
|
|
4000
|
+
| {
|
|
4001
|
+
/**
|
|
4002
|
+
* Specifies the type of tool (e.g., 'function').
|
|
4003
|
+
*/
|
|
4004
|
+
type: string;
|
|
4005
|
+
/**
|
|
4006
|
+
* Details of the function tool.
|
|
4007
|
+
*/
|
|
4008
|
+
function: {
|
|
4009
|
+
/**
|
|
4010
|
+
* The name of the function.
|
|
4011
|
+
*/
|
|
4012
|
+
name: string;
|
|
4013
|
+
/**
|
|
4014
|
+
* A brief description of what the function does.
|
|
4015
|
+
*/
|
|
4016
|
+
description: string;
|
|
4017
|
+
/**
|
|
4018
|
+
* Schema defining the parameters accepted by the function.
|
|
4019
|
+
*/
|
|
4020
|
+
parameters: {
|
|
4021
|
+
/**
|
|
4022
|
+
* The type of the parameters object (usually 'object').
|
|
4023
|
+
*/
|
|
4024
|
+
type: string;
|
|
4025
|
+
/**
|
|
4026
|
+
* List of required parameter names.
|
|
4027
|
+
*/
|
|
4028
|
+
required?: string[];
|
|
4029
|
+
/**
|
|
4030
|
+
* Definitions of each parameter.
|
|
4031
|
+
*/
|
|
4032
|
+
properties: {
|
|
4033
|
+
[k: string]: {
|
|
4034
|
+
/**
|
|
4035
|
+
* The data type of the parameter.
|
|
4036
|
+
*/
|
|
4037
|
+
type: string;
|
|
4038
|
+
/**
|
|
4039
|
+
* A description of the expected parameter.
|
|
4040
|
+
*/
|
|
4041
|
+
description: string;
|
|
4042
|
+
};
|
|
4043
|
+
};
|
|
4044
|
+
};
|
|
4045
|
+
};
|
|
4046
|
+
}
|
|
4047
|
+
)[];
|
|
4048
|
+
/**
|
|
4049
|
+
* If true, the response will be streamed back incrementally.
|
|
4050
|
+
*/
|
|
4051
|
+
stream?: boolean;
|
|
4052
|
+
/**
|
|
4053
|
+
* The maximum number of tokens to generate in the response.
|
|
4054
|
+
*/
|
|
4055
|
+
max_tokens?: number;
|
|
4056
|
+
/**
|
|
4057
|
+
* Controls the randomness of the output; higher values produce more random results.
|
|
4058
|
+
*/
|
|
4059
|
+
temperature?: number;
|
|
4060
|
+
/**
|
|
4061
|
+
* Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
|
|
4062
|
+
*/
|
|
4063
|
+
top_p?: number;
|
|
4064
|
+
/**
|
|
4065
|
+
* 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.
|
|
4066
|
+
*/
|
|
4067
|
+
top_k?: number;
|
|
4068
|
+
/**
|
|
4069
|
+
* Random seed for reproducibility of the generation.
|
|
4070
|
+
*/
|
|
4071
|
+
seed?: number;
|
|
4072
|
+
/**
|
|
4073
|
+
* Penalty for repeated tokens; higher values discourage repetition.
|
|
4074
|
+
*/
|
|
4075
|
+
repetition_penalty?: number;
|
|
4076
|
+
/**
|
|
4077
|
+
* Decreases the likelihood of the model repeating the same lines verbatim.
|
|
4078
|
+
*/
|
|
4079
|
+
frequency_penalty?: number;
|
|
4080
|
+
/**
|
|
4081
|
+
* Increases the likelihood of the model introducing new topics.
|
|
4082
|
+
*/
|
|
4083
|
+
presence_penalty?: number;
|
|
4084
|
+
}
|
|
4085
|
+
export type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output =
|
|
4086
|
+
| {
|
|
4087
|
+
/**
|
|
4088
|
+
* The generated text response from the model
|
|
4089
|
+
*/
|
|
4090
|
+
response?: string;
|
|
4091
|
+
/**
|
|
4092
|
+
* An array of tool calls requests made during the response generation
|
|
4093
|
+
*/
|
|
4094
|
+
tool_calls?: {
|
|
4095
|
+
/**
|
|
4096
|
+
* The arguments passed to be passed to the tool call request
|
|
4097
|
+
*/
|
|
4098
|
+
arguments?: object;
|
|
4099
|
+
/**
|
|
4100
|
+
* The name of the tool to be called
|
|
4101
|
+
*/
|
|
4102
|
+
name?: string;
|
|
4103
|
+
}[];
|
|
4104
|
+
}
|
|
4105
|
+
| ReadableStream;
|
|
4106
|
+
export declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct {
|
|
4107
|
+
inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input;
|
|
4108
|
+
postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output;
|
|
4109
|
+
}
|
|
4110
|
+
export interface AiModels {
|
|
4111
|
+
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
|
4112
|
+
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
|
4113
|
+
"@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
|
|
4114
|
+
"@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
|
|
4115
|
+
"@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
|
|
4116
|
+
"@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
|
|
4117
|
+
"@cf/baai/bge-base-en-v1.5": BaseAiTextEmbeddings;
|
|
4118
|
+
"@cf/baai/bge-small-en-v1.5": BaseAiTextEmbeddings;
|
|
4119
|
+
"@cf/baai/bge-large-en-v1.5": BaseAiTextEmbeddings;
|
|
4120
|
+
"@cf/microsoft/resnet-50": BaseAiImageClassification;
|
|
4121
|
+
"@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
|
|
4122
|
+
"@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
|
|
4123
|
+
"@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
|
|
4124
|
+
"@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
|
|
4125
|
+
"@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
|
|
4126
|
+
"@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
|
|
4127
|
+
"@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
|
|
4128
|
+
"@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
|
|
4129
|
+
"@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
|
|
4130
|
+
"@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
|
|
4131
|
+
"@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
|
|
4132
|
+
"@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
|
|
4133
|
+
"@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
|
|
4134
|
+
"@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
|
|
4135
|
+
"@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
|
|
4136
|
+
"@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
|
|
4137
|
+
"@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
|
|
4138
|
+
"@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
|
|
4139
|
+
"@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
|
|
4140
|
+
"@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
|
|
4141
|
+
"@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
|
|
4142
|
+
"@cf/microsoft/phi-2": BaseAiTextGeneration;
|
|
4143
|
+
"@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
|
|
4144
|
+
"@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
|
|
4145
|
+
"@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
|
|
4146
|
+
"@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
|
|
4147
|
+
"@hf/google/gemma-7b-it": BaseAiTextGeneration;
|
|
4148
|
+
"@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
|
|
4149
|
+
"@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
|
|
4150
|
+
"@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
|
|
4151
|
+
"@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
|
|
4152
|
+
"@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
|
|
4153
|
+
"@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
|
|
4154
|
+
"@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
|
|
4155
|
+
"@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
|
|
4156
|
+
"@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
|
|
4157
|
+
"@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
|
|
4158
|
+
"@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
|
|
4159
|
+
"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
|
|
4160
|
+
"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
|
|
4161
|
+
"@cf/meta/llama-3.3-70b-instruct-fp8-fast": BaseAiTextGeneration;
|
|
4162
|
+
"@cf/meta/m2m100-1.2b": BaseAiTranslation;
|
|
4163
|
+
"@cf/facebook/bart-large-cnn": BaseAiSummarization;
|
|
4164
|
+
"@cf/unum/uform-gen2-qwen-500m": BaseAiImageToText;
|
|
4165
|
+
"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
|
|
4166
|
+
"@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
|
|
4167
|
+
"@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
|
|
4168
|
+
"@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
|
|
4169
|
+
"@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
|
|
4170
|
+
"@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
|
|
4171
|
+
}
|
|
4172
|
+
export type AiOptions = {
|
|
4173
|
+
gateway?: GatewayOptions;
|
|
4174
|
+
prefix?: string;
|
|
4175
|
+
extraHeaders?: object;
|
|
4176
|
+
};
|
|
4177
|
+
export type AiModelsSearchParams = {
|
|
4178
|
+
author?: string;
|
|
4179
|
+
hide_experimental?: boolean;
|
|
4180
|
+
page?: number;
|
|
4181
|
+
per_page?: number;
|
|
4182
|
+
search?: string;
|
|
4183
|
+
source?: number;
|
|
4184
|
+
task?: string;
|
|
4185
|
+
};
|
|
4186
|
+
export type AiModelsSearchObject = {
|
|
4187
|
+
id: string;
|
|
4188
|
+
source: number;
|
|
4189
|
+
name: string;
|
|
4190
|
+
description: string;
|
|
4191
|
+
task: {
|
|
4192
|
+
id: string;
|
|
4193
|
+
name: string;
|
|
4194
|
+
description: string;
|
|
4195
|
+
};
|
|
4196
|
+
tags: string[];
|
|
4197
|
+
properties: {
|
|
4198
|
+
property_id: string;
|
|
4199
|
+
value: string;
|
|
4200
|
+
}[];
|
|
4201
|
+
};
|
|
4202
|
+
export interface InferenceUpstreamError extends Error {}
|
|
4203
|
+
export interface AiInternalError extends Error {}
|
|
4204
|
+
export type AiModelListType = Record<string, any>;
|
|
4205
|
+
export declare abstract class Ai<
|
|
4206
|
+
AiModelList extends AiModelListType = AiModels,
|
|
4207
|
+
> {
|
|
4208
|
+
aiGatewayLogId: string | null;
|
|
4209
|
+
gateway(gatewayId: string): AiGateway;
|
|
4210
|
+
run<Name extends keyof AiModelList>(
|
|
4211
|
+
model: Name,
|
|
4212
|
+
inputs: AiModelList[Name]["inputs"],
|
|
4213
|
+
options?: AiOptions,
|
|
4214
|
+
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
4215
|
+
public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
4216
|
+
}
|
|
4217
|
+
export type GatewayOptions = {
|
|
4218
|
+
id: string;
|
|
4219
|
+
cacheKey?: string;
|
|
4220
|
+
cacheTtl?: number;
|
|
4221
|
+
skipCache?: boolean;
|
|
4222
|
+
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
4223
|
+
collectLog?: boolean;
|
|
4224
|
+
};
|
|
4225
|
+
export type AiGatewayPatchLog = {
|
|
4226
|
+
score?: number | null;
|
|
4227
|
+
feedback?: -1 | 1 | null;
|
|
4228
|
+
metadata?: Record<string, number | string | boolean | null | bigint> | null;
|
|
4229
|
+
};
|
|
4230
|
+
export type AiGatewayLog = {
|
|
4231
|
+
id: string;
|
|
4232
|
+
provider: string;
|
|
4233
|
+
model: string;
|
|
4234
|
+
model_type?: string;
|
|
4235
|
+
path: string;
|
|
4236
|
+
duration: number;
|
|
4237
|
+
request_type?: string;
|
|
4238
|
+
request_content_type?: string;
|
|
4239
|
+
status_code: number;
|
|
4240
|
+
response_content_type?: string;
|
|
4241
|
+
success: boolean;
|
|
4242
|
+
cached: boolean;
|
|
4243
|
+
tokens_in?: number;
|
|
4244
|
+
tokens_out?: number;
|
|
4245
|
+
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
4246
|
+
step?: number;
|
|
4247
|
+
cost?: number;
|
|
4248
|
+
custom_cost?: boolean;
|
|
4249
|
+
request_size: number;
|
|
4250
|
+
request_head?: string;
|
|
4251
|
+
request_head_complete: boolean;
|
|
4252
|
+
response_size: number;
|
|
4253
|
+
response_head?: string;
|
|
4254
|
+
response_head_complete: boolean;
|
|
4255
|
+
created_at: Date;
|
|
4256
|
+
};
|
|
4257
|
+
export type AIGatewayProviders =
|
|
4258
|
+
| "workers-ai"
|
|
4259
|
+
| "anthropic"
|
|
4260
|
+
| "aws-bedrock"
|
|
4261
|
+
| "azure-openai"
|
|
4262
|
+
| "google-vertex-ai"
|
|
4263
|
+
| "huggingface"
|
|
4264
|
+
| "openai"
|
|
4265
|
+
| "perplexity-ai"
|
|
4266
|
+
| "replicate"
|
|
4267
|
+
| "groq"
|
|
4268
|
+
| "cohere"
|
|
4269
|
+
| "google-ai-studio"
|
|
4270
|
+
| "mistral"
|
|
4271
|
+
| "grok"
|
|
4272
|
+
| "openrouter";
|
|
4273
|
+
export type AIGatewayHeaders = {
|
|
4274
|
+
"cf-aig-metadata":
|
|
4275
|
+
| Record<string, number | string | boolean | null | bigint>
|
|
4276
|
+
| string;
|
|
4277
|
+
"cf-aig-custom-cost":
|
|
4278
|
+
| {
|
|
4279
|
+
per_token_in?: number;
|
|
4280
|
+
per_token_out?: number;
|
|
4281
|
+
}
|
|
4282
|
+
| {
|
|
4283
|
+
total_cost?: number;
|
|
4284
|
+
}
|
|
4285
|
+
| string;
|
|
4286
|
+
"cf-aig-cache-ttl": number | string;
|
|
4287
|
+
"cf-aig-skip-cache": boolean | string;
|
|
4288
|
+
"cf-aig-cache-key": string;
|
|
4289
|
+
"cf-aig-collect-log": boolean | string;
|
|
4290
|
+
Authorization: string;
|
|
4291
|
+
"Content-Type": string;
|
|
4292
|
+
[key: string]: string | number | boolean | object;
|
|
4293
|
+
};
|
|
4294
|
+
export type AIGatewayUniversalRequest = {
|
|
4295
|
+
provider: AIGatewayProviders | string; // eslint-disable-line
|
|
4296
|
+
endpoint: string;
|
|
4297
|
+
headers: Partial<AIGatewayHeaders>;
|
|
4298
|
+
query: unknown;
|
|
4299
|
+
};
|
|
4300
|
+
export interface AiGatewayInternalError extends Error {}
|
|
4301
|
+
export interface AiGatewayLogNotFound extends Error {}
|
|
4302
|
+
export declare abstract class AiGateway {
|
|
4303
|
+
patchLog(logId: string, data: AiGatewayPatchLog): Promise<void>;
|
|
4304
|
+
getLog(logId: string): Promise<AiGatewayLog>;
|
|
4305
|
+
run(
|
|
4306
|
+
data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[],
|
|
4307
|
+
): Promise<Response>;
|
|
4308
|
+
}
|
|
4309
|
+
export interface BasicImageTransformations {
|
|
4310
|
+
/**
|
|
4311
|
+
* Maximum width in image pixels. The value must be an integer.
|
|
4312
|
+
*/
|
|
4313
|
+
width?: number;
|
|
4314
|
+
/**
|
|
4315
|
+
* Maximum height in image pixels. The value must be an integer.
|
|
4316
|
+
*/
|
|
4317
|
+
height?: number;
|
|
4318
|
+
/**
|
|
4319
|
+
* Resizing mode as a string. It affects interpretation of width and height
|
|
4320
|
+
* options:
|
|
4321
|
+
* - scale-down: Similar to contain, but the image is never enlarged. If
|
|
4322
|
+
* the image is larger than given width or height, it will be resized.
|
|
4323
|
+
* Otherwise its original size will be kept.
|
|
4324
|
+
* - contain: Resizes to maximum size that fits within the given width and
|
|
4325
|
+
* height. If only a single dimension is given (e.g. only width), the
|
|
4326
|
+
* image will be shrunk or enlarged to exactly match that dimension.
|
|
4327
|
+
* Aspect ratio is always preserved.
|
|
4328
|
+
* - cover: Resizes (shrinks or enlarges) to fill the entire area of width
|
|
4329
|
+
* and height. If the image has an aspect ratio different from the ratio
|
|
4330
|
+
* of width and height, it will be cropped to fit.
|
|
4331
|
+
* - crop: The image will be shrunk and cropped to fit within the area
|
|
4332
|
+
* specified by width and height. The image will not be enlarged. For images
|
|
4333
|
+
* smaller than the given dimensions it's the same as scale-down. For
|
|
4334
|
+
* images larger than the given dimensions, it's the same as cover.
|
|
4335
|
+
* See also trim.
|
|
4336
|
+
* - pad: Resizes to the maximum size that fits within the given width and
|
|
4337
|
+
* height, and then fills the remaining area with a background color
|
|
4338
|
+
* (white by default). Use of this mode is not recommended, as the same
|
|
4339
|
+
* effect can be more efficiently achieved with the contain mode and the
|
|
4340
|
+
* CSS object-fit: contain property.
|
|
4341
|
+
*/
|
|
4342
|
+
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
|
|
4343
|
+
/**
|
|
4344
|
+
* When cropping with fit: "cover", this defines the side or point that should
|
|
4345
|
+
* be left uncropped. The value is either a string
|
|
4346
|
+
* "left", "right", "top", "bottom", "auto", or "center" (the default),
|
|
4347
|
+
* or an object {x, y} containing focal point coordinates in the original
|
|
4348
|
+
* image expressed as fractions ranging from 0.0 (top or left) to 1.0
|
|
4349
|
+
* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
|
|
4350
|
+
* crop bottom or left and right sides as necessary, but won’t crop anything
|
|
4351
|
+
* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
|
|
4352
|
+
* preserve as much as possible around a point at 20% of the height of the
|
|
4353
|
+
* source image.
|
|
4354
|
+
*/
|
|
4355
|
+
gravity?:
|
|
4356
|
+
| "left"
|
|
4357
|
+
| "right"
|
|
4358
|
+
| "top"
|
|
4359
|
+
| "bottom"
|
|
4360
|
+
| "center"
|
|
4361
|
+
| "auto"
|
|
4362
|
+
| BasicImageTransformationsGravityCoordinates;
|
|
4363
|
+
/**
|
|
4364
|
+
* Background color to add underneath the image. Applies only to images with
|
|
4365
|
+
* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
|
|
4366
|
+
* hsl(…), etc.)
|
|
4367
|
+
*/
|
|
4368
|
+
background?: string;
|
|
4369
|
+
/**
|
|
4370
|
+
* Number of degrees (90, 180, 270) to rotate the image by. width and height
|
|
4371
|
+
* options refer to axes after rotation.
|
|
4372
|
+
*/
|
|
4373
|
+
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
4374
|
+
}
|
|
4375
|
+
export interface BasicImageTransformationsGravityCoordinates {
|
|
4376
|
+
x: number;
|
|
4377
|
+
y: number;
|
|
4378
|
+
}
|
|
4379
|
+
/**
|
|
4380
|
+
* In addition to the properties you can set in the RequestInit dict
|
|
4381
|
+
* that you pass as an argument to the Request constructor, you can
|
|
4382
|
+
* set certain properties of a `cf` object to control how Cloudflare
|
|
4383
|
+
* features are applied to that new Request.
|
|
4384
|
+
*
|
|
4385
|
+
* Note: Currently, these properties cannot be tested in the
|
|
4386
|
+
* playground.
|
|
4387
|
+
*/
|
|
4388
|
+
export interface RequestInitCfProperties extends Record<string, unknown> {
|
|
4389
|
+
cacheEverything?: boolean;
|
|
4390
|
+
/**
|
|
4391
|
+
* A request's cache key is what determines if two requests are
|
|
4392
|
+
* "the same" for caching purposes. If a request has the same cache key
|
|
3115
4393
|
* as some previous request, then we can serve the same cached response for
|
|
3116
4394
|
* both. (e.g. 'some-key')
|
|
3117
4395
|
*
|
|
@@ -3142,6 +4420,7 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
3142
4420
|
minify?: RequestInitCfPropertiesImageMinify;
|
|
3143
4421
|
mirage?: boolean;
|
|
3144
4422
|
polish?: "lossy" | "lossless" | "off";
|
|
4423
|
+
r2?: RequestInitCfPropertiesR2;
|
|
3145
4424
|
/**
|
|
3146
4425
|
* Redirects the request to an alternate origin server. You can use this,
|
|
3147
4426
|
* for example, to implement load balancing across several origins.
|
|
@@ -3326,6 +4605,12 @@ export interface RequestInitCfPropertiesImageMinify {
|
|
|
3326
4605
|
css?: boolean;
|
|
3327
4606
|
html?: boolean;
|
|
3328
4607
|
}
|
|
4608
|
+
export interface RequestInitCfPropertiesR2 {
|
|
4609
|
+
/**
|
|
4610
|
+
* Colo id of bucket that an object is stored in
|
|
4611
|
+
*/
|
|
4612
|
+
bucketColoId?: number;
|
|
4613
|
+
}
|
|
3329
4614
|
/**
|
|
3330
4615
|
* Request metadata provided by Cloudflare's edge.
|
|
3331
4616
|
*/
|
|
@@ -3718,7 +5003,7 @@ export interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
|
|
|
3718
5003
|
certNotAfter: "";
|
|
3719
5004
|
}
|
|
3720
5005
|
/** Possible outcomes of TLS verification */
|
|
3721
|
-
export type CertVerificationStatus =
|
|
5006
|
+
export declare type CertVerificationStatus =
|
|
3722
5007
|
/** Authentication succeeded */
|
|
3723
5008
|
| "SUCCESS"
|
|
3724
5009
|
/** No certificate was presented */
|
|
@@ -3736,7 +5021,7 @@ export type CertVerificationStatus =
|
|
|
3736
5021
|
/**
|
|
3737
5022
|
* An upstream endpoint's response to a TCP `keepalive` message from Cloudflare.
|
|
3738
5023
|
*/
|
|
3739
|
-
export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
5024
|
+
export declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
3740
5025
|
| 0 /** Unknown */
|
|
3741
5026
|
| 1 /** no keepalives (not found) */
|
|
3742
5027
|
| 2 /** no connection re-use, opening keepalive connection failed */
|
|
@@ -3744,7 +5029,7 @@ export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
|
|
|
3744
5029
|
| 4 /** connection re-use, refused by the origin server (`TCP FIN`) */
|
|
3745
5030
|
| 5; /** connection re-use, accepted by the origin server */
|
|
3746
5031
|
/** ISO 3166-1 Alpha-2 codes */
|
|
3747
|
-
export type Iso3166Alpha2Code =
|
|
5032
|
+
export declare type Iso3166Alpha2Code =
|
|
3748
5033
|
| "AD"
|
|
3749
5034
|
| "AE"
|
|
3750
5035
|
| "AF"
|
|
@@ -3995,7 +5280,14 @@ export type Iso3166Alpha2Code =
|
|
|
3995
5280
|
| "ZM"
|
|
3996
5281
|
| "ZW";
|
|
3997
5282
|
/** The 2-letter continent codes Cloudflare uses */
|
|
3998
|
-
export type ContinentCode =
|
|
5283
|
+
export declare type ContinentCode =
|
|
5284
|
+
| "AF"
|
|
5285
|
+
| "AN"
|
|
5286
|
+
| "AS"
|
|
5287
|
+
| "EU"
|
|
5288
|
+
| "NA"
|
|
5289
|
+
| "OC"
|
|
5290
|
+
| "SA";
|
|
3999
5291
|
export type CfProperties<HostMetadata = unknown> =
|
|
4000
5292
|
| IncomingRequestCfProperties<HostMetadata>
|
|
4001
5293
|
| RequestInitCfProperties;
|
|
@@ -4030,7 +5322,7 @@ export declare abstract class D1PreparedStatement {
|
|
|
4030
5322
|
bind(...values: unknown[]): D1PreparedStatement;
|
|
4031
5323
|
first<T = unknown>(colName: string): Promise<T | null>;
|
|
4032
5324
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
4033
|
-
run(): Promise<
|
|
5325
|
+
run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4034
5326
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4035
5327
|
raw<T = unknown[]>(options: {
|
|
4036
5328
|
columnNames: true;
|
|
@@ -4086,6 +5378,12 @@ export interface ForwardableEmailMessage extends EmailMessage {
|
|
|
4086
5378
|
* @returns A promise that resolves when the email message is forwarded.
|
|
4087
5379
|
*/
|
|
4088
5380
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
5381
|
+
/**
|
|
5382
|
+
* Reply to the sender of this email message with a new EmailMessage object.
|
|
5383
|
+
* @param message The reply message.
|
|
5384
|
+
* @returns A promise that resolves when the email message is replied.
|
|
5385
|
+
*/
|
|
5386
|
+
reply(message: EmailMessage): Promise<void>;
|
|
4089
5387
|
}
|
|
4090
5388
|
/**
|
|
4091
5389
|
* A binding that allows a Worker to send email messages.
|
|
@@ -4096,7 +5394,7 @@ export interface SendEmail {
|
|
|
4096
5394
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
4097
5395
|
readonly message: ForwardableEmailMessage;
|
|
4098
5396
|
}
|
|
4099
|
-
export type EmailExportedHandler<Env = unknown> = (
|
|
5397
|
+
export declare type EmailExportedHandler<Env = unknown> = (
|
|
4100
5398
|
message: ForwardableEmailMessage,
|
|
4101
5399
|
env: Env,
|
|
4102
5400
|
ctx: ExecutionContext,
|
|
@@ -4148,6 +5446,128 @@ export interface Hyperdrive {
|
|
|
4148
5446
|
*/
|
|
4149
5447
|
readonly database: string;
|
|
4150
5448
|
}
|
|
5449
|
+
// Copyright (c) 2024 Cloudflare, Inc.
|
|
5450
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
5451
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
5452
|
+
export type ImageInfoResponse =
|
|
5453
|
+
| {
|
|
5454
|
+
format: "image/svg+xml";
|
|
5455
|
+
}
|
|
5456
|
+
| {
|
|
5457
|
+
format: string;
|
|
5458
|
+
fileSize: number;
|
|
5459
|
+
width: number;
|
|
5460
|
+
height: number;
|
|
5461
|
+
};
|
|
5462
|
+
export type ImageTransform = {
|
|
5463
|
+
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
5464
|
+
gravity?:
|
|
5465
|
+
| "left"
|
|
5466
|
+
| "right"
|
|
5467
|
+
| "top"
|
|
5468
|
+
| "bottom"
|
|
5469
|
+
| "center"
|
|
5470
|
+
| "auto"
|
|
5471
|
+
| "entropy"
|
|
5472
|
+
| "face"
|
|
5473
|
+
| {
|
|
5474
|
+
x?: number;
|
|
5475
|
+
y?: number;
|
|
5476
|
+
mode: "remainder" | "box-center";
|
|
5477
|
+
};
|
|
5478
|
+
trim?: {
|
|
5479
|
+
top?: number;
|
|
5480
|
+
bottom?: number;
|
|
5481
|
+
left?: number;
|
|
5482
|
+
right?: number;
|
|
5483
|
+
width?: number;
|
|
5484
|
+
height?: number;
|
|
5485
|
+
border?:
|
|
5486
|
+
| boolean
|
|
5487
|
+
| {
|
|
5488
|
+
color?: string;
|
|
5489
|
+
tolerance?: number;
|
|
5490
|
+
keep?: number;
|
|
5491
|
+
};
|
|
5492
|
+
};
|
|
5493
|
+
width?: number;
|
|
5494
|
+
height?: number;
|
|
5495
|
+
background?: string;
|
|
5496
|
+
rotate?: number;
|
|
5497
|
+
sharpen?: number;
|
|
5498
|
+
blur?: number;
|
|
5499
|
+
contrast?: number;
|
|
5500
|
+
brightness?: number;
|
|
5501
|
+
gamma?: number;
|
|
5502
|
+
border?: {
|
|
5503
|
+
color?: string;
|
|
5504
|
+
width?: number;
|
|
5505
|
+
top?: number;
|
|
5506
|
+
bottom?: number;
|
|
5507
|
+
left?: number;
|
|
5508
|
+
right?: number;
|
|
5509
|
+
};
|
|
5510
|
+
zoom?: number;
|
|
5511
|
+
};
|
|
5512
|
+
export type ImageOutputOptions = {
|
|
5513
|
+
format:
|
|
5514
|
+
| "image/jpeg"
|
|
5515
|
+
| "image/png"
|
|
5516
|
+
| "image/gif"
|
|
5517
|
+
| "image/webp"
|
|
5518
|
+
| "image/avif"
|
|
5519
|
+
| "rgb"
|
|
5520
|
+
| "rgba";
|
|
5521
|
+
quality?: number;
|
|
5522
|
+
background?: string;
|
|
5523
|
+
};
|
|
5524
|
+
export interface ImagesBinding {
|
|
5525
|
+
/**
|
|
5526
|
+
* Get image metadata (type, width and height)
|
|
5527
|
+
* @throws {@link ImagesError} with code 9412 if input is not an image
|
|
5528
|
+
* @param stream The image bytes
|
|
5529
|
+
*/
|
|
5530
|
+
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
|
|
5531
|
+
/**
|
|
5532
|
+
* Begin applying a series of transformations to an image
|
|
5533
|
+
* @param stream The image bytes
|
|
5534
|
+
* @returns A transform handle
|
|
5535
|
+
*/
|
|
5536
|
+
input(stream: ReadableStream<Uint8Array>): ImageTransformer;
|
|
5537
|
+
}
|
|
5538
|
+
export interface ImageTransformer {
|
|
5539
|
+
/**
|
|
5540
|
+
* Apply transform next, returning a transform handle.
|
|
5541
|
+
* You can then apply more transformations or retrieve the output.
|
|
5542
|
+
* @param transform
|
|
5543
|
+
*/
|
|
5544
|
+
transform(transform: ImageTransform): ImageTransformer;
|
|
5545
|
+
/**
|
|
5546
|
+
* Retrieve the image that results from applying the transforms to the
|
|
5547
|
+
* provided input
|
|
5548
|
+
* @param options Options that apply to the output e.g. output format
|
|
5549
|
+
*/
|
|
5550
|
+
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
|
|
5551
|
+
}
|
|
5552
|
+
export interface ImageTransformationResult {
|
|
5553
|
+
/**
|
|
5554
|
+
* The image as a response, ready to store in cache or return to users
|
|
5555
|
+
*/
|
|
5556
|
+
response(): Response;
|
|
5557
|
+
/**
|
|
5558
|
+
* The content type of the returned image
|
|
5559
|
+
*/
|
|
5560
|
+
contentType(): string;
|
|
5561
|
+
/**
|
|
5562
|
+
* The bytes of the response
|
|
5563
|
+
*/
|
|
5564
|
+
image(): ReadableStream<Uint8Array>;
|
|
5565
|
+
}
|
|
5566
|
+
export interface ImagesError extends Error {
|
|
5567
|
+
readonly code: number;
|
|
5568
|
+
readonly message: string;
|
|
5569
|
+
readonly stack?: string;
|
|
5570
|
+
}
|
|
4151
5571
|
export type Params<P extends string = any> = Record<P, string | string[]>;
|
|
4152
5572
|
export type EventContext<Env, P extends string, Data> = {
|
|
4153
5573
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
@@ -4191,6 +5611,30 @@ export type PagesPluginFunction<
|
|
|
4191
5611
|
> = (
|
|
4192
5612
|
context: EventPluginContext<Env, Params, Data, PluginArgs>,
|
|
4193
5613
|
) => Response | Promise<Response>;
|
|
5614
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
5615
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
5616
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
5617
|
+
export declare abstract class PipelineTransform {
|
|
5618
|
+
/**
|
|
5619
|
+
* transformJson recieves an array of javascript objects which can be
|
|
5620
|
+
* mutated and returned to the pipeline
|
|
5621
|
+
* @param data The data to be mutated
|
|
5622
|
+
* @returns A promise containing the mutated data
|
|
5623
|
+
*/
|
|
5624
|
+
public transformJson(data: object[]): Promise<object[]>;
|
|
5625
|
+
}
|
|
5626
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
5627
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
5628
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
5629
|
+
export interface Pipeline {
|
|
5630
|
+
/**
|
|
5631
|
+
* send takes an array of javascript objects which are
|
|
5632
|
+
* then received by the pipeline for processing
|
|
5633
|
+
*
|
|
5634
|
+
* @param data The data to be sent
|
|
5635
|
+
*/
|
|
5636
|
+
send(data: object[]): Promise<void>;
|
|
5637
|
+
}
|
|
4194
5638
|
// PubSubMessage represents an incoming PubSub message.
|
|
4195
5639
|
// The message includes metadata about the broker, the client, and the payload
|
|
4196
5640
|
// itself.
|
|
@@ -4225,6 +5669,20 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
|
|
|
4225
5669
|
// Key Identifier of the JWK
|
|
4226
5670
|
readonly kid: string;
|
|
4227
5671
|
}
|
|
5672
|
+
export interface RateLimitOptions {
|
|
5673
|
+
key: string;
|
|
5674
|
+
}
|
|
5675
|
+
export interface RateLimitOutcome {
|
|
5676
|
+
success: boolean;
|
|
5677
|
+
}
|
|
5678
|
+
export interface RateLimit {
|
|
5679
|
+
/**
|
|
5680
|
+
* Rate limit a request based on the provided options.
|
|
5681
|
+
* @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
|
|
5682
|
+
* @returns A promise that resolves with the outcome of the rate limit.
|
|
5683
|
+
*/
|
|
5684
|
+
limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
|
|
5685
|
+
}
|
|
4228
5686
|
// Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
|
|
4229
5687
|
// to referenced by `Fetcher`. This is included in the "importable" version of the types which
|
|
4230
5688
|
// strips all `module` blocks.
|
|
@@ -4237,6 +5695,7 @@ export declare namespace Rpc {
|
|
|
4237
5695
|
export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
|
|
4238
5696
|
export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
|
|
4239
5697
|
export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
|
|
5698
|
+
export const __WORKFLOW_ENTRYPOINT_BRAND: "__WORKFLOW_ENTRYPOINT_BRAND";
|
|
4240
5699
|
export interface RpcTargetBranded {
|
|
4241
5700
|
[__RPC_TARGET_BRAND]: never;
|
|
4242
5701
|
}
|
|
@@ -4246,13 +5705,20 @@ export declare namespace Rpc {
|
|
|
4246
5705
|
export interface DurableObjectBranded {
|
|
4247
5706
|
[__DURABLE_OBJECT_BRAND]: never;
|
|
4248
5707
|
}
|
|
5708
|
+
export interface WorkflowEntrypointBranded {
|
|
5709
|
+
[__WORKFLOW_ENTRYPOINT_BRAND]: never;
|
|
5710
|
+
}
|
|
4249
5711
|
export type EntrypointBranded =
|
|
4250
5712
|
| WorkerEntrypointBranded
|
|
4251
|
-
| DurableObjectBranded
|
|
5713
|
+
| DurableObjectBranded
|
|
5714
|
+
| WorkflowEntrypointBranded;
|
|
4252
5715
|
// Types that can be used through `Stub`s
|
|
4253
5716
|
export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
|
|
4254
5717
|
// Types that can be passed over RPC
|
|
4255
|
-
type
|
|
5718
|
+
// The reason for using a generic type here is to build a serializable subset of structured
|
|
5719
|
+
// cloneable composite types. This allows types defined with the "interface" keyword to pass the
|
|
5720
|
+
// serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
|
|
5721
|
+
type Serializable<T> =
|
|
4256
5722
|
// Structured cloneables
|
|
4257
5723
|
| void
|
|
4258
5724
|
| undefined
|
|
@@ -4268,11 +5734,14 @@ export declare namespace Rpc {
|
|
|
4268
5734
|
| Error
|
|
4269
5735
|
| RegExp
|
|
4270
5736
|
// Structured cloneable composites
|
|
4271
|
-
| Map<
|
|
4272
|
-
|
|
4273
|
-
|
|
5737
|
+
| Map<
|
|
5738
|
+
T extends Map<infer U, unknown> ? Serializable<U> : never,
|
|
5739
|
+
T extends Map<unknown, infer U> ? Serializable<U> : never
|
|
5740
|
+
>
|
|
5741
|
+
| Set<T extends Set<infer U> ? Serializable<U> : never>
|
|
5742
|
+
| ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
|
|
4274
5743
|
| {
|
|
4275
|
-
[
|
|
5744
|
+
[K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
|
|
4276
5745
|
}
|
|
4277
5746
|
// Special types
|
|
4278
5747
|
| ReadableStream<Uint8Array>
|
|
@@ -4302,7 +5771,7 @@ export declare namespace Rpc {
|
|
|
4302
5771
|
: T extends ReadonlyArray<infer V>
|
|
4303
5772
|
? ReadonlyArray<Stubify<V>>
|
|
4304
5773
|
: T extends {
|
|
4305
|
-
[key: string | number]:
|
|
5774
|
+
[key: string | number]: any;
|
|
4306
5775
|
}
|
|
4307
5776
|
? {
|
|
4308
5777
|
[K in keyof T]: Stubify<T[K]>;
|
|
@@ -4345,7 +5814,7 @@ export declare namespace Rpc {
|
|
|
4345
5814
|
// Intersecting with `(Maybe)Provider` allows pipelining.
|
|
4346
5815
|
type Result<R> = R extends Stubable
|
|
4347
5816
|
? Promise<Stub<R>> & Provider<R>
|
|
4348
|
-
: R extends Serializable
|
|
5817
|
+
: R extends Serializable<R>
|
|
4349
5818
|
? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
|
|
4350
5819
|
: never;
|
|
4351
5820
|
// Type for method or property on an RPC interface.
|
|
@@ -4374,6 +5843,198 @@ export declare namespace Rpc {
|
|
|
4374
5843
|
>]: MethodOrProperty<T[K]>;
|
|
4375
5844
|
};
|
|
4376
5845
|
}
|
|
5846
|
+
export declare namespace TailStream {
|
|
5847
|
+
interface Header {
|
|
5848
|
+
readonly name: string;
|
|
5849
|
+
readonly value: string;
|
|
5850
|
+
}
|
|
5851
|
+
interface FetchEventInfo {
|
|
5852
|
+
readonly type: "fetch";
|
|
5853
|
+
readonly method: string;
|
|
5854
|
+
readonly url: string;
|
|
5855
|
+
readonly cfJson: string;
|
|
5856
|
+
readonly headers: Header[];
|
|
5857
|
+
}
|
|
5858
|
+
interface JsRpcEventInfo {
|
|
5859
|
+
readonly type: "jsrpc";
|
|
5860
|
+
readonly methodName: string;
|
|
5861
|
+
}
|
|
5862
|
+
interface ScheduledEventInfo {
|
|
5863
|
+
readonly type: "scheduled";
|
|
5864
|
+
readonly scheduledTime: Date;
|
|
5865
|
+
readonly cron: string;
|
|
5866
|
+
}
|
|
5867
|
+
interface AlarmEventInfo {
|
|
5868
|
+
readonly type: "alarm";
|
|
5869
|
+
readonly scheduledTime: Date;
|
|
5870
|
+
}
|
|
5871
|
+
interface QueueEventInfo {
|
|
5872
|
+
readonly type: "queue";
|
|
5873
|
+
readonly queueName: string;
|
|
5874
|
+
readonly batchSize: number;
|
|
5875
|
+
}
|
|
5876
|
+
interface EmailEventInfo {
|
|
5877
|
+
readonly type: "email";
|
|
5878
|
+
readonly mailFrom: string;
|
|
5879
|
+
readonly rcptTo: string;
|
|
5880
|
+
readonly rawSize: number;
|
|
5881
|
+
}
|
|
5882
|
+
interface TraceEventInfo {
|
|
5883
|
+
readonly type: "trace";
|
|
5884
|
+
readonly traces: (string | null)[];
|
|
5885
|
+
}
|
|
5886
|
+
interface HibernatableWebSocketEventInfoMessage {
|
|
5887
|
+
readonly type: "message";
|
|
5888
|
+
}
|
|
5889
|
+
interface HibernatableWebSocketEventInfoError {
|
|
5890
|
+
readonly type: "error";
|
|
5891
|
+
}
|
|
5892
|
+
interface HibernatableWebSocketEventInfoClose {
|
|
5893
|
+
readonly type: "close";
|
|
5894
|
+
readonly code: number;
|
|
5895
|
+
readonly wasClean: boolean;
|
|
5896
|
+
}
|
|
5897
|
+
interface HibernatableWebSocketEventInfo {
|
|
5898
|
+
readonly type: "hibernatableWebSocket";
|
|
5899
|
+
readonly info:
|
|
5900
|
+
| HibernatableWebSocketEventInfoClose
|
|
5901
|
+
| HibernatableWebSocketEventInfoError
|
|
5902
|
+
| HibernatableWebSocketEventInfoMessage;
|
|
5903
|
+
}
|
|
5904
|
+
interface Resume {
|
|
5905
|
+
readonly type: "resume";
|
|
5906
|
+
readonly attachment?: any;
|
|
5907
|
+
}
|
|
5908
|
+
interface CustomEventInfo {
|
|
5909
|
+
readonly type: "custom";
|
|
5910
|
+
}
|
|
5911
|
+
interface FetchResponseInfo {
|
|
5912
|
+
readonly type: "fetch";
|
|
5913
|
+
readonly statusCode: number;
|
|
5914
|
+
}
|
|
5915
|
+
type EventOutcome =
|
|
5916
|
+
| "ok"
|
|
5917
|
+
| "canceled"
|
|
5918
|
+
| "exception"
|
|
5919
|
+
| "unknown"
|
|
5920
|
+
| "killSwitch"
|
|
5921
|
+
| "daemonDown"
|
|
5922
|
+
| "exceededCpu"
|
|
5923
|
+
| "exceededMemory"
|
|
5924
|
+
| "loadShed"
|
|
5925
|
+
| "responseStreamDisconnected"
|
|
5926
|
+
| "scriptNotFound";
|
|
5927
|
+
interface ScriptVersion {
|
|
5928
|
+
readonly id: string;
|
|
5929
|
+
readonly tag?: string;
|
|
5930
|
+
readonly message?: string;
|
|
5931
|
+
}
|
|
5932
|
+
interface Trigger {
|
|
5933
|
+
readonly traceId: string;
|
|
5934
|
+
readonly invocationId: string;
|
|
5935
|
+
readonly spanId: string;
|
|
5936
|
+
}
|
|
5937
|
+
interface Onset {
|
|
5938
|
+
readonly type: "onset";
|
|
5939
|
+
readonly dispatchNamespace?: string;
|
|
5940
|
+
readonly entrypoint?: string;
|
|
5941
|
+
readonly scriptName?: string;
|
|
5942
|
+
readonly scriptTags?: string[];
|
|
5943
|
+
readonly scriptVersion?: ScriptVersion;
|
|
5944
|
+
readonly trigger?: Trigger;
|
|
5945
|
+
readonly info:
|
|
5946
|
+
| FetchEventInfo
|
|
5947
|
+
| JsRpcEventInfo
|
|
5948
|
+
| ScheduledEventInfo
|
|
5949
|
+
| AlarmEventInfo
|
|
5950
|
+
| QueueEventInfo
|
|
5951
|
+
| EmailEventInfo
|
|
5952
|
+
| TraceEventInfo
|
|
5953
|
+
| HibernatableWebSocketEventInfo
|
|
5954
|
+
| Resume
|
|
5955
|
+
| CustomEventInfo;
|
|
5956
|
+
}
|
|
5957
|
+
interface Outcome {
|
|
5958
|
+
readonly type: "outcome";
|
|
5959
|
+
readonly outcome: EventOutcome;
|
|
5960
|
+
readonly cpuTime: number;
|
|
5961
|
+
readonly wallTime: number;
|
|
5962
|
+
}
|
|
5963
|
+
interface Hibernate {
|
|
5964
|
+
readonly type: "hibernate";
|
|
5965
|
+
}
|
|
5966
|
+
interface SpanOpen {
|
|
5967
|
+
readonly type: "spanOpen";
|
|
5968
|
+
readonly op?: string;
|
|
5969
|
+
readonly info?: FetchEventInfo | JsRpcEventInfo | Attribute[];
|
|
5970
|
+
}
|
|
5971
|
+
interface SpanClose {
|
|
5972
|
+
readonly type: "spanClose";
|
|
5973
|
+
readonly outcome: EventOutcome;
|
|
5974
|
+
}
|
|
5975
|
+
interface DiagnosticChannelEvent {
|
|
5976
|
+
readonly type: "diagnosticChannel";
|
|
5977
|
+
readonly channel: string;
|
|
5978
|
+
readonly message: any;
|
|
5979
|
+
}
|
|
5980
|
+
interface Exception {
|
|
5981
|
+
readonly type: "exception";
|
|
5982
|
+
readonly name: string;
|
|
5983
|
+
readonly message: string;
|
|
5984
|
+
readonly stack?: string;
|
|
5985
|
+
}
|
|
5986
|
+
interface Log {
|
|
5987
|
+
readonly type: "log";
|
|
5988
|
+
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
|
5989
|
+
readonly message: string;
|
|
5990
|
+
}
|
|
5991
|
+
interface Return {
|
|
5992
|
+
readonly type: "return";
|
|
5993
|
+
readonly info?: FetchResponseInfo | Attribute[];
|
|
5994
|
+
}
|
|
5995
|
+
interface Link {
|
|
5996
|
+
readonly type: "link";
|
|
5997
|
+
readonly label?: string;
|
|
5998
|
+
readonly traceId: string;
|
|
5999
|
+
readonly invocationId: string;
|
|
6000
|
+
readonly spanId: string;
|
|
6001
|
+
}
|
|
6002
|
+
interface Attribute {
|
|
6003
|
+
readonly type: "attribute";
|
|
6004
|
+
readonly name: string;
|
|
6005
|
+
readonly value: string | string[] | boolean | boolean[] | number | number[];
|
|
6006
|
+
}
|
|
6007
|
+
type Mark =
|
|
6008
|
+
| DiagnosticChannelEvent
|
|
6009
|
+
| Exception
|
|
6010
|
+
| Log
|
|
6011
|
+
| Return
|
|
6012
|
+
| Link
|
|
6013
|
+
| Attribute[];
|
|
6014
|
+
interface TailEvent {
|
|
6015
|
+
readonly traceId: string;
|
|
6016
|
+
readonly invocationId: string;
|
|
6017
|
+
readonly spanId: string;
|
|
6018
|
+
readonly timestamp: Date;
|
|
6019
|
+
readonly sequence: number;
|
|
6020
|
+
readonly event: Onset | Outcome | Hibernate | SpanOpen | SpanClose | Mark;
|
|
6021
|
+
}
|
|
6022
|
+
type TailEventHandler = (event: TailEvent) => void | Promise<void>;
|
|
6023
|
+
type TailEventHandlerName =
|
|
6024
|
+
| "onset"
|
|
6025
|
+
| "outcome"
|
|
6026
|
+
| "hibernate"
|
|
6027
|
+
| "spanOpen"
|
|
6028
|
+
| "spanClose"
|
|
6029
|
+
| "diagnosticChannel"
|
|
6030
|
+
| "exception"
|
|
6031
|
+
| "log"
|
|
6032
|
+
| "return"
|
|
6033
|
+
| "link"
|
|
6034
|
+
| "attribute";
|
|
6035
|
+
type TailEventHandlerObject = Record<TailEventHandlerName, TailEventHandler>;
|
|
6036
|
+
type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;
|
|
6037
|
+
}
|
|
4377
6038
|
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
4378
6039
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4379
6040
|
// https://opensource.org/licenses/Apache-2.0
|
|
@@ -4417,11 +6078,21 @@ export type VectorizeVectorMetadataFilter = {
|
|
|
4417
6078
|
* Distance metrics determine how other "similar" vectors are determined.
|
|
4418
6079
|
*/
|
|
4419
6080
|
export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
6081
|
+
/**
|
|
6082
|
+
* Metadata return levels for a Vectorize query.
|
|
6083
|
+
*
|
|
6084
|
+
* Default to "none".
|
|
6085
|
+
*
|
|
6086
|
+
* @property all Full metadata for the vector return set, including all fields (including those un-indexed) without truncation. This is a more expensive retrieval, as it requires additional fetching & reading of un-indexed data.
|
|
6087
|
+
* @property indexed Return all metadata fields configured for indexing in the vector return set. This level of retrieval is "free" in that no additional overhead is incurred returning this data. However, note that indexed metadata is subject to truncation (especially for larger strings).
|
|
6088
|
+
* @property none No indexed metadata will be returned.
|
|
6089
|
+
*/
|
|
6090
|
+
export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
|
|
4420
6091
|
export interface VectorizeQueryOptions {
|
|
4421
6092
|
topK?: number;
|
|
4422
6093
|
namespace?: string;
|
|
4423
6094
|
returnValues?: boolean;
|
|
4424
|
-
returnMetadata?: boolean;
|
|
6095
|
+
returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
|
|
4425
6096
|
filter?: VectorizeVectorMetadataFilter;
|
|
4426
6097
|
}
|
|
4427
6098
|
/**
|
|
@@ -4437,6 +6108,9 @@ export type VectorizeIndexConfig =
|
|
|
4437
6108
|
};
|
|
4438
6109
|
/**
|
|
4439
6110
|
* Metadata about an existing index.
|
|
6111
|
+
*
|
|
6112
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
6113
|
+
* See {@link VectorizeIndexInfo} for its post-beta equivalent.
|
|
4440
6114
|
*/
|
|
4441
6115
|
export interface VectorizeIndexDetails {
|
|
4442
6116
|
/** The unique ID of the index */
|
|
@@ -4450,6 +6124,19 @@ export interface VectorizeIndexDetails {
|
|
|
4450
6124
|
/** The number of records containing vectors within the index. */
|
|
4451
6125
|
vectorsCount: number;
|
|
4452
6126
|
}
|
|
6127
|
+
/**
|
|
6128
|
+
* Metadata about an existing index.
|
|
6129
|
+
*/
|
|
6130
|
+
export interface VectorizeIndexInfo {
|
|
6131
|
+
/** The number of records containing vectors within the index. */
|
|
6132
|
+
vectorCount: number;
|
|
6133
|
+
/** Number of dimensions the index has been configured for. */
|
|
6134
|
+
dimensions: number;
|
|
6135
|
+
/** ISO 8601 datetime of the last processed mutation on in the index. All changes before this mutation will be reflected in the index state. */
|
|
6136
|
+
processedUpToDatetime: number;
|
|
6137
|
+
/** UUIDv4 of the last mutation processed by the index. All changes before this mutation will be reflected in the index state. */
|
|
6138
|
+
processedUpToMutation: number;
|
|
6139
|
+
}
|
|
4453
6140
|
/**
|
|
4454
6141
|
* Represents a single vector value set along with its associated metadata.
|
|
4455
6142
|
*/
|
|
@@ -4460,7 +6147,7 @@ export interface VectorizeVector {
|
|
|
4460
6147
|
values: VectorFloatArray | number[];
|
|
4461
6148
|
/** The namespace this vector belongs to. */
|
|
4462
6149
|
namespace?: string;
|
|
4463
|
-
/** Metadata associated with the vector. Includes the values of
|
|
6150
|
+
/** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
|
|
4464
6151
|
metadata?: Record<string, VectorizeVectorMetadata>;
|
|
4465
6152
|
}
|
|
4466
6153
|
/**
|
|
@@ -4472,7 +6159,7 @@ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
|
4472
6159
|
score: number;
|
|
4473
6160
|
};
|
|
4474
6161
|
/**
|
|
4475
|
-
* A set of
|
|
6162
|
+
* A set of matching {@link VectorizeMatch} for a particular query.
|
|
4476
6163
|
*/
|
|
4477
6164
|
export interface VectorizeMatches {
|
|
4478
6165
|
matches: VectorizeMatch[];
|
|
@@ -4481,6 +6168,9 @@ export interface VectorizeMatches {
|
|
|
4481
6168
|
/**
|
|
4482
6169
|
* Results of an operation that performed a mutation on a set of vectors.
|
|
4483
6170
|
* Here, `ids` is a list of vectors that were successfully processed.
|
|
6171
|
+
*
|
|
6172
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
6173
|
+
* See {@link VectorizeAsyncMutation} for its post-beta equivalent.
|
|
4484
6174
|
*/
|
|
4485
6175
|
export interface VectorizeVectorMutation {
|
|
4486
6176
|
/* List of ids of vectors that were successfully processed. */
|
|
@@ -4488,6 +6178,20 @@ export interface VectorizeVectorMutation {
|
|
|
4488
6178
|
/* Total count of the number of processed vectors. */
|
|
4489
6179
|
count: number;
|
|
4490
6180
|
}
|
|
6181
|
+
/**
|
|
6182
|
+
* Result type indicating a mutation on the Vectorize Index.
|
|
6183
|
+
* Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
|
|
6184
|
+
*/
|
|
6185
|
+
export interface VectorizeAsyncMutation {
|
|
6186
|
+
/** The unique identifier for the async mutation operation containing the changeset. */
|
|
6187
|
+
mutationId: string;
|
|
6188
|
+
}
|
|
6189
|
+
/**
|
|
6190
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
6191
|
+
*
|
|
6192
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
6193
|
+
* See {@link Vectorize} for its new implementation.
|
|
6194
|
+
*/
|
|
4491
6195
|
export declare abstract class VectorizeIndex {
|
|
4492
6196
|
/**
|
|
4493
6197
|
* Get information about the currently bound index.
|
|
@@ -4502,7 +6206,7 @@ export declare abstract class VectorizeIndex {
|
|
|
4502
6206
|
*/
|
|
4503
6207
|
public query(
|
|
4504
6208
|
vector: VectorFloatArray | number[],
|
|
4505
|
-
options
|
|
6209
|
+
options?: VectorizeQueryOptions,
|
|
4506
6210
|
): Promise<VectorizeMatches>;
|
|
4507
6211
|
/**
|
|
4508
6212
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
@@ -4529,6 +6233,62 @@ export declare abstract class VectorizeIndex {
|
|
|
4529
6233
|
*/
|
|
4530
6234
|
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
4531
6235
|
}
|
|
6236
|
+
/**
|
|
6237
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
6238
|
+
*
|
|
6239
|
+
* Mutations in this version are async, returning a mutation id.
|
|
6240
|
+
*/
|
|
6241
|
+
export declare abstract class Vectorize {
|
|
6242
|
+
/**
|
|
6243
|
+
* Get information about the currently bound index.
|
|
6244
|
+
* @returns A promise that resolves with information about the current index.
|
|
6245
|
+
*/
|
|
6246
|
+
public describe(): Promise<VectorizeIndexInfo>;
|
|
6247
|
+
/**
|
|
6248
|
+
* Use the provided vector to perform a similarity search across the index.
|
|
6249
|
+
* @param vector Input vector that will be used to drive the similarity search.
|
|
6250
|
+
* @param options Configuration options to massage the returned data.
|
|
6251
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
6252
|
+
*/
|
|
6253
|
+
public query(
|
|
6254
|
+
vector: VectorFloatArray | number[],
|
|
6255
|
+
options?: VectorizeQueryOptions,
|
|
6256
|
+
): Promise<VectorizeMatches>;
|
|
6257
|
+
/**
|
|
6258
|
+
* Use the provided vector-id to perform a similarity search across the index.
|
|
6259
|
+
* @param vectorId Id for a vector in the index against which the index should be queried.
|
|
6260
|
+
* @param options Configuration options to massage the returned data.
|
|
6261
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
6262
|
+
*/
|
|
6263
|
+
public queryById(
|
|
6264
|
+
vectorId: string,
|
|
6265
|
+
options?: VectorizeQueryOptions,
|
|
6266
|
+
): Promise<VectorizeMatches>;
|
|
6267
|
+
/**
|
|
6268
|
+
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
6269
|
+
* @param vectors List of vectors that will be inserted.
|
|
6270
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
|
|
6271
|
+
*/
|
|
6272
|
+
public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
6273
|
+
/**
|
|
6274
|
+
* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
|
|
6275
|
+
* @param vectors List of vectors that will be upserted.
|
|
6276
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
|
|
6277
|
+
*/
|
|
6278
|
+
public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
6279
|
+
/**
|
|
6280
|
+
* Delete a list of vectors with a matching id.
|
|
6281
|
+
* @param ids List of vector ids that should be deleted.
|
|
6282
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
|
|
6283
|
+
*/
|
|
6284
|
+
public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
|
|
6285
|
+
/**
|
|
6286
|
+
* Get a list of vectors with a matching id.
|
|
6287
|
+
* @param ids List of vector ids that should be returned.
|
|
6288
|
+
* @returns A promise that resolves with the raw unscored vectors matching the id set.
|
|
6289
|
+
*/
|
|
6290
|
+
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
6291
|
+
}
|
|
4532
6292
|
/**
|
|
4533
6293
|
* The interface for "version_metadata" binding
|
|
4534
6294
|
* providing metadata about the Worker Version using this binding.
|
|
@@ -4538,6 +6298,8 @@ export type WorkerVersionMetadata = {
|
|
|
4538
6298
|
id: string;
|
|
4539
6299
|
/** The tag of the Worker Version using this binding */
|
|
4540
6300
|
tag: string;
|
|
6301
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
6302
|
+
timestamp: string;
|
|
4541
6303
|
};
|
|
4542
6304
|
export interface DynamicDispatchLimits {
|
|
4543
6305
|
/**
|
|
@@ -4577,3 +6339,70 @@ export interface DispatchNamespace {
|
|
|
4577
6339
|
options?: DynamicDispatchOptions,
|
|
4578
6340
|
): Fetcher;
|
|
4579
6341
|
}
|
|
6342
|
+
export declare abstract class Workflow<PARAMS = unknown> {
|
|
6343
|
+
/**
|
|
6344
|
+
* Get a handle to an existing instance of the Workflow.
|
|
6345
|
+
* @param id Id for the instance of this Workflow
|
|
6346
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
6347
|
+
*/
|
|
6348
|
+
public get(id: string): Promise<WorkflowInstance>;
|
|
6349
|
+
/**
|
|
6350
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
6351
|
+
* @param options Options when creating an instance including id and params
|
|
6352
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
6353
|
+
*/
|
|
6354
|
+
public create(
|
|
6355
|
+
options?: WorkflowInstanceCreateOptions<PARAMS>,
|
|
6356
|
+
): Promise<WorkflowInstance>;
|
|
6357
|
+
}
|
|
6358
|
+
export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|
6359
|
+
/**
|
|
6360
|
+
* An id for your Workflow instance. Must be unique within the Workflow.
|
|
6361
|
+
*/
|
|
6362
|
+
id?: string;
|
|
6363
|
+
/**
|
|
6364
|
+
* The event payload the Workflow instance is triggered with
|
|
6365
|
+
*/
|
|
6366
|
+
params?: PARAMS;
|
|
6367
|
+
}
|
|
6368
|
+
export type InstanceStatus = {
|
|
6369
|
+
status:
|
|
6370
|
+
| "queued" // means that instance is waiting to be started (see concurrency limits)
|
|
6371
|
+
| "running"
|
|
6372
|
+
| "paused"
|
|
6373
|
+
| "errored"
|
|
6374
|
+
| "terminated" // user terminated the instance while it was running
|
|
6375
|
+
| "complete"
|
|
6376
|
+
| "waiting" // instance is hibernating and waiting for sleep or event to finish
|
|
6377
|
+
| "waitingForPause" // instance is finishing the current work to pause
|
|
6378
|
+
| "unknown";
|
|
6379
|
+
error?: string;
|
|
6380
|
+
output?: object;
|
|
6381
|
+
};
|
|
6382
|
+
export interface WorkflowError {
|
|
6383
|
+
code?: number;
|
|
6384
|
+
message: string;
|
|
6385
|
+
}
|
|
6386
|
+
export declare abstract class WorkflowInstance {
|
|
6387
|
+
public id: string;
|
|
6388
|
+
/**
|
|
6389
|
+
* Pause the instance.
|
|
6390
|
+
*/
|
|
6391
|
+
public pause(): Promise<void>;
|
|
6392
|
+
/**
|
|
6393
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
6394
|
+
*/
|
|
6395
|
+
public resume(): Promise<void>;
|
|
6396
|
+
/**
|
|
6397
|
+
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
6398
|
+
*/
|
|
6399
|
+
public terminate(): Promise<void>;
|
|
6400
|
+
/**
|
|
6401
|
+
* Restart the instance.
|
|
6402
|
+
*/
|
|
6403
|
+
public restart(): Promise<void>;
|
|
6404
|
+
/**
|
|
6405
|
+
* Returns the current status of the instance.
|
|
6406
|
+
*/
|
|
6407
|
+
public status(): Promise<InstanceStatus>;
|
|
6408
|
+
}
|