@types/node 22.15.33 → 24.10.3
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 v24.10/README.md +15 -0
- node v24.10/assert/strict.d.ts +111 -0
- {node v22.15 → node v24.10}/assert.d.ts +162 -101
- {node v22.15 → node v24.10}/async_hooks.d.ts +26 -6
- {node v22.15 → node v24.10}/buffer.buffer.d.ts +9 -0
- {node v22.15 → node v24.10}/buffer.d.ts +15 -7
- {node v22.15 → node v24.10}/child_process.d.ts +91 -164
- {node v22.15 → node v24.10}/cluster.d.ts +19 -20
- {node v22.15 → node v24.10}/compatibility/iterators.d.ts +1 -0
- {node v22.15 → node v24.10}/console.d.ts +19 -18
- {node v22.15 → node v24.10}/crypto.d.ts +1264 -356
- {node v22.15 → node v24.10}/dgram.d.ts +10 -9
- {node v22.15 → node v24.10}/diagnostics_channel.d.ts +1 -3
- {node v22.15 → node v24.10}/dns/promises.d.ts +12 -11
- {node v22.15 → node v24.10}/dns.d.ts +41 -37
- {node v22.15 → node v24.10}/domain.d.ts +1 -1
- {node v22.15 → node v24.10}/events.d.ts +81 -36
- {node v22.15 → node v24.10}/fs/promises.d.ts +101 -57
- {node v22.15 → node v24.10}/fs.d.ts +413 -136
- node v24.10/globals.d.ts +170 -0
- node v24.10/globals.typedarray.d.ts +41 -0
- {node v22.15 → node v24.10}/http.d.ts +187 -37
- {node v22.15 → node v24.10}/http2.d.ts +197 -66
- {node v22.15 → node v24.10}/https.d.ts +97 -63
- {node v22.15 → node v24.10}/index.d.ts +16 -7
- node v24.10/inspector.d.ts +277 -0
- node v22.15/inspector.d.ts → node v24.10/inspector.generated.d.ts +1059 -828
- {node v22.15 → node v24.10}/module.d.ts +90 -30
- {node v22.15 → node v24.10}/net.d.ts +35 -16
- {node v22.15 → node v24.10}/os.d.ts +22 -10
- {node v22.15 → node v24.10}/package.json +14 -84
- {node v22.15 → node v24.10}/path.d.ts +2 -2
- {node v22.15 → node v24.10}/perf_hooks.d.ts +28 -16
- {node v22.15 → node v24.10}/process.d.ts +40 -34
- {node v22.15 → node v24.10}/punycode.d.ts +1 -1
- {node v22.15 → node v24.10}/querystring.d.ts +1 -1
- {node v22.15 → node v24.10}/readline/promises.d.ts +1 -2
- {node v22.15 → node v24.10}/readline.d.ts +13 -13
- {node v22.15 → node v24.10}/repl.d.ts +25 -17
- {node v22.15 → node v24.10}/sea.d.ts +10 -1
- {node v22.15 → node v24.10}/sqlite.d.ts +438 -9
- {node v22.15 → node v24.10}/stream/consumers.d.ts +2 -2
- {node v22.15 → node v24.10}/stream/web.d.ts +13 -54
- {node v22.15 → node v24.10}/stream.d.ts +63 -48
- {node v22.15 → node v24.10}/string_decoder.d.ts +3 -3
- node v24.10/test.d.ts +2339 -0
- {node v22.15 → node v24.10}/timers/promises.d.ts +1 -1
- {node v22.15 → node v24.10}/timers.d.ts +1 -3
- {node v22.15 → node v24.10}/tls.d.ts +124 -114
- {node v22.15 → node v24.10}/trace_events.d.ts +6 -6
- {node v22.15 → node v24.10}/ts5.6/buffer.buffer.d.ts +10 -2
- node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
- node v24.10/ts5.6/globals.typedarray.d.ts +36 -0
- {node v22.15 → node v24.10}/ts5.6/index.d.ts +18 -7
- node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
- node v24.10/ts5.7/index.d.ts +103 -0
- {node v22.15 → node v24.10}/tty.d.ts +1 -1
- {node v22.15 → node v24.10}/url.d.ts +119 -34
- {node v22.15 → node v24.10}/util.d.ts +45 -304
- {node v22.15 → node v24.10}/v8.d.ts +68 -38
- {node v22.15 → node v24.10}/vm.d.ts +258 -107
- {node v22.15 → node v24.10}/wasi.d.ts +23 -2
- node v24.10/web-globals/abortcontroller.d.ts +34 -0
- node v24.10/web-globals/crypto.d.ts +32 -0
- node v24.10/web-globals/domexception.d.ts +68 -0
- node v22.15/dom-events.d.ts → node v24.10/web-globals/events.d.ts +49 -51
- node v24.10/web-globals/fetch.d.ts +50 -0
- node v24.10/web-globals/navigator.d.ts +25 -0
- node v24.10/web-globals/storage.d.ts +24 -0
- node v24.10/web-globals/streams.d.ts +22 -0
- {node v22.15 → node v24.10}/worker_threads.d.ts +206 -68
- {node v22.15 → node v24.10}/zlib.d.ts +44 -33
- node v22.15/README.md +0 -15
- node v22.15/assert/strict.d.ts +0 -8
- node v22.15/compatibility/disposable.d.ts +0 -14
- node v22.15/compatibility/index.d.ts +0 -9
- node v22.15/compatibility/indexable.d.ts +0 -20
- node v22.15/globals.d.ts +0 -364
- node v22.15/globals.typedarray.d.ts +0 -21
- node v22.15/test.d.ts +0 -2278
- node v22.15/ts5.6/globals.typedarray.d.ts +0 -19
- {node v22.15 → node v24.10}/LICENSE +0 -0
- {node v22.15 → node v24.10}/constants.d.ts +0 -0
- {node v22.15 → node v24.10}/stream/promises.d.ts +0 -0
|
@@ -30,7 +30,7 @@ declare module "module" {
|
|
|
30
30
|
/**
|
|
31
31
|
* The following constants are returned as the `status` field in the object returned by
|
|
32
32
|
* {@link enableCompileCache} to indicate the result of the attempt to enable the
|
|
33
|
-
* [module compile cache](https://nodejs.org/docs/latest-
|
|
33
|
+
* [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache).
|
|
34
34
|
* @since v22.8.0
|
|
35
35
|
*/
|
|
36
36
|
namespace compileCacheStatus {
|
|
@@ -81,7 +81,7 @@ declare module "module" {
|
|
|
81
81
|
directory?: string;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* Enable [module compile cache](https://nodejs.org/docs/latest-
|
|
84
|
+
* Enable [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache)
|
|
85
85
|
* in the current Node.js instance.
|
|
86
86
|
*
|
|
87
87
|
* If `cacheDir` is not specified, Node.js will either use the directory specified by the
|
|
@@ -99,7 +99,7 @@ declare module "module" {
|
|
|
99
99
|
* contains the path to the directory where the compile cache is stored. The `status`
|
|
100
100
|
* field in the returned object would be one of the `module.constants.compileCacheStatus`
|
|
101
101
|
* values to indicate the result of the attempt to enable the
|
|
102
|
-
* [module compile cache](https://nodejs.org/docs/latest-
|
|
102
|
+
* [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache).
|
|
103
103
|
*
|
|
104
104
|
* This method only affects the current Node.js instance. To enable it in child worker threads,
|
|
105
105
|
* either call this method in child worker threads too, or set the
|
|
@@ -112,7 +112,7 @@ declare module "module" {
|
|
|
112
112
|
*/
|
|
113
113
|
function enableCompileCache(cacheDir?: string): EnableCompileCacheResult;
|
|
114
114
|
/**
|
|
115
|
-
* Flush the [module compile cache](https://nodejs.org/docs/latest-
|
|
115
|
+
* Flush the [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache)
|
|
116
116
|
* accumulated from modules already loaded
|
|
117
117
|
* in the current Node.js instance to disk. This returns after all the flushing
|
|
118
118
|
* file system operations come to an end, no matter they succeed or not. If there
|
|
@@ -123,7 +123,7 @@ declare module "module" {
|
|
|
123
123
|
function flushCompileCache(): void;
|
|
124
124
|
/**
|
|
125
125
|
* @since v22.8.0
|
|
126
|
-
* @return Path to the [module compile cache](https://nodejs.org/docs/latest-
|
|
126
|
+
* @return Path to the [module compile cache](https://nodejs.org/docs/latest-v24.x/api/module.html#module-compile-cache)
|
|
127
127
|
* directory if it is enabled, or `undefined` otherwise.
|
|
128
128
|
*/
|
|
129
129
|
function getCompileCacheDir(): string | undefined;
|
|
@@ -194,7 +194,7 @@ declare module "module" {
|
|
|
194
194
|
*/
|
|
195
195
|
data?: Data | undefined;
|
|
196
196
|
/**
|
|
197
|
-
* [Transferable objects](https://nodejs.org/docs/latest-
|
|
197
|
+
* [Transferable objects](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#portpostmessagevalue-transferlist)
|
|
198
198
|
* to be passed into the `initialize` hook.
|
|
199
199
|
*/
|
|
200
200
|
transferList?: any[] | undefined;
|
|
@@ -203,10 +203,10 @@ declare module "module" {
|
|
|
203
203
|
/**
|
|
204
204
|
* Register a module that exports hooks that customize Node.js module
|
|
205
205
|
* resolution and loading behavior. See
|
|
206
|
-
* [Customization hooks](https://nodejs.org/docs/latest-
|
|
206
|
+
* [Customization hooks](https://nodejs.org/docs/latest-v24.x/api/module.html#customization-hooks).
|
|
207
207
|
*
|
|
208
208
|
* This feature requires `--allow-worker` if used with the
|
|
209
|
-
* [Permission Model](https://nodejs.org/docs/latest-
|
|
209
|
+
* [Permission Model](https://nodejs.org/docs/latest-v24.x/api/permissions.html#permission-model).
|
|
210
210
|
* @since v20.6.0, v18.19.0
|
|
211
211
|
* @param specifier Customization hooks to be registered; this should be
|
|
212
212
|
* the same string that would be passed to `import()`, except that if it is
|
|
@@ -222,12 +222,12 @@ declare module "module" {
|
|
|
222
222
|
function register<Data = any>(specifier: string | URL, options?: RegisterOptions<Data>): void;
|
|
223
223
|
interface RegisterHooksOptions {
|
|
224
224
|
/**
|
|
225
|
-
* See [load hook](https://nodejs.org/docs/latest-
|
|
225
|
+
* See [load hook](https://nodejs.org/docs/latest-v24.x/api/module.html#loadurl-context-nextload).
|
|
226
226
|
* @default undefined
|
|
227
227
|
*/
|
|
228
228
|
load?: LoadHookSync | undefined;
|
|
229
229
|
/**
|
|
230
|
-
* See [resolve hook](https://nodejs.org/docs/latest-
|
|
230
|
+
* See [resolve hook](https://nodejs.org/docs/latest-v24.x/api/module.html#resolvespecifier-context-nextresolve).
|
|
231
231
|
* @default undefined
|
|
232
232
|
*/
|
|
233
233
|
resolve?: ResolveHookSync | undefined;
|
|
@@ -239,7 +239,7 @@ declare module "module" {
|
|
|
239
239
|
deregister(): void;
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
|
-
* Register [hooks](https://nodejs.org/docs/latest-
|
|
242
|
+
* Register [hooks](https://nodejs.org/docs/latest-v24.x/api/module.html#customization-hooks)
|
|
243
243
|
* that customize Node.js module resolution and loading behavior.
|
|
244
244
|
* @since v22.15.0
|
|
245
245
|
* @experimental
|
|
@@ -270,9 +270,9 @@ declare module "module" {
|
|
|
270
270
|
* with `vm.runInContext()` or `vm.compileFunction()`.
|
|
271
271
|
* By default, it will throw an error if the code contains TypeScript features
|
|
272
272
|
* that require transformation such as `Enums`,
|
|
273
|
-
* see [type-stripping](https://nodejs.org/docs/latest-
|
|
273
|
+
* see [type-stripping](https://nodejs.org/docs/latest-v24.x/api/typescript.md#type-stripping) for more information.
|
|
274
274
|
* When mode is `'transform'`, it also transforms TypeScript features to JavaScript,
|
|
275
|
-
* see [transform TypeScript features](https://nodejs.org/docs/latest-
|
|
275
|
+
* see [transform TypeScript features](https://nodejs.org/docs/latest-v24.x/api/typescript.md#typescript-features) for more information.
|
|
276
276
|
* When mode is `'strip'`, source maps are not generated, because locations are preserved.
|
|
277
277
|
* If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown.
|
|
278
278
|
*
|
|
@@ -359,7 +359,9 @@ declare module "module" {
|
|
|
359
359
|
interface ImportAttributes extends NodeJS.Dict<string> {
|
|
360
360
|
type?: string | undefined;
|
|
361
361
|
}
|
|
362
|
+
type ImportPhase = "source" | "evaluation";
|
|
362
363
|
type ModuleFormat =
|
|
364
|
+
| "addon"
|
|
363
365
|
| "builtin"
|
|
364
366
|
| "commonjs"
|
|
365
367
|
| "commonjs-typescript"
|
|
@@ -501,7 +503,7 @@ declare module "module" {
|
|
|
501
503
|
/**
|
|
502
504
|
* This method returns whether the [Source Map v3](https://tc39.es/ecma426/) support for stack
|
|
503
505
|
* traces is enabled.
|
|
504
|
-
* @since v22.14.0
|
|
506
|
+
* @since v23.7.0, v22.14.0
|
|
505
507
|
*/
|
|
506
508
|
function getSourceMapsSupport(): SourceMapsSupport;
|
|
507
509
|
/**
|
|
@@ -535,7 +537,7 @@ declare module "module" {
|
|
|
535
537
|
* enabled will be parsed and loaded. Preferably, use the commandline options
|
|
536
538
|
* `--enable-source-maps` to avoid losing track of source maps of modules loaded
|
|
537
539
|
* before this API call.
|
|
538
|
-
* @since v22.14.0
|
|
540
|
+
* @since v23.7.0, v22.14.0
|
|
539
541
|
*/
|
|
540
542
|
function setSourceMapsSupport(enabled: boolean, options?: SetSourceMapsSupportOptions): void;
|
|
541
543
|
interface SourceMapConstructorOptions {
|
|
@@ -623,34 +625,91 @@ declare module "module" {
|
|
|
623
625
|
global {
|
|
624
626
|
interface ImportMeta {
|
|
625
627
|
/**
|
|
626
|
-
* The directory name of the current module.
|
|
627
|
-
*
|
|
628
|
+
* The directory name of the current module.
|
|
629
|
+
*
|
|
630
|
+
* This is the same as the `path.dirname()` of the `import.meta.filename`.
|
|
631
|
+
*
|
|
632
|
+
* > **Caveat**: only present on `file:` modules.
|
|
633
|
+
* @since v21.2.0, v20.11.0
|
|
628
634
|
*/
|
|
629
635
|
dirname: string;
|
|
630
636
|
/**
|
|
631
|
-
* The full absolute path and filename of the current module, with
|
|
637
|
+
* The full absolute path and filename of the current module, with
|
|
638
|
+
* symlinks resolved.
|
|
639
|
+
*
|
|
632
640
|
* This is the same as the `url.fileURLToPath()` of the `import.meta.url`.
|
|
633
|
-
*
|
|
641
|
+
*
|
|
642
|
+
* > **Caveat** only local modules support this property. Modules not using the
|
|
643
|
+
* > `file:` protocol will not provide it.
|
|
644
|
+
* @since v21.2.0, v20.11.0
|
|
634
645
|
*/
|
|
635
646
|
filename: string;
|
|
636
647
|
/**
|
|
637
648
|
* The absolute `file:` URL of the module.
|
|
649
|
+
*
|
|
650
|
+
* This is defined exactly the same as it is in browsers providing the URL of the
|
|
651
|
+
* current module file.
|
|
652
|
+
*
|
|
653
|
+
* This enables useful patterns such as relative file loading:
|
|
654
|
+
*
|
|
655
|
+
* ```js
|
|
656
|
+
* import { readFileSync } from 'node:fs';
|
|
657
|
+
* const buffer = readFileSync(new URL('./data.proto', import.meta.url));
|
|
658
|
+
* ```
|
|
638
659
|
*/
|
|
639
660
|
url: string;
|
|
640
661
|
/**
|
|
641
|
-
*
|
|
642
|
-
* the URL string.
|
|
662
|
+
* `import.meta.resolve` is a module-relative resolution function scoped to
|
|
663
|
+
* each module, returning the URL string.
|
|
664
|
+
*
|
|
665
|
+
* ```js
|
|
666
|
+
* const dependencyAsset = import.meta.resolve('component-lib/asset.css');
|
|
667
|
+
* // file:///app/node_modules/component-lib/asset.css
|
|
668
|
+
* import.meta.resolve('./dep.js');
|
|
669
|
+
* // file:///app/dep.js
|
|
670
|
+
* ```
|
|
671
|
+
*
|
|
672
|
+
* All features of the Node.js module resolution are supported. Dependency
|
|
673
|
+
* resolutions are subject to the permitted exports resolutions within the package.
|
|
674
|
+
*
|
|
675
|
+
* **Caveats**:
|
|
676
|
+
*
|
|
677
|
+
* * This can result in synchronous file-system operations, which
|
|
678
|
+
* can impact performance similarly to `require.resolve`.
|
|
679
|
+
* * This feature is not available within custom loaders (it would
|
|
680
|
+
* create a deadlock).
|
|
681
|
+
* @since v13.9.0, v12.16.0
|
|
682
|
+
* @param specifier The module specifier to resolve relative to the
|
|
683
|
+
* current module.
|
|
684
|
+
* @param parent An optional absolute parent module URL to resolve from.
|
|
685
|
+
* **Default:** `import.meta.url`
|
|
686
|
+
* @returns The absolute URL string that the specifier would resolve to.
|
|
687
|
+
*/
|
|
688
|
+
resolve(specifier: string, parent?: string | URL): string;
|
|
689
|
+
/**
|
|
690
|
+
* `true` when the current module is the entry point of the current process; `false` otherwise.
|
|
691
|
+
*
|
|
692
|
+
* Equivalent to `require.main === module` in CommonJS.
|
|
693
|
+
*
|
|
694
|
+
* Analogous to Python's `__name__ == "__main__"`.
|
|
643
695
|
*
|
|
644
|
-
*
|
|
645
|
-
*
|
|
696
|
+
* ```js
|
|
697
|
+
* export function foo() {
|
|
698
|
+
* return 'Hello, world';
|
|
699
|
+
* }
|
|
646
700
|
*
|
|
647
|
-
*
|
|
701
|
+
* function main() {
|
|
702
|
+
* const message = foo();
|
|
703
|
+
* console.log(message);
|
|
704
|
+
* }
|
|
648
705
|
*
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
*
|
|
706
|
+
* if (import.meta.main) main();
|
|
707
|
+
* // `foo` can be imported from another module without possible side-effects from `main`
|
|
708
|
+
* ```
|
|
709
|
+
* @since v24.2.0
|
|
710
|
+
* @experimental
|
|
652
711
|
*/
|
|
653
|
-
|
|
712
|
+
main: boolean;
|
|
654
713
|
}
|
|
655
714
|
namespace NodeJS {
|
|
656
715
|
interface Module {
|
|
@@ -725,7 +784,7 @@ declare module "module" {
|
|
|
725
784
|
* Modules are cached in this object when they are required. By deleting a key
|
|
726
785
|
* value from this object, the next `require` will reload the module.
|
|
727
786
|
* This does not apply to
|
|
728
|
-
* [native addons](https://nodejs.org/docs/latest-
|
|
787
|
+
* [native addons](https://nodejs.org/docs/latest-v24.x/api/addons.html),
|
|
729
788
|
* for which reloading will result in an error.
|
|
730
789
|
* @since v0.3.0
|
|
731
790
|
*/
|
|
@@ -759,7 +818,7 @@ declare module "module" {
|
|
|
759
818
|
* Paths to resolve module location from. If present, these
|
|
760
819
|
* paths are used instead of the default resolution paths, with the exception
|
|
761
820
|
* of
|
|
762
|
-
* [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-
|
|
821
|
+
* [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-v24.x/api/modules.html#loading-from-the-global-folders)
|
|
763
822
|
* like `$HOME/.node_modules`, which are
|
|
764
823
|
* always included. Each of these paths is used as a starting point for
|
|
765
824
|
* the module resolution algorithm, meaning that the `node_modules` hierarchy
|
|
@@ -819,6 +878,7 @@ declare module "module" {
|
|
|
819
878
|
*/
|
|
820
879
|
var require: NodeJS.Require;
|
|
821
880
|
// Global-scope aliases for backwards compatibility with @types/node <13.0.x
|
|
881
|
+
// TODO: consider removing in a future major version update
|
|
822
882
|
/** @deprecated Use `NodeJS.Module` instead. */
|
|
823
883
|
interface NodeModule extends NodeJS.Module {}
|
|
824
884
|
/** @deprecated Use `NodeJS.Require` instead. */
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
* ```js
|
|
11
11
|
* import net from 'node:net';
|
|
12
12
|
* ```
|
|
13
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
13
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/net.js)
|
|
14
14
|
*/
|
|
15
15
|
declare module "net" {
|
|
16
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
16
17
|
import * as stream from "node:stream";
|
|
17
18
|
import { Abortable, EventEmitter } from "node:events";
|
|
18
19
|
import * as dns from "node:dns";
|
|
@@ -32,7 +33,7 @@ declare module "net" {
|
|
|
32
33
|
onread?: OnReadOpts | undefined;
|
|
33
34
|
readable?: boolean | undefined;
|
|
34
35
|
writable?: boolean | undefined;
|
|
35
|
-
signal?: AbortSignal;
|
|
36
|
+
signal?: AbortSignal | undefined;
|
|
36
37
|
}
|
|
37
38
|
interface OnReadOpts {
|
|
38
39
|
buffer: Uint8Array | (() => Uint8Array);
|
|
@@ -43,9 +44,6 @@ declare module "net" {
|
|
|
43
44
|
*/
|
|
44
45
|
callback(bytesWritten: number, buffer: Uint8Array): boolean;
|
|
45
46
|
}
|
|
46
|
-
// TODO: remove empty ConnectOpts placeholder at next major @types/node version.
|
|
47
|
-
/** @deprecated */
|
|
48
|
-
interface ConnectOpts {}
|
|
49
47
|
interface TcpSocketConnectOpts {
|
|
50
48
|
port: number;
|
|
51
49
|
host?: string | undefined;
|
|
@@ -324,25 +322,25 @@ declare module "net" {
|
|
|
324
322
|
* the socket is destroyed (for example, if the client disconnected).
|
|
325
323
|
* @since v0.5.10
|
|
326
324
|
*/
|
|
327
|
-
readonly remoteAddress
|
|
325
|
+
readonly remoteAddress: string | undefined;
|
|
328
326
|
/**
|
|
329
327
|
* The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
|
|
330
328
|
* the socket is destroyed (for example, if the client disconnected).
|
|
331
329
|
* @since v0.11.14
|
|
332
330
|
*/
|
|
333
|
-
readonly remoteFamily
|
|
331
|
+
readonly remoteFamily: string | undefined;
|
|
334
332
|
/**
|
|
335
333
|
* The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
|
|
336
334
|
* the socket is destroyed (for example, if the client disconnected).
|
|
337
335
|
* @since v0.5.10
|
|
338
336
|
*/
|
|
339
|
-
readonly remotePort
|
|
337
|
+
readonly remotePort: number | undefined;
|
|
340
338
|
/**
|
|
341
339
|
* The socket timeout in milliseconds as set by `socket.setTimeout()`.
|
|
342
340
|
* It is `undefined` if a timeout has not been set.
|
|
343
341
|
* @since v10.7.0
|
|
344
342
|
*/
|
|
345
|
-
readonly timeout?: number
|
|
343
|
+
readonly timeout?: number;
|
|
346
344
|
/**
|
|
347
345
|
* Half-closes the socket. i.e., it sends a FIN packet. It is possible the
|
|
348
346
|
* server will still send some data.
|
|
@@ -383,7 +381,7 @@ declare module "net" {
|
|
|
383
381
|
event: "connectionAttemptTimeout",
|
|
384
382
|
listener: (ip: string, port: number, family: number) => void,
|
|
385
383
|
): this;
|
|
386
|
-
addListener(event: "data", listener: (data:
|
|
384
|
+
addListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
387
385
|
addListener(event: "drain", listener: () => void): this;
|
|
388
386
|
addListener(event: "end", listener: () => void): this;
|
|
389
387
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
@@ -399,7 +397,7 @@ declare module "net" {
|
|
|
399
397
|
emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean;
|
|
400
398
|
emit(event: "connectionAttemptFailed", ip: string, port: number, family: number, error: Error): boolean;
|
|
401
399
|
emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean;
|
|
402
|
-
emit(event: "data", data:
|
|
400
|
+
emit(event: "data", data: NonSharedBuffer): boolean;
|
|
403
401
|
emit(event: "drain"): boolean;
|
|
404
402
|
emit(event: "end"): boolean;
|
|
405
403
|
emit(event: "error", err: Error): boolean;
|
|
@@ -415,7 +413,7 @@ declare module "net" {
|
|
|
415
413
|
listener: (ip: string, port: number, family: number, error: Error) => void,
|
|
416
414
|
): this;
|
|
417
415
|
on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
|
418
|
-
on(event: "data", listener: (data:
|
|
416
|
+
on(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
419
417
|
on(event: "drain", listener: () => void): this;
|
|
420
418
|
on(event: "end", listener: () => void): this;
|
|
421
419
|
on(event: "error", listener: (err: Error) => void): this;
|
|
@@ -434,7 +432,7 @@ declare module "net" {
|
|
|
434
432
|
): this;
|
|
435
433
|
once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
|
436
434
|
once(event: "connect", listener: () => void): this;
|
|
437
|
-
once(event: "data", listener: (data:
|
|
435
|
+
once(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
438
436
|
once(event: "drain", listener: () => void): this;
|
|
439
437
|
once(event: "end", listener: () => void): this;
|
|
440
438
|
once(event: "error", listener: (err: Error) => void): this;
|
|
@@ -456,7 +454,7 @@ declare module "net" {
|
|
|
456
454
|
event: "connectionAttemptTimeout",
|
|
457
455
|
listener: (ip: string, port: number, family: number) => void,
|
|
458
456
|
): this;
|
|
459
|
-
prependListener(event: "data", listener: (data:
|
|
457
|
+
prependListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
460
458
|
prependListener(event: "drain", listener: () => void): this;
|
|
461
459
|
prependListener(event: "end", listener: () => void): this;
|
|
462
460
|
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
@@ -481,7 +479,7 @@ declare module "net" {
|
|
|
481
479
|
event: "connectionAttemptTimeout",
|
|
482
480
|
listener: (ip: string, port: number, family: number) => void,
|
|
483
481
|
): this;
|
|
484
|
-
prependOnceListener(event: "data", listener: (data:
|
|
482
|
+
prependOnceListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
|
485
483
|
prependOnceListener(event: "drain", listener: () => void): this;
|
|
486
484
|
prependOnceListener(event: "end", listener: () => void): this;
|
|
487
485
|
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
@@ -538,7 +536,7 @@ declare module "net" {
|
|
|
538
536
|
keepAliveInitialDelay?: number | undefined;
|
|
539
537
|
/**
|
|
540
538
|
* Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
|
|
541
|
-
* @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-
|
|
539
|
+
* @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v24.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode).
|
|
542
540
|
* @since v18.17.0, v20.1.0
|
|
543
541
|
*/
|
|
544
542
|
highWaterMark?: number | undefined;
|
|
@@ -808,6 +806,27 @@ declare module "net" {
|
|
|
808
806
|
* @param value Any JS value
|
|
809
807
|
*/
|
|
810
808
|
static isBlockList(value: unknown): value is BlockList;
|
|
809
|
+
/**
|
|
810
|
+
* ```js
|
|
811
|
+
* const blockList = new net.BlockList();
|
|
812
|
+
* const data = [
|
|
813
|
+
* 'Subnet: IPv4 192.168.1.0/24',
|
|
814
|
+
* 'Address: IPv4 10.0.0.5',
|
|
815
|
+
* 'Range: IPv4 192.168.2.1-192.168.2.10',
|
|
816
|
+
* 'Range: IPv4 10.0.0.1-10.0.0.10',
|
|
817
|
+
* ];
|
|
818
|
+
* blockList.fromJSON(data);
|
|
819
|
+
* blockList.fromJSON(JSON.stringify(data));
|
|
820
|
+
* ```
|
|
821
|
+
* @since v24.5.0
|
|
822
|
+
* @experimental
|
|
823
|
+
*/
|
|
824
|
+
fromJSON(data: string | readonly string[]): void;
|
|
825
|
+
/**
|
|
826
|
+
* @since v24.5.0
|
|
827
|
+
* @experimental
|
|
828
|
+
*/
|
|
829
|
+
toJSON(): readonly string[];
|
|
811
830
|
}
|
|
812
831
|
interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
|
|
813
832
|
timeout?: number | undefined;
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* ```js
|
|
6
6
|
* import os from 'node:os';
|
|
7
7
|
* ```
|
|
8
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/os.js)
|
|
9
9
|
*/
|
|
10
10
|
declare module "os" {
|
|
11
|
+
import { NonSharedBuffer } from "buffer";
|
|
11
12
|
interface CpuInfo {
|
|
12
13
|
model: string;
|
|
13
14
|
speed: number;
|
|
@@ -30,10 +31,10 @@ declare module "os" {
|
|
|
30
31
|
mac: string;
|
|
31
32
|
internal: boolean;
|
|
32
33
|
cidr: string | null;
|
|
34
|
+
scopeid?: number;
|
|
33
35
|
}
|
|
34
36
|
interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
|
|
35
37
|
family: "IPv4";
|
|
36
|
-
scopeid?: undefined;
|
|
37
38
|
}
|
|
38
39
|
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
|
|
39
40
|
family: "IPv6";
|
|
@@ -231,6 +232,15 @@ declare module "os" {
|
|
|
231
232
|
* @since v2.3.0
|
|
232
233
|
*/
|
|
233
234
|
function homedir(): string;
|
|
235
|
+
interface UserInfoOptions {
|
|
236
|
+
encoding?: BufferEncoding | "buffer" | undefined;
|
|
237
|
+
}
|
|
238
|
+
interface UserInfoOptionsWithBufferEncoding extends UserInfoOptions {
|
|
239
|
+
encoding: "buffer";
|
|
240
|
+
}
|
|
241
|
+
interface UserInfoOptionsWithStringEncoding extends UserInfoOptions {
|
|
242
|
+
encoding?: BufferEncoding | undefined;
|
|
243
|
+
}
|
|
234
244
|
/**
|
|
235
245
|
* Returns information about the currently effective user. On POSIX platforms,
|
|
236
246
|
* this is typically a subset of the password file. The returned object includes
|
|
@@ -241,11 +251,12 @@ declare module "os" {
|
|
|
241
251
|
* environment variables for the home directory before falling back to the
|
|
242
252
|
* operating system response.
|
|
243
253
|
*
|
|
244
|
-
* Throws a [`SystemError`](https://nodejs.org/docs/latest-
|
|
254
|
+
* Throws a [`SystemError`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`.
|
|
245
255
|
* @since v6.0.0
|
|
246
256
|
*/
|
|
247
|
-
function userInfo(options
|
|
248
|
-
function userInfo(options
|
|
257
|
+
function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo<string>;
|
|
258
|
+
function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo<NonSharedBuffer>;
|
|
259
|
+
function userInfo(options: UserInfoOptions): UserInfo<string | NonSharedBuffer>;
|
|
249
260
|
type SignalConstants = {
|
|
250
261
|
[key in NodeJS.Signals]: number;
|
|
251
262
|
};
|
|
@@ -417,13 +428,13 @@ declare module "os" {
|
|
|
417
428
|
const EOL: string;
|
|
418
429
|
/**
|
|
419
430
|
* Returns the operating system CPU architecture for which the Node.js binary was
|
|
420
|
-
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`,
|
|
421
|
-
* and `'x64'`.
|
|
431
|
+
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`,
|
|
432
|
+
* `'mips'`, `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`.
|
|
422
433
|
*
|
|
423
|
-
* The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-
|
|
434
|
+
* The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v24.x/api/process.html#processarch).
|
|
424
435
|
* @since v0.5.0
|
|
425
436
|
*/
|
|
426
|
-
function arch():
|
|
437
|
+
function arch(): NodeJS.Architecture;
|
|
427
438
|
/**
|
|
428
439
|
* Returns a string identifying the kernel version.
|
|
429
440
|
*
|
|
@@ -445,7 +456,8 @@ declare module "os" {
|
|
|
445
456
|
*/
|
|
446
457
|
function platform(): NodeJS.Platform;
|
|
447
458
|
/**
|
|
448
|
-
* Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,
|
|
459
|
+
* Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,
|
|
460
|
+
* `mips`, `mips64`, `ppc64`, `ppc64le`, `s390x`, `i386`, `i686`, `x86_64`.
|
|
449
461
|
*
|
|
450
462
|
* On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
|
|
451
463
|
* available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.10.3",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,11 +15,6 @@
|
|
|
15
15
|
"githubUsername": "jkomyno",
|
|
16
16
|
"url": "https://github.com/jkomyno"
|
|
17
17
|
},
|
|
18
|
-
{
|
|
19
|
-
"name": "Alvis HT Tang",
|
|
20
|
-
"githubUsername": "alvis",
|
|
21
|
-
"url": "https://github.com/alvis"
|
|
22
|
-
},
|
|
23
18
|
{
|
|
24
19
|
"name": "Andrew Makarov",
|
|
25
20
|
"githubUsername": "r3nya",
|
|
@@ -30,56 +25,11 @@
|
|
|
30
25
|
"githubUsername": "btoueg",
|
|
31
26
|
"url": "https://github.com/btoueg"
|
|
32
27
|
},
|
|
33
|
-
{
|
|
34
|
-
"name": "Chigozirim C.",
|
|
35
|
-
"githubUsername": "smac89",
|
|
36
|
-
"url": "https://github.com/smac89"
|
|
37
|
-
},
|
|
38
28
|
{
|
|
39
29
|
"name": "David Junger",
|
|
40
30
|
"githubUsername": "touffy",
|
|
41
31
|
"url": "https://github.com/touffy"
|
|
42
32
|
},
|
|
43
|
-
{
|
|
44
|
-
"name": "Deividas Bakanas",
|
|
45
|
-
"githubUsername": "DeividasBakanas",
|
|
46
|
-
"url": "https://github.com/DeividasBakanas"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"name": "Eugene Y. Q. Shen",
|
|
50
|
-
"githubUsername": "eyqs",
|
|
51
|
-
"url": "https://github.com/eyqs"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "Hannes Magnusson",
|
|
55
|
-
"githubUsername": "Hannes-Magnusson-CK",
|
|
56
|
-
"url": "https://github.com/Hannes-Magnusson-CK"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "Huw",
|
|
60
|
-
"githubUsername": "hoo29",
|
|
61
|
-
"url": "https://github.com/hoo29"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "Kelvin Jin",
|
|
65
|
-
"githubUsername": "kjin",
|
|
66
|
-
"url": "https://github.com/kjin"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"name": "Klaus Meinhardt",
|
|
70
|
-
"githubUsername": "ajafff",
|
|
71
|
-
"url": "https://github.com/ajafff"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "Lishude",
|
|
75
|
-
"githubUsername": "islishude",
|
|
76
|
-
"url": "https://github.com/islishude"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"name": "Mariusz Wiktorczyk",
|
|
80
|
-
"githubUsername": "mwiktorczyk",
|
|
81
|
-
"url": "https://github.com/mwiktorczyk"
|
|
82
|
-
},
|
|
83
33
|
{
|
|
84
34
|
"name": "Mohsen Azimi",
|
|
85
35
|
"githubUsername": "mohsen1",
|
|
@@ -90,46 +40,16 @@
|
|
|
90
40
|
"githubUsername": "galkin",
|
|
91
41
|
"url": "https://github.com/galkin"
|
|
92
42
|
},
|
|
93
|
-
{
|
|
94
|
-
"name": "Parambir Singh",
|
|
95
|
-
"githubUsername": "parambirs",
|
|
96
|
-
"url": "https://github.com/parambirs"
|
|
97
|
-
},
|
|
98
43
|
{
|
|
99
44
|
"name": "Sebastian Silbermann",
|
|
100
45
|
"githubUsername": "eps1lon",
|
|
101
46
|
"url": "https://github.com/eps1lon"
|
|
102
47
|
},
|
|
103
|
-
{
|
|
104
|
-
"name": "Thomas den Hollander",
|
|
105
|
-
"githubUsername": "ThomasdenH",
|
|
106
|
-
"url": "https://github.com/ThomasdenH"
|
|
107
|
-
},
|
|
108
48
|
{
|
|
109
49
|
"name": "Wilco Bakker",
|
|
110
50
|
"githubUsername": "WilcoBakker",
|
|
111
51
|
"url": "https://github.com/WilcoBakker"
|
|
112
52
|
},
|
|
113
|
-
{
|
|
114
|
-
"name": "wwwy3y3",
|
|
115
|
-
"githubUsername": "wwwy3y3",
|
|
116
|
-
"url": "https://github.com/wwwy3y3"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"name": "Samuel Ainsworth",
|
|
120
|
-
"githubUsername": "samuela",
|
|
121
|
-
"url": "https://github.com/samuela"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"name": "Kyle Uehlein",
|
|
125
|
-
"githubUsername": "kuehlein",
|
|
126
|
-
"url": "https://github.com/kuehlein"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"name": "Thanik Bhongbhibhat",
|
|
130
|
-
"githubUsername": "bhongy",
|
|
131
|
-
"url": "https://github.com/bhongy"
|
|
132
|
-
},
|
|
133
53
|
{
|
|
134
54
|
"name": "Marcin Kopacz",
|
|
135
55
|
"githubUsername": "chyzwar",
|
|
@@ -199,6 +119,11 @@
|
|
|
199
119
|
"name": "René",
|
|
200
120
|
"githubUsername": "Renegade334",
|
|
201
121
|
"url": "https://github.com/Renegade334"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "Yagiz Nizipli",
|
|
125
|
+
"githubUsername": "anonrig",
|
|
126
|
+
"url": "https://github.com/anonrig"
|
|
202
127
|
}
|
|
203
128
|
],
|
|
204
129
|
"main": "",
|
|
@@ -208,6 +133,11 @@
|
|
|
208
133
|
"*": [
|
|
209
134
|
"ts5.6/*"
|
|
210
135
|
]
|
|
136
|
+
},
|
|
137
|
+
"<=5.7": {
|
|
138
|
+
"*": [
|
|
139
|
+
"ts5.7/*"
|
|
140
|
+
]
|
|
211
141
|
}
|
|
212
142
|
},
|
|
213
143
|
"repository": {
|
|
@@ -217,9 +147,9 @@
|
|
|
217
147
|
},
|
|
218
148
|
"scripts": {},
|
|
219
149
|
"dependencies": {
|
|
220
|
-
"undici-types": "~
|
|
150
|
+
"undici-types": "~7.16.0"
|
|
221
151
|
},
|
|
222
152
|
"peerDependencies": {},
|
|
223
|
-
"typesPublisherContentHash": "
|
|
224
|
-
"typeScriptVersion": "5.
|
|
153
|
+
"typesPublisherContentHash": "c1d0bd77a7979f7f1dab093518030acae3864ba1c2342b773d235a8a921ac6e0",
|
|
154
|
+
"typeScriptVersion": "5.2"
|
|
225
155
|
}
|