@types/node 20.12.13 → 20.12.14
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 +1 -1
- node/assert.d.ts +1 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +1 -1
- node/child_process.d.ts +29 -31
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +1 -2
- node/dgram.d.ts +1 -1
- node/diagnostics_channel.d.ts +1 -10
- node/dns/promises.d.ts +6 -7
- node/dns.d.ts +12 -23
- node/domain.d.ts +1 -1
- node/events.d.ts +2 -22
- node/fs.d.ts +2 -3
- node/http.d.ts +43 -62
- node/http2.d.ts +1 -1
- node/https.d.ts +1 -1
- node/inspector.d.ts +1 -1
- node/net.d.ts +4 -7
- node/os.d.ts +1 -1
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +45 -305
- node/process.d.ts +4 -11
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream.d.ts +15 -15
- node/string_decoder.d.ts +1 -1
- node/test.d.ts +51 -291
- node/timers.d.ts +1 -1
- node/tls.d.ts +1 -1
- node/trace_events.d.ts +1 -1
- node/tty.d.ts +1 -1
- node/url.d.ts +3 -11
- node/util.d.ts +4 -20
- node/v8.d.ts +1 -45
- node/vm.d.ts +6 -9
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
node/util.d.ts
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* ```js
|
7
7
|
* const util = require('node:util');
|
8
8
|
* ```
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/util.js)
|
10
10
|
*/
|
11
11
|
declare module "util" {
|
12
12
|
import * as types from "node:util/types";
|
@@ -1256,32 +1256,16 @@ declare module "util" {
|
|
1256
1256
|
*
|
1257
1257
|
* ```js
|
1258
1258
|
* console.log(
|
1259
|
-
* util.styleText(
|
1260
|
-
* );
|
1261
|
-
* ```
|
1262
|
-
*
|
1263
|
-
* When passing an array of formats, the order of the format applied is left to right so the following style
|
1264
|
-
* might overwrite the previous one.
|
1265
|
-
*
|
1266
|
-
* ```js
|
1267
|
-
* console.log(
|
1268
|
-
* util.styleText(['red', 'green'], 'text'), // green
|
1259
|
+
* util.styleText('underline', util.styleText('italic', 'My italic underlined message')),
|
1269
1260
|
* );
|
1270
1261
|
* ```
|
1271
1262
|
*
|
1272
1263
|
* The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v20.x/api/util.html#modifiers).
|
1273
|
-
* @param format A text format
|
1264
|
+
* @param format A text format defined in `util.inspect.colors`.
|
1274
1265
|
* @param text The text to to be formatted.
|
1275
1266
|
* @since v20.12.0
|
1276
1267
|
*/
|
1277
|
-
export function styleText(
|
1278
|
-
format:
|
1279
|
-
| ForegroundColors
|
1280
|
-
| BackgroundColors
|
1281
|
-
| Modifiers
|
1282
|
-
| Array<ForegroundColors | BackgroundColors | Modifiers>,
|
1283
|
-
text: string,
|
1284
|
-
): string;
|
1268
|
+
export function styleText(format: ForegroundColors | BackgroundColors | Modifiers, text: string): string;
|
1285
1269
|
/**
|
1286
1270
|
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
|
1287
1271
|
*
|
node/v8.d.ts
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
* ```js
|
5
5
|
* const v8 = require('node:v8');
|
6
6
|
* ```
|
7
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
7
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/v8.js)
|
8
8
|
*/
|
9
9
|
declare module "v8" {
|
10
10
|
import { Readable } from "node:stream";
|
@@ -183,50 +183,6 @@ declare module "v8" {
|
|
183
183
|
* @since v1.0.0
|
184
184
|
*/
|
185
185
|
function setFlagsFromString(flags: string): void;
|
186
|
-
/**
|
187
|
-
* This is similar to the [`queryObjects()` console API](https://developer.chrome.com/docs/devtools/console/utilities#queryObjects-function)
|
188
|
-
* provided by the Chromium DevTools console. It can be used to search for objects that have the matching constructor on its prototype chain
|
189
|
-
* in the heap after a full garbage collection, which can be useful for memory leak regression tests. To avoid surprising results, users should
|
190
|
-
* avoid using this API on constructors whose implementation they don't control, or on constructors that can be invoked by other parties in the
|
191
|
-
* application.
|
192
|
-
*
|
193
|
-
* To avoid accidental leaks, this API does not return raw references to the objects found. By default, it returns the count of the objects
|
194
|
-
* found. If `options.format` is `'summary'`, it returns an array containing brief string representations for each object. The visibility provided
|
195
|
-
* in this API is similar to what the heap snapshot provides, while users can save the cost of serialization and parsing and directly filter the
|
196
|
-
* target objects during the search.
|
197
|
-
*
|
198
|
-
* Only objects created in the current execution context are included in the results.
|
199
|
-
*
|
200
|
-
* ```js
|
201
|
-
* import { queryObjects } from 'node:v8';
|
202
|
-
* class A { foo = 'bar'; }
|
203
|
-
* console.log(queryObjects(A)); // 0
|
204
|
-
* const a = new A();
|
205
|
-
* console.log(queryObjects(A)); // 1
|
206
|
-
* // [ "A { foo: 'bar' }" ]
|
207
|
-
* console.log(queryObjects(A, { format: 'summary' }));
|
208
|
-
*
|
209
|
-
* class B extends A { bar = 'qux'; }
|
210
|
-
* const b = new B();
|
211
|
-
* console.log(queryObjects(B)); // 1
|
212
|
-
* // [ "B { foo: 'bar', bar: 'qux' }" ]
|
213
|
-
* console.log(queryObjects(B, { format: 'summary' }));
|
214
|
-
*
|
215
|
-
* // Note that, when there are child classes inheriting from a constructor,
|
216
|
-
* // the constructor also shows up in the prototype chain of the child
|
217
|
-
* // classes's prototoype, so the child classes's prototoype would also be
|
218
|
-
* // included in the result.
|
219
|
-
* console.log(queryObjects(A)); // 3
|
220
|
-
* // [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ]
|
221
|
-
* console.log(queryObjects(A, { format: 'summary' }));
|
222
|
-
* ```
|
223
|
-
* @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap.
|
224
|
-
* @since v20.13.0
|
225
|
-
* @experimental
|
226
|
-
*/
|
227
|
-
function queryObjects(ctor: Function): number | string[];
|
228
|
-
function queryObjects(ctor: Function, options: { format: "count" }): number;
|
229
|
-
function queryObjects(ctor: Function, options: { format: "summary" }): string[];
|
230
186
|
/**
|
231
187
|
* Generates a snapshot of the current V8 heap and returns a Readable
|
232
188
|
* Stream that may be used to read the JSON serialized representation.
|
node/vm.d.ts
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
*
|
35
35
|
* console.log(x); // 1; y is not defined.
|
36
36
|
* ```
|
37
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
37
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/vm.js)
|
38
38
|
*/
|
39
39
|
declare module "vm" {
|
40
40
|
import { ImportAttributes } from "node:module";
|
@@ -347,14 +347,11 @@ declare module "vm" {
|
|
347
347
|
sourceMapURL?: string | undefined;
|
348
348
|
}
|
349
349
|
/**
|
350
|
-
* If given a `contextObject`, the `vm.createContext()` method will
|
351
|
-
*
|
352
|
-
*
|
353
|
-
* [
|
354
|
-
*
|
355
|
-
* existing properties but also having the built-in objects and functions any
|
356
|
-
* standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
|
357
|
-
* variables will remain unchanged.
|
350
|
+
* If given a `contextObject`, the `vm.createContext()` method will `prepare
|
351
|
+
* that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts,
|
352
|
+
* the `contextObject` will be the global object, retaining all of its existing
|
353
|
+
* properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables
|
354
|
+
* will remain unchanged.
|
358
355
|
*
|
359
356
|
* ```js
|
360
357
|
* const vm = require('node:vm');
|
node/wasi.d.ts
CHANGED
@@ -67,7 +67,7 @@
|
|
67
67
|
* wat2wasm demo.wat
|
68
68
|
* ```
|
69
69
|
* @experimental
|
70
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
70
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/wasi.js)
|
71
71
|
*/
|
72
72
|
declare module "wasi" {
|
73
73
|
interface WASIOptions {
|
node/worker_threads.d.ts
CHANGED
@@ -49,7 +49,7 @@
|
|
49
49
|
*
|
50
50
|
* Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
|
51
51
|
* specifically `argv` and `execArgv` options.
|
52
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
52
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/worker_threads.js)
|
53
53
|
*/
|
54
54
|
declare module "worker_threads" {
|
55
55
|
import { Blob } from "node:buffer";
|
node/zlib.d.ts
CHANGED
@@ -89,7 +89,7 @@
|
|
89
89
|
* });
|
90
90
|
* ```
|
91
91
|
* @since v0.5.8
|
92
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
92
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/zlib.js)
|
93
93
|
*/
|
94
94
|
declare module "zlib" {
|
95
95
|
import * as stream from "node:stream";
|