@types/node 24.4.0 → 24.5.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/dns.d.ts +5 -0
- node/http.d.ts +24 -0
- node/index.d.ts +1 -1
- node/inspector.d.ts +187 -4145
- node/inspector.generated.d.ts +4052 -0
- node/net.d.ts +21 -0
- node/package.json +3 -3
- node/sqlite.d.ts +7 -0
- node/tls.d.ts +32 -0
- node/ts5.6/index.d.ts +1 -1
- node/ts5.7/index.d.ts +1 -1
- node/url.d.ts +8 -5
- node/util.d.ts +6 -4
- node/web-globals/navigator.d.ts +3 -0
- node/worker_threads.d.ts +29 -0
node/net.d.ts
CHANGED
@@ -805,6 +805,27 @@ declare module "net" {
|
|
805
805
|
* @param value Any JS value
|
806
806
|
*/
|
807
807
|
static isBlockList(value: unknown): value is BlockList;
|
808
|
+
/**
|
809
|
+
* ```js
|
810
|
+
* const blockList = new net.BlockList();
|
811
|
+
* const data = [
|
812
|
+
* 'Subnet: IPv4 192.168.1.0/24',
|
813
|
+
* 'Address: IPv4 10.0.0.5',
|
814
|
+
* 'Range: IPv4 192.168.2.1-192.168.2.10',
|
815
|
+
* 'Range: IPv4 10.0.0.1-10.0.0.10',
|
816
|
+
* ];
|
817
|
+
* blockList.fromJSON(data);
|
818
|
+
* blockList.fromJSON(JSON.stringify(data));
|
819
|
+
* ```
|
820
|
+
* @since v24.5.0
|
821
|
+
* @experimental
|
822
|
+
*/
|
823
|
+
fromJSON(data: string | readonly string[]): void;
|
824
|
+
/**
|
825
|
+
* @since v24.5.0
|
826
|
+
* @experimental
|
827
|
+
*/
|
828
|
+
toJSON(): readonly string[];
|
808
829
|
}
|
809
830
|
interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
|
810
831
|
timeout?: number | undefined;
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "24.
|
3
|
+
"version": "24.5.0",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -147,9 +147,9 @@
|
|
147
147
|
},
|
148
148
|
"scripts": {},
|
149
149
|
"dependencies": {
|
150
|
-
"undici-types": "~7.
|
150
|
+
"undici-types": "~7.12.0"
|
151
151
|
},
|
152
152
|
"peerDependencies": {},
|
153
|
-
"typesPublisherContentHash": "
|
153
|
+
"typesPublisherContentHash": "9e50bdbd01c40dff0305ada6ea13f1c2663dcbfc108ae09fab45726ac985531a",
|
154
154
|
"typeScriptVersion": "5.2"
|
155
155
|
}
|
node/sqlite.d.ts
CHANGED
@@ -593,6 +593,13 @@ declare module "node:sqlite" {
|
|
593
593
|
* @param enabled Enables or disables support for unknown named parameters.
|
594
594
|
*/
|
595
595
|
setAllowUnknownNamedParameters(enabled: boolean): void;
|
596
|
+
/**
|
597
|
+
* When enabled, query results returned by the `all()`, `get()`, and `iterate()` methods will be returned as arrays instead
|
598
|
+
* of objects.
|
599
|
+
* @since v24.0.0
|
600
|
+
* @param enabled Enables or disables the return of query results as arrays.
|
601
|
+
*/
|
602
|
+
setReturnArrays(enabled: boolean): void;
|
596
603
|
/**
|
597
604
|
* When reading from the database, SQLite `INTEGER`s are mapped to JavaScript
|
598
605
|
* numbers by default. However, SQLite `INTEGER`s can store values larger than
|
node/tls.d.ts
CHANGED
@@ -1162,6 +1162,38 @@ declare module "tls" {
|
|
1162
1162
|
* @since v0.10.2
|
1163
1163
|
*/
|
1164
1164
|
function getCiphers(): string[];
|
1165
|
+
/**
|
1166
|
+
* Sets the default CA certificates used by Node.js TLS clients. If the provided
|
1167
|
+
* certificates are parsed successfully, they will become the default CA
|
1168
|
+
* certificate list returned by {@link getCACertificates} and used
|
1169
|
+
* by subsequent TLS connections that don't specify their own CA certificates.
|
1170
|
+
* The certificates will be deduplicated before being set as the default.
|
1171
|
+
*
|
1172
|
+
* This function only affects the current Node.js thread. Previous
|
1173
|
+
* sessions cached by the HTTPS agent won't be affected by this change, so
|
1174
|
+
* this method should be called before any unwanted cachable TLS connections are
|
1175
|
+
* made.
|
1176
|
+
*
|
1177
|
+
* To use system CA certificates as the default:
|
1178
|
+
*
|
1179
|
+
* ```js
|
1180
|
+
* import tls from 'node:tls';
|
1181
|
+
* tls.setDefaultCACertificates(tls.getCACertificates('system'));
|
1182
|
+
* ```
|
1183
|
+
*
|
1184
|
+
* This function completely replaces the default CA certificate list. To add additional
|
1185
|
+
* certificates to the existing defaults, get the current certificates and append to them:
|
1186
|
+
*
|
1187
|
+
* ```js
|
1188
|
+
* import tls from 'node:tls';
|
1189
|
+
* const currentCerts = tls.getCACertificates('default');
|
1190
|
+
* const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
|
1191
|
+
* tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
|
1192
|
+
* ```
|
1193
|
+
* @since v24.5.0
|
1194
|
+
* @param certs An array of CA certificates in PEM format.
|
1195
|
+
*/
|
1196
|
+
function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
|
1165
1197
|
/**
|
1166
1198
|
* The default curve name to use for ECDH key agreement in a tls server.
|
1167
1199
|
* The default value is `'auto'`. See `{@link createSecureContext()}` for further
|
node/ts5.6/index.d.ts
CHANGED
@@ -59,7 +59,6 @@
|
|
59
59
|
/// <reference path="../diagnostics_channel.d.ts" />
|
60
60
|
/// <reference path="../dns.d.ts" />
|
61
61
|
/// <reference path="../dns/promises.d.ts" />
|
62
|
-
/// <reference path="../dns/promises.d.ts" />
|
63
62
|
/// <reference path="../domain.d.ts" />
|
64
63
|
/// <reference path="../events.d.ts" />
|
65
64
|
/// <reference path="../fs.d.ts" />
|
@@ -68,6 +67,7 @@
|
|
68
67
|
/// <reference path="../http2.d.ts" />
|
69
68
|
/// <reference path="../https.d.ts" />
|
70
69
|
/// <reference path="../inspector.d.ts" />
|
70
|
+
/// <reference path="../inspector.generated.d.ts" />
|
71
71
|
/// <reference path="../module.d.ts" />
|
72
72
|
/// <reference path="../net.d.ts" />
|
73
73
|
/// <reference path="../os.d.ts" />
|
node/ts5.7/index.d.ts
CHANGED
@@ -59,7 +59,6 @@
|
|
59
59
|
/// <reference path="../diagnostics_channel.d.ts" />
|
60
60
|
/// <reference path="../dns.d.ts" />
|
61
61
|
/// <reference path="../dns/promises.d.ts" />
|
62
|
-
/// <reference path="../dns/promises.d.ts" />
|
63
62
|
/// <reference path="../domain.d.ts" />
|
64
63
|
/// <reference path="../events.d.ts" />
|
65
64
|
/// <reference path="../fs.d.ts" />
|
@@ -68,6 +67,7 @@
|
|
68
67
|
/// <reference path="../http2.d.ts" />
|
69
68
|
/// <reference path="../https.d.ts" />
|
70
69
|
/// <reference path="../inspector.d.ts" />
|
70
|
+
/// <reference path="../inspector.generated.d.ts" />
|
71
71
|
/// <reference path="../module.d.ts" />
|
72
72
|
/// <reference path="../net.d.ts" />
|
73
73
|
/// <reference path="../os.d.ts" />
|
node/url.d.ts
CHANGED
@@ -455,12 +455,15 @@ declare module "url" {
|
|
455
455
|
*/
|
456
456
|
static canParse(input: string, base?: string): boolean;
|
457
457
|
/**
|
458
|
-
* Parses a string as a URL. If `base` is provided, it will be used as the base
|
459
|
-
*
|
460
|
-
*
|
461
|
-
* `converted to a string` first.
|
462
|
-
* @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
|
458
|
+
* Parses a string as a URL. If `base` is provided, it will be used as the base
|
459
|
+
* URL for the purpose of resolving non-absolute `input` URLs. Returns `null`
|
460
|
+
* if the parameters can't be resolved to a valid URL.
|
463
461
|
* @since v22.1.0
|
462
|
+
* @param input The absolute or relative input URL to parse. If `input`
|
463
|
+
* is relative, then `base` is required. If `input` is absolute, the `base`
|
464
|
+
* is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
|
465
|
+
* @param base The base URL to resolve against if the `input` is not
|
466
|
+
* absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
|
464
467
|
*/
|
465
468
|
static parse(input: string, base?: string): URL | null;
|
466
469
|
constructor(input: string | { toString: () => string }, base?: string | URL);
|
node/util.d.ts
CHANGED
@@ -1420,10 +1420,12 @@ declare module "util" {
|
|
1420
1420
|
*/
|
1421
1421
|
short?: string | undefined;
|
1422
1422
|
/**
|
1423
|
-
* The
|
1424
|
-
*
|
1425
|
-
*
|
1426
|
-
*
|
1423
|
+
* The value to assign to
|
1424
|
+
* the option if it does not appear in the arguments to be parsed. The value
|
1425
|
+
* must match the type specified by the `type` property. If `multiple` is
|
1426
|
+
* `true`, it must be an array. No default value is applied when the option
|
1427
|
+
* does appear in the arguments to be parsed, even if the provided value
|
1428
|
+
* is falsy.
|
1427
1429
|
* @since v18.11.0
|
1428
1430
|
*/
|
1429
1431
|
default?: string | boolean | string[] | boolean[] | undefined;
|
node/web-globals/navigator.d.ts
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
export {};
|
2
2
|
|
3
|
+
import { LockManager } from "worker_threads";
|
4
|
+
|
3
5
|
// lib.webworker has `WorkerNavigator` rather than `Navigator`, so conditionals use `onabort` instead of `onmessage`
|
4
6
|
type _Navigator = typeof globalThis extends { onabort: any } ? {} : Navigator;
|
5
7
|
interface Navigator {
|
6
8
|
readonly hardwareConcurrency: number;
|
7
9
|
readonly language: string;
|
8
10
|
readonly languages: readonly string[];
|
11
|
+
readonly locks: LockManager;
|
9
12
|
readonly platform: string;
|
10
13
|
readonly userAgent: string;
|
11
14
|
}
|
node/worker_threads.d.ts
CHANGED
@@ -598,6 +598,35 @@ declare module "worker_threads" {
|
|
598
598
|
*/
|
599
599
|
postMessage(message: unknown): void;
|
600
600
|
}
|
601
|
+
interface Lock {
|
602
|
+
readonly mode: LockMode;
|
603
|
+
readonly name: string;
|
604
|
+
}
|
605
|
+
interface LockGrantedCallback<T> {
|
606
|
+
(lock: Lock | null): T;
|
607
|
+
}
|
608
|
+
interface LockInfo {
|
609
|
+
clientId: string;
|
610
|
+
mode: LockMode;
|
611
|
+
name: string;
|
612
|
+
}
|
613
|
+
interface LockManager {
|
614
|
+
query(): Promise<LockManagerSnapshot>;
|
615
|
+
request<T>(name: string, callback: LockGrantedCallback<T>): Promise<Awaited<T>>;
|
616
|
+
request<T>(name: string, options: LockOptions, callback: LockGrantedCallback<T>): Promise<Awaited<T>>;
|
617
|
+
}
|
618
|
+
interface LockManagerSnapshot {
|
619
|
+
held: LockInfo[];
|
620
|
+
pending: LockInfo[];
|
621
|
+
}
|
622
|
+
type LockMode = "exclusive" | "shared";
|
623
|
+
interface LockOptions {
|
624
|
+
ifAvailable?: boolean;
|
625
|
+
mode?: LockMode;
|
626
|
+
signal?: AbortSignal;
|
627
|
+
steal?: boolean;
|
628
|
+
}
|
629
|
+
var locks: LockManager;
|
601
630
|
/**
|
602
631
|
* Mark an object as not transferable. If `object` occurs in the transfer list of
|
603
632
|
* a `port.postMessage()` call, it is ignored.
|