@types/node 16.18.40 → 16.18.42
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 v16.18/README.md +1 -1
- node v16.18/module.d.ts +96 -0
- node v16.18/package.json +2 -2
- node v16.18/perf_hooks.d.ts +15 -0
- node v16.18/ts4.8/module.d.ts +96 -0
- node v16.18/ts4.8/perf_hooks.d.ts +15 -0
- node v16.18/ts4.8/util.d.ts +27 -0
- node v16.18/util.d.ts +27 -0
node v16.18/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v16.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Tue,
|
|
11
|
+
* Last updated: Tue, 22 Aug 2023 09:03:17 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
|
14
14
|
|
node v16.18/module.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare module 'module' {
|
|
5
5
|
import { URL } from 'node:url';
|
|
6
|
+
import { MessagePort } from 'node:worker_threads';
|
|
6
7
|
namespace Module {
|
|
7
8
|
/**
|
|
8
9
|
* The `module.syncBuiltinESMExports()` method updates all the live bindings for
|
|
@@ -78,6 +79,101 @@ declare module 'module' {
|
|
|
78
79
|
*/
|
|
79
80
|
findEntry(line: number, column: number): SourceMapping;
|
|
80
81
|
}
|
|
82
|
+
type ModuleFormat = 'builtin' | 'commonjs' | 'json' | 'module' | 'wasm';
|
|
83
|
+
type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
|
|
84
|
+
interface GlobalPreloadContext {
|
|
85
|
+
port: MessagePort;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Sometimes it might be necessary to run some code inside of the same global scope that the application runs in.
|
|
89
|
+
* This hook allows the return of a string that is run as a sloppy-mode script on startup.
|
|
90
|
+
*
|
|
91
|
+
* @param context Information to assist the preload code
|
|
92
|
+
* @return Code to run before application startup
|
|
93
|
+
*/
|
|
94
|
+
type GlobalPreloadHook = (context: GlobalPreloadContext) => string;
|
|
95
|
+
interface ResolveHookContext {
|
|
96
|
+
/**
|
|
97
|
+
* Export conditions of the relevant `package.json`
|
|
98
|
+
*/
|
|
99
|
+
conditions: string[];
|
|
100
|
+
/**
|
|
101
|
+
* An object whose key-value pairs represent the assertions for the module to import
|
|
102
|
+
*/
|
|
103
|
+
importAssertions: Object;
|
|
104
|
+
/**
|
|
105
|
+
* The module importing this one, or undefined if this is the Node.js entry point
|
|
106
|
+
*/
|
|
107
|
+
parentURL: string | undefined;
|
|
108
|
+
}
|
|
109
|
+
interface ResolveFnOutput {
|
|
110
|
+
/**
|
|
111
|
+
* A hint to the load hook (it might be ignored)
|
|
112
|
+
*/
|
|
113
|
+
format?: ModuleFormat | null | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* The import assertions to use when caching the module (optional; if excluded the input will be used)
|
|
116
|
+
*/
|
|
117
|
+
importAssertions?: Object | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* A signal that this hook intends to terminate the chain of `resolve` hooks.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
shortCircuit?: boolean | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* The absolute URL to which this input resolves
|
|
125
|
+
*/
|
|
126
|
+
url: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook.
|
|
130
|
+
* If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`);
|
|
131
|
+
* if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook.
|
|
132
|
+
*
|
|
133
|
+
* @param specifier The specified URL path of the module to be resolved
|
|
134
|
+
* @param context
|
|
135
|
+
* @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook
|
|
136
|
+
*/
|
|
137
|
+
type ResolveHook = (
|
|
138
|
+
specifier: string,
|
|
139
|
+
context: ResolveHookContext,
|
|
140
|
+
nextResolve: (specifier: string, context?: ResolveHookContext) => ResolveFnOutput
|
|
141
|
+
) => ResolveFnOutput | Promise<ResolveFnOutput>;
|
|
142
|
+
interface LoadHookContext {
|
|
143
|
+
/**
|
|
144
|
+
* Export conditions of the relevant `package.json`
|
|
145
|
+
*/
|
|
146
|
+
conditions: string[];
|
|
147
|
+
/**
|
|
148
|
+
* The format optionally supplied by the `resolve` hook chain
|
|
149
|
+
*/
|
|
150
|
+
format: ModuleFormat;
|
|
151
|
+
/**
|
|
152
|
+
* An object whose key-value pairs represent the assertions for the module to import
|
|
153
|
+
*/
|
|
154
|
+
importAssertions: Object;
|
|
155
|
+
}
|
|
156
|
+
interface LoadFnOutput {
|
|
157
|
+
format: ModuleFormat;
|
|
158
|
+
/**
|
|
159
|
+
* A signal that this hook intends to terminate the chain of `resolve` hooks.
|
|
160
|
+
* @default false
|
|
161
|
+
*/
|
|
162
|
+
shortCircuit?: boolean | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* The source for Node.js to evaluate
|
|
165
|
+
*/
|
|
166
|
+
source?: ModuleSource;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed.
|
|
170
|
+
* It is also in charge of validating the import assertion.
|
|
171
|
+
*
|
|
172
|
+
* @param url The URL/path of the module to be loaded
|
|
173
|
+
* @param context Metadata about the module
|
|
174
|
+
* @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook
|
|
175
|
+
*/
|
|
176
|
+
type LoadHook = (url: string, context: LoadHookContext, nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput) => LoadFnOutput | Promise<LoadFnOutput>;
|
|
81
177
|
}
|
|
82
178
|
interface Module extends NodeModule {}
|
|
83
179
|
class Module {
|
node v16.18/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.18.
|
|
3
|
+
"version": "16.18.42",
|
|
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": "
|
|
230
|
+
"typesPublisherContentHash": "bd09846ed767f8aa5b57f9d938bb7dc4bb20cc15c283f4282fe15d705d68ba59",
|
|
231
231
|
"typeScriptVersion": "4.3"
|
|
232
232
|
}
|
node v16.18/perf_hooks.d.ts
CHANGED
|
@@ -580,6 +580,21 @@ declare module 'perf_hooks' {
|
|
|
580
580
|
* @since v15.9.0
|
|
581
581
|
*/
|
|
582
582
|
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
|
583
|
+
|
|
584
|
+
import { performance as _performance } from 'perf_hooks';
|
|
585
|
+
global {
|
|
586
|
+
/**
|
|
587
|
+
* `performance` is a global reference for `require('perf_hooks').performance`
|
|
588
|
+
* https://nodejs.org/api/globals.html#performance
|
|
589
|
+
* @since v16.0.0
|
|
590
|
+
*/
|
|
591
|
+
var performance: typeof globalThis extends {
|
|
592
|
+
onmessage: any;
|
|
593
|
+
performance: infer T;
|
|
594
|
+
}
|
|
595
|
+
? T
|
|
596
|
+
: typeof _performance;
|
|
597
|
+
}
|
|
583
598
|
}
|
|
584
599
|
declare module 'node:perf_hooks' {
|
|
585
600
|
export * from 'perf_hooks';
|
node v16.18/ts4.8/module.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare module 'module' {
|
|
5
5
|
import { URL } from 'node:url';
|
|
6
|
+
import { MessagePort } from 'node:worker_threads';
|
|
6
7
|
namespace Module {
|
|
7
8
|
/**
|
|
8
9
|
* The `module.syncBuiltinESMExports()` method updates all the live bindings for
|
|
@@ -78,6 +79,101 @@ declare module 'module' {
|
|
|
78
79
|
*/
|
|
79
80
|
findEntry(line: number, column: number): SourceMapping;
|
|
80
81
|
}
|
|
82
|
+
type ModuleFormat = 'builtin' | 'commonjs' | 'json' | 'module' | 'wasm';
|
|
83
|
+
type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
|
|
84
|
+
interface GlobalPreloadContext {
|
|
85
|
+
port: MessagePort;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Sometimes it might be necessary to run some code inside of the same global scope that the application runs in.
|
|
89
|
+
* This hook allows the return of a string that is run as a sloppy-mode script on startup.
|
|
90
|
+
*
|
|
91
|
+
* @param context Information to assist the preload code
|
|
92
|
+
* @return Code to run before application startup
|
|
93
|
+
*/
|
|
94
|
+
type GlobalPreloadHook = (context: GlobalPreloadContext) => string;
|
|
95
|
+
interface ResolveHookContext {
|
|
96
|
+
/**
|
|
97
|
+
* Export conditions of the relevant `package.json`
|
|
98
|
+
*/
|
|
99
|
+
conditions: string[];
|
|
100
|
+
/**
|
|
101
|
+
* An object whose key-value pairs represent the assertions for the module to import
|
|
102
|
+
*/
|
|
103
|
+
importAssertions: Object;
|
|
104
|
+
/**
|
|
105
|
+
* The module importing this one, or undefined if this is the Node.js entry point
|
|
106
|
+
*/
|
|
107
|
+
parentURL: string | undefined;
|
|
108
|
+
}
|
|
109
|
+
interface ResolveFnOutput {
|
|
110
|
+
/**
|
|
111
|
+
* A hint to the load hook (it might be ignored)
|
|
112
|
+
*/
|
|
113
|
+
format?: ModuleFormat | null | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* The import assertions to use when caching the module (optional; if excluded the input will be used)
|
|
116
|
+
*/
|
|
117
|
+
importAssertions?: Object | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* A signal that this hook intends to terminate the chain of `resolve` hooks.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
shortCircuit?: boolean | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* The absolute URL to which this input resolves
|
|
125
|
+
*/
|
|
126
|
+
url: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook.
|
|
130
|
+
* If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`);
|
|
131
|
+
* if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook.
|
|
132
|
+
*
|
|
133
|
+
* @param specifier The specified URL path of the module to be resolved
|
|
134
|
+
* @param context
|
|
135
|
+
* @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook
|
|
136
|
+
*/
|
|
137
|
+
type ResolveHook = (
|
|
138
|
+
specifier: string,
|
|
139
|
+
context: ResolveHookContext,
|
|
140
|
+
nextResolve: (specifier: string, context?: ResolveHookContext) => ResolveFnOutput
|
|
141
|
+
) => ResolveFnOutput | Promise<ResolveFnOutput>;
|
|
142
|
+
interface LoadHookContext {
|
|
143
|
+
/**
|
|
144
|
+
* Export conditions of the relevant `package.json`
|
|
145
|
+
*/
|
|
146
|
+
conditions: string[];
|
|
147
|
+
/**
|
|
148
|
+
* The format optionally supplied by the `resolve` hook chain
|
|
149
|
+
*/
|
|
150
|
+
format: ModuleFormat;
|
|
151
|
+
/**
|
|
152
|
+
* An object whose key-value pairs represent the assertions for the module to import
|
|
153
|
+
*/
|
|
154
|
+
importAssertions: Object;
|
|
155
|
+
}
|
|
156
|
+
interface LoadFnOutput {
|
|
157
|
+
format: ModuleFormat;
|
|
158
|
+
/**
|
|
159
|
+
* A signal that this hook intends to terminate the chain of `resolve` hooks.
|
|
160
|
+
* @default false
|
|
161
|
+
*/
|
|
162
|
+
shortCircuit?: boolean | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* The source for Node.js to evaluate
|
|
165
|
+
*/
|
|
166
|
+
source?: ModuleSource;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed.
|
|
170
|
+
* It is also in charge of validating the import assertion.
|
|
171
|
+
*
|
|
172
|
+
* @param url The URL/path of the module to be loaded
|
|
173
|
+
* @param context Metadata about the module
|
|
174
|
+
* @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook
|
|
175
|
+
*/
|
|
176
|
+
type LoadHook = (url: string, context: LoadHookContext, nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput) => LoadFnOutput | Promise<LoadFnOutput>;
|
|
81
177
|
}
|
|
82
178
|
interface Module extends NodeModule {}
|
|
83
179
|
class Module {
|
|
@@ -580,6 +580,21 @@ declare module 'perf_hooks' {
|
|
|
580
580
|
* @since v15.9.0
|
|
581
581
|
*/
|
|
582
582
|
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
|
583
|
+
|
|
584
|
+
import { performance as _performance } from 'perf_hooks';
|
|
585
|
+
global {
|
|
586
|
+
/**
|
|
587
|
+
* `performance` is a global reference for `require('perf_hooks').performance`
|
|
588
|
+
* https://nodejs.org/api/globals.html#performance
|
|
589
|
+
* @since v16.0.0
|
|
590
|
+
*/
|
|
591
|
+
var performance: typeof globalThis extends {
|
|
592
|
+
onmessage: any;
|
|
593
|
+
performance: infer T;
|
|
594
|
+
}
|
|
595
|
+
? T
|
|
596
|
+
: typeof _performance;
|
|
597
|
+
}
|
|
583
598
|
}
|
|
584
599
|
declare module 'node:perf_hooks' {
|
|
585
600
|
export * from 'perf_hooks';
|
node v16.18/ts4.8/util.d.ts
CHANGED
|
@@ -1094,6 +1094,33 @@ declare module 'util' {
|
|
|
1094
1094
|
*/
|
|
1095
1095
|
encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
|
|
1096
1096
|
}
|
|
1097
|
+
|
|
1098
|
+
import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from 'util';
|
|
1099
|
+
global {
|
|
1100
|
+
/**
|
|
1101
|
+
* `TextDecoder` class is a global reference for `require('util').TextDecoder`
|
|
1102
|
+
* https://nodejs.org/api/globals.html#textdecoder
|
|
1103
|
+
* @since v11.0.0
|
|
1104
|
+
*/
|
|
1105
|
+
var TextDecoder: typeof globalThis extends {
|
|
1106
|
+
onmessage: any;
|
|
1107
|
+
TextDecoder: infer TextDecoder;
|
|
1108
|
+
}
|
|
1109
|
+
? TextDecoder
|
|
1110
|
+
: typeof _TextDecoder;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* `TextEncoder` class is a global reference for `require('util').TextEncoder`
|
|
1114
|
+
* https://nodejs.org/api/globals.html#textencoder
|
|
1115
|
+
* @since v11.0.0
|
|
1116
|
+
*/
|
|
1117
|
+
var TextEncoder: typeof globalThis extends {
|
|
1118
|
+
onmessage: any;
|
|
1119
|
+
TextEncoder: infer TextEncoder;
|
|
1120
|
+
}
|
|
1121
|
+
? TextEncoder
|
|
1122
|
+
: typeof _TextEncoder;
|
|
1123
|
+
}
|
|
1097
1124
|
}
|
|
1098
1125
|
declare module 'util/types' {
|
|
1099
1126
|
export * from 'util/types';
|
node v16.18/util.d.ts
CHANGED
|
@@ -1094,6 +1094,33 @@ declare module 'util' {
|
|
|
1094
1094
|
*/
|
|
1095
1095
|
encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
|
|
1096
1096
|
}
|
|
1097
|
+
|
|
1098
|
+
import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from 'util';
|
|
1099
|
+
global {
|
|
1100
|
+
/**
|
|
1101
|
+
* `TextDecoder` class is a global reference for `require('util').TextDecoder`
|
|
1102
|
+
* https://nodejs.org/api/globals.html#textdecoder
|
|
1103
|
+
* @since v11.0.0
|
|
1104
|
+
*/
|
|
1105
|
+
var TextDecoder: typeof globalThis extends {
|
|
1106
|
+
onmessage: any;
|
|
1107
|
+
TextDecoder: infer TextDecoder;
|
|
1108
|
+
}
|
|
1109
|
+
? TextDecoder
|
|
1110
|
+
: typeof _TextDecoder;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* `TextEncoder` class is a global reference for `require('util').TextEncoder`
|
|
1114
|
+
* https://nodejs.org/api/globals.html#textencoder
|
|
1115
|
+
* @since v11.0.0
|
|
1116
|
+
*/
|
|
1117
|
+
var TextEncoder: typeof globalThis extends {
|
|
1118
|
+
onmessage: any;
|
|
1119
|
+
TextEncoder: infer TextEncoder;
|
|
1120
|
+
}
|
|
1121
|
+
? TextEncoder
|
|
1122
|
+
: typeof _TextEncoder;
|
|
1123
|
+
}
|
|
1097
1124
|
}
|
|
1098
1125
|
declare module 'util/types' {
|
|
1099
1126
|
export * from 'util/types';
|