-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathworker-configuration.d.ts
More file actions
10860 lines (10858 loc) · 402 KB
/
worker-configuration.d.ts
File metadata and controls
10860 lines (10858 loc) · 402 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: 49720b982ac25129efb937f1d7da4d85)
// Runtime types generated with workerd@1.20260107.1 2026-01-07 nodejs_compat
declare namespace Cloudflare {
interface Env {
CLOUDFLARE_ACCOUNT_ID: string;
GITHUB_CLIENT_ID: string;
GITHUB_CLIENT_SECRET: string;
BETTER_AUTH_SECRET: string;
BETTER_AUTH_URL: string;
DB: D1Database;
mad_css_db_staging: D1Database;
}
}
interface Env extends Cloudflare.Env {}
type StringifyValues<EnvType extends Record<string, unknown>> = {
[Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
};
declare namespace NodeJS {
interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, "CLOUDFLARE_ACCOUNT_ID" | "GITHUB_CLIENT_ID" | "GITHUB_CLIENT_SECRET" | "BETTER_AUTH_SECRET" | "BETTER_AUTH_URL">> {}
}
// Begin runtime types
/*! *****************************************************************************
Copyright (c) Cloudflare. All rights reserved.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* eslint-disable */
// noinspection JSUnusedGlobalSymbols
declare var onmessage: never;
/**
* The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
*/
declare class DOMException extends Error {
constructor(message?: string, name?: string);
/**
* The **`message`** read-only property of the a message or description associated with the given error name.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
*/
readonly message: string;
/**
* The **`name`** read-only property of the one of the strings associated with an error name.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
*/
readonly name: string;
/**
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
* @deprecated
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
*/
readonly code: number;
static readonly INDEX_SIZE_ERR: number;
static readonly DOMSTRING_SIZE_ERR: number;
static readonly HIERARCHY_REQUEST_ERR: number;
static readonly WRONG_DOCUMENT_ERR: number;
static readonly INVALID_CHARACTER_ERR: number;
static readonly NO_DATA_ALLOWED_ERR: number;
static readonly NO_MODIFICATION_ALLOWED_ERR: number;
static readonly NOT_FOUND_ERR: number;
static readonly NOT_SUPPORTED_ERR: number;
static readonly INUSE_ATTRIBUTE_ERR: number;
static readonly INVALID_STATE_ERR: number;
static readonly SYNTAX_ERR: number;
static readonly INVALID_MODIFICATION_ERR: number;
static readonly NAMESPACE_ERR: number;
static readonly INVALID_ACCESS_ERR: number;
static readonly VALIDATION_ERR: number;
static readonly TYPE_MISMATCH_ERR: number;
static readonly SECURITY_ERR: number;
static readonly NETWORK_ERR: number;
static readonly ABORT_ERR: number;
static readonly URL_MISMATCH_ERR: number;
static readonly QUOTA_EXCEEDED_ERR: number;
static readonly TIMEOUT_ERR: number;
static readonly INVALID_NODE_TYPE_ERR: number;
static readonly DATA_CLONE_ERR: number;
get stack(): any;
set stack(value: any);
}
type WorkerGlobalScopeEventMap = {
fetch: FetchEvent;
scheduled: ScheduledEvent;
queue: QueueEvent;
unhandledrejection: PromiseRejectionEvent;
rejectionhandled: PromiseRejectionEvent;
};
declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
EventTarget: typeof EventTarget;
}
/* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). *
* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox).
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console)
*/
interface Console {
"assert"(condition?: boolean, ...data: any[]): void;
/**
* The **`console.clear()`** static method clears the console if possible.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static)
*/
clear(): void;
/**
* The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
*/
count(label?: string): void;
/**
* The **`console.countReset()`** static method resets counter used with console/count_static.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
*/
countReset(label?: string): void;
/**
* The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
*/
debug(...data: any[]): void;
/**
* The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
*/
dir(item?: any, options?: any): void;
/**
* The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
*/
dirxml(...data: any[]): void;
/**
* The **`console.error()`** static method outputs a message to the console at the 'error' log level.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
*/
error(...data: any[]): void;
/**
* The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
*/
group(...data: any[]): void;
/**
* The **`console.groupCollapsed()`** static method creates a new inline group in the console.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
*/
groupCollapsed(...data: any[]): void;
/**
* The **`console.groupEnd()`** static method exits the current inline group in the console.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
*/
groupEnd(): void;
/**
* The **`console.info()`** static method outputs a message to the console at the 'info' log level.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
*/
info(...data: any[]): void;
/**
* The **`console.log()`** static method outputs a message to the console.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
*/
log(...data: any[]): void;
/**
* The **`console.table()`** static method displays tabular data as a table.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static)
*/
table(tabularData?: any, properties?: string[]): void;
/**
* The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
*/
time(label?: string): void;
/**
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
*/
timeEnd(label?: string): void;
/**
* The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
*/
timeLog(label?: string, ...data: any[]): void;
timeStamp(label?: string): void;
/**
* The **`console.trace()`** static method outputs a stack trace to the console.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static)
*/
trace(...data: any[]): void;
/**
* The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
*/
warn(...data: any[]): void;
}
declare const console: Console;
type BufferSource = ArrayBufferView | ArrayBuffer;
type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
declare namespace WebAssembly {
class CompileError extends Error {
constructor(message?: string);
}
class RuntimeError extends Error {
constructor(message?: string);
}
type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
interface GlobalDescriptor {
value: ValueType;
mutable?: boolean;
}
class Global {
constructor(descriptor: GlobalDescriptor, value?: any);
value: any;
valueOf(): any;
}
type ImportValue = ExportValue | number;
type ModuleImports = Record<string, ImportValue>;
type Imports = Record<string, ModuleImports>;
type ExportValue = Function | Global | Memory | Table;
type Exports = Record<string, ExportValue>;
class Instance {
constructor(module: Module, imports?: Imports);
readonly exports: Exports;
}
interface MemoryDescriptor {
initial: number;
maximum?: number;
shared?: boolean;
}
class Memory {
constructor(descriptor: MemoryDescriptor);
readonly buffer: ArrayBuffer;
grow(delta: number): number;
}
type ImportExportKind = "function" | "global" | "memory" | "table";
interface ModuleExportDescriptor {
kind: ImportExportKind;
name: string;
}
interface ModuleImportDescriptor {
kind: ImportExportKind;
module: string;
name: string;
}
abstract class Module {
static customSections(module: Module, sectionName: string): ArrayBuffer[];
static exports(module: Module): ModuleExportDescriptor[];
static imports(module: Module): ModuleImportDescriptor[];
}
type TableKind = "anyfunc" | "externref";
interface TableDescriptor {
element: TableKind;
initial: number;
maximum?: number;
}
class Table {
constructor(descriptor: TableDescriptor, value?: any);
readonly length: number;
get(index: number): any;
grow(delta: number, value?: any): number;
set(index: number, value?: any): void;
}
function instantiate(module: Module, imports?: Imports): Promise<Instance>;
function validate(bytes: BufferSource): boolean;
}
/**
* The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker.
* Available only in secure contexts.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
*/
interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
DOMException: typeof DOMException;
WorkerGlobalScope: typeof WorkerGlobalScope;
btoa(data: string): string;
atob(data: string): string;
setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
clearTimeout(timeoutId: number | null): void;
setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
clearInterval(timeoutId: number | null): void;
queueMicrotask(task: Function): void;
structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
reportError(error: any): void;
fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;
self: ServiceWorkerGlobalScope;
crypto: Crypto;
caches: CacheStorage;
scheduler: Scheduler;
performance: Performance;
Cloudflare: Cloudflare;
readonly origin: string;
Event: typeof Event;
ExtendableEvent: typeof ExtendableEvent;
CustomEvent: typeof CustomEvent;
PromiseRejectionEvent: typeof PromiseRejectionEvent;
FetchEvent: typeof FetchEvent;
TailEvent: typeof TailEvent;
TraceEvent: typeof TailEvent;
ScheduledEvent: typeof ScheduledEvent;
MessageEvent: typeof MessageEvent;
CloseEvent: typeof CloseEvent;
ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;
ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;
ReadableStream: typeof ReadableStream;
WritableStream: typeof WritableStream;
WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;
TransformStream: typeof TransformStream;
ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
CountQueuingStrategy: typeof CountQueuingStrategy;
ErrorEvent: typeof ErrorEvent;
MessageChannel: typeof MessageChannel;
MessagePort: typeof MessagePort;
EventSource: typeof EventSource;
ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
ReadableByteStreamController: typeof ReadableByteStreamController;
WritableStreamDefaultController: typeof WritableStreamDefaultController;
TransformStreamDefaultController: typeof TransformStreamDefaultController;
CompressionStream: typeof CompressionStream;
DecompressionStream: typeof DecompressionStream;
TextEncoderStream: typeof TextEncoderStream;
TextDecoderStream: typeof TextDecoderStream;
Headers: typeof Headers;
Body: typeof Body;
Request: typeof Request;
Response: typeof Response;
WebSocket: typeof WebSocket;
WebSocketPair: typeof WebSocketPair;
WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
AbortController: typeof AbortController;
AbortSignal: typeof AbortSignal;
TextDecoder: typeof TextDecoder;
TextEncoder: typeof TextEncoder;
navigator: Navigator;
Navigator: typeof Navigator;
URL: typeof URL;
URLSearchParams: typeof URLSearchParams;
URLPattern: typeof URLPattern;
Blob: typeof Blob;
File: typeof File;
FormData: typeof FormData;
Crypto: typeof Crypto;
SubtleCrypto: typeof SubtleCrypto;
CryptoKey: typeof CryptoKey;
CacheStorage: typeof CacheStorage;
Cache: typeof Cache;
FixedLengthStream: typeof FixedLengthStream;
IdentityTransformStream: typeof IdentityTransformStream;
HTMLRewriter: typeof HTMLRewriter;
}
declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(type: Type, handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
/**
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/
declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
declare function btoa(data: string): string;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
declare function atob(data: string): string;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
declare function setTimeout<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */
declare function clearTimeout(timeoutId: number | null): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
declare function setInterval<Args extends any[]>(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */
declare function clearInterval(timeoutId: number | null): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */
declare function queueMicrotask(task: Function): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
declare function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */
declare function reportError(error: any): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */
declare function fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;
declare const self: ServiceWorkerGlobalScope;
/**
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
* The Workers runtime implements the full surface of this API, but with some differences in
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
* compared to those implemented in most browsers.
*
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
*/
declare const crypto: Crypto;
/**
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
*
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
*/
declare const caches: CacheStorage;
declare const scheduler: Scheduler;
/**
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
* as well as timing of subrequests and other operations.
*
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
*/
declare const performance: Performance;
declare const Cloudflare: Cloudflare;
declare const origin: string;
declare const navigator: Navigator;
interface TestController {
}
interface ExecutionContext<Props = unknown> {
waitUntil(promise: Promise<any>): void;
passThroughOnException(): void;
readonly exports: Cloudflare.Exports;
readonly props: Props;
}
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Response | Promise<Response>;
type ExportedHandlerTailHandler<Env = unknown> = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;
type ExportedHandlerTraceHandler<Env = unknown> = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise<void>;
type ExportedHandlerTailStreamHandler<Env = unknown> = (event: TailStream.TailEvent<TailStream.Onset>, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
type ExportedHandlerScheduledHandler<Env = unknown> = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise<void>;
type ExportedHandlerQueueHandler<Env = unknown, Message = unknown> = (batch: MessageBatch<Message>, env: Env, ctx: ExecutionContext) => void | Promise<void>;
type ExportedHandlerTestHandler<Env = unknown> = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise<void>;
interface ExportedHandler<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown> {
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
tail?: ExportedHandlerTailHandler<Env>;
trace?: ExportedHandlerTraceHandler<Env>;
tailStream?: ExportedHandlerTailStreamHandler<Env>;
scheduled?: ExportedHandlerScheduledHandler<Env>;
test?: ExportedHandlerTestHandler<Env>;
email?: EmailExportedHandler<Env>;
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
}
interface StructuredSerializeOptions {
transfer?: any[];
}
declare abstract class Navigator {
sendBeacon(url: string, body?: BodyInit): boolean;
readonly userAgent: string;
readonly hardwareConcurrency: number;
readonly language: string;
readonly languages: string[];
}
interface AlarmInvocationInfo {
readonly isRetry: boolean;
readonly retryCount: number;
}
interface Cloudflare {
readonly compatibilityFlags: Record<string, boolean>;
}
interface DurableObject {
fetch(request: Request): Response | Promise<Response>;
alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>;
webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>;
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
}
type DurableObjectStub<T extends Rpc.DurableObjectBranded | undefined = undefined> = Fetcher<T, "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"> & {
readonly id: DurableObjectId;
readonly name?: string;
};
interface DurableObjectId {
toString(): string;
equals(other: DurableObjectId): boolean;
readonly name?: string;
}
declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {
newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
idFromName(name: string): DurableObjectId;
idFromString(id: string): DurableObjectId;
get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
}
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
interface DurableObjectNamespaceNewUniqueIdOptions {
jurisdiction?: DurableObjectJurisdiction;
}
type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
type DurableObjectRoutingMode = "primary-only";
interface DurableObjectNamespaceGetDurableObjectOptions {
locationHint?: DurableObjectLocationHint;
routingMode?: DurableObjectRoutingMode;
}
interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {
}
interface DurableObjectState<Props = unknown> {
waitUntil(promise: Promise<any>): void;
readonly exports: Cloudflare.Exports;
readonly props: Props;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
getWebSockets(tag?: string): WebSocket[];
setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
getHibernatableWebSocketEventTimeout(): number | null;
getTags(ws: WebSocket): string[];
abort(reason?: string): void;
}
interface DurableObjectTransaction {
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>;
list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>;
put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>;
put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>;
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
rollback(): void;
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
}
interface DurableObjectStorage {
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
get<T = unknown>(keys: string[], options?: DurableObjectGetOptions): Promise<Map<string, T>>;
list<T = unknown>(options?: DurableObjectListOptions): Promise<Map<string, T>>;
put<T>(key: string, value: T, options?: DurableObjectPutOptions): Promise<void>;
put<T>(entries: Record<string, T>, options?: DurableObjectPutOptions): Promise<void>;
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
deleteAll(options?: DurableObjectPutOptions): Promise<void>;
transaction<T>(closure: (txn: DurableObjectTransaction) => Promise<T>): Promise<T>;
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
setAlarm(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
sync(): Promise<void>;
sql: SqlStorage;
kv: SyncKvStorage;
transactionSync<T>(closure: () => T): T;
getCurrentBookmark(): Promise<string>;
getBookmarkForTime(timestamp: number | Date): Promise<string>;
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
}
interface DurableObjectListOptions {
start?: string;
startAfter?: string;
end?: string;
prefix?: string;
reverse?: boolean;
limit?: number;
allowConcurrency?: boolean;
noCache?: boolean;
}
interface DurableObjectGetOptions {
allowConcurrency?: boolean;
noCache?: boolean;
}
interface DurableObjectGetAlarmOptions {
allowConcurrency?: boolean;
}
interface DurableObjectPutOptions {
allowConcurrency?: boolean;
allowUnconfirmed?: boolean;
noCache?: boolean;
}
interface DurableObjectSetAlarmOptions {
allowConcurrency?: boolean;
allowUnconfirmed?: boolean;
}
declare class WebSocketRequestResponsePair {
constructor(request: string, response: string);
get request(): string;
get response(): string;
}
interface AnalyticsEngineDataset {
writeDataPoint(event?: AnalyticsEngineDataPoint): void;
}
interface AnalyticsEngineDataPoint {
indexes?: ((ArrayBuffer | string) | null)[];
doubles?: number[];
blobs?: ((ArrayBuffer | string) | null)[];
}
/**
* The **`Event`** interface represents an event which takes place on an `EventTarget`.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event)
*/
declare class Event {
constructor(type: string, init?: EventInit);
/**
* The **`type`** read-only property of the Event interface returns a string containing the event's type.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type)
*/
get type(): string;
/**
* The **`eventPhase`** read-only property of the being evaluated.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
*/
get eventPhase(): number;
/**
* The read-only **`composed`** property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed)
*/
get composed(): boolean;
/**
* The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
*/
get bubbles(): boolean;
/**
* The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
*/
get cancelable(): boolean;
/**
* The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
*/
get defaultPrevented(): boolean;
/**
* The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not.
* @deprecated
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue)
*/
get returnValue(): boolean;
/**
* The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
*/
get currentTarget(): EventTarget | undefined;
/**
* The read-only **`target`** property of the dispatched.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target)
*/
get target(): EventTarget | undefined;
/**
* The deprecated **`Event.srcElement`** is an alias for the Event.target property.
* @deprecated
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement)
*/
get srcElement(): EventTarget | undefined;
/**
* The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
*/
get timeStamp(): number;
/**
* The **`isTrusted`** read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and `false` when the event was dispatched via The only exception is the `click` event, which initializes the `isTrusted` property to `false` in user agents.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
*/
get isTrusted(): boolean;
/**
* The **`cancelBubble`** property of the Event interface is deprecated.
* @deprecated
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
*/
get cancelBubble(): boolean;
/**
* The **`cancelBubble`** property of the Event interface is deprecated.
* @deprecated
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble)
*/
set cancelBubble(value: boolean);
/**
* The **`stopImmediatePropagation()`** method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
*/
stopImmediatePropagation(): void;
/**
* The **`preventDefault()`** method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
*/
preventDefault(): void;
/**
* The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
*/
stopPropagation(): void;
/**
* The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
*/
composedPath(): EventTarget[];
static readonly NONE: number;
static readonly CAPTURING_PHASE: number;
static readonly AT_TARGET: number;
static readonly BUBBLING_PHASE: number;
}
interface EventInit {
bubbles?: boolean;
cancelable?: boolean;
composed?: boolean;
}
type EventListener<EventType extends Event = Event> = (event: EventType) => void;
interface EventListenerObject<EventType extends Event = Event> {
handleEvent(event: EventType): void;
}
type EventListenerOrEventListenerObject<EventType extends Event = Event> = EventListener<EventType> | EventListenerObject<EventType>;
/**
* The **`EventTarget`** interface is implemented by objects that can receive events and may have listeners for them.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget)
*/
declare class EventTarget<EventMap extends Record<string, Event> = Record<string, Event>> {
constructor();
/**
* The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
*/
addEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetAddEventListenerOptions | boolean): void;
/**
* The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
*/
removeEventListener<Type extends keyof EventMap>(type: Type, handler: EventListenerOrEventListenerObject<EventMap[Type]>, options?: EventTargetEventListenerOptions | boolean): void;
/**
* The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/
dispatchEvent(event: EventMap[keyof EventMap]): boolean;
}
interface EventTargetEventListenerOptions {
capture?: boolean;
}
interface EventTargetAddEventListenerOptions {
capture?: boolean;
passive?: boolean;
once?: boolean;
signal?: AbortSignal;
}
interface EventTargetHandlerObject {
handleEvent: (event: Event) => any | undefined;
}
/**
* The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController)
*/
declare class AbortController {
constructor();
/**
* The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal)
*/
get signal(): AbortSignal;
/**
* The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort)
*/
abort(reason?: any): void;
}
/**
* The **`AbortSignal`** interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal)
*/
declare abstract class AbortSignal extends EventTarget {
/**
* The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event).
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static)
*/
static abort(reason?: any): AbortSignal;
/**
* The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static)
*/
static timeout(delay: number): AbortSignal;
/**
* The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static)
*/
static any(signals: AbortSignal[]): AbortSignal;
/**
* The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`).
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted)
*/
get aborted(): boolean;
/**
* The **`reason`** read-only property returns a JavaScript value that indicates the abort reason.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason)
*/
get reason(): any;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
get onabort(): any | null;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */
set onabort(value: any | null);
/**
* The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted)
*/
throwIfAborted(): void;
}
interface Scheduler {
wait(delay: number, maybeOptions?: SchedulerWaitOptions): Promise<void>;
}
interface SchedulerWaitOptions {
signal?: AbortSignal;
}
/**
* The **`ExtendableEvent`** interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent)
*/
declare abstract class ExtendableEvent extends Event {
/**
* The **`ExtendableEvent.waitUntil()`** method tells the event dispatcher that work is ongoing.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil)
*/
waitUntil(promise: Promise<any>): void;
}
/**
* The **`CustomEvent`** interface represents events initialized by an application for any purpose.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent)
*/
declare class CustomEvent<T = any> extends Event {
constructor(type: string, init?: CustomEventCustomEventInit);
/**
* The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail)
*/
get detail(): T;
}
interface CustomEventCustomEventInit {
bubbles?: boolean;
cancelable?: boolean;
composed?: boolean;
detail?: any;
}
/**
* The **`Blob`** interface represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a ReadableStream so its methods can be used for processing the data.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
*/
declare class Blob {
constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
/**
* The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size)
*/
get size(): number;
/**
* The **`type`** read-only property of the Blob interface returns the MIME type of the file.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type)
*/
get type(): string;
/**
* The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice)
*/
slice(start?: number, end?: number, type?: string): Blob;
/**
* The **`arrayBuffer()`** method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer)
*/
arrayBuffer(): Promise<ArrayBuffer>;
/**
* The **`bytes()`** method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes)
*/
bytes(): Promise<Uint8Array>;
/**
* The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text)
*/
text(): Promise<string>;
/**
* The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream)
*/
stream(): ReadableStream;
}
interface BlobOptions {
type?: string;
}
/**
* The **`File`** interface provides information about files and allows JavaScript in a web page to access their content.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File)
*/
declare class File extends Blob {
constructor(bits: ((ArrayBuffer | ArrayBufferView) | string | Blob)[] | undefined, name: string, options?: FileOptions);
/**
* The **`name`** read-only property of the File interface returns the name of the file represented by a File object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name)
*/
get name(): string;
/**
* The **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified)
*/
get lastModified(): number;
}
interface FileOptions {
type?: string;
lastModified?: number;
}
/**
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
*
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
*/
declare abstract class CacheStorage {
/**
* The **`open()`** method of the the Cache object matching the `cacheName`.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open)
*/
open(cacheName: string): Promise<Cache>;
readonly default: Cache;
}
/**
* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
*
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
*/
declare abstract class Cache {
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>;
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>;
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
put(request: RequestInfo | URL, response: Response): Promise<void>;
}
interface CacheQueryOptions {
ignoreMethod?: boolean;
}
/**
* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
* The Workers runtime implements the full surface of this API, but with some differences in
* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
* compared to those implemented in most browsers.
*
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
*/
declare abstract class Crypto {