@cloudflare/workers-types 0.20230518.0 → 0.20240405.1

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.
@@ -16,8 +16,15 @@ and limitations under the License.
16
16
  // noinspection JSUnusedGlobalSymbols
17
17
  export declare class DOMException extends Error {
18
18
  constructor(message?: string, name?: string);
19
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
19
20
  readonly message: string;
21
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
20
22
  readonly name: string;
23
+ /**
24
+ * @deprecated
25
+ *
26
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
27
+ */
21
28
  readonly code: number;
22
29
  readonly stack: any;
23
30
  static readonly INDEX_SIZE_ERR: number;
@@ -56,30 +63,61 @@ export type WorkerGlobalScopeEventMap = {
56
63
  export declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
57
64
  EventTarget: typeof EventTarget;
58
65
  }
66
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
59
67
  export interface Console {
60
68
  "assert"(condition?: boolean, ...data: any[]): void;
69
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
61
70
  clear(): void;
71
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
62
72
  count(label?: string): void;
73
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
63
74
  countReset(label?: string): void;
75
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
64
76
  debug(...data: any[]): void;
77
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
65
78
  dir(item?: any, options?: any): void;
79
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
66
80
  dirxml(...data: any[]): void;
81
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
67
82
  error(...data: any[]): void;
83
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
68
84
  group(...data: any[]): void;
85
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
69
86
  groupCollapsed(...data: any[]): void;
87
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
70
88
  groupEnd(): void;
89
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
71
90
  info(...data: any[]): void;
91
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
72
92
  log(...data: any[]): void;
93
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
73
94
  table(tabularData?: any, properties?: string[]): void;
95
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
74
96
  time(label?: string): void;
97
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
75
98
  timeEnd(label?: string): void;
99
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
76
100
  timeLog(label?: string, ...data: any[]): void;
77
101
  timeStamp(label?: string): void;
102
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
78
103
  trace(...data: any[]): void;
104
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
79
105
  warn(...data: any[]): void;
80
106
  }
81
107
  export declare const console: Console;
82
108
  export type BufferSource = ArrayBufferView | ArrayBuffer;
109
+ export type TypedArray =
110
+ | Int8Array
111
+ | Uint8Array
112
+ | Uint8ClampedArray
113
+ | Int16Array
114
+ | Uint16Array
115
+ | Int32Array
116
+ | Uint32Array
117
+ | Float32Array
118
+ | Float64Array
119
+ | BigInt64Array
120
+ | BigUint64Array;
83
121
  export declare namespace WebAssembly {
84
122
  class CompileError extends Error {
85
123
  constructor(message?: string);
@@ -154,7 +192,11 @@ export declare namespace WebAssembly {
154
192
  function instantiate(module: Module, imports?: Imports): Promise<Instance>;
155
193
  function validate(bytes: BufferSource): boolean;
156
194
  }
157
- /** This ServiceWorker API interface represents the global execution context of a service worker. */
195
+ /**
196
+ * This ServiceWorker API interface represents the global execution context of a service worker.
197
+ *
198
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
199
+ */
158
200
  export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
159
201
  DOMException: typeof DOMException;
160
202
  WorkerGlobalScope: typeof WorkerGlobalScope;
@@ -178,7 +220,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
178
220
  structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
179
221
  fetch(
180
222
  input: RequestInfo,
181
- init?: RequestInit<RequestInitCfProperties>
223
+ init?: RequestInit<RequestInitCfProperties>,
182
224
  ): Promise<Response>;
183
225
  self: ServiceWorkerGlobalScope;
184
226
  crypto: Crypto;
@@ -188,6 +230,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
188
230
  readonly origin: string;
189
231
  Event: typeof Event;
190
232
  ExtendableEvent: typeof ExtendableEvent;
233
+ CustomEvent: typeof CustomEvent;
191
234
  PromiseRejectionEvent: typeof PromiseRejectionEvent;
192
235
  FetchEvent: typeof FetchEvent;
193
236
  TailEvent: typeof TailEvent;
@@ -213,6 +256,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
213
256
  Response: typeof Response;
214
257
  WebSocket: typeof WebSocket;
215
258
  WebSocketPair: typeof WebSocketPair;
259
+ WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
216
260
  AbortController: typeof AbortController;
217
261
  AbortSignal: typeof AbortSignal;
218
262
  TextDecoder: typeof TextDecoder;
@@ -233,55 +277,80 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
233
277
  FixedLengthStream: typeof FixedLengthStream;
234
278
  IdentityTransformStream: typeof IdentityTransformStream;
235
279
  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;
236
290
  }
237
291
  export declare function addEventListener<
238
- Type extends keyof WorkerGlobalScopeEventMap
292
+ Type extends keyof WorkerGlobalScopeEventMap,
239
293
  >(
240
294
  type: Type,
241
295
  handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
242
- options?: EventTargetAddEventListenerOptions | boolean
296
+ options?: EventTargetAddEventListenerOptions | boolean,
243
297
  ): void;
244
298
  export declare function removeEventListener<
245
- Type extends keyof WorkerGlobalScopeEventMap
299
+ Type extends keyof WorkerGlobalScopeEventMap,
246
300
  >(
247
301
  type: Type,
248
302
  handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
249
- options?: EventTargetEventListenerOptions | boolean
303
+ options?: EventTargetEventListenerOptions | boolean,
250
304
  ): void;
251
- /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
305
+ /**
306
+ * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
307
+ *
308
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
309
+ */
252
310
  export declare function dispatchEvent(
253
- event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]
311
+ event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],
254
312
  ): boolean;
313
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
255
314
  export declare function btoa(data: string): string;
315
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
256
316
  export declare function atob(data: string): string;
317
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
257
318
  export declare function setTimeout(
258
319
  callback: (...args: any[]) => void,
259
- msDelay?: number
320
+ msDelay?: number,
260
321
  ): number;
322
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
261
323
  export declare function setTimeout<Args extends any[]>(
262
324
  callback: (...args: Args) => void,
263
325
  msDelay?: number,
264
326
  ...args: Args
265
327
  ): number;
328
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
266
329
  export declare function clearTimeout(timeoutId: number | null): void;
330
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
267
331
  export declare function setInterval(
268
332
  callback: (...args: any[]) => void,
269
- msDelay?: number
333
+ msDelay?: number,
270
334
  ): number;
335
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
271
336
  export declare function setInterval<Args extends any[]>(
272
337
  callback: (...args: Args) => void,
273
338
  msDelay?: number,
274
339
  ...args: Args
275
340
  ): number;
341
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
276
342
  export declare function clearInterval(timeoutId: number | null): void;
343
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
277
344
  export declare function queueMicrotask(task: Function): void;
345
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
278
346
  export declare function structuredClone<T>(
279
347
  value: T,
280
- options?: StructuredSerializeOptions
348
+ options?: StructuredSerializeOptions,
281
349
  ): T;
350
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
282
351
  export declare function fetch(
283
352
  input: RequestInfo,
284
- init?: RequestInit<RequestInitCfProperties>
353
+ init?: RequestInit<RequestInitCfProperties>,
285
354
  ): Promise<Response>;
286
355
  export declare const self: ServiceWorkerGlobalScope;
287
356
  export declare const crypto: Crypto;
@@ -297,88 +366,132 @@ export interface ExecutionContext {
297
366
  }
298
367
  export type ExportedHandlerFetchHandler<
299
368
  Env = unknown,
300
- CfHostMetadata = unknown
369
+ CfHostMetadata = unknown,
301
370
  > = (
302
371
  request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
303
372
  env: Env,
304
- ctx: ExecutionContext
373
+ ctx: ExecutionContext,
305
374
  ) => Response | Promise<Response>;
306
375
  export type ExportedHandlerTailHandler<Env = unknown> = (
307
376
  events: TraceItem[],
308
377
  env: Env,
309
- ctx: ExecutionContext
378
+ ctx: ExecutionContext,
310
379
  ) => void | Promise<void>;
311
380
  export type ExportedHandlerTraceHandler<Env = unknown> = (
312
381
  traces: TraceItem[],
313
382
  env: Env,
314
- ctx: ExecutionContext
383
+ ctx: ExecutionContext,
315
384
  ) => void | Promise<void>;
316
385
  export type ExportedHandlerScheduledHandler<Env = unknown> = (
317
386
  controller: ScheduledController,
318
387
  env: Env,
319
- ctx: ExecutionContext
388
+ ctx: ExecutionContext,
320
389
  ) => void | Promise<void>;
321
390
  export type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (
322
391
  batch: MessageBatch<Message>,
323
392
  env: Env,
324
- ctx: ExecutionContext
393
+ ctx: ExecutionContext,
325
394
  ) => void | Promise<void>;
326
395
  export type ExportedHandlerTestHandler<Env = unknown> = (
327
396
  controller: TestController,
328
397
  env: Env,
329
- ctx: ExecutionContext
398
+ ctx: ExecutionContext,
330
399
  ) => void | Promise<void>;
331
400
  export interface ExportedHandler<
332
401
  Env = unknown,
333
- QueueMessage = unknown,
334
- CfHostMetadata = unknown
402
+ QueueHandlerMessage = unknown,
403
+ CfHostMetadata = unknown,
335
404
  > {
336
405
  fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
337
406
  tail?: ExportedHandlerTailHandler<Env>;
338
407
  trace?: ExportedHandlerTraceHandler<Env>;
339
408
  scheduled?: ExportedHandlerScheduledHandler<Env>;
340
409
  test?: ExportedHandlerTestHandler<Env>;
341
- queue?: ExportedHandlerQueueHandler<Env, Message>;
410
+ email?: EmailExportedHandler<Env>;
411
+ queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
342
412
  }
343
413
  export interface StructuredSerializeOptions {
344
414
  transfer?: any[];
345
415
  }
346
416
  export declare abstract class PromiseRejectionEvent extends Event {
417
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
347
418
  readonly promise: Promise<any>;
419
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
348
420
  readonly reason: any;
349
421
  }
350
422
  export declare abstract class Navigator {
423
+ sendBeacon(
424
+ url: string,
425
+ body?:
426
+ | ReadableStream
427
+ | string
428
+ | (ArrayBuffer | ArrayBufferView)
429
+ | Blob
430
+ | URLSearchParams
431
+ | FormData,
432
+ ): boolean;
351
433
  readonly userAgent: string;
434
+ readonly gpu: gpuGPU;
352
435
  }
353
- /** 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. */
436
+ /**
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.
438
+ *
439
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance)
440
+ */
354
441
  export interface Performance {
442
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin) */
355
443
  readonly timeOrigin: number;
444
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/now) */
356
445
  now(): number;
357
446
  }
447
+ export interface AlarmInvocationInfo {
448
+ readonly isRetry: boolean;
449
+ readonly retryCount: number;
450
+ }
358
451
  export interface DurableObject {
359
452
  fetch(request: Request): Response | Promise<Response>;
360
453
  alarm?(): void | Promise<void>;
361
- }
362
- export interface DurableObjectStub extends Fetcher {
454
+ webSocketMessage?(
455
+ ws: WebSocket,
456
+ message: string | ArrayBuffer,
457
+ ): void | Promise<void>;
458
+ webSocketClose?(
459
+ ws: WebSocket,
460
+ code: number,
461
+ reason: string,
462
+ wasClean: boolean,
463
+ ): void | Promise<void>;
464
+ webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
465
+ }
466
+ export type DurableObjectStub<
467
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
468
+ > = Fetcher<
469
+ T,
470
+ "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
471
+ > & {
363
472
  readonly id: DurableObjectId;
364
473
  readonly name?: string;
365
- }
474
+ };
366
475
  export interface DurableObjectId {
367
476
  toString(): string;
368
477
  equals(other: DurableObjectId): boolean;
369
478
  readonly name?: string;
370
479
  }
371
- export interface DurableObjectNamespace {
480
+ export interface DurableObjectNamespace<
481
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
482
+ > {
372
483
  newUniqueId(
373
- options?: DurableObjectNamespaceNewUniqueIdOptions
484
+ options?: DurableObjectNamespaceNewUniqueIdOptions,
374
485
  ): DurableObjectId;
375
486
  idFromName(name: string): DurableObjectId;
376
487
  idFromString(id: string): DurableObjectId;
377
488
  get(
378
489
  id: DurableObjectId,
379
- options?: DurableObjectNamespaceGetDurableObjectOptions
380
- ): DurableObjectStub;
381
- jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
490
+ options?: DurableObjectNamespaceGetDurableObjectOptions,
491
+ ): DurableObjectStub<T>;
492
+ jurisdiction(
493
+ jurisdiction: DurableObjectJurisdiction,
494
+ ): DurableObjectNamespace<T>;
382
495
  }
383
496
  export type DurableObjectJurisdiction = "eu" | "fedramp";
