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