deno.land / x / diplodocus@0.0.3 / _deploy.d.ts

_deploy.d.ts
View Documentation
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
// Copyright 2018-2021 Deno Land Inc. All rights reserved. MIT license.
// deno-lint-ignore-file
/// <reference no-default-lib="true" />/// <reference lib="esnext" />
/** Deno provides extra properties on `import.meta`. These are included here * to ensure that these are still available when using the Deno namespace in * conjunction with other type libs, like `dom`. */declare interface ImportMeta { /** A string representation of the fully qualified module URL. */ url: string;
/** A flag that indicates if the current module is the main module that was * called when starting the program under Deno. * * ```ts * if (import.meta.main) { * // this was loaded as the main module, maybe do some bootstrapping * } * ``` */ main: boolean;}
declare namespace Deno { export const env: { /** Retrieve the value of an environment variable. Returns undefined if that * key doesn't exist. * * ```ts * console.log(Deno.env.get("HOME")); // e.g. outputs "/home/alice" * console.log(Deno.env.get("MADE_UP_VAR")); // outputs "Undefined" * ``` */ get(key: string): string | undefined;
/** Set the value of an environment variable. * * ```ts * Deno.env.set("SOME_VAR", "Value")); * Deno.env.get("SOME_VAR"); // outputs "Value" * ``` */ set(key: string, value: string): void;
/** Delete the value of an environment variable. * * ```ts * Deno.env.set("SOME_VAR", "Value")); * Deno.env.delete("SOME_VAR"); // outputs "Undefined" * ``` */ delete(key: string): void;
/** Returns a snapshot of the environment variables at invocation. * * ```ts * Deno.env.set("TEST_VAR", "A"); * const myEnv = Deno.env.toObject(); * console.log(myEnv.SHELL); * Deno.env.set("TEST_VAR", "B"); * console.log(myEnv.TEST_VAR); // outputs "A" * ``` */ toObject(): { [index: string]: string }; };
/** Build related information. */ export const build: { /** The LLVM target triple */ target: string; /** Instruction set architecture */ arch: "x86_64"; /** Operating system */ os: "darwin" | "linux" | "windows"; /** Computer vendor */ vendor: string; /** Optional environment */ env?: string; };
/** Reflects the `NO_COLOR` environment variable. This is always set to `true` * on Deno Deploy, as the logs page supports ANSI colors. * * See: https://no-color.org/ */ export const noColor: boolean;
export interface InspectOptions { /** Stylize output with ANSI colors. Defaults to false. */ colors?: boolean; /** Try to fit more than one entry of a collection on the same line. * Defaults to true. */ compact?: boolean; /** Traversal depth for nested objects. Defaults to 4. */ depth?: number; /** The maximum number of iterable entries to print. Defaults to 100. */ iterableLimit?: number; /** Show a Proxy's target and handler. Defaults to false. */ showProxy?: boolean; /** Sort Object, Set and Map entries by key. Defaults to false. */ sorted?: boolean; /** Add a trailing comma for multiline collections. Defaults to false. */ trailingComma?: boolean; /*** Evaluate the result of calling getters. Defaults to false. */ getters?: boolean; /** Show an object's non-enumerable properties. Defaults to false. */ showHidden?: boolean; }
/** Converts the input into a string that has the same format as printed by * `console.log()`. * * ```ts * const obj = {}; * obj.propA = 10; * obj.propB = "hello"; * const objAsString = Deno.inspect(obj); // { propA: 10, propB: "hello" } * console.log(obj); // prints same value as objAsString, e.g. { propA: 10, propB: "hello" } * ``` * * You can also register custom inspect functions, via the `customInspect` Deno * symbol on objects, to control and customize the output. * * ```ts * class A { * x = 10; * y = "hello"; * [Deno.customInspect](): string { * return "x=" + this.x + ", y=" + this.y; * } * } * ``` * * const inStringFormat = Deno.inspect(new A()); // "x=10, y=hello" * console.log(inStringFormat); // prints "x=10, y=hello" * * Finally, you can also specify the depth to which it will format. * * Deno.inspect({a: {b: {c: {d: 'hello'}}}}, {depth: 2}); // { a: { b: [Object] } } */ export function inspect(value: unknown, options?: InspectOptions): string;
export interface NetAddr { transport: "tcp" | "udp"; hostname: string; port: number; }
export type Addr = NetAddr;
export interface Reader { /** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of * bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error * encountered. Even if `read()` resolves to `n` < `p.byteLength`, it may * use all of `p` as scratch space during the call. If some data is * available but not `p.byteLength` bytes, `read()` conventionally resolves * to what is available instead of waiting for more. * * When `read()` encounters end-of-file condition, it resolves to EOF * (`null`). * * When `read()` encounters an error, it rejects with an error. * * Callers should always process the `n` > `0` bytes returned before * considering the EOF (`null`). Doing so correctly handles I/O errors that * happen after reading some bytes and also both of the allowed EOF * behaviors. * * Implementations should not retain a reference to `p`. * * Use iter() from https://deno.land/std/io/util.ts to turn a Reader into an * AsyncIterator. */ read(p: Uint8Array): Promise<number | null>; }
export interface Writer { /** Writes `p.byteLength` bytes from `p` to the underlying data stream. It * resolves to the number of bytes written from `p` (`0` <= `n` <= * `p.byteLength`) or reject with the error encountered that caused the * write to stop early. `write()` must reject with a non-null error if * would resolve to `n` < `p.byteLength`. `write()` must not modify the * slice data, even temporarily. * * Implementations should not retain a reference to `p`. */ write(p: Uint8Array): Promise<number>; }
export interface Closer { close(): void; }
export interface Conn extends Reader, Writer, Closer { /** The local address of the connection. */ readonly localAddr: Addr; /** The remote address of the connection. */ readonly remoteAddr: Addr; /** The resource ID of the connection. */ readonly rid: number; /** Shuts down (`shutdown(2)`) the write side of the connection. Most * callers should just use `close()`. */ closeWrite(): Promise<void>; }
/** A generic network listener for stream-oriented protocols. */ export interface Listener extends AsyncIterable<Conn> { /** Waits for and resolves to the next connection to the `Listener`. */ accept(): Promise<Conn>; /** Close closes the listener. Any pending accept promises will be rejected * with errors. */ close(): void; /** Return the address of the `Listener`. */ readonly addr: Addr;
/** Return the rid of the `Listener`. */ readonly rid: number;
[Symbol.asyncIterator](): AsyncIterableIterator<Conn>; }
export interface ListenOptions { /** The port to listen on. */ port: number; /** A literal IP address or host name that can be resolved to an IP address. * If not specified, defaults to `0.0.0.0`. */ hostname?: string; }
/** Listen announces on the local transport address. * * ```ts * const listener1 = Deno.listen({ port: 80 }) * const listener2 = Deno.listen({ hostname: "192.0.2.1", port: 80 }) * const listener3 = Deno.listen({ hostname: "[2001:db8::1]", port: 80 }); * const listener4 = Deno.listen({ hostname: "golang.org", port: 80, transport: "tcp" }); * ``` * * Requires `allow-net` permission. */ export function listen( options: ListenOptions & { transport?: "tcp" }, ): Listener;
export interface RequestEvent { readonly request: Request; respondWith(r: Response | Promise<Response>): Promise<void>; }
export interface HttpConn extends AsyncIterable<RequestEvent> { readonly rid: number;
nextRequest(): Promise<RequestEvent | null>; close(): void; }
/** * Services HTTP requests given a TCP or TLS socket. * * ```ts * const conn = await Deno.connect({ port: 80, hostname: "127.0.0.1" }); * const httpConn = Deno.serveHttp(conn); * const e = await httpConn.nextRequest(); * if (e) { * e.respondWith(new Response("Hello World")); * } * ``` * * If `httpConn.nextRequest()` encounters an error or returns `null` * then the underlying HttpConn resource is closed automatically. * * Alternatively, you can also use the Async Iterator approach: * * ```ts * async function handleHttp(conn: Deno.Conn) { * for await (const e of Deno.serveHttp(conn)) { * e.respondWith(new Response("Hello World")); * } * } * * for await (const conn of Deno.listen({ port: 80 })) { * handleHttp(conn); * } * ``` */ export function serveHttp(conn: Conn): HttpConn;
export interface WebSocketUpgrade { response: Response; socket: WebSocket; }
export interface UpgradeWebSocketOptions { protocol?: string; }
/** Used to upgrade an incoming HTTP request to a WebSocket. * * Given a request, returns a pair of WebSocket and Response. The original * request must be responded to with the returned response for the websocket * upgrade to be successful. * * ```ts * const conn = await Deno.connect({ port: 80, hostname: "127.0.0.1" }); * const httpConn = Deno.serveHttp(conn); * const e = await httpConn.nextRequest(); * if (e) { * const { socket, response } = Deno.upgradeWebSocket(e.request); * socket.onopen = () => { * socket.send("Hello World!"); * }; * socket.onmessage = (e) => { * console.log(e.data); * socket.close(); * }; * socket.onclose = () => console.log("WebSocket has been closed."); * socket.onerror = (e) => console.error("WebSocket error:", e.message); * e.respondWith(response); * } * ``` * * If the request body is disturbed (read from) before the upgrade is * completed, upgrading fails. * * This operation does not yet consume the request or open the websocket. This * only happens once the returned response has been passed to `respondWith`. */ export function upgradeWebSocket( request: Request, options?: UpgradeWebSocketOptions, ): WebSocketUpgrade;
/** Asynchronously reads and returns the entire contents of a file as utf8 * encoded string. Reading a directory throws an error. * * ```ts * const data = await Deno.readTextFile("hello.txt"); * console.log(data); * ``` */ export function readTextFile(path: string | URL): Promise<string>;
/** Reads and resolves to the entire contents of a file as an array of bytes. * `TextDecoder` can be used to transform the bytes to string if required. * Reading a directory returns an empty data array. * * ```ts * const decoder = new TextDecoder("utf-8"); * const data = await Deno.readFile("hello.txt"); * console.log(decoder.decode(data)); * ``` */ export function readFile(path: string | URL): Promise<Uint8Array>;
/** * Return a string representing the current working directory. * * If the current directory can be reached via multiple paths (due to symbolic * links), `cwd()` may return any one of them. * * ```ts * const currentWorkingDirectory = Deno.cwd(); * ``` * * Throws `Deno.errors.NotFound` if directory not available. */ export function cwd(): string;}
// Copyright 2018-2021 Deno Land Inc. All rights reserved. MIT license.
// deno-lint-ignore-file
// Documentation partially adapted from [MDN](https://developer.mozilla.org/),// by Mozilla Contributors, which is licensed under CC-BY-SA 2.5.
/// <reference no-default-lib="true" />/// <reference lib="esnext" />
declare class DOMException extends Error { constructor(message?: string, name?: string); readonly name: string; readonly message: string; readonly code: number;}
interface EventInit { bubbles?: boolean; cancelable?: boolean; composed?: boolean;}
/** An event which takes place in the DOM. */declare class Event { constructor(type: string, eventInitDict?: EventInit); /** 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. */ readonly bubbles: boolean; cancelBubble: boolean; /** 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. */ readonly cancelable: boolean; /** 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. */ readonly composed: boolean; /** Returns the object whose event listener's callback is currently being * invoked. */ readonly currentTarget: EventTarget | null; /** Returns true if preventDefault() was invoked successfully to indicate * cancellation, and false otherwise. */ readonly defaultPrevented: boolean; /** Returns the event's phase, which is one of NONE, CAPTURING_PHASE, * AT_TARGET, and BUBBLING_PHASE. */ readonly eventPhase: number; /** Returns true if event was dispatched by the user agent, and false * otherwise. */ readonly isTrusted: boolean; /** Returns the object to which event is dispatched (its target). */ readonly target: EventTarget | null; /** Returns the event's timestamp as the number of milliseconds measured * relative to the time origin. */ readonly timeStamp: number; /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ readonly type: string; /** 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. */ composedPath(): EventTarget[]; /** 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. */ preventDefault(): void; /** 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. */ stopImmediatePropagation(): void; /** When dispatched in a tree, invoking this method prevents event from * reaching any objects other than the current object. */ stopPropagation(): void; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; readonly CAPTURING_PHASE: number; readonly NONE: number; static readonly AT_TARGET: number; static readonly BUBBLING_PHASE: number; static readonly CAPTURING_PHASE: number; static readonly NONE: number;}
/** * EventTarget is a DOM interface implemented by objects that can receive events * and may have listeners for them. */declare class EventTarget { /** 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. * * 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. * * 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. * * 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. * * When set to true, options's once indicates that the callback will only be * invoked once after which the event listener will be removed. * * The event listener is appended to target's event listener list and is not * appended if it has the same type, callback, and capture. */ addEventListener( type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions, ): void; /** 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. */ dispatchEvent(event: Event): boolean; /** Removes the event listener in target's event listener list with the same * type, callback, and options. */ removeEventListener( type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean, ): void; [Symbol.toStringTag]: string;}
interface EventListener<Evt extends Event = Event> { (evt: Evt): void | Promise<void>;}
interface EventListenerObject<Evt extends Event = Event> { handleEvent(evt: Evt): void | Promise<void>;}
declare type EventListenerOrEventListenerObject<Evt extends Event = Event> = | EventListener<Evt> | EventListenerObject<Evt>;
interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean;}
interface EventListenerOptions { capture?: boolean;}
interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; total?: number;}
/** Events measuring progress of an underlying process, like an HTTP request * (for an XMLHttpRequest, or the loading of the underlying resource of an * <img>, <audio>, <video>, <style> or <link>). */declare class ProgressEvent<T extends EventTarget = EventTarget> extends Event { constructor(type: string, eventInitDict?: ProgressEventInit); readonly lengthComputable: boolean; readonly loaded: number; readonly target: T | null; readonly total: number;}
/** Decodes a string of data which has been encoded using base-64 encoding. * * console.log(atob("aGVsbG8gd29ybGQ=")); // outputs 'hello world' */declare function atob(s: string): string;
/** Creates a base-64 ASCII encoded string from the input string. * * console.log(btoa("hello world")); // outputs "aGVsbG8gd29ybGQ=" */declare function btoa(s: string): string;
declare class TextDecoder { /** Returns encoding's name, lowercased. */ readonly encoding: string; /** Returns `true` if error mode is "fatal", and `false` otherwise. */ readonly fatal: boolean; /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ readonly ignoreBOM = false; constructor( label?: string, options?: { fatal?: boolean; ignoreBOM?: boolean }, ); /** Returns the result of running encoding's decoder. */ decode(input?: BufferSource, options?: { stream?: false }): string; readonly [Symbol.toStringTag]: string;}
declare class TextEncoder { /** Returns "utf-8". */ readonly encoding = "utf-8"; /** Returns the result of running UTF-8's encoder. */ encode(input?: string): Uint8Array; encodeInto( input: string, dest: Uint8Array, ): { read: number; written: number }; readonly [Symbol.toStringTag]: string;}
/** A controller object that allows you to abort one or more DOM requests as and * when desired. */declare class AbortController { /** Returns the AbortSignal object associated with this object. */ readonly signal: AbortSignal; /** 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. */ abort(): void;}
interface AbortSignalEventMap { abort: Event;}
/** A signal object that allows you to communicate with a DOM request (such as a * Fetch) and abort it if required via an AbortController object. */interface AbortSignal extends EventTarget { /** Returns true if this AbortSignal's AbortController has signaled to abort, * and false otherwise. */ readonly aborted: boolean; onabort: ((this: AbortSignal, ev: Event) => any) | null; addEventListener<K extends keyof AbortSignalEventMap>( type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions, ): void; addEventListener( type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions, ): void; removeEventListener<K extends keyof AbortSignalEventMap>( type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions, ): void; removeEventListener( type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions, ): void;}
declare var AbortSignal: { prototype: AbortSignal; new (): AbortSignal;};
interface FileReaderEventMap { abort: ProgressEvent<FileReader>; error: ProgressEvent<FileReader>; load: ProgressEvent<FileReader>; loadend: ProgressEvent<FileReader>; loadstart: ProgressEvent<FileReader>; progress: ProgressEvent<FileReader>;}
/** Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */interface FileReader extends EventTarget { readonly error: DOMException | null; onabort: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; onerror: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; onloadstart: | ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null; readonly readyState: number; readonly result: string | ArrayBuffer | null; abort(): void; readAsArrayBuffer(blob: Blob): void; readAsBinaryString(blob: Blob): void; readAsDataURL(blob: Blob): void; readAsText(blob: Blob, encoding?: string): void; readonly DONE: number; readonly EMPTY: number; readonly LOADING: number; addEventListener<K extends keyof FileReaderEventMap>( type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions, ): void; addEventListener( type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions, ): void; removeEventListener<K extends keyof FileReaderEventMap>( type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions, ): void; removeEventListener( type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions, ): void;}
declare var FileReader: { prototype: FileReader; new (): FileReader; readonly DONE: number; readonly EMPTY: number; readonly LOADING: number;};
declare class URLSearchParams { constructor( init?: string[][] | Record<string, string> | string | URLSearchParams, ); static toString(): string;
/** Appends a specified key/value pair as a new search parameter. * * ```ts * let searchParams = new URLSearchParams(); * searchParams.append('name', 'first'); * searchParams.append('name', 'second'); * ``` */ append(name: string, value: string): void;
/** Deletes the given search parameter and its associated value, * from the list of all search parameters. * * ```ts * let searchParams = new URLSearchParams([['name', 'value']]); * searchParams.delete('name'); * ``` */ delete(name: string): void;
/** Returns all the values associated with a given search parameter * as an array. * * ```ts * searchParams.getAll('name'); * ``` */ getAll(name: string): string[];
/** Returns the first value associated to the given search parameter. * * ```ts * searchParams.get('name'); * ``` */ get(name: string): string | null;
/** Returns a Boolean that indicates whether a parameter with the * specified name exists. * * ```ts * searchParams.has('name'); * ``` */ has(name: string): boolean;
/** Sets the value associated with a given search parameter to the * given value. If there were several matching values, this method * deletes the others. If the search parameter doesn't exist, this * method creates it. * * ```ts * searchParams.set('name', 'value'); * ``` */ set(name: string, value: string): void;
/** Sort all key/value pairs contained in this object in place and * return undefined. The sort order is according to Unicode code * points of the keys. * * ```ts * searchParams.sort(); * ``` */ sort(): void;
/** Calls a function for each element contained in this object in * place and return undefined. Optionally accepts an object to use * as this when executing callback as second argument. * * ```ts * const params = new URLSearchParams([["a", "b"], ["c", "d"]]); * params.forEach((value, key, parent) => { * console.log(value, key, parent); * }); * ``` */ forEach( callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any, ): void;
/** Returns an iterator allowing to go through all keys contained * in this object. * * ```ts * const params = new URLSearchParams([["a", "b"], ["c", "d"]]); * for (const key of params.keys()) { * console.log(key); * } * ``` */ keys(): IterableIterator<string>;
/** Returns an iterator allowing to go through all values contained * in this object. * * ```ts * const params = new URLSearchParams([["a", "b"], ["c", "d"]]); * for (const value of params.values()) { * console.log(value); * } * ``` */ values(): IterableIterator<string>;
/** Returns an iterator allowing to go through all key/value * pairs contained in this object. * * ```ts * const params = new URLSearchParams([["a", "b"], ["c", "d"]]); * for (const [key, value] of params.entries()) { * console.log(key, value); * } * ``` */ entries(): IterableIterator<[string, string]>;
/** Returns an iterator allowing to go through all key/value * pairs contained in this object. * * ```ts * const params = new URLSearchParams([["a", "b"], ["c", "d"]]); * for (const [key, value] of params) { * console.log(key, value); * } * ``` */ [Symbol.iterator](): IterableIterator<[string, string]>;
/** Returns a query string suitable for use in a URL. * * ```ts * searchParams.toString(); * ``` */ toString(): string;}
/** The URL interface represents an object providing static methods used for creating object URLs. */declare class URL { constructor(url: string, base?: string | URL); createObjectURL(object: any): string; revokeObjectURL(url: string): void;
hash: string; host: string; hostname: string; href: string; toString(): string; readonly origin: string; password: string; pathname: string; port: string; protocol: string; search: string; readonly searchParams: URLSearchParams; username: string; toJSON(): string;}
interface DomIterable<K, V> { keys(): IterableIterator<K>; values(): IterableIterator<V>; entries(): IterableIterator<[K, V]>; [Symbol.iterator](): IterableIterator<[K, V]>; forEach( callback: (value: V, key: K, parent: this) => void, thisArg?: any, ): void;}
interface ReadableStreamReadDoneResult<T> { done: true; value?: T;}
interface ReadableStreamReadValueResult<T> { done: false; value: T;}
type ReadableStreamReadResult<T> = | ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
interface ReadableStreamDefaultReader<R = any> { readonly closed: Promise<void>; cancel(reason?: any): Promise<void>; read(): Promise<ReadableStreamReadResult<R>>; releaseLock(): void;}
declare var ReadableStreamDefaultReader: { prototype: ReadableStreamDefaultReader; new <R>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;};
interface ReadableStreamReader<R = any> { cancel(): Promise<void>; read(): Promise<ReadableStreamReadResult<R>>; releaseLock(): void;}
declare var ReadableStreamReader: { prototype: ReadableStreamReader; new (): ReadableStreamReader;};
interface ReadableByteStreamControllerCallback { (controller: ReadableByteStreamController): void | PromiseLike<void>;}
interface UnderlyingByteSource { autoAllocateChunkSize?: number; cancel?: ReadableStreamErrorCallback; pull?: ReadableByteStreamControllerCallback; start?: ReadableByteStreamControllerCallback; type: "bytes";}
interface UnderlyingSink<W = any> { abort?: WritableStreamErrorCallback; close?: WritableStreamDefaultControllerCloseCallback; start?: WritableStreamDefaultControllerStartCallback; type?: undefined; write?: WritableStreamDefaultControllerWriteCallback<W>;}
interface UnderlyingSource<R = any> { cancel?: ReadableStreamErrorCallback; pull?: ReadableStreamDefaultControllerCallback<R>; start?: ReadableStreamDefaultControllerCallback<R>; type?: undefined;}
interface ReadableStreamErrorCallback { (reason: any): void | PromiseLike<void>;}
interface ReadableStreamDefaultControllerCallback<R> { (controller: ReadableStreamDefaultController<R>): void | PromiseLike<void>;}
interface ReadableStreamDefaultController<R = any> { readonly desiredSize: number | null; close(): void; enqueue(chunk: R): void; error(error?: any): void;}
declare var ReadableStreamDefaultController: { prototype: ReadableStreamDefaultController; new (): ReadableStreamDefaultController;};
interface ReadableByteStreamController { readonly byobRequest: undefined; readonly desiredSize: number | null; close(): void; enqueue(chunk: ArrayBufferView): void; error(error?: any): void;}
declare var ReadableByteStreamController: { prototype: ReadableByteStreamController; new (): ReadableByteStreamController;};
interface PipeOptions { preventAbort?: boolean; preventCancel?: boolean; preventClose?: boolean; signal?: AbortSignal;}
interface QueuingStrategySizeCallback<T = any> { (chunk: T): number;}
interface QueuingStrategy<T = any> { highWaterMark?: number; size?: QueuingStrategySizeCallback<T>;}
/** This Streams API interface provides a built-in byte length queuing strategy * that can be used when constructing streams. */declare class CountQueuingStrategy implements QueuingStrategy { constructor(options: { highWaterMark: number }); highWaterMark: number; size(chunk: any): 1;}
declare class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> { constructor(options: { highWaterMark: number }); highWaterMark: number; size(chunk: ArrayBufferView): number;}
/** 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. */interface ReadableStream<R = any> { readonly locked: boolean; cancel(reason?: any): Promise<void>; /** * @deprecated This is no longer part of the Streams standard and the async * iterable should be obtained by just using the stream as an * async iterator. */ getIterator(options?: { preventCancel?: boolean }): AsyncIterableIterator<R>; getReader(): ReadableStreamDefaultReader<R>; pipeThrough<T>( { writable, readable, }: { writable: WritableStream<R>; readable: ReadableStream<T>; }, options?: PipeOptions, ): ReadableStream<T>; pipeTo(dest: WritableStream<R>, options?: PipeOptions): Promise<void>; tee(): [ReadableStream<R>, ReadableStream<R>]; [Symbol.asyncIterator](options?: { preventCancel?: boolean; }): AsyncIterableIterator<R>;}
declare var ReadableStream: { prototype: ReadableStream; new ( underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number; size?: undefined }, ): ReadableStream<Uint8Array>; new <R = any>( underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>, ): ReadableStream<R>;};
interface WritableStreamDefaultControllerCloseCallback { (): void | PromiseLike<void>;}
interface WritableStreamDefaultControllerStartCallback { (controller: WritableStreamDefaultController): void | PromiseLike<void>;}
interface WritableStreamDefaultControllerWriteCallback<W> { ( chunk: W, controller: WritableStreamDefaultController, ): void | PromiseLike<void>;}
interface WritableStreamErrorCallback { (reason: any): void | PromiseLike<void>;}
/** This Streams API interface provides a standard abstraction for writing * streaming data to a destination, known as a sink. This object comes with * built-in backpressure and queuing. */interface WritableStream<W = any> { readonly locked: boolean; abort(reason?: any): Promise<void>; getWriter(): WritableStreamDefaultWriter<W>;}
declare var WritableStream: { prototype: WritableStream; new <W = any>( underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>, ): WritableStream<W>;};
/** 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. */interface WritableStreamDefaultController { error(error?: any): void;}
/** This Streams API interface is the object returned by * WritableStream.getWriter() and once created locks the < writer to the * WritableStream ensuring that no other streams can write to the underlying * sink. */interface WritableStreamDefaultWriter<W = any> { readonly closed: Promise<void>; readonly desiredSize: number | null; readonly ready: Promise<void>; abort(reason?: any): Promise<void>; close(): Promise<void>; releaseLock(): void; write(chunk: W): Promise<void>;}
declare var WritableStreamDefaultWriter: { prototype: WritableStreamDefaultWriter; new (): WritableStreamDefaultWriter;};
interface TransformStream<I = any, O = any> { readonly readable: ReadableStream<O>; readonly writable: WritableStream<I>;}
declare var TransformStream: { prototype: TransformStream; new <I = any, O = any>( transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>, ): TransformStream<I, O>;};
interface TransformStreamDefaultController<O = any> { readonly desiredSize: number | null; enqueue(chunk: O): void; error(reason?: any): void; terminate(): void;}
interface Transformer<I = any, O = any> { flush?: TransformStreamDefaultControllerCallback<O>; readableType?: undefined; start?: TransformStreamDefaultControllerCallback<O>; transform?: TransformStreamDefaultControllerTransformCallback<I, O>; writableType?: undefined;}
interface TransformStreamDefaultControllerCallback<O> { (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;}
interface TransformStreamDefaultControllerTransformCallback<I, O> { ( chunk: I, controller: TransformStreamDefaultController<O>, ): void | PromiseLike<void>;}
type BlobPart = BufferSource | Blob | string;
interface BlobPropertyBag { type?: string; endings?: "transparent" | "native";}
/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */declare class Blob { constructor(blobParts?: BlobPart[], options?: BlobPropertyBag);
readonly size: number; readonly type: string; arrayBuffer(): Promise<ArrayBuffer>; slice(start?: number, end?: number, contentType?: string): Blob; stream(): ReadableStream; text(): Promise<string>;}
interface FilePropertyBag extends BlobPropertyBag { lastModified?: number;}
/** Provides information about files and allows JavaScript in a web page to * access their content. */declare class File extends Blob { constructor( fileBits: BlobPart[], fileName: string, options?: FilePropertyBag, );
readonly lastModified: number; readonly name: string;}
type FormDataEntryValue = File | string;
/** Provides a way to easily construct a set of key/value pairs representing * form fields and their values, which can then be easily sent using the * XMLHttpRequest.send() method. It uses the same format a form would use if the * encoding type were set to "multipart/form-data". */declare class FormData implements DomIterable<string, FormDataEntryValue> { // TODO(ry) FormData constructor is non-standard. // new(form?: HTMLFormElement): FormData; constructor();
append(name: string, value: string | Blob, fileName?: string): void; delete(name: string): void; get(name: string): FormDataEntryValue | null; getAll(name: string): FormDataEntryValue[]; has(name: string): boolean; set(name: string, value: string | Blob, fileName?: string): void; keys(): IterableIterator<string>; values(): IterableIterator<string>; entries(): IterableIterator<[string, FormDataEntryValue]>; [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>; forEach( callback: (value: FormDataEntryValue, key: string, parent: this) => void, thisArg?: any, ): void;}
interface Body { /** A simple getter used to expose a `ReadableStream` of the body contents. */ readonly body: ReadableStream<Uint8Array> | null; /** Stores a `Boolean` that declares whether the body has been used in a * response yet. */ readonly bodyUsed: boolean; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with an `ArrayBuffer`. */ arrayBuffer(): Promise<ArrayBuffer>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `Blob`. */ blob(): Promise<Blob>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `FormData` object. */ formData(): Promise<FormData>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with the result of parsing the body text as JSON. */ json(): Promise<any>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `USVString` (text). */ text(): Promise<string>;}
type HeadersInit = Headers | string[][] | Record<string, string>;
/** This Fetch API interface allows you to perform various actions on HTTP * request and response headers. These actions include retrieving, setting, * adding to, and removing. A Headers object has an associated header list, * which is initially empty and consists of zero or more name and value pairs. * You can add to this using methods like append() (see Examples). In all * methods of this interface, header names are matched by case-insensitive byte * sequence. */declare class Headers implements DomIterable<string, string> { constructor(init?: HeadersInit);
/** Appends a new value onto an existing header inside a `Headers` object, or * adds the header if it does not already exist. */ append(name: string, value: string): void; /** Deletes a header from a `Headers` object. */ delete(name: string): void; /** Returns an iterator allowing to go through all key/value pairs * contained in this Headers object. The both the key and value of each pairs * are ByteString objects. */ entries(): IterableIterator<[string, string]>; /** Returns a `ByteString` sequence of all the values of a header within a * `Headers` object with a given name. */ get(name: string): string | null; /** Returns a boolean stating whether a `Headers` object contains a certain * header. */ has(name: string): boolean; /** Returns an iterator allowing to go through all keys contained in * this Headers object. The keys are ByteString objects. */ keys(): IterableIterator<string>; /** Sets a new value for an existing header inside a Headers object, or adds * the header if it does not already exist. */ set(name: string, value: string): void; /** Returns an iterator allowing to go through all values contained in * this Headers object. The values are ByteString objects. */ values(): IterableIterator<string>; forEach( callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any, ): void; /** The Symbol.iterator well-known symbol specifies the default * iterator for this Headers object */ [Symbol.iterator](): IterableIterator<[string, string]>;}
type RequestInfo = Request | string;type RequestCache = | "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";type RequestCredentials = "include" | "omit" | "same-origin";type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin";type RequestRedirect = "error" | "follow" | "manual";type ReferrerPolicy = | "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";type BodyInit = | Blob | BufferSource | FormData | URLSearchParams | ReadableStream<Uint8Array> | string;type RequestDestination = | "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt";
interface RequestInit { /** * A BodyInit object or null to set request's body. */ body?: BodyInit | null; /** * A string indicating how the request will interact with the browser's cache * to set request's cache. */ cache?: RequestCache; /** * A string indicating whether credentials will be sent with the request * always, never, or only when sent to a same-origin URL. Sets request's * credentials. */ credentials?: RequestCredentials; /** * A Headers object, an object literal, or an array of two-item arrays to set * request's headers. */ headers?: HeadersInit; /** * A cryptographic hash of the resource to be fetched by request. Sets * request's integrity. */ integrity?: string; /** * A boolean to set request's keepalive. */ keepalive?: boolean; /** * A string to set request's method. */ method?: string; /** * A string to indicate whether the request will use CORS, or will be * restricted to same-origin URLs. Sets request's mode. */ mode?: RequestMode; /** * A string indicating whether request follows redirects, results in an error * upon encountering a redirect, or returns the redirect (in an opaque * fashion). Sets request's redirect. */ redirect?: RequestRedirect; /** * A string whose value is a same-origin URL, "about:client", or the empty * string, to set request's referrer. */ referrer?: string; /** * A referrer policy to set request's referrerPolicy. */ referrerPolicy?: ReferrerPolicy; /** * An AbortSignal to set request's signal. */ signal?: AbortSignal | null; /** * Can only be null. Used to disassociate request from any Window. */ window?: any;}
/** This Fetch API interface represents a resource request. */declare class Request implements Body { constructor(input: RequestInfo, init?: RequestInit);
/** * Returns the cache mode associated with request, which is a string * indicating how the request will interact with the browser's cache when * fetching. */ readonly cache: RequestCache; /** * Returns the credentials mode associated with request, which is a string * indicating whether credentials will be sent with the request always, never, * or only when sent to a same-origin URL. */ readonly credentials: RequestCredentials; /** * Returns the kind of resource requested by request, e.g., "document" or "script". */ readonly destination: RequestDestination; /** * 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. */ readonly headers: Headers; /** * 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] */ readonly integrity: string; /** * Returns a boolean indicating whether or not request is for a history * navigation (a.k.a. back-forward navigation). */ readonly isHistoryNavigation: boolean; /** * Returns a boolean indicating whether or not request is for a reload * navigation. */ readonly isReloadNavigation: boolean; /** * Returns a boolean indicating whether or not request can outlive the global * in which it was created. */ readonly keepalive: boolean; /** * Returns request's HTTP method, which is "GET" by default. */ readonly method: string; /** * Returns the mode associated with request, which is a string indicating * whether the request will use CORS, or will be restricted to same-origin * URLs. */ readonly mode: RequestMode; /** * 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. */ readonly redirect: RequestRedirect; /** * Returns the referrer of request. Its value can be a same-origin URL if * explicitly set in init, the empty string to indicate no referrer, and * "about:client" when defaulting to the global's default. This is used during * fetching to determine the value of the `Referer` header of the request * being made. */ readonly referrer: string; /** * Returns the referrer policy associated with request. This is used during * fetching to compute the value of the request's referrer. */ readonly referrerPolicy: ReferrerPolicy; /** * Returns the signal associated with request, which is an AbortSignal object * indicating whether or not request has been aborted, and its abort event * handler. */ readonly signal: AbortSignal; /** * Returns the URL of request as a string. */ readonly url: string; clone(): Request;
/** A simple getter used to expose a `ReadableStream` of the body contents. */ readonly body: ReadableStream<Uint8Array> | null; /** Stores a `Boolean` that declares whether the body has been used in a * response yet. */ readonly bodyUsed: boolean; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with an `ArrayBuffer`. */ arrayBuffer(): Promise<ArrayBuffer>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `Blob`. */ blob(): Promise<Blob>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `FormData` object. */ formData(): Promise<FormData>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with the result of parsing the body text as JSON. */ json(): Promise<any>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `USVString` (text). */ text(): Promise<string>;}
interface ResponseInit { headers?: HeadersInit; status?: number; statusText?: string;}
type ResponseType = | "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
/** This Fetch API interface represents the response to a request. */declare class Response implements Body { constructor(body?: BodyInit | null, init?: ResponseInit); static error(): Response; static redirect(url: string, status?: number): Response;
readonly headers: Headers; readonly ok: boolean; readonly redirected: boolean; readonly status: number; readonly statusText: string; readonly trailer: Promise<Headers>; readonly type: ResponseType; readonly url: string; clone(): Response;
/** A simple getter used to expose a `ReadableStream` of the body contents. */ readonly body: ReadableStream<Uint8Array> | null; /** Stores a `Boolean` that declares whether the body has been used in a * response yet. */ readonly bodyUsed: boolean; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with an `ArrayBuffer`. */ arrayBuffer(): Promise<ArrayBuffer>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `Blob`. */ blob(): Promise<Blob>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `FormData` object. */ formData(): Promise<FormData>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with the result of parsing the body text as JSON. */ json(): Promise<any>; /** Takes a `Response` stream and reads it to completion. It returns a promise * that resolves with a `USVString` (text). */ text(): Promise<string>;}
/** Fetch a resource from the network. It returns a Promise that resolves to the * Response to that request, whether it is successful or not. * * const response = await fetch("http://my.json.host/data.json"); * console.log(response.status); // e.g. 200 * console.log(response.statusText); // e.g. "OK" * const jsonData = await response.json(); */declare function fetch( input: Request | URL | string, init?: RequestInit,): Promise<Response>;
interface CloseEventInit extends EventInit { code?: number; reason?: string; wasClean?: boolean;}
declare class CloseEvent extends Event { constructor(type: string, eventInitDict?: CloseEventInit); /** * Returns the WebSocket connection close code provided by the server. */ readonly code: number; /** * Returns the WebSocket connection close reason provided by the server. */ readonly reason: string; /** * Returns true if the connection closed cleanly; false otherwise. */ readonly wasClean: boolean;}
interface WebSocketEventMap { close: CloseEvent; error: Event; message: MessageEvent; open: Event;}
/** Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. */declare class WebSocket extends EventTarget { constructor(url: string, protocols?: string | string[]);
static readonly CLOSED: number; static readonly CLOSING: number; static readonly CONNECTING: number; static readonly OPEN: number;
/** * Returns a string that indicates how binary data from the WebSocket object is exposed to scripts: * * Can be set, to change how binary data is returned. The default is "blob". */ binaryType: BinaryType; /** * Returns the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but not yet been transmitted to the network. * * If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.) */ readonly bufferedAmount: number; /** * Returns the extensions selected by the server, if any. */ readonly extensions: string; onclose: ((this: WebSocket, ev: CloseEvent) => any) | null; onerror: ((this: WebSocket, ev: Event | ErrorEvent) => any) | null; onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null; onopen: ((this: WebSocket, ev: Event) => any) | null; /** * 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. */ readonly protocol: string; /** * Returns the state of the WebSocket object's connection. It can have the values described below. */ readonly readyState: number; /** * Returns the URL that was used to establish the WebSocket connection. */ readonly url: string; /** * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason. */ close(code?: number, reason?: string): void; /** * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView. */ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number; addEventListener<K extends keyof WebSocketEventMap>( type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions, ): void; addEventListener( type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions, ): void; removeEventListener<K extends keyof WebSocketEventMap>( type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions, ): void; removeEventListener( type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions, ): void;}
type BinaryType = "arraybuffer" | "blob";
declare namespace WebAssembly { /** * The `WebAssembly.CompileError` object indicates an error during WebAssembly decoding or validation. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError) */ export class CompileError extends Error { /** Creates a new `WebAssembly.CompileError` object. */ constructor(); }
/** * A `WebAssembly.Global` object represents a global variable instance, accessible from * both JavaScript and importable/exportable across one or more `WebAssembly.Module` * instances. This allows dynamic linking of multiple modules. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global) */ export class Global { /** Creates a new `Global` object. */ constructor(descriptor: GlobalDescriptor, v?: any);
/** * The value contained inside the global variable — this can be used to directly set * and get the global's value. */ value: any;
/** Old-style method that returns the value contained inside the global variable. */ valueOf(): any; }
/** * A `WebAssembly.Instance` object is a stateful, executable instance of a `WebAssembly.Module`. * Instance objects contain all the Exported WebAssembly functions that allow calling into * WebAssembly code from JavaScript. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance) */ export class Instance { /** Creates a new Instance object. */ constructor(module: Module, importObject?: Imports);
/** * Returns an object containing as its members all the functions exported from the * WebAssembly module instance, to allow them to be accessed and used by JavaScript. * Read-only. */ readonly exports: Exports; }
/** * The `WebAssembly.LinkError` object indicates an error during module instantiation * (besides traps from the start function). * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError) */ export class LinkError extends Error { /** Creates a new WebAssembly.LinkError object. */ constructor(); }
/** * The `WebAssembly.Memory` object is a resizable `ArrayBuffer` or `SharedArrayBuffer` that * holds the raw bytes of memory accessed by a WebAssembly Instance. * * A memory created by JavaScript or in WebAssembly code will be accessible and mutable * from both JavaScript and WebAssembly. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) */ export class Memory { /** Creates a new `Memory` object. */ constructor(descriptor: MemoryDescriptor);
/** An accessor property that returns the buffer contained in the memory. */ readonly buffer: ArrayBuffer;
/** * Increases the size of the memory instance by a specified number of WebAssembly * pages (each one is 64KB in size). */ grow(delta: number): number; }
/** * A `WebAssembly.Module` object contains stateless WebAssembly code that has already been compiled * by the browser — this can be efficiently shared with Workers, and instantiated multiple times. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) */ export class Module { /** Creates a new `Module` object. */ constructor(bytes: BufferSource);
/** * Given a `Module` and string, returns a copy of the contents of all custom sections in the * module with the given string name. */ static customSections( moduleObject: Module, sectionName: string, ): ArrayBuffer[];
/** Given a `Module`, returns an array containing descriptions of all the declared exports. */ static exports(moduleObject: Module): ModuleExportDescriptor[];
/** Given a `Module`, returns an array containing descriptions of all the declared imports. */ static imports(moduleObject: Module): ModuleImportDescriptor[]; }
/** * The `WebAssembly.RuntimeError` object is the error type that is thrown whenever WebAssembly * specifies a trap. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError) */ export class RuntimeError extends Error { /** Creates a new `WebAssembly.RuntimeError` object. */ constructor(); }
/** * The `WebAssembly.Table()` object is a JavaScript wrapper object — an array-like structure * representing a WebAssembly Table, which stores function references. A table created by * JavaScript or in WebAssembly code will be accessible and mutable from both JavaScript * and WebAssembly. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table) */ export class Table { /** Creates a new `Table` object. */ constructor(descriptor: TableDescriptor);
/** Returns the length of the table, i.e. the number of elements. */ readonly length: number;
/** Accessor function — gets the element stored at a given index. */ get(index: number): Function | null;
/** Increases the size of the `Table` instance by a specified number of elements. */ grow(delta: number): number;
/** Sets an element stored at a given index to a given value. */ set(index: number, value: Function | null): void; }
/** The `GlobalDescriptor` describes the options you can pass to `new WebAssembly.Global()`. */ export interface GlobalDescriptor { mutable?: boolean; value: ValueType; }
/** The `MemoryDescriptor` describes the options you can pass to `new WebAssembly.Memory()`. */ export interface MemoryDescriptor { initial: number; maximum?: number; }
/** A `ModuleExportDescriptor` is the description of a declared export in a `WebAssembly.Module`. */ export interface ModuleExportDescriptor { kind: ImportExportKind; name: string; }
/** A `ModuleImportDescriptor` is the description of a declared import in a `WebAssembly.Module`. */ export interface ModuleImportDescriptor { kind: ImportExportKind; module: string; name: string; }
/** The `TableDescriptor` describes the options you can pass to `new WebAssembly.Table()`. */ export interface TableDescriptor { element: TableKind; initial: number; maximum?: number; }
/** The value returned from `WebAssembly.instantiate` and `WebAssembly.instantiateStreaming`. */ export interface WebAssemblyInstantiatedSource { /* A `WebAssembly.Instance` object that contains all the exported WebAssembly functions. */ instance: Instance;
/** * A `WebAssembly.Module` object representing the compiled WebAssembly module. * This `Module` can be instantiated again, or shared via postMessage(). */ module: Module; }
export type ImportExportKind = "function" | "global" | "memory" | "table"; export type TableKind = "anyfunc"; export type ValueType = "f32" | "f64" | "i32" | "i64"; export type ExportValue = Function | Global | Memory | Table; export type Exports = Record<string, ExportValue>; export type ImportValue = ExportValue | number; export type ModuleImports = Record<string, ImportValue>; export type Imports = Record<string, ModuleImports>;
/** * The `WebAssembly.compile()` function compiles WebAssembly binary code into a * `WebAssembly.Module` object. This function is useful if it is necessary to compile * a module before it can be instantiated (otherwise, the `WebAssembly.instantiate()` * function should be used). * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile) */ export function compile(bytes: BufferSource): Promise<Module>;
/** * The `WebAssembly.compileStreaming()` function compiles a `WebAssembly.Module` * directly from a streamed underlying source. This function is useful if it * is necessary to a compile a module before it can be instantiated (otherwise, * the `WebAssembly.instantiateStreaming()` function should be used). * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming) */ export function compileStreaming( source: Response | Promise<Response>, ): Promise<Module>;
/** * The WebAssembly.instantiate() function allows you to compile and instantiate * WebAssembly code. * * This overload takes the WebAssembly binary code, in the form of a typed * array or ArrayBuffer, and performs both compilation and instantiation in one step. * The returned Promise resolves to both a compiled WebAssembly.Module and its first * WebAssembly.Instance. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate) */ export function instantiate( bytes: BufferSource, importObject?: Imports, ): Promise<WebAssemblyInstantiatedSource>;
/** * The WebAssembly.instantiate() function allows you to compile and instantiate * WebAssembly code. * * This overload takes an already-compiled WebAssembly.Module and returns * a Promise that resolves to an Instance of that Module. This overload is useful * if the Module has already been compiled. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate) */ export function instantiate( moduleObject: Module, importObject?: Imports, ): Promise<Instance>;
/** * The `WebAssembly.instantiateStreaming()` function compiles and instantiates a * WebAssembly module directly from a streamed underlying source. This is the most * efficient, optimized way to load WebAssembly code. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming) */ export function instantiateStreaming( response: Response | PromiseLike<Response>, importObject?: Imports, ): Promise<WebAssemblyInstantiatedSource>;
/** * The `WebAssembly.validate()` function validates a given typed array of * WebAssembly binary code, returning whether the bytes form a valid wasm * module (`true`) or not (`false`). * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate) */ export function validate(bytes: BufferSource): boolean;}
interface VoidFunction { (): void;}
/** A microtask is a short function which is executed after the function or * module which created it exits and only if the JavaScript execution stack is * empty, but before returning control to the event loop being used to drive the * script's execution environment. This event loop may be either the main event * loop or the event loop driving a web worker. * * queueMicrotask(() => { console.log('This event loop stack is complete'); }); */declare function queueMicrotask(func: VoidFunction): void;
/** Registers an event listener in the global scope, which will be called * synchronously whenever the event `type` is dispatched. * * addEventListener('unload', () => { console.log('All finished!'); }); * ... * dispatchEvent(new Event('unload')); */declare function addEventListener( type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions | undefined,): void;
/** Dispatches an event in the global scope, synchronously invoking any * registered event listeners for this event in the appropriate order. Returns * false if event is cancelable and at least one of the event handlers which * handled this event called Event.preventDefault(). Otherwise it returns true. * * dispatchEvent(new Event('unload')); */declare function dispatchEvent(event: Event): boolean;
/** Remove a previously registered event listener from the global scope * * const lstnr = () => { console.log('hello'); }; * addEventListener('load', lstnr); * removeEventListener('load', lstnr); */declare function removeEventListener( type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined,): void;
interface DOMStringList { /** Returns the number of strings in strings. */ readonly length: number; /** Returns true if strings contains string, and false otherwise. */ contains(string: string): boolean; /** Returns the string with index index from strings. */ item(index: number): string | null; [index: number]: string;}
type BufferSource = ArrayBufferView | ArrayBuffer;
declare interface Console { assert(condition?: boolean, ...data: any[]): void; clear(): void; count(label?: string): void; countReset(label?: string): void; debug(...data: any[]): void; dir(item?: any, options?: any): void; dirxml(...data: any[]): void; error(...data: any[]): void; group(...data: any[]): void; groupCollapsed(...data: any[]): void; groupEnd(): void; info(...data: any[]): void; log(...data: any[]): void; table(tabularData?: any, properties?: string[]): void; time(label?: string): void; timeEnd(label?: string): void; timeLog(label?: string, ...data: any[]): void; timeStamp(label?: string): void; trace(...data: any[]): void; warn(...data: any[]): void;}
declare var console: Console;
interface MessageEventInit<T = any> extends EventInit { data?: T; origin?: string; lastEventId?: string;}
declare class MessageEvent<T = any> extends Event { /** * Returns the data of the message. */ readonly data: T; /** * Returns the last event ID string, for server-sent events. */ readonly lastEventId: string; constructor(type: string, eventInitDict?: MessageEventInit);}
interface ErrorEventInit extends EventInit { message?: string; filename?: string; lineno?: number; colno?: number; error?: any;}
declare class ErrorEvent extends Event { readonly message: string; readonly filename: string; readonly lineno: number; readonly colno: number; readonly error: any; constructor(type: string, eventInitDict?: ErrorEventInit);}
declare interface CustomEventInit<T = any> extends EventInit { detail?: T;}
declare class CustomEvent<T = any> extends Event { constructor(typeArg: string, eventInitDict?: CustomEventInit<T>); /** Returns any custom data event was created with. Typically used for * synthetic events. */ readonly detail: T;}
interface ErrorConstructor { /** See https://v8.dev/docs/stack-trace-api#stack-trace-collection-for-custom-exceptions. */ captureStackTrace(error: Object, constructor?: Function): void; // TODO(nayeemrmn): Support `Error.prepareStackTrace()`. We currently use this // internally in a way that makes it unavailable for users.}
declare class Window extends EventTarget { new(): Window; readonly window: Window & typeof globalThis; readonly self: Window & typeof globalThis; Deno: typeof Deno;}
declare var window: Window & typeof globalThis;declare var self: Window & typeof globalThis;
declare var crypto: Crypto;
declare interface Crypto { readonly subtle: null; getRandomValues< T extends | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null, >( array: T, ): T;}
/** Sets a timer which executes a function once after the timer expires. Returns * an id which may be used to cancel the timeout. * * setTimeout(() => { console.log('hello'); }, 500); */declare function setTimeout( /** callback function to execute when timer expires */ cb: (...args: any[]) => void, /** delay in ms */ delay?: number, /** arguments passed to callback function */ ...args: any[]): number;
/** Repeatedly calls a function , with a fixed time delay between each call. * * // Outputs 'hello' to the console every 500ms * setInterval(() => { console.log('hello'); }, 500); */declare function setInterval( /** callback function to execute when timer expires */ cb: (...args: any[]) => void, /** delay in ms */ delay?: number, /** arguments passed to callback function */ ...args: any[]): number;
/** Cancels a timed, repeating action which was previously started by a call * to `setInterval()` * * const id = setInterval(() => {console.log('hello');}, 500); * ... * clearInterval(id); */declare function clearInterval(id?: number): void;
/** Cancels a scheduled action initiated by `setTimeout()` * * const id = setTimeout(() => {console.log('hello');}, 500); * ... * clearTimeout(id); */declare function clearTimeout(id?: number): void;
// Copyright 2018-2021 Deno Land Inc. All rights reserved. MIT license.
// deno-lint-ignore-file
/// <reference no-default-lib="true" />/// <reference lib="esnext" />
declare class FetchEvent extends Event { request: Request; respondWith(response: Response | Promise<Response>): void;}
declare type FetchEventListenerOrFetchEventListenerObject = | FetchEventListener | FetchEventListenerObject;
interface FetchEventListener { (evt: FetchEvent): void | Promise<void>;}
interface FetchEventListenerObject { handleEvent(evt: FetchEvent): void | Promise<void>;}
declare function addEventListener( type: "fetch", callback: FetchEventListenerOrFetchEventListenerObject | null, options?: boolean | AddEventListenerOptions | undefined,): void;
diplodocus
🦕 Deno Deploy Docs 📓
DocumentationDocumentation
GitHub Stars
21

Version Info

Tagged at
8 months ago

External Dependencies

No external dependencies 🎉