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