From 569bc1702e4fab2630fcc46245c104e4a00f3f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Sun, 1 Feb 2026 15:04:37 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74412=20node:=20v2?= =?UTF-8?q?5.2=20by=20@Renegade334?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/node/child_process.d.ts | 12 +- types/node/crypto.d.ts | 8 +- types/node/http.d.ts | 35 +++- types/node/https.d.ts | 6 + types/node/net.d.ts | 2 +- types/node/node-tests-dom.ts | 1 - types/node/node-tests-non-dom.ts | 1 - types/node/node-tests-webworker.ts | 1 - types/node/node-tests/perf_hooks-dom.ts | 2 - types/node/node-tests/perf_hooks-non-dom.ts | 1 - types/node/node-tests/perf_hooks.ts | 21 ++ types/node/node-tests/util.ts | 21 +- types/node/package.json | 2 +- types/node/perf_hooks.d.ts | 200 +++++++++++--------- types/node/process.d.ts | 2 +- types/node/sqlite.d.ts | 2 + types/node/util.d.ts | 11 +- types/node/v8.d.ts | 4 + 18 files changed, 205 insertions(+), 127 deletions(-) delete mode 100644 types/node/node-tests/perf_hooks-dom.ts delete mode 100644 types/node/node-tests/perf_hooks-non-dom.ts diff --git a/types/node/child_process.d.ts b/types/node/child_process.d.ts index e546fe6e8041a9..f0818091a3069f 100644 --- a/types/node/child_process.d.ts +++ b/types/node/child_process.d.ts @@ -5,6 +5,7 @@ * * ```js * import { spawn } from 'node:child_process'; + * import { once } from 'node:events'; * const ls = spawn('ls', ['-lh', '/usr']); * * ls.stdout.on('data', (data) => { @@ -15,9 +16,8 @@ * console.error(`stderr: ${data}`); * }); * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); + * const [code] = await once(ls, 'close'); + * console.log(`child process exited with code ${code}`); * ``` * * By default, pipes for `stdin`, `stdout`, and `stderr` are established between @@ -671,6 +671,7 @@ declare module "node:child_process" { * * ```js * import { spawn } from 'node:child_process'; + * import { once } from 'node:events'; * const ls = spawn('ls', ['-lh', '/usr']); * * ls.stdout.on('data', (data) => { @@ -681,9 +682,8 @@ declare module "node:child_process" { * console.error(`stderr: ${data}`); * }); * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); + * const [code] = await once(ls, 'close'); + * console.log(`child process exited with code ${code}`); * ``` * * Example: A very elaborate way to run `ps ax | grep ssh` diff --git a/types/node/crypto.d.ts b/types/node/crypto.d.ts index 0ae42e4542f026..15b46ce0dc87b8 100644 --- a/types/node/crypto.d.ts +++ b/types/node/crypto.d.ts @@ -2582,8 +2582,8 @@ declare module "node:crypto" { interface X25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} interface X448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {} /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, DH, and ML-DSA are currently supported. + * Generates a new asymmetric key pair of the given `type`. See the + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). * * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function * behaves as if `keyObject.export()` had been called on its result. Otherwise, @@ -2672,8 +2672,8 @@ declare module "node:crypto" { options?: T, ): KeyPairExportResult; /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * Generates a new asymmetric key pair of the given `type`. See the + * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types). * * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function * behaves as if `keyObject.export()` had been called on its result. Otherwise, diff --git a/types/node/http.d.ts b/types/node/http.d.ts index 6e07c257b77911..1fc8b36f71094a 100644 --- a/types/node/http.d.ts +++ b/types/node/http.d.ts @@ -1046,6 +1046,7 @@ declare module "node:http" { * * ```js * import http from 'node:http'; + * const agent = new http.Agent({ keepAlive: true }); * * // Server has a 5 seconds keep-alive timeout by default * http @@ -1679,20 +1680,34 @@ declare module "node:http" { /** * Produces a socket/stream to be used for HTTP requests. * - * By default, this function is the same as `net.createConnection()`. However, - * custom agents may override this method in case greater flexibility is desired. + * By default, this function behaves identically to `net.createConnection()`, + * synchronously returning the created socket. The optional `callback` parameter in the + * signature is **not** used by this default implementation. * - * A socket/stream can be supplied in one of two ways: by returning the - * socket/stream from this function, or by passing the socket/stream to `callback`. + * However, custom agents may override this method to provide greater flexibility, + * for example, to create sockets asynchronously. When overriding `createConnection`: * - * This method is guaranteed to return an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specifies a socket - * type other than `net.Socket`. + * 1. **Synchronous socket creation**: The overriding method can return the + * socket/stream directly. + * 2. **Asynchronous socket creation**: The overriding method can accept the `callback` + * and pass the created socket/stream to it (e.g., `callback(null, newSocket)`). + * If an error occurs during socket creation, it should be passed as the first + * argument to the `callback` (e.g., `callback(err)`). * - * `callback` has a signature of `(err, stream)`. + * The agent will call the provided `createConnection` function with `options` and + * this internal `callback`. The `callback` provided by the agent has a signature + * of `(err, stream)`. * @since v0.11.4 - * @param options Options containing connection details. Check `createConnection` for the format of the options - * @param callback Callback function that receives the created socket + * @param options Options containing connection details. Check + * `net.createConnection` for the format of the options. For custom agents, + * this object is passed to the custom `createConnection` function. + * @param callback (Optional, primarily for custom agents) A function to be + * called by a custom `createConnection` implementation when the socket is + * created, especially for asynchronous operations. + * @returns The created socket. This is returned by the default + * implementation or by a custom synchronous `createConnection` implementation. + * If a custom `createConnection` uses the `callback` for asynchronous + * operation, this return value might not be the primary way to obtain the socket. */ createConnection( options: ClientRequestArgs, diff --git a/types/node/https.d.ts b/types/node/https.d.ts index c4fbe8c0ab1ced..6b025690f351b0 100644 --- a/types/node/https.d.ts +++ b/types/node/https.d.ts @@ -24,6 +24,12 @@ declare module "node:https" { } /** * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. + * + * Like `http.Agent`, the `createConnection(options[, callback])` method can be overridden + * to customize how TLS connections are established. + * + * > See `agent.createConnection()` for details on overriding this method, + * > including asynchronous socket creation with a callback. * @since v0.4.5 */ class Agent extends http.Agent { diff --git a/types/node/net.d.ts b/types/node/net.d.ts index e0cf8377f1a0be..0fcd105b52586f 100644 --- a/types/node/net.d.ts +++ b/types/node/net.d.ts @@ -825,7 +825,7 @@ declare module "node:net" { function setDefaultAutoSelectFamily(value: boolean): void; /** * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`. + * The initial default value is `500` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`. * @returns The current default value of the `autoSelectFamilyAttemptTimeout` option. * @since v19.8.0, v18.8.0 */ diff --git a/types/node/node-tests-dom.ts b/types/node/node-tests-dom.ts index 11db324a6e51e8..bdb552a1ced608 100644 --- a/types/node/node-tests-dom.ts +++ b/types/node/node-tests-dom.ts @@ -1,3 +1,2 @@ import "./node-tests/events-dom"; import "./node-tests/globals-dom"; -import "./node-tests/perf_hooks-dom"; diff --git a/types/node/node-tests-non-dom.ts b/types/node/node-tests-non-dom.ts index 3e638be0dd9fcb..3de3ec557b0a85 100644 --- a/types/node/node-tests-non-dom.ts +++ b/types/node/node-tests-non-dom.ts @@ -1,3 +1,2 @@ import "./node-tests/events-non-dom"; import "./node-tests/globals-non-dom"; -import "./node-tests/perf_hooks-non-dom"; diff --git a/types/node/node-tests-webworker.ts b/types/node/node-tests-webworker.ts index 7a52b79c836aa8..6dbe43fd5463af 100644 --- a/types/node/node-tests-webworker.ts +++ b/types/node/node-tests-webworker.ts @@ -2,4 +2,3 @@ // If this changes, and it's necessary to create a WebWorker-specific test script, then the import should be updated here. import "./node-tests/events-dom"; import "./node-tests/globals-dom"; -import "./node-tests/perf_hooks-dom"; diff --git a/types/node/node-tests/perf_hooks-dom.ts b/types/node/node-tests/perf_hooks-dom.ts deleted file mode 100644 index 9db194f3d338cd..00000000000000 --- a/types/node/node-tests/perf_hooks-dom.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @ts-expect-error - Node API isn't available in DOM environment -performance.eventLoopUtilization(); diff --git a/types/node/node-tests/perf_hooks-non-dom.ts b/types/node/node-tests/perf_hooks-non-dom.ts deleted file mode 100644 index 084ff5d4717d95..00000000000000 --- a/types/node/node-tests/perf_hooks-non-dom.ts +++ /dev/null @@ -1 +0,0 @@ -performance.eventLoopUtilization(); diff --git a/types/node/node-tests/perf_hooks.ts b/types/node/node-tests/perf_hooks.ts index a581d6b2a749ca..8e43f485bb3a3d 100644 --- a/types/node/node-tests/perf_hooks.ts +++ b/types/node/node-tests/perf_hooks.ts @@ -1,6 +1,7 @@ import { createHistogram, EntryType, + eventLoopUtilization, IntervalHistogram, monitorEventLoopDelay, performance as NodePerf, @@ -9,6 +10,7 @@ import { PerformanceObserver, PerformanceObserverCallback, RecordableHistogram, + timerify, } from "node:perf_hooks"; // Test module import once, the rest use global @@ -155,3 +157,22 @@ resource; // $ExpectType PerformanceResourceTiming uvMetrics.events; // $ExpectType number uvMetrics.eventsWaiting; // $ExpectType number } + +{ + let elu = eventLoopUtilization(); + elu.active; // $ExpectType number + elu.idle; // $ExpectType number + elu.utilization; // $ExpectType number + + elu = eventLoopUtilization(elu); + elu = eventLoopUtilization(elu, elu); +} + +{ + const fn = (a: number, b: number) => a + b; + + // $ExpectType (a: number, b: number) => number + timerify(fn); + // $ExpectType (a: number, b: number) => number + timerify(fn, { histogram: createHistogram() }); +} diff --git a/types/node/node-tests/util.ts b/types/node/node-tests/util.ts index d18b88e205b649..9b92e24531fe1f 100644 --- a/types/node/node-tests/util.ts +++ b/types/node/node-tests/util.ts @@ -217,14 +217,19 @@ const cbOptionalError: () => Promise = util.promisify((cb: (err?: Err cb(); }); assert(typeof util.promisify.custom === "symbol"); -// util.deprecate -const foo = () => {}; -// $ExpectType () => void -util.deprecate(foo, "foo() is deprecated, use bar() instead"); -// $ExpectType (fn: T, msg: string, code?: string | undefined) => T -util.deprecate(util.deprecate, "deprecate() is deprecated, use bar() instead"); -// $ExpectType (fn: T, msg: string, code?: string | undefined) => T -util.deprecate(util.deprecate, "deprecate() is deprecated, use bar() instead", "DEP0001"); + +{ + const foo = () => {}; + + // $ExpectType () => void + util.deprecate(foo, "foo() is deprecated, use bar() instead"); + // $ExpectType () => void + util.deprecate(foo, "foo() is deprecated, use bar() instead", "DEP0001"); + // $ExpectType () => void + util.deprecate(foo, "foo() is deprecated, use bar() instead", "DEP0001", { modifyPrototype: false }); + // $ExpectType (fn: T, msg: string, code?: string | undefined, options?: DeprecateOptions | undefined) => T + util.deprecate(util.deprecate, "pass-through return type"); +} // util.isDeepStrictEqual util.isDeepStrictEqual({ foo: "bar" }, { foo: "bar" }); // $ExpectType boolean diff --git a/types/node/package.json b/types/node/package.json index 7d6b9944c3a308..b921742e8c61fe 100644 --- a/types/node/package.json +++ b/types/node/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/node", - "version": "25.1.9999", + "version": "25.2.9999", "nonNpm": "conflict", "nonNpmDescription": "Node.js", "projects": [ diff --git a/types/node/perf_hooks.d.ts b/types/node/perf_hooks.d.ts index 699f3bf507f044..4dd063284a53b7 100644 --- a/types/node/perf_hooks.d.ts +++ b/types/node/perf_hooks.d.ts @@ -43,11 +43,6 @@ declare module "node:perf_hooks" { | "net" // Node.js only | "node" // Node.js only | "resource"; // available on the Web - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } interface ConnectionTimingInfo { domainLookupStartTime: number; domainLookupEndTime: number; @@ -88,6 +83,9 @@ declare module "node:perf_hooks" { entryTypes?: EntryType[]; type?: EntryType; } + // TODO: remove in next major + /** @deprecated Use `TimerifyOptions` instead. */ + interface PerformanceTimerifyOptions extends TimerifyOptions {} interface PerformanceEventMap { "resourcetimingbufferfull": Event; } @@ -137,50 +135,9 @@ declare module "node:perf_hooks" { options?: EventListenerOptions | boolean, ): void; /** - * The `eventLoopUtilization()` method returns an object that contains the - * cumulative duration of time the event loop has been both idle and active as a - * high resolution milliseconds timer. The `utilization` value is the calculated - * Event Loop Utilization (ELU). - * - * If bootstrapping has not yet finished on the main thread the properties have - * the value of `0`. The ELU is immediately available on [Worker threads](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#worker-threads) since - * bootstrap happens within the event loop. - * - * Both `utilization1` and `utilization2` are optional parameters. - * - * If `utilization1` is passed, then the delta between the current call's `active` - * and `idle` times, as well as the corresponding `utilization` value are - * calculated and returned (similar to `process.hrtime()`). - * - * If `utilization1` and `utilization2` are both passed, then the delta is - * calculated between the two arguments. This is a convenience option because, - * unlike `process.hrtime()`, calculating the ELU is more complex than a - * single subtraction. - * - * ELU is similar to CPU utilization, except that it only measures event loop - * statistics and not CPU usage. It represents the percentage of time the event - * loop has spent outside the event loop's event provider (e.g. `epoll_wait`). - * No other CPU idle time is taken into consideration. The following is an example - * of how a mostly idle process will have a high ELU. + * This is an alias of `perf_hooks.eventLoopUtilization()`. * - * ```js - * import { eventLoopUtilization } from 'node:perf_hooks'; - * import { spawnSync } from 'node:child_process'; - * - * setImmediate(() => { - * const elu = eventLoopUtilization(); - * spawnSync('sleep', ['5']); - * console.log(eventLoopUtilization(elu).utilization); - * }); - * ``` - * - * Although the CPU is mostly idle while running this script, the value of - * `utilization` is `1`. This is because the call to - * `child_process.spawnSync()` blocks the event loop from proceeding. - * - * Passing in a user-defined object instead of the result of a previous call to - * `eventLoopUtilization()` will lead to undefined behavior. The return values - * are not guaranteed to reflect any correct state of the event loop. + * _This property is an extension by Node.js. It is not available in Web browsers._ * @since v14.10.0, v12.19.0 * @param utilization1 The result of a previous call to * `eventLoopUtilization()`. @@ -192,40 +149,12 @@ declare module "node:perf_hooks" { utilization2?: EventLoopUtilization, ): EventLoopUtilization; /** - * _This property is an extension by Node.js. It is not available in Web browsers._ + * This is an alias of `perf_hooks.timerify()`. * - * Wraps a function within a new function that measures the running time of the - * wrapped function. A `PerformanceObserver` must be subscribed to the `'function'` - * event type in order for the timing details to be accessed. - * - * ```js - * import { performance, PerformanceObserver } from 'node:perf_hooks'; - * - * function someFunction() { - * console.log('hello world'); - * } - * - * const wrapped = performance.timerify(someFunction); - * - * const obs = new PerformanceObserver((list) => { - * console.log(list.getEntries()[0].duration); - * - * performance.clearMarks(); - * performance.clearMeasures(); - * obs.disconnect(); - * }); - * obs.observe({ entryTypes: ['function'] }); - * - * // A performance timeline entry will be created - * wrapped(); - * ``` - * - * If the wrapped function returns a promise, a finally handler will be attached - * to the promise and the duration will be reported once the finally handler is - * invoked. + * _This property is an extension by Node.js. It is not available in Web browsers._ * @since v8.5.0 */ - timerify any>(fn: T, options?: PerformanceTimerifyOptions): T; + timerify any>(fn: T, options?: TimerifyOptions): T; } var Performance: { prototype: Performance; @@ -305,14 +234,6 @@ declare module "node:perf_hooks" { }; var performance: Performance; // #endregion - interface PerformanceTimerifyOptions { - /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } /** * _This class is an extension by Node.js. It is not available in Web browsers._ * @@ -557,6 +478,66 @@ declare module "node:perf_hooks" { */ add(other: RecordableHistogram): void; } + interface EventLoopUtilization { + idle: number; + active: number; + utilization: number; + } + /** + * The `eventLoopUtilization()` function returns an object that contains the + * cumulative duration of time the event loop has been both idle and active as a + * high resolution milliseconds timer. The `utilization` value is the calculated + * Event Loop Utilization (ELU). + * + * If bootstrapping has not yet finished on the main thread the properties have + * the value of `0`. The ELU is immediately available on [Worker threads](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#worker-threads) since + * bootstrap happens within the event loop. + * + * Both `utilization1` and `utilization2` are optional parameters. + * + * If `utilization1` is passed, then the delta between the current call's `active` + * and `idle` times, as well as the corresponding `utilization` value are + * calculated and returned (similar to `process.hrtime()`). + * + * If `utilization1` and `utilization2` are both passed, then the delta is + * calculated between the two arguments. This is a convenience option because, + * unlike `process.hrtime()`, calculating the ELU is more complex than a + * single subtraction. + * + * ELU is similar to CPU utilization, except that it only measures event loop + * statistics and not CPU usage. It represents the percentage of time the event + * loop has spent outside the event loop's event provider (e.g. `epoll_wait`). + * No other CPU idle time is taken into consideration. The following is an example + * of how a mostly idle process will have a high ELU. + * + * ```js + * import { eventLoopUtilization } from 'node:perf_hooks'; + * import { spawnSync } from 'node:child_process'; + * + * setImmediate(() => { + * const elu = eventLoopUtilization(); + * spawnSync('sleep', ['5']); + * console.log(eventLoopUtilization(elu).utilization); + * }); + * ``` + * + * Although the CPU is mostly idle while running this script, the value of + * `utilization` is `1`. This is because the call to + * `child_process.spawnSync()` blocks the event loop from proceeding. + * + * Passing in a user-defined object instead of the result of a previous call to + * `eventLoopUtilization()` will lead to undefined behavior. The return values + * are not guaranteed to reflect any correct state of the event loop. + * @since v25.2.0 + * @param utilization1 The result of a previous call to + * `eventLoopUtilization()`. + * @param utilization2 The result of a previous call to + * `eventLoopUtilization()` prior to `utilization1`. + */ + function eventLoopUtilization( + utilization1?: EventLoopUtilization, + utilization2?: EventLoopUtilization, + ): EventLoopUtilization; /** * _This property is an extension by Node.js. It is not available in Web browsers._ * @@ -586,6 +567,49 @@ declare module "node:perf_hooks" { * @since v11.10.0 */ function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; + interface TimerifyOptions { + /** + * A histogram object created using + * `perf_hooks.createHistogram()` that will record runtime durations in + * nanoseconds. + */ + histogram?: RecordableHistogram | undefined; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Wraps a function within a new function that measures the running time of the + * wrapped function. A `PerformanceObserver` must be subscribed to the `'function'` + * event type in order for the timing details to be accessed. + * + * ```js + * import { timerify, performance, PerformanceObserver } from 'node:perf_hooks'; + * + * function someFunction() { + * console.log('hello world'); + * } + * + * const wrapped = timerify(someFunction); + * + * const obs = new PerformanceObserver((list) => { + * console.log(list.getEntries()[0].duration); + * + * performance.clearMarks(); + * performance.clearMeasures(); + * obs.disconnect(); + * }); + * obs.observe({ entryTypes: ['function'] }); + * + * // A performance timeline entry will be created + * wrapped(); + * ``` + * + * If the wrapped function returns a promise, a finally handler will be attached + * to the promise and the duration will be reported once the finally handler is + * invoked. + * @since v25.2.0 + */ + function timerify any>(fn: T, options?: TimerifyOptions): T; interface CreateHistogramOptions { /** * The minimum recordable value. Must be an integer value greater than 0. @@ -613,8 +637,6 @@ declare module "node:perf_hooks" { interface MarkOptions extends PerformanceMarkOptions {} /** @deprecated Use the canonical `PerformanceMeasureOptions` instead. */ interface MeasureOptions extends PerformanceMeasureOptions {} - /** @deprecated Use `PerformanceTimerifyOptions` instead. */ - interface TimerifyOptions extends PerformanceTimerifyOptions {} } declare module "perf_hooks" { export * from "node:perf_hooks"; diff --git a/types/node/process.d.ts b/types/node/process.d.ts index 914106fc05ce3b..6974c48e4b70d2 100644 --- a/types/node/process.d.ts +++ b/types/node/process.d.ts @@ -253,7 +253,7 @@ declare module "node:process" { /** * A value that is `"strip"` by default, * `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if - * Node.js is run with `--no-experimental-strip-types`. + * Node.js is run with `--no-strip-types`. * @since v22.10.0 */ readonly typescript: "strip" | "transform" | false; diff --git a/types/node/sqlite.d.ts b/types/node/sqlite.d.ts index ef364d19ba88ca..f6c34529e111b0 100644 --- a/types/node/sqlite.d.ts +++ b/types/node/sqlite.d.ts @@ -484,6 +484,8 @@ declare module "node:sqlite" { * [`sqlite3changeset_apply()`](https://www.sqlite.org/session/sqlite3changeset_apply.html). * * ```js + * import { DatabaseSync } from 'node:sqlite'; + * * const sourceDb = new DatabaseSync(':memory:'); * const targetDb = new DatabaseSync(':memory:'); * diff --git a/types/node/util.d.ts b/types/node/util.d.ts index 70fd51a0285062..4caf804beb8604 100644 --- a/types/node/util.d.ts +++ b/types/node/util.d.ts @@ -838,6 +838,15 @@ declare module "node:util" { */ export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; export { debuglog as debug }; + export interface DeprecateOptions { + /** + * When false do not change the prototype of object + * while emitting the deprecation warning. + * @since v25.2.0 + * @default true + */ + modifyPrototype?: boolean | undefined; + } /** * The `util.deprecate()` method wraps `fn` (which may be a function or class) in * such a way that it is marked as deprecated. @@ -898,7 +907,7 @@ declare module "node:util" { * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. * @return The deprecated function wrapped to emit a warning. */ - export function deprecate(fn: T, msg: string, code?: string): T; + export function deprecate(fn: T, msg: string, code?: string, options?: DeprecateOptions): T; export interface IsDeepStrictEqualOptions { /** * If `true`, prototype and constructor diff --git a/types/node/v8.d.ts b/types/node/v8.d.ts index 9216587d5bd1be..022dc01a154884 100644 --- a/types/node/v8.d.ts +++ b/types/node/v8.d.ts @@ -33,6 +33,7 @@ declare module "node:v8" { total_global_handles_size: number; used_global_handles_size: number; external_memory: number; + total_allocated_bytes: number; } interface HeapCodeStatistics { code_and_metadata_size: number; @@ -93,6 +94,9 @@ declare module "node:v8" { * `external_memory` The value of external\_memory is the memory size of array * buffers and external strings. * + * `total_allocated_bytes` The value of total allocated bytes since the Isolate + * creation + * * ```js * { * total_heap_size: 7326976,