384
497
  export interface DurableObjectNamespaceNewUniqueIdOptions {
@@ -404,27 +517,33 @@ export interface DurableObjectState {
404
517
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
405
518
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
406
519
  getWebSockets(tag?: string): WebSocket[];
520
+ setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
521
+ getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
522
+ getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
523
+ setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
524
+ getHibernatableWebSocketEventTimeout(): number | null;
525
+ getTags(ws: WebSocket): string[];
407
526
  }
408
527
  export interface DurableObjectTransaction {
409
528
  get<T = unknown>(
410
529
  key: string,
411
- options?: DurableObjectGetOptions
530
+ options?: DurableObjectGetOptions,
412
531
  ): Promise<T | undefined>;
413
532
  get<T = unknown>(
414
533
  keys: string[],
415
- options?: DurableObjectGetOptions
534
+ options?: DurableObjectGetOptions,
416
535
  ): Promise<Map<string, T>>;
417
536
  list<T = unknown>(
418
- options?: DurableObjectListOptions
537
+ options?: DurableObjectListOptions,
419
538
  ): Promise<Map<string, T>>;
420
539
  put<T>(
421
540
  key: string,
422
541
  value: T,
423
- options?: DurableObjectPutOptions
542
+ options?: DurableObjectPutOptions,
424
543
  ): Promise<void>;
425
544
  put<T>(
426
545
  entries: Record<string, T>,
427
- options?: DurableObjectPutOptions
546
+ options?: DurableObjectPutOptions,
428
547
  ): Promise<void>;
429
548
  delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
430
549
  delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
@@ -432,41 +551,41 @@ export interface DurableObjectTransaction {
432
551
  getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
433
552
  setAlarm(
434
553
  scheduledTime: number | Date,
435
- options?: DurableObjectSetAlarmOptions
554
+ options?: DurableObjectSetAlarmOptions,
436
555
  ): Promise<void>;
437
556
  deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
438
557
  }
439
558
  export interface DurableObjectStorage {
440
559
  get<T = unknown>(
441
560
  key: string,
442
- options?: DurableObjectGetOptions
561
+ options?: DurableObjectGetOptions,
443
562
  ): Promise<T | undefined>;
444
563
  get<T = unknown>(
445
564
  keys: string[],
446
- options?: DurableObjectGetOptions
565
+ options?: DurableObjectGetOptions,
447
566
  ): Promise<Map<string, T>>;
448
567
  list<T = unknown>(
449
- options?: DurableObjectListOptions
568
+ options?: DurableObjectListOptions,
450
569
  ): Promise<Map<string, T>>;
451
570
  put<T>(
452
571
  key: string,
453
572
  value: T,
454
- options?: DurableObjectPutOptions
573
+ options?: DurableObjectPutOptions,
455
574
  ): Promise<void>;
456
575
  put<T>(
457
576
  entries: Record<string, T>,
458
- options?: DurableObjectPutOptions
577
+ options?: DurableObjectPutOptions,
459
578
  ): Promise<void>;
460
579
  delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
461
580
  delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
462
581
  deleteAll(options?: DurableObjectPutOptions): Promise<void>;
463
582
  transaction<T>(
464
- closure: (txn: DurableObjectTransaction) => Promise<T>
583
+ closure: (txn: DurableObjectTransaction) => Promise<T>,
465
584
  ): Promise<T>;
466
585
  getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
467
586
  setAlarm(
468
587
  scheduledTime: number | Date,
469
- options?: DurableObjectSetAlarmOptions
588
+ options?: DurableObjectSetAlarmOptions,
470
589
  ): Promise<void>;
471
590
  deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
472
591
  sync(): Promise<void>;
@@ -498,6 +617,11 @@ export interface DurableObjectSetAlarmOptions {
498
617
  allowConcurrency?: boolean;
499
618
  allowUnconfirmed?: boolean;
500
619
  }
620
+ export declare class WebSocketRequestResponsePair {
621
+ constructor(request: string, response: string);
622
+ get request(): string;
623
+ get response(): string;
624
+ }
501
625
  export interface AnalyticsEngineDataset {
502
626
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
503
627
  }
@@ -508,22 +632,107 @@ export interface AnalyticsEngineDataPoint {
508
632
  }
509
633
  export declare class Event {
510
634
  constructor(type: string, init?: EventInit);
635
+ /**
636
+ * Returns the type of event, e.g. "click", "hashchange", or "submit".
637
+ *
638
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
639
+ */
511
640
  get type(): string;
641
+ /**
642
+ * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
643
+ *
644
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
645
+ */
512
646
  get eventPhase(): number;
647
+ /**
648
+ * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
649
+ *
650
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
651
+ */
513
652
  get composed(): boolean;
653
+ /**
654
+ * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
655
+ *
656
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
657
+ */
514
658
  get bubbles(): boolean;
659
+ /**
660
+ * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
661
+ *
662
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
663
+ */
515
664
  get cancelable(): boolean;
665
+ /**
666
+ * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
667
+ *
668
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
669
+ */
516
670
  get defaultPrevented(): boolean;
671
+ /**
672
+ * @deprecated
673
+ *
674
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
675
+ */
517
676
  get returnValue(): boolean;
677
+ /**
678
+ * Returns the object whose event listener's callback is currently being invoked.
679
+ *
680
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
681
+ */
518
682
  get currentTarget(): EventTarget | undefined;
683
+ /**
684
+ * @deprecated
685
+ *
686
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
687
+ */
519
688
  get srcElement(): EventTarget | undefined;
689
+ /**
690
+ * Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
691
+ *
692
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
693
+ */
520
694
  get timeStamp(): number;
695
+ /**
696
+ * Returns true if event was dispatched by the user agent, and false otherwise.
697
+ *
698
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
699
+ */
521
700
  get isTrusted(): boolean;
701
+ /**
702
+ * @deprecated
703
+ *
704
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
705
+ */
522
706
  get cancelBubble(): boolean;
707
+ /**
708
+ * @deprecated
709
+ *
710
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
711
+ */
523
712
  set cancelBubble(value: boolean);
713
+ /**
714
+ * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
715
+ *
716
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
717
+ */
524
718
  stopImmediatePropagation(): void;
719
+ /**
720
+ * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
721
+ *
722
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
723
+ */
525
724
  preventDefault(): void;
725
+ /**
726
+ * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
727
+ *
728
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
729
+ */
526
730
  stopPropagation(): void;
731
+ /**
732
+ * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
733
+ *
734
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
735
+ */
527
736
  composedPath(): EventTarget[];
528
737
  static readonly NONE: number;
529
738
  static readonly CAPTURING_PHASE: number;
@@ -536,28 +745,55 @@ export interface EventInit {
536
745
  composed?: boolean;
537
746
  }
538
747
  export type EventListener<EventType extends Event = Event> = (
539
- event: EventType
748
+ event: EventType,
540
749
  ) => void;
541
750
  export interface EventListenerObject<EventType extends Event = Event> {
542
751
  handleEvent(event: EventType): void;
543
752
  }
544
753
  export type EventListenerOrEventListenerObject<
545
- EventType extends Event = Event
754
+ EventType extends Event = Event,
546
755
  > = EventListener<EventType> | EventListenerObject<EventType>;
547
756
  export declare class EventTarget<
548
- EventMap extends Record<string, Event> = Record<string, Event>
757
+ EventMap extends Record<string, Event> = Record<string, Event>,
549
758
  > {
550
759
  constructor();
760
+ /**
761
+ * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
762
+ *
763
+ * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
764
+ *
765
+ * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
766
+ *
767
+ * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
768
+ *
769
+ * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
770
+ *
771
+ * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
772
+ *
773
+ * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
774
+ *
775
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
776
+ */
551
777
  addEventListener<Type extends keyof EventMap>(
552
778
  type: Type,
553
779
  handler: EventListenerOrEventListenerObject<EventMap[Type]>,
554
- options?: EventTargetAddEventListenerOptions | boolean
780
+ options?: EventTargetAddEventListenerOptions | boolean,
555
781
  ): void;
782
+ /**
783
+ * Removes the event listener in target's event listener list with the same type, callback, and options.
784
+ *
785
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
786
+ */
556
787
  removeEventListener<Type extends keyof EventMap>(
557
788
  type: Type,
558
789
  handler: EventListenerOrEventListenerObject<EventMap[Type]>,
559
- options?: EventTargetEventListenerOptions | boolean
790
+ options?: EventTargetEventListenerOptions | boolean,
560
791
  ): void;
792
+ /**
793
+ * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
794
+ *
795
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
796
+ */
561
797
  dispatchEvent(event: EventMap[keyof EventMap]): boolean;
562
798
  }
563
799
  export interface EventTargetEventListenerOptions {
@@ -574,15 +810,38 @@ export interface EventTargetHandlerObject {
574
810
  }
575
811
  export declare class AbortController {
576
812
  constructor();
813
+ /**
814
+ * Returns the AbortSignal object associated with this object.
815
+ *
816
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
817
+ */
577
818
  get signal(): AbortSignal;
819
+ /**
820
+ * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
821
+ *
822
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
823
+ */
578
824
  abort(reason?: any): void;
579
825
  }
580
826
  export declare abstract class AbortSignal extends EventTarget {
827
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */
581
828
  static abort(reason?: any): AbortSignal;
829
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */
582
830
  static timeout(delay: number): AbortSignal;
583
831
  static any(signals: AbortSignal[]): AbortSignal;
832
+ /**
833
+ * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
834
+ *
835
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
836
+ */
584
837
  get aborted(): boolean;
838
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */
585
839
  get reason(): any;
840
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
841
+ get onabort(): any | null;
842
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
843
+ set onabort(value: any | null);
844
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */
586
845
  throwIfAborted(): void;
587
846
  }
588
847
  export interface Scheduler {
@@ -592,18 +851,40 @@ export interface SchedulerWaitOptions {
592
851
  signal?: AbortSignal;
593
852
  }
594
853
  export declare abstract class ExtendableEvent extends Event {
854
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) */
595
855
  waitUntil(promise: Promise<any>): void;
596
856
  }
857
+ export declare class CustomEvent<T = any> extends Event {
858
+ constructor(type: string, init?: CustomEventCustomEventInit);
859
+ /**
860
+ * Returns any custom data event was created with. Typically used for synthetic events.
861
+ *
862
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
863
+ */
864
+ get detail(): T;
865
+ }
866
+ export interface CustomEventCustomEventInit {
867
+ bubbles?: boolean;
868
+ cancelable?: boolean;
869
+ composed?: boolean;
870
+ detail?: any;
871
+ }
597
872
  export declare class Blob {
598
873
  constructor(
599
874
  bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[],
600
- options?: BlobOptions
875
+ options?: BlobOptions,
601
876
  );
877
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
602
878
  get size(): number;
879
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
603
880
  get type(): string;
881
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
604
882
  slice(start?: number, end?: number, type?: string): Blob;
883
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */
605
884
  arrayBuffer(): Promise<ArrayBuffer>;
885
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
606
886
  text(): Promise<string>;
887
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */
607
888
  stream(): ReadableStream;
608
889
  }
609
890
  export interface BlobOptions {
@@ -613,9 +894,11 @@ export declare class File extends Blob {
613
894
  constructor(
614
895
  bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined,
615
896
  name: string,
616
- options?: FileOptions
897
+ options?: FileOptions,
617
898
  );
899
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
618
900
  get name(): string;
901
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
619
902
  get lastModified(): number;
620
903
  }
621
904
  export interface FileOptions {
@@ -623,6 +906,7 @@ export interface FileOptions {
623
906
  lastModified?: number;
624
907
  }
625
908
  export declare abstract class CacheStorage {
909
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */
626
910
  open(cacheName: string): Promise<Cache>;
627
911
  readonly default: Cache;
628
912
  }
@@ -630,7 +914,7 @@ export declare abstract class Cache {
630
914
  delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
631
915
  match(
632
916
  request: RequestInfo,
633
- options?: CacheQueryOptions
917
+ options?: CacheQueryOptions,
634
918
  ): Promise<Response | undefined>;
635
919
  put(request: RequestInfo, response: Response): Promise<void>;
636
920
  }
@@ -638,7 +922,13 @@ export interface CacheQueryOptions {
638
922
  ignoreMethod?: boolean;
639
923
  }
640
924
  export declare abstract class Crypto {
925
+ /**
926
+ * Available only in secure contexts.
927
+ *
928
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
929
+ */
641
930
  get subtle(): SubtleCrypto;
931
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
642
932
  getRandomValues<
643
933
  T extends
644
934
  | Int8Array
@@ -648,8 +938,13 @@ export declare abstract class Crypto {
648
938
  | Int32Array
649
939
  | Uint32Array
650
940
  | BigInt64Array
651
- | BigUint64Array
941
+ | BigUint64Array,
652
942
  >(buffer: T): T;
943
+ /**
944
+ * Available only in secure contexts.
945
+ *
946
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
947
+ */
653
948
  randomUUID(): string;
654
949
  DigestStream: typeof DigestStream;
655
950
  }
@@ -657,59 +952,63 @@ export declare abstract class SubtleCrypto {
657
952
  encrypt(
658
953
  algorithm: string | SubtleCryptoEncryptAlgorithm,
659
954
  key: CryptoKey,
660
- plainText: ArrayBuffer | ArrayBufferView
955
+ plainText: ArrayBuffer | ArrayBufferView,
661
956
  ): Promise<ArrayBuffer>;
662
957
  decrypt(
663
958
  algorithm: string | SubtleCryptoEncryptAlgorithm,
664
959
  key: CryptoKey,
665
- cipherText: ArrayBuffer | ArrayBufferView
960
+ cipherText: ArrayBuffer | ArrayBufferView,
666
961
  ): Promise<ArrayBuffer>;
667
962
  sign(
668
963
  algorithm: string | SubtleCryptoSignAlgorithm,
669
964
  key: CryptoKey,
670
- data: ArrayBuffer | ArrayBufferView
965
+ data: ArrayBuffer | ArrayBufferView,
671
966
  ): Promise<ArrayBuffer>;
672
967
  verify(
673
968
  algorithm: string | SubtleCryptoSignAlgorithm,
674
969
  key: CryptoKey,
675
970
  signature: ArrayBuffer | ArrayBufferView,
676
- data: ArrayBuffer | ArrayBufferView
971
+ data: ArrayBuffer | ArrayBufferView,
677
972
  ): Promise<boolean>;
678
973
  digest(
679
974
  algorithm: string | SubtleCryptoHashAlgorithm,
680
- data: ArrayBuffer | ArrayBufferView
975
+ data: ArrayBuffer | ArrayBufferView,
681
976
  ): Promise<ArrayBuffer>;
977
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
682
978
  generateKey(
683
979
  algorithm: string | SubtleCryptoGenerateKeyAlgorithm,
684
980
  extractable: boolean,
685
- keyUsages: string[]
981
+ keyUsages: string[],
686
982
  ): Promise<CryptoKey | CryptoKeyPair>;
983
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
687
984
  deriveKey(
688
985
  algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
689
986
  baseKey: CryptoKey,
690
987
  derivedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
691
988
  extractable: boolean,
692
- keyUsages: string[]
989
+ keyUsages: string[],
693
990
  ): Promise<CryptoKey>;
694
991
  deriveBits(
695
992
  algorithm: string | SubtleCryptoDeriveKeyAlgorithm,
696
993
  baseKey: CryptoKey,
697
- length: number | null
994
+ length: number | null,
698
995
  ): Promise<ArrayBuffer>;
996
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
699
997
  importKey(
700
998
  format: string,
701
999
  keyData: (ArrayBuffer | ArrayBufferView) | JsonWebKey,
702
1000
  algorithm: string | SubtleCryptoImportKeyAlgorithm,
703
1001
  extractable: boolean,
704
- keyUsages: string[]
1002
+ keyUsages: string[],
705
1003
  ): Promise<CryptoKey>;
706
1004
  exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
707
1005
  wrapKey(
708
1006
  format: string,
709
1007
  key: CryptoKey,
710
1008
  wrappingKey: CryptoKey,
711
- wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm
1009
+ wrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
712
1010
  ): Promise<ArrayBuffer>;
1011
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
713
1012
  unwrapKey(
714
1013
  format: string,
715
1014
  wrappedKey: ArrayBuffer | ArrayBufferView,
@@ -717,16 +1016,19 @@ export declare abstract class SubtleCrypto {
717
1016
  unwrapAlgorithm: string | SubtleCryptoEncryptAlgorithm,
718
1017
  unwrappedKeyAlgorithm: string | SubtleCryptoImportKeyAlgorithm,
719
1018
  extractable: boolean,
720
- keyUsages: string[]
1019
+ keyUsages: string[],
721
1020
  ): Promise<CryptoKey>;
722
1021
  timingSafeEqual(
723
1022
  a: ArrayBuffer | ArrayBufferView,
724
- b: ArrayBuffer | ArrayBufferView
1023
+ b: ArrayBuffer | ArrayBufferView,
725
1024
  ): boolean;
726
1025
  }
727
1026
  export declare abstract class CryptoKey {
1027
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
728
1028
  readonly type: string;
1029
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
729
1030
  readonly extractable: boolean;
1031
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
730
1032
  readonly algorithm:
731
1033
  | CryptoKeyKeyAlgorithm
732
1034
  | CryptoKeyAesKeyAlgorithm
@@ -734,6 +1036,7 @@ export declare abstract class CryptoKey {
734
1036
  | CryptoKeyRsaKeyAlgorithm
735
1037
  | CryptoKeyEllipticKeyAlgorithm
736
1038
  | CryptoKeyArbitraryKeyAlgorithm;
1039
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
737
1040
  readonly usages: string[];
738
1041
  }
739
1042
  export interface CryptoKeyPair {
@@ -821,7 +1124,7 @@ export interface CryptoKeyHmacKeyAlgorithm {
821
1124
  export interface CryptoKeyRsaKeyAlgorithm {
822
1125
  name: string;
823
1126
  modulusLength: number;
824
- publicExponent: ArrayBuffer;
1127
+ publicExponent: ArrayBuffer | (ArrayBuffer | ArrayBufferView);
825
1128
  hash?: CryptoKeyKeyAlgorithm;
826
1129
  }
827
1130
  export interface CryptoKeyEllipticKeyAlgorithm {
@@ -842,9 +1145,24 @@ export declare class DigestStream extends WritableStream<
842
1145
  }
843
1146
  export declare class TextDecoder {
844
1147
  constructor(decoder?: string, options?: TextDecoderConstructorOptions);
1148
+ /**
1149
+ * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
1150
+ *
1151
+ * ```
1152
+ * var string = "", decoder = new TextDecoder(encoding), buffer;
1153
+ * while(buffer = next_chunk()) {
1154
+ * string += decoder.decode(buffer, {stream:true});
1155
+ * }
1156
+ * string += decoder.decode(); // end-of-queue
1157
+ * ```
1158
+ *
1159
+ * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
1160
+ *
1161
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
1162
+ */
845
1163
  decode(
846
1164
  input?: ArrayBuffer | ArrayBufferView,
847
- options?: TextDecoderDecodeOptions
1165
+ options?: TextDecoderDecodeOptions,
848
1166
  ): string;
849
1167
  get encoding(): string;
850
1168
  get fatal(): boolean;
@@ -852,8 +1170,21 @@ export declare class TextDecoder {
852
1170
  }
853
1171
  export declare class TextEncoder {
854
1172
  constructor();
1173
+ /**
1174
+ * Returns the result of running UTF-8's encoder.
1175
+ *
1176
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encode)
1177
+ */
855
1178
  encode(input?: string): Uint8Array;
856
- encodeInto(input: string, buffer: Uint8Array): TextEncoderEncodeIntoResult;
1179
+ /**
1180
+ * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.
1181
+ *
1182
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextEncoder/encodeInto)
1183
+ */
1184
+ encodeInto(
1185
+ input: string,
1186
+ buffer: ArrayBuffer | ArrayBufferView,
1187
+ ): TextEncoderEncodeIntoResult;
857
1188
  get encoding(): string;
858
1189
  }
859
1190
  export interface TextDecoderConstructorOptions {
@@ -877,17 +1208,20 @@ export declare class FormData {
877
1208
  has(name: string): boolean;
878
1209
  set(name: string, value: string): void;
879
1210
  set(name: string, value: Blob, filename?: string): void;
1211
+ /** Returns an array of key, value pairs for every entry in the list. */
880
1212
  entries(): IterableIterator<[key: string, value: File | string]>;
1213
+ /** Returns a list of keys in the list. */
881
1214
  keys(): IterableIterator<string>;
1215
+ /** Returns a list of values in the list. */
882
1216
  values(): IterableIterator<File | string>;
883
1217
  forEach<This = unknown>(
884
1218
  callback: (
885
1219
  this: This,
886
1220
  value: File | string,
887
1221
  key: string,
888
- parent: FormData
1222
+ parent: FormData,
889
1223
  ) => void,
890
- thisArg?: This
1224
+ thisArg?: This,
891
1225
  ): void;
892
1226
  [Symbol.iterator](): IterableIterator<[key: string, value: File | string]>;
893
1227
  }
@@ -898,7 +1232,7 @@ export declare class HTMLRewriter {
898
1232
  constructor();
899
1233
  on(
900
1234
  selector: string,
901
- handlers: HTMLRewriterElementContentHandlers
1235
+ handlers: HTMLRewriterElementContentHandlers,
902
1236
  ): HTMLRewriter;
903
1237
  onDocument(handlers: HTMLRewriterDocumentContentHandlers): HTMLRewriter;
904
1238
  transform(response: Response): Response;
@@ -965,7 +1299,9 @@ export interface DocumentEnd {
965
1299
  append(content: string, options?: ContentOptions): DocumentEnd;
966
1300
  }
967
1301
  export declare abstract class FetchEvent extends ExtendableEvent {
1302
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/request) */
968
1303
  readonly request: Request;
1304
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FetchEvent/respondWith) */
969
1305
  respondWith(promise: Response | Promise<Response>): void;
970
1306
  passThroughOnException(): void;
971
1307
  }
@@ -983,10 +1319,13 @@ export declare class Headers {
983
1319
  delete(name: string): void;
984
1320
  forEach<This = unknown>(
985
1321
  callback: (this: This, value: string, key: string, parent: Headers) => void,
986
- thisArg?: This
1322
+ thisArg?: This,
987
1323
  ): void;
1324
+ /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
988
1325
  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. */
989
1327
  keys(): IterableIterator<string>;
1328
+ /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
990
1329
  values(): IterableIterator<string>;
991
1330
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
992
1331
  }
@@ -1009,14 +1348,23 @@ export declare abstract class Body {
1009
1348
  }
1010
1349
  export declare class Response extends Body {
1011
1350
  constructor(body?: BodyInit | null, init?: ResponseInit);
1351
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
1012
1352
  static redirect(url: string, status?: number): Response;
1353
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
1013
1354
  static json(any: any, maybeInit?: ResponseInit | Response): Response;
1355
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
1014
1356
  clone(): Response;
1357
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
1015
1358
  get status(): number;
1359
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
1016
1360
  get statusText(): string;
1361
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
1017
1362
  get headers(): Headers;
1363
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
1018
1364
  get ok(): boolean;
1365
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
1019
1366
  get redirected(): boolean;
1367
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
1020
1368
  get url(): string;
1021
1369
  get webSocket(): WebSocket | null;
1022
1370
  get cf(): any | undefined;
@@ -1031,22 +1379,58 @@ export interface ResponseInit {
1031
1379
  }
1032
1380
  export type RequestInfo<
1033
1381
  CfHostMetadata = unknown,
1034
- Cf = CfProperties<CfHostMetadata>
1382
+ Cf = CfProperties<CfHostMetadata>,
1035
1383
  > = Request<CfHostMetadata, Cf> | string | URL;
1036
1384
  export declare class Request<
1037
1385
  CfHostMetadata = unknown,
1038
- Cf = CfProperties<CfHostMetadata>
1386
+ Cf = CfProperties<CfHostMetadata>,
1039
1387
  > extends Body {
1040
1388
  constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
1389
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
1041
1390
  clone(): Request<CfHostMetadata, Cf>;
1391
+ /**
1392
+ * Returns request's HTTP method, which is "GET" by default.
1393
+ *
1394
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
1395
+ */
1042
1396
  get method(): string;
1397
+ /**
1398
+ * Returns the URL of request as a string.
1399
+ *
1400
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
1401
+ */
1043
1402
  get url(): string;
1403
+ /**
1404
+ * 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
+ *
1406
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
1407
+ */
1044
1408
  get headers(): Headers;
1409
+ /**
1410
+ * 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
+ *
1412
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
1413
+ */
1045
1414
  get redirect(): string;
1046
1415
  get fetcher(): Fetcher | null;
1416
+ /**
1417
+ * 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
+ *
1419
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
1420
+ */
1047
1421
  get signal(): AbortSignal;
1048
1422
  get cf(): Cf | undefined;
1423
+ /**
1424
+ * 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
+ *
1426
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
1427
+ */
1049
1428
  get integrity(): string;
1429
+ /**
1430
+ * Returns a boolean indicating whether or not request can outlive the global in which it was created.
1431
+ *
1432
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1433
+ */
1050
1434
  get keepalive(): boolean;
1051
1435
  }
1052
1436
  export interface RequestInit<Cf = CfProperties> {
@@ -1065,10 +1449,18 @@ export interface RequestInit<Cf = CfProperties> {
1065
1449
  /** An AbortSignal to set request's signal. */
1066
1450
  signal?: AbortSignal | null;
1067
1451
  }
1068
- export declare abstract class Fetcher {
1452
+ export type Service<
1453
+ T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
1454
+ > = Fetcher<T>;
1455
+ export type Fetcher<
1456
+ T extends Rpc.EntrypointBranded | undefined = undefined,
1457
+ Reserved extends string = never,
1458
+ > = (T extends Rpc.EntrypointBranded
1459
+ ? Rpc.Provider<T, Reserved | "fetch" | "connect">
1460
+ : unknown) & {
1069
1461
  fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
1070
1462
  connect(address: SocketAddress | string, options?: SocketOptions): Socket;
1071
- }
1463
+ };
1072
1464
  export interface FetcherPutOptions {
1073
1465
  expiration?: number;
1074
1466
  expirationTtl?: number;
@@ -1083,82 +1475,84 @@ export type KVNamespaceListResult<Metadata, Key extends string = string> =
1083
1475
  list_complete: false;
1084
1476
  keys: KVNamespaceListKey<Metadata, Key>[];
1085
1477
  cursor: string;
1478
+ cacheStatus: string | null;
1086
1479
  }
1087
1480
  | {
1088
1481
  list_complete: true;
1089
1482
  keys: KVNamespaceListKey<Metadata, Key>[];
1483
+ cacheStatus: string | null;
1090
1484
  };
1091
1485
  export interface KVNamespace<Key extends string = string> {
1092
1486
  get(
1093
1487
  key: Key,
1094
- options?: Partial<KVNamespaceGetOptions<undefined>>
1488
+ options?: Partial<KVNamespaceGetOptions<undefined>>,
1095
1489
  ): Promise<string | null>;
1096
1490
  get(key: Key, type: "text"): Promise<string | null>;
1097
1491
  get<ExpectedValue = unknown>(
1098
1492
  key: Key,
1099
- type: "json"
1493
+ type: "json",
1100
1494
  ): Promise<ExpectedValue | null>;
1101
1495
  get(key: Key, type: "arrayBuffer"): Promise<ArrayBuffer | null>;
1102
1496
  get(key: Key, type: "stream"): Promise<ReadableStream | null>;
1103
1497
  get(
1104
1498
  key: Key,
1105
- options?: KVNamespaceGetOptions<"text">
1499
+ options?: KVNamespaceGetOptions<"text">,
1106
1500
  ): Promise<string | null>;
1107
1501
  get<ExpectedValue = unknown>(
1108
1502
  key: Key,
1109
- options?: KVNamespaceGetOptions<"json">
1503
+ options?: KVNamespaceGetOptions<"json">,
1110
1504
  ): Promise<ExpectedValue | null>;
1111
1505
  get(
1112
1506
  key: Key,
1113
- options?: KVNamespaceGetOptions<"arrayBuffer">
1507
+ options?: KVNamespaceGetOptions<"arrayBuffer">,
1114
1508
  ): Promise<ArrayBuffer | null>;
1115
1509
  get(
1116
1510
  key: Key,
1117
- options?: KVNamespaceGetOptions<"stream">
1511
+ options?: KVNamespaceGetOptions<"stream">,
1118
1512
  ): Promise<ReadableStream | null>;
1119
1513
  list<Metadata = unknown>(
1120
- options?: KVNamespaceListOptions
1514
+ options?: KVNamespaceListOptions,
1121
1515
  ): Promise<KVNamespaceListResult<Metadata, Key>>;
1122
1516
  put(
1123
1517
  key: Key,
1124
1518
  value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
1125
- options?: KVNamespacePutOptions
1519
+ options?: KVNamespacePutOptions,
1126
1520
  ): Promise<void>;
1127
1521
  getWithMetadata<Metadata = unknown>(
1128
1522
  key: Key,
1129
- options?: Partial<KVNamespaceGetOptions<undefined>>
1523
+ options?: Partial<KVNamespaceGetOptions<undefined>>,
1130
1524
  ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1131
1525
  getWithMetadata<Metadata = unknown>(
1132
1526
  key: Key,
1133
- type: "text"
1527
+ type: "text",
1134
1528
  ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1135
1529
  getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
1136
1530
  key: Key,
1137
- type: "json"
1531
+ type: "json",
1138
1532
  ): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1139
1533
  getWithMetadata<Metadata = unknown>(
1140
1534
  key: Key,
1141
- type: "arrayBuffer"
1535
+ type: "arrayBuffer",
1142
1536
  ): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1143
1537
  getWithMetadata<Metadata = unknown>(
1144
1538
  key: Key,
1145
- type: "stream"
1539
+ type: "stream",
1146
1540
  ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1147
1541
  getWithMetadata<Metadata = unknown>(
1148
1542
  key: Key,
1149
- options: KVNamespaceGetOptions<"text">
1543
+ options: KVNamespaceGetOptions<"text">,
1150
1544
  ): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
1151
1545
  getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
1152
1546
  key: Key,
1153
- options: KVNamespaceGetOptions<"json">
1547
+ options: KVNamespaceGetOptions<"json">,
1154
1548
  ): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
1155
1549
  getWithMetadata<Metadata = unknown>(
1156
1550
  key: Key,
1157
- options: KVNamespaceGetOptions<"arrayBuffer">
1551
+ options: KVNamespaceGetOptions<"arrayBuffer">,
1158
1552
  ): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
1159
1553
  getWithMetadata<Metadata = unknown>(
1160
1554
  key: Key,
1161
- options: KVNamespaceGetOptions<"stream">
1555
+ options: KVNamespaceGetOptions<"stream">,
1162
1556
  ): Promise<KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>>;
1163
1557
  delete(key: Key): Promise<void>;
1164
1558
  }
@@ -1179,32 +1573,49 @@ export interface KVNamespacePutOptions {
1179
1573
  export interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
1180
1574
  value: Value | null;
1181
1575
  metadata: Metadata | null;
1576
+ cacheStatus: string | null;
1577
+ }
1578
+ export type QueueContentType = "text" | "bytes" | "json" | "v8";
1579
+ export interface Queue<Body = unknown> {
1580
+ send(message: Body, options?: QueueSendOptions): Promise<void>;
1581
+ sendBatch(
1582
+ messages: Iterable<MessageSendRequest<Body>>,
1583
+ options?: QueueSendBatchOptions,
1584
+ ): Promise<void>;
1182
1585
  }
1183
- export interface Queue<Body> {
1184
- send(message: Body): Promise<void>;
1185
- sendBatch(messages: Iterable<MessageSendRequest<Body>>): Promise<void>;
1586
+ export interface QueueSendOptions {
1587
+ contentType?: QueueContentType;
1588
+ delaySeconds?: number;
1589
+ }
1590
+ export interface QueueSendBatchOptions {
1591
+ delaySeconds?: number;
1186
1592
  }
1187
- export interface QueueSendOptions {}
1188
1593
  export interface MessageSendRequest<Body = unknown> {
1189
1594
  body: Body;
1595
+ contentType?: QueueContentType;
1596
+ delaySeconds?: number;
1597
+ }
1598
+ export interface QueueRetryOptions {
1599
+ delaySeconds?: number;
1190
1600
  }
1191
1601
  export interface Message<Body = unknown> {
1192
1602
  readonly id: string;
1193
1603
  readonly timestamp: Date;
1194
1604
  readonly body: Body;
1195
- retry(): void;
1605
+ readonly attempts: number;
1606
+ retry(options?: QueueRetryOptions): void;
1196
1607
  ack(): void;
1197
1608
  }
1198
1609
  export interface QueueEvent<Body = unknown> extends ExtendableEvent {
1199
1610
  readonly messages: readonly Message<Body>[];
1200
1611
  readonly queue: string;
1201
- retryAll(): void;
1612
+ retryAll(options?: QueueRetryOptions): void;
1202
1613
  ackAll(): void;
1203
1614
  }
1204
1615
  export interface MessageBatch<Body = unknown> {
1205
1616
  readonly messages: readonly Message<Body>[];
1206
1617
  readonly queue: string;
1207
- retryAll(): void;
1618
+ retryAll(options?: QueueRetryOptions): void;
1208
1619
  ackAll(): void;
1209
1620
  }
1210
1621
  export interface R2Error extends Error {
@@ -1228,7 +1639,7 @@ export declare abstract class R2Bucket {
1228
1639
  key: string,
1229
1640
  options: R2GetOptions & {
1230
1641
  onlyIf: R2Conditional | Headers;
1231
- }
1642
+ },
1232
1643
  ): Promise<R2ObjectBody | R2Object | null>;
1233
1644
  get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
1234
1645
  put(
@@ -1240,8 +1651,10 @@ export declare abstract class R2Bucket {
1240
1651
  | string
1241
1652
  | null
1242
1653
  | Blob,
1243
- options?: R2PutOptions
1244
- ): Promise<R2Object>;
1654
+ options?: R2PutOptions & {
1655
+ onlyIf: R2Conditional | Headers;
1656
+ },
1657
+ ): Promise<R2Object | null>;
1245
1658
  put(
1246
1659
  key: string,
1247
1660
  value:
@@ -1251,13 +1664,11 @@ export declare abstract class R2Bucket {
1251
1664
  | string
1252
1665
  | null
1253
1666
  | Blob,
1254
- options?: R2PutOptions & {
1255
- onlyIf: R2Conditional | Headers;
1256
- }
1257
- ): Promise<R2Object | null>;
1667
+ options?: R2PutOptions,
1668
+ ): Promise<R2Object>;
1258
1669
  createMultipartUpload(
1259
1670
  key: string,
1260
- options?: R2MultipartOptions
1671
+ options?: R2MultipartOptions,
1261
1672
  ): Promise<R2MultipartUpload>;
1262
1673
  resumeMultipartUpload(key: string, uploadId: string): R2MultipartUpload;
1263
1674
  delete(keys: string | string[]): Promise<void>;
@@ -1268,7 +1679,7 @@ export interface R2MultipartUpload {
1268
1679
  readonly uploadId: string;
1269
1680
  uploadPart(
1270
1681
  partNumber: number,
1271
- value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob
1682
+ value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
1272
1683
  ): Promise<R2UploadedPart>;
1273
1684
  abort(): Promise<void>;
1274
1685
  complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
@@ -1288,6 +1699,7 @@ export declare abstract class R2Object {
1288
1699
  readonly httpMetadata?: R2HTTPMetadata;
1289
1700
  readonly customMetadata?: Record<string, string>;
1290
1701
  readonly range?: R2Range;
1702
+ readonly storageClass: string;
1291
1703
  writeHttpMetadata(headers: Headers): void;
1292
1704
  }
1293
1705
  export interface R2ObjectBody extends R2Object {
@@ -1330,10 +1742,12 @@ export interface R2PutOptions {
1330
1742
  sha256?: ArrayBuffer | string;
1331
1743
  sha384?: ArrayBuffer | string;
1332
1744
  sha512?: ArrayBuffer | string;
1745
+ storageClass?: string;
1333
1746
  }
1334
1747
  export interface R2MultipartOptions {
1335
1748
  httpMetadata?: R2HTTPMetadata | Headers;
1336
1749
  customMetadata?: Record<string, string>;
1750
+ storageClass?: string;
1337
1751
  }
1338
1752
  export interface R2Checksums {
1339
1753
  readonly md5?: ArrayBuffer;
@@ -1389,7 +1803,7 @@ export interface UnderlyingSink<W = any> {
1389
1803
  start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
1390
1804
  write?: (
1391
1805
  chunk: W,
1392
- controller: WritableStreamDefaultController
1806
+ controller: WritableStreamDefaultController,
1393
1807
  ) => void | Promise<void>;
1394
1808
  abort?: (reason: any) => void | Promise<void>;
1395
1809
  close?: () => void | Promise<void>;
@@ -1404,26 +1818,29 @@ export interface UnderlyingByteSource {
1404
1818
  export interface UnderlyingSource<R = any> {
1405
1819
  type?: "" | undefined;
1406
1820
  start?: (
1407
- controller: ReadableStreamDefaultController<R>
1821
+ controller: ReadableStreamDefaultController<R>,
1408
1822
  ) => void | Promise<void>;
1409
1823
  pull?: (
1410
- controller: ReadableStreamDefaultController<R>
1824
+ controller: ReadableStreamDefaultController<R>,
1411
1825
  ) => void | Promise<void>;
1412
1826
  cancel?: (reason: any) => void | Promise<void>;
1827
+ expectedLength?: number | bigint;
1413
1828
  }
1414
1829
  export interface Transformer<I = any, O = any> {
1415
1830
  readableType?: string;
1416
1831
  writableType?: string;
1417
1832
  start?: (
1418
- controller: TransformStreamDefaultController<O>
1833
+ controller: TransformStreamDefaultController<O>,
1419
1834
  ) => void | Promise<void>;
1420
1835
  transform?: (
1421
1836
  chunk: I,
1422
- controller: TransformStreamDefaultController<O>
1837
+ controller: TransformStreamDefaultController<O>,
1423
1838
  ) => void | Promise<void>;
1424
1839
  flush?: (
1425
- controller: TransformStreamDefaultController<O>
1840
+ controller: TransformStreamDefaultController<O>,
1426
1841
  ) => void | Promise<void>;
1842
+ cancel?: (reason: any) => void | Promise<void>;
1843
+ expectedLength?: number;
1427
1844
  }
1428
1845
  export interface StreamPipeOptions {
1429
1846
  /**
@@ -1457,88 +1874,137 @@ export type ReadableStreamReadResult<R = any> =
1457
1874
  done: true;
1458
1875
  value?: undefined;
1459
1876
  };
1460
- /** 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. */
1877
+ /**
1878
+ * 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.
1879
+ *
1880
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream)
1881
+ */
1461
1882
  export interface ReadableStream<R = any> {
1883
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/locked) */
1462
1884
  get locked(): boolean;
1885
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel) */
1463
1886
  cancel(reason?: any): Promise<void>;
1887
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1464
1888
  getReader(): ReadableStreamDefaultReader<R>;
1889
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader) */
1465
1890
  getReader(options: ReadableStreamGetReaderOptions): ReadableStreamBYOBReader;
1891
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough) */
1466
1892
  pipeThrough<T>(
1467
1893
  transform: ReadableWritablePair<T, R>,
1468
- options?: StreamPipeOptions
1894
+ options?: StreamPipeOptions,
1469
1895
  ): ReadableStream<T>;
1896
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo) */
1470
1897
  pipeTo(
1471
1898
  destination: WritableStream<R>,
1472
- options?: StreamPipeOptions
1899
+ options?: StreamPipeOptions,
1473
1900
  ): Promise<void>;
1901
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee) */
1474
1902
  tee(): [ReadableStream<R>, ReadableStream<R>];
1475
1903
  values(options?: ReadableStreamValuesOptions): AsyncIterableIterator<R>;
1476
1904
  [Symbol.asyncIterator](
1477
- options?: ReadableStreamValuesOptions
1905
+ options?: ReadableStreamValuesOptions,
1478
1906
  ): AsyncIterableIterator<R>;
1479
1907
  }
1480
1908
  export declare const ReadableStream: {
1481
1909
  prototype: ReadableStream;
1482
1910
  new (
1483
1911
  underlyingSource: UnderlyingByteSource,
1484
- strategy?: QueuingStrategy<Uint8Array>
1912
+ strategy?: QueuingStrategy<Uint8Array>,
1485
1913
  ): ReadableStream<Uint8Array>;
1486
1914
  new <R = any>(
1487
1915
  underlyingSource?: UnderlyingSource<R>,
1488
- strategy?: QueuingStrategy<R>
1916
+ strategy?: QueuingStrategy<R>,
1489
1917
  ): ReadableStream<R>;
1490
1918
  };
1491
1919
  export declare class ReadableStreamDefaultReader<R = any> {
1492
1920
  constructor(stream: ReadableStream);
1493
1921
  get closed(): Promise<void>;
1494
1922
  cancel(reason?: any): Promise<void>;
1923
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/read) */
1495
1924
  read(): Promise<ReadableStreamReadResult<R>>;
1925
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock) */
1496
1926
  releaseLock(): void;
1497
1927
  }
1498
1928
  export declare class ReadableStreamBYOBReader {
1499
1929
  constructor(stream: ReadableStream);
1500
1930
  get closed(): Promise<void>;
1501
1931
  cancel(reason?: any): Promise<void>;
1932
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
1502
1933
  read<T extends ArrayBufferView>(
1503
- view: T
1934
+ view: T,
1504
1935
  ): Promise<ReadableStreamReadResult<T>>;
1936
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
1505
1937
  releaseLock(): void;
1506
1938
  readAtLeast<T extends ArrayBufferView>(
1507
1939
  minElements: number,
1508
- view: T
1940
+ view: T,
1509
1941
  ): Promise<ReadableStreamReadResult<T>>;
1510
1942
  }
1943
+ export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
1944
+ min?: number;
1945
+ }
1511
1946
  export interface ReadableStreamGetReaderOptions {
1947
+ /**
1948
+ * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
1949
+ *
1950
+ * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
1951
+ */
1512
1952
  mode: "byob";
1513
1953
  }
1954
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
1514
1955
  export interface ReadableStreamBYOBRequest {
1515
- readonly view: Uint8Array | null;
1956
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
1957
+ get view(): Uint8Array | null;
1958
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
1516
1959
  respond(bytesWritten: number): void;
1960
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
1517
1961
  respondWithNewView(view: ArrayBuffer | ArrayBufferView): void;
1518
- readonly atLeast: number | null;
1962
+ get atLeast(): number | null;
1519
1963
  }
1964
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController) */
1520
1965
  export interface ReadableStreamDefaultController<R = any> {
1521
- readonly desiredSize: number | null;
1966
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/desiredSize) */
1967
+ get desiredSize(): number | null;
1968
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/close) */
1522
1969
  close(): void;
1970
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/enqueue) */
1523
1971
  enqueue(chunk?: R): void;
1972
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultController/error) */
1524
1973
  error(reason: any): void;
1525
1974
  }
1975
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController) */
1526
1976
  export interface ReadableByteStreamController {
1527
- readonly byobRequest: ReadableStreamBYOBRequest | null;
1528
- readonly desiredSize: number | null;
1977
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/byobRequest) */
1978
+ get byobRequest(): ReadableStreamBYOBRequest | null;
1979
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/desiredSize) */
1980
+ get desiredSize(): number | null;
1981
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/close) */
1529
1982
  close(): void;
1983
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/enqueue) */
1530
1984
  enqueue(chunk: ArrayBuffer | ArrayBufferView): void;
1985
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableByteStreamController/error) */
1531
1986
  error(reason: any): void;
1532
1987
  }
1533
- /** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */
1988
+ /**
1989
+ * This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.
1990
+ *
1991
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController)
1992
+ */
1534
1993
  export interface WritableStreamDefaultController {
1535
- readonly signal: AbortSignal;
1994
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/signal) */
1995
+ get signal(): AbortSignal;
1996
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error) */
1536
1997
  error(reason?: any): void;
1537
1998
  }
1999
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController) */
1538
2000
  export interface TransformStreamDefaultController<O = any> {
2001
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/desiredSize) */
1539
2002
  get desiredSize(): number | null;
