@types/node 15.14.7 → 16.0.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.
Files changed (65) hide show
  1. {node v15.14 → node}/LICENSE +0 -0
  2. node v15.14/README.md → node/README.md +3 -3
  3. node/assert/strict.d.ts +9 -0
  4. node v15.14/assert.d.ts → node/assert.d.ts +35 -30
  5. node v15.14/async_hooks.d.ts → node/async_hooks.d.ts +7 -3
  6. {node v15.14 → node}/base.d.ts +0 -0
  7. node/buffer.d.ts +357 -0
  8. node v15.14/child_process.d.ts → node/child_process.d.ts +54 -50
  9. node v15.14/cluster.d.ts → node/cluster.d.ts +33 -108
  10. node v15.14/console.d.ts → node/console.d.ts +24 -23
  11. node v15.14/constants.d.ts → node/constants.d.ts +5 -0
  12. node v15.14/crypto.d.ts → node/crypto.d.ts +82 -67
  13. node v15.14/dgram.d.ts → node/dgram.d.ts +13 -9
  14. node v15.14/diagnostic_channel.d.ts → node/diagnostic_channel.d.ts +4 -0
  15. node v15.14/dns/promises.d.ts → node/dns/promises.d.ts +4 -0
  16. node v15.14/dns.d.ts → node/dns.d.ts +15 -11
  17. node/domain.d.ts +25 -0
  18. node v15.14/events.d.ts → node/events.d.ts +8 -3
  19. node v15.14/fs/promises.d.ts → node/fs/promises.d.ts +25 -17
  20. node v15.14/fs.d.ts → node/fs.d.ts +71 -75
  21. node/globals.d.ts +274 -0
  22. node/globals.global.d.ts +1 -0
  23. node v15.14/http.d.ts → node/http.d.ts +109 -167
  24. node v15.14/http2.d.ts → node/http2.d.ts +69 -66
  25. node/https.d.ts +40 -0
  26. node v15.14/index.d.ts → node/index.d.ts +1 -1
  27. node v15.14/inspector.d.ts → node/inspector.d.ts +152 -470
  28. node v15.14/module.d.ts → node/module.d.ts +25 -4
  29. node v15.14/net.d.ts → node/net.d.ts +34 -36
  30. node v15.14/os.d.ts → node/os.d.ts +4 -0
  31. node v15.14/package.json → node/package.json +2 -2
  32. node v15.14/path.d.ts → node/path.d.ts +10 -5
  33. node v15.14/perf_hooks.d.ts → node/perf_hooks.d.ts +70 -23
  34. node v15.14/process.d.ts → node/process.d.ts +54 -51
  35. node v15.14/punycode.d.ts → node/punycode.d.ts +4 -0
  36. node v15.14/querystring.d.ts → node/querystring.d.ts +7 -3
  37. node v15.14/readline.d.ts → node/readline.d.ts +20 -16
  38. node v15.14/repl.d.ts → node/repl.d.ts +18 -14
  39. node v15.14/stream/promises.d.ts → node/stream/promises.d.ts +4 -0
  40. node v15.14/stream.d.ts → node/stream.d.ts +22 -17
  41. node v15.14/string_decoder.d.ts → node/string_decoder.d.ts +4 -0
  42. node v15.14/timers/promises.d.ts → node/timers/promises.d.ts +4 -0
  43. node/timers.d.ts +92 -0
  44. node v15.14/tls.d.ts → node/tls.d.ts +54 -50
  45. node v15.14/trace_events.d.ts → node/trace_events.d.ts +4 -0
  46. node v15.14/ts3.6/assert.d.ts → node/ts3.6/assert.d.ts +26 -26
  47. {node v15.14 → node}/ts3.6/base.d.ts +0 -0
  48. {node v15.14 → node}/ts3.6/index.d.ts +0 -0
  49. node v15.14/tty.d.ts → node/tty.d.ts +4 -0
  50. node v15.14/url.d.ts → node/url.d.ts +19 -15
  51. node/util/types.d.ts +57 -0
  52. node v15.14/util.d.ts → node/util.d.ts +67 -21
  53. node v15.14/v8.d.ts → node/v8.d.ts +4 -0
  54. node v15.14/vm.d.ts → node/vm.d.ts +28 -24
  55. node v15.14/wasi.d.ts → node/wasi.d.ts +11 -7
  56. node v15.14/worker_threads.d.ts → node/worker_threads.d.ts +19 -15
  57. node v15.14/zlib.d.ts → node/zlib.d.ts +20 -16
  58. node v15.14/assert/strict.d.ts +0 -4
  59. node v15.14/buffer.d.ts +0 -112
  60. node v15.14/domain.d.ts +0 -24
  61. node v15.14/globals.d.ts +0 -659
  62. node v15.14/globals.global.d.ts +0 -1
  63. node v15.14/https.d.ts +0 -139
  64. node v15.14/timers.d.ts +0 -27
  65. node v15.14/util/types.d.ts +0 -53
