@types/node 22.17.1 → 22.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {node v22.17 → node v22.18}/README.md +1 -1
- {node v22.17 → node v22.18}/buffer.d.ts +1 -1
- {node v22.17 → node v22.18}/child_process.d.ts +26 -122
- {node v22.17 → node v22.18}/fs/promises.d.ts +19 -26
- {node v22.17 → node v22.18}/fs.d.ts +17 -34
- node v22.18/globals.d.ts +170 -0
- {node v22.17 → node v22.18}/http.d.ts +1 -1
- {node v22.17 → node v22.18}/index.d.ts +6 -1
- {node v22.17 → node v22.18}/inspector.d.ts +68 -12
- {node v22.17 → node v22.18}/module.d.ts +24 -0
- {node v22.17 → node v22.18}/package.json +2 -2
- {node v22.17 → node v22.18}/process.d.ts +3 -2
- {node v22.17 → node v22.18}/sqlite.d.ts +35 -0
- {node v22.17 → node v22.18}/ts5.6/index.d.ts +6 -1
- {node v22.17 → node v22.18}/url.d.ts +11 -0
- node v22.18/web-globals/abortcontroller.d.ts +34 -0
- node v22.18/web-globals/domexception.d.ts +68 -0
- node v22.17/dom-events.d.ts → node v22.18/web-globals/events.d.ts +47 -52
- node v22.18/web-globals/fetch.d.ts +46 -0
- node v22.18/web-globals/navigator.d.ts +22 -0
- node v22.18/web-globals/storage.d.ts +24 -0
- {node v22.17 → node v22.18}/worker_threads.d.ts +12 -0
- node v22.17/globals.d.ts +0 -364
- {node v22.17 → node v22.18}/LICENSE +0 -0
- {node v22.17 → node v22.18}/assert/strict.d.ts +0 -0
- {node v22.17 → node v22.18}/assert.d.ts +0 -0
- {node v22.17 → node v22.18}/async_hooks.d.ts +0 -0
- {node v22.17 → node v22.18}/buffer.buffer.d.ts +0 -0
- {node v22.17 → node v22.18}/cluster.d.ts +0 -0
- {node v22.17 → node v22.18}/compatibility/disposable.d.ts +0 -0
- {node v22.17 → node v22.18}/compatibility/index.d.ts +0 -0
- {node v22.17 → node v22.18}/compatibility/indexable.d.ts +0 -0
- {node v22.17 → node v22.18}/compatibility/iterators.d.ts +0 -0
- {node v22.17 → node v22.18}/console.d.ts +0 -0
- {node v22.17 → node v22.18}/constants.d.ts +0 -0
- {node v22.17 → node v22.18}/crypto.d.ts +0 -0
- {node v22.17 → node v22.18}/dgram.d.ts +0 -0
- {node v22.17 → node v22.18}/diagnostics_channel.d.ts +0 -0
- {node v22.17 → node v22.18}/dns/promises.d.ts +0 -0
- {node v22.17 → node v22.18}/dns.d.ts +0 -0
- {node v22.17 → node v22.18}/domain.d.ts +0 -0
- {node v22.17 → node v22.18}/events.d.ts +0 -0
- {node v22.17 → node v22.18}/globals.typedarray.d.ts +0 -0
- {node v22.17 → node v22.18}/http2.d.ts +0 -0
- {node v22.17 → node v22.18}/https.d.ts +0 -0
- {node v22.17 → node v22.18}/net.d.ts +0 -0
- {node v22.17 → node v22.18}/os.d.ts +0 -0
- {node v22.17 → node v22.18}/path.d.ts +0 -0
- {node v22.17 → node v22.18}/perf_hooks.d.ts +0 -0
- {node v22.17 → node v22.18}/punycode.d.ts +0 -0
- {node v22.17 → node v22.18}/querystring.d.ts +0 -0
- {node v22.17 → node v22.18}/readline/promises.d.ts +0 -0
- {node v22.17 → node v22.18}/readline.d.ts +0 -0
- {node v22.17 → node v22.18}/repl.d.ts +0 -0
- {node v22.17 → node v22.18}/sea.d.ts +0 -0
- {node v22.17 → node v22.18}/stream/consumers.d.ts +0 -0
- {node v22.17 → node v22.18}/stream/promises.d.ts +0 -0
- {node v22.17 → node v22.18}/stream/web.d.ts +0 -0
- {node v22.17 → node v22.18}/stream.d.ts +0 -0
- {node v22.17 → node v22.18}/string_decoder.d.ts +0 -0
- {node v22.17 → node v22.18}/test.d.ts +0 -0
- {node v22.17 → node v22.18}/timers/promises.d.ts +0 -0
- {node v22.17 → node v22.18}/timers.d.ts +0 -0
- {node v22.17 → node v22.18}/tls.d.ts +0 -0
- {node v22.17 → node v22.18}/trace_events.d.ts +0 -0
- {node v22.17 → node v22.18}/ts5.6/buffer.buffer.d.ts +0 -0
- {node v22.17 → node v22.18}/ts5.6/globals.typedarray.d.ts +0 -0
- {node v22.17 → node v22.18}/tty.d.ts +0 -0
- {node v22.17 → node v22.18}/util.d.ts +0 -0
- {node v22.17 → node v22.18}/v8.d.ts +0 -0
- {node v22.17 → node v22.18}/vm.d.ts +0 -0
- {node v22.17 → node v22.18}/wasi.d.ts +0 -0
- {node v22.17 → node v22.18}/zlib.d.ts +0 -0
@@ -268,7 +268,7 @@ declare module 'inspector' {
|
|
268
268
|
/**
|
269
269
|
* Embedder-specific auxiliary data.
|
270
270
|
*/
|
271
|
-
auxData?:
|
271
|
+
auxData?: object | undefined;
|
272
272
|
}
|
273
273
|
/**
|
274
274
|
* Detailed information about exception (or error) that was thrown during script compilation or execution.
|
@@ -701,7 +701,7 @@ declare module 'inspector' {
|
|
701
701
|
}
|
702
702
|
interface InspectRequestedEventDataType {
|
703
703
|
object: RemoteObject;
|
704
|
-
hints:
|
704
|
+
hints: object;
|
705
705
|
}
|
706
706
|
}
|
707
707
|
namespace Debugger {
|
@@ -1173,7 +1173,7 @@ declare module 'inspector' {
|
|
1173
1173
|
/**
|
1174
1174
|
* Embedder-specific auxiliary data.
|
1175
1175
|
*/
|
1176
|
-
executionContextAuxData?:
|
1176
|
+
executionContextAuxData?: object | undefined;
|
1177
1177
|
/**
|
1178
1178
|
* True, if this script is generated as a result of the live edit operation.
|
1179
1179
|
* @experimental
|
@@ -1237,7 +1237,7 @@ declare module 'inspector' {
|
|
1237
1237
|
/**
|
1238
1238
|
* Embedder-specific auxiliary data.
|
1239
1239
|
*/
|
1240
|
-
executionContextAuxData?:
|
1240
|
+
executionContextAuxData?: object | undefined;
|
1241
1241
|
/**
|
1242
1242
|
* URL of source map associated with script (if any).
|
1243
1243
|
*/
|
@@ -1282,7 +1282,7 @@ declare module 'inspector' {
|
|
1282
1282
|
/**
|
1283
1283
|
* Object containing break-specific auxiliary properties.
|
1284
1284
|
*/
|
1285
|
-
data?:
|
1285
|
+
data?: object | undefined;
|
1286
1286
|
/**
|
1287
1287
|
* Hit breakpoints IDs
|
1288
1288
|
*/
|
@@ -1649,7 +1649,7 @@ declare module 'inspector' {
|
|
1649
1649
|
categories: string[];
|
1650
1650
|
}
|
1651
1651
|
interface DataCollectedEventDataType {
|
1652
|
-
value:
|
1652
|
+
value: object[];
|
1653
1653
|
}
|
1654
1654
|
}
|
1655
1655
|
namespace NodeWorker {
|
@@ -1759,6 +1759,7 @@ declare module 'inspector' {
|
|
1759
1759
|
url: string;
|
1760
1760
|
method: string;
|
1761
1761
|
headers: Headers;
|
1762
|
+
hasPostData: boolean;
|
1762
1763
|
}
|
1763
1764
|
/**
|
1764
1765
|
* HTTP response data.
|
@@ -1776,17 +1777,45 @@ declare module 'inspector' {
|
|
1776
1777
|
*/
|
1777
1778
|
interface Headers {
|
1778
1779
|
}
|
1780
|
+
interface GetRequestPostDataParameterType {
|
1781
|
+
/**
|
1782
|
+
* Identifier of the network request to get content for.
|
1783
|
+
*/
|
1784
|
+
requestId: RequestId;
|
1785
|
+
}
|
1786
|
+
interface GetResponseBodyParameterType {
|
1787
|
+
/**
|
1788
|
+
* Identifier of the network request to get content for.
|
1789
|
+
*/
|
1790
|
+
requestId: RequestId;
|
1791
|
+
}
|
1779
1792
|
interface StreamResourceContentParameterType {
|
1780
1793
|
/**
|
1781
1794
|
* Identifier of the request to stream.
|
1782
1795
|
*/
|
1783
1796
|
requestId: RequestId;
|
1784
1797
|
}
|
1798
|
+
interface GetRequestPostDataReturnType {
|
1799
|
+
/**
|
1800
|
+
* Request body string, omitting files from multipart requests
|
1801
|
+
*/
|
1802
|
+
postData: string;
|
1803
|
+
}
|
1804
|
+
interface GetResponseBodyReturnType {
|
1805
|
+
/**
|
1806
|
+
* Response body.
|
1807
|
+
*/
|
1808
|
+
body: string;
|
1809
|
+
/**
|
1810
|
+
* True, if content was sent as base64.
|
1811
|
+
*/
|
1812
|
+
base64Encoded: boolean;
|
1813
|
+
}
|
1785
1814
|
interface StreamResourceContentReturnType {
|
1786
1815
|
/**
|
1787
1816
|
* Data that has been buffered until streaming is enabled.
|
1788
1817
|
*/
|
1789
|
-
bufferedData:
|
1818
|
+
bufferedData: string;
|
1790
1819
|
}
|
1791
1820
|
interface RequestWillBeSentEventDataType {
|
1792
1821
|
/**
|
@@ -1877,7 +1906,7 @@ declare module 'inspector' {
|
|
1877
1906
|
* Data that was received.
|
1878
1907
|
* @experimental
|
1879
1908
|
*/
|
1880
|
-
data?:
|
1909
|
+
data?: string | undefined;
|
1881
1910
|
}
|
1882
1911
|
}
|
1883
1912
|
namespace NodeRuntime {
|
@@ -2285,6 +2314,16 @@ declare module 'inspector' {
|
|
2285
2314
|
* Enables network tracking, network events will now be delivered to the client.
|
2286
2315
|
*/
|
2287
2316
|
post(method: 'Network.enable', callback?: (err: Error | null) => void): void;
|
2317
|
+
/**
|
2318
|
+
* Returns post data sent with the request. Returns an error when no data was sent with the request.
|
2319
|
+
*/
|
2320
|
+
post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType, callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void;
|
2321
|
+
post(method: 'Network.getRequestPostData', callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void;
|
2322
|
+
/**
|
2323
|
+
* Returns content served for the given request.
|
2324
|
+
*/
|
2325
|
+
post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType, callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void;
|
2326
|
+
post(method: 'Network.getResponseBody', callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void;
|
2288
2327
|
/**
|
2289
2328
|
* Enables streaming of the response for the given requestId.
|
2290
2329
|
* If enabled, the dataReceived event contains the data that was received during streaming.
|
@@ -3049,22 +3088,31 @@ declare module 'inspector' {
|
|
3049
3088
|
|
3050
3089
|
// DevTools protocol event broadcast methods
|
3051
3090
|
namespace Network {
|
3091
|
+
/**
|
3092
|
+
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3093
|
+
*
|
3094
|
+
* Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
|
3095
|
+
* the application is about to send an HTTP request.
|
3096
|
+
* @since v22.6.0
|
3097
|
+
*/
|
3098
|
+
function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
|
3052
3099
|
/**
|
3053
3100
|
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3054
3101
|
*
|
3055
3102
|
* Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if
|
3056
3103
|
* `Network.streamResourceContent` command was not invoked for the given request yet.
|
3104
|
+
*
|
3105
|
+
* Also enables `Network.getResponseBody` command to retrieve the response data.
|
3057
3106
|
* @since v22.17.0
|
3058
3107
|
*/
|
3059
3108
|
function dataReceived(params: DataReceivedEventDataType): void;
|
3060
3109
|
/**
|
3061
3110
|
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3062
3111
|
*
|
3063
|
-
*
|
3064
|
-
*
|
3065
|
-
* @since v22.6.0
|
3112
|
+
* Enables `Network.getRequestPostData` command to retrieve the request data.
|
3113
|
+
* @since v22.18.0
|
3066
3114
|
*/
|
3067
|
-
function
|
3115
|
+
function dataSent(params: unknown): void;
|
3068
3116
|
/**
|
3069
3117
|
* This feature is only available with the `--experimental-network-inspection` flag enabled.
|
3070
3118
|
*
|
@@ -3450,6 +3498,14 @@ declare module 'inspector/promises' {
|
|
3450
3498
|
* Enables network tracking, network events will now be delivered to the client.
|
3451
3499
|
*/
|
3452
3500
|
post(method: 'Network.enable'): Promise<void>;
|
3501
|
+
/**
|
3502
|
+
* Returns post data sent with the request. Returns an error when no data was sent with the request.
|
3503
|
+
*/
|
3504
|
+
post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType): Promise<Network.GetRequestPostDataReturnType>;
|
3505
|
+
/**
|
3506
|
+
* Returns content served for the given request.
|
3507
|
+
*/
|
3508
|
+
post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType): Promise<Network.GetResponseBodyReturnType>;
|
3453
3509
|
/**
|
3454
3510
|
* Enables streaming of the response for the given requestId.
|
3455
3511
|
* If enabled, the dataReceived event contains the data that was received during streaming.
|
@@ -684,6 +684,30 @@ declare module "module" {
|
|
684
684
|
* @returns The absolute URL string that the specifier would resolve to.
|
685
685
|
*/
|
686
686
|
resolve(specifier: string, parent?: string | URL): string;
|
687
|
+
/**
|
688
|
+
* `true` when the current module is the entry point of the current process; `false` otherwise.
|
689
|
+
*
|
690
|
+
* Equivalent to `require.main === module` in CommonJS.
|
691
|
+
*
|
692
|
+
* Analogous to Python's `__name__ == "__main__"`.
|
693
|
+
*
|
694
|
+
* ```js
|
695
|
+
* export function foo() {
|
696
|
+
* return 'Hello, world';
|
697
|
+
* }
|
698
|
+
*
|
699
|
+
* function main() {
|
700
|
+
* const message = foo();
|
701
|
+
* console.log(message);
|
702
|
+
* }
|
703
|
+
*
|
704
|
+
* if (import.meta.main) main();
|
705
|
+
* // `foo` can be imported from another module without possible side-effects from `main`
|
706
|
+
* ```
|
707
|
+
* @since v22.18.0
|
708
|
+
* @experimental
|
709
|
+
*/
|
710
|
+
main: boolean;
|
687
711
|
}
|
688
712
|
namespace NodeJS {
|
689
713
|
interface Module {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.
|
3
|
+
"version": "22.18.1",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -140,6 +140,6 @@
|
|
140
140
|
"undici-types": "~6.21.0"
|
141
141
|
},
|
142
142
|
"peerDependencies": {},
|
143
|
-
"typesPublisherContentHash": "
|
143
|
+
"typesPublisherContentHash": "ac2c8f7bae3ace55de8cc6e3e0972fd50a4ba54caa6840816e1367bed47e1022",
|
144
144
|
"typeScriptVersion": "5.2"
|
145
145
|
}
|
@@ -231,8 +231,9 @@ declare module "process" {
|
|
231
231
|
*/
|
232
232
|
readonly tls_sni: boolean;
|
233
233
|
/**
|
234
|
-
* A value that is `"strip"`
|
235
|
-
* `"transform"` if Node.js is run with `--experimental-transform-types`, and `false`
|
234
|
+
* A value that is `"strip"` by default,
|
235
|
+
* `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if
|
236
|
+
* Node.js is run with `--no-experimental-strip-types`.
|
236
237
|
* @since v22.10.0
|
237
238
|
*/
|
238
239
|
readonly typescript: "strip" | "transform" | false;
|
@@ -89,6 +89,41 @@ declare module "node:sqlite" {
|
|
89
89
|
* @default false
|
90
90
|
*/
|
91
91
|
allowExtension?: boolean | undefined;
|
92
|
+
/**
|
93
|
+
* The [busy timeout](https://sqlite.org/c3ref/busy_timeout.html) in milliseconds. This is the maximum amount of
|
94
|
+
* time that SQLite will wait for a database lock to be released before
|
95
|
+
* returning an error.
|
96
|
+
* @since v22.16.0
|
97
|
+
* @default 0
|
98
|
+
*/
|
99
|
+
timeout?: number | undefined;
|
100
|
+
/**
|
101
|
+
* If `true`, integer fields are read as JavaScript `BigInt` values. If `false`,
|
102
|
+
* integer fields are read as JavaScript numbers.
|
103
|
+
* @since v22.18.0
|
104
|
+
* @default false
|
105
|
+
*/
|
106
|
+
readBigInts?: boolean | undefined;
|
107
|
+
/**
|
108
|
+
* If `true`, query results are returned as arrays instead of objects.
|
109
|
+
* @since v22.18.0
|
110
|
+
* @default false
|
111
|
+
*/
|
112
|
+
returnArrays?: boolean | undefined;
|
113
|
+
/**
|
114
|
+
* If `true`, allows binding named parameters without the prefix
|
115
|
+
* character (e.g., `foo` instead of `:foo`).
|
116
|
+
* @since v22.18.0
|
117
|
+
* @default true
|
118
|
+
*/
|
119
|
+
allowBareNamedParameters?: boolean | undefined;
|
120
|
+
/**
|
121
|
+
* If `true`, unknown named parameters are ignored when binding.
|
122
|
+
* If `false`, an exception is thrown for unknown named parameters.
|
123
|
+
* @since v22.18.0
|
124
|
+
* @default false
|
125
|
+
*/
|
126
|
+
allowUnknownNamedParameters?: boolean | undefined;
|
92
127
|
}
|
93
128
|
interface CreateSessionOptions {
|
94
129
|
/**
|
@@ -36,6 +36,12 @@
|
|
36
36
|
|
37
37
|
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
38
38
|
/// <reference path="../globals.d.ts" />
|
39
|
+
/// <reference path="../web-globals/abortcontroller.d.ts" />
|
40
|
+
/// <reference path="../web-globals/domexception.d.ts" />
|
41
|
+
/// <reference path="../web-globals/events.d.ts" />
|
42
|
+
/// <reference path="../web-globals/fetch.d.ts" />
|
43
|
+
/// <reference path="../web-globals/navigator.d.ts" />
|
44
|
+
/// <reference path="../web-globals/storage.d.ts" />
|
39
45
|
/// <reference path="../assert.d.ts" />
|
40
46
|
/// <reference path="../assert/strict.d.ts" />
|
41
47
|
/// <reference path="../async_hooks.d.ts" />
|
@@ -51,7 +57,6 @@
|
|
51
57
|
/// <reference path="../dns/promises.d.ts" />
|
52
58
|
/// <reference path="../dns/promises.d.ts" />
|
53
59
|
/// <reference path="../domain.d.ts" />
|
54
|
-
/// <reference path="../dom-events.d.ts" />
|
55
60
|
/// <reference path="../events.d.ts" />
|
56
61
|
/// <reference path="../fs.d.ts" />
|
57
62
|
/// <reference path="../fs/promises.d.ts" />
|
@@ -315,6 +315,17 @@ declare module "url" {
|
|
315
315
|
* @return The fully-resolved platform-specific Node.js file path.
|
316
316
|
*/
|
317
317
|
function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string;
|
318
|
+
/**
|
319
|
+
* Like `url.fileURLToPath(...)` except that instead of returning a string
|
320
|
+
* representation of the path, a `Buffer` is returned. This conversion is
|
321
|
+
* helpful when the input URL contains percent-encoded segments that are
|
322
|
+
* not valid UTF-8 / Unicode sequences.
|
323
|
+
* @since v22.18.0
|
324
|
+
* @param url The file URL string or URL object to convert to a path.
|
325
|
+
* @returns The fully-resolved platform-specific Node.js file path
|
326
|
+
* as a `Buffer`.
|
327
|
+
*/
|
328
|
+
function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): Buffer;
|
318
329
|
/**
|
319
330
|
* This function ensures that `path` is resolved absolutely, and that the URL
|
320
331
|
* control characters are correctly encoded when converting into a File URL.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
export {};
|
2
|
+
|
3
|
+
type _AbortController = typeof globalThis extends { onmessage: any } ? {} : AbortController;
|
4
|
+
interface AbortController {
|
5
|
+
readonly signal: AbortSignal;
|
6
|
+
abort(reason?: any): void;
|
7
|
+
}
|
8
|
+
|
9
|
+
type _AbortSignal = typeof globalThis extends { onmessage: any } ? {} : AbortSignal;
|
10
|
+
interface AbortSignal extends EventTarget {
|
11
|
+
readonly aborted: boolean;
|
12
|
+
onabort: ((this: AbortSignal, ev: Event) => any) | null;
|
13
|
+
readonly reason: any;
|
14
|
+
throwIfAborted(): void;
|
15
|
+
}
|
16
|
+
|
17
|
+
declare global {
|
18
|
+
interface AbortController extends _AbortController {}
|
19
|
+
var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
20
|
+
: {
|
21
|
+
prototype: AbortController;
|
22
|
+
new(): AbortController;
|
23
|
+
};
|
24
|
+
|
25
|
+
interface AbortSignal extends _AbortSignal {}
|
26
|
+
var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
27
|
+
: {
|
28
|
+
prototype: AbortSignal;
|
29
|
+
new(): AbortSignal;
|
30
|
+
abort(reason?: any): AbortSignal;
|
31
|
+
any(signals: AbortSignal[]): AbortSignal;
|
32
|
+
timeout(milliseconds: number): AbortSignal;
|
33
|
+
};
|
34
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
export {};
|
2
|
+
|
3
|
+
type _DOMException = typeof globalThis extends { onmessage: any } ? {} : DOMException;
|
4
|
+
interface DOMException extends Error {
|
5
|
+
readonly code: number;
|
6
|
+
readonly message: string;
|
7
|
+
readonly name: string;
|
8
|
+
readonly INDEX_SIZE_ERR: 1;
|
9
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
10
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
11
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
12
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
13
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
14
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
15
|
+
readonly NOT_FOUND_ERR: 8;
|
16
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
17
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
18
|
+
readonly INVALID_STATE_ERR: 11;
|
19
|
+
readonly SYNTAX_ERR: 12;
|
20
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
21
|
+
readonly NAMESPACE_ERR: 14;
|
22
|
+
readonly INVALID_ACCESS_ERR: 15;
|
23
|
+
readonly VALIDATION_ERR: 16;
|
24
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
25
|
+
readonly SECURITY_ERR: 18;
|
26
|
+
readonly NETWORK_ERR: 19;
|
27
|
+
readonly ABORT_ERR: 20;
|
28
|
+
readonly URL_MISMATCH_ERR: 21;
|
29
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
30
|
+
readonly TIMEOUT_ERR: 23;
|
31
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
32
|
+
readonly DATA_CLONE_ERR: 25;
|
33
|
+
}
|
34
|
+
|
35
|
+
declare global {
|
36
|
+
interface DOMException extends _DOMException {}
|
37
|
+
var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
|
38
|
+
: {
|
39
|
+
prototype: DOMException;
|
40
|
+
new(message?: string, name?: string): DOMException;
|
41
|
+
new(message?: string, options?: { name?: string; cause?: unknown }): DOMException;
|
42
|
+
readonly INDEX_SIZE_ERR: 1;
|
43
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
44
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
45
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
46
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
47
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
48
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
49
|
+
readonly NOT_FOUND_ERR: 8;
|
50
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
51
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
52
|
+
readonly INVALID_STATE_ERR: 11;
|
53
|
+
readonly SYNTAX_ERR: 12;
|
54
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
55
|
+
readonly NAMESPACE_ERR: 14;
|
56
|
+
readonly INVALID_ACCESS_ERR: 15;
|
57
|
+
readonly VALIDATION_ERR: 16;
|
58
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
59
|
+
readonly SECURITY_ERR: 18;
|
60
|
+
readonly NETWORK_ERR: 19;
|
61
|
+
readonly ABORT_ERR: 20;
|
62
|
+
readonly URL_MISMATCH_ERR: 21;
|
63
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
64
|
+
readonly TIMEOUT_ERR: 23;
|
65
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
66
|
+
readonly DATA_CLONE_ERR: 25;
|
67
|
+
};
|
68
|
+
}
|
@@ -1,37 +1,61 @@
|
|
1
|
-
// Make this a module
|
2
1
|
export {};
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
interface AddEventListenerOptions extends EventListenerOptions {
|
4
|
+
once?: boolean;
|
5
|
+
passive?: boolean;
|
6
|
+
signal?: AbortSignal;
|
7
|
+
}
|
6
8
|
|
7
|
-
type
|
9
|
+
type _CustomEvent<T = any> = typeof globalThis extends { onmessage: any } ? {} : CustomEvent<T>;
|
10
|
+
interface CustomEvent<T = any> extends Event {
|
11
|
+
readonly detail: T;
|
12
|
+
}
|
13
|
+
|
14
|
+
interface CustomEventInit<T = any> extends EventInit {
|
15
|
+
detail?: T;
|
16
|
+
}
|
17
|
+
|
18
|
+
type _Event = typeof globalThis extends { onmessage: any } ? {} : Event;
|
8
19
|
interface Event {
|
9
20
|
readonly bubbles: boolean;
|
10
21
|
cancelBubble: boolean;
|
11
22
|
readonly cancelable: boolean;
|
12
23
|
readonly composed: boolean;
|
13
|
-
composedPath(): [EventTarget?];
|
14
24
|
readonly currentTarget: EventTarget | null;
|
15
25
|
readonly defaultPrevented: boolean;
|
16
26
|
readonly eventPhase: 0 | 2;
|
17
|
-
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
|
18
27
|
readonly isTrusted: boolean;
|
19
|
-
|
20
|
-
readonly returnValue: boolean;
|
28
|
+
returnValue: boolean;
|
21
29
|
readonly srcElement: EventTarget | null;
|
22
|
-
stopImmediatePropagation(): void;
|
23
|
-
stopPropagation(): void;
|
24
30
|
readonly target: EventTarget | null;
|
25
31
|
readonly timeStamp: number;
|
26
32
|
readonly type: string;
|
33
|
+
composedPath(): [EventTarget?];
|
34
|
+
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
|
35
|
+
preventDefault(): void;
|
36
|
+
stopImmediatePropagation(): void;
|
37
|
+
stopPropagation(): void;
|
27
38
|
}
|
28
39
|
|
29
|
-
|
30
|
-
|
31
|
-
|
40
|
+
interface EventInit {
|
41
|
+
bubbles?: boolean;
|
42
|
+
cancelable?: boolean;
|
43
|
+
composed?: boolean;
|
44
|
+
}
|
45
|
+
|
46
|
+
interface EventListener {
|
47
|
+
(evt: Event): void;
|
48
|
+
}
|
49
|
+
|
50
|
+
interface EventListenerObject {
|
51
|
+
handleEvent(object: Event): void;
|
52
|
+
}
|
53
|
+
|
54
|
+
interface EventListenerOptions {
|
55
|
+
capture?: boolean;
|
32
56
|
}
|
33
57
|
|
34
|
-
type
|
58
|
+
type _EventTarget = typeof globalThis extends { onmessage: any } ? {} : EventTarget;
|
35
59
|
interface EventTarget {
|
36
60
|
addEventListener(
|
37
61
|
type: string,
|
@@ -46,51 +70,22 @@ interface EventTarget {
|
|
46
70
|
): void;
|
47
71
|
}
|
48
72
|
|
49
|
-
interface EventInit {
|
50
|
-
bubbles?: boolean;
|
51
|
-
cancelable?: boolean;
|
52
|
-
composed?: boolean;
|
53
|
-
}
|
54
|
-
|
55
|
-
interface CustomEventInit<T = any> extends EventInit {
|
56
|
-
detail?: T;
|
57
|
-
}
|
58
|
-
|
59
|
-
interface EventListenerOptions {
|
60
|
-
capture?: boolean;
|
61
|
-
}
|
62
|
-
|
63
|
-
interface AddEventListenerOptions extends EventListenerOptions {
|
64
|
-
once?: boolean;
|
65
|
-
passive?: boolean;
|
66
|
-
signal?: AbortSignal;
|
67
|
-
}
|
68
|
-
|
69
|
-
interface EventListener {
|
70
|
-
(evt: Event): void;
|
71
|
-
}
|
72
|
-
|
73
|
-
interface EventListenerObject {
|
74
|
-
handleEvent(object: Event): void;
|
75
|
-
}
|
76
|
-
|
77
|
-
// Merge conditional interfaces into global scope, and conditionally declare global constructors.
|
78
73
|
declare global {
|
79
|
-
interface
|
80
|
-
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
|
81
|
-
: {
|
82
|
-
prototype: Event;
|
83
|
-
new(type: string, eventInitDict?: EventInit): Event;
|
84
|
-
};
|
85
|
-
|
86
|
-
interface CustomEvent<T = any> extends __CustomEvent<T> {}
|
74
|
+
interface CustomEvent<T = any> extends _CustomEvent<T> {}
|
87
75
|
var CustomEvent: typeof globalThis extends { onmessage: any; CustomEvent: infer T } ? T
|
88
76
|
: {
|
89
77
|
prototype: CustomEvent;
|
90
78
|
new<T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
|
91
79
|
};
|
92
80
|
|
93
|
-
interface
|
81
|
+
interface Event extends _Event {}
|
82
|
+
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
|
83
|
+
: {
|
84
|
+
prototype: Event;
|
85
|
+
new(type: string, eventInitDict?: EventInit): Event;
|
86
|
+
};
|
87
|
+
|
88
|
+
interface EventTarget extends _EventTarget {}
|
94
89
|
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
|
95
90
|
: {
|
96
91
|
prototype: EventTarget;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
export {};
|
2
|
+
|
3
|
+
import * as undici from "undici-types";
|
4
|
+
|
5
|
+
type _EventSource = typeof globalThis extends { onmessage: any } ? {} : undici.EventSource;
|
6
|
+
type _FormData = typeof globalThis extends { onmessage: any } ? {} : undici.FormData;
|
7
|
+
type _Headers = typeof globalThis extends { onmessage: any } ? {} : undici.Headers;
|
8
|
+
type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : undici.MessageEvent;
|
9
|
+
type _Request = typeof globalThis extends { onmessage: any } ? {} : undici.Request;
|
10
|
+
type _RequestInit = typeof globalThis extends { onmessage: any } ? {} : undici.RequestInit;
|
11
|
+
type _Response = typeof globalThis extends { onmessage: any } ? {} : undici.Response;
|
12
|
+
type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} : undici.ResponseInit;
|
13
|
+
type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : undici.WebSocket;
|
14
|
+
|
15
|
+
declare global {
|
16
|
+
function fetch(
|
17
|
+
input: string | URL | Request,
|
18
|
+
init?: RequestInit,
|
19
|
+
): Promise<Response>;
|
20
|
+
|
21
|
+
interface EventSource extends _EventSource {}
|
22
|
+
var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T : typeof undici.EventSource;
|
23
|
+
|
24
|
+
interface FormData extends _FormData {}
|
25
|
+
var FormData: typeof globalThis extends { onmessage: any; FormData: infer T } ? T : typeof undici.FormData;
|
26
|
+
|
27
|
+
interface Headers extends _Headers {}
|
28
|
+
var Headers: typeof globalThis extends { onmessage: any; Headers: infer T } ? T : typeof undici.Headers;
|
29
|
+
|
30
|
+
interface MessageEvent extends _MessageEvent {}
|
31
|
+
var MessageEvent: typeof globalThis extends { onmessage: any; MessageEvent: infer T } ? T
|
32
|
+
: typeof undici.MessageEvent;
|
33
|
+
|
34
|
+
interface Request extends _Request {}
|
35
|
+
var Request: typeof globalThis extends { onmessage: any; Request: infer T } ? T : typeof undici.Request;
|
36
|
+
|
37
|
+
interface RequestInit extends _RequestInit {}
|
38
|
+
|
39
|
+
interface Response extends _Response {}
|
40
|
+
var Response: typeof globalThis extends { onmessage: any; Response: infer T } ? T : typeof undici.Response;
|
41
|
+
|
42
|
+
interface ResponseInit extends _ResponseInit {}
|
43
|
+
|
44
|
+
interface WebSocket extends _WebSocket {}
|
45
|
+
var WebSocket: typeof globalThis extends { onmessage: any; WebSocket: infer T } ? T : typeof undici.WebSocket;
|
46
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export {};
|
2
|
+
|
3
|
+
// lib.webworker has `WorkerNavigator` rather than `Navigator`, so conditionals use `onabort` instead of `onmessage`
|
4
|
+
type _Navigator = typeof globalThis extends { onabort: any } ? {} : Navigator;
|
5
|
+
interface Navigator {
|
6
|
+
readonly hardwareConcurrency: number;
|
7
|
+
readonly language: string;
|
8
|
+
readonly languages: readonly string[];
|
9
|
+
readonly platform: string;
|
10
|
+
readonly userAgent: string;
|
11
|
+
}
|
12
|
+
|
13
|
+
declare global {
|
14
|
+
interface Navigator extends _Navigator {}
|
15
|
+
var Navigator: typeof globalThis extends { onabort: any; Navigator: infer T } ? T : {
|
16
|
+
prototype: Navigator;
|
17
|
+
new(): Navigator;
|
18
|
+
};
|
19
|
+
|
20
|
+
// Needs conditional inference for lib.dom and lib.webworker compatibility
|
21
|
+
var navigator: typeof globalThis extends { onmessage: any; navigator: infer T } ? T : Navigator;
|
22
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
export {};
|
2
|
+
|
3
|
+
// These interfaces are absent from lib.webworker, so the conditionals use `onabort` rather than `onmessage`
|
4
|
+
type _Storage = typeof globalThis extends { onabort: any } ? {} : Storage;
|
5
|
+
interface Storage {
|
6
|
+
readonly length: number;
|
7
|
+
clear(): void;
|
8
|
+
getItem(key: string): string | null;
|
9
|
+
key(index: number): string | null;
|
10
|
+
removeItem(key: string): void;
|
11
|
+
setItem(key: string, value: string): void;
|
12
|
+
[key: string]: any;
|
13
|
+
}
|
14
|
+
|
15
|
+
declare global {
|
16
|
+
interface Storage extends _Storage {}
|
17
|
+
var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T : {
|
18
|
+
prototype: Storage;
|
19
|
+
new(): Storage;
|
20
|
+
};
|
21
|
+
|
22
|
+
var localStorage: Storage;
|
23
|
+
var sessionStorage: Storage;
|
24
|
+
}
|