2003
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/enqueue) */
1540
2004
  enqueue(chunk?: O): void;
2005
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/error) */
1541
2006
  error(reason: any): void;
2007
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStreamDefaultController/terminate) */
1542
2008
  terminate(): void;
1543
2009
  }
1544
2010
  export interface ReadableWritablePair<R = any, W = any> {
@@ -1553,36 +2019,49 @@ export interface ReadableWritablePair<R = any, W = any> {
1553
2019
  export declare class WritableStream<W = any> {
1554
2020
  constructor(
1555
2021
  underlyingSink?: UnderlyingSink,
1556
- queuingStrategy?: QueuingStrategy
2022
+ queuingStrategy?: QueuingStrategy,
1557
2023
  );
2024
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/locked) */
1558
2025
  get locked(): boolean;
2026
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/abort) */
1559
2027
  abort(reason?: any): Promise<void>;
2028
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/close) */
1560
2029
  close(): Promise<void>;
2030
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter) */
1561
2031
  getWriter(): WritableStreamDefaultWriter<W>;
1562
2032
  }
1563
2033
  export declare class WritableStreamDefaultWriter<W = any> {
1564
2034
  constructor(stream: WritableStream);
2035
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/closed) */
1565
2036
  get closed(): Promise<void>;
2037
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/ready) */
1566
2038
  get ready(): Promise<void>;
