@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
  abort(reason?: any): void;
371
407
  }
372
408
  export type ExportedHandlerFetchHandler<
@@ -387,6 +423,11 @@ export type ExportedHandlerTraceHandler<Env = unknown> = (
387
423
  env: Env,
388
424
  ctx: ExecutionContext,
389
425
  ) => void | Promise<void>;
426
+ export type ExportedHandlerTailStreamHandler<Env = unknown> = (
427
+ event: TailStream.TailEvent,
428
+ env: Env,
429
+ ctx: ExecutionContext,
430
+ ) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
390
431
  export type ExportedHandlerScheduledHandler<Env = unknown> = (
391
432
  controller: ScheduledController,
392
433
  env: Env,
@@ -410,6 +451,7 @@ export interface ExportedHandler<
410
451
  fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
411
452
  tail?: ExportedHandlerTailHandler<Env>;
412
453
  trace?: ExportedHandlerTraceHandler<Env>;
454
+ tailStream?: ExportedHandlerTailStreamHandler<Env>;
413
455
  scheduled?: ExportedHandlerScheduledHandler<Env>;
414
456
  test?: ExportedHandlerTestHandler<Env>;
415
457
  email?: EmailExportedHandler<Env>;
@@ -418,10 +460,11 @@ export interface ExportedHandler<
418
460
  export interface StructuredSerializeOptions {
419
461
  transfer?: any[];
420
462
  }
463
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
421
464
  export declare abstract class PromiseRejectionEvent extends Event {
422
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
465
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
423
466
  readonly promise: Promise<any>;
424
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
467
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
425
468
  readonly reason: any;
426
469
  }
427
470
  export declare abstract class Navigator {
@@ -432,30 +475,35 @@ export declare abstract class Navigator {
432
475
  | string
433
476
  | (ArrayBuffer | ArrayBufferView)
434
477
  | Blob
478
+ | FormData
435
479
  | URLSearchParams
436
- | FormData,
480
+ | URLSearchParams,
437
481
  ): boolean;
438
482
  readonly userAgent: string;
439
- readonly gpu: gpuGPU;
483
+ readonly gpu: GPU;
440
484
  }
441
485
  /**
442
- * 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.
486
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
487
+ * as well as timing of subrequests and other operations.
443
488
  *
444
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance)
489
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
445
490
  */
446
491
  export interface Performance {
447
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin) */
492
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
448
493
  readonly timeOrigin: number;
449
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/now) */
494
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
450
495
  now(): number;
451
496
  }
452
497
  export interface AlarmInvocationInfo {
453
498
  readonly isRetry: boolean;
454
499
  readonly retryCount: number;
455
500
  }
