@types/node 16.4.1 → 16.4.5
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/README.md +2 -2
- node/assert/strict.d.ts +0 -1
- node/assert.d.ts +1352 -40
- node/async_hooks.d.ts +359 -90
- node/buffer.d.ts +1503 -78
- node/child_process.d.ts +1054 -233
- node/cluster.d.ts +320 -100
- node/console.d.ts +305 -32
- node/crypto.d.ts +3115 -739
- node/dgram.d.ts +446 -55
- node/diagnostics_channel.d.ts +85 -12
- node/dns/promises.d.ts +292 -36
- node/dns.d.ts +410 -97
- node/domain.d.ts +154 -10
- node/events.d.ts +377 -31
- node/fs/promises.d.ts +697 -273
- node/fs.d.ts +2257 -858
- node/http.d.ts +889 -81
- node/http2.d.ts +1520 -459
- node/https.d.ts +261 -11
- node/index.d.ts +25 -0
- node/inspector.d.ts +354 -661
- node/module.d.ts +49 -11
- node/net.d.ts +548 -140
- node/os.d.ts +236 -26
- node/package.json +7 -2
- node/path.d.ts +9 -5
- node/perf_hooks.d.ts +288 -90
- node/process.d.ts +1092 -153
- node/punycode.d.ts +65 -26
- node/querystring.d.ts +107 -8
- node/readline.d.ts +425 -79
- node/repl.d.ts +135 -110
- node/stream/promises.d.ts +15 -44
- node/stream.d.ts +927 -225
- node/string_decoder.d.ts +57 -1
- node/timers/promises.d.ts +97 -9
- node/timers.d.ts +29 -10
- node/tls.d.ts +444 -221
- node/trace_events.d.ts +107 -11
- node/tty.d.ts +163 -23
- node/url.d.ts +739 -29
- node/util.d.ts +1361 -73
- node/v8.d.ts +254 -78
- node/vm.d.ts +381 -33
- node/wasi.d.ts +107 -24
- node/worker_threads.d.ts +494 -131
- node/zlib.d.ts +215 -63
node/module.d.ts
CHANGED
|
@@ -1,12 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since v0.3.7
|
|
3
|
+
*/
|
|
1
4
|
declare module 'module' {
|
|
2
5
|
import { URL } from 'node:url';
|
|
3
6
|
namespace Module {
|
|
4
7
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
8
|
+
* The `module.syncBuiltinESMExports()` method updates all the live bindings for
|
|
9
|
+
* builtin `ES Modules` to match the properties of the `CommonJS` exports. It
|
|
10
|
+
* does not add or remove exported names from the `ES Modules`.
|
|
11
|
+
*
|
|
12
|
+
* ```js
|
|
13
|
+
* const fs = require('fs');
|
|
14
|
+
* const assert = require('assert');
|
|
15
|
+
* const { syncBuiltinESMExports } = require('module');
|
|
16
|
+
*
|
|
17
|
+
* fs.readFile = newAPI;
|
|
18
|
+
*
|
|
19
|
+
* delete fs.readFileSync;
|
|
20
|
+
*
|
|
21
|
+
* function newAPI() {
|
|
22
|
+
* // ...
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* fs.newAPI = newAPI;
|
|
26
|
+
*
|
|
27
|
+
* syncBuiltinESMExports();
|
|
28
|
+
*
|
|
29
|
+
* import('fs').then((esmFS) => {
|
|
30
|
+
* // It syncs the existing readFile property with the new value
|
|
31
|
+
* assert.strictEqual(esmFS.readFile, newAPI);
|
|
32
|
+
* // readFileSync has been deleted from the required fs
|
|
33
|
+
* assert.strictEqual('readFileSync' in fs, false);
|
|
34
|
+
* // syncBuiltinESMExports() does not remove readFileSync from esmFS
|
|
35
|
+
* assert.strictEqual('readFileSync' in esmFS, true);
|
|
36
|
+
* // syncBuiltinESMExports() does not add names
|
|
37
|
+
* assert.strictEqual(esmFS.newAPI, undefined);
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
* @since v12.12.0
|
|
7
41
|
*/
|
|
8
42
|
function syncBuiltinESMExports(): void;
|
|
9
|
-
|
|
43
|
+
/**
|
|
44
|
+
* `path` is the resolved path for the file for which a corresponding source map
|
|
45
|
+
* should be fetched.
|
|
46
|
+
* @since v13.7.0, v12.17.0
|
|
47
|
+
*/
|
|
10
48
|
function findSourceMap(path: string, error?: Error): SourceMap;
|
|
11
49
|
interface SourceMapPayload {
|
|
12
50
|
file: string;
|
|
@@ -17,7 +55,6 @@ declare module 'module' {
|
|
|
17
55
|
mappings: string;
|
|
18
56
|
sourceRoot: string;
|
|
19
57
|
}
|
|
20
|
-
|
|
21
58
|
interface SourceMapping {
|
|
22
59
|
generatedLine: number;
|
|
23
60
|
generatedColumn: number;
|
|
@@ -25,10 +62,17 @@ declare module 'module' {
|
|
|
25
62
|
originalLine: number;
|
|
26
63
|
originalColumn: number;
|
|
27
64
|
}
|
|
28
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @since v13.7.0, v12.17.0
|
|
67
|
+
*/
|
|
29
68
|
class SourceMap {
|
|
30
69
|
readonly payload: SourceMapPayload;
|
|
31
70
|
constructor(payload: SourceMapPayload);
|
|
71
|
+
/**
|
|
72
|
+
* Given a line number and column number in the generated source file, returns
|
|
73
|
+
* an object representing the position in the original file. The object returned
|
|
74
|
+
* consists of the following keys:
|
|
75
|
+
*/
|
|
32
76
|
findEntry(line: number, column: number): SourceMapping;
|
|
33
77
|
}
|
|
34
78
|
}
|
|
@@ -36,15 +80,11 @@ declare module 'module' {
|
|
|
36
80
|
class Module {
|
|
37
81
|
static runMain(): void;
|
|
38
82
|
static wrap(code: string): string;
|
|
39
|
-
|
|
40
83
|
static createRequire(path: string | URL): NodeRequire;
|
|
41
84
|
static builtinModules: string[];
|
|
42
|
-
|
|
43
85
|
static Module: typeof Module;
|
|
44
|
-
|
|
45
86
|
constructor(id: string, parent?: Module);
|
|
46
87
|
}
|
|
47
|
-
|
|
48
88
|
global {
|
|
49
89
|
interface ImportMeta {
|
|
50
90
|
url: string;
|
|
@@ -63,10 +103,8 @@ declare module 'module' {
|
|
|
63
103
|
resolve?(specified: string, parent?: string | URL): Promise<string>;
|
|
64
104
|
}
|
|
65
105
|
}
|
|
66
|
-
|
|
67
106
|
export = Module;
|
|
68
107
|
}
|
|
69
|
-
|
|
70
108
|
declare module 'node:module' {
|
|
71
109
|
import module = require('module');
|
|
72
110
|
export = module;
|