@@ -37,10 +37,6 @@ declare module 'module' {
37
37
  static runMain(): void;
38
38
  static wrap(code: string): string;
39
39
 
40
- /**
41
- * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
42
- */
43
- static createRequireFromPath(path: string): NodeRequire;
44
40
  static createRequire(path: string | URL): NodeRequire;
45
41
  static builtinModules: string[];
46
42
 
@@ -48,5 +44,30 @@ declare module 'module' {
48
44
 
49
45
  constructor(id: string, parent?: Module);
50
46
  }
47
+
48
+ global {
49
+ interface ImportMeta {
50
+ url: string;
51
+ /**
52
+ * @experimental
53
+ * This feature is only available with the `--experimental-import-meta-resolve`
54
+ * command flag enabled.
55
+ *
56
+ * Provides a module-relative resolution function scoped to each module, returning
57
+ * the URL string.
58
+ *
59
+ * @param specified The module specifier to resolve relative to `parent`.
60
+ * @param parent The absolute parent module URL to resolve from. If none
61
+ * is specified, the value of `import.meta.url` is used as the default.
62
+ */
63
+ resolve?(specified: string, parent?: string | URL): Promise<string>;
64
+ }
65
+ }
66
+
51
67
  export = Module;
52
68
  }
69
+
70
+ declare module 'node:module' {
71
+ import module = require('module');
72
+ export = module;
73
+ }
@@ -16,10 +16,10 @@ declare module 'net' {
16
16
  }
17
17
 
18
18
  interface SocketConstructorOpts {
19
- fd?: number;
20
- allowHalfOpen?: boolean;
21
- readable?: boolean;
22
- writable?: boolean;
19
+ fd?: number | undefined;
20
+ allowHalfOpen?: boolean | undefined;
21
+ readable?: boolean | undefined;
22
+ writable?: boolean | undefined;
23
23
  }
24
24
 
