@types/node 18.11.5 → 20.2.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.d.ts +86 -75
- node/async_hooks.d.ts +66 -37
- node/buffer.d.ts +193 -100
- node/child_process.d.ts +82 -56
- node/cluster.d.ts +12 -12
- node/console.d.ts +5 -5
- node/crypto.d.ts +233 -235
- node/dgram.d.ts +15 -15
- node/diagnostics_channel.d.ts +59 -21
- node/dns/promises.d.ts +50 -6
- node/dns.d.ts +26 -17
- node/domain.d.ts +4 -4
- node/events.d.ts +111 -65
- node/fs/promises.d.ts +99 -47
- node/fs.d.ts +244 -73
- node/globals.d.ts +6 -3
- node/http.d.ts +265 -148
- node/http2.d.ts +42 -47
- node/https.d.ts +53 -153
- node/index.d.ts +2 -1
- node/inspector.d.ts +10 -3
- node/module.d.ts +6 -4
- node/net.d.ts +32 -15
- node/os.d.ts +27 -16
- node/package.json +9 -4
- node/path.d.ts +4 -4
- node/perf_hooks.d.ts +28 -15
- node/process.d.ts +49 -46
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +5 -5
- node/readline/promises.d.ts +65 -63
- node/readline.d.ts +32 -159
- node/repl.d.ts +20 -20
- node/stream/consumers.d.ts +1 -1
- node/stream.d.ts +950 -869
- node/string_decoder.d.ts +6 -6
- node/test.d.ts +877 -139
- node/timers/promises.d.ts +26 -1
- node/timers.d.ts +125 -4
- node/tls.d.ts +120 -29
- node/trace_events.d.ts +20 -9
- node/ts4.8/assert.d.ts +86 -75
- node/ts4.8/async_hooks.d.ts +66 -37
- node/ts4.8/buffer.d.ts +193 -101
- node/ts4.8/child_process.d.ts +82 -56
- node/ts4.8/cluster.d.ts +12 -12
- node/ts4.8/console.d.ts +5 -5
- node/ts4.8/crypto.d.ts +230 -233
- node/ts4.8/dgram.d.ts +15 -15
- node/ts4.8/diagnostics_channel.d.ts +59 -21
- node/ts4.8/dns/promises.d.ts +50 -6
- node/ts4.8/dns.d.ts +26 -17
- node/ts4.8/domain.d.ts +4 -4
- node/ts4.8/events.d.ts +111 -65
- node/ts4.8/fs/promises.d.ts +97 -46
- node/ts4.8/fs.d.ts +244 -73
- node/ts4.8/globals.d.ts +21 -12
- node/ts4.8/http.d.ts +265 -148
- node/ts4.8/http2.d.ts +42 -47
- node/ts4.8/https.d.ts +53 -153
- node/ts4.8/inspector.d.ts +10 -3
- node/ts4.8/module.d.ts +6 -4
- node/ts4.8/net.d.ts +33 -16
- node/ts4.8/os.d.ts +27 -16
- node/ts4.8/path.d.ts +4 -4
- node/ts4.8/perf_hooks.d.ts +28 -15
- node/ts4.8/process.d.ts +49 -46
- node/ts4.8/punycode.d.ts +1 -1
- node/ts4.8/querystring.d.ts +5 -5
- node/ts4.8/readline/promises.d.ts +65 -63
- node/ts4.8/readline.d.ts +32 -159
- node/ts4.8/repl.d.ts +20 -20
- node/ts4.8/stream/consumers.d.ts +1 -1
- node/ts4.8/stream.d.ts +192 -140
- node/ts4.8/string_decoder.d.ts +6 -6
- node/ts4.8/test.d.ts +877 -139
- node/ts4.8/timers/promises.d.ts +26 -1
- node/ts4.8/timers.d.ts +125 -4
- node/ts4.8/tls.d.ts +120 -29
- node/ts4.8/trace_events.d.ts +20 -9
- node/ts4.8/tty.d.ts +4 -5
- node/ts4.8/url.d.ts +46 -42
- node/ts4.8/util.d.ts +325 -123
- node/ts4.8/v8.d.ts +253 -14
- node/ts4.8/vm.d.ts +417 -32
- node/ts4.8/wasi.d.ts +13 -19
- node/ts4.8/worker_threads.d.ts +38 -34
- node/ts4.8/zlib.d.ts +11 -11
- node/tty.d.ts +4 -5
- node/url.d.ts +46 -42
- node/util.d.ts +325 -123
- node/v8.d.ts +253 -14
- node/vm.d.ts +417 -32
- node/wasi.d.ts +13 -19
- node/worker_threads.d.ts +38 -34
- node/zlib.d.ts +11 -11
node/ts4.8/path.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ declare module 'path/win32' {
|
|
|
7
7
|
export = path;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* The `path` module provides utilities for working with file and directory
|
|
11
|
-
* It can be accessed using:
|
|
10
|
+
* The `node:path` module provides utilities for working with file and directory
|
|
11
|
+
* paths. It can be accessed using:
|
|
12
12
|
*
|
|
13
13
|
* ```js
|
|
14
|
-
* const path = require('path');
|
|
14
|
+
* const path = require('node:path');
|
|
15
15
|
* ```
|
|
16
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
16
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js)
|
|
17
17
|
*/
|
|
18
18
|
declare module 'path' {
|
|
19
19
|
namespace path {
|
node/ts4.8/perf_hooks.d.ts
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
|
|
8
8
|
* * [Performance Timeline](https://w3c.github.io/performance-timeline/)
|
|
9
9
|
* * [User Timing](https://www.w3.org/TR/user-timing/)
|
|
10
|
+
* * [Resource Timing](https://www.w3.org/TR/resource-timing-2/)
|
|
10
11
|
*
|
|
11
12
|
* ```js
|
|
12
|
-
* const { PerformanceObserver, performance } = require('perf_hooks');
|
|
13
|
+
* const { PerformanceObserver, performance } = require('node:perf_hooks');
|
|
13
14
|
*
|
|
14
15
|
* const obs = new PerformanceObserver((items) => {
|
|
15
16
|
* console.log(items.getEntries()[0].duration);
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
* performance.measure('A to B', 'A', 'B');
|
|
27
28
|
* });
|
|
28
29
|
* ```
|
|
29
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
30
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/perf_hooks.js)
|
|
30
31
|
*/
|
|
31
32
|
declare module 'perf_hooks' {
|
|
32
33
|
import { AsyncResource } from 'node:async_hooks';
|
|
@@ -46,6 +47,7 @@ declare module 'perf_hooks' {
|
|
|
46
47
|
readonly flags?: number | undefined;
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
50
|
+
* The constructor of this class is not exposed to users directly.
|
|
49
51
|
* @since v8.5.0
|
|
50
52
|
*/
|
|
51
53
|
class PerformanceEntry {
|
|
@@ -87,10 +89,20 @@ declare module 'perf_hooks' {
|
|
|
87
89
|
readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
|
|
88
90
|
toJSON(): any;
|
|
89
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Exposes marks created via the `Performance.mark()` method.
|
|
94
|
+
* @since v18.2.0, v16.17.0
|
|
95
|
+
*/
|
|
90
96
|
class PerformanceMark extends PerformanceEntry {
|
|
91
97
|
readonly duration: 0;
|
|
92
98
|
readonly entryType: 'mark';
|
|
93
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Exposes measures created via the `Performance.measure()` method.
|
|
102
|
+
*
|
|
103
|
+
* The constructor of this class is not exposed to users directly.
|
|
104
|
+
* @since v18.2.0, v16.17.0
|
|
105
|
+
*/
|
|
94
106
|
class PerformanceMeasure extends PerformanceEntry {
|
|
95
107
|
readonly entryType: 'measure';
|
|
96
108
|
}
|
|
@@ -288,8 +300,8 @@ declare module 'perf_hooks' {
|
|
|
288
300
|
* ```js
|
|
289
301
|
* const {
|
|
290
302
|
* performance,
|
|
291
|
-
* PerformanceObserver
|
|
292
|
-
* } = require('perf_hooks');
|
|
303
|
+
* PerformanceObserver,
|
|
304
|
+
* } = require('node:perf_hooks');
|
|
293
305
|
*
|
|
294
306
|
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
|
295
307
|
* console.log(perfObserverList.getEntries());
|
|
@@ -330,8 +342,8 @@ declare module 'perf_hooks' {
|
|
|
330
342
|
* ```js
|
|
331
343
|
* const {
|
|
332
344
|
* performance,
|
|
333
|
-
* PerformanceObserver
|
|
334
|
-
* } = require('perf_hooks');
|
|
345
|
+
* PerformanceObserver,
|
|
346
|
+
* } = require('node:perf_hooks');
|
|
335
347
|
*
|
|
336
348
|
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
|
337
349
|
* console.log(perfObserverList.getEntriesByName('meow'));
|
|
@@ -379,8 +391,8 @@ declare module 'perf_hooks' {
|
|
|
379
391
|
* ```js
|
|
380
392
|
* const {
|
|
381
393
|
* performance,
|
|
382
|
-
* PerformanceObserver
|
|
383
|
-
* } = require('perf_hooks');
|
|
394
|
+
* PerformanceObserver,
|
|
395
|
+
* } = require('node:perf_hooks');
|
|
384
396
|
*
|
|
385
397
|
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
|
386
398
|
* console.log(perfObserverList.getEntriesByType('mark'));
|
|
@@ -414,6 +426,9 @@ declare module 'perf_hooks' {
|
|
|
414
426
|
getEntriesByType(type: EntryType): PerformanceEntry[];
|
|
415
427
|
}
|
|
416
428
|
type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
|
|
429
|
+
/**
|
|
430
|
+
* @since v8.5.0
|
|
431
|
+
*/
|
|
417
432
|
class PerformanceObserver extends AsyncResource {
|
|
418
433
|
constructor(callback: PerformanceObserverCallback);
|
|
419
434
|
/**
|
|
@@ -427,8 +442,8 @@ declare module 'perf_hooks' {
|
|
|
427
442
|
* ```js
|
|
428
443
|
* const {
|
|
429
444
|
* performance,
|
|
430
|
-
* PerformanceObserver
|
|
431
|
-
* } = require('perf_hooks');
|
|
445
|
+
* PerformanceObserver,
|
|
446
|
+
* } = require('node:perf_hooks');
|
|
432
447
|
*
|
|
433
448
|
* const obs = new PerformanceObserver((list, observer) => {
|
|
434
449
|
* // Called once asynchronously. `list` contains three items.
|
|
@@ -547,11 +562,10 @@ declare module 'perf_hooks' {
|
|
|
547
562
|
*/
|
|
548
563
|
recordDelta(): void;
|
|
549
564
|
/**
|
|
550
|
-
* Adds the values from other to this histogram.
|
|
565
|
+
* Adds the values from `other` to this histogram.
|
|
551
566
|
* @since v17.4.0, v16.14.0
|
|
552
|
-
* @param other Recordable Histogram to combine with
|
|
553
567
|
*/
|
|
554
|
-
|
|
568
|
+
add(other: RecordableHistogram): void;
|
|
555
569
|
}
|
|
556
570
|
/**
|
|
557
571
|
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
@@ -566,7 +580,7 @@ declare module 'perf_hooks' {
|
|
|
566
580
|
* detect.
|
|
567
581
|
*
|
|
568
582
|
* ```js
|
|
569
|
-
* const { monitorEventLoopDelay } = require('perf_hooks');
|
|
583
|
+
* const { monitorEventLoopDelay } = require('node:perf_hooks');
|
|
570
584
|
* const h = monitorEventLoopDelay({ resolution: 20 });
|
|
571
585
|
* h.enable();
|
|
572
586
|
* // Do something.
|
|
@@ -604,7 +618,6 @@ declare module 'perf_hooks' {
|
|
|
604
618
|
* @since v15.9.0, v14.18.0
|
|
605
619
|
*/
|
|
606
620
|
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
|
607
|
-
|
|
608
621
|
import { performance as _performance } from 'perf_hooks';
|
|
609
622
|
global {
|
|
610
623
|
/**
|
node/ts4.8/process.d.ts
CHANGED
|
@@ -250,7 +250,7 @@ declare module 'process' {
|
|
|
250
250
|
* For example, to copy `process.stdin` to `process.stdout`:
|
|
251
251
|
*
|
|
252
252
|
* ```js
|
|
253
|
-
* import { stdin, stdout } from 'process';
|
|
253
|
+
* import { stdin, stdout } from 'node:process';
|
|
254
254
|
*
|
|
255
255
|
* stdin.pipe(stdout);
|
|
256
256
|
* ```
|
|
@@ -297,7 +297,7 @@ declare module 'process' {
|
|
|
297
297
|
* For example, assuming the following script for `process-args.js`:
|
|
298
298
|
*
|
|
299
299
|
* ```js
|
|
300
|
-
* import { argv } from 'process';
|
|
300
|
+
* import { argv } from 'node:process';
|
|
301
301
|
*
|
|
302
302
|
* // print process.argv
|
|
303
303
|
* argv.forEach((val, index) => {
|
|
@@ -389,7 +389,7 @@ declare module 'process' {
|
|
|
389
389
|
* the specified `directory` does not exist).
|
|
390
390
|
*
|
|
391
391
|
* ```js
|
|
392
|
-
* import { chdir, cwd } from 'process';
|
|
392
|
+
* import { chdir, cwd } from 'node:process';
|
|
393
393
|
*
|
|
394
394
|
* console.log(`Starting directory: ${cwd()}`);
|
|
395
395
|
* try {
|
|
@@ -409,7 +409,7 @@ declare module 'process' {
|
|
|
409
409
|
* process.
|
|
410
410
|
*
|
|
411
411
|
* ```js
|
|
412
|
-
* import { cwd } from 'process';
|
|
412
|
+
* import { cwd } from 'node:process';
|
|
413
413
|
*
|
|
414
414
|
* console.log(`Current directory: ${cwd()}`);
|
|
415
415
|
* ```
|
|
@@ -420,7 +420,7 @@ declare module 'process' {
|
|
|
420
420
|
* The port used by the Node.js debugger when enabled.
|
|
421
421
|
*
|
|
422
422
|
* ```js
|
|
423
|
-
* import process from 'process';
|
|
423
|
+
* import process from 'node:process';
|
|
424
424
|
*
|
|
425
425
|
* process.debugPort = 5858;
|
|
426
426
|
* ```
|
|
@@ -432,12 +432,12 @@ declare module 'process' {
|
|
|
432
432
|
* specific process warnings. These can be listened for by adding a handler to the `'warning'` event.
|
|
433
433
|
*
|
|
434
434
|
* ```js
|
|
435
|
-
* import { emitWarning } from 'process';
|
|
435
|
+
* import { emitWarning } from 'node:process';
|
|
436
436
|
*
|
|
437
437
|
* // Emit a warning with a code and additional detail.
|
|
438
438
|
* emitWarning('Something happened!', {
|
|
439
439
|
* code: 'MY_WARNING',
|
|
440
|
-
* detail: 'This is some additional information'
|
|
440
|
+
* detail: 'This is some additional information',
|
|
441
441
|
* });
|
|
442
442
|
* // Emits:
|
|
443
443
|
* // (node:56338) [MY_WARNING] Warning: Something happened!
|
|
@@ -447,7 +447,7 @@ declare module 'process' {
|
|
|
447
447
|
* In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler.
|
|
448
448
|
*
|
|
449
449
|
* ```js
|
|
450
|
-
* import process from 'process';
|
|
450
|
+
* import process from 'node:process';
|
|
451
451
|
*
|
|
452
452
|
* process.on('warning', (warning) => {
|
|
453
453
|
* console.warn(warning.name); // 'Warning'
|
|
@@ -499,7 +499,7 @@ declare module 'process' {
|
|
|
499
499
|
* While the following will:
|
|
500
500
|
*
|
|
501
501
|
* ```js
|
|
502
|
-
* import { env } from 'process';
|
|
502
|
+
* import { env } from 'node:process';
|
|
503
503
|
*
|
|
504
504
|
* env.foo = 'bar';
|
|
505
505
|
* console.log(env.foo);
|
|
@@ -510,7 +510,7 @@ declare module 'process' {
|
|
|
510
510
|
* throw an error when the value is not a string, number, or boolean.
|
|
511
511
|
*
|
|
512
512
|
* ```js
|
|
513
|
-
* import { env } from 'process';
|
|
513
|
+
* import { env } from 'node:process';
|
|
514
514
|
*
|
|
515
515
|
* env.test = null;
|
|
516
516
|
* console.log(env.test);
|
|
@@ -523,7 +523,7 @@ declare module 'process' {
|
|
|
523
523
|
* Use `delete` to delete a property from `process.env`.
|
|
524
524
|
*
|
|
525
525
|
* ```js
|
|
526
|
-
* import { env } from 'process';
|
|
526
|
+
* import { env } from 'node:process';
|
|
527
527
|
*
|
|
528
528
|
* env.TEST = 1;
|
|
529
529
|
* delete env.TEST;
|
|
@@ -534,7 +534,7 @@ declare module 'process' {
|
|
|
534
534
|
* On Windows operating systems, environment variables are case-insensitive.
|
|
535
535
|
*
|
|
536
536
|
* ```js
|
|
537
|
-
* import { env } from 'process';
|
|
537
|
+
* import { env } from 'node:process';
|
|
538
538
|
*
|
|
539
539
|
* env.TEST = 1;
|
|
540
540
|
* console.log(env.test);
|
|
@@ -543,7 +543,7 @@ declare module 'process' {
|
|
|
543
543
|
*
|
|
544
544
|
* Unless explicitly specified when creating a `Worker` instance,
|
|
545
545
|
* each `Worker` thread has its own copy of `process.env`, based on its
|
|
546
|
-
* parent thread
|
|
546
|
+
* parent thread's `process.env`, or whatever was specified as the `env` option
|
|
547
547
|
* to the `Worker` constructor. Changes to `process.env` will not be visible
|
|
548
548
|
* across `Worker` threads, and only the main thread can make changes that
|
|
549
549
|
* are visible to the operating system or to native add-ons.
|
|
@@ -560,7 +560,7 @@ declare module 'process' {
|
|
|
560
560
|
* To exit with a 'failure' code:
|
|
561
561
|
*
|
|
562
562
|
* ```js
|
|
563
|
-
* import { exit } from 'process';
|
|
563
|
+
* import { exit } from 'node:process';
|
|
564
564
|
*
|
|
565
565
|
* exit(1);
|
|
566
566
|
* ```
|
|
@@ -579,7 +579,7 @@ declare module 'process' {
|
|
|
579
579
|
* truncated and lost:
|
|
580
580
|
*
|
|
581
581
|
* ```js
|
|
582
|
-
* import { exit } from 'process';
|
|
582
|
+
* import { exit } from 'node:process';
|
|
583
583
|
*
|
|
584
584
|
* // This is an example of what *not* to do:
|
|
585
585
|
* if (someConditionNotMet()) {
|
|
@@ -596,7 +596,7 @@ declare module 'process' {
|
|
|
596
596
|
* scheduling any additional work for the event loop:
|
|
597
597
|
*
|
|
598
598
|
* ```js
|
|
599
|
-
* import process from 'process';
|
|
599
|
+
* import process from 'node:process';
|
|
600
600
|
*
|
|
601
601
|
* // How to properly set the exit code while letting
|
|
602
602
|
* // the process exit gracefully.
|
|
@@ -613,7 +613,7 @@ declare module 'process' {
|
|
|
613
613
|
* In `Worker` threads, this function stops the current thread rather
|
|
614
614
|
* than the current process.
|
|
615
615
|
* @since v0.1.13
|
|
616
|
-
* @param [code=0] The exit code.
|
|
616
|
+
* @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed.
|
|
617
617
|
*/
|
|
618
618
|
exit(code?: number): never;
|
|
619
619
|
/**
|
|
@@ -873,7 +873,7 @@ declare module 'process' {
|
|
|
873
873
|
* The `process.version` property contains the Node.js version string.
|
|
874
874
|
*
|
|
875
875
|
* ```js
|
|
876
|
-
* import { version } from 'process';
|
|
876
|
+
* import { version } from 'node:process';
|
|
877
877
|
*
|
|
878
878
|
* console.log(`Version: ${version}`);
|
|
879
879
|
* // Version: v14.8.0
|
|
@@ -890,7 +890,7 @@ declare module 'process' {
|
|
|
890
890
|
* to load modules that were compiled against a different module ABI version.
|
|
891
891
|
*
|
|
892
892
|
* ```js
|
|
893
|
-
* import { versions } from 'process';
|
|
893
|
+
* import { versions } from 'node:process';
|
|
894
894
|
*
|
|
895
895
|
* console.log(versions);
|
|
896
896
|
* ```
|
|
@@ -918,10 +918,10 @@ declare module 'process' {
|
|
|
918
918
|
*/
|
|
919
919
|
readonly versions: ProcessVersions;
|
|
920
920
|
/**
|
|
921
|
-
* The `process.config` property returns
|
|
922
|
-
* representation of the configure options used to compile the current
|
|
923
|
-
* executable. This is the same as the `config.gypi` file that was produced
|
|
924
|
-
* running the `./configure` script.
|
|
921
|
+
* The `process.config` property returns a frozen `Object` containing the
|
|
922
|
+
* JavaScript representation of the configure options used to compile the current
|
|
923
|
+
* Node.js executable. This is the same as the `config.gypi` file that was produced
|
|
924
|
+
* when running the `./configure` script.
|
|
925
925
|
*
|
|
926
926
|
* An example of the possible output looks like:
|
|
927
927
|
*
|
|
@@ -943,7 +943,6 @@ declare module 'process' {
|
|
|
943
943
|
* node_shared_http_parser: 'false',
|
|
944
944
|
* node_shared_libuv: 'false',
|
|
945
945
|
* node_shared_zlib: 'false',
|
|
946
|
-
* node_use_dtrace: 'false',
|
|
947
946
|
* node_use_openssl: 'true',
|
|
948
947
|
* node_shared_openssl: 'false',
|
|
949
948
|
* strict_aliasing: 'true',
|
|
@@ -952,13 +951,6 @@ declare module 'process' {
|
|
|
952
951
|
* }
|
|
953
952
|
* }
|
|
954
953
|
* ```
|
|
955
|
-
*
|
|
956
|
-
* The `process.config` property is **not** read-only and there are existing
|
|
957
|
-
* modules in the ecosystem that are known to extend, modify, or entirely replace
|
|
958
|
-
* the value of `process.config`.
|
|
959
|
-
*
|
|
960
|
-
* Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made
|
|
961
|
-
* read-only in a future release.
|
|
962
954
|
* @since v0.7.7
|
|
963
955
|
*/
|
|
964
956
|
readonly config: ProcessConfig;
|
|
@@ -977,7 +969,7 @@ declare module 'process' {
|
|
|
977
969
|
* other than kill the target process.
|
|
978
970
|
*
|
|
979
971
|
* ```js
|
|
980
|
-
* import process, { kill } from 'process';
|
|
972
|
+
* import process, { kill } from 'node:process';
|
|
981
973
|
*
|
|
982
974
|
* process.on('SIGHUP', () => {
|
|
983
975
|
* console.log('Got SIGHUP signal.');
|
|
@@ -1002,7 +994,7 @@ declare module 'process' {
|
|
|
1002
994
|
* The `process.pid` property returns the PID of the process.
|
|
1003
995
|
*
|
|
1004
996
|
* ```js
|
|
1005
|
-
* import { pid } from 'process';
|
|
997
|
+
* import { pid } from 'node:process';
|
|
1006
998
|
*
|
|
1007
999
|
* console.log(`This process is pid ${pid}`);
|
|
1008
1000
|
* ```
|
|
@@ -1014,7 +1006,7 @@ declare module 'process' {
|
|
|
1014
1006
|
* current process.
|
|
1015
1007
|
*
|
|
1016
1008
|
* ```js
|
|
1017
|
-
* import { ppid } from 'process';
|
|
1009
|
+
* import { ppid } from 'node:process';
|
|
1018
1010
|
*
|
|
1019
1011
|
* console.log(`The parent process is pid ${ppid}`);
|
|
1020
1012
|
* ```
|
|
@@ -1044,7 +1036,7 @@ declare module 'process' {
|
|
|
1044
1036
|
* Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
|
|
1045
1037
|
*
|
|
1046
1038
|
* ```js
|
|
1047
|
-
* import { arch } from 'process';
|
|
1039
|
+
* import { arch } from 'node:process';
|
|
1048
1040
|
*
|
|
1049
1041
|
* console.log(`This processor architecture is ${arch}`);
|
|
1050
1042
|
* ```
|
|
@@ -1066,7 +1058,7 @@ declare module 'process' {
|
|
|
1066
1058
|
* * `'win32'`
|
|
1067
1059
|
*
|
|
1068
1060
|
* ```js
|
|
1069
|
-
* import { platform } from 'process';
|
|
1061
|
+
* import { platform } from 'node:process';
|
|
1070
1062
|
*
|
|
1071
1063
|
* console.log(`This platform is ${platform}`);
|
|
1072
1064
|
* ```
|
|
@@ -1089,6 +1081,17 @@ declare module 'process' {
|
|
|
1089
1081
|
*/
|
|
1090
1082
|
mainModule?: Module | undefined;
|
|
1091
1083
|
memoryUsage: MemoryUsageFn;
|
|
1084
|
+
/**
|
|
1085
|
+
* Gets the amount of memory available to the process (in bytes) based on
|
|
1086
|
+
* limits imposed by the OS. If there is no such constraint, or the constraint
|
|
1087
|
+
* is unknown, `undefined` is returned.
|
|
1088
|
+
*
|
|
1089
|
+
* See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more
|
|
1090
|
+
* information.
|
|
1091
|
+
* @since v19.6.0, v18.15.0
|
|
1092
|
+
* @experimental
|
|
1093
|
+
*/
|
|
1094
|
+
constrainedMemory(): number | undefined;
|
|
1092
1095
|
/**
|
|
1093
1096
|
* The `process.cpuUsage()` method returns the user and system CPU time usage of
|
|
1094
1097
|
* the current process, in an object with properties `user` and `system`, whose
|
|
@@ -1100,7 +1103,7 @@ declare module 'process' {
|
|
|
1100
1103
|
* argument to the function, to get a diff reading.
|
|
1101
1104
|
*
|
|
1102
1105
|
* ```js
|
|
1103
|
-
* import { cpuUsage } from 'process';
|
|
1106
|
+
* import { cpuUsage } from 'node:process';
|
|
1104
1107
|
*
|
|
1105
1108
|
* const startUsage = cpuUsage();
|
|
1106
1109
|
* // { user: 38579, system: 6986 }
|
|
@@ -1124,7 +1127,7 @@ declare module 'process' {
|
|
|
1124
1127
|
* See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background.
|
|
1125
1128
|
*
|
|
1126
1129
|
* ```js
|
|
1127
|
-
* import { nextTick } from 'process';
|
|
1130
|
+
* import { nextTick } from 'node:process';
|
|
1128
1131
|
*
|
|
1129
1132
|
* console.log('start');
|
|
1130
1133
|
* nextTick(() => {
|
|
@@ -1142,7 +1145,7 @@ declare module 'process' {
|
|
|
1142
1145
|
* I/O has occurred:
|
|
1143
1146
|
*
|
|
1144
1147
|
* ```js
|
|
1145
|
-
* import { nextTick } from 'process';
|
|
1148
|
+
* import { nextTick } from 'node:process';
|
|
1146
1149
|
*
|
|
1147
1150
|
* function MyThing(options) {
|
|
1148
1151
|
* this.setupOptions(options);
|
|
@@ -1190,7 +1193,7 @@ declare module 'process' {
|
|
|
1190
1193
|
* The following approach is much better:
|
|
1191
1194
|
*
|
|
1192
1195
|
* ```js
|
|
1193
|
-
* import { nextTick } from 'process';
|
|
1196
|
+
* import { nextTick } from 'node:process';
|
|
1194
1197
|
*
|
|
1195
1198
|
* function definitelyAsync(arg, cb) {
|
|
1196
1199
|
* if (arg) {
|
|
@@ -1215,10 +1218,10 @@ declare module 'process' {
|
|
|
1215
1218
|
* ```js
|
|
1216
1219
|
* {
|
|
1217
1220
|
* name: 'node',
|
|
1218
|
-
* lts: '
|
|
1219
|
-
* sourceUrl: 'https://nodejs.org/download/release/
|
|
1220
|
-
* headersUrl: 'https://nodejs.org/download/release/
|
|
1221
|
-
* libUrl: 'https://nodejs.org/download/release/
|
|
1221
|
+
* lts: 'Hydrogen',
|
|
1222
|
+
* sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz',
|
|
1223
|
+
* headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz',
|
|
1224
|
+
* libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib'
|
|
1222
1225
|
* }
|
|
1223
1226
|
* ```
|
|
1224
1227
|
*
|
|
@@ -1322,7 +1325,7 @@ declare module 'process' {
|
|
|
1322
1325
|
* dashes:
|
|
1323
1326
|
*
|
|
1324
1327
|
* ```js
|
|
1325
|
-
* import { allowedNodeEnvironmentFlags } from 'process';
|
|
1328
|
+
* import { allowedNodeEnvironmentFlags } from 'node:process';
|
|
1326
1329
|
*
|
|
1327
1330
|
* allowedNodeEnvironmentFlags.forEach((flag) => {
|
|
1328
1331
|
* // -r
|
|
@@ -1348,7 +1351,7 @@ declare module 'process' {
|
|
|
1348
1351
|
report?: ProcessReport | undefined;
|
|
1349
1352
|
/**
|
|
1350
1353
|
* ```js
|
|
1351
|
-
* import { resourceUsage } from 'process';
|
|
1354
|
+
* import { resourceUsage } from 'node:process';
|
|
1352
1355
|
*
|
|
1353
1356
|
* console.log(resourceUsage());
|
|
1354
1357
|
* /*
|
node/ts4.8/punycode.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* made available to developers as a convenience. Fixes or other modifications to
|
|
25
25
|
* the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
|
|
26
26
|
* @deprecated Since v7.0.0 - Deprecated
|
|
27
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
27
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/punycode.js)
|
|
28
28
|
*/
|
|
29
29
|
declare module 'punycode' {
|
|
30
30
|
/**
|
node/ts4.8/querystring.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `querystring` module provides utilities for parsing and formatting URL
|
|
2
|
+
* The `node:querystring` module provides utilities for parsing and formatting URL
|
|
3
3
|
* query strings. It can be accessed using:
|
|
4
4
|
*
|
|
5
5
|
* ```js
|
|
6
|
-
* const querystring = require('querystring');
|
|
6
|
+
* const querystring = require('node:querystring');
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
9
|
* `querystring` is more performant than `URLSearchParams` but is not a
|
|
10
|
-
* standardized API. Use `URLSearchParams` when performance is not critical
|
|
11
|
-
*
|
|
12
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
10
|
+
* standardized API. Use `URLSearchParams` when performance is not critical or
|
|
11
|
+
* when compatibility with browser code is desirable.
|
|
12
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/querystring.js)
|
|
13
13
|
*/
|
|
14
14
|
declare module 'querystring' {
|
|
15
15
|
interface StringifyOptions {
|