501
+ export interface Cloudflare {
502
+ readonly compatibilityFlags: Record<string, boolean>;
503
+ }
456
504
  export interface DurableObject {
457
505
  fetch(request: Request): Response | Promise<Response>;
458
- alarm?(): void | Promise<void>;
506
+ alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
459
507
  webSocketMessage?(
460
508
  ws: WebSocket,
461
509
  message: string | ArrayBuffer,
@@ -604,6 +652,9 @@ export interface DurableObjectStorage {
604
652
  getCurrentBookmark(): Promise<string>;
605
653
  getBookmarkForTime(timestamp: number | Date): Promise<string>;
606
654
  onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
655
+ waitForBookmark(bookmark: string): Promise<void>;
656
+ readonly primary?: DurableObjectStub;
657
+ ensureReplicas(): void;
607
658
  }
608
659
  export interface DurableObjectListOptions {
609
660
  start?: string;
@@ -644,6 +695,11 @@ export interface AnalyticsEngineDataPoint {
644
695
  doubles?: number[];
645
696
  blobs?: ((ArrayBuffer | string) | null)[];
646
697
  }
698
+ /**
699
+ * An event which takes place in the DOM.
700
+ *
701
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
702
+ */
647
703
  export declare class Event {
648
704
  constructor(type: string, init?: EventInit);
649
705
  /**
@@ -767,6 +823,11 @@ export interface EventListenerObject<EventType extends Event = Event> {
767
823
  export type EventListenerOrEventListenerObject<
768
824
  EventType extends Event = Event,
769
825
  > = EventListener<EventType> | EventListenerObject<EventType>;
826
+ /**
827
+ * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
828
+ *
829
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
830
+ */
770
831
  export declare class EventTarget<
771
832
  EventMap extends Record<string, Event> = Record<string, Event>,
772
833
  > {
@@ -822,6 +883,11 @@ export interface EventTargetAddEventListenerOptions {
822
883
  export interface EventTargetHandlerObject {
823
884
  handleEvent: (event: Event) => any | undefined;
824
885
  }
886
+ /**
887
+ * A controller object that allows you to abort one or more DOM requests as and when desired.
888
+ *
889
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
890
+ */
825
891
  export declare class AbortController {
826
892
  constructor();
827
893
  /**
@@ -837,11 +903,17 @@ export declare class AbortController {
837
903
  */
838
904
  abort(reason?: any): void;
839
905
  }
906
+ /**
907
+ * 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.
908
+ *
909
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
910
+ */
840
911
  export declare abstract class AbortSignal extends EventTarget {
841
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
912
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
842
913
  static abort(reason?: any): AbortSignal;
843
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
914
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
844
915
  static timeout(delay: number): AbortSignal;
916
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
845
917
  static any(signals: AbortSignal[]): AbortSignal;
846
918
  /**
847
919
  * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
@@ -849,13 +921,13 @@ export declare abstract class AbortSignal extends EventTarget {
849
921
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
850
922
  */
851
923
  get aborted(): boolean;
852
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
924
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
853
925
  get reason(): any;
854
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
926
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
855
927
  get onabort(): any | null;
856
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
928
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
857
929
  set onabort(value: any | null);
858
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
930
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
859
931
  throwIfAborted(): void;
860
932
  }
861
933
  export interface Scheduler {
@@ -864,10 +936,16 @@ export interface Scheduler {
864
936
  export interface SchedulerWaitOptions {
865
937
  signal?: AbortSignal;
866
938
  }
939
+ /**
940
+ * 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.
941
+ *
942
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
943
+ */
867
944
  export declare abstract class ExtendableEvent extends Event {
868
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
945
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
869
946
  waitUntil(promise: Promise<any>): void;
870
947
  }
948
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */
871
949
  export declare class CustomEvent<T = any> extends Event {
872
950
  constructor(type: string, init?: CustomEventCustomEventInit);
873
951
  /**
@@ -883,58 +961,93 @@ export interface CustomEventCustomEventInit {
883
961
  composed?: boolean;
884
962
  detail?: any;
885
963
  }
964
+ /**
965
+ * 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.
966
+ *
967
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
968
+ */
886
969
  export declare class Blob {
887
970
  constructor(
888
- bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
971
+ type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
889
972
  options?: BlobOptions,
890
973
  );
891
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
974
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
892
975
  get size(): number;
893
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
976
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
894
977
  get type(): string;
895
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
978
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
896
979
  slice(start?: number, end?: number, type?: string): Blob;
897
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
980
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
898
981
  arrayBuffer(): Promise<ArrayBuffer>;
899
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
982
+ bytes(): Promise<Uint8Array>;
983
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
900
984
  text(): Promise<string>;
901
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
985
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
902
986
  stream(): ReadableStream;
903
987
  }
904
988
  export interface BlobOptions {
905
989
  type?: string;
906
990
  }
991
+ /**
992
+ * Provides information about files and allows JavaScript in a web page to access their content.
993
+ *
994
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
995
+ */
907
996
  export declare class File extends Blob {
908
997
  constructor(
909
998
  bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
910
999
  name: string,
911
1000
  options?: FileOptions,
912
1001
  );
913
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
1002
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
914
1003
  get name(): string;
915
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
1004
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
916
1005
  get lastModified(): number;
917
1006
  }
918
1007
  export interface FileOptions {
919
1008
  type?: string;
920
1009
  lastModified?: number;
921
1010
  }
1011
+ /**
1012
+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
1013
+ *
1014
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
1015
+ */
922
1016
  export declare abstract class CacheStorage {
923
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
1017
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
924
1018
  open(cacheName: string): Promise<Cache>;
925
1019
  readonly default: Cache;
926
1020
  }
1021
+ /**
1022
+ * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
1023
+ *
1024
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
1025
+ */
927
1026
  export declare abstract class Cache {
928
- delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
1027
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
1028
+ delete(
1029
+ request: RequestInfo | URL,
1030
+ options?: CacheQueryOptions,
1031
+ ): Promise<boolean>;
1032
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
929
1033
  match(
930
- request: RequestInfo,
1034
+ request: RequestInfo | URL,
931
1035
  options?: CacheQueryOptions,
932
1036
  ): Promise<Response | undefined>;
933
- put(request: RequestInfo, response: Response): Promise<void>;
1037
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
1038
+ put(request: RequestInfo | URL, response: Response): Promise<void>;
934
1039
  }
935
1040
  export interface CacheQueryOptions {
936
1041
  ignoreMethod?: boolean;
937
1042
  }
1043
+ /**
1044
+ * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
1045
+ * The Workers runtime implements the full surface of this API, but with some differences in
1046
+ * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
1047
+ * compared to those implemented in most browsers.
1048
+ *
1049
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
1050
+ */
938
1051
  export declare abstract class Crypto {
939
1052
  /**
940
1053
  * Available only in secure contexts.
@@ -942,7 +1055,7 @@ export declare abstract class Crypto {
942
1055
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
943
1056
  */
944
1057
  get subtle(): SubtleCrypto;
945
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
1058
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
946
1059
  getRandomValues<
947
1060
  T extends
948
1061
  | Int8Array
@@ -962,39 +1075,50 @@ export declare abstract class Crypto {
962
1075
  randomUUID(): string;
963
1076
  DigestStream: typeof DigestStream;
964
1077
  }
1078
+ /**
1079
+ * 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).
1080
+ * Available only in secure contexts.
1081
+ *
1082
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
1083
+ */
965
1084
  export declare abstract class SubtleCrypto {
1085
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
966
1086
  encrypt(
967
1087
  algorithm: string | SubtleCryptoEncryptAlgorithm,
968
1088
  key: CryptoKey,
969
1089
  plainText: ArrayBuffer | ArrayBufferView,
970
1090
  ): Promise<ArrayBuffer>;
1091
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
971
1092
  decrypt(
972
1093
  algorithm: string | SubtleCryptoEncryptAlgorithm,
973
1094
  key: CryptoKey,
974
1095
  cipherText: ArrayBuffer | ArrayBufferView,
975
1096
  ): Promise<ArrayBuffer>;
1097
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
976
1098
  sign(
977
1099
  algorithm: string | SubtleCryptoSignAlgorithm,
978
1100
  key: CryptoKey,
979
1101
  data: ArrayBuffer | ArrayBufferView,
980
1102
  ): Promise<ArrayBuffer>;
1103
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
981
1104
  verify(
982
1105
  algorithm: string | SubtleCryptoSignAlgorithm,
983
1106
  key: CryptoKey,
984
1107
  signature: ArrayBuffer | ArrayBufferView,
985
1108
  data: ArrayBuffer | ArrayBufferView,
986
1109
  ): Promise<boolean>;
1110
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
987
1111
  digest(
988
1112
  algorithm: string | SubtleCryptoHashAlgorithm,
989
1113
  data: ArrayBuffer | ArrayBufferView,
990
1114
  ): Promise<ArrayBuffer>;
991
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
1115
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
992
1116
  generateKey(
993
1117
  algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
994
1118
  extractable: boolean,
995
1119
  keyUsages: string[],
996
1120
  ): Promise<CryptoKey | CryptoKeyPair>;
997
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
1121
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
998
1122
  deriveKey(
999
1123
  algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
1000
1124
  baseKey: CryptoKey,
@@ -1002,12 +1126,13 @@ export declare abstract class SubtleCrypto {
1002
1126
  extractable: boolean,
1003
1127
  keyUsages: string[],
1004
1128
  ): Promise<CryptoKey>;
1129
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
1005
1130
  deriveBits(
1006
1131
  algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
1007
1132
  baseKey: CryptoKey,
1008
- length: number | null,
1133
+ length?: number | null,
1009
1134
  ): Promise<ArrayBuffer>;
1010
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
1135
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
1011
1136
  importKey(
1012
1137
  format: string,
1013
1138
  keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
@@ -1015,14 +1140,16 @@ export declare abstract class SubtleCrypto {
1015
1140
  extractable: boolean,
1016
1141
  keyUsages: string[],
1017
1142
  ): Promise<CryptoKey>;
1143
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
1018
1144
  exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
1145
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
1019
1146
  wrapKey(
1020
1147
  format: string,
1021
1148
  key: CryptoKey,
1022
1149
  wrappingKey: CryptoKey,
1023
1150
  wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
1024
1151
  ): Promise<ArrayBuffer>;
1025
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
1152
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
1026
1153
  unwrapKey(
1027
1154
  format: string,
1028
1155
  wrappedKey: ArrayBuffer | ArrayBufferView,
@@ -1037,12 +1164,18 @@ export declare abstract class SubtleCrypto {
1037
1164
  b: ArrayBuffer | ArrayBufferView,
1038
1165
  ): boolean;
1039
1166
  }
1167
+ /**
1168
+ * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
1169
+ * Available only in secure contexts.
1170
+ *
1171
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
1172
+ */
1040
1173
  export declare abstract class CryptoKey {
1041
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
1174
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
1042
1175
  readonly type: string;
1043
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
1176
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
1044
1177
  readonly extractable: boolean;
1045
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
1178
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
1046
1179
  readonly algorithm:
1047
1180
  | CryptoKeyKeyAlgorithm
1048
1181
  | CryptoKeyAesKeyAlgorithm
@@ -1050,7 +1183,7 @@ export declare abstract class CryptoKey {
1050
1183
  | CryptoKeyRsaKeyAlgorithm
1051
1184
  | CryptoKeyEllipticKeyAlgorithm
1052
1185
  | CryptoKeyArbitraryKeyAlgorithm;
1053
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
1186
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
1054
1187
  readonly usages: string[];
1055
1188
  }
1056
1189
  export interface CryptoKeyPair {
@@ -1156,7 +1289,13 @@ export declare class DigestStream extends WritableStream<
1156
1289
  > {
1157
1290
  constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1158
1291
  get digest(): Promise<ArrayBuffer>;
1292
+ get bytesWritten(): number | bigint;
1159
1293
  }
1294
+ /**
1295
+ * 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.
1296
+ *
1297
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1298
+ */
1160
1299
  export declare class TextDecoder {
1161
1300
  constructor(decoder?: string, options?: TextDecoderConstructorOptions);
1162
1301
  /**
@@ -1182,6 +1321,11 @@ export declare class TextDecoder {
1182
1321
  get fatal(): boolean;
1183
1322
  get ignoreBOM(): boolean;
1184
1323
  }
1324
+ /**
1325
+ * 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.
1326
+ *
1327
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder)
1328
+ */
1185
1329
  export declare class TextEncoder {
1186
1330
  constructor();
1187
1331
  /**
@@ -1212,21 +1356,59 @@ export interface TextEncoderEncodeIntoResult {
1212
1356
  read: number;
1213
1357
  written: number;
1214
1358
  }
1359
+ /**
1360
+ * Events providing information related to errors in scripts or in files.
1361
+ *
1362
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
1363
+ */
1364
+ export declare class ErrorEvent extends Event {
1365
+ constructor(type: string, init?: ErrorEventErrorEventInit);
1366
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1367
+ get filename(): string;
1368
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1369
+ get message(): string;
1370
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1371
+ get lineno(): number;
1372
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1373
+ get colno(): number;
1374
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1375
+ get error(): any;
1376
+ }
1377
+ export interface ErrorEventErrorEventInit {
1378
+ message?: string;
1379
+ filename?: string;
1380
+ lineno?: number;
1381
+ colno?: number;
1382
+ error?: any;
1383
+ }
1384
+ /**
1385
+ * 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".
1386
+ *
1387
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData)
1388
+ */
1215
1389
  export declare class FormData {
1216
1390
  constructor();
1391
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1217
1392
  append(name: string, value: string): void;
1393
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */
1218
1394
  append(name: string, value: Blob, filename?: string): void;
1395
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */
1219
1396
  delete(name: string): void;
1397
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */
1220
1398
  get(name: string): (File | string) | null;
1399
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */
1221
1400
  getAll(name: string): (File | string)[];
1401
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */
1222
1402
  has(name: string): boolean;
1403
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1223
1404
  set(name: string, value: string): void;
1405
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */
1224
1406
  set(name: string, value: Blob, filename?: string): void;
1225
- /** Returns an array of key, value pairs for every entry in the list. */
1407
+ /* Returns an array of key, value pairs for every entry in the list. */
1226
1408
  entries(): IterableIterator<[key: string, value: File | string]>;
1227
- /** Returns a list of keys in the list. */
1409
+ /* Returns a list of keys in the list. */
1228
1410
  keys(): IterableIterator<string>;
1229
- /** Returns a list of values in the list. */
1411
+ /* Returns a list of values in the list. */
1230
1412
  values(): IterableIterator<File | string>;
1231
1413
  forEach<This = unknown>(
1232
1414
  callback: (
@@ -1276,20 +1458,44 @@ export interface Element {
1276
1458
  hasAttribute(name: string): boolean;
1277
1459
  setAttribute(name: string, value: string): Element;
1278
1460
  removeAttribute(name: string): Element;
1279
- before(content: string, options?: ContentOptions): Element;
1280
- after(content: string, options?: ContentOptions): Element;
1281
- prepend(content: string, options?: ContentOptions): Element;
1282
- append(content: string, options?: ContentOptions): Element;
1283
- replace(content: string, options?: ContentOptions): Element;
1461
+ before(
1462
+ content: string | ReadableStream | Response,
1463
+ options?: ContentOptions,
1464
+ ): Element;
1465
+ after(
1466
+ content: string | ReadableStream | Response,
1467
+ options?: ContentOptions,
1468
+ ): Element;
1469
+ prepend(
1470
+ content: string | ReadableStream | Response,
1471
+ options?: ContentOptions,
1472
+ ): Element;
1473
+ append(
1474
+ content: string | ReadableStream | Response,
1475
+ options?: ContentOptions,
1476
+ ): Element;
1477
+ replace(
1478
+ content: string | ReadableStream | Response,
1479
+ options?: ContentOptions,
1480
+ ): Element;
1284
1481
  remove(): Element;
1285
1482
  removeAndKeepContent(): Element;
1286
- setInnerContent(content: string, options?: ContentOptions): Element;
1483
+ setInnerContent(
1484
+ content: string | ReadableStream | Response,
1485
+ options?: ContentOptions,
1486
+ ): Element;
1287
1487
  onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
1288
1488
  }
1289
1489
  export interface EndTag {
1290
1490
  name: string;
1291
- before(content: string, options?: ContentOptions): EndTag;
1292
- after(content: string, options?: ContentOptions): EndTag;
1491
+ before(
1492
+ content: string | ReadableStream | Response,
1493
+ options?: ContentOptions,
1494
+ ): EndTag;
1495
+ after(
1496
+ content: string | ReadableStream | Response,
1497
+ options?: ContentOptions,
1498
+ ): EndTag;
1293
1499
  remove(): EndTag;
1294
1500
  }
1295
1501
  export interface Comment {
@@ -1304,18 +1510,32 @@ export interface Text {
1304
1510
  readonly text: string;
1305
1511
  readonly lastInTextNode: boolean;
1306
1512
  readonly removed: boolean;
1307
- before(content: string, options?: ContentOptions): Text;
1308
- after(content: string, options?: ContentOptions): Text;
1309
- replace(content: string, options?: ContentOptions): Text;
1513
+ before(
1514
+ content: string | ReadableStream | Response,
1515
+ options?: ContentOptions,
1516
+ ): Text;
1517
+ after(
1518
+ content: string | ReadableStream | Response,
1519
+ options?: ContentOptions,
1520
+ ): Text;
1521
+ replace(
1522
+ content: string | ReadableStream | Response,
1523
+ options?: ContentOptions,
1524
+ ): Text;
1310
1525
  remove(): Text;
1311
1526
  }
1312
1527
  export interface DocumentEnd {
1313
1528
  append(content: string, options?: ContentOptions): DocumentEnd;
1314
1529
  }
1530
+ /**
1531
+ * 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.
1532
+ *
1533
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent)
1534
+ */
1315
1535
  export declare abstract class FetchEvent extends ExtendableEvent {
1316
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1536
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
1317
1537
  readonly request: Request;
1318
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1538
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
1319
1539
  respondWith(promise: Response | Promise<Response>): void;
1320
1540
  passThroughOnException(): void;
1321
1541
  }
@@ -1323,24 +1543,35 @@ export type HeadersInit =
1323
1543
  | Headers
1324
1544
  | Iterable<Iterable<string>>
1325
1545
  | Record<string, string>;
1546
+ /**
1547
+ * 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.
1548
+ *
1549
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
1550
+ */
1326
1551
  export declare class Headers {
1327
1552
  constructor(init?: HeadersInit);
1553
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/get) */
1328
1554
  get(name: string): string | null;
1329
1555
  getAll(name: string): string[];
1556
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/getSetCookie) */
1330
1557
  getSetCookie(): string[];
1558
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/has) */
1331
1559
  has(name: string): boolean;
1560
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/set) */
1332
1561
  set(name: string, value: string): void;
1562
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
1333
1563
  append(name: string, value: string): void;
1564
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/delete) */
1334
1565
  delete(name: string): void;
1335
1566
  forEach<This = unknown>(
1336
1567
  callback: (this: This, value: string, key: string, parent: Headers) => void,
1337
1568
  thisArg?: This,
1338
1569
  ): void;
1339
- /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
1570
+ /* Returns an iterator allowing to go through all key/value pairs contained in this object. */
1340
1571
  entries(): IterableIterator<[key: string, value: string]>;
1341
- /** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1572
+ /* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
1342
1573
  keys(): IterableIterator<string>;
1343
- /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1574
+ /* Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
1344
1575
  values(): IterableIterator<string>;
1345
1576
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
1346
1577
  }
@@ -1353,36 +1584,55 @@ export type BodyInit =
1353
1584
  | URLSearchParams
1354
1585
  | FormData;
1355
1586
  export declare abstract class Body {
1587
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */
1356
1588
  get body(): ReadableStream | null;
1589
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
1357
1590
  get bodyUsed(): boolean;
1591
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
1358
1592
  arrayBuffer(): Promise<ArrayBuffer>;
1593
+ bytes(): Promise<Uint8Array>;
1594
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
1359
1595
  text(): Promise<string>;
1596
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
1360
1597
  json<T>(): Promise<T>;
1598
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
1361
1599
  formData(): Promise<FormData>;
1600
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
1362
1601
  blob(): Promise<Blob>;
1363
1602
  }
1364
- export declare class Response extends Body {
1365
- constructor(body?: BodyInit | null, init?: ResponseInit);
1366
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
1367
- static redirect(url: string, status?: number): Response;
1368
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
1369
- static json(any: any, maybeInit?: ResponseInit | Response): Response;
1370
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1603
+ /**
1604
+ * This Fetch API interface represents the response to a request.
1605
+ *
1606
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1607
+ */
1608
+ export declare var Response: {
1609
+ prototype: Response;
1610
+ new (body?: BodyInit | null, init?: ResponseInit): Response;
1611
+ redirect(url: string, status?: number): Response;
1612
+ json(any: any, maybeInit?: ResponseInit | Response): Response;
1613
+ };
1614
+ /**
1615
+ * This Fetch API interface represents the response to a request.
1616
+ *
1617
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
1618
+ */
1619
+ export interface Response extends Body {
1620
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1371
1621
  clone(): Response;
1372
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1373
- get status(): number;
1374
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1375
- get statusText(): string;
1376
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1377
- get headers(): Headers;
1378
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1379
- get ok(): boolean;
1380
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1381
- get redirected(): boolean;
1382
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1383
- get url(): string;
1384
- get webSocket(): WebSocket | null;
1385
- get cf(): any | undefined;
1622
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1623
+ status: number;
1624
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1625
+ statusText: string;
1626
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1627
+ headers: Headers;
1628
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1629
+ ok: boolean;
1630
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1631
+ redirected: boolean;
1632
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1633
+ url: string;
1634
+ webSocket: WebSocket | null;
1635
+ cf: any | undefined;
1386
1636
  }
1387
1637
  export interface ResponseInit {
1388
1638
  status?: number;
@@ -1395,73 +1645,97 @@ export interface ResponseInit {
1395
1645
  export type RequestInfo<
1396
1646
  CfHostMetadata = unknown,
1397
1647
  Cf = CfProperties<CfHostMetadata>,
1398
- > = Request<CfHostMetadata, Cf> | string | URL;
1399
- export declare class Request<
1648
+ > = Request<CfHostMetadata, Cf> | string;
1649
+ /**
1650
+ * This Fetch API interface represents a resource request.
1651
+ *
1652
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1653
+ */
1654
+ export declare var Request: {
1655
+ prototype: Request;
1656
+ new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
1657
+ input: RequestInfo<CfProperties> | URL,
1658
+ init?: RequestInit<Cf>,
1659
+ ): Request<CfHostMetadata, Cf>;
1660
+ };
1661
+ /**
1662
+ * This Fetch API interface represents a resource request.
1663
+ *
1664
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
1665
+ */
1666
+ export interface Request<
1400
1667
  CfHostMetadata = unknown,
1401
1668
  Cf = CfProperties<CfHostMetadata>,
1402
1669
  > extends Body {
1403
- constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
1404
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1670
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1405
1671
  clone(): Request<CfHostMetadata, Cf>;
1406
1672
  /**
1407
1673
  * Returns request's HTTP method, which is "GET" by default.
1408
1674
  *
1409
1675
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1410
1676
  */
1411
- get method(): string;
1677
+ method: string;
1412
1678
  /**
1413
1679
  * Returns the URL of request as a string.
1414
1680
  *
1415
1681
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
1416
1682
  */
1417
- get url(): string;
1683
+ url: string;
1418
1684
  /**
1419
1685
  * 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.
1420
1686
  *
1421
1687
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1422
1688
  */
1423
- get headers(): Headers;
1689
+ headers: Headers;
1424
1690
  /**
1425
1691
  * 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.
1426
1692
  *
1427
1693
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
1428
1694
  */
1429
- get redirect(): string;
1430
- get fetcher(): Fetcher | null;
1695
+ redirect: string;
1696
+ fetcher: Fetcher | null;
1431
1697
  /**
1432
1698
  * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
1433
1699
  *
1434
1700
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
1435
1701
  */
1436
- get signal(): AbortSignal;
1437
- get cf(): Cf | undefined;
1702
+ signal: AbortSignal;
1703
+ cf: Cf | undefined;
1438
1704
  /**
1439
1705
  * 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]
1440
1706
  *
1441
1707
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
1442
1708
  */
1443
- get integrity(): string;
1709
+ integrity: string;
1444
1710
  /**
1445
1711
  * Returns a boolean indicating whether or not request can outlive the global in which it was created.
1446
1712
  *
1447
1713
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1448
1714
  */
1449
- get keepalive(): boolean;
1715
+ keepalive: boolean;
1716
+ /**
1717
+ * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
1718
+ *
1719
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
1720
+ */
1721
+ cache?: "no-store" | "no-cache";
1450
1722
  }
1451
1723
  export interface RequestInit<Cf = CfProperties> {
1452
- /** A string to set request's method. */
1724
+ /* A string to set request's method. */
1453
1725
  method?: string;
1454
- /** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
1726
+ /* A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
1455
1727
  headers?: HeadersInit;
1456
- /** A BodyInit object or null to set request's body. */
1728
+ /* A BodyInit object or null to set request's body. */
1457
1729
  body?: BodyInit | null;
1458
- /** 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. */
1730
+ /* 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. */
1459
1731
  redirect?: string;
1460
1732
  fetcher?: Fetcher | null;
1461
1733
  cf?: Cf;
1462
- /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1734
+ /* A string indicating how the request will interact with the browser's cache to set request's cache. */
1735
+ cache?: "no-store" | "no-cache";
1736
+ /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1463
1737
  integrity?: string;
1464
- /** An AbortSignal to set request's signal. */
1738
+ /* An AbortSignal to set request's signal. */
1465
1739
  signal?: AbortSignal | null;
1466
1740
  }
1467
1741
  export type Service<
@@ -1473,7 +1747,7 @@ export type Fetcher<
1473
1747
  > = (T extends Rpc.EntrypointBranded
1474
1748
  ? Rpc.Provider<T, Reserved | "fetch" | "connect" | "queue" | "scheduled">
1475
1749
  : unknown) & {
1476
- fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
1750
+ fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
1477
1751
  connect(address: SocketAddress | string, options?: SocketOptions): Socket;
1478
1752
  queue(
1479
1753
  queueName: string,
@@ -1731,6 +2005,7 @@ export interface R2MultipartUpload {
1731
2005
  uploadPart(
1732
2006
  partNumber: number,
1733
2007
  value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
2008
+ options?: R2UploadPartOptions,
1734
2009
  ): Promise<R2UploadedPart>;
1735
2010
  abort(): Promise<void>;
1736
2011
  complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
@@ -1751,6 +2026,7 @@ export declare abstract class R2Object {
1751
2026
  readonly customMetadata?: Record<string, string>;
1752
2027
  readonly range?: R2Range;
1753
2028
  readonly storageClass: string;
2029
+ readonly ssecKeyMd5?: string;
1754
2030
  writeHttpMetadata(headers: Headers): void;
1755
2031
  }
1756
2032
  export interface R2ObjectBody extends R2Object {
@@ -1783,6 +2059,7 @@ export interface R2Conditional {
1783
2059
  export interface R2GetOptions {
1784
2060
  onlyIf?: R2Conditional | Headers;
1785
2061
  range?: R2Range | Headers;
2062
+ ssecKey?: ArrayBuffer | string;
1786
2063
  }
1787
2064
  export interface R2PutOptions {
1788
2065
  onlyIf?: R2Conditional | Headers;
@@ -1794,11 +2071,13 @@ export interface R2PutOptions {
1794
2071
  sha384?: ArrayBuffer | string;
1795
2072
  sha512?: ArrayBuffer | string;
1796
2073
  storageClass?: string;
2074
+ ssecKey?: ArrayBuffer | string;
1797
2075
  }
1798
2076
  export interface R2MultipartOptions {
1799
2077
  httpMetadata?: R2HTTPMetadata | Headers;
1800
2078
  customMetadata?: Record<string, string>;
1801
2079
  storageClass?: string;
2080
+ ssecKey?: ArrayBuffer | string;
1802
2081
  }
1803
2082
  export interface R2Checksums {
1804
2083
  readonly md5?: ArrayBuffer;
@@ -1835,6 +2114,9 @@ export type R2Objects = {
1835
2114
  truncated: false;
1836
2115
  }
1837
2116
  );
2117
+ export interface R2UploadPartOptions {
2118
+ ssecKey?: ArrayBuffer | string;
2119
+ }
1838
2120
  export declare abstract class JsRpcProperty {
1839
2121
  then(handler: Function, errorHandler?: Function): any;
1840
2122
  catch(errorHandler: Function): any;
@@ -1936,31 +2218,36 @@ export type ReadableStreamReadResult<R = any> =
1936
2218
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1937
2219
  */
1938
2220
  export interface ReadableStream<R = any> {
1939
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
2221
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
1940
2222
  get locked(): boolean;
1941
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
2223
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
1942
2224
  cancel(reason?: any): Promise<void>;
1943
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
2225
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1944
2226
  getReader(): ReadableStreamDefaultReader<R>;
1945
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
2227
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1946
2228
  getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
1947
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
2229
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
1948
2230
  pipeThrough<T>(
1949
2231
  transform: ReadableWritablePair<T, R>,
1950
2232
  options?: StreamPipeOptions,
1951
2233
  ): ReadableStream<T>;
1952
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
2234
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
1953
2235
  pipeTo(
1954
2236
  destination: WritableStream<R>,
1955
2237
  options?: StreamPipeOptions,
1956
2238
  ): Promise<void>;
1957
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
2239
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
1958
2240
  tee(): [ReadableStream<R>, ReadableStream<R>];
1959
2241
  values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1960
2242
  [Symbol.asyncIterator](
1961
2243
  options?: ReadableStreamValuesOptions,
1962
2244
  ): AsyncIterableIterator<R>;
1963
2245
  }
2246
+ /**
2247
+ * 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.
2248
+ *
2249
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
2250
+ */
1964
2251
  export declare const ReadableStream: {
1965
2252
  prototype: ReadableStream;
1966
2253
  new (
@@ -1972,24 +2259,26 @@ export declare const ReadableStream: {
1972
2259
  strategy?: QueuingStrategy<R>,
1973
2260
  ): ReadableStream<R>;
1974
2261
  };
2262
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader) */
1975
2263
  export declare class ReadableStreamDefaultReader<R = any> {
1976
2264
  constructor(stream: ReadableStream);
1977
2265
  get closed(): Promise<void>;
1978
2266
  cancel(reason?: any): Promise<void>;
1979
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
2267
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
1980
2268
  read(): Promise<ReadableStreamReadResult<R>>;
1981
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
2269
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
1982
2270
  releaseLock(): void;
1983
2271
  }
2272
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
1984
2273
  export declare class ReadableStreamBYOBReader {
1985
2274
  constructor(stream: ReadableStream);
1986
2275
  get closed(): Promise<void>;
1987
2276
  cancel(reason?: any): Promise<void>;
1988
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
2277
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
1989
2278
  read<T extends ArrayBufferView>(
1990
2279
  view: T,
1991
2280
  ): Promise<ReadableStreamReadResult<T>>;
1992
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
2281
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
1993
2282
  releaseLock(): void;
1994
2283
  readAtLeast<T extends ArrayBufferView>(
1995
2284
  minElements: number,
@@ -2007,52 +2296,60 @@ export interface ReadableStreamGetReaderOptions {
2007
2296
  */
2008
2297
  mode: "byob";
2009
2298
  }
2299
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
2010
2300
  export declare abstract class ReadableStreamBYOBRequest {
2011
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
2301
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
2012
2302
  get view(): Uint8Array | null;
2013
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
2303
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
2014
2304
  respond(bytesWritten: number): void;
2015
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
2305
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
2016
2306
  respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
2017
2307
  get atLeast(): number | null;
2018
2308
  }
2309
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
2019
2310
  export declare abstract class ReadableStreamDefaultController<R = any> {
2020
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
2311
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
2021
2312
  get desiredSize(): number | null;
2022
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
2313
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
2023
2314
  close(): void;
2024
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
2315
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
2025
2316
  enqueue(chunk?: R): void;
2026
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
2317
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
2027
2318
  error(reason: any): void;
2028
2319
  }
2320
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
2029
2321
  export declare abstract class ReadableByteStreamController {
2030
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
2322
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
2031
2323
  get byobRequest(): ReadableStreamBYOBRequest | null;
2032
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
2324
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
2033
2325
  get desiredSize(): number | null;
2034
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
2326
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
2035
2327
  close(): void;
2036
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
2328
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
2037
2329
  enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
2038
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
2330
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
2039
2331
  error(reason: any): void;
2040
2332
  }
2333
+ /**
2334
+ * 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.
2335
+ *
2336
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
2337
+ */
2041
2338
  export declare abstract class WritableStreamDefaultController {
2042
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
2339
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
2043
2340
  get signal(): AbortSignal;
2044
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
2341
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
2045
2342
  error(reason?: any): void;
2046
2343
  }
2047
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
2048
- export interface TransformStreamDefaultController<O = any> {
2049
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
2344
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
2345
+ export declare abstract class TransformStreamDefaultController<O = any> {
2346
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
2050
2347
  get desiredSize(): number | null;
2051
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
2348
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
2052
2349
  enqueue(chunk?: O): void;
2053
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
2350
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
2054
2351
  error(reason: any): void;
2055
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
2352
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
2056
2353
  terminate(): void;
2057
2354
  }
2058
2355
  export interface ReadableWritablePair<R = any, W = any> {
@@ -2064,46 +2361,57 @@ export interface ReadableWritablePair<R = any, W = any> {
2064
2361
  writable: WritableStream<W>;
2065
2362
  readable: ReadableStream<R>;
2066
2363
  }
2364
+ /**
2365
+ * 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.
2366
+ *
2367
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream)
2368
+ */
2067
2369
  export declare class WritableStream<W = any> {
2068
2370
  constructor(
2069
2371
  underlyingSink?: UnderlyingSink,
2070
2372
  queuingStrategy?: QueuingStrategy,
2071
2373
  );
2072
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
2374
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
2073
2375
  get locked(): boolean;
2074
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
2376
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
2075
2377
  abort(reason?: any): Promise<void>;
2076
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
2378
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
2077
2379
  close(): Promise<void>;
2078
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
2380
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
2079
2381
  getWriter(): WritableStreamDefaultWriter<W>;
2080
2382
  }
2383
+ /**
2384
+ * 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.
2385
+ *
2386
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter)
2387
+ */
2081
2388
  export declare class WritableStreamDefaultWriter<W = any> {
2082
2389
  constructor(stream: WritableStream);
2083
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
2390
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
2084
2391
  get closed(): Promise<void>;
2085
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
2392
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
2086
2393
  get ready(): Promise<void>;
2087
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
2394
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
2088
2395
  get desiredSize(): number | null;
2089
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
2396
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
2090
2397
  abort(reason?: any): Promise<void>;
2091
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
2398
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
2092
2399
  close(): Promise<void>;
2093
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
2400
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
2094
2401
  write(chunk?: W): Promise<void>;
2095
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
2402
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
2096
2403
  releaseLock(): void;
2097
2404
  }
2405
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream) */
2098
2406
  export declare class TransformStream<I = any, O = any> {
2099
2407
  constructor(
2100
2408
  transformer?: Transformer<I, O>,
2101
2409
  writableStrategy?: QueuingStrategy<I>,
2102
2410
  readableStrategy?: QueuingStrategy<O>,
2103
2411
  );
2104
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
2412
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
2105
2413
  get readable(): ReadableStream<O>;
2106
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
2414
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
2107
2415
  get writable(): WritableStream<I>;
2108
2416
  }
2109
2417
  export declare class FixedLengthStream extends IdentityTransformStream {
@@ -2124,18 +2432,21 @@ export interface IdentityTransformStreamQueuingStrategy {
2124
2432
  export interface ReadableStreamValuesOptions {
2125
2433
  preventCancel?: boolean;
2126
2434
  }
2435
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
2127
2436
  export declare class CompressionStream extends TransformStream<
2128
2437
  ArrayBuffer | ArrayBufferView,
2129
2438
  Uint8Array
2130
2439
  > {
2131
2440
  constructor(format: "gzip" | "deflate" | "deflate-raw");
2132
2441
  }
2442
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
2133
2443
  export declare class DecompressionStream extends TransformStream<
2134
2444
  ArrayBuffer | ArrayBufferView,
2135
2445
  Uint8Array
2136
2446
  > {
2137
2447
  constructor(format: "gzip" | "deflate" | "deflate-raw");
2138
2448
  }
2449
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoderStream) */
2139
2450
  export declare class TextEncoderStream extends TransformStream<
2140
2451
  string,
2141
2452
  Uint8Array
@@ -2143,6 +2454,7 @@ export declare class TextEncoderStream extends TransformStream<
2143
2454
  constructor();
2144
2455
  get encoding(): string;
2145
2456
  }
2457
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoderStream) */
2146
2458
  export declare class TextDecoderStream extends TransformStream<
2147
2459
  ArrayBuffer | ArrayBufferView,
2148
2460
  string
@@ -2156,20 +2468,30 @@ export interface TextDecoderStreamTextDecoderStreamInit {
2156
2468
  fatal?: boolean;
2157
2469
  ignoreBOM?: boolean;
2158
2470
  }
2471
+ /**
2472
+ * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
2473
+ *
2474
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy)
2475
+ */
2159
2476
  export declare class ByteLengthQueuingStrategy
2160
2477
  implements QueuingStrategy<ArrayBufferView>
2161
2478
  {
2162
2479
  constructor(init: QueuingStrategyInit);
2163
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
2480
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
2164
2481
  get highWaterMark(): number;
2165
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
2482
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
2166
2483
  get size(): (chunk?: any) => number;
2167
2484
  }
2485
+ /**
2486
+ * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
2487
+ *
2488
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy)
2489
+ */
2168
2490
  export declare class CountQueuingStrategy implements QueuingStrategy {
2169
2491
  constructor(init: QueuingStrategyInit);
2170
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
2492
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
2171
2493
  get highWaterMark(): number;
2172
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
2494
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
2173
2495
  get size(): (chunk?: any) => number;
2174
2496
  }
2175
2497
  export interface QueuingStrategyInit {
@@ -2205,6 +2527,7 @@ export interface TraceItem {
2205
2527
  | null;
2206
2528
  readonly eventTimestamp: number | null;
2207
2529
  readonly logs: TraceLog[];
2530
+ readonly spans: OTelSpan[];
2208
2531
  readonly exceptions: TraceException[];
2209
2532
  readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
2210
2533
  readonly scriptName: string | null;
@@ -2213,6 +2536,8 @@ export interface TraceItem {
2213
2536
  readonly dispatchNamespace?: string;
2214
2537
  readonly scriptTags?: string[];
2215
2538
  readonly outcome: string;
2539
+ readonly executionModel: string;
2540
+ readonly truncated: boolean;
2216
2541
  }
2217
2542
  export interface TraceItemAlarmEventInfo {
2218
2543
  readonly scheduledTime: Date;
@@ -2276,6 +2601,18 @@ export interface TraceLog {
2276
2601
  readonly level: string;
2277
2602
  readonly message: any;
2278
2603
  }
2604
+ export interface OTelSpan {
2605
+ readonly spanId: string;
2606
+ readonly parentSpanId: string;
2607
+ readonly operation: string;
2608
+ readonly tags: OTelSpanTag[];
2609
+ readonly startTime: Date;
2610
+ readonly endTime: Date;
2611
+ }
2612
+ export interface OTelSpanTag {
2613
+ key: string;
2614
+ value: boolean | (number | bigint) | number | string;
2615
+ }
2279
2616
  export interface TraceException {
2280
2617
  readonly timestamp: number;
2281
2618
  readonly message: string;
@@ -2294,76 +2631,119 @@ export interface TraceMetrics {
2294
2631
  export interface UnsafeTraceMetrics {
2295
2632
  fromTrace(item: TraceItem): TraceMetrics;
2296
2633
  }
2634
+ /**
2635
+ * The URL interface represents an object providing static methods used for creating object URLs.
2636
+ *
2637
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
2638
+ */
2297
2639
  export declare class URL {
2298
2640
  constructor(url: string | URL, base?: string | URL);
2299
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
2641
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
2300
2642
  get origin(): string;
2301
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2643
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2302
2644
  get href(): string;
2303
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2645
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
2304
2646
  set href(value: string);
2305
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2647
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2306
2648
  get protocol(): string;
2307
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2649
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
2308
2650
  set protocol(value: string);
2309
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2651
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2310
2652
  get username(): string;
2311
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2653
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
2312
2654
  set username(value: string);
2313
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2655
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2314
2656
  get password(): string;
2315
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2657
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
2316
2658
  set password(value: string);
2317
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2659
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2318
2660
  get host(): string;
2319
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2661
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
2320
2662
  set host(value: string);
2321
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2663
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2322
2664
  get hostname(): string;
2323
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2665
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
2324
2666
  set hostname(value: string);
2325
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2667
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2326
2668
  get port(): string;
2327
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2669
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
2328
2670
  set port(value: string);
2329
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2671
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2330
2672
  get pathname(): string;
2331
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2673
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
2332
2674
  set pathname(value: string);
2333
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2675
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2334
2676
  get search(): string;
2335
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2677
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
2336
2678
  set search(value: string);
2337
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2679
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2338
2680
  get hash(): string;
2339
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2681
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
2340
2682
  set hash(value: string);
2341
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
2683
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
2342
2684
  get searchParams(): URLSearchParams;
2343
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
2685
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
2344
2686
  toJSON(): string;
2687
+ /*function toString() { [native code] }*/
2345
2688
  toString(): string;
2346
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
2689
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
2347
2690
  static canParse(url: string, base?: string): boolean;
2348
2691
  static parse(url: string, base?: string): URL | null;
2692
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
2693
+ static createObjectURL(object: File | Blob): string;
2694
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
2695
+ static revokeObjectURL(object_url: string): void;
2349
2696
  }
2697
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
2350
2698
  export declare class URLSearchParams {
2351
2699
  constructor(
2352
2700
  init?: Iterable<Iterable<string>> | Record<string, string> | string,
2353
2701
  );
2702
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */
2354
2703
  get size(): number;
2704
+ /**
2705
+ * Appends a specified key/value pair as a new search parameter.
2706
+ *
2707
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
2708
+ */
2355
2709
  append(name: string, value: string): void;
2710
+ /**
2711
+ * Deletes the given search parameter, and its associated value, from the list of all search parameters.
2712
+ *
2713
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
2714
+ */
2356
2715
  delete(name: string, value?: string): void;
2716
+ /**
2717
+ * Returns the first value associated to the given search parameter.
2718
+ *
2719
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
2720
+ */
2357
2721
  get(name: string): string | null;
2722
+ /**
2723
+ * Returns all the values association with a given search parameter.
2724
+ *
2725
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
2726
+ */
2358
2727
  getAll(name: string): string[];
2728
+ /**
2729
+ * Returns a Boolean indicating if such a search parameter exists.
2730
+ *
2731
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
2732
+ */
2359
2733
  has(name: string, value?: string): boolean;
2734
+ /**
2735
+ * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
2736
+ *
2737
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
2738
+ */
2360
2739
  set(name: string, value: string): void;
2740
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */
2361
2741
  sort(): void;
2362
- /** Returns an array of key, value pairs for every entry in the search params. */
2742
+ /* Returns an array of key, value pairs for every entry in the search params. */
2363
2743
  entries(): IterableIterator<[key: string, value: string]>;
2364
- /** Returns a list of keys in the search params. */
2744
+ /* Returns a list of keys in the search params. */
2365
2745
  keys(): IterableIterator<string>;
2366
- /** Returns a list of values in the search params. */
2746
+ /* Returns a list of values in the search params. */
2367
2747
  values(): IterableIterator<string>;
2368
2748
  forEach<This = unknown>(
2369
2749
  callback: (
@@ -2374,6 +2754,7 @@ export declare class URLSearchParams {
2374
2754
  ) => void,
2375
2755
  thisArg?: This,
2376
2756
  ): void;
2757
+ /*function toString() { [native code] } Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
2377
2758
  toString(): string;
2378
2759
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
2379
2760
  }
@@ -2426,6 +2807,11 @@ export interface URLPatternURLPatternResult {
2426
2807
  export interface URLPatternURLPatternOptions {
2427
2808
  ignoreCase?: boolean;
2428
2809
  }
2810
+ /**
2811
+ * 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.
2812
+ *
2813
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent)
2814
+ */
2429
2815
  export declare class CloseEvent extends Event {
2430
2816
  constructor(type: string, initializer?: CloseEventInit);
2431
2817
  /**
@@ -2452,38 +2838,52 @@ export interface CloseEventInit {
2452
2838
  reason?: string;
2453
2839
  wasClean?: boolean;
2454
2840
  }
2841
+ /**
2842
+ * A message received by a target object.
2843
+ *
2844
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent)
2845
+ */
2455
2846
  export declare class MessageEvent extends Event {
2456
2847
  constructor(type: string, initializer: MessageEventInit);
2848
+ /**
2849
+ * Returns the data of the message.
2850
+ *
2851
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/data)
2852
+ */
2457
2853
  readonly data: ArrayBuffer | string;
2458
2854
  }
2459
2855
  export interface MessageEventInit {
2460
2856
  data: ArrayBuffer | string;
2461
2857
  }
2462
- /**
2463
- * Events providing information related to errors in scripts or in files.
2464
- *
2465
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
2466
- */
2467
- export interface ErrorEvent extends Event {
2468
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
2469
- readonly filename: string;
2470
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
2471
- readonly message: string;
2472
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
2473
- readonly lineno: number;
2474
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
2475
- readonly colno: number;
2476
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
2477
- readonly error: any;
2478
- }
2479
2858
  export type WebSocketEventMap = {
2480
2859
  close: CloseEvent;
2481
2860
  message: MessageEvent;
2482
2861
  open: Event;
2483
2862
  error: ErrorEvent;
2484
2863
  };
2485
- export declare class WebSocket extends EventTarget<WebSocketEventMap> {
2486
- constructor(url: string, protocols?: string[] | string);
2864
+ /**
2865
+ * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2866
+ *
2867
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2868
+ */
2869
+ export declare var WebSocket: {
2870
+ prototype: WebSocket;
2871
+ new (url: string, protocols?: string[] | string): WebSocket;
2872
+ readonly READY_STATE_CONNECTING: number;
2873
+ readonly CONNECTING: number;
2874
+ readonly READY_STATE_OPEN: number;
2875
+ readonly OPEN: number;
2876
+ readonly READY_STATE_CLOSING: number;
2877
+ readonly CLOSING: number;
2878
+ readonly READY_STATE_CLOSED: number;
2879
+ readonly CLOSED: number;
2880
+ };
2881
+ /**
2882
+ * Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
2883
+ *
2884
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
2885
+ */
2886
+ export interface WebSocket extends EventTarget<WebSocketEventMap> {
2487
2887
  accept(): void;
2488
2888
  /**
2489
2889
  * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
@@ -2499,38 +2899,30 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
2499
2899
  close(code?: number, reason?: string): void;
2500
2900
  serializeAttachment(attachment: any): void;
2501
2901
  deserializeAttachment(): any | null;
2502
- static readonly READY_STATE_CONNECTING: number;
2503
- static readonly CONNECTING: number;
2504
- static readonly READY_STATE_OPEN: number;
2505
- static readonly OPEN: number;
2506
- static readonly READY_STATE_CLOSING: number;
2507
- static readonly CLOSING: number;
2508
- static readonly READY_STATE_CLOSED: number;
2509
- static readonly CLOSED: number;
2510
2902
  /**
2511
2903
  * Returns the state of the WebSocket object's connection. It can have the values described below.
2512
2904
  *
2513
2905
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2514
2906
  */
2515
- get readyState(): number;
2907
+ readyState: number;
2516
2908
  /**
2517
2909
  * Returns the URL that was used to establish the WebSocket connection.
2518
2910
  *
2519
2911
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2520
2912
  */
2521
- get url(): string | null;
2913
+ url: string | null;
2522
2914
  /**
2523
2915
  * 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.
2524
2916
  *
2525
2917
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2526
2918
  */
2527
- get protocol(): string | null;
2919
+ protocol: string | null;
2528
2920
  /**
2529
2921
  * Returns the extensions selected by the server, if any.
2530
2922
  *
2531
2923
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2532
2924
  */
2533
- get extensions(): string | null;
2925
+ extensions: string | null;
2534
2926
  }
2535
2927
  export declare const WebSocketPair: {
2536
2928
  new (): {
@@ -2539,22 +2931,44 @@ export declare const WebSocketPair: {
2539
2931
  };
2540
2932
  };
2541
2933
  export interface SqlStorage {
2542
- exec(query: string, ...bindings: any[]): SqlStorageCursor;
2934
+ exec<T extends Record<string, SqlStorageValue>>(
2935
+ query: string,
2936
+ ...bindings: any[]
2937
+ ): SqlStorageCursor<T>;
2543
2938
  prepare(query: string): SqlStorageStatement;
2544
- ingest(query: string): string;
2939
+ ingest(query: string): SqlStorageIngestResult;
2545
2940
  get databaseSize(): number;
2546
2941
  Cursor: typeof SqlStorageCursor;
2547
2942
  Statement: typeof SqlStorageStatement;
2548
2943
  }
2549
2944
  export declare abstract class SqlStorageStatement {}
2550
- export declare abstract class SqlStorageCursor {
2551
- raw(): IterableIterator<((ArrayBuffer | string | number) | null)[]>;
2552
- get columnNames(): string[];
2945
+ export type SqlStorageValue = ArrayBuffer | string | number | null;
2946
+ export declare abstract class SqlStorageCursor<
2947
+ T extends Record<string, SqlStorageValue>,
2948
+ > {
2949
+ next():
2950
+ | {
2951
+ done?: false;
2952
+ value: T;
2953
+ }
2954
+ | {
2955
+ done: true;
2956
+ value?: never;
2957
+ };
2958
+ toArray(): T[];
2959
+ one(): T;
2960
+ raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
2961
+ columnNames: string[];
2553
2962
  get rowsRead(): number;
2554
2963
  get rowsWritten(): number;
2555
- [Symbol.iterator](): IterableIterator<
2556
- Record<string, (ArrayBuffer | string | number) | null>
2557
- >;
2964
+ get reusedCachedQueryForTest(): boolean;
2965
+ [Symbol.iterator](): IterableIterator<T>;
2966
+ }
2967
+ export interface SqlStorageIngestResult {
2968
+ remainder: string;
2969
+ rowsRead: number;
2970
+ rowsWritten: number;
2971
+ statementCount: number;
2558
2972
  }
2559
2973
  export interface Socket {
2560
2974
  get readable(): ReadableStream;
@@ -2567,6 +2981,7 @@ export interface Socket {
2567
2981
  export interface SocketOptions {
2568
2982
  secureTransport?: string;
2569
2983
  allowHalfOpen: boolean;
2984
+ highWaterMark?: number | bigint;
2570
2985
  }
2571
2986
  export interface SocketAddress {
2572
2987
  hostname: string;
@@ -2579,65 +2994,61 @@ export interface SocketInfo {
2579
2994
  remoteAddress?: string;
2580
2995
  localAddress?: string;
2581
2996
  }
2582
- export interface gpuGPU {
2583
- requestAdapter(
2584
- param1?: gpuGPURequestAdapterOptions,
2585
- ): Promise<gpuGPUAdapter | null>;
2997
+ export interface GPU {
2998
+ requestAdapter(param1?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
2586
2999
  }
2587
- export declare abstract class gpuGPUAdapter {
2588
- requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
2589
- requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
2590
- get features(): gpuGPUSupportedFeatures;
2591
- get limits(): gpuGPUSupportedLimits;
3000
+ export declare abstract class GPUAdapter {
3001
+ requestDevice(param1?: GPUDeviceDescriptor): Promise<GPUDevice>;
3002
+ requestAdapterInfo(unmaskHints?: string[]): Promise<GPUAdapterInfo>;
3003
+ get features(): GPUSupportedFeatures;
3004
+ get limits(): GPUSupportedLimits;
2592
3005
  }
2593
- export interface gpuGPUDevice extends EventTarget {
2594
- createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
3006
+ export interface GPUDevice extends EventTarget {
3007
+ createBuffer(param1: GPUBufferDescriptor): GPUBuffer;
2595
3008
  createBindGroupLayout(
2596
- descriptor: gpuGPUBindGroupLayoutDescriptor,
2597
- ): gpuGPUBindGroupLayout;
2598
- createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
2599
- createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
2600
- createShaderModule(
2601
- descriptor: gpuGPUShaderModuleDescriptor,
2602
- ): gpuGPUShaderModule;
3009
+ descriptor: GPUBindGroupLayoutDescriptor,
3010
+ ): GPUBindGroupLayout;
3011
+ createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
3012
+ createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
3013
+ createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
2603
3014
  createPipelineLayout(
2604
- descriptor: gpuGPUPipelineLayoutDescriptor,
2605
- ): gpuGPUPipelineLayout;
3015
+ descriptor: GPUPipelineLayoutDescriptor,
3016
+ ): GPUPipelineLayout;
2606
3017
  createComputePipeline(
2607
- descriptor: gpuGPUComputePipelineDescriptor,
2608
- ): gpuGPUComputePipeline;
3018
+ descriptor: GPUComputePipelineDescriptor,
3019
+ ): GPUComputePipeline;
2609
3020
  createRenderPipeline(
2610
- descriptor: gpuGPURenderPipelineDescriptor,
2611
- ): gpuGPURenderPipeline;
3021
+ descriptor: GPURenderPipelineDescriptor,
3022
+ ): GPURenderPipeline;
2612
3023
  createCommandEncoder(
2613
- descriptor?: gpuGPUCommandEncoderDescriptor,
2614
- ): gpuGPUCommandEncoder;
2615
- createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
3024
+ descriptor?: GPUCommandEncoderDescriptor,
3025
+ ): GPUCommandEncoder;
3026
+ createTexture(param1: GPUTextureDescriptor): GPUTexture;
2616
3027
  destroy(): void;
2617
- createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
3028
+ createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
2618
3029
  pushErrorScope(filter: string): void;
2619
- popErrorScope(): Promise<gpuGPUError | null>;
2620
- get queue(): gpuGPUQueue;
2621
- get lost(): Promise<gpuGPUDeviceLostInfo>;
2622
- get features(): gpuGPUSupportedFeatures;
2623
- get limits(): gpuGPUSupportedLimits;
3030
+ popErrorScope(): Promise<GPUError | null>;
3031
+ get queue(): GPUQueue;
3032
+ get lost(): Promise<GPUDeviceLostInfo>;
3033
+ get features(): GPUSupportedFeatures;
3034
+ get limits(): GPUSupportedLimits;
2624
3035
  }
2625
- export interface gpuGPUDeviceDescriptor {
3036
+ export interface GPUDeviceDescriptor {
2626
3037
  label?: string;
2627
3038
  requiredFeatures?: string[];
2628
3039
  requiredLimits?: Record<string, number | bigint>;
2629
- defaultQueue?: gpuGPUQueueDescriptor;
3040
+ defaultQueue?: GPUQueueDescriptor;
2630
3041
  }
2631
- export interface gpuGPUBufferDescriptor {
3042
+ export interface GPUBufferDescriptor {
2632
3043
  label: string;
2633
3044
  size: number | bigint;
2634
3045
  usage: number;
2635
3046
  mappedAtCreation: boolean;
2636
3047
  }
2637
- export interface gpuGPUQueueDescriptor {
3048
+ export interface GPUQueueDescriptor {
2638
3049
  label?: string;
2639
3050
  }
2640
- export declare abstract class gpuGPUBufferUsage {
3051
+ export declare abstract class GPUBufferUsage {
2641
3052
  static readonly MAP_READ: number;
2642
3053
  static readonly MAP_WRITE: number;
2643
3054
  static readonly COPY_SRC: number;
@@ -2649,7 +3060,7 @@ export declare abstract class gpuGPUBufferUsage {
2649
3060
  static readonly INDIRECT: number;
2650
3061
  static readonly QUERY_RESOLVE: number;
2651
3062
  }
2652
- export interface gpuGPUBuffer {
3063
+ export interface GPUBuffer {
2653
3064
  getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
2654
3065
  unmap(): void;
2655
3066
  destroy(): void;
@@ -2662,59 +3073,59 @@ export interface gpuGPUBuffer {
2662
3073
  get usage(): number;
2663
3074
  get mapState(): string;
2664
3075
  }
2665
- export declare abstract class gpuGPUShaderStage {
3076
+ export declare abstract class GPUShaderStage {
2666
3077
  static readonly VERTEX: number;
2667
3078
  static readonly FRAGMENT: number;
2668
3079
  static readonly COMPUTE: number;
2669
3080
  }
2670
- export interface gpuGPUBindGroupLayoutDescriptor {
3081
+ export interface GPUBindGroupLayoutDescriptor {
2671
3082
  label?: string;
2672
- entries: gpuGPUBindGroupLayoutEntry[];
3083
+ entries: GPUBindGroupLayoutEntry[];
2673
3084
  }
2674
- export interface gpuGPUBindGroupLayoutEntry {
3085
+ export interface GPUBindGroupLayoutEntry {
2675
3086
  binding: number;
2676
3087
  visibility: number;
2677
- buffer?: gpuGPUBufferBindingLayout;
2678
- sampler?: gpuGPUSamplerBindingLayout;
2679
- texture?: gpuGPUTextureBindingLayout;
2680
- storageTexture?: gpuGPUStorageTextureBindingLayout;
3088
+ buffer?: GPUBufferBindingLayout;
3089
+ sampler?: GPUSamplerBindingLayout;
3090
+ texture?: GPUTextureBindingLayout;
3091
+ storageTexture?: GPUStorageTextureBindingLayout;
2681
3092
  }
2682
- export interface gpuGPUStorageTextureBindingLayout {
3093
+ export interface GPUStorageTextureBindingLayout {
2683
3094
  access?: string;
2684
3095
  format: string;
2685
3096
  viewDimension?: string;
2686
3097
  }
2687
- export interface gpuGPUTextureBindingLayout {
3098
+ export interface GPUTextureBindingLayout {
2688
3099
  sampleType?: string;
2689
3100
  viewDimension?: string;
2690
3101
  multisampled?: boolean;
2691
3102
  }
2692
- export interface gpuGPUSamplerBindingLayout {
3103
+ export interface GPUSamplerBindingLayout {
2693
3104
  type?: string;
2694
3105
  }
2695
- export interface gpuGPUBufferBindingLayout {
3106
+ export interface GPUBufferBindingLayout {
2696
3107
  type?: string;
2697
3108
  hasDynamicOffset?: boolean;
2698
3109
  minBindingSize?: number | bigint;
2699
3110
  }
2700
- export interface gpuGPUBindGroupLayout {}
2701
- export interface gpuGPUBindGroup {}
2702
- export interface gpuGPUBindGroupDescriptor {
3111
+ export interface GPUBindGroupLayout {}
3112
+ export interface GPUBindGroup {}
3113
+ export interface GPUBindGroupDescriptor {
2703
3114
  label?: string;
2704
- layout: gpuGPUBindGroupLayout;
2705
- entries: gpuGPUBindGroupEntry[];
3115
+ layout: GPUBindGroupLayout;
3116
+ entries: GPUBindGroupEntry[];
2706
3117
  }
2707
- export interface gpuGPUBindGroupEntry {
3118
+ export interface GPUBindGroupEntry {
2708
3119
  binding: number;
2709
- resource: gpuGPUBufferBinding | gpuGPUSampler;
3120
+ resource: GPUBufferBinding | GPUSampler;
2710
3121
  }
2711
- export interface gpuGPUBufferBinding {
2712
- buffer: gpuGPUBuffer;
3122
+ export interface GPUBufferBinding {
3123
+ buffer: GPUBuffer;
2713
3124
  offset?: number | bigint;
2714
3125
  size?: number | bigint;
2715
3126
  }
2716
- export interface gpuGPUSampler {}
2717
- export interface gpuGPUSamplerDescriptor {
3127
+ export interface GPUSampler {}
3128
+ export interface GPUSamplerDescriptor {
2718
3129
  label?: string;
2719
3130
  addressModeU?: string;
2720
3131
  addressModeV?: string;
@@ -2727,76 +3138,74 @@ export interface gpuGPUSamplerDescriptor {
2727
3138
  compare: string;
2728
3139
  maxAnisotropy?: number;
2729
3140
  }
2730
- export interface gpuGPUShaderModule {
2731
- getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
3141
+ export interface GPUShaderModule {
3142
+ getCompilationInfo(): Promise<GPUCompilationInfo>;
2732
3143
  }
2733
- export interface gpuGPUShaderModuleDescriptor {
3144
+ export interface GPUShaderModuleDescriptor {
2734
3145
  label?: string;
2735
3146
  code: string;
2736
3147
  }
2737
- export interface gpuGPUPipelineLayout {}
2738
- export interface gpuGPUPipelineLayoutDescriptor {
3148
+ export interface GPUPipelineLayout {}
3149
+ export interface GPUPipelineLayoutDescriptor {
2739
3150
  label?: string;
2740
- bindGroupLayouts: gpuGPUBindGroupLayout[];
3151
+ bindGroupLayouts: GPUBindGroupLayout[];
2741
3152
  }
2742
- export interface gpuGPUComputePipeline {
2743
- getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
3153
+ export interface GPUComputePipeline {
3154
+ getBindGroupLayout(index: number): GPUBindGroupLayout;
2744
3155
  }
2745
- export interface gpuGPUComputePipelineDescriptor {
3156
+ export interface GPUComputePipelineDescriptor {
2746
3157
  label?: string;
2747
- compute: gpuGPUProgrammableStage;
2748
- layout: string | gpuGPUPipelineLayout;
3158
+ compute: GPUProgrammableStage;
3159
+ layout: string | GPUPipelineLayout;
2749
3160
  }
2750
- export interface gpuGPUProgrammableStage {
2751
- module: gpuGPUShaderModule;
3161
+ export interface GPUProgrammableStage {
3162
+ module: GPUShaderModule;
2752
3163
  entryPoint: string;
2753
3164
  constants?: Record<string, number>;
2754
3165
  }
2755
- export interface gpuGPUCommandEncoder {
3166
+ export interface GPUCommandEncoder {
2756
3167
  get label(): string;
2757
3168
  beginComputePass(
2758
- descriptor?: gpuGPUComputePassDescriptor,
2759
- ): gpuGPUComputePassEncoder;
2760
- beginRenderPass(
2761
- descriptor: gpuGPURenderPassDescriptor,
2762
- ): gpuGPURenderPassEncoder;
3169
+ descriptor?: GPUComputePassDescriptor,
3170
+ ): GPUComputePassEncoder;
3171
+ beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
2763
3172
  copyBufferToBuffer(
2764
- source: gpuGPUBuffer,
3173
+ source: GPUBuffer,
2765
3174
  sourceOffset: number | bigint,
2766
- destination: gpuGPUBuffer,
3175
+ destination: GPUBuffer,
2767
3176
  destinationOffset: number | bigint,
2768
3177
  size: number | bigint,
2769
3178
  ): void;
2770
- finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
3179
+ finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
2771
3180
  copyTextureToBuffer(
2772
- source: gpuGPUImageCopyTexture,
2773
- destination: gpuGPUImageCopyBuffer,
2774
- copySize: Iterable<number> | gpuGPUExtent3DDict,
3181
+ source: GPUImageCopyTexture,
3182
+ destination: GPUImageCopyBuffer,
3183
+ copySize: Iterable<number> | GPUExtent3DDict,
2775
3184
  ): void;
2776
3185
  copyBufferToTexture(
2777
- source: gpuGPUImageCopyBuffer,
2778
- destination: gpuGPUImageCopyTexture,
2779
- copySize: Iterable<number> | gpuGPUExtent3DDict,
3186
+ source: GPUImageCopyBuffer,
3187
+ destination: GPUImageCopyTexture,
3188
+ copySize: Iterable<number> | GPUExtent3DDict,
2780
3189
  ): void;
2781
3190
  copyTextureToTexture(
2782
- source: gpuGPUImageCopyTexture,
2783
- destination: gpuGPUImageCopyTexture,
2784
- copySize: Iterable<number> | gpuGPUExtent3DDict,
3191
+ source: GPUImageCopyTexture,
3192
+ destination: GPUImageCopyTexture,
3193
+ copySize: Iterable<number> | GPUExtent3DDict,
2785
3194
  ): void;
2786
3195
  clearBuffer(
2787
- buffer: gpuGPUBuffer,
3196
+ buffer: GPUBuffer,
2788
3197
  offset?: number | bigint,
2789
3198
  size?: number | bigint,
2790
3199
  ): void;
2791
3200
  }
2792
- export interface gpuGPUCommandEncoderDescriptor {
3201
+ export interface GPUCommandEncoderDescriptor {
2793
3202
  label?: string;
2794
3203
  }
2795
- export interface gpuGPUComputePassEncoder {
2796
- setPipeline(pipeline: gpuGPUComputePipeline): void;
3204
+ export interface GPUComputePassEncoder {
3205
+ setPipeline(pipeline: GPUComputePipeline): void;
2797
3206
  setBindGroup(
2798
3207
  index: number,
2799
- bindGroup: gpuGPUBindGroup | null,
3208
+ bindGroup: GPUBindGroup | null,
2800
3209
  dynamicOffsets?: Iterable<number>,
2801
3210
  ): void;
2802
3211
  dispatchWorkgroups(
@@ -2806,52 +3215,52 @@ export interface gpuGPUComputePassEncoder {
2806
3215
  ): void;
2807
3216
  end(): void;
2808
3217
  }
2809
- export interface gpuGPUComputePassDescriptor {
3218
+ export interface GPUComputePassDescriptor {
2810
3219
  label?: string;
2811
- timestampWrites?: gpuGPUComputePassTimestampWrites;
3220
+ timestampWrites?: GPUComputePassTimestampWrites;
2812
3221
  }
2813
- export interface gpuGPUQuerySet {}
2814
- export interface gpuGPUQuerySetDescriptor {
3222
+ export interface GPUQuerySet {}
3223
+ export interface GPUQuerySetDescriptor {
2815
3224
  label?: string;
2816
3225
  }
2817
- export interface gpuGPUComputePassTimestampWrites {
2818
- querySet: gpuGPUQuerySet;
3226
+ export interface GPUComputePassTimestampWrites {
3227
+ querySet: GPUQuerySet;
2819
3228
  beginningOfPassWriteIndex?: number;
2820
3229
  endOfPassWriteIndex?: number;
2821
3230
  }
2822
- export interface gpuGPUCommandBufferDescriptor {
3231
+ export interface GPUCommandBufferDescriptor {
2823
3232
  label?: string;
2824
3233
  }
2825
- export interface gpuGPUCommandBuffer {}
2826
- export interface gpuGPUQueue {
2827
- submit(commandBuffers: gpuGPUCommandBuffer[]): void;
3234
+ export interface GPUCommandBuffer {}
3235
+ export interface GPUQueue {
3236
+ submit(commandBuffers: GPUCommandBuffer[]): void;
2828
3237
  writeBuffer(
2829
- buffer: gpuGPUBuffer,
3238
+ buffer: GPUBuffer,
2830
3239
  bufferOffset: number | bigint,
2831
3240
  data: ArrayBuffer | ArrayBufferView,
2832
3241
  dataOffset?: number | bigint,
2833
3242
  size?: number | bigint,
2834
3243
  ): void;
2835
3244
  }
2836
- export declare abstract class gpuGPUMapMode {
3245
+ export declare abstract class GPUMapMode {
2837
3246
  static readonly READ: number;
2838
3247
  static readonly WRITE: number;
2839
3248
  }
2840
- export interface gpuGPURequestAdapterOptions {
3249
+ export interface GPURequestAdapterOptions {
2841
3250
  powerPreference: string;
2842
3251
  forceFallbackAdapter?: boolean;
2843
3252
  }
2844
- export interface gpuGPUAdapterInfo {
3253
+ export interface GPUAdapterInfo {
2845
3254
  get vendor(): string;
2846
3255
  get architecture(): string;
2847
3256
  get device(): string;
2848
3257
  get description(): string;
2849
3258
  }
2850
- export interface gpuGPUSupportedFeatures {
3259
+ export interface GPUSupportedFeatures {
2851
3260
  has(name: string): boolean;
2852
3261
  keys(): string[];
2853
3262
  }
2854
- export interface gpuGPUSupportedLimits {
3263
+ export interface GPUSupportedLimits {
2855
3264
  get maxTextureDimension1D(): number;
2856
3265
  get maxTextureDimension2D(): number;
2857
3266
  get maxTextureDimension3D(): number;
@@ -2884,17 +3293,17 @@ export interface gpuGPUSupportedLimits {
2884
3293
  get maxComputeWorkgroupSizeZ(): number;
2885
3294
  get maxComputeWorkgroupsPerDimension(): number;
2886
3295
  }
2887
- export declare abstract class gpuGPUError {
3296
+ export declare abstract class GPUError {
2888
3297
  get message(): string;
2889
3298
  }
2890
- export declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
2891
- export declare abstract class gpuGPUInternalError extends gpuGPUError {}
2892
- export declare abstract class gpuGPUValidationError extends gpuGPUError {}
2893
- export declare abstract class gpuGPUDeviceLostInfo {
3299
+ export declare abstract class GPUOutOfMemoryError extends GPUError {}
3300
+ export declare abstract class GPUInternalError extends GPUError {}
3301
+ export declare abstract class GPUValidationError extends GPUError {}
3302
+ export declare abstract class GPUDeviceLostInfo {
2894
3303
  get message(): string;
2895
3304
  get reason(): string;
2896
3305
  }
2897
- export interface gpuGPUCompilationMessage {
3306
+ export interface GPUCompilationMessage {
2898
3307
  get message(): string;
2899
3308
  get type(): string;
2900
3309
  get lineNum(): number;
@@ -2902,19 +3311,19 @@ export interface gpuGPUCompilationMessage {
2902
3311
  get offset(): number;
2903
3312
  get length(): number;
2904
3313
  }
2905
- export interface gpuGPUCompilationInfo {
2906
- get messages(): gpuGPUCompilationMessage[];
3314
+ export interface GPUCompilationInfo {
3315
+ get messages(): GPUCompilationMessage[];
2907
3316
  }
2908
- export declare abstract class gpuGPUTextureUsage {
3317
+ export declare abstract class GPUTextureUsage {
2909
3318
  static readonly COPY_SRC: number;
2910
3319
  static readonly COPY_DST: number;
2911
3320
  static readonly TEXTURE_BINDING: number;
2912
3321
  static readonly STORAGE_BINDING: number;
2913
3322
  static readonly RENDER_ATTACHMENT: number;
2914
3323
  }
2915
- export interface gpuGPUTextureDescriptor {
3324
+ export interface GPUTextureDescriptor {
2916
3325
  label: string;
2917
- size: number[] | gpuGPUExtent3DDict;
3326
+ size: number[] | GPUExtent3DDict;
2918
3327
  mipLevelCount?: number;
2919
3328
  sampleCount?: number;
2920
3329
  dimension?: string;
@@ -2922,13 +3331,13 @@ export interface gpuGPUTextureDescriptor {
2922
3331
  usage: number;
2923
3332
  viewFormats?: string[];
2924
3333
  }
2925
- export interface gpuGPUExtent3DDict {
3334
+ export interface GPUExtent3DDict {
2926
3335
  width: number;
2927
3336
  height?: number;
2928
3337
  depthOrArrayLayers?: number;
2929
3338
  }
2930
- export interface gpuGPUTexture {
2931
- createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
3339
+ export interface GPUTexture {
3340
+ createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
2932
3341
  destroy(): void;
2933
3342
  get width(): number;
2934
3343
  get height(): number;
@@ -2938,8 +3347,8 @@ export interface gpuGPUTexture {
2938
3347
  get format(): string;
2939
3348
  get usage(): number;
2940
3349
  }
2941
- export interface gpuGPUTextureView {}
2942
- export interface gpuGPUTextureViewDescriptor {
3350
+ export interface GPUTextureView {}
3351
+ export interface GPUTextureViewDescriptor {
2943
3352
  label: string;
2944
3353
  format: string;
2945
3354
  dimension: string;
@@ -2949,91 +3358,91 @@ export interface gpuGPUTextureViewDescriptor {
2949
3358
  baseArrayLayer?: number;
2950
3359
  arrayLayerCount: number;
2951
3360
  }
2952
- export declare abstract class gpuGPUColorWrite {
3361
+ export declare abstract class GPUColorWrite {
2953
3362
  static readonly RED: number;
2954
3363
  static readonly GREEN: number;
2955
3364
  static readonly BLUE: number;
2956
3365
  static readonly ALPHA: number;
2957
3366
  static readonly ALL: number;
2958
3367
  }
2959
- export interface gpuGPURenderPipeline {}
2960
- export interface gpuGPURenderPipelineDescriptor {
3368
+ export interface GPURenderPipeline {}
3369
+ export interface GPURenderPipelineDescriptor {
2961
3370
  label?: string;
2962
- layout: string | gpuGPUPipelineLayout;
2963
- vertex: gpuGPUVertexState;
2964
- primitive?: gpuGPUPrimitiveState;
2965
- depthStencil?: gpuGPUDepthStencilState;
2966
- multisample?: gpuGPUMultisampleState;
2967
- fragment?: gpuGPUFragmentState;
2968
- }
2969
- export interface gpuGPUVertexState {
2970
- module: gpuGPUShaderModule;
3371
+ layout: string | GPUPipelineLayout;
3372
+ vertex: GPUVertexState;
3373
+ primitive?: GPUPrimitiveState;
3374
+ depthStencil?: GPUDepthStencilState;
3375
+ multisample?: GPUMultisampleState;
3376
+ fragment?: GPUFragmentState;
3377
+ }
3378
+ export interface GPUVertexState {
3379
+ module: GPUShaderModule;
2971
3380
  entryPoint: string;
2972
3381
  constants?: Record<string, number>;
2973
- buffers?: gpuGPUVertexBufferLayout[];
3382
+ buffers?: GPUVertexBufferLayout[];
2974
3383
  }
2975
- export interface gpuGPUVertexBufferLayout {
3384
+ export interface GPUVertexBufferLayout {
2976
3385
  arrayStride: number | bigint;
2977
3386
  stepMode?: string;
2978
- attributes: gpuGPUVertexAttribute[];
3387
+ attributes: GPUVertexAttribute[];
2979
3388
  }
2980
- export interface gpuGPUVertexAttribute {
3389
+ export interface GPUVertexAttribute {
2981
3390
  format: string;
2982
3391
  offset: number | bigint;
2983
3392
  shaderLocation: number;
2984
3393
  }
2985
- export interface gpuGPUPrimitiveState {
3394
+ export interface GPUPrimitiveState {
2986
3395
  topology?: string;
2987
3396
  stripIndexFormat?: string;
2988
3397
  frontFace?: string;
2989
3398
  cullMode?: string;
2990
3399
  unclippedDepth?: boolean;
2991
3400
  }
2992
- export interface gpuGPUStencilFaceState {
3401
+ export interface GPUStencilFaceState {
2993
3402
  compare?: string;
2994
3403
  failOp?: string;
2995
3404
  depthFailOp?: string;
2996
3405
  passOp?: string;
2997
3406
  }
2998
- export interface gpuGPUDepthStencilState {
3407
+ export interface GPUDepthStencilState {
2999
3408
  format: string;
3000
3409
  depthWriteEnabled: boolean;
3001
3410
  depthCompare: string;
3002
- stencilFront?: gpuGPUStencilFaceState;
3003
- stencilBack?: gpuGPUStencilFaceState;
3411
+ stencilFront?: GPUStencilFaceState;
3412
+ stencilBack?: GPUStencilFaceState;
3004
3413
  stencilReadMask?: number;
3005
3414
  stencilWriteMask?: number;
3006
3415
  depthBias?: number;
3007
3416
  depthBiasSlopeScale?: number;
3008
3417
  depthBiasClamp?: number;
3009
3418
  }
3010
- export interface gpuGPUMultisampleState {
3419
+ export interface GPUMultisampleState {
3011
3420
  count?: number;
3012
3421
  mask?: number;
3013
3422
  alphaToCoverageEnabled?: boolean;
3014
3423
  }
3015
- export interface gpuGPUFragmentState {
3016
- module: gpuGPUShaderModule;
3424
+ export interface GPUFragmentState {
3425
+ module: GPUShaderModule;
3017
3426
  entryPoint: string;
3018
3427
  constants?: Record<string, number>;
3019
- targets: gpuGPUColorTargetState[];
3428
+ targets: GPUColorTargetState[];
3020
3429
  }
3021
- export interface gpuGPUColorTargetState {
3430
+ export interface GPUColorTargetState {
3022
3431
  format: string;
3023
- blend: gpuGPUBlendState;
3432
+ blend: GPUBlendState;
3024
3433
  writeMask?: number;
3025
3434
  }
3026
- export interface gpuGPUBlendState {
3027
- color: gpuGPUBlendComponent;
3028
- alpha: gpuGPUBlendComponent;
3435
+ export interface GPUBlendState {
3436
+ color: GPUBlendComponent;
3437
+ alpha: GPUBlendComponent;
3029
3438
  }
3030
- export interface gpuGPUBlendComponent {
3439
+ export interface GPUBlendComponent {
3031
3440
  operation?: string;
3032
3441
  srcFactor?: string;
3033
3442
  dstFactor?: string;
3034
3443
  }
3035
- export interface gpuGPURenderPassEncoder {
3036
- setPipeline(pipeline: gpuGPURenderPipeline): void;
3444
+ export interface GPURenderPassEncoder {
3445
+ setPipeline(pipeline: GPURenderPipeline): void;
3037
3446
  draw(
3038
3447
  vertexCount: number,
3039
3448
  instanceCount?: number,
@@ -3042,30 +3451,30 @@ export interface gpuGPURenderPassEncoder {
3042
3451
  ): void;
3043
3452
  end(): void;
3044
3453
  }
3045
- export interface gpuGPURenderPassDescriptor {
3454
+ export interface GPURenderPassDescriptor {
3046
3455
  label?: string;
3047
- colorAttachments: gpuGPURenderPassColorAttachment[];
3048
- depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
3049
- occlusionQuerySet?: gpuGPUQuerySet;
3050
- timestampWrites?: gpuGPURenderPassTimestampWrites;
3456
+ colorAttachments: GPURenderPassColorAttachment[];
3457
+ depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
3458
+ occlusionQuerySet?: GPUQuerySet;
3459
+ timestampWrites?: GPURenderPassTimestampWrites;
3051
3460
  maxDrawCount?: number | bigint;
3052
3461
  }
3053
- export interface gpuGPURenderPassColorAttachment {
3054
- view: gpuGPUTextureView;
3462
+ export interface GPURenderPassColorAttachment {
3463
+ view: GPUTextureView;
3055
3464
  depthSlice?: number;
3056
- resolveTarget?: gpuGPUTextureView;
3057
- clearValue?: number[] | gpuGPUColorDict;
3465
+ resolveTarget?: GPUTextureView;
3466
+ clearValue?: number[] | GPUColorDict;
3058
3467
  loadOp: string;
3059
3468
  storeOp: string;
3060
3469
  }
3061
- export interface gpuGPUColorDict {
3470
+ export interface GPUColorDict {
3062
3471
  r: number;
3063
3472
  g: number;
3064
3473
  b: number;
3065
3474
  a: number;
3066
3475
  }
3067
- export interface gpuGPURenderPassDepthStencilAttachment {
3068
- view: gpuGPUTextureView;
3476
+ export interface GPURenderPassDepthStencilAttachment {
3477
+ view: GPUTextureView;
3069
3478
  depthClearValue?: number;
3070
3479
  depthLoadOp?: string;
3071
3480
  depthStoreOp?: string;
@@ -3075,107 +3484,986 @@ export interface gpuGPURenderPassDepthStencilAttachment {
3075
3484
  stencilStoreOp?: string;
3076
3485
  stencilReadOnly?: boolean;
3077
3486
  }
3078
- export interface gpuGPURenderPassTimestampWrites {
3079
- querySet: gpuGPUQuerySet;
3487
+ export interface GPURenderPassTimestampWrites {
3488
+ querySet: GPUQuerySet;
3080
3489
  beginningOfPassWriteIndex?: number;
3081
3490
  endOfPassWriteIndex?: number;
3082
3491
  }
3083
- export interface gpuGPUImageCopyTexture {
3084
- texture: gpuGPUTexture;
3492
+ export interface GPUImageCopyTexture {
3493
+ texture: GPUTexture;
3085
3494
  mipLevel?: number;
3086
- origin?: number[] | gpuGPUOrigin3DDict;
3495
+ origin?: number[] | GPUOrigin3DDict;
3087
3496
  aspect?: string;
3088
3497
  }
3089
- export interface gpuGPUImageCopyBuffer {
3090
- buffer: gpuGPUBuffer;
3498
+ export interface GPUImageCopyBuffer {
3499
+ buffer: GPUBuffer;
3091
3500
  offset?: number | bigint;
3092
3501
  bytesPerRow?: number;
3093
3502
  rowsPerImage?: number;
3094
3503
  }
3095
- export interface gpuGPUOrigin3DDict {
3504
+ export interface GPUOrigin3DDict {
3096
3505
  x?: number;
3097
3506
  y?: number;
3098
3507
  z?: number;
3099
3508
  }
3100
- export interface BasicImageTransformations {
3101
- /**
3102
- * Maximum width in image pixels. The value must be an integer.
3103
- */
3104
- width?: number;
3105
- /**
3106
- * Maximum height in image pixels. The value must be an integer.
3107
- */
3108
- height?: number;
3509
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
3510
+ export declare class EventSource extends EventTarget {
3511
+ constructor(url: string, init?: EventSourceEventSourceInit);
3109
3512
  /**
3110
- * Resizing mode as a string. It affects interpretation of width and height
3111
- * options:
3112
- * - scale-down: Similar to contain, but the image is never enlarged. If
3113
- * the image is larger than given width or height, it will be resized.
3114
- * Otherwise its original size will be kept.
3115
- * - contain: Resizes to maximum size that fits within the given width and
3116
- * height. If only a single dimension is given (e.g. only width), the
3117
- * image will be shrunk or enlarged to exactly match that dimension.
3118
- * Aspect ratio is always preserved.
3119
- * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
3120
- * and height. If the image has an aspect ratio different from the ratio
3121
- * of width and height, it will be cropped to fit.
3122
- * - crop: The image will be shrunk and cropped to fit within the area
3123
- * specified by width and height. The image will not be enlarged. For images
3124
- * smaller than the given dimensions it's the same as scale-down. For
3125
- * images larger than the given dimensions, it's the same as cover.
3126
- * See also trim.
3127
- * - pad: Resizes to the maximum size that fits within the given width and
3128
- * height, and then fills the remaining area with a background color
3129
- * (white by default). Use of this mode is not recommended, as the same
3130
- * effect can be more efficiently achieved with the contain mode and the
3131
- * CSS object-fit: contain property.
3513
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3514
+ *
3515
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3132
3516
  */
3133
- fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
3517
+ close(): void;
3134
3518
  /**
3135
- * When cropping with fit: "cover", this defines the side or point that should
3136
- * be left uncropped. The value is either a string
3137
- * "left", "right", "top", "bottom", "auto", or "center" (the default),
3138
- * or an object {x, y} containing focal point coordinates in the original
3139
- * image expressed as fractions ranging from 0.0 (top or left) to 1.0
3140
- * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
3141
- * crop bottom or left and right sides as necessary, but won’t crop anything
3142
- * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
3143
- * preserve as much as possible around a point at 20% of the height of the
3144
- * source image.
3519
+ * Returns the URL providing the event stream.
3520
+ *
3521
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3145
3522
  */
3146
- gravity?:
3147
- | "left"
3148
- | "right"
3149
- | "top"
3150
- | "bottom"
3151
- | "center"
3152
- | "auto"
3153
- | BasicImageTransformationsGravityCoordinates;
3523
+ get url(): string;
3154
3524
  /**
3155
- * Background color to add underneath the image. Applies only to images with
3156
- * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
3157
- * hsl(…), etc.)
3525
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3526
+ *
3527
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3158
3528
  */
3159
- background?: string;
3529
+ get withCredentials(): boolean;
3160
3530
  /**
3161
- * Number of degrees (90, 180, 270) to rotate the image by. width and height
3162
- * options refer to axes after rotation.
3531
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3532
+ *
3533
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3163
3534
  */
3164
- rotate?: 0 | 90 | 180 | 270 | 360;
3535
+ get readyState(): number;
3536
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3537
+ get onopen(): any | null;
3538
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3539
+ set onopen(value: any | null);
3540
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3541
+ get onmessage(): any | null;
3542
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3543
+ set onmessage(value: any | null);
3544
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3545
+ get onerror(): any | null;
3546
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3547
+ set onerror(value: any | null);
3548
+ static readonly CONNECTING: number;
3549
+ static readonly OPEN: number;
3550
+ static readonly CLOSED: number;
3551
+ static from(stream: ReadableStream): EventSource;
3165
3552
  }
3166
- export interface BasicImageTransformationsGravityCoordinates {
3167
- x: number;
3168
- y: number;
3553
+ export interface EventSourceEventSourceInit {
3554
+ withCredentials?: boolean;
3555
+ fetcher?: Fetcher;
3169
3556
  }
3170
- /**
3171
- * In addition to the properties you can set in the RequestInit dict
3172
- * that you pass as an argument to the Request constructor, you can
3173
- * set certain properties of a `cf` object to control how Cloudflare
3174
- * features are applied to that new Request.
3175
- *
3176
- * Note: Currently, these properties cannot be tested in the
3177
- * playground.
3178
- */
3557
+ export type AiImageClassificationInput = {
3558
+ image: number[];
3559
+ };
3560
+ export type AiImageClassificationOutput = {
3561
+ score?: number;
3562
+ label?: string;
3563
+ }[];
3564
+ export declare abstract class BaseAiImageClassification {
3565
+ inputs: AiImageClassificationInput;
3566
+ postProcessedOutputs: AiImageClassificationOutput;
3567
+ }
3568
+ export type AiImageToTextInput = {
3569
+ image: number[];
3570
+ prompt?: string;
3571
+ max_tokens?: number;
3572
+ temperature?: number;
3573
+ top_p?: number;
3574
+ top_k?: number;
3575
+ seed?: number;
3576
+ repetition_penalty?: number;
3577
+ frequency_penalty?: number;
3578
+ presence_penalty?: number;
3579
+ raw?: boolean;
3580
+ messages?: RoleScopedChatInput[];
3581
+ };
3582
+ export type AiImageToTextOutput = {
3583
+ description: string;
3584
+ };
3585
+ export declare abstract class BaseAiImageToText {
3586
+ inputs: AiImageToTextInput;
3587
+ postProcessedOutputs: AiImageToTextOutput;
3588
+ }
3589
+ export type AiObjectDetectionInput = {
3590
+ image: number[];
3591
+ };
3592
+ export type AiObjectDetectionOutput = {
3593
+ score?: number;
3594
+ label?: string;
3595
+ }[];
3596
+ export declare abstract class BaseAiObjectDetection {
3597
+ inputs: AiObjectDetectionInput;
3598
+ postProcessedOutputs: AiObjectDetectionOutput;
3599
+ }
3600
+ export type AiSentenceSimilarityInput = {
3601
+ source: string;
3602
+ sentences: string[];
3603
+ };
3604
+ export type AiSentenceSimilarityOutput = number[];
3605
+ export declare abstract class BaseAiSentenceSimilarity {
3606
+ inputs: AiSentenceSimilarityInput;
3607
+ postProcessedOutputs: AiSentenceSimilarityOutput;
3608
+ }
3609
+ export type AiAutomaticSpeechRecognitionInput = {
3610
+ audio: number[];
3611
+ };
3612
+ export type AiAutomaticSpeechRecognitionOutput = {
3613
+ text?: string;
3614
+ words?: {
3615
+ word: string;
3616
+ start: number;
3617
+ end: number;
3618
+ }[];
3619
+ vtt?: string;
3620
+ };
3621
+ export declare abstract class BaseAiAutomaticSpeechRecognition {
3622
+ inputs: AiAutomaticSpeechRecognitionInput;
3623
+ postProcessedOutputs: AiAutomaticSpeechRecognitionOutput;
3624
+ }
3625
+ export type AiSummarizationInput = {
3626
+ input_text: string;
3627
+ max_length?: number;
3628
+ };
3629
+ export type AiSummarizationOutput = {
3630
+ summary: string;
3631
+ };
3632
+ export declare abstract class BaseAiSummarization {
3633
+ inputs: AiSummarizationInput;
3634
+ postProcessedOutputs: AiSummarizationOutput;
3635
+ }
3636
+ export type AiTextClassificationInput = {
3637
+ text: string;
3638
+ };
3639
+ export type AiTextClassificationOutput = {
3640
+ score?: number;
3641
+ label?: string;
3642
+ }[];
3643
+ export declare abstract class BaseAiTextClassification {
3644
+ inputs: AiTextClassificationInput;
3645
+ postProcessedOutputs: AiTextClassificationOutput;
3646
+ }
3647
+ export type AiTextEmbeddingsInput = {
3648
+ text: string | string[];
3649
+ };
3650
+ export type AiTextEmbeddingsOutput = {
3651
+ shape: number[];
3652
+ data: number[][];
3653
+ };
3654
+ export declare abstract class BaseAiTextEmbeddings {
3655
+ inputs: AiTextEmbeddingsInput;
3656
+ postProcessedOutputs: AiTextEmbeddingsOutput;
3657
+ }
3658
+ export type RoleScopedChatInput = {
3659
+ role:
3660
+ | "user"
3661
+ | "assistant"
3662
+ | "system"
3663
+ | "tool"
3664
+ | (string & NonNullable<unknown>);
3665
+ content: string;
3666
+ name?: string;
3667
+ };
3668
+ export type AiTextGenerationToolLegacyInput = {
3669
+ name: string;
3670
+ description: string;
3671
+ parameters?: {
3672
+ type: "object" | (string & NonNullable<unknown>);
3673
+ properties: {
3674
+ [key: string]: {
3675
+ type: string;
3676
+ description?: string;
3677
+ };
3678
+ };
3679
+ required: string[];
3680
+ };
3681
+ };
3682
+ export type AiTextGenerationToolInput = {
3683
+ type: "function" | (string & NonNullable<unknown>);
3684
+ function: {
3685
+ name: string;
3686
+ description: string;
3687
+ parameters?: {
3688
+ type: "object" | (string & NonNullable<unknown>);
3689
+ properties: {
3690
+ [key: string]: {
3691
+ type: string;
3692
+ description?: string;
3693
+ };
3694
+ };
3695
+ required: string[];
3696
+ };
3697
+ };
3698
+ };
3699
+ export type AiTextGenerationFunctionsInput = {
3700
+ name: string;
3701
+ code: string;
3702
+ };
3703
+ export type AiTextGenerationInput = {
3704
+ prompt?: string;
3705
+ raw?: boolean;
3706
+ stream?: boolean;
3707
+ max_tokens?: number;
3708
+ temperature?: number;
3709
+ top_p?: number;
3710
+ top_k?: number;
3711
+ seed?: number;
3712
+ repetition_penalty?: number;
3713
+ frequency_penalty?: number;
3714
+ presence_penalty?: number;
3715
+ messages?: RoleScopedChatInput[];
3716
+ tools?:
3717
+ | AiTextGenerationToolInput[]
3718
+ | AiTextGenerationToolLegacyInput[]
3719
+ | (object & NonNullable<unknown>);
3720
+ functions?: AiTextGenerationFunctionsInput[];
3721
+ };
3722
+ export type AiTextGenerationOutput =
3723
+ | {
3724
+ response?: string;
3725
+ tool_calls?: {
3726
+ name: string;
3727
+ arguments: unknown;
3728
+ }[];
3729
+ }
3730
+ | ReadableStream;
3731
+ export declare abstract class BaseAiTextGeneration {
3732
+ inputs: AiTextGenerationInput;
3733
+ postProcessedOutputs: AiTextGenerationOutput;
3734
+ }
3735
+ export type AiTextToSpeechInput = {
3736
+ prompt: string;
3737
+ lang?: string;
3738
+ };
3739
+ export type AiTextToSpeechOutput =
3740
+ | Uint8Array
3741
+ | {
3742
+ audio: string;
3743
+ };
3744
+ export declare abstract class BaseAiTextToSpeech {
3745
+ inputs: AiTextToSpeechInput;
3746
+ postProcessedOutputs: AiTextToSpeechOutput;
3747
+ }
3748
+ export type AiTextToImageInput = {
3749
+ prompt: string;
3750
+ negative_prompt?: string;
3751
+ height?: number;
3752
+ width?: number;
3753
+ image?: number[];
3754
+ image_b64?: string;
3755
+ mask?: number[];
3756
+ num_steps?: number;
3757
+ strength?: number;
3758
+ guidance?: number;
3759
+ seed?: number;
3760
+ };
3761
+ export type AiTextToImageOutput = ReadableStream<Uint8Array>;
3762
+ export declare abstract class BaseAiTextToImage {
3763
+ inputs: AiTextToImageInput;
3764
+ postProcessedOutputs: AiTextToImageOutput;
3765
+ }
3766
+ export type AiTranslationInput = {
3767
+ text: string;
3768
+ target_lang: string;
3769
+ source_lang?: string;
3770
+ };
3771
+ export type AiTranslationOutput = {
3772
+ translated_text?: string;
3773
+ };
3774
+ export declare abstract class BaseAiTranslation {
3775
+ inputs: AiTranslationInput;
3776
+ postProcessedOutputs: AiTranslationOutput;
3777
+ }
3778
+ export type Ai_Cf_Openai_Whisper_Input =
3779
+ | string
3780
+ | {
3781
+ /**
3782
+ * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
3783
+ */
3784
+ audio: number[];
3785
+ };
3786
+ export interface Ai_Cf_Openai_Whisper_Output {
3787
+ /**
3788
+ * The transcription
3789
+ */
3790
+ text: string;
3791
+ word_count?: number;
3792
+ words?: {
3793
+ word?: string;
3794
+ /**
3795
+ * The second this word begins in the recording
3796
+ */
3797
+ start?: number;
3798
+ /**
3799
+ * The ending second when the word completes
3800
+ */
3801
+ end?: number;
3802
+ }[];
3803
+ vtt?: string;
3804
+ }
3805
+ export declare abstract class Base_Ai_Cf_Openai_Whisper {
3806
+ inputs: Ai_Cf_Openai_Whisper_Input;
3807
+ postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
3808
+ }
3809
+ export type Ai_Cf_Openai_Whisper_Tiny_En_Input =
3810
+ | string
3811
+ | {
3812
+ /**
3813
+ * An array of integers that represent the audio data constrained to 8-bit unsigned integer values
3814
+ */
3815
+ audio: number[];
3816
+ };
3817
+ export interface Ai_Cf_Openai_Whisper_Tiny_En_Output {
3818
+ /**
3819
+ * The transcription
3820
+ */
3821
+ text: string;
3822
+ word_count?: number;
3823
+ words?: {
3824
+ word?: string;
3825
+ /**
3826
+ * The second this word begins in the recording
3827
+ */
3828
+ start?: number;
3829
+ /**
3830
+ * The ending second when the word completes
3831
+ */
3832
+ end?: number;
3833
+ }[];
3834
+ vtt?: string;
3835
+ }
3836
+ export declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
3837
+ inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input;
3838
+ postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;
3839
+ }
3840
+ export interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
3841
+ /**
3842
+ * Base64 encoded value of the audio data.
3843
+ */
3844
+ audio: string;
3845
+ /**
3846
+ * Supported tasks are 'translate' or 'transcribe'.
3847
+ */
3848
+ task?: string;
3849
+ /**
3850
+ * The language of the audio being transcribed or translated.
3851
+ */
3852
+ language?: string;
3853
+ /**
3854
+ * Preprocess the audio with a voice activity detection model.
3855
+ */
3856
+ vad_filter?: string;
3857
+ /**
3858
+ * A text prompt to help provide context to the model on the contents of the audio.
3859
+ */
3860
+ initial_prompt?: string;
3861
+ /**
3862
+ * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
3863
+ */
3864
+ prefix?: string;
3865
+ }
3866
+ export interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
3867
+ transcription_info?: {
3868
+ /**
3869
+ * The language of the audio being transcribed or translated.
3870
+ */
3871
+ language?: string;
3872
+ /**
3873
+ * The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1.
3874
+ */
3875
+ language_probability?: number;
3876
+ /**
3877
+ * The total duration of the original audio file, in seconds.
3878
+ */
3879
+ duration?: number;
3880
+ /**
3881
+ * The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds.
3882
+ */
3883
+ duration_after_vad?: number;
3884
+ };
3885
+ /**
3886
+ * The complete transcription of the audio.
3887
+ */
3888
+ text: string;
3889
+ /**
3890
+ * The total number of words in the transcription.
3891
+ */
3892
+ word_count?: number;
3893
+ segments?: {
3894
+ /**
3895
+ * The starting time of the segment within the audio, in seconds.
3896
+ */
3897
+ start?: number;
3898
+ /**
3899
+ * The ending time of the segment within the audio, in seconds.
3900
+ */
3901
+ end?: number;
3902
+ /**
3903
+ * The transcription of the segment.
3904
+ */
3905
+ text?: string;
3906
+ /**
3907
+ * The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs.
3908
+ */
3909
+ temperature?: number;
3910
+ /**
3911
+ * The average log probability of the predictions for the words in this segment, indicating overall confidence.
3912
+ */
3913
+ avg_logprob?: number;
3914
+ /**
3915
+ * The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process.
3916
+ */
3917
+ compression_ratio?: number;
3918
+ /**
3919
+ * The probability that the segment contains no speech, represented as a decimal between 0 and 1.
3920
+ */
3921
+ no_speech_prob?: number;
3922
+ words?: {
3923
+ /**
3924
+ * The individual word transcribed from the audio.
3925
+ */
3926
+ word?: string;
3927
+ /**
3928
+ * The starting time of the word within the audio, in seconds.
3929
+ */
3930
+ start?: number;
3931
+ /**
3932
+ * The ending time of the word within the audio, in seconds.
3933
+ */
3934
+ end?: number;
3935
+ }[];
3936
+ };
3937
+ /**
3938
+ * The transcription in WebVTT format, which includes timing and text information for use in subtitles.
3939
+ */
3940
+ vtt?: string;
3941
+ }
3942
+ export declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
3943
+ inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
3944
+ postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
3945
+ }
3946
+ export interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
3947
+ /**
3948
+ * A text description of the image you want to generate.
3949
+ */
3950
+ prompt: string;
3951
+ /**
3952
+ * The number of diffusion steps; higher values can improve quality but take longer.
3953
+ */
3954
+ steps?: number;
3955
+ }
3956
+ export interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output {
3957
+ /**
3958
+ * The generated image in Base64 format.
3959
+ */
3960
+ image?: string;
3961
+ }
3962
+ export declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell {
3963
+ inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input;
3964
+ postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output;
3965
+ }
3966
+ export type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Prompt | Messages;
3967
+ export interface Prompt {
3968
+ /**
3969
+ * The input text prompt for the model to generate a response.
3970
+ */
3971
+ prompt: string;
3972
+ image?: number[] | (string & NonNullable<unknown>);
3973
+ /**
3974
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3975
+ */
3976
+ raw?: boolean;
3977
+ /**
3978
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3979
+ */
3980
+ stream?: boolean;
3981
+ /**
3982
+ * The maximum number of tokens to generate in the response.
3983
+ */
3984
+ max_tokens?: number;
3985
+ /**
3986
+ * Controls the randomness of the output; higher values produce more random results.
3987
+ */
3988
+ temperature?: number;
3989
+ /**
3990
+ * 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.
3991
+ */
3992
+ top_p?: number;
3993
+ /**
3994
+ * 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.
3995
+ */
3996
+ top_k?: number;
3997
+ /**
3998
+ * Random seed for reproducibility of the generation.
3999
+ */
4000
+ seed?: number;
4001
+ /**
4002
+ * Penalty for repeated tokens; higher values discourage repetition.
4003
+ */
4004
+ repetition_penalty?: number;
4005
+ /**
4006
+ * Decreases the likelihood of the model repeating the same lines verbatim.
4007
+ */
4008
+ frequency_penalty?: number;
4009
+ /**
4010
+ * Increases the likelihood of the model introducing new topics.
4011
+ */
4012
+ presence_penalty?: number;
4013
+ /**
4014
+ * Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
4015
+ */
4016
+ lora?: string;
4017
+ }
4018
+ export interface Messages {
4019
+ /**
4020
+ * An array of message objects representing the conversation history.
4021
+ */
4022
+ messages: {
4023
+ /**
4024
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
4025
+ */
4026
+ role: string;
4027
+ /**
4028
+ * The content of the message as a string.
4029
+ */
4030
+ content: string;
4031
+ }[];
4032
+ image?: number[] | string;
4033
+ functions?: {
4034
+ name: string;
4035
+ code: string;
4036
+ }[];
4037
+ /**
4038
+ * A list of tools available for the assistant to use.
4039
+ */
4040
+ tools?: (
4041
+ | {
4042
+ /**
4043
+ * The name of the tool. More descriptive the better.
4044
+ */
4045
+ name: string;
4046
+ /**
4047
+ * A brief description of what the tool does.
4048
+ */
4049
+ description: string;
4050
+ /**
4051
+ * Schema defining the parameters accepted by the tool.
4052
+ */
4053
+ parameters: {
4054
+ /**
4055
+ * The type of the parameters object (usually 'object').
4056
+ */
4057
+ type: string;
4058
+ /**
4059
+ * List of required parameter names.
4060
+ */
4061
+ required?: string[];
4062
+ /**
4063
+ * Definitions of each parameter.
4064
+ */
4065
+ properties: {
4066
+ [k: string]: {
4067
+ /**
4068
+ * The data type of the parameter.
4069
+ */
4070
+ type: string;
4071
+ /**
4072
+ * A description of the expected parameter.
4073
+ */
4074
+ description: string;
4075
+ };
4076
+ };
4077
+ };
4078
+ }
4079
+ | {
4080
+ /**
4081
+ * Specifies the type of tool (e.g., 'function').
4082
+ */
4083
+ type: string;
4084
+ /**
4085
+ * Details of the function tool.
4086
+ */
4087
+ function: {
4088
+ /**
4089
+ * The name of the function.
4090
+ */
4091
+ name: string;
4092
+ /**
4093
+ * A brief description of what the function does.
4094
+ */
4095
+ description: string;
4096
+ /**
4097
+ * Schema defining the parameters accepted by the function.
4098
+ */
4099
+ parameters: {
4100
+ /**
4101
+ * The type of the parameters object (usually 'object').
4102
+ */
4103
+ type: string;
4104
+ /**
4105
+ * List of required parameter names.
4106
+ */
4107
+ required?: string[];
4108
+ /**
4109
+ * Definitions of each parameter.
4110
+ */
4111
+ properties: {
4112
+ [k: string]: {
4113
+ /**
4114
+ * The data type of the parameter.
4115
+ */
4116
+ type: string;
4117
+ /**
4118
+ * A description of the expected parameter.
4119
+ */
4120
+ description: string;
4121
+ };
4122
+ };
4123
+ };
4124
+ };
4125
+ }
4126
+ )[];
4127
+ /**
4128
+ * If true, the response will be streamed back incrementally.
4129
+ */
4130
+ stream?: boolean;
4131
+ /**
4132
+ * The maximum number of tokens to generate in the response.
4133
+ */
4134
+ max_tokens?: number;
4135
+ /**
4136
+ * Controls the randomness of the output; higher values produce more random results.
4137
+ */
4138
+ temperature?: number;
4139
+ /**
4140
+ * 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.
4141
+ */
4142
+ top_p?: number;
4143
+ /**
4144
+ * 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.
4145
+ */
4146
+ top_k?: number;
4147
+ /**
4148
+ * Random seed for reproducibility of the generation.
4149
+ */
4150
+ seed?: number;
4151
+ /**
4152
+ * Penalty for repeated tokens; higher values discourage repetition.
4153
+ */
4154
+ repetition_penalty?: number;
4155
+ /**
4156
+ * Decreases the likelihood of the model repeating the same lines verbatim.
4157
+ */
4158
+ frequency_penalty?: number;
4159
+ /**
4160
+ * Increases the likelihood of the model introducing new topics.
4161
+ */
4162
+ presence_penalty?: number;
4163
+ }
4164
+ export type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output =
4165
+ | {
4166
+ /**
4167
+ * The generated text response from the model
4168
+ */
4169
+ response?: string;
4170
+ /**
4171
+ * An array of tool calls requests made during the response generation
4172
+ */
4173
+ tool_calls?: {
4174
+ /**
4175
+ * The arguments passed to be passed to the tool call request
4176
+ */
4177
+ arguments?: object;
4178
+ /**
4179
+ * The name of the tool to be called
4180
+ */
4181
+ name?: string;
4182
+ }[];
4183
+ }
4184
+ | ReadableStream;
4185
+ export declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct {
4186
+ inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input;
4187
+ postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output;
4188
+ }
4189
+ export interface AiModels {
4190
+ "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
4191
+ "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
4192
+ "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
4193
+ "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
4194
+ "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
4195
+ "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
4196
+ "@cf/baai/bge-base-en-v1.5": BaseAiTextEmbeddings;
4197
+ "@cf/baai/bge-small-en-v1.5": BaseAiTextEmbeddings;
4198
+ "@cf/baai/bge-large-en-v1.5": BaseAiTextEmbeddings;
4199
+ "@cf/microsoft/resnet-50": BaseAiImageClassification;
4200
+ "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
4201
+ "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
4202
+ "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
4203
+ "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
4204
+ "@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
4205
+ "@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
4206
+ "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
4207
+ "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
4208
+ "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
4209
+ "@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
4210
+ "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
4211
+ "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
4212
+ "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
4213
+ "@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
4214
+ "@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
4215
+ "@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
4216
+ "@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
4217
+ "@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
4218
+ "@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
4219
+ "@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
4220
+ "@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
4221
+ "@cf/microsoft/phi-2": BaseAiTextGeneration;
4222
+ "@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
4223
+ "@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
4224
+ "@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
4225
+ "@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
4226
+ "@hf/google/gemma-7b-it": BaseAiTextGeneration;
4227
+ "@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
4228
+ "@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
4229
+ "@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
4230
+ "@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
4231
+ "@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
4232
+ "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
4233
+ "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
4234
+ "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
4235
+ "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
4236
+ "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
4237
+ "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
4238
+ "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
4239
+ "@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
4240
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast": BaseAiTextGeneration;
4241
+ "@cf/meta/m2m100-1.2b": BaseAiTranslation;
4242
+ "@cf/facebook/bart-large-cnn": BaseAiSummarization;
4243
+ "@cf/unum/uform-gen2-qwen-500m": BaseAiImageToText;
4244
+ "@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
4245
+ "@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
4246
+ "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
4247
+ "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
4248
+ "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
4249
+ "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
4250
+ }
4251
+ export type AiOptions = {
4252
+ gateway?: GatewayOptions;
4253
+ prefix?: string;
4254
+ extraHeaders?: object;
4255
+ };
4256
+ export type AiModelsSearchParams = {
4257
+ author?: string;
4258
+ hide_experimental?: boolean;
4259
+ page?: number;
4260
+ per_page?: number;
4261
+ search?: string;
4262
+ source?: number;
4263
+ task?: string;
4264
+ };
4265
+ export type AiModelsSearchObject = {
4266
+ id: string;
4267
+ source: number;
4268
+ name: string;
4269
+ description: string;
4270
+ task: {
4271
+ id: string;
4272
+ name: string;
4273
+ description: string;
4274
+ };
4275
+ tags: string[];
4276
+ properties: {
4277
+ property_id: string;
4278
+ value: string;
4279
+ }[];
4280
+ };
4281
+ export interface InferenceUpstreamError extends Error {}
4282
+ export interface AiInternalError extends Error {}
4283
+ export type AiModelListType = Record<string, any>;
4284
+ export declare abstract class Ai<
4285
+ AiModelList extends AiModelListType = AiModels,
4286
+ > {
4287
+ aiGatewayLogId: string | null;
4288
+ gateway(gatewayId: string): AiGateway;
4289
+ run<Name extends keyof AiModelList>(
4290
+ model: Name,
4291
+ inputs: AiModelList[Name]["inputs"],
4292
+ options?: AiOptions,
4293
+ ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
4294
+ public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
4295
+ }
4296
+ export type GatewayOptions = {
4297
+ id: string;
4298
+ cacheKey?: string;
4299
+ cacheTtl?: number;
4300
+ skipCache?: boolean;
4301
+ metadata?: Record<string, number | string | boolean | null | bigint>;
4302
+ collectLog?: boolean;
4303
+ };
4304
+ export type AiGatewayPatchLog = {
4305
+ score?: number | null;
4306
+ feedback?: -1 | 1 | null;
4307
+ metadata?: Record<string, number | string | boolean | null | bigint> | null;
4308
+ };
4309
+ export type AiGatewayLog = {
4310
+ id: string;
4311
+ provider: string;
4312
+ model: string;
4313
+ model_type?: string;
4314
+ path: string;
4315
+ duration: number;
4316
+ request_type?: string;
4317
+ request_content_type?: string;
4318
+ status_code: number;
4319
+ response_content_type?: string;
4320
+ success: boolean;
4321
+ cached: boolean;
4322
+ tokens_in?: number;
4323
+ tokens_out?: number;
4324
+ metadata?: Record<string, number | string | boolean | null | bigint>;
4325
+ step?: number;
4326
+ cost?: number;
4327
+ custom_cost?: boolean;
4328
+ request_size: number;
4329
+ request_head?: string;
4330
+ request_head_complete: boolean;
4331
+ response_size: number;
4332
+ response_head?: string;
4333
+ response_head_complete: boolean;
4334
+ created_at: Date;
4335
+ };
4336
+ export type AIGatewayProviders =
4337
+ | "workers-ai"
4338
+ | "anthropic"
4339
+ | "aws-bedrock"
4340
+ | "azure-openai"
4341
+ | "google-vertex-ai"
4342
+ | "huggingface"
4343
+ | "openai"
4344
+ | "perplexity-ai"
4345
+ | "replicate"
4346
+ | "groq"
4347
+ | "cohere"
4348
+ | "google-ai-studio"
4349
+ | "mistral"
4350
+ | "grok"
4351
+ | "openrouter";
4352
+ export type AIGatewayHeaders = {
4353
+ "cf-aig-metadata":
4354
+ | Record<string, number | string | boolean | null | bigint>
4355
+ | string;
4356
+ "cf-aig-custom-cost":
4357
+ | {
4358
+ per_token_in?: number;
4359
+ per_token_out?: number;
4360
+ }
4361
+ | {
4362
+ total_cost?: number;
4363
+ }
4364
+ | string;
4365
+ "cf-aig-cache-ttl": number | string;
4366
+ "cf-aig-skip-cache": boolean | string;
4367
+ "cf-aig-cache-key": string;
4368
+ "cf-aig-collect-log": boolean | string;
4369
+ Authorization: string;
4370
+ "Content-Type": string;
4371
+ [key: string]: string | number | boolean | object;
4372
+ };
4373
+ export type AIGatewayUniversalRequest = {
4374
+ provider: AIGatewayProviders | string; // eslint-disable-line
4375
+ endpoint: string;
4376
+ headers: Partial<AIGatewayHeaders>;
4377
+ query: unknown;
4378
+ };
4379
+ export interface AiGatewayInternalError extends Error {}
4380
+ export interface AiGatewayLogNotFound extends Error {}
4381
+ export declare abstract class AiGateway {
4382
+ patchLog(logId: string, data: AiGatewayPatchLog): Promise<void>;
4383
+ getLog(logId: string): Promise<AiGatewayLog>;
4384
+ run(
4385
+ data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[],
4386
+ ): Promise<Response>;
4387
+ }
4388
+ export interface BasicImageTransformations {
4389
+ /**
4390
+ * Maximum width in image pixels. The value must be an integer.
4391
+ */
4392
+ width?: number;
4393
+ /**
4394
+ * Maximum height in image pixels. The value must be an integer.
4395
+ */
4396
+ height?: number;
4397
+ /**
4398
+ * Resizing mode as a string. It affects interpretation of width and height
4399
+ * options:
4400
+ * - scale-down: Similar to contain, but the image is never enlarged. If
4401
+ * the image is larger than given width or height, it will be resized.
4402
+ * Otherwise its original size will be kept.
4403
+ * - contain: Resizes to maximum size that fits within the given width and
4404
+ * height. If only a single dimension is given (e.g. only width), the
4405
+ * image will be shrunk or enlarged to exactly match that dimension.
4406
+ * Aspect ratio is always preserved.
4407
+ * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
4408
+ * and height. If the image has an aspect ratio different from the ratio
4409
+ * of width and height, it will be cropped to fit.
4410
+ * - crop: The image will be shrunk and cropped to fit within the area
4411
+ * specified by width and height. The image will not be enlarged. For images
4412
+ * smaller than the given dimensions it's the same as scale-down. For
4413
+ * images larger than the given dimensions, it's the same as cover.
4414
+ * See also trim.
4415
+ * - pad: Resizes to the maximum size that fits within the given width and
4416
+ * height, and then fills the remaining area with a background color
4417
+ * (white by default). Use of this mode is not recommended, as the same
4418
+ * effect can be more efficiently achieved with the contain mode and the
4419
+ * CSS object-fit: contain property.
4420
+ */
4421
+ fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
4422
+ /**
4423
+ * When cropping with fit: "cover", this defines the side or point that should
4424
+ * be left uncropped. The value is either a string
4425
+ * "left", "right", "top", "bottom", "auto", or "center" (the default),
4426
+ * or an object {x, y} containing focal point coordinates in the original
4427
+ * image expressed as fractions ranging from 0.0 (top or left) to 1.0
4428
+ * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
4429
+ * crop bottom or left and right sides as necessary, but won’t crop anything
4430
+ * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
4431
+ * preserve as much as possible around a point at 20% of the height of the
4432
+ * source image.
4433
+ */
4434
+ gravity?:
4435
+ | "left"
4436
+ | "right"
4437
+ | "top"
4438
+ | "bottom"
4439
+ | "center"
4440
+ | "auto"
4441
+ | BasicImageTransformationsGravityCoordinates;
4442
+ /**
4443
+ * Background color to add underneath the image. Applies only to images with
4444
+ * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
4445
+ * hsl(…), etc.)
4446
+ */
4447
+ background?: string;
4448
+ /**
4449
+ * Number of degrees (90, 180, 270) to rotate the image by. width and height
4450
+ * options refer to axes after rotation.
4451
+ */
4452
+ rotate?: 0 | 90 | 180 | 270 | 360;
4453
+ }
4454
+ export interface BasicImageTransformationsGravityCoordinates {
4455
+ x: number;
4456
+ y: number;
4457
+ }
4458
+ /**
4459
+ * In addition to the properties you can set in the RequestInit dict
4460
+ * that you pass as an argument to the Request constructor, you can
4461
+ * set certain properties of a `cf` object to control how Cloudflare
4462
+ * features are applied to that new Request.
4463
+ *
4464
+ * Note: Currently, these properties cannot be tested in the
4465
+ * playground.
4466
+ */
3179
4467
  export interface RequestInitCfProperties extends Record<string, unknown> {
3180
4468
  cacheEverything?: boolean;
3181
4469
  /**
@@ -3211,6 +4499,7 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
3211
4499
  minify?: RequestInitCfPropertiesImageMinify;
3212
4500
  mirage?: boolean;
3213
4501
  polish?: "lossy" | "lossless" | "off";
4502
+ r2?: RequestInitCfPropertiesR2;
3214
4503
  /**
3215
4504
  * Redirects the request to an alternate origin server. You can use this,
3216
4505
  * for example, to implement load balancing across several origins.
@@ -3395,6 +4684,12 @@ export interface RequestInitCfPropertiesImageMinify {
3395
4684
  css?: boolean;
3396
4685
  html?: boolean;
3397
4686
  }
4687
+ export interface RequestInitCfPropertiesR2 {
4688
+ /**
4689
+ * Colo id of bucket that an object is stored in
4690
+ */
4691
+ bucketColoId?: number;
4692
+ }
3398
4693
  /**
3399
4694
  * Request metadata provided by Cloudflare's edge.
3400
4695
  */
@@ -3787,7 +5082,7 @@ export interface IncomingRequestCfPropertiesTLSClientAuthPlaceholder {
3787
5082
  certNotAfter: "";
3788
5083
  }
3789
5084
  /** Possible outcomes of TLS verification */
3790
- export type CertVerificationStatus =
5085
+ export declare type CertVerificationStatus =
3791
5086
  /** Authentication succeeded */
3792
5087
  | "SUCCESS"
3793
5088
  /** No certificate was presented */
@@ -3805,7 +5100,7 @@ export type CertVerificationStatus =
3805
5100
  /**
3806
5101
  * An upstream endpoint's response to a TCP `keepalive` message from Cloudflare.
3807
5102
  */
3808
- export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
5103
+ export declare type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
3809
5104
  | 0 /** Unknown */
3810
5105
  | 1 /** no keepalives (not found) */
3811
5106
  | 2 /** no connection re-use, opening keepalive connection failed */
@@ -3813,7 +5108,7 @@ export type IncomingRequestCfPropertiesEdgeRequestKeepAliveStatus =
3813
5108
  | 4 /** connection re-use, refused by the origin server (`TCP FIN`) */
3814
5109
  | 5; /** connection re-use, accepted by the origin server */
3815
5110
  /** ISO 3166-1 Alpha-2 codes */
3816
- export type Iso3166Alpha2Code =
5111
+ export declare type Iso3166Alpha2Code =
3817
5112
  | "AD"
3818
5113
  | "AE"
3819
5114
  | "AF"
@@ -4064,7 +5359,14 @@ export type Iso3166Alpha2Code =
4064
5359
  | "ZM"
4065
5360
  | "ZW";
4066
5361
  /** The 2-letter continent codes Cloudflare uses */
4067
- export type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
5362
+ export declare type ContinentCode =
5363
+ | "AF"
5364
+ | "AN"
5365
+ | "AS"
5366
+ | "EU"
5367
+ | "NA"
5368
+ | "OC"
5369
+ | "SA";
4068
5370
  export type CfProperties<HostMetadata = unknown> =
4069
5371
  | IncomingRequestCfProperties<HostMetadata>
4070
5372
  | RequestInitCfProperties;
@@ -4099,7 +5401,7 @@ export declare abstract class D1PreparedStatement {
4099
5401
  bind(...values: unknown[]): D1PreparedStatement;
4100
5402
  first<T = unknown>(colName: string): Promise<T | null>;
4101
5403
  first<T = Record<string, unknown>>(): Promise<T | null>;
4102
- run(): Promise<D1Response>;
5404
+ run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4103
5405
  all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4104
5406
  raw<T = unknown[]>(options: {
4105
5407
  columnNames: true;
@@ -4155,6 +5457,12 @@ export interface ForwardableEmailMessage extends EmailMessage {
4155
5457
  * @returns A promise that resolves when the email message is forwarded.
4156
5458
  */
4157
5459
  forward(rcptTo: string, headers?: Headers): Promise<void>;
5460
+ /**
5461
+ * Reply to the sender of this email message with a new EmailMessage object.
5462
+ * @param message The reply message.
5463
+ * @returns A promise that resolves when the email message is replied.
5464
+ */
5465
+ reply(message: EmailMessage): Promise<void>;
4158
5466
  }
4159
5467
  /**
4160
5468
  * A binding that allows a Worker to send email messages.
@@ -4165,7 +5473,7 @@ export interface SendEmail {
4165
5473
  export declare abstract class EmailEvent extends ExtendableEvent {
4166
5474
  readonly message: ForwardableEmailMessage;
4167
5475
  }
4168
- export type EmailExportedHandler<Env = unknown> = (
5476
+ export declare type EmailExportedHandler<Env = unknown> = (
4169
5477
  message: ForwardableEmailMessage,
4170
5478
  env: Env,
4171
5479
  ctx: ExecutionContext,
@@ -4217,6 +5525,128 @@ export interface Hyperdrive {
4217
5525
  */
4218
5526
  readonly database: string;
4219
5527
  }
5528
+ // Copyright (c) 2024 Cloudflare, Inc.
5529
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
5530
+ // https://opensource.org/licenses/Apache-2.0
5531
+ export type ImageInfoResponse =
5532
+ | {
5533
+ format: "image/svg+xml";
5534
+ }
5535
+ | {
5536
+ format: string;
5537
+ fileSize: number;
5538
+ width: number;
5539
+ height: number;
5540
+ };
5541
+ export type ImageTransform = {
5542
+ fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
5543
+ gravity?:
5544
+ | "left"
5545
+ | "right"
5546
+ | "top"
5547
+ | "bottom"
5548
+ | "center"
5549
+ | "auto"
5550
+ | "entropy"
5551
+ | "face"
5552
+ | {
5553
+ x?: number;
5554
+ y?: number;
5555
+ mode: "remainder" | "box-center";
5556
+ };
5557
+ trim?: {
5558
+ top?: number;
5559
+ bottom?: number;
5560
+ left?: number;
5561
+ right?: number;
5562
+ width?: number;
5563
+ height?: number;
5564
+ border?:
5565
+ | boolean
5566
+ | {
5567
+ color?: string;
5568
+ tolerance?: number;
5569
+ keep?: number;
5570
+ };
5571
+ };
5572
+ width?: number;
5573
+ height?: number;
5574
+ background?: string;
5575
+ rotate?: number;
5576
+ sharpen?: number;
5577
+ blur?: number;
5578
+ contrast?: number;
5579
+ brightness?: number;
5580
+ gamma?: number;
5581
+ border?: {
5582
+ color?: string;
5583
+ width?: number;
5584
+ top?: number;
5585
+ bottom?: number;
5586
+ left?: number;
5587
+ right?: number;
5588
+ };
5589
+ zoom?: number;
5590
+ };
5591
+ export type ImageOutputOptions = {
5592
+ format:
5593
+ | "image/jpeg"
5594
+ | "image/png"
5595
+ | "image/gif"
5596
+ | "image/webp"
5597
+ | "image/avif"
5598
+ | "rgb"
5599
+ | "rgba";
5600
+ quality?: number;
5601
+ background?: string;
5602
+ };
5603
+ export interface ImagesBinding {
5604
+ /**
5605
+ * Get image metadata (type, width and height)
5606
+ * @throws {@link ImagesError} with code 9412 if input is not an image
5607
+ * @param stream The image bytes
5608
+ */
5609
+ info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
5610
+ /**
5611
+ * Begin applying a series of transformations to an image
5612
+ * @param stream The image bytes
5613
+ * @returns A transform handle
5614
+ */
5615
+ input(stream: ReadableStream<Uint8Array>): ImageTransformer;
5616
+ }
5617
+ export interface ImageTransformer {
5618
+ /**
5619
+ * Apply transform next, returning a transform handle.
5620
+ * You can then apply more transformations or retrieve the output.
5621
+ * @param transform
5622
+ */
5623
+ transform(transform: ImageTransform): ImageTransformer;
5624
+ /**
5625
+ * Retrieve the image that results from applying the transforms to the
5626
+ * provided input
5627
+ * @param options Options that apply to the output e.g. output format
5628
+ */
5629
+ output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
5630
+ }
5631
+ export interface ImageTransformationResult {
5632
+ /**
5633
+ * The image as a response, ready to store in cache or return to users
5634
+ */
5635
+ response(): Response;
5636
+ /**
5637
+ * The content type of the returned image
5638
+ */
5639
+ contentType(): string;
5640
+ /**
5641
+ * The bytes of the response
5642
+ */
5643
+ image(): ReadableStream<Uint8Array>;
5644
+ }
5645
+ export interface ImagesError extends Error {
5646
+ readonly code: number;
5647
+ readonly message: string;
5648
+ readonly stack?: string;
5649
+ }
4220
5650
  export type Params<P extends string = any> = Record<P, string | string[]>;
4221
5651
  export type EventContext<Env, P extends string, Data> = {
4222
5652
  request: Request<unknown, IncomingRequestCfProperties<unknown>>;
@@ -4260,6 +5690,30 @@ export type PagesPluginFunction<
4260
5690
  > = (
4261
5691
  context: EventPluginContext<Env, Params, Data, PluginArgs>,
4262
5692
  ) => Response | Promise<Response>;
5693
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
5694
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
5695
+ // https://opensource.org/licenses/Apache-2.0
5696
+ export declare abstract class PipelineTransform {
5697
+ /**
5698
+ * transformJson recieves an array of javascript objects which can be
5699
+ * mutated and returned to the pipeline
5700
+ * @param data The data to be mutated
5701
+ * @returns A promise containing the mutated data
5702
+ */
5703
+ public transformJson(data: object[]): Promise<object[]>;
5704
+ }
5705
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
5706
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
5707
+ // https://opensource.org/licenses/Apache-2.0
5708
+ export interface Pipeline {
5709
+ /**
5710
+ * send takes an array of javascript objects which are
5711
+ * then received by the pipeline for processing
5712
+ *
5713
+ * @param data The data to be sent
5714
+ */
5715
+ send(data: object[]): Promise<void>;
5716
+ }
4263
5717
  // PubSubMessage represents an incoming PubSub message.
4264
5718
  // The message includes metadata about the broker, the client, and the payload
4265
5719
  // itself.
@@ -4294,6 +5748,20 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
4294
5748
  // Key Identifier of the JWK
4295
5749
  readonly kid: string;
4296
5750
  }
5751
+ export interface RateLimitOptions {
5752
+ key: string;
5753
+ }
5754
+ export interface RateLimitOutcome {
5755
+ success: boolean;
5756
+ }
5757
+ export interface RateLimit {
5758
+ /**
5759
+ * Rate limit a request based on the provided options.
5760
+ * @see https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/
5761
+ * @returns A promise that resolves with the outcome of the rate limit.
5762
+ */
5763
+ limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
5764
+ }
4297
5765
  // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
4298
5766
  // to referenced by `Fetcher`. This is included in the "importable" version of the types which
4299
5767
  // strips all `module` blocks.
@@ -4306,6 +5774,7 @@ export declare namespace Rpc {
4306
5774
  export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
4307
5775
  export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
4308
5776
  export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
5777
+ export const __WORKFLOW_ENTRYPOINT_BRAND: "__WORKFLOW_ENTRYPOINT_BRAND";
4309
5778
  export interface RpcTargetBranded {
4310
5779
  [__RPC_TARGET_BRAND]: never;
4311
5780
  }
@@ -4315,13 +5784,20 @@ export declare namespace Rpc {
4315
5784
  export interface DurableObjectBranded {
4316
5785
  [__DURABLE_OBJECT_BRAND]: never;
4317
5786
  }
5787
+ export interface WorkflowEntrypointBranded {
5788
+ [__WORKFLOW_ENTRYPOINT_BRAND]: never;
5789
+ }
4318
5790
  export type EntrypointBranded =
4319
5791
  | WorkerEntrypointBranded
4320
- | DurableObjectBranded;
5792
+ | DurableObjectBranded
5793
+ | WorkflowEntrypointBranded;
4321
5794
  // Types that can be used through `Stub`s
4322
5795
  export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
4323
5796
  // Types that can be passed over RPC
4324
- type Serializable =
5797
+ // The reason for using a generic type here is to build a serializable subset of structured
5798
+ // cloneable composite types. This allows types defined with the "interface" keyword to pass the
5799
+ // serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
5800
+ type Serializable<T> =
4325
5801
  // Structured cloneables
4326
5802
  | void
4327
5803
  | undefined
@@ -4337,11 +5813,14 @@ export declare namespace Rpc {
4337
5813
  | Error
4338
5814
  | RegExp
4339
5815
  // Structured cloneable composites
4340
- | Map<Serializable, Serializable>
4341
- | Set<Serializable>
4342
- | ReadonlyArray<Serializable>
5816
+ | Map<
5817
+ T extends Map<infer U, unknown> ? Serializable<U> : never,
5818
+ T extends Map<unknown, infer U> ? Serializable<U> : never
5819
+ >
5820
+ | Set<T extends Set<infer U> ? Serializable<U> : never>
5821
+ | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
4343
5822
  | {
4344
- [key: string | number]: Serializable;
5823
+ [K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
4345
5824
  }
4346
5825
  // Special types
4347
5826
  | ReadableStream<Uint8Array>
@@ -4371,7 +5850,7 @@ export declare namespace Rpc {
4371
5850
  : T extends ReadonlyArray<infer V>
4372
5851
  ? ReadonlyArray<Stubify<V>>
4373
5852
  : T extends {
4374
- [key: string | number]: unknown;
5853
+ [key: string | number]: any;
4375
5854
  }
4376
5855
  ? {
4377
5856
  [K in keyof T]: Stubify<T[K]>;
@@ -4414,7 +5893,7 @@ export declare namespace Rpc {
4414
5893
  // Intersecting with `(Maybe)Provider` allows pipelining.
4415
5894
  type Result<R> = R extends Stubable
4416
5895
  ? Promise<Stub<R>> & Provider<R>
4417
- : R extends Serializable
5896
+ : R extends Serializable<R>
4418
5897
  ? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
4419
5898
  : never;
4420
5899
  // Type for method or property on an RPC interface.
@@ -4443,6 +5922,198 @@ export declare namespace Rpc {
4443
5922
  >]: MethodOrProperty<T[K]>;
4444
5923
  };
4445
5924
  }
5925
+ export declare namespace TailStream {
5926
+ interface Header {
5927
+ readonly name: string;
5928
+ readonly value: string;
5929
+ }
5930
+ interface FetchEventInfo {
5931
+ readonly type: "fetch";
5932
+ readonly method: string;
5933
+ readonly url: string;
5934
+ readonly cfJson: string;
5935
+ readonly headers: Header[];
5936
+ }
5937
+ interface JsRpcEventInfo {
5938
+ readonly type: "jsrpc";
5939
+ readonly methodName: string;
5940
+ }
5941
+ interface ScheduledEventInfo {
5942
+ readonly type: "scheduled";
5943
+ readonly scheduledTime: Date;
5944
+ readonly cron: string;
5945
+ }
5946
+ interface AlarmEventInfo {
5947
+ readonly type: "alarm";
5948
+ readonly scheduledTime: Date;
5949
+ }
5950
+ interface QueueEventInfo {
5951
+ readonly type: "queue";
5952
+ readonly queueName: string;
5953
+ readonly batchSize: number;
5954
+ }
5955
+ interface EmailEventInfo {
5956
+ readonly type: "email";
5957
+ readonly mailFrom: string;
5958
+ readonly rcptTo: string;
5959
+ readonly rawSize: number;
5960
+ }
5961
+ interface TraceEventInfo {
5962
+ readonly type: "trace";
5963
+ readonly traces: (string | null)[];
5964
+ }
5965
+ interface HibernatableWebSocketEventInfoMessage {
5966
+ readonly type: "message";
5967
+ }
5968
+ interface HibernatableWebSocketEventInfoError {
5969
+ readonly type: "error";
5970
+ }
5971
+ interface HibernatableWebSocketEventInfoClose {
5972
+ readonly type: "close";
5973
+ readonly code: number;
5974
+ readonly wasClean: boolean;
5975
+ }
5976
+ interface HibernatableWebSocketEventInfo {
5977
+ readonly type: "hibernatableWebSocket";
5978
+ readonly info:
5979
+ | HibernatableWebSocketEventInfoClose
5980
+ | HibernatableWebSocketEventInfoError
5981
+ | HibernatableWebSocketEventInfoMessage;
5982
+ }
5983
+ interface Resume {
5984
+ readonly type: "resume";
5985
+ readonly attachment?: any;
5986
+ }
5987
+ interface CustomEventInfo {
5988
+ readonly type: "custom";
5989
+ }
5990
+ interface FetchResponseInfo {
5991
+ readonly type: "fetch";
5992
+ readonly statusCode: number;
5993
+ }
5994
+ type EventOutcome =
5995
+ | "ok"
5996
+ | "canceled"
5997
+ | "exception"
5998
+ | "unknown"
5999
+ | "killSwitch"
6000
+ | "daemonDown"
6001
+ | "exceededCpu"
6002
+ | "exceededMemory"
6003
+ | "loadShed"
6004
+ | "responseStreamDisconnected"
6005
+ | "scriptNotFound";
6006
+ interface ScriptVersion {
6007
+ readonly id: string;
6008
+ readonly tag?: string;
6009
+ readonly message?: string;
6010
+ }
6011
+ interface Trigger {
6012
+ readonly traceId: string;
6013
+ readonly invocationId: string;
6014
+ readonly spanId: string;
6015
+ }
6016
+ interface Onset {
6017
+ readonly type: "onset";
6018
+ readonly dispatchNamespace?: string;
6019
+ readonly entrypoint?: string;
6020
+ readonly scriptName?: string;
6021
+ readonly scriptTags?: string[];
6022
+ readonly scriptVersion?: ScriptVersion;
6023
+ readonly trigger?: Trigger;
6024
+ readonly info:
6025
+ | FetchEventInfo
6026
+ | JsRpcEventInfo
6027
+ | ScheduledEventInfo
6028
+ | AlarmEventInfo
6029
+ | QueueEventInfo
6030
+ | EmailEventInfo
6031
+ | TraceEventInfo
6032
+ | HibernatableWebSocketEventInfo
6033
+ | Resume
6034
+ | CustomEventInfo;
6035
+ }
6036
+ interface Outcome {
6037
+ readonly type: "outcome";
6038
+ readonly outcome: EventOutcome;
6039
+ readonly cpuTime: number;
6040
+ readonly wallTime: number;
6041
+ }
6042
+ interface Hibernate {
6043
+ readonly type: "hibernate";
6044
+ }
6045
+ interface SpanOpen {
6046
+ readonly type: "spanOpen";
6047
+ readonly op?: string;
6048
+ readonly info?: FetchEventInfo | JsRpcEventInfo | Attribute[];
6049
+ }
6050
+ interface SpanClose {
6051
+ readonly type: "spanClose";
6052
+ readonly outcome: EventOutcome;
6053
+ }
6054
+ interface DiagnosticChannelEvent {
6055
+ readonly type: "diagnosticChannel";
6056
+ readonly channel: string;
6057
+ readonly message: any;
6058
+ }
6059
+ interface Exception {
6060
+ readonly type: "exception";
6061
+ readonly name: string;
6062
+ readonly message: string;
6063
+ readonly stack?: string;
6064
+ }
6065
+ interface Log {
6066
+ readonly type: "log";
6067
+ readonly level: "debug" | "error" | "info" | "log" | "warn";
6068
+ readonly message: string;
6069
+ }
6070
+ interface Return {
6071
+ readonly type: "return";
6072
+ readonly info?: FetchResponseInfo | Attribute[];
6073
+ }
6074
+ interface Link {
6075
+ readonly type: "link";
6076
+ readonly label?: string;
6077
+ readonly traceId: string;
6078
+ readonly invocationId: string;
6079
+ readonly spanId: string;
6080
+ }
6081
+ interface Attribute {
6082
+ readonly type: "attribute";
6083
+ readonly name: string;
6084
+ readonly value: string | string[] | boolean | boolean[] | number | number[];
6085
+ }
6086
+ type Mark =
6087
+ | DiagnosticChannelEvent
6088
+ | Exception
6089
+ | Log
6090
+ | Return
6091
+ | Link
6092
+ | Attribute[];
6093
+ interface TailEvent {
6094
+ readonly traceId: string;
6095
+ readonly invocationId: string;
6096
+ readonly spanId: string;
6097
+ readonly timestamp: Date;
6098
+ readonly sequence: number;
6099
+ readonly event: Onset | Outcome | Hibernate | SpanOpen | SpanClose | Mark;
6100
+ }
6101
+ type TailEventHandler = (event: TailEvent) => void | Promise<void>;
6102
+ type TailEventHandlerName =
6103
+ | "onset"
6104
+ | "outcome"
6105
+ | "hibernate"
6106
+ | "spanOpen"
6107
+ | "spanClose"
6108
+ | "diagnosticChannel"
6109
+ | "exception"
6110
+ | "log"
6111
+ | "return"
6112
+ | "link"
6113
+ | "attribute";
6114
+ type TailEventHandlerObject = Record<TailEventHandlerName, TailEventHandler>;
6115
+ type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;
6116
+ }
4446
6117
  // Copyright (c) 2022-2023 Cloudflare, Inc.
4447
6118
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4448
6119
  // https://opensource.org/licenses/Apache-2.0
@@ -4486,11 +6157,21 @@ export type VectorizeVectorMetadataFilter = {
4486
6157
  * Distance metrics determine how other "similar" vectors are determined.
4487
6158
  */
4488
6159
  export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
6160
+ /**
6161
+ * Metadata return levels for a Vectorize query.
6162
+ *
6163
+ * Default to "none".
6164
+ *
6165
+ * @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.
6166
+ * @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).
6167
+ * @property none No indexed metadata will be returned.
6168
+ */
6169
+ export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
4489
6170
  export interface VectorizeQueryOptions {
4490
6171
  topK?: number;
4491
6172
  namespace?: string;
4492
6173
  returnValues?: boolean;
4493
- returnMetadata?: boolean;
6174
+ returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
4494
6175
  filter?: VectorizeVectorMetadataFilter;
4495
6176
  }
4496
6177
  /**
@@ -4506,6 +6187,9 @@ export type VectorizeIndexConfig =
4506
6187
  };
4507
6188
  /**
4508
6189
  * Metadata about an existing index.
6190
+ *
6191
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
6192
+ * See {@link VectorizeIndexInfo} for its post-beta equivalent.
4509
6193
  */
4510
6194
  export interface VectorizeIndexDetails {
4511
6195
  /** The unique ID of the index */
@@ -4519,6 +6203,19 @@ export interface VectorizeIndexDetails {
4519
6203
  /** The number of records containing vectors within the index. */
4520
6204
  vectorsCount: number;
4521
6205
  }
6206
+ /**
6207
+ * Metadata about an existing index.
6208
+ */
6209
+ export interface VectorizeIndexInfo {
6210
+ /** The number of records containing vectors within the index. */
6211
+ vectorCount: number;
6212
+ /** Number of dimensions the index has been configured for. */
6213
+ dimensions: number;
6214
+ /** ISO 8601 datetime of the last processed mutation on in the index. All changes before this mutation will be reflected in the index state. */
6215
+ processedUpToDatetime: number;
6216
+ /** UUIDv4 of the last mutation processed by the index. All changes before this mutation will be reflected in the index state. */
6217
+ processedUpToMutation: number;
6218
+ }
4522
6219
  /**
4523
6220
  * Represents a single vector value set along with its associated metadata.
4524
6221
  */
@@ -4529,7 +6226,7 @@ export interface VectorizeVector {
4529
6226
  values: VectorFloatArray | number[];
4530
6227
  /** The namespace this vector belongs to. */
4531
6228
  namespace?: string;
4532
- /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
6229
+ /** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
4533
6230
  metadata?: Record<string, VectorizeVectorMetadata>;
4534
6231
  }
4535
6232
  /**
@@ -4541,7 +6238,7 @@ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
4541
6238
  score: number;
4542
6239
  };
4543
6240
  /**
4544
- * A set of vector {@link VectorizeMatch} for a particular query.
6241
+ * A set of matching {@link VectorizeMatch} for a particular query.
4545
6242
  */
4546
6243
  export interface VectorizeMatches {
4547
6244
  matches: VectorizeMatch[];
@@ -4550,6 +6247,9 @@ export interface VectorizeMatches {
4550
6247
  /**
4551
6248
  * Results of an operation that performed a mutation on a set of vectors.
4552
6249
  * Here, `ids` is a list of vectors that were successfully processed.
6250
+ *
6251
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
6252
+ * See {@link VectorizeAsyncMutation} for its post-beta equivalent.
4553
6253
  */
4554
6254
  export interface VectorizeVectorMutation {
4555
6255
  /* List of ids of vectors that were successfully processed. */
@@ -4557,6 +6257,20 @@ export interface VectorizeVectorMutation {
4557
6257
  /* Total count of the number of processed vectors. */
4558
6258
  count: number;
4559
6259
  }
6260
+ /**
6261
+ * Result type indicating a mutation on the Vectorize Index.
6262
+ * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
6263
+ */
6264
+ export interface VectorizeAsyncMutation {
6265
+ /** The unique identifier for the async mutation operation containing the changeset. */
6266
+ mutationId: string;
6267
+ }
6268
+ /**
6269
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
6270
+ *
6271
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
6272
+ * See {@link Vectorize} for its new implementation.
6273
+ */
4560
6274
  export declare abstract class VectorizeIndex {
4561
6275
  /**
4562
6276
  * Get information about the currently bound index.
@@ -4571,7 +6285,7 @@ export declare abstract class VectorizeIndex {
4571
6285
  */
4572
6286
  public query(
4573
6287
  vector: VectorFloatArray | number[],
4574
- options: VectorizeQueryOptions,
6288
+ options?: VectorizeQueryOptions,
4575
6289
  ): Promise<VectorizeMatches>;
4576
6290
  /**
4577
6291
  * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
@@ -4598,6 +6312,62 @@ export declare abstract class VectorizeIndex {
4598
6312
  */
4599
6313
  public getByIds(ids: string[]): Promise<VectorizeVector[]>;
4600
6314
  }
6315
+ /**
6316
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
6317
+ *
6318
+ * Mutations in this version are async, returning a mutation id.
6319
+ */
6320
+ export declare abstract class Vectorize {
6321
+ /**
6322
+ * Get information about the currently bound index.
6323
+ * @returns A promise that resolves with information about the current index.
6324
+ */
6325
+ public describe(): Promise<VectorizeIndexInfo>;
6326
+ /**
6327
+ * Use the provided vector to perform a similarity search across the index.
6328
+ * @param vector Input vector that will be used to drive the similarity search.
6329
+ * @param options Configuration options to massage the returned data.
6330
+ * @returns A promise that resolves with matched and scored vectors.
6331
+ */
6332
+ public query(
6333
+ vector: VectorFloatArray | number[],
6334
+ options?: VectorizeQueryOptions,
6335
+ ): Promise<VectorizeMatches>;
6336
+ /**
6337
+ * Use the provided vector-id to perform a similarity search across the index.
6338
+ * @param vectorId Id for a vector in the index against which the index should be queried.
6339
+ * @param options Configuration options to massage the returned data.
6340
+ * @returns A promise that resolves with matched and scored vectors.
6341
+ */
6342
+ public queryById(
6343
+ vectorId: string,
6344
+ options?: VectorizeQueryOptions,
6345
+ ): Promise<VectorizeMatches>;
6346
+ /**
6347
+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
6348
+ * @param vectors List of vectors that will be inserted.
6349
+ * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
6350
+ */
6351
+ public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
6352
+ /**
6353
+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
6354
+ * @param vectors List of vectors that will be upserted.
6355
+ * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
6356
+ */
6357
+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
6358
+ /**
6359
+ * Delete a list of vectors with a matching id.
6360
+ * @param ids List of vector ids that should be deleted.
6361
+ * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
6362
+ */
6363
+ public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
6364
+ /**
6365
+ * Get a list of vectors with a matching id.
6366
+ * @param ids List of vector ids that should be returned.
6367
+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
6368
+ */
6369
+ public getByIds(ids: string[]): Promise<VectorizeVector[]>;
6370
+ }
4601
6371
  /**
4602
6372
  * The interface for "version_metadata" binding
4603
6373
  * providing metadata about the Worker Version using this binding.
@@ -4607,6 +6377,8 @@ export type WorkerVersionMetadata = {
4607
6377
  id: string;
4608
6378
  /** The tag of the Worker Version using this binding */
4609
6379
  tag: string;
6380
+ /** The timestamp of when the Worker Version was uploaded */
6381
+ timestamp: string;
4610
6382
  };
4611
6383
  export interface DynamicDispatchLimits {
4612
6384
  /**
@@ -4646,3 +6418,70 @@ export interface DispatchNamespace {
4646
6418
  options?: DynamicDispatchOptions,
4647
6419
  ): Fetcher;
4648
6420
  }
6421
+ export declare abstract class Workflow<PARAMS = unknown> {
6422
+ /**
6423
+ * Get a handle to an existing instance of the Workflow.
6424
+ * @param id Id for the instance of this Workflow
6425
+ * @returns A promise that resolves with a handle for the Instance
6426
+ */
6427
+ public get(id: string): Promise<WorkflowInstance>;
6428
+ /**
6429
+ * Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
6430
+ * @param options Options when creating an instance including id and params
6431
+ * @returns A promise that resolves with a handle for the Instance
6432
+ */
6433
+ public create(
6434
+ options?: WorkflowInstanceCreateOptions<PARAMS>,
6435
+ ): Promise<WorkflowInstance>;
6436
+ }
6437
+ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6438
+ /**
6439
+ * An id for your Workflow instance. Must be unique within the Workflow.
6440
+ */
6441
+ id?: string;
6442
+ /**
6443
+ * The event payload the Workflow instance is triggered with
6444
+ */
6445
+ params?: PARAMS;
6446
+ }
6447
+ export type InstanceStatus = {
6448
+ status:
6449
+ | "queued" // means that instance is waiting to be started (see concurrency limits)
6450
+ | "running"
6451
+ | "paused"
6452
+ | "errored"
6453
+ | "terminated" // user terminated the instance while it was running
6454
+ | "complete"
6455
+ | "waiting" // instance is hibernating and waiting for sleep or event to finish
6456
+ | "waitingForPause" // instance is finishing the current work to pause
6457
+ | "unknown";
6458
+ error?: string;
6459
+ output?: object;
6460
+ };
6461
+ export interface WorkflowError {
6462
+ code?: number;
6463
+ message: string;
6464
+ }
6465
+ export declare abstract class WorkflowInstance {
6466
+ public id: string;
6467
+ /**
6468
+ * Pause the instance.
6469
+ */
6470
+ public pause(): Promise<void>;
6471
+ /**
6472
+ * Resume the instance. If it is already running, an error will be thrown.
6473
+ */
6474
+ public resume(): Promise<void>;
6475
+ /**
6476
+ * Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
6477
+ */
6478
+ public terminate(): Promise<void>;
6479
+ /**
6480
+ * Restart the instance.
6481
+ */
6482
+ public restart(): Promise<void>;
6483
+ /**
6484
+ * Returns the current status of the instance.
6485
+ */
6486
+ public status(): Promise<InstanceStatus>;
6487
+ }