25
25
  interface OnReadOpts {
@@ -38,17 +38,17 @@ declare module 'net' {
38
38
  * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
39
39
  * still be emitted as normal and methods like pause() and resume() will also behave as expected.
40
40
  */
41
- onread?: OnReadOpts;
41
+ onread?: OnReadOpts | undefined;
42
42
  }
43
43
 
44
44
  interface TcpSocketConnectOpts extends ConnectOpts {
45
45
  port: number;
46
- host?: string;
47
- localAddress?: string;
48
- localPort?: number;
49
- hints?: number;
50
- family?: number;
51
- lookup?: LookupFunction;
46
+ host?: string | undefined;
47
+ localAddress?: string | undefined;
48
+ localPort?: number | undefined;
49
+ hints?: number | undefined;
50
+ family?: number | undefined;
51
+ lookup?: LookupFunction | undefined;
52
52
  }
53
53
 
54
54
  interface IpcSocketConnectOpts extends ConnectOpts {
@@ -87,9 +87,9 @@ declare module 'net' {
87
87
  readonly destroyed: boolean;
88
88
  readonly localAddress: string;
89
89
  readonly localPort: number;
90
- readonly remoteAddress?: string;
91
- readonly remoteFamily?: string;
92
- readonly remotePort?: number;
90
+ readonly remoteAddress?: string | undefined;
91
+ readonly remoteFamily?: string | undefined;
92
+ readonly remotePort?: number | undefined;
93
93
 
94
94
  // Extended base methods
95
95
  end(cb?: () => void): void;
@@ -115,7 +115,6 @@ declare module 'net' {
115
115
  addListener(event: "end", listener: () => void): this;
116
116
  addListener(event: "error", listener: (err: Error) => void): this;
117
117
  addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
118
- addListener(event: "ready", listener: () => void): this;
119
118
  addListener(event: "timeout", listener: () => void): this;
120
119
 
121
120
  emit(event: string | symbol, ...args: any[]): boolean;
@@ -126,7 +125,6 @@ declare module 'net' {
126
125
  emit(event: "end"): boolean;
127
126
  emit(event: "error", err: Error): boolean;
128
127
  emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
129
- emit(event: "ready"): boolean;
130
128
  emit(event: "timeout"): boolean;
131
129
 
132
130
  on(event: string, listener: (...args: any[]) => void): this;
@@ -137,7 +135,6 @@ declare module 'net' {
137
135
  on(event: "end", listener: () => void): this;
138
136
  on(event: "error", listener: (err: Error) => void): this;
139
137
  on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
140
- on(event: "ready", listener: () => void): this;
141
138
  on(event: "timeout", listener: () => void): this;
142
139
 
143
140
  once(event: string, listener: (...args: any[]) => void): this;
@@ -148,7 +145,6 @@ declare module 'net' {
148
145
  once(event: "end", listener: () => void): this;
149
146
  once(event: "error", listener: (err: Error) => void): this;
150
147
  once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
151
- once(event: "ready", listener: () => void): this;
152
148
  once(event: "timeout", listener: () => void): this;
153
149
 
154
150
  prependListener(event: string, listener: (...args: any[]) => void): this;
@@ -159,7 +155,6 @@ declare module 'net' {
159
155
  prependListener(event: "end", listener: () => void): this;
160
156
  prependListener(event: "error", listener: (err: Error) => void): this;
161
157
  prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
162
- prependListener(event: "ready", listener: () => void): this;
163
158
  prependListener(event: "timeout", listener: () => void): this;
164
159
 
165
160
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
@@ -170,22 +165,21 @@ declare module 'net' {
170
165
  prependOnceListener(event: "end", listener: () => void): this;
171
166
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
172
167
  prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
173
- prependOnceListener(event: "ready", listener: () => void): this;
174
168
  prependOnceListener(event: "timeout", listener: () => void): this;
175
169
  }
176
170
 
177
171
  interface ListenOptions extends Abortable {
178
- port?: number;
179
- host?: string;
180
- backlog?: number;
181
- path?: string;
182
- exclusive?: boolean;
183
- readableAll?: boolean;
184
- writableAll?: boolean;
172
+ port?: number | undefined;
173
+ host?: string | undefined;
174
+ backlog?: number | undefined;
175
+ path?: string | undefined;
176
+ exclusive?: boolean | undefined;
177
+ readableAll?: boolean | undefined;
178
+ writableAll?: boolean | undefined;
185
179
  /**
186
180
  * @default false
187
181
  */
188
- ipv6Only?: boolean;
182
+ ipv6Only?: boolean | undefined;
189
183
  }
190
184
 
191
185
  interface ServerOpts {
@@ -193,13 +187,13 @@ declare module 'net' {
193
187
  * Indicates whether half-opened TCP connections are allowed.
194
188
  * @default false
195
189
  */
196
- allowHalfOpen?: boolean;
190
+ allowHalfOpen?: boolean | undefined;
197
191
 
198
192
  /**
199
193
  * Indicates whether the socket should be paused on incoming connections.
200
194
  * @default false
201
195
  */
202
- pauseOnConnect?: boolean;
196
+ pauseOnConnect?: boolean | undefined;
203
197
  }
204
198
 
205
199
  // https://github.com/nodejs/node/blob/master/lib/net.js
@@ -313,11 +307,11 @@ declare module 'net' {
313
307
  }
314
308
 
315
309
  interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
316
- timeout?: number;
310
+ timeout?: number | undefined;
317
311
  }
318
312
 
319
313
  interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
320
- timeout?: number;
314
+ timeout?: number | undefined;
321
315
  }
322
316
 
323
317
  type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
@@ -339,21 +333,21 @@ declare module 'net' {
339
333
  * The network address as either an IPv4 or IPv6 string.
340
334
  * @default 127.0.0.1
341
335
  */
342
- address?: string;
336
+ address?: string | undefined;
343
337
  /**
344
338
  * @default `'ipv4'`
345
339
  */
346
- family?: IPVersion;
340
+ family?: IPVersion | undefined;
347
341
  /**
348
342
  * An IPv6 flow-label used only if `family` is `'ipv6'`.
349
343
  * @default 0
350
344
  */
351
- flowlabel?: number;
345
+ flowlabel?: number | undefined;
352
346
  /**
353
347
  * An IP port.
354
348
  * @default 0
355
349
  */
356
- port?: number;
350
+ port?: number | undefined;
357
351
  }
358
352
 
359
353
  // TODO: Mark as clonable if `kClone` symbol is set in node.
@@ -368,3 +362,7 @@ declare module 'net' {
368
362
  readonly flowlabel: number;
369
363
  }
370
364
  }
365
+
366
+ declare module 'node:net' {
367
+ export * from 'net';
368
+ }
@@ -237,3 +237,7 @@ declare module 'os' {
237
237
  */
238
238
  function setPriority(pid: number, priority: number): void;
239
239
  }
240
+
241
+ declare module 'node:os' {
242
+ export * from 'os';
243
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "15.14.7",
3
+ "version": "16.0.1",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "f60b71b8600b8ad396862537ba53704951e5478f885bc912439da78112025cbf",
230
+ "typesPublisherContentHash": "439cbcc286cf9e49d4bb3d391b53e338b23d39ce5de6ced5355197c306990b02",
231
231
  "typeScriptVersion": "3.6"
232
232
  }
@@ -40,23 +40,23 @@ declare module 'path' {
40
40
  /**
41
41
  * The root of the path such as '/' or 'c:\'
42
42
  */
43
- root?: string;
43
+ root?: string | undefined;
44
44
  /**
45
45
  * The full directory path such as '/home/user/dir' or 'c:\path\dir'
46
46
  */
47
- dir?: string;
47
+ dir?: string | undefined;
48
48
  /**
49
49
  * The file name including extension (if any) such as 'index.html'
50
50
  */
51
- base?: string;
51
+ base?: string | undefined;
52
52
  /**
53
53
  * The file extension (if any) such as '.html'
54
54
  */
55
- ext?: string;
55
+ ext?: string | undefined;
56
56
  /**
57
57
  * The file name without extension (if any) such as 'index'
58
58
  */
59
- name?: string;
59
+ name?: string | undefined;
60
60
  }
61
61
 
62
62
  interface PlatformPath {
@@ -161,3 +161,8 @@ declare module 'path' {
161
161
  const path: path.PlatformPath;
162
162
  export = path;
163
163
  }
164
+
165
+ declare module 'node:path' {
166
+ import path = require('path');
167
+ export = path;
168
+ }
@@ -3,6 +3,22 @@ declare module 'perf_hooks' {
3
3
 
4
4
  type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
5
5
 
6
+ interface NodeGCPerformanceDetail {
7
+ /**
8
+ * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
9
+ * the type of garbage collection operation that occurred.
10
+ * See perf_hooks.constants for valid values.
11
+ */
12
+ readonly kind?: number | undefined;
13
+
14
+ /**
15
+ * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
16
+ * property contains additional information about garbage collection operation.
17
+ * See perf_hooks.constants for valid values.
18
+ */
19
+ readonly flags?: number | undefined;
20
+ }
21
+
6
22
  class PerformanceEntry {
7
23
  protected constructor();
8
24
  /**
@@ -27,19 +43,7 @@ declare module 'perf_hooks' {
27
43
  */
28
44
  readonly entryType: EntryType;
29
45
 
30
- /**
31
- * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
32
- * the type of garbage collection operation that occurred.
33
- * See perf_hooks.constants for valid values.
34
- */
35
- readonly kind?: number;
36
-
37
- /**
38
- * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
39
- * property contains additional information about garbage collection operation.
40
- * See perf_hooks.constants for valid values.
41
- */
42
- readonly flags?: number;
46
+ readonly details?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
43
47
  }
44
48
 
45
49
  class PerformanceNodeTiming extends PerformanceEntry {
@@ -94,6 +98,46 @@ declare module 'perf_hooks' {
94
98
  util2?: EventLoopUtilization,
95
99
  ) => EventLoopUtilization;
96
100
 
101
+ interface MarkOptions {
102
+ /**
103
+ * Additional optional detail to include with the mark.
104
+ */
105
+ detail?: unknown | undefined;
106
+ /**
107
+ * An optional timestamp to be used as the mark time.
108
+ * @default `performance.now()`.
109
+ */
110
+ startTime?: number | undefined;
111
+ }
112
+
113
+ interface MeasureOptions {
114
+ /**
115
+ * Additional optional detail to include with the mark.
116
+ */
117
+ detail?: unknown | undefined;
118
+ /**
119
+ * Duration between start and end times.
120
+ */
121
+ duration?: number | undefined;
122
+ /**
123
+ * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
124
+ */
125
+ end?: number | string | undefined;
126
+ /**
127
+ * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
128
+ */
129
+ start?: number | string | undefined;
130
+ }
131
+
132
+ interface TimerifyOptions {
133
+ /**
134
+ * A histogram object created using
135
+ * `perf_hooks.createHistogram()` that will record runtime durations in
136
+ * nanoseconds.
137
+ */
138
+ histogram?: RecordableHistogram | undefined;
139
+ }
140
+
97
141
  interface Performance {
98
142
  /**
99
143
  * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
@@ -109,7 +153,7 @@ declare module 'perf_hooks' {
109
153
  * Performance marks are used to mark specific significant moments in the Performance Timeline.
110
154
  * @param name
111
155
  */
112
- mark(name?: string): void;
156
+ mark(name?: string, options?: MarkOptions): void;
113
157
 
114
158
  /**
115
159
  * Creates a new PerformanceMeasure entry in the Performance Timeline.
@@ -127,6 +171,7 @@ declare module 'perf_hooks' {
127
171
  * @param endMark
128
172
  */
129
173
  measure(name: string, startMark?: string, endMark?: string): void;
174
+ measure(name: string, options: MeasureOptions): void;
130
175
 
131
176
  /**
132
177
  * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
@@ -148,7 +193,7 @@ declare module 'perf_hooks' {
148
193
  * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
149
194
  * @param fn
150
195
  */
151
- timerify<T extends (...optionalParams: any[]) => any>(fn: T): T;
196
+ timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
152
197
 
153
198
  /**
154
199
  * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
@@ -188,12 +233,10 @@ declare module 'perf_hooks' {
188
233
  disconnect(): void;
189
234
 
190
235
  /**
191
- * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes.
236
+ * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes or options.type.
192
237
  * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance.
193
- * Property buffered defaults to false.
194
- * @param options
195
238
  */
196
- observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean }): void;
239
+ observe(options: { entryTypes: ReadonlyArray<EntryType> } | { type: EntryType }): void;
197
240
  }
198
241
 
199
242
  namespace constants {
@@ -219,7 +262,7 @@ declare module 'perf_hooks' {
219
262
  * Must be greater than zero.
220
263
  * @default 10
221
264
  */
222
- resolution?: number;
265
+ resolution?: number | undefined;
223
266
  }
224
267
 
225
268
  interface Histogram {
@@ -292,19 +335,23 @@ declare module 'perf_hooks' {
292
335
  * The minimum recordable value. Must be an integer value greater than 0.
293
336
  * @default 1
294
337
  */
295
- min?: number | bigint;
338
+ min?: number | bigint | undefined;
296
339
 
297
340
  /**
298
341
  * The maximum recordable value. Must be an integer value greater than min.
299
342
  * @default Number.MAX_SAFE_INTEGER
300
343
  */
301
- max?: number | bigint;
344
+ max?: number | bigint | undefined;
302
345
  /**
303
346
  * The number of accuracy digits. Must be a number between 1 and 5.
304
347
  * @default 3
305
348
  */
306
- figures?: number;
349
+ figures?: number | undefined;
307
350
  }
308
351
 
309
352
  function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
310
353
  }
354
+
355
+ declare module 'node:perf_hooks' {
356
+ export * from 'perf_hooks';
357
+ }
@@ -38,10 +38,10 @@ declare module 'process' {
38
38
 
39
39
  interface ProcessRelease {
40
40
  name: string;
41
- sourceUrl?: string;
42
- headersUrl?: string;
43
- libUrl?: string;
44
- lts?: string;
41
+ sourceUrl?: string | undefined;
42
+ headersUrl?: string | undefined;
43
+ libUrl?: string | undefined;
44
+ lts?: string | undefined;
45
45
  }
46
46
 
47
47
  interface ProcessVersions extends Dict<string> {
@@ -59,6 +59,7 @@ declare module 'process' {
59
59
  | 'android'
60
60
  | 'darwin'
61
61
  | 'freebsd'
62
+ | 'haiku'
62
63
  | 'linux'
63
64
  | 'openbsd'
64
65
  | 'sunos'
@@ -88,7 +89,7 @@ declare module 'process' {
88
89
  type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
89
90
 
90
91
  interface Socket extends ReadWriteStream {
91
- isTTY?: true;
92
+ isTTY?: true | undefined;
92
93
  }
93
94
 
94
95
  // Alias for compatibility
@@ -189,24 +190,51 @@ declare module 'process' {
189
190
  *
190
191
  * @default 'Warning'
191
192
  */
192
- type?: string;
193
+ type?: string | undefined;
193
194
 
194
195
  /**
195
196
  * A unique identifier for the warning instance being emitted.
196
197
  */
197
- code?: string;
198
+ code?: string | undefined;
198
199
 
199
200
  /**
200
201
  * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
201
202
  *
202
203
  * @default process.emitWarning
203
204
  */
204
- ctor?: Function;
205
+ ctor?: Function | undefined;
205
206
 
206
207
  /**
207
208
  * Additional text to include with the error.
208
209
  */
209
- detail?: string;
210
+ detail?: string | undefined;
211
+ }
212
+
213
+ interface ProcessConfig {
214
+ readonly target_defaults: {
215
+ readonly cflags: any[];
216
+ readonly default_configuration: string;
217
+ readonly defines: string[];
218
+ readonly include_dirs: string[];
219
+ readonly libraries: string[];
220
+ };
221
+ readonly variables: {
222
+ readonly clang: number;
223
+ readonly host_arch: string;
224
+ readonly node_install_npm: boolean;
225
+ readonly node_install_waf: boolean;
226
+ readonly node_prefix: string;
227
+ readonly node_shared_openssl: boolean;
228
+ readonly node_shared_v8: boolean;
229
+ readonly node_shared_zlib: boolean;
230
+ readonly node_use_dtrace: boolean;
231
+ readonly node_use_etw: boolean;
232
+ readonly node_use_openssl: boolean;
233
+ readonly target_arch: string;
234
+ readonly v8_no_strict_aliasing: number;
235
+ readonly v8_use_snapshot: boolean;
236
+ readonly visibility: string;
237
+ };
210
238
  }
211
239
 
212
240
  interface Process extends EventEmitter {
@@ -252,7 +280,7 @@ declare module 'process' {
252
280
 
253
281
  env: ProcessEnv;
254
282
  exit(code?: number): never;
255
- exitCode?: number;
283
+ exitCode?: number | undefined;
256
284
  getgid(): number;
257
285
  setgid(id: number | string): void;
258
286
  getuid(): number;
@@ -265,46 +293,21 @@ declare module 'process' {
265
293
  setgroups(groups: ReadonlyArray<string | number>): void;
266
294
  setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
267
295
  hasUncaughtExceptionCaptureCallback(): boolean;
268
- version: string;
269
- versions: ProcessVersions;
270
- config: {
271
- target_defaults: {
272
- cflags: any[];
273
- default_configuration: string;
274
- defines: string[];
275
- include_dirs: string[];
276
- libraries: string[];
277
- };
278
- variables: {
279
- clang: number;
280
- host_arch: string;
281
- node_install_npm: boolean;
282
- node_install_waf: boolean;
283
- node_prefix: string;
284
- node_shared_openssl: boolean;
285
- node_shared_v8: boolean;
286
- node_shared_zlib: boolean;
287
- node_use_dtrace: boolean;
288
- node_use_etw: boolean;
289
- node_use_openssl: boolean;
290
- target_arch: string;
291
- v8_no_strict_aliasing: number;
292
- v8_use_snapshot: boolean;
293
- visibility: string;
294
- };
295
- };
296
+ readonly version: string;
297
+ readonly versions: ProcessVersions;
298
+ readonly config: ProcessConfig;
296
299
  kill(pid: number, signal?: string | number): true;
297
- pid: number;
298
- ppid: number;
300
+ readonly pid: number;
301
+ readonly ppid: number;
299
302
  title: string;
300
- arch: string;
301
- platform: Platform;
303
+ readonly arch: string;
304
+ readonly platform: Platform;
302
305
  /** @deprecated since v14.0.0 - use `require.main` instead. */
303
- mainModule?: Module;
306
+ mainModule?: Module | undefined;
304
307
  memoryUsage: MemoryUsageFn;
305
308
  cpuUsage(previousValue?: CpuUsage): CpuUsage;
306
309
  nextTick(callback: Function, ...args: any[]): void;
307
- release: ProcessRelease;
310
+ readonly release: ProcessRelease;
308
311
  features: {
309
312
  inspector: boolean;
310
313
  debug: boolean;
@@ -327,10 +330,9 @@ declare module 'process' {
327
330
  umask(mask: string | number): number;
328
331
  uptime(): number;
329
332
  hrtime: HRTime;
330
- domain: Domain;
331
333
 
332
334
  // Worker
333
- send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
335
+ send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean | undefined}, callback?: (error: Error | null) => void): boolean;
334
336
  disconnect(): void;
335
337
  connected: boolean;
336
338
 
@@ -344,7 +346,7 @@ declare module 'process' {
344
346
  /**
345
347
  * Only available with `--experimental-report`
346
348
  */
347
- report?: ProcessReport;
349
+ report?: ProcessReport | undefined;
348
350
 
349
351
  resourceUsage(): ResourceUsage;
350
352
 
@@ -450,12 +452,13 @@ declare module 'process' {
450
452
  listeners(event: "removeListener"): RemoveListenerListener[];
451
453
  listeners(event: "multipleResolves"): MultipleResolveListener[];
452
454
  }
453
-
454
- interface Global {
455
- process: Process;
456
- }
457
455
  }
458
456
  }
459
457
 
460
458
  export = process;
461
459
  }
460
+
461
+ declare module 'node:process' {
462
+ import process = require('process');
463
+ export = process;
464
+ }
@@ -73,3 +73,7 @@ declare module 'punycode' {
73
73
  */
74
74
  const version: string;
75
75
  }
76
+
77
+ declare module 'node:punycode' {
78
+ export * from 'punycode';
79
+ }
@@ -1,11 +1,11 @@
1
1
  declare module 'querystring' {
2
2
  interface StringifyOptions {
3
- encodeURIComponent?: (str: string) => string;
3
+ encodeURIComponent?: ((str: string) => string) | undefined;
4
4
  }
5
5
 
6
6
  interface ParseOptions {
7
- maxKeys?: number;
8
- decodeURIComponent?: (str: string) => string;
7
+ maxKeys?: number | undefined;
8
+ decodeURIComponent?: ((str: string) => string) | undefined;
9
9
  }
10
10
 
11
11
  interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> { }
@@ -26,3 +26,7 @@ declare module 'querystring' {
26
26
  function escape(str: string): string;
27
27
  function unescape(str: string): string;
28
28
  }
29
+
30
+ declare module 'node:querystring' {
31
+ export * from 'querystring';
32
+ }