2039
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/desiredSize) */
1567
2040
  get desiredSize(): number | null;
2041
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/abort) */
1568
2042
  abort(reason?: any): Promise<void>;
2043
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/close) */
1569
2044
  close(): Promise<void>;
2045
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/write) */
1570
2046
  write(chunk?: W): Promise<void>;
2047
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock) */
1571
2048
  releaseLock(): void;
1572
2049
  }
1573
2050
  export declare class TransformStream<I = any, O = any> {
1574
2051
  constructor(
1575
2052
  transformer?: Transformer<I, O>,
1576
2053
  writableStrategy?: QueuingStrategy<I>,
1577
- readableStrategy?: QueuingStrategy<O>
2054
+ readableStrategy?: QueuingStrategy<O>,
1578
2055
  );
2056
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/readable) */
1579
2057
  get readable(): ReadableStream<O>;
2058
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransformStream/writable) */
1580
2059
  get writable(): WritableStream<I>;
1581
2060
  }
1582
2061
  export declare class FixedLengthStream extends IdentityTransformStream {
1583
2062
  constructor(
1584
2063
  expectedLength: number | bigint,
1585
- queuingStrategy?: IdentityTransformStreamQueuingStrategy
2064
+ queuingStrategy?: IdentityTransformStreamQueuingStrategy,
1586
2065
  );
1587
2066
  }
