@types/node 25.3.4 → 25.4.0
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 +2 -2
- node/child_process.d.ts +5 -0
- node/events.d.ts +6 -13
- node/http.d.ts +22 -1
- node/inspector.generated.d.ts +428 -415
- node/module.d.ts +0 -62
- node/net.d.ts +4 -4
- node/package.json +2 -2
- node/process.d.ts +18 -0
- node/readline.d.ts +1 -0
- node/sqlite.d.ts +103 -16
- node/stream.d.ts +15 -5
- node/test.d.ts +42 -19
- node/tls.d.ts +6 -2
- node/url.d.ts +22 -0
- node/util.d.ts +27 -2
- node/v8.d.ts +0 -1
- node/worker_threads.d.ts +2 -2
node/util.d.ts
CHANGED
|
@@ -308,6 +308,9 @@ declare module "node:util" {
|
|
|
308
308
|
* Returns an array of call site objects containing the stack of
|
|
309
309
|
* the caller function.
|
|
310
310
|
*
|
|
311
|
+
* Unlike accessing an `error.stack`, the result returned from this API is not
|
|
312
|
+
* interfered with `Error.prepareStackTrace`.
|
|
313
|
+
*
|
|
311
314
|
* ```js
|
|
312
315
|
* import { getCallSites } from 'node:util';
|
|
313
316
|
*
|
|
@@ -320,7 +323,7 @@ declare module "node:util" {
|
|
|
320
323
|
* console.log(`Function Name: ${callSite.functionName}`);
|
|
321
324
|
* console.log(`Script Name: ${callSite.scriptName}`);
|
|
322
325
|
* console.log(`Line Number: ${callSite.lineNumber}`);
|
|
323
|
-
* console.log(`Column Number: ${callSite.
|
|
326
|
+
* console.log(`Column Number: ${callSite.columnNumber}`);
|
|
324
327
|
* });
|
|
325
328
|
* // CallSite 1:
|
|
326
329
|
* // Function Name: exampleFunction
|
|
@@ -750,6 +753,28 @@ declare module "node:util" {
|
|
|
750
753
|
* @legacy Use ES2015 class syntax and `extends` keyword instead.
|
|
751
754
|
*/
|
|
752
755
|
export function inherits(constructor: unknown, superConstructor: unknown): void;
|
|
756
|
+
/**
|
|
757
|
+
* The `util.convertProcessSignalToExitCode()` method converts a signal name to its
|
|
758
|
+
* corresponding POSIX exit code. Following the POSIX standard, the exit code
|
|
759
|
+
* for a process terminated by a signal is calculated as `128 + signal number`.
|
|
760
|
+
*
|
|
761
|
+
* If `signal` is not a valid signal name, then an error will be thrown. See
|
|
762
|
+
* [`signal(7)`](https://man7.org/linux/man-pages/man7/signal.7.html) for a list of valid signals.
|
|
763
|
+
*
|
|
764
|
+
* ```js
|
|
765
|
+
* import { convertProcessSignalToExitCode } from 'node:util';
|
|
766
|
+
*
|
|
767
|
+
* console.log(convertProcessSignalToExitCode('SIGTERM')); // 143 (128 + 15)
|
|
768
|
+
* console.log(convertProcessSignalToExitCode('SIGKILL')); // 137 (128 + 9)
|
|
769
|
+
* ```
|
|
770
|
+
*
|
|
771
|
+
* This is particularly useful when working with processes to determine
|
|
772
|
+
* the exit code based on the signal that terminated the process.
|
|
773
|
+
* @since v25.4.0
|
|
774
|
+
* @param signal A signal name (e.g. `'SIGTERM'`)
|
|
775
|
+
* @returns The exit code corresponding to `signal`
|
|
776
|
+
*/
|
|
777
|
+
export function convertProcessSignalToExitCode(signal: NodeJS.Signals): number;
|
|
753
778
|
export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
|
|
754
779
|
export interface DebugLogger extends DebugLoggerFunction {
|
|
755
780
|
/**
|
|
@@ -804,7 +829,7 @@ declare module "node:util" {
|
|
|
804
829
|
*
|
|
805
830
|
* ```js
|
|
806
831
|
* import { debuglog } from 'node:util';
|
|
807
|
-
* const log = debuglog('foo');
|
|
832
|
+
* const log = debuglog('foo-bar');
|
|
808
833
|
*
|
|
809
834
|
* log('hi there, it\'s foo-bar [%d]', 2333);
|
|
810
835
|
* ```
|
node/v8.d.ts
CHANGED
|
@@ -308,7 +308,6 @@ declare module "node:v8" {
|
|
|
308
308
|
* ```
|
|
309
309
|
* @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap.
|
|
310
310
|
* @since v20.13.0
|
|
311
|
-
* @experimental
|
|
312
311
|
*/
|
|
313
312
|
function queryObjects(ctor: Function): number | string[];
|
|
314
313
|
function queryObjects(ctor: Function, options: { format: "count" }): number;
|
node/worker_threads.d.ts
CHANGED
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
* workerData: script,
|
|
34
34
|
* });
|
|
35
35
|
* worker.on('message', resolve);
|
|
36
|
-
* worker.
|
|
37
|
-
* worker.
|
|
36
|
+
* worker.once('error', reject);
|
|
37
|
+
* worker.once('exit', (code) => {
|
|
38
38
|
* if (code !== 0)
|
|
39
39
|
* reject(new Error(`Worker stopped with exit code ${code}`));
|
|
40
40
|
* });
|