1588
2067
  export declare class IdentityTransformStream extends TransformStream<
@@ -1614,26 +2093,35 @@ export declare class TextEncoderStream extends TransformStream<
1614
2093
  Uint8Array
1615
2094
  > {
1616
2095
  constructor();
2096
+ get encoding(): string;
1617
2097
  }
1618
2098
  export declare class TextDecoderStream extends TransformStream<
1619
2099
  ArrayBuffer | ArrayBufferView,
1620
2100
  string
1621
2101
  > {
1622
2102
  constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
2103
+ get encoding(): string;
2104
+ get fatal(): boolean;
2105
+ get ignoreBOM(): boolean;
1623
2106
  }
1624
2107
  export interface TextDecoderStreamTextDecoderStreamInit {
1625
2108
  fatal?: boolean;
2109
+ ignoreBOM?: boolean;
1626
2110
  }
1627
2111
  export declare class ByteLengthQueuingStrategy
1628
2112
  implements QueuingStrategy<ArrayBufferView>
1629
2113
  {
1630
2114
  constructor(init: QueuingStrategyInit);
2115
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */
1631
2116
  get highWaterMark(): number;
2117
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */
1632
2118
  get size(): (chunk?: any) => number;
1633
2119
  }
1634
2120
  export declare class CountQueuingStrategy implements QueuingStrategy {
1635
2121
  constructor(init: QueuingStrategyInit);
2122
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */
1636
2123
  get highWaterMark(): number;
2124
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */
1637
2125
  get size(): (chunk?: any) => number;
1638
2126
  }
1639
2127
  export interface QueuingStrategyInit {
@@ -1644,6 +2132,11 @@ export interface QueuingStrategyInit {
1644
2132
  */
1645
2133
  highWaterMark: number;
1646
2134
  }
2135
+ export interface ScriptVersion {
2136
+ id?: string;
2137
+ tag?: string;
2138
+ message?: string;
2139
+ }
1647
2140
  export declare abstract class TailEvent extends ExtendableEvent {
1648
2141
  readonly events: TraceItem[];
1649
2142
  readonly traces: TraceItem[];
@@ -1652,17 +2145,23 @@ export interface TraceItem {
1652
2145
  readonly event:
1653
2146
  | (
1654
2147
  | TraceItemFetchEventInfo
2148
+ | TraceItemJsRpcEventInfo
1655
2149
  | TraceItemScheduledEventInfo
1656
2150
  | TraceItemAlarmEventInfo
1657
2151
  | TraceItemQueueEventInfo
1658
2152
  | TraceItemEmailEventInfo
2153
+ | TraceItemTailEventInfo
1659
2154
  | TraceItemCustomEventInfo
2155
+ | TraceItemHibernatableWebSocketEventInfo
1660
2156
  )
1661
2157
  | null;
1662
2158
  readonly eventTimestamp: number | null;
1663
2159
  readonly logs: TraceLog[];
1664
2160
  readonly exceptions: TraceException[];
2161
+ readonly diagnosticsChannelEvents: TraceDiagnosticChannelEvent[];
1665
2162
  readonly scriptName: string | null;
2163
+ readonly entrypoint?: string;
2164
+ readonly scriptVersion?: ScriptVersion;
1666
2165
  readonly dispatchNamespace?: string;
1667
2166
  readonly scriptTags?: string[];
1668
2167
  readonly outcome: string;
@@ -1684,6 +2183,12 @@ export interface TraceItemEmailEventInfo {
1684
2183
  readonly rcptTo: string;
1685
2184
  readonly rawSize: number;
1686
2185
  }
2186
+ export interface TraceItemTailEventInfo {
2187
+ readonly consumedEvents: TraceItemTailEventInfoTailItem[];
2188
+ }
2189
+ export interface TraceItemTailEventInfoTailItem {
2190
+ readonly scriptName: string | null;
2191
+ }
1687
2192
  export interface TraceItemFetchEventInfo {
1688
2193
  readonly response?: TraceItemFetchEventInfoResponse;
1689
2194
  readonly request: TraceItemFetchEventInfoRequest;
@@ -1698,6 +2203,26 @@ export interface TraceItemFetchEventInfoRequest {
1698
2203
  export interface TraceItemFetchEventInfoResponse {
1699
2204
  readonly status: number;
1700
2205
  }
2206
+ export interface TraceItemJsRpcEventInfo {
2207
+ readonly rpcMethod: string;
2208
+ }
2209
+ export interface TraceItemHibernatableWebSocketEventInfo {
2210
+ readonly getWebSocketEvent:
2211
+ | TraceItemHibernatableWebSocketEventInfoMessage
2212
+ | TraceItemHibernatableWebSocketEventInfoClose
2213
+ | TraceItemHibernatableWebSocketEventInfoError;
2214
+ }
2215
+ export interface TraceItemHibernatableWebSocketEventInfoMessage {
2216
+ readonly webSocketEventType: string;
2217
+ }
2218
+ export interface TraceItemHibernatableWebSocketEventInfoClose {
2219
+ readonly webSocketEventType: string;
2220
+ readonly code: number;
2221
+ readonly wasClean: boolean;
2222
+ }
2223
+ export interface TraceItemHibernatableWebSocketEventInfoError {
2224
+ readonly webSocketEventType: string;
2225
+ }
1701
2226
  export interface TraceLog {
1702
2227
  readonly timestamp: number;
1703
2228
  readonly level: string;
@@ -1707,6 +2232,12 @@ export interface TraceException {
1707
2232
  readonly timestamp: number;
1708
2233
  readonly message: string;
1709
2234
  readonly name: string;
2235
+ readonly stack?: string;
2236
+ }
2237
+ export interface TraceDiagnosticChannelEvent {
2238
+ readonly timestamp: number;
2239
+ readonly channel: string;
2240
+ readonly message: any;
1710
2241
  }
1711
2242
  export interface TraceMetrics {
1712
2243
  readonly cpuTime: number;
@@ -1717,29 +2248,52 @@ export interface UnsafeTraceMetrics {
1717
2248
  }
1718
2249
  export declare class URL {
1719
2250
  constructor(url: string | URL, base?: string | URL);
2251
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
1720
2252
  get href(): string;
2253
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */
1721
2254
  set href(value: string);
2255
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */
1722
2256
  get origin(): string;
2257
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
1723
2258
  get protocol(): string;
2259
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */
1724
2260
  set protocol(value: string);
2261
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
1725
2262
  get username(): string;
2263
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */
1726
2264
  set username(value: string);
2265
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
1727
2266
  get password(): string;
2267
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */
1728
2268
  set password(value: string);
2269
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
1729
2270
  get host(): string;
2271
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */
1730
2272
  set host(value: string);
2273
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
1731
2274
  get hostname(): string;
2275
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */
1732
2276
  set hostname(value: string);
2277
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
1733
2278
  get port(): string;
2279
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */
1734
2280
  set port(value: string);
2281
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
1735
2282
  get pathname(): string;
2283
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */
1736
2284
  set pathname(value: string);
2285
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
1737
2286
  get search(): string;
2287
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */
1738
2288
  set search(value: string);
2289
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */
1739
2290
  get searchParams(): URLSearchParams;
2291
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
1740
2292
  get hash(): string;
2293
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */
1741
2294
  set hash(value: string);
1742
2295
  toString(): string;
2296
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */
1743
2297
  toJSON(): string;
1744
2298
  }
1745
2299
  export declare class URLSearchParams {
@@ -1748,7 +2302,7 @@ export declare class URLSearchParams {
1748
2302
  | URLSearchParams
1749
2303
  | string
1750
2304
  | Record<string, string>
1751
- | [key: string, value: string][]
2305
+ | [key: string, value: string][],
1752
2306
  );
1753
2307
  get size(): number;
1754
2308
  append(name: string, value: string): void;
@@ -1758,23 +2312,30 @@ export declare class URLSearchParams {
1758
2312
  has(name: string): boolean;
1759
2313
  set(name: string, value: string): void;
1760
2314
  sort(): void;
2315
+ /** Returns an array of key, value pairs for every entry in the search params. */
1761
2316
  entries(): IterableIterator<[key: string, value: string]>;
2317
+ /** Returns a list of keys in the search params. */
1762
2318
  keys(): IterableIterator<string>;
2319
+ /** Returns a list of values in the search params. */
1763
2320
  values(): IterableIterator<string>;
1764
2321
  forEach<This = unknown>(
1765
2322
  callback: (
1766
2323
  this: This,
1767
2324
  value: string,
1768
2325
  key: string,
1769
- parent: URLSearchParams
2326
+ parent: URLSearchParams,
1770
2327
  ) => void,
1771
- thisArg?: This
2328
+ thisArg?: This,
1772
2329
  ): void;
1773
2330
  toString(): string;
1774
2331
  [Symbol.iterator](): IterableIterator<[key: string, value: string]>;
1775
2332
  }
1776
2333
  export declare class URLPattern {
1777
- constructor(input?: string | URLPatternURLPatternInit, baseURL?: string);
2334
+ constructor(
2335
+ input?: string | URLPatternURLPatternInit,
2336
+ baseURL?: string,
2337
+ patternOptions?: URLPatternURLPatternOptions,
2338
+ );
1778
2339
  get protocol(): string;
1779
2340
  get username(): string;
1780
2341
  get password(): string;
@@ -1786,7 +2347,7 @@ export declare class URLPattern {
1786
2347
  test(input?: string | URLPatternURLPatternInit, baseURL?: string): boolean;
1787
2348
  exec(
1788
2349
  input?: string | URLPatternURLPatternInit,
1789
- baseURL?: string
2350
+ baseURL?: string,
1790
2351
  ): URLPatternURLPatternResult | null;
1791
2352
  }
1792
2353
  export interface URLPatternURLPatternInit {
@@ -1815,13 +2376,28 @@ export interface URLPatternURLPatternResult {
1815
2376
  search: URLPatternURLPatternComponentResult;
1816
2377
  hash: URLPatternURLPatternComponentResult;
1817
2378
  }
2379
+ export interface URLPatternURLPatternOptions {
2380
+ ignoreCase?: boolean;
2381
+ }
1818
2382
  export declare class CloseEvent extends Event {
1819
- constructor(type: string, initializer: CloseEventInit);
1820
- /** Returns the WebSocket connection close code provided by the server. */
2383
+ constructor(type: string, initializer?: CloseEventInit);
2384
+ /**
2385
+ * Returns the WebSocket connection close code provided by the server.
2386
+ *
2387
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code)
2388
+ */
1821
2389
  readonly code: number;
1822
- /** Returns the WebSocket connection close reason provided by the server. */
2390
+ /**
2391
+ * Returns the WebSocket connection close reason provided by the server.
2392
+ *
2393
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason)
2394
+ */
1823
2395
  readonly reason: string;
1824
- /** Returns true if the connection closed cleanly; false otherwise. */
2396
+ /**
2397
+ * Returns true if the connection closed cleanly; false otherwise.
2398
+ *
2399
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean)
2400
+ */
1825
2401
  readonly wasClean: boolean;
1826
2402
  }
1827
2403
  export interface CloseEventInit {
@@ -1836,12 +2412,21 @@ export declare class MessageEvent extends Event {
1836
2412
  export interface MessageEventInit {
1837
2413
  data: ArrayBuffer | string;
1838
2414
  }
1839
- /** Events providing information related to errors in scripts or in files. */
2415
+ /**
2416
+ * Events providing information related to errors in scripts or in files.
2417
+ *
2418
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
2419
+ */
1840
2420
  export interface ErrorEvent extends Event {
2421
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
1841
2422
  readonly filename: string;
2423
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
1842
2424
  readonly message: string;
2425
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
1843
2426
  readonly lineno: number;
2427
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
1844
2428
  readonly colno: number;
2429
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
1845
2430
  readonly error: any;
1846
2431
  }
1847
2432
  export type WebSocketEventMap = {
@@ -1853,17 +2438,51 @@ export type WebSocketEventMap = {
1853
2438
  export declare class WebSocket extends EventTarget<WebSocketEventMap> {
1854
2439
  constructor(url: string, protocols?: string[] | string);
1855
2440
  accept(): void;
2441
+ /**
2442
+ * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
2443
+ *
2444
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
2445
+ */
1856
2446
  send(message: (ArrayBuffer | ArrayBufferView) | string): void;
2447
+ /**
2448
+ * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.
2449
+ *
2450
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
2451
+ */
1857
2452
  close(code?: number, reason?: string): void;
1858
2453
  serializeAttachment(attachment: any): void;
1859
2454
  deserializeAttachment(): any | null;
1860
2455
  static readonly READY_STATE_CONNECTING: number;
2456
+ static readonly CONNECTING: number;
1861
2457
  static readonly READY_STATE_OPEN: number;
2458
+ static readonly OPEN: number;
1862
2459
  static readonly READY_STATE_CLOSING: number;
2460
+ static readonly CLOSING: number;
1863
2461
  static readonly READY_STATE_CLOSED: number;
2462
+ static readonly CLOSED: number;
2463
+ /**
2464
+ * Returns the state of the WebSocket object's connection. It can have the values described below.
2465
+ *
2466
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
2467
+ */
1864
2468
  get readyState(): number;
2469
+ /**
2470
+ * Returns the URL that was used to establish the WebSocket connection.
2471
+ *
2472
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
2473
+ */
1865
2474
  get url(): string | null;
2475
+ /**
2476
+ * 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.
2477
+ *
2478
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
2479
+ */
1866
2480
  get protocol(): string | null;
2481
+ /**
2482
+ * Returns the extensions selected by the server, if any.
2483
+ *
2484
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
2485
+ */
1867
2486
  get extensions(): string | null;
1868
2487
  }
1869
2488
  export declare const WebSocketPair: {
@@ -1876,6 +2495,7 @@ export interface Socket {
1876
2495
  get readable(): ReadableStream;
1877
2496
  get writable(): WritableStream;
1878
2497
  get closed(): Promise<void>;
2498
+ get opened(): Promise<SocketInfo>;
1879
2499
  close(): Promise<void>;
1880
2500
  startTls(options?: TlsOptions): Socket;
1881
2501
  }
@@ -1890,6 +2510,528 @@ export interface SocketAddress {
1890
2510
  export interface TlsOptions {
1891
2511
  expectedServerHostname?: string;
1892
2512
  }
2513
+ export interface SocketInfo {
2514
+ remoteAddress?: string;
2515
+ localAddress?: string;
2516
+ }
2517
+ export interface gpuGPU {
2518
+ requestAdapter(
2519
+ param1?: gpuGPURequestAdapterOptions,
2520
+ ): Promise<gpuGPUAdapter | null>;
2521
+ }
2522
+ export declare abstract class gpuGPUAdapter {
2523
+ requestDevice(param1?: gpuGPUDeviceDescriptor): Promise<gpuGPUDevice>;
2524
+ requestAdapterInfo(unmaskHints?: string[]): Promise<gpuGPUAdapterInfo>;
2525
+ get features(): gpuGPUSupportedFeatures;
2526
+ get limits(): gpuGPUSupportedLimits;
2527
+ }
2528
+ export interface gpuGPUDevice extends EventTarget {
2529
+ createBuffer(param1: gpuGPUBufferDescriptor): gpuGPUBuffer;
2530
+ createBindGroupLayout(
2531
+ descriptor: gpuGPUBindGroupLayoutDescriptor,
2532
+ ): gpuGPUBindGroupLayout;
2533
+ createBindGroup(descriptor: gpuGPUBindGroupDescriptor): gpuGPUBindGroup;
2534
+ createSampler(descriptor: gpuGPUSamplerDescriptor): gpuGPUSampler;
2535
+ createShaderModule(
2536
+ descriptor: gpuGPUShaderModuleDescriptor,
2537
+ ): gpuGPUShaderModule;
2538
+ createPipelineLayout(
2539
+ descriptor: gpuGPUPipelineLayoutDescriptor,
2540
+ ): gpuGPUPipelineLayout;
2541
+ createComputePipeline(
2542
+ descriptor: gpuGPUComputePipelineDescriptor,
2543
+ ): gpuGPUComputePipeline;
2544
+ createRenderPipeline(
2545
+ descriptor: gpuGPURenderPipelineDescriptor,
2546
+ ): gpuGPURenderPipeline;
2547
+ createCommandEncoder(
2548
+ descriptor?: gpuGPUCommandEncoderDescriptor,
2549
+ ): gpuGPUCommandEncoder;
2550
+ createTexture(param1: gpuGPUTextureDescriptor): gpuGPUTexture;
2551
+ destroy(): void;
2552
+ createQuerySet(descriptor: gpuGPUQuerySetDescriptor): gpuGPUQuerySet;
2553
+ pushErrorScope(filter: string): void;
2554
+ popErrorScope(): Promise<gpuGPUError | null>;
2555
+ get queue(): gpuGPUQueue;
2556
+ get lost(): Promise<gpuGPUDeviceLostInfo>;
2557
+ get features(): gpuGPUSupportedFeatures;
2558
+ get limits(): gpuGPUSupportedLimits;
2559
+ }
2560
+ export interface gpuGPUDeviceDescriptor {
2561
+ label?: string;
2562
+ requiredFeatures?: string[];
2563
+ requiredLimits?: Record<string, number | bigint>;
2564
+ defaultQueue?: gpuGPUQueueDescriptor;
2565
+ }
2566
+ export interface gpuGPUBufferDescriptor {
2567
+ label: string;
2568
+ size: number | bigint;
2569
+ usage: number;
2570
+ mappedAtCreation: boolean;
2571
+ }
2572
+ export interface gpuGPUQueueDescriptor {
2573
+ label?: string;
2574
+ }
2575
+ export declare abstract class gpuGPUBufferUsage {
2576
+ static readonly MAP_READ: number;
2577
+ static readonly MAP_WRITE: number;
2578
+ static readonly COPY_SRC: number;
2579
+ static readonly COPY_DST: number;
2580
+ static readonly INDEX: number;
2581
+ static readonly VERTEX: number;
2582
+ static readonly UNIFORM: number;
2583
+ static readonly STORAGE: number;
2584
+ static readonly INDIRECT: number;
2585
+ static readonly QUERY_RESOLVE: number;
2586
+ }
2587
+ export interface gpuGPUBuffer {
2588
+ getMappedRange(size?: number | bigint, param2?: number | bigint): ArrayBuffer;
2589
+ unmap(): void;
2590
+ destroy(): void;
2591
+ mapAsync(
2592
+ offset: number,
2593
+ size?: number | bigint,
2594
+ param3?: number | bigint,
2595
+ ): Promise<void>;
2596
+ get size(): number | bigint;
2597
+ get usage(): number;
2598
+ get mapState(): string;
2599
+ }
2600
+ export declare abstract class gpuGPUShaderStage {
2601
+ static readonly VERTEX: number;
2602
+ static readonly FRAGMENT: number;
2603
+ static readonly COMPUTE: number;
2604
+ }
2605
+ export interface gpuGPUBindGroupLayoutDescriptor {
2606
+ label?: string;
2607
+ entries: gpuGPUBindGroupLayoutEntry[];
2608
+ }
2609
+ export interface gpuGPUBindGroupLayoutEntry {
2610
+ binding: number;
2611
+ visibility: number;
2612
+ buffer?: gpuGPUBufferBindingLayout;
2613
+ sampler?: gpuGPUSamplerBindingLayout;
2614
+ texture?: gpuGPUTextureBindingLayout;
2615
+ storageTexture?: gpuGPUStorageTextureBindingLayout;
2616
+ }
2617
+ export interface gpuGPUStorageTextureBindingLayout {
2618
+ access?: string;
2619
+ format: string;
2620
+ viewDimension?: string;
2621
+ }
2622
+ export interface gpuGPUTextureBindingLayout {
2623
+ sampleType?: string;
2624
+ viewDimension?: string;
2625
+ multisampled?: boolean;
2626
+ }
2627
+ export interface gpuGPUSamplerBindingLayout {
2628
+ type?: string;
2629
+ }
2630
+ export interface gpuGPUBufferBindingLayout {
2631
+ type?: string;
2632
+ hasDynamicOffset?: boolean;
2633
+ minBindingSize?: number | bigint;
2634
+ }
2635
+ export interface gpuGPUBindGroupLayout {}
2636
+ export interface gpuGPUBindGroup {}
2637
+ export interface gpuGPUBindGroupDescriptor {
2638
+ label?: string;
2639
+ layout: gpuGPUBindGroupLayout;
2640
+ entries: gpuGPUBindGroupEntry[];
2641
+ }
2642
+ export interface gpuGPUBindGroupEntry {
2643
+ binding: number;
2644
+ resource: gpuGPUBufferBinding | gpuGPUSampler;
2645
+ }
2646
+ export interface gpuGPUBufferBinding {
2647
+ buffer: gpuGPUBuffer;
2648
+ offset?: number | bigint;
2649
+ size?: number | bigint;
2650
+ }
2651
+ export interface gpuGPUSampler {}
2652
+ export interface gpuGPUSamplerDescriptor {
2653
+ label?: string;
2654
+ addressModeU?: string;
2655
+ addressModeV?: string;
2656
+ addressModeW?: string;
2657
+ magFilter?: string;
2658
+ minFilter?: string;
2659
+ mipmapFilter?: string;
2660
+ lodMinClamp?: number;
2661
+ lodMaxClamp?: number;
2662
+ compare: string;
2663
+ maxAnisotropy?: number;
2664
+ }
2665
+ export interface gpuGPUShaderModule {
2666
+ getCompilationInfo(): Promise<gpuGPUCompilationInfo>;
2667
+ }
2668
+ export interface gpuGPUShaderModuleDescriptor {
2669
+ label?: string;
2670
+ code: string;
2671
+ }
2672
+ export interface gpuGPUPipelineLayout {}
2673
+ export interface gpuGPUPipelineLayoutDescriptor {
2674
+ label?: string;
2675
+ bindGroupLayouts: gpuGPUBindGroupLayout[];
2676
+ }
2677
+ export interface gpuGPUComputePipeline {
2678
+ getBindGroupLayout(index: number): gpuGPUBindGroupLayout;
2679
+ }
2680
+ export interface gpuGPUComputePipelineDescriptor {
2681
+ label?: string;
2682
+ compute: gpuGPUProgrammableStage;
2683
+ layout: string | gpuGPUPipelineLayout;
2684
+ }
2685
+ export interface gpuGPUProgrammableStage {
2686
+ module: gpuGPUShaderModule;
2687
+ entryPoint: string;
2688
+ constants?: Record<string, number>;
2689
+ }
2690
+ export interface gpuGPUCommandEncoder {
2691
+ get label(): string;
2692
+ beginComputePass(
2693
+ descriptor?: gpuGPUComputePassDescriptor,
2694
+ ): gpuGPUComputePassEncoder;
2695
+ beginRenderPass(
2696
+ descriptor: gpuGPURenderPassDescriptor,
2697
+ ): gpuGPURenderPassEncoder;
2698
+ copyBufferToBuffer(
2699
+ source: gpuGPUBuffer,
2700
+ sourceOffset: number | bigint,
2701
+ destination: gpuGPUBuffer,
2702
+ destinationOffset: number | bigint,
2703
+ size: number | bigint,
2704
+ ): void;
2705
+ finish(param0?: gpuGPUCommandBufferDescriptor): gpuGPUCommandBuffer;
2706
+ copyTextureToBuffer(
2707
+ source: gpuGPUImageCopyTexture,
2708
+ destination: gpuGPUImageCopyBuffer,
2709
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2710
+ ): void;
2711
+ copyBufferToTexture(
2712
+ source: gpuGPUImageCopyBuffer,
2713
+ destination: gpuGPUImageCopyTexture,
2714
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2715
+ ): void;
2716
+ copyTextureToTexture(
2717
+ source: gpuGPUImageCopyTexture,
2718
+ destination: gpuGPUImageCopyTexture,
2719
+ copySize: Iterable<number> | gpuGPUExtent3DDict,
2720
+ ): void;
2721
+ clearBuffer(
2722
+ buffer: gpuGPUBuffer,
2723
+ offset?: number | bigint,
2724
+ size?: number | bigint,
2725
+ ): void;
2726
+ }
2727
+ export interface gpuGPUCommandEncoderDescriptor {
2728
+ label?: string;
2729
+ }
2730
+ export interface gpuGPUComputePassEncoder {
2731
+ setPipeline(pipeline: gpuGPUComputePipeline): void;
2732
+ setBindGroup(
2733
+ index: number,
2734
+ bindGroup: gpuGPUBindGroup | null,
2735
+ dynamicOffsets?: Iterable<number>,
2736
+ ): void;
2737
+ dispatchWorkgroups(
2738
+ workgroupCountX: number,
2739
+ workgroupCountY?: number,
2740
+ workgroupCountZ?: number,
2741
+ ): void;
2742
+ end(): void;
2743
+ }
2744
+ export interface gpuGPUComputePassDescriptor {
2745
+ label?: string;
2746
+ timestampWrites?: gpuGPUComputePassTimestampWrites;
2747
+ }
2748
+ export interface gpuGPUQuerySet {}
2749
+ export interface gpuGPUQuerySetDescriptor {
2750
+ label?: string;
2751
+ }
2752
+ export interface gpuGPUComputePassTimestampWrites {
2753
+ querySet: gpuGPUQuerySet;
2754
+ beginningOfPassWriteIndex?: number;
2755
+ endOfPassWriteIndex?: number;
2756
+ }
2757
+ export interface gpuGPUCommandBufferDescriptor {
2758
+ label?: string;
2759
+ }
2760
+ export interface gpuGPUCommandBuffer {}
2761
+ export interface gpuGPUQueue {
2762
+ submit(commandBuffers: gpuGPUCommandBuffer[]): void;
2763
+ writeBuffer(
2764
+ buffer: gpuGPUBuffer,
2765
+ bufferOffset: number | bigint,
2766
+ data: ArrayBuffer | ArrayBufferView,
2767
+ dataOffset?: number | bigint,
2768
+ size?: number | bigint,
2769
+ ): void;
2770
+ }
2771
+ export declare abstract class gpuGPUMapMode {
2772
+ static readonly READ: number;
2773
+ static readonly WRITE: number;
2774
+ }
2775
+ export interface gpuGPURequestAdapterOptions {
2776
+ powerPreference: string;
2777
+ forceFallbackAdapter?: boolean;
2778
+ }
2779
+ export interface gpuGPUAdapterInfo {
2780
+ get vendor(): string;
2781
+ get architecture(): string;
2782
+ get device(): string;
2783
+ get description(): string;
2784
+ }
2785
+ export interface gpuGPUSupportedFeatures {
2786
+ has(name: string): boolean;
2787
+ keys(): string[];
2788
+ }
2789
+ export interface gpuGPUSupportedLimits {
2790
+ get maxTextureDimension1D(): number;
2791
+ get maxTextureDimension2D(): number;
2792
+ get maxTextureDimension3D(): number;
2793
+ get maxTextureArrayLayers(): number;
2794
+ get maxBindGroups(): number;
2795
+ get maxBindingsPerBindGroup(): number;
2796
+ get maxDynamicUniformBuffersPerPipelineLayout(): number;
2797
+ get maxDynamicStorageBuffersPerPipelineLayout(): number;
2798
+ get maxSampledTexturesPerShaderStage(): number;
2799
+ get maxSamplersPerShaderStage(): number;
2800
+ get maxStorageBuffersPerShaderStage(): number;
2801
+ get maxStorageTexturesPerShaderStage(): number;
2802
+ get maxUniformBuffersPerShaderStage(): number;
2803
+ get maxUniformBufferBindingSize(): number | bigint;
2804
+ get maxStorageBufferBindingSize(): number | bigint;
2805
+ get minUniformBufferOffsetAlignment(): number;
2806
+ get minStorageBufferOffsetAlignment(): number;
2807
+ get maxVertexBuffers(): number;
2808
+ get maxBufferSize(): number | bigint;
2809
+ get maxVertexAttributes(): number;
2810
+ get maxVertexBufferArrayStride(): number;
2811
+ get maxInterStageShaderComponents(): number;
2812
+ get maxInterStageShaderVariables(): number;
2813
+ get maxColorAttachments(): number;
2814
+ get maxColorAttachmentBytesPerSample(): number;
2815
+ get maxComputeWorkgroupStorageSize(): number;
2816
+ get maxComputeInvocationsPerWorkgroup(): number;
2817
+ get maxComputeWorkgroupSizeX(): number;
2818
+ get maxComputeWorkgroupSizeY(): number;
2819
+ get maxComputeWorkgroupSizeZ(): number;
2820
+ get maxComputeWorkgroupsPerDimension(): number;
2821
+ }
2822
+ export declare abstract class gpuGPUError {
2823
+ get message(): string;
2824
+ }
2825
+ export declare abstract class gpuGPUOutOfMemoryError extends gpuGPUError {}
2826
+ export declare abstract class gpuGPUInternalError extends gpuGPUError {}
2827
+ export declare abstract class gpuGPUValidationError extends gpuGPUError {}
2828
+ export declare abstract class gpuGPUDeviceLostInfo {
2829
+ get message(): string;
2830
+ get reason(): string;
2831
+ }
2832
+ export interface gpuGPUCompilationMessage {
2833
+ get message(): string;
2834
+ get type(): string;
2835
+ get lineNum(): number;
2836
+ get linePos(): number;
2837
+ get offset(): number;
2838
+ get length(): number;
2839
+ }
2840
+ export interface gpuGPUCompilationInfo {
2841
+ get messages(): gpuGPUCompilationMessage[];
2842
+ }
2843
+ export declare abstract class gpuGPUTextureUsage {
2844
+ static readonly COPY_SRC: number;
2845
+ static readonly COPY_DST: number;
2846
+ static readonly TEXTURE_BINDING: number;
2847
+ static readonly STORAGE_BINDING: number;
2848
+ static readonly RENDER_ATTACHMENT: number;
2849
+ }
2850
+ export interface gpuGPUTextureDescriptor {
2851
+ label: string;
2852
+ size: number[] | gpuGPUExtent3DDict;
2853
+ mipLevelCount?: number;
2854
+ sampleCount?: number;
2855
+ dimension?: string;
2856
+ format: string;
2857
+ usage: number;
2858
+ viewFormats?: string[];
2859
+ }
2860
+ export interface gpuGPUExtent3DDict {
2861
+ width: number;
2862
+ height?: number;
2863
+ depthOrArrayLayers?: number;
2864
+ }
2865
+ export interface gpuGPUTexture {
2866
+ createView(descriptor?: gpuGPUTextureViewDescriptor): gpuGPUTextureView;
2867
+ destroy(): void;
2868
+ get width(): number;
2869
+ get height(): number;
2870
+ get depthOrArrayLayers(): number;
2871
+ get mipLevelCount(): number;
2872
+ get dimension(): string;
2873
+ get format(): string;
2874
+ get usage(): number;
2875
+ }
2876
+ export interface gpuGPUTextureView {}
2877
+ export interface gpuGPUTextureViewDescriptor {
2878
+ label: string;
2879
+ format: string;
2880
+ dimension: string;
2881
+ aspect?: string;
2882
+ baseMipLevel?: number;
2883
+ mipLevelCount: number;
2884
+ baseArrayLayer?: number;
2885
+ arrayLayerCount: number;
2886
+ }
2887
+ export declare abstract class gpuGPUColorWrite {
2888
+ static readonly RED: number;
2889
+ static readonly GREEN: number;
2890
+ static readonly BLUE: number;
2891
+ static readonly ALPHA: number;
2892
+ static readonly ALL: number;
2893
+ }
2894
+ export interface gpuGPURenderPipeline {}
2895
+ export interface gpuGPURenderPipelineDescriptor {
2896
+ label?: string;
2897
+ layout: string | gpuGPUPipelineLayout;
2898
+ vertex: gpuGPUVertexState;
2899
+ primitive?: gpuGPUPrimitiveState;
2900
+ depthStencil?: gpuGPUDepthStencilState;
2901
+ multisample?: gpuGPUMultisampleState;
2902
+ fragment?: gpuGPUFragmentState;
2903
+ }
2904
+ export interface gpuGPUVertexState {
2905
+ module: gpuGPUShaderModule;
2906
+ entryPoint: string;
2907
+ constants?: Record<string, number>;
2908
+ buffers?: gpuGPUVertexBufferLayout[];
2909
+ }
2910
+ export interface gpuGPUVertexBufferLayout {
2911
+ arrayStride: number | bigint;
2912
+ stepMode?: string;
2913
+ attributes: gpuGPUVertexAttribute[];
2914
+ }
2915
+ export interface gpuGPUVertexAttribute {
2916
+ format: string;
2917
+ offset: number | bigint;
2918
+ shaderLocation: number;
2919
+ }
2920
+ export interface gpuGPUPrimitiveState {
2921
+ topology?: string;
2922
+ stripIndexFormat?: string;
2923
+ frontFace?: string;
2924
+ cullMode?: string;
2925
+ unclippedDepth?: boolean;
2926
+ }
2927
+ export interface gpuGPUStencilFaceState {
2928
+ compare?: string;
2929
+ failOp?: string;
2930
+ depthFailOp?: string;
2931
+ passOp?: string;
2932
+ }
2933
+ export interface gpuGPUDepthStencilState {
2934
+ format: string;
2935
+ depthWriteEnabled: boolean;
2936
+ depthCompare: string;
2937
+ stencilFront?: gpuGPUStencilFaceState;
2938
+ stencilBack?: gpuGPUStencilFaceState;
2939
+ stencilReadMask?: number;
2940
+ stencilWriteMask?: number;
2941
+ depthBias?: number;
2942
+ depthBiasSlopeScale?: number;
2943
+ depthBiasClamp?: number;
2944
+ }
2945
+ export interface gpuGPUMultisampleState {
2946
+ count?: number;
2947
+ mask?: number;
2948
+ alphaToCoverageEnabled?: boolean;
2949
+ }
2950
+ export interface gpuGPUFragmentState {
2951
+ module: gpuGPUShaderModule;
2952
+ entryPoint: string;
2953
+ constants?: Record<string, number>;
2954
+ targets: gpuGPUColorTargetState[];
2955
+ }
2956
+ export interface gpuGPUColorTargetState {
2957
+ format: string;
2958
+ blend: gpuGPUBlendState;
2959
+ writeMask?: number;
2960
+ }
2961
+ export interface gpuGPUBlendState {
2962
+ color: gpuGPUBlendComponent;
2963
+ alpha: gpuGPUBlendComponent;
2964
+ }
2965
+ export interface gpuGPUBlendComponent {
2966
+ operation?: string;
2967
+ srcFactor?: string;
2968
+ dstFactor?: string;
2969
+ }
2970
+ export interface gpuGPURenderPassEncoder {
2971
+ setPipeline(pipeline: gpuGPURenderPipeline): void;
2972
+ draw(
2973
+ vertexCount: number,
2974
+ instanceCount?: number,
2975
+ firstVertex?: number,
2976
+ firstInstance?: number,
2977
+ ): void;
2978
+ end(): void;
2979
+ }
2980
+ export interface gpuGPURenderPassDescriptor {
2981
+ label?: string;
2982
+ colorAttachments: gpuGPURenderPassColorAttachment[];
2983
+ depthStencilAttachment?: gpuGPURenderPassDepthStencilAttachment;
2984
+ occlusionQuerySet?: gpuGPUQuerySet;
2985
+ timestampWrites?: gpuGPURenderPassTimestampWrites;
2986
+ maxDrawCount?: number | bigint;
2987
+ }
2988
+ export interface gpuGPURenderPassColorAttachment {
2989
+ view: gpuGPUTextureView;
2990
+ depthSlice?: number;
2991
+ resolveTarget?: gpuGPUTextureView;
2992
+ clearValue?: number[] | gpuGPUColorDict;
2993
+ loadOp: string;
2994
+ storeOp: string;
2995
+ }
2996
+ export interface gpuGPUColorDict {
2997
+ r: number;
2998
+ g: number;
2999
+ b: number;
3000
+ a: number;
3001
+ }
3002
+ export interface gpuGPURenderPassDepthStencilAttachment {
3003
+ view: gpuGPUTextureView;
3004
+ depthClearValue?: number;
3005
+ depthLoadOp?: string;
3006
+ depthStoreOp?: string;
3007
+ depthReadOnly?: boolean;
3008
+ stencilClearValue?: number;
3009
+ stencilLoadOp?: string;
3010
+ stencilStoreOp?: string;
3011
+ stencilReadOnly?: boolean;
3012
+ }
3013
+ export interface gpuGPURenderPassTimestampWrites {
3014
+ querySet: gpuGPUQuerySet;
3015
+ beginningOfPassWriteIndex?: number;
3016
+ endOfPassWriteIndex?: number;
3017
+ }
3018
+ export interface gpuGPUImageCopyTexture {
3019
+ texture: gpuGPUTexture;
3020
+ mipLevel?: number;
3021
+ origin?: number[] | gpuGPUOrigin3DDict;
3022
+ aspect?: string;
3023
+ }
3024
+ export interface gpuGPUImageCopyBuffer {
3025
+ buffer: gpuGPUBuffer;
3026
+ offset?: number | bigint;
3027
+ bytesPerRow?: number;
3028
+ rowsPerImage?: number;
3029
+ }
3030
+ export interface gpuGPUOrigin3DDict {
3031
+ x?: number;
3032
+ y?: number;
3033
+ z?: number;
3034
+ }
1893
3035
  export interface BasicImageTransformations {
1894
3036
  /**
1895
3037
  * Maximum width in image pixels. The value must be an integer.
@@ -2329,7 +3471,7 @@ export interface IncomingRequestCfPropertiesBotManagementEnterprise
2329
3471
  };
2330
3472
  }
2331
3473
  export interface IncomingRequestCfPropertiesCloudflareForSaaSEnterprise<
2332
- HostMetadata
3474
+ HostMetadata,
2333
3475
  > {
2334
3476
  /**
2335
3477
  * Custom metadata set per-host in [Cloudflare for SaaS](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/).
@@ -2861,25 +4003,51 @@ export type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
2861
4003
  export type CfProperties<HostMetadata = unknown> =
2862
4004
  | IncomingRequestCfProperties<HostMetadata>
2863
4005
  | RequestInitCfProperties;
2864
- export interface D1Result<T = unknown> {
2865
- results?: T[];
2866
- success: boolean;
2867
- error?: string;
2868
- meta: any;
4006
+ export interface D1Meta {
4007
+ duration: number;
4008
+ size_after: number;
4009
+ rows_read: number;
4010
+ rows_written: number;
4011
+ last_row_id: number;
4012
+ changed_db: boolean;
4013
+ changes: number;
4014
+ }
4015
+ export interface D1Response {
4016
+ success: true;
4017
+ meta: D1Meta & Record<string, unknown>;
4018
+ error?: never;
4019
+ }
4020
+ export type D1Result<T = unknown> = D1Response & {
4021
+ results: T[];
4022
+ };
4023
+ export interface D1ExecResult {
4024
+ count: number;
4025
+ duration: number;
2869
4026
  }
2870
4027
  export declare abstract class D1Database {
2871
4028
  prepare(query: string): D1PreparedStatement;
2872
4029
  dump(): Promise<ArrayBuffer>;
2873
4030
  batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
2874
- exec<T = unknown>(query: string): Promise<D1Result<T>>;
4031
+ exec(query: string): Promise<D1ExecResult>;
2875
4032
  }
2876
4033
  export declare abstract class D1PreparedStatement {
2877
- bind(...values: any[]): D1PreparedStatement;
2878
- first<T = unknown>(colName?: string): Promise<T>;
2879
- run<T = unknown>(): Promise<D1Result<T>>;
2880
- all<T = unknown>(): Promise<D1Result<T>>;
2881
- raw<T = unknown>(): Promise<T[]>;
2882
- }
4034
+ bind(...values: unknown[]): D1PreparedStatement;
4035
+ first<T = unknown>(colName: string): Promise<T | null>;
4036
+ first<T = Record<string, unknown>>(): Promise<T | null>;
4037
+ run(): Promise<D1Response>;
4038
+ all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4039
+ raw<T = unknown[]>(options: {
4040
+ columnNames: true;
4041
+ }): Promise<[string[], ...T[]]>;
4042
+ raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
4043
+ }
4044
+ // `Disposable` was added to TypeScript's standard lib types in version 5.2.
4045
+ // To support older TypeScript versions, define an empty `Disposable` interface.
4046
+ // Users won't be able to use `using`/`Symbol.dispose` without upgrading to 5.2,
4047
+ // but this will ensure type checking on older versions still passes.
4048
+ // TypeScript's interface merging will ensure our empty interface is effectively
4049
+ // ignored when `Disposable` is included in the standard lib.
4050
+ export interface Disposable {}
2883
4051
  /**
2884
4052
  * An email message that can be sent from a Worker.
2885
4053
  */
@@ -2900,7 +4068,7 @@ export interface ForwardableEmailMessage extends EmailMessage {
2900
4068
  /**
2901
4069
  * Stream of the email message content.
2902
4070
  */
2903
- readonly raw: ReadableStream;
4071
+ readonly raw: ReadableStream<Uint8Array>;
2904
4072
  /**
2905
4073
  * An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
2906
4074
  */
@@ -2935,11 +4103,58 @@ export declare abstract class EmailEvent extends ExtendableEvent {
2935
4103
  export type EmailExportedHandler<Env = unknown> = (
2936
4104
  message: ForwardableEmailMessage,
2937
4105
  env: Env,
2938
- ctx: ExecutionContext
4106
+ ctx: ExecutionContext,
2939
4107
  ) => void | Promise<void>;
4108
+ export interface Hyperdrive {
4109
+ /**
4110
+ * Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
4111
+ *
4112
+ * Calling this method returns an idential socket to if you call
4113
+ * `connect("host:port")` using the `host` and `port` fields from this object.
4114
+ * Pick whichever approach works better with your preferred DB client library.
4115
+ *
4116
+ * Note that this socket is not yet authenticated -- it's expected that your
4117
+ * code (or preferably, the client library of your choice) will authenticate
4118
+ * using the information in this class's readonly fields.
4119
+ */
4120
+ connect(): Socket;
4121
+ /**
4122
+ * A valid DB connection string that can be passed straight into the typical
4123
+ * client library/driver/ORM. This will typically be the easiest way to use
4124
+ * Hyperdrive.
4125
+ */
4126
+ readonly connectionString: string;
4127
+ /*
4128
+ * A randomly generated hostname that is only valid within the context of the
4129
+ * currently running Worker which, when passed into `connect()` function from
4130
+ * the "cloudflare:sockets" module, will connect to the Hyperdrive instance
4131
+ * for your database.
4132
+ */
4133
+ readonly host: string;
4134
+ /*
4135
+ * The port that must be paired the the host field when connecting.
4136
+ */
4137
+ readonly port: number;
4138
+ /*
4139
+ * The username to use when authenticating to your database via Hyperdrive.
4140
+ * Unlike the host and password, this will be the same every time
4141
+ */
4142
+ readonly user: string;
4143
+ /*
4144
+ * The randomly generated password to use when authenticating to your
4145
+ * database via Hyperdrive. Like the host field, this password is only valid
4146
+ * within the context of the currently running Worker instance from which
4147
+ * it's read.
4148
+ */
4149
+ readonly password: string;
4150
+ /*
4151
+ * The name of the database to connect to.
4152
+ */
4153
+ readonly database: string;
4154
+ }
2940
4155
  export type Params<P extends string = any> = Record<P, string | string[]>;
2941
4156
  export type EventContext<Env, P extends string, Data> = {
2942
- request: Request;
4157
+ request: Request<unknown, IncomingRequestCfProperties<unknown>>;
2943
4158
  functionPath: string;
2944
4159
  waitUntil: (promise: Promise<any>) => void;
2945
4160
  passThroughOnException: () => void;
@@ -2955,10 +4170,10 @@ export type EventContext<Env, P extends string, Data> = {
2955
4170
  export type PagesFunction<
2956
4171
  Env = unknown,
2957
4172
  Params extends string = any,
2958
- Data extends Record<string, unknown> = Record<string, unknown>
4173
+ Data extends Record<string, unknown> = Record<string, unknown>,
2959
4174
  > = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
2960
4175
  export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
2961
- request: Request;
4176
+ request: Request<unknown, IncomingRequestCfProperties<unknown>>;
2962
4177
  functionPath: string;
2963
4178
  waitUntil: (promise: Promise<any>) => void;
2964
4179
  passThroughOnException: () => void;
@@ -2976,14 +4191,14 @@ export type PagesPluginFunction<
2976
4191
  Env = unknown,
2977
4192
  Params extends string = any,
2978
4193
  Data extends Record<string, unknown> = Record<string, unknown>,
2979
- PluginArgs = unknown
4194
+ PluginArgs = unknown,
2980
4195
  > = (
2981
- context: EventPluginContext<Env, Params, Data, PluginArgs>
4196
+ context: EventPluginContext<Env, Params, Data, PluginArgs>,
2982
4197
  ) => Response | Promise<Response>;
2983
- // https://developers.cloudflare.com/pub-sub/
2984
4198
  // PubSubMessage represents an incoming PubSub message.
2985
4199
  // The message includes metadata about the broker, the client, and the payload
2986
4200
  // itself.
4201
+ // https://developers.cloudflare.com/pub-sub/
2987
4202
  export interface PubSubMessage {
2988
4203
  // Message ID
2989
4204
  readonly mid: number;
@@ -3014,7 +4229,320 @@ export interface JsonWebKeyWithKid extends JsonWebKey {
3014
4229
  // Key Identifier of the JWK
3015
4230
  readonly kid: string;
3016
4231
  }
3017
- // https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/
4232
+ // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
4233
+ // to referenced by `Fetcher`. This is included in the "importable" version of the types which
4234
+ // strips all `module` blocks.
4235
+ export declare namespace Rpc {
4236
+ // Branded types for identifying `WorkerEntrypoint`/`DurableObject`/`Target`s.
4237
+ // TypeScript uses *structural* typing meaning anything with the same shape as type `T` is a `T`.
4238
+ // For the classes exported by `cloudflare:workers` we want *nominal* typing (i.e. we only want to
4239
+ // accept `WorkerEntrypoint` from `cloudflare:workers`, not any other class with the same shape)
4240
+ export const __RPC_STUB_BRAND: "__RPC_STUB_BRAND";
4241
+ export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
4242
+ export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
4243
+ export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
4244
+ export interface RpcTargetBranded {
4245
+ [__RPC_TARGET_BRAND]: never;
4246
+ }
4247
+ export interface WorkerEntrypointBranded {
4248
+ [__WORKER_ENTRYPOINT_BRAND]: never;
4249
+ }
4250
+ export interface DurableObjectBranded {
4251
+ [__DURABLE_OBJECT_BRAND]: never;
4252
+ }
4253
+ export type EntrypointBranded =
4254
+ | WorkerEntrypointBranded
4255
+ | DurableObjectBranded;
4256
+ // Types that can be used through `Stub`s
4257
+ export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
4258
+ // Types that can be passed over RPC
4259
+ type Serializable =
4260
+ // Structured cloneables
4261
+ | void
4262
+ | undefined
4263
+ | null
4264
+ | boolean
4265
+ | number
4266
+ | bigint
4267
+ | string
4268
+ | TypedArray
4269
+ | ArrayBuffer
4270
+ | DataView
4271
+ | Date
4272
+ | Error
4273
+ | RegExp
4274
+ // Structured cloneable composites
4275
+ | Map<Serializable, Serializable>
4276
+ | Set<Serializable>
4277
+ | ReadonlyArray<Serializable>
4278
+ | {
4279
+ [key: string | number]: Serializable;
4280
+ }
4281
+ // Special types
4282
+ | ReadableStream<Uint8Array>
4283
+ | WritableStream<Uint8Array>
4284
+ | Request
4285
+ | Response
4286
+ | Headers
4287
+ | Stub<Stubable>
4288
+ // Serialized as stubs, see `Stubify`
4289
+ | Stubable;
4290
+ // Base type for all RPC stubs, including common memory management methods.
4291
+ // `T` is used as a marker type for unwrapping `Stub`s later.
4292
+ interface StubBase<T extends Stubable> extends Disposable {
4293
+ [__RPC_STUB_BRAND]: T;
4294
+ dup(): this;
4295
+ }
4296
+ export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
4297
+ // Recursively rewrite all `Stubable` types with `Stub`s
4298
+ type Stubify<T> = T extends Stubable
4299
+ ? Stub<T>
4300
+ : T extends Map<infer K, infer V>
4301
+ ? Map<Stubify<K>, Stubify<V>>
4302
+ : T extends Set<infer V>
4303
+ ? Set<Stubify<V>>
4304
+ : T extends Array<infer V>
4305
+ ? Array<Stubify<V>>
4306
+ : T extends ReadonlyArray<infer V>
4307
+ ? ReadonlyArray<Stubify<V>>
4308
+ : T extends {
4309
+ [key: string | number]: unknown;
4310
+ }
4311
+ ? {
4312
+ [K in keyof T]: Stubify<T[K]>;
4313
+ }
4314
+ : T;
4315
+ // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
4316
+ // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
4317
+ // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
4318
+ type Unstubify<T> =
4319
+ T extends StubBase<infer V>
4320
+ ? V
4321
+ : T extends Map<infer K, infer V>
4322
+ ? Map<Unstubify<K>, Unstubify<V>>
4323
+ : T extends Set<infer V>
4324
+ ? Set<Unstubify<V>>
4325
+ : T extends Array<infer V>
4326
+ ? Array<Unstubify<V>>
4327
+ : T extends ReadonlyArray<infer V>
4328
+ ? ReadonlyArray<Unstubify<V>>
4329
+ : T extends {
4330
+ [key: string | number]: unknown;
4331
+ }
4332
+ ? {
4333
+ [K in keyof T]: Unstubify<T[K]>;
4334
+ }
4335
+ : T;
4336
+ type UnstubifyAll<A extends any[]> = {
4337
+ [I in keyof A]: Unstubify<A[I]>;
4338
+ };
4339
+ // Utility type for adding `Provider`/`Disposable`s to `object` types only.
4340
+ // Note `unknown & T` is equivalent to `T`.
4341
+ type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
4342
+ type MaybeDisposable<T> = T extends object ? Disposable : unknown;
4343
+ // Type for method return or property on an RPC interface.
4344
+ // - Stubable types are replaced by stubs.
4345
+ // - Serializable types are passed by value, with stubable types replaced by stubs
4346
+ // and a top-level `Disposer`.
4347
+ // Everything else can't be passed over PRC.
4348
+ // Technically, we use custom thenables here, but they quack like `Promise`s.
4349
+ // Intersecting with `(Maybe)Provider` allows pipelining.
4350
+ type Result<R> = R extends Stubable
4351
+ ? Promise<Stub<R>> & Provider<R>
4352
+ : R extends Serializable
4353
+ ? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
4354
+ : never;
4355
+ // Type for method or property on an RPC interface.
4356
+ // For methods, unwrap `Stub`s in parameters, and rewrite returns to be `Result`s.
4357
+ // Unwrapping `Stub`s allows calling with `Stubable` arguments.
4358
+ // For properties, rewrite types to be `Result`s.
4359
+ // In each case, unwrap `Promise`s.
4360
+ type MethodOrProperty<V> = V extends (...args: infer P) => infer R
4361
+ ? (...args: UnstubifyAll<P>) => Result<Awaited<R>>
4362
+ : Result<Awaited<V>>;
4363
+ // Type for the callable part of an `Provider` if `T` is callable.
4364
+ // This is intersected with methods/properties.
4365
+ type MaybeCallableProvider<T> = T extends (...args: any[]) => any
4366
+ ? MethodOrProperty<T>
4367
+ : unknown;
4368
+ // Base type for all other types providing RPC-like interfaces.
4369
+ // Rewrites all methods/properties to be `MethodOrProperty`s, while preserving callable types.
4370
+ // `Reserved` names (e.g. stub method names like `dup()`) and symbols can't be accessed over RPC.
4371
+ export type Provider<
4372
+ T extends object,
4373
+ Reserved extends string = never,
4374
+ > = MaybeCallableProvider<T> & {
4375
+ [K in Exclude<
4376
+ keyof T,
4377
+ Reserved | symbol | keyof StubBase<never>
4378
+ >]: MethodOrProperty<T[K]>;
4379
+ };
4380
+ }
4381
+ // Copyright (c) 2022-2023 Cloudflare, Inc.
4382
+ // Licensed under the Apache 2.0 license found in the LICENSE file or at:
4383
+ // https://opensource.org/licenses/Apache-2.0
4384
+ /**
4385
+ * Data types supported for holding vector metadata.
4386
+ */
4387
+ export type VectorizeVectorMetadataValue = string | number | boolean | string[];
4388
+ /**
4389
+ * Additional information to associate with a vector.
4390
+ */
4391
+ export type VectorizeVectorMetadata =
4392
+ | VectorizeVectorMetadataValue
4393
+ | Record<string, VectorizeVectorMetadataValue>;
4394
+ export type VectorFloatArray = Float32Array | Float64Array;
4395
+ export interface VectorizeError {
4396
+ code?: number;
4397
+ error: string;
4398
+ }
4399
+ /**
4400
+ * Comparison logic/operation to use for metadata filtering.
4401
+ *
4402
+ * This list is expected to grow as support for more operations are released.
4403
+ */
4404
+ export type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
4405
+ /**
4406
+ * Filter criteria for vector metadata used to limit the retrieved query result set.
4407
+ */
4408
+ export type VectorizeVectorMetadataFilter = {
4409
+ [field: string]:
4410
+ | Exclude<VectorizeVectorMetadataValue, string[]>
4411
+ | null
4412
+ | {
4413
+ [Op in VectorizeVectorMetadataFilterOp]?: Exclude<
4414
+ VectorizeVectorMetadataValue,
4415
+ string[]
4416
+ > | null;
4417
+ };
4418
+ };
4419
+ /**
4420
+ * Supported distance metrics for an index.
4421
+ * Distance metrics determine how other "similar" vectors are determined.
4422
+ */
4423
+ export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
4424
+ export interface VectorizeQueryOptions {
4425
+ topK?: number;
4426
+ namespace?: string;
4427
+ returnValues?: boolean;
4428
+ returnMetadata?: boolean;
4429
+ filter?: VectorizeVectorMetadataFilter;
4430
+ }
4431
+ /**
4432
+ * Information about the configuration of an index.
4433
+ */
4434
+ export type VectorizeIndexConfig =
4435
+ | {
4436
+ dimensions: number;
4437
+ metric: VectorizeDistanceMetric;
4438
+ }
4439
+ | {
4440
+ preset: string; // keep this generic, as we'll be adding more presets in the future and this is only in a read capacity
4441
+ };
4442
+ /**
4443
+ * Metadata about an existing index.
4444
+ */
4445
+ export interface VectorizeIndexDetails {
4446
+ /** The unique ID of the index */
4447
+ readonly id: string;
4448
+ /** The name of the index. */
4449
+ name: string;
4450
+ /** (optional) A human readable description for the index. */
4451
+ description?: string;
4452
+ /** The index configuration, including the dimension size and distance metric. */
4453
+ config: VectorizeIndexConfig;
4454
+ /** The number of records containing vectors within the index. */
4455
+ vectorsCount: number;
4456
+ }
4457
+ /**
4458
+ * Represents a single vector value set along with its associated metadata.
4459
+ */
4460
+ export interface VectorizeVector {
4461
+ /** The ID for the vector. This can be user-defined, and must be unique. It should uniquely identify the object, and is best set based on the ID of what the vector represents. */
4462
+ id: string;
4463
+ /** The vector values */
4464
+ values: VectorFloatArray | number[];
4465
+ /** The namespace this vector belongs to. */
4466
+ namespace?: string;
4467
+ /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
4468
+ metadata?: Record<string, VectorizeVectorMetadata>;
4469
+ }
4470
+ /**
4471
+ * Represents a matched vector for a query along with its score and (if specified) the matching vector information.
4472
+ */
4473
+ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
4474
+ Omit<VectorizeVector, "values"> & {
4475
+ /** The score or rank for similarity, when returned as a result */
4476
+ score: number;
4477
+ };
4478
+ /**
4479
+ * A set of vector {@link VectorizeMatch} for a particular query.
4480
+ */
4481
+ export interface VectorizeMatches {
4482
+ matches: VectorizeMatch[];
4483
+ count: number;
4484
+ }
4485
+ /**
4486
+ * Results of an operation that performed a mutation on a set of vectors.
4487
+ * Here, `ids` is a list of vectors that were successfully processed.
4488
+ */
4489
+ export interface VectorizeVectorMutation {
4490
+ /* List of ids of vectors that were successfully processed. */
4491
+ ids: string[];
4492
+ /* Total count of the number of processed vectors. */
4493
+ count: number;
4494
+ }
4495
+ export declare abstract class VectorizeIndex {
4496
+ /**
4497
+ * Get information about the currently bound index.
4498
+ * @returns A promise that resolves with information about the current index.
4499
+ */
4500
+ public describe(): Promise<VectorizeIndexDetails>;
4501
+ /**
4502
+ * Use the provided vector to perform a similarity search across the index.
4503
+ * @param vector Input vector that will be used to drive the similarity search.
4504
+ * @param options Configuration options to massage the returned data.
4505
+ * @returns A promise that resolves with matched and scored vectors.
4506
+ */
4507
+ public query(
4508
+ vector: VectorFloatArray | number[],
4509
+ options: VectorizeQueryOptions,
4510
+ ): Promise<VectorizeMatches>;
4511
+ /**
4512
+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
4513
+ * @param vectors List of vectors that will be inserted.
4514
+ * @returns A promise that resolves with the ids & count of records that were successfully processed.
4515
+ */
4516
+ public insert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
4517
+ /**
4518
+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
4519
+ * @param vectors List of vectors that will be upserted.
4520
+ * @returns A promise that resolves with the ids & count of records that were successfully processed.
4521
+ */
4522
+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeVectorMutation>;
4523
+ /**
4524
+ * Delete a list of vectors with a matching id.
4525
+ * @param ids List of vector ids that should be deleted.
4526
+ * @returns A promise that resolves with the ids & count of records that were successfully processed (and thus deleted).
4527
+ */
4528
+ public deleteByIds(ids: string[]): Promise<VectorizeVectorMutation>;
4529
+ /**
4530
+ * Get a list of vectors with a matching id.
4531
+ * @param ids List of vector ids that should be returned.
4532
+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
4533
+ */
4534
+ public getByIds(ids: string[]): Promise<VectorizeVector[]>;
4535
+ }
4536
+ /**
4537
+ * The interface for "version_metadata" binding
4538
+ * providing metadata about the Worker Version using this binding.
4539
+ */
4540
+ export type WorkerVersionMetadata = {
4541
+ /** The ID of the Worker Version using this binding */
4542
+ id: string;
4543
+ /** The tag of the Worker Version using this binding */
4544
+ tag: string;
4545
+ };
3018
4546
  export interface DynamicDispatchLimits {
3019
4547
  /**
3020
4548
  * Limit CPU time in milliseconds.
@@ -3050,6 +4578,6 @@ export interface DispatchNamespace {
3050
4578
  args?: {
3051
4579
  [key: string]: any;
3052
4580
  },
3053
- options?: DynamicDispatchOptions
4581
+ options?: DynamicDispatchOptions,
3054
4582
  ): Fetcher;
3055
4583
  }