@types/node 26.1.2 → 26.3.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/buffer.buffer.d.ts +5 -5
- node/child_process.d.ts +0 -1
- node/crypto.d.ts +8 -8
- node/dns/promises.d.ts +5 -5
- node/dns.d.ts +5 -5
- node/fs.d.ts +7 -0
- node/http.d.ts +46 -0
- node/http2.d.ts +14 -6
- node/os.d.ts +30 -30
- node/package.json +2 -2
- node/perf_hooks.d.ts +2 -1
- node/process.d.ts +94 -43
- node/quic.d.ts +1242 -95
- node/sqlite.d.ts +20 -3
- node/stream/iter.d.ts +3 -2
- node/test.d.ts +97 -0
- node/v8.d.ts +20 -23
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Mon,
|
|
11
|
+
* Last updated: Mon, 24 Aug 2026 19:40:21 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
node/buffer.buffer.d.ts
CHANGED
|
@@ -316,11 +316,11 @@ declare module "node:buffer" {
|
|
|
316
316
|
* such `Buffer` instances with zeroes.
|
|
317
317
|
*
|
|
318
318
|
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
|
|
319
|
-
* allocations
|
|
320
|
-
*
|
|
321
|
-
* individually allocated `Buffer`
|
|
322
|
-
*
|
|
323
|
-
* many individual `ArrayBuffer` objects.
|
|
319
|
+
* allocations less than `Buffer.poolSize >>> 1` (32KiB when default poolSize is used) are sliced
|
|
320
|
+
* from a single pre-allocated `Buffer`. This allows applications to avoid the
|
|
321
|
+
* garbage collection overhead of creating many individually allocated `Buffer`
|
|
322
|
+
* instances. This approach improves both performance and memory usage by
|
|
323
|
+
* eliminating the need to track and clean up as many individual `ArrayBuffer` objects.
|
|
324
324
|
*
|
|
325
325
|
* However, in the case where a developer may need to retain a small chunk of
|
|
326
326
|
* memory from a pool for an indeterminate amount of time, it may be appropriate
|
node/child_process.d.ts
CHANGED
node/crypto.d.ts
CHANGED
|
@@ -2698,12 +2698,12 @@ declare module "node:crypto" {
|
|
|
2698
2698
|
*/
|
|
2699
2699
|
function sign(
|
|
2700
2700
|
algorithm: string | null | undefined,
|
|
2701
|
-
data:
|
|
2701
|
+
data: BinaryLike,
|
|
2702
2702
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
2703
2703
|
): NonSharedBuffer;
|
|
2704
2704
|
function sign(
|
|
2705
2705
|
algorithm: string | null | undefined,
|
|
2706
|
-
data:
|
|
2706
|
+
data: BinaryLike,
|
|
2707
2707
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
|
|
2708
2708
|
callback: (error: Error | null, data: NonSharedBuffer) => void,
|
|
2709
2709
|
): void;
|
|
@@ -2729,15 +2729,15 @@ declare module "node:crypto" {
|
|
|
2729
2729
|
*/
|
|
2730
2730
|
function verify(
|
|
2731
2731
|
algorithm: string | null | undefined,
|
|
2732
|
-
data:
|
|
2732
|
+
data: BinaryLike,
|
|
2733
2733
|
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
|
|
2734
|
-
signature:
|
|
2734
|
+
signature: BinaryLike,
|
|
2735
2735
|
): boolean;
|
|
2736
2736
|
function verify(
|
|
2737
2737
|
algorithm: string | null | undefined,
|
|
2738
|
-
data:
|
|
2738
|
+
data: BinaryLike,
|
|
2739
2739
|
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
|
|
2740
|
-
signature:
|
|
2740
|
+
signature: BinaryLike,
|
|
2741
2741
|
callback: (error: Error | null, result: boolean) => void,
|
|
2742
2742
|
): void;
|
|
2743
2743
|
/**
|
|
@@ -3742,7 +3742,7 @@ declare module "node:crypto" {
|
|
|
3742
3742
|
ciphertext: NodeJS.BufferSource,
|
|
3743
3743
|
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
3744
3744
|
extractable: boolean,
|
|
3745
|
-
|
|
3745
|
+
keyUsages: KeyUsage[],
|
|
3746
3746
|
): Promise<CryptoKey>;
|
|
3747
3747
|
decrypt(
|
|
3748
3748
|
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
@@ -3774,7 +3774,7 @@ declare module "node:crypto" {
|
|
|
3774
3774
|
encapsulationKey: CryptoKey,
|
|
3775
3775
|
sharedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams,
|
|
3776
3776
|
extractable: boolean,
|
|
3777
|
-
|
|
3777
|
+
keyUsages: KeyUsage[],
|
|
3778
3778
|
): Promise<EncapsulatedKey>;
|
|
3779
3779
|
encrypt(
|
|
3780
3780
|
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
node/dns/promises.d.ts
CHANGED
|
@@ -183,7 +183,7 @@ declare module "node:dns/promises" {
|
|
|
183
183
|
* refresh: 900,
|
|
184
184
|
* retry: 900,
|
|
185
185
|
* expire: 1800,
|
|
186
|
-
* minttl: 60 } ]
|
|
186
|
+
* minttl: 60 } ];
|
|
187
187
|
* ```
|
|
188
188
|
* @since v10.6.0
|
|
189
189
|
*/
|
|
@@ -226,7 +226,7 @@ declare module "node:dns/promises" {
|
|
|
226
226
|
* regexp: '',
|
|
227
227
|
* replacement: '_sip._udp.example.com',
|
|
228
228
|
* order: 30,
|
|
229
|
-
* preference: 100
|
|
229
|
+
* preference: 100,
|
|
230
230
|
* }
|
|
231
231
|
* ```
|
|
232
232
|
* @since v10.6.0
|
|
@@ -265,7 +265,7 @@ declare module "node:dns/promises" {
|
|
|
265
265
|
* refresh: 10000,
|
|
266
266
|
* retry: 2400,
|
|
267
267
|
* expire: 604800,
|
|
268
|
-
* minttl: 3600
|
|
268
|
+
* minttl: 3600,
|
|
269
269
|
* }
|
|
270
270
|
* ```
|
|
271
271
|
* @since v10.6.0
|
|
@@ -285,7 +285,7 @@ declare module "node:dns/promises" {
|
|
|
285
285
|
* priority: 10,
|
|
286
286
|
* weight: 5,
|
|
287
287
|
* port: 21223,
|
|
288
|
-
* name: 'service.example.com'
|
|
288
|
+
* name: 'service.example.com',
|
|
289
289
|
* }
|
|
290
290
|
* ```
|
|
291
291
|
* @since v10.6.0
|
|
@@ -306,7 +306,7 @@ declare module "node:dns/promises" {
|
|
|
306
306
|
* certUsage: 3,
|
|
307
307
|
* selector: 1,
|
|
308
308
|
* match: 1,
|
|
309
|
-
* data: [ArrayBuffer]
|
|
309
|
+
* data: [ArrayBuffer],
|
|
310
310
|
* }
|
|
311
311
|
* ```
|
|
312
312
|
* @since v23.9.0, v22.15.0
|
node/dns.d.ts
CHANGED
|
@@ -490,7 +490,7 @@ declare module "node:dns" {
|
|
|
490
490
|
* regexp: '',
|
|
491
491
|
* replacement: '_sip._udp.example.com',
|
|
492
492
|
* order: 30,
|
|
493
|
-
* preference: 100
|
|
493
|
+
* preference: 100,
|
|
494
494
|
* }
|
|
495
495
|
* ```
|
|
496
496
|
* @since v0.9.12
|
|
@@ -547,7 +547,7 @@ declare module "node:dns" {
|
|
|
547
547
|
* refresh: 10000,
|
|
548
548
|
* retry: 2400,
|
|
549
549
|
* expire: 604800,
|
|
550
|
-
* minttl: 3600
|
|
550
|
+
* minttl: 3600,
|
|
551
551
|
* }
|
|
552
552
|
* ```
|
|
553
553
|
* @since v0.11.10
|
|
@@ -573,7 +573,7 @@ declare module "node:dns" {
|
|
|
573
573
|
* priority: 10,
|
|
574
574
|
* weight: 5,
|
|
575
575
|
* port: 21223,
|
|
576
|
-
* name: 'service.example.com'
|
|
576
|
+
* name: 'service.example.com',
|
|
577
577
|
* }
|
|
578
578
|
* ```
|
|
579
579
|
* @since v0.1.27
|
|
@@ -600,7 +600,7 @@ declare module "node:dns" {
|
|
|
600
600
|
* certUsage: 3,
|
|
601
601
|
* selector: 1,
|
|
602
602
|
* match: 1,
|
|
603
|
-
* data: [ArrayBuffer]
|
|
603
|
+
* data: [ArrayBuffer],
|
|
604
604
|
* }
|
|
605
605
|
* ```
|
|
606
606
|
* @since v23.9.0, v22.15.0
|
|
@@ -650,7 +650,7 @@ declare module "node:dns" {
|
|
|
650
650
|
* refresh: 900,
|
|
651
651
|
* retry: 900,
|
|
652
652
|
* expire: 1800,
|
|
653
|
-
* minttl: 60 } ]
|
|
653
|
+
* minttl: 60 } ];
|
|
654
654
|
* ```
|
|
655
655
|
*
|
|
656
656
|
* DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see
|
node/fs.d.ts
CHANGED
|
@@ -48,6 +48,13 @@ declare module "node:fs" {
|
|
|
48
48
|
mtime: Date;
|
|
49
49
|
ctime: Date;
|
|
50
50
|
birthtime: Date;
|
|
51
|
+
// Deliberately not defining a type alias here... it'd be exported, and something in the ecosystem would inevitably start using it.
|
|
52
|
+
// TODO: replace with Temporal builtins once @types/node no longer supports TS <6.0.
|
|
53
|
+
atimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
|
|
54
|
+
mtimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
|
|
55
|
+
ctimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
|
|
56
|
+
birthtimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T
|
|
57
|
+
: unknown;
|
|
51
58
|
}
|
|
52
59
|
interface Stats extends StatsBase<number> {}
|
|
53
60
|
/**
|
node/http.d.ts
CHANGED
|
@@ -175,6 +175,7 @@ declare module "node:http" {
|
|
|
175
175
|
headers?: OutgoingHttpHeaders | readonly string[] | undefined;
|
|
176
176
|
host?: string | null | undefined;
|
|
177
177
|
hostname?: string | null | undefined;
|
|
178
|
+
httpValidation?: "strict" | "relaxed" | "insecure" | undefined;
|
|
178
179
|
insecureHTTPParser?: boolean | undefined;
|
|
179
180
|
localAddress?: string | undefined;
|
|
180
181
|
localPort?: number | undefined;
|
|
@@ -254,6 +255,21 @@ declare module "node:http" {
|
|
|
254
255
|
* @since v20.1.0
|
|
255
256
|
*/
|
|
256
257
|
highWaterMark?: number | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Controls HTTP header value validation strictness
|
|
260
|
+
* for incoming requests. Accepted values are:
|
|
261
|
+
* * `'strict'`: Strictest validation; rejects any non-ASCII or control
|
|
262
|
+
* characters in header values.
|
|
263
|
+
* * `'relaxed'`: Allows a limited set of non-ASCII characters in header
|
|
264
|
+
* values, aligning with the
|
|
265
|
+
* [Fetch specification](https://fetch.spec.whatwg.org/).
|
|
266
|
+
* * `'insecure'`: Disables all header value validation (equivalent to
|
|
267
|
+
* `insecureHTTPParser: true`).
|
|
268
|
+
*
|
|
269
|
+
* Cannot be used together with `insecureHTTPParser`. **Default:** `'strict'`.
|
|
270
|
+
* @since v26.3.0
|
|
271
|
+
*/
|
|
272
|
+
httpValidation?: "strict" | "relaxed" | "insecure" | undefined;
|
|
257
273
|
/**
|
|
258
274
|
* Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
|
|
259
275
|
* Using the insecure parser should be avoided.
|
|
@@ -922,6 +938,36 @@ declare module "node:http" {
|
|
|
922
938
|
headers?: OutgoingHttpHeaders | OutgoingHttpHeader[],
|
|
923
939
|
): this;
|
|
924
940
|
writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
|
|
941
|
+
/**
|
|
942
|
+
* Sends an arbitrary HTTP/1.1 1xx informational response to the client. This
|
|
943
|
+
* is a generic equivalent of `response.writeContinue()`,
|
|
944
|
+
* `response.writeProcessing()` and `response.writeEarlyHints()`, and
|
|
945
|
+
* can be called multiple times before the final response. After the final
|
|
946
|
+
* response headers have been sent (via `response.writeHead()` or an
|
|
947
|
+
* implicit header), calling this method throws `ERR_HTTP_HEADERS_SENT`.
|
|
948
|
+
*
|
|
949
|
+
* Clients receive these responses via the [`'information'`](https://nodejs.org/docs/latest-v26.x/api/http.html#event-information)
|
|
950
|
+
* event on `http.ClientRequest`.
|
|
951
|
+
*
|
|
952
|
+
* ```js
|
|
953
|
+
* response.writeInformation(110, { 'X-Progress': '50%' });
|
|
954
|
+
* ```
|
|
955
|
+
* @since v26.2.0
|
|
956
|
+
* @param statusCode An HTTP 1xx informational status code, between `100`
|
|
957
|
+
* and `199` inclusive, excluding `101` (Switching Protocols) which is only
|
|
958
|
+
* available through the [`'upgrade'`](https://nodejs.org/docs/latest-v26.x/api/http.html#event-upgrade) event.
|
|
959
|
+
* @param headers An optional set of headers to send with the
|
|
960
|
+
* informational response. Accepts the same shapes as
|
|
961
|
+
* `response.writeHead()`.
|
|
962
|
+
* @param callback Optional, called once the message has been written
|
|
963
|
+
* to the socket.
|
|
964
|
+
*/
|
|
965
|
+
writeInformation(
|
|
966
|
+
statusCode: number,
|
|
967
|
+
headers?: OutgoingHttpHeaders | readonly string[],
|
|
968
|
+
callback?: () => void,
|
|
969
|
+
): void;
|
|
970
|
+
writeInformation(statusCode: number, callback: () => void): void;
|
|
925
971
|
/**
|
|
926
972
|
* Sends a HTTP/1.1 102 Processing message to the client, indicating that
|
|
927
973
|
* the request body should be sent.
|
node/http2.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ declare module "node:http2" {
|
|
|
59
59
|
"ready": [];
|
|
60
60
|
"streamClosed": [code: number];
|
|
61
61
|
"timeout": [];
|
|
62
|
-
"trailers": [
|
|
62
|
+
"trailers": [headers: IncomingHttpHeaders, flags: number, rawHeaders: string[]];
|
|
63
63
|
"wantTrailers": [];
|
|
64
64
|
}
|
|
65
65
|
interface Http2Stream extends stream.Duplex {
|
|
@@ -245,7 +245,7 @@ declare module "node:http2" {
|
|
|
245
245
|
interface ClientHttp2StreamEventMap extends Http2StreamEventMap {
|
|
246
246
|
"continue": [];
|
|
247
247
|
"headers": [headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number, rawHeaders: string[]];
|
|
248
|
-
"push": [headers: IncomingHttpHeaders, flags: number];
|
|
248
|
+
"push": [headers: IncomingHttpHeaders, flags: number, rawHeaders: string[]];
|
|
249
249
|
"response": [headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number, rawHeaders: string[]];
|
|
250
250
|
}
|
|
251
251
|
interface ClientHttp2Stream extends Http2Stream {
|
|
@@ -840,9 +840,12 @@ declare module "node:http2" {
|
|
|
840
840
|
* HTTP/2 request to the connected server.
|
|
841
841
|
*
|
|
842
842
|
* When a `ClientHttp2Session` is first created, the socket may not yet be
|
|
843
|
-
* connected.
|
|
843
|
+
* connected. If `clienthttp2session.request()` is called during this time, the
|
|
844
844
|
* actual request will be deferred until the socket is ready to go.
|
|
845
|
-
*
|
|
845
|
+
*
|
|
846
|
+
* If the session becomes unavailable before the request can be created, the
|
|
847
|
+
* returned stream will emit `ERR_HTTP2_GOAWAY_SESSION` or
|
|
848
|
+
* `ERR_HTTP2_INVALID_SESSION` asynchronously.
|
|
846
849
|
*
|
|
847
850
|
* This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`.
|
|
848
851
|
*
|
|
@@ -1166,6 +1169,11 @@ declare module "node:http2" {
|
|
|
1166
1169
|
* @default 128
|
|
1167
1170
|
*/
|
|
1168
1171
|
maxHeaderListPairs?: number | undefined;
|
|
1172
|
+
/**
|
|
1173
|
+
* Sets the maximum number of uniq origin the sever
|
|
1174
|
+
* can send via ORIGIN frames. **Default:** `128`.
|
|
1175
|
+
*/
|
|
1176
|
+
maxOriginSetSize?: number | undefined;
|
|
1169
1177
|
/**
|
|
1170
1178
|
* Sets the maximum number of outstanding, unacknowledged pings.
|
|
1171
1179
|
* @default 10
|
|
@@ -1644,8 +1652,8 @@ declare module "node:http2" {
|
|
|
1644
1652
|
*
|
|
1645
1653
|
* Then `request.url` will be:
|
|
1646
1654
|
*
|
|
1647
|
-
* ```
|
|
1648
|
-
*
|
|
1655
|
+
* ```json
|
|
1656
|
+
* "/status?name=ryan"
|
|
1649
1657
|
* ```
|
|
1650
1658
|
*
|
|
1651
1659
|
* To parse the url into its parts, `new URL()` can be used:
|
node/os.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ declare module "node:os" {
|
|
|
122
122
|
* irq: 20,
|
|
123
123
|
* },
|
|
124
124
|
* },
|
|
125
|
-
* ]
|
|
125
|
+
* ];
|
|
126
126
|
* ```
|
|
127
127
|
*
|
|
128
128
|
* `nice` values are POSIX-only. On Windows, the `nice` values of all processors
|
|
@@ -167,44 +167,44 @@ declare module "node:os" {
|
|
|
167
167
|
*
|
|
168
168
|
* The properties available on the assigned network address object include:
|
|
169
169
|
*
|
|
170
|
-
* ```
|
|
170
|
+
* ```json
|
|
171
171
|
* {
|
|
172
|
-
* lo: [
|
|
172
|
+
* "lo": [
|
|
173
173
|
* {
|
|
174
|
-
* address:
|
|
175
|
-
* netmask:
|
|
176
|
-
* family:
|
|
177
|
-
* mac:
|
|
178
|
-
* internal: true,
|
|
179
|
-
* cidr:
|
|
174
|
+
* "address:": "127.0.0.1",
|
|
175
|
+
* "netmask:": "255.0.0.0",
|
|
176
|
+
* "family:": "IPv4",
|
|
177
|
+
* "mac:": "00:00:00:00:00:00",
|
|
178
|
+
* "internal:": true,
|
|
179
|
+
* "cidr:": "127.0.0.1/8"
|
|
180
180
|
* },
|
|
181
181
|
* {
|
|
182
|
-
* address:
|
|
183
|
-
* netmask:
|
|
184
|
-
* family:
|
|
185
|
-
* mac:
|
|
186
|
-
* scopeid: 0,
|
|
187
|
-
* internal: true,
|
|
188
|
-
* cidr:
|
|
182
|
+
* "address:": "::1",
|
|
183
|
+
* "netmask:": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
|
|
184
|
+
* "family:": "IPv6",
|
|
185
|
+
* "mac:": "00:00:00:00:00:00",
|
|
186
|
+
* "scopeid:": 0,
|
|
187
|
+
* "internal:": true,
|
|
188
|
+
* "cidr:": "::1/128"
|
|
189
189
|
* }
|
|
190
190
|
* ],
|
|
191
|
-
* eth0: [
|
|
191
|
+
* "eth0": [
|
|
192
192
|
* {
|
|
193
|
-
* address:
|
|
194
|
-
* netmask:
|
|
195
|
-
* family:
|
|
196
|
-
* mac:
|
|
197
|
-
* internal: false,
|
|
198
|
-
* cidr:
|
|
193
|
+
* "address:": "192.168.1.108",
|
|
194
|
+
* "netmask:": "255.255.255.0",
|
|
195
|
+
* "family:": "IPv4",
|
|
196
|
+
* "mac:": "01:02:03:0a:0b:0c",
|
|
197
|
+
* "internal:": false,
|
|
198
|
+
* "cidr:": "192.168.1.108/24"
|
|
199
199
|
* },
|
|
200
200
|
* {
|
|
201
|
-
* address:
|
|
202
|
-
* netmask:
|
|
203
|
-
* family:
|
|
204
|
-
* mac:
|
|
205
|
-
* scopeid: 1,
|
|
206
|
-
* internal: false,
|
|
207
|
-
* cidr:
|
|
201
|
+
* "address:": "fe80::a00:27ff:fe4e:66a1",
|
|
202
|
+
* "netmask:": "ffff:ffff:ffff:ffff::",
|
|
203
|
+
* "family:": "IPv6",
|
|
204
|
+
* "mac:": "01:02:03:0a:0b:0c",
|
|
205
|
+
* "scopeid:": 1,
|
|
206
|
+
* "internal:": false,
|
|
207
|
+
* "cidr:": "fe80::a00:27ff:fe4e:66a1/64"
|
|
208
208
|
* }
|
|
209
209
|
* ]
|
|
210
210
|
* }
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.3.0",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~8.3.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "125032099e1f7132c95bf327b36f694c396de965952f7cb9632ac916bbad47e9",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
node/perf_hooks.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ declare module "node:perf_hooks" {
|
|
|
11
11
|
| "measure" // available on the Web
|
|
12
12
|
| "net" // Node.js only
|
|
13
13
|
| "node" // Node.js only
|
|
14
|
+
| "quic" // Node.js only
|
|
14
15
|
| "resource"; // available on the Web
|
|
15
16
|
interface ConnectionTimingInfo {
|
|
16
17
|
domainLookupStartTime: number;
|
|
@@ -214,7 +215,7 @@ declare module "node:perf_hooks" {
|
|
|
214
215
|
* @since v16.0.0
|
|
215
216
|
*/
|
|
216
217
|
readonly detail: any;
|
|
217
|
-
readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node";
|
|
218
|
+
readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node" | "quic";
|
|
218
219
|
}
|
|
219
220
|
interface UVMetrics {
|
|
220
221
|
/**
|
node/process.d.ts
CHANGED
|
@@ -549,6 +549,58 @@ declare module "node:process" {
|
|
|
549
549
|
* @since v20.0.0
|
|
550
550
|
*/
|
|
551
551
|
has(scope: string, reference?: string): boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Drops the specified permission from the current process. This operation is
|
|
554
|
+
* **irreversible** — once a permission is dropped, it cannot be restored through
|
|
555
|
+
* any Node.js API.
|
|
556
|
+
*
|
|
557
|
+
* If no reference is provided, the entire scope is dropped. For example,
|
|
558
|
+
* `process.permission.drop('fs.read')` will revoke ALL file system read
|
|
559
|
+
* permissions.
|
|
560
|
+
*
|
|
561
|
+
* When a reference is provided, only the permission for that specific resource
|
|
562
|
+
* is dropped. For example, `process.permission.drop('fs.read', '/etc/myapp')`
|
|
563
|
+
* will revoke read access to that directory while keeping other read
|
|
564
|
+
* permissions intact.
|
|
565
|
+
*
|
|
566
|
+
* **Important:** You can only drop the exact resource that was explicitly
|
|
567
|
+
* granted. The reference passed to `drop()` must match the original grant:
|
|
568
|
+
*
|
|
569
|
+
* * If a permission was granted using a wildcard (`*`), such as
|
|
570
|
+
* `--allow-fs-read=*`, individual paths cannot be dropped - only the entire
|
|
571
|
+
* scope can be dropped (by calling `drop()` without a reference).
|
|
572
|
+
* * If a directory was granted (e.g. `--allow-fs-read=/my/folder`), you cannot
|
|
573
|
+
* drop access to individual files inside it. You must drop the same directory
|
|
574
|
+
* that was granted. Any remaining grants continue to apply.
|
|
575
|
+
*
|
|
576
|
+
* The available scopes are the same as [`process.permission.has()`][]:
|
|
577
|
+
*
|
|
578
|
+
* `fs` - All File System (drops both read and write)
|
|
579
|
+
* * `fs.read` - File System read operations
|
|
580
|
+
* * `fs.write` - File System write operations
|
|
581
|
+
* * `child` - Child process spawning operations
|
|
582
|
+
* * `worker` - Worker thread spawning operation
|
|
583
|
+
* * `net` - Network operations
|
|
584
|
+
* * `inspector` - Inspector operations
|
|
585
|
+
* * `wasi` - WASI operations
|
|
586
|
+
* * `addon` - Native addon operations
|
|
587
|
+
*
|
|
588
|
+
* ```js
|
|
589
|
+
* const fs = require('node:fs');
|
|
590
|
+
*
|
|
591
|
+
* // Read configuration during startup
|
|
592
|
+
* const config = fs.readFileSync('/etc/myapp/config.json', 'utf8');
|
|
593
|
+
*
|
|
594
|
+
* // Drop read access to the config directory after initialization
|
|
595
|
+
* process.permission.drop('fs.read', '/etc/myapp');
|
|
596
|
+
*
|
|
597
|
+
* // This will now throw ERR_ACCESS_DENIED
|
|
598
|
+
* fs.readFileSync('/etc/myapp/config.json');
|
|
599
|
+
* ```
|
|
600
|
+
* @since v26.3.0
|
|
601
|
+
* @experimental
|
|
602
|
+
*/
|
|
603
|
+
drop(scope: string, reference?: string): void;
|
|
552
604
|
}
|
|
553
605
|
interface ProcessReport {
|
|
554
606
|
/**
|
|
@@ -791,14 +843,14 @@ declare module "node:process" {
|
|
|
791
843
|
*
|
|
792
844
|
* Results in `process.execArgv`:
|
|
793
845
|
*
|
|
794
|
-
* ```
|
|
846
|
+
* ```json
|
|
795
847
|
* ["--icu-data-dir=./foo", "--require", "./bar.js"]
|
|
796
848
|
* ```
|
|
797
849
|
*
|
|
798
850
|
* And `process.argv`:
|
|
799
851
|
*
|
|
800
|
-
* ```
|
|
801
|
-
* [
|
|
852
|
+
* ```json
|
|
853
|
+
* ["/usr/local/bin/node", "script.js", "--version"]
|
|
802
854
|
* ```
|
|
803
855
|
*
|
|
804
856
|
* Refer to `Worker constructor` for the detailed behavior of worker
|
|
@@ -810,8 +862,8 @@ declare module "node:process" {
|
|
|
810
862
|
* The `process.execPath` property returns the absolute pathname of the executable
|
|
811
863
|
* that started the Node.js process. Symbolic links, if any, are resolved.
|
|
812
864
|
*
|
|
813
|
-
* ```
|
|
814
|
-
*
|
|
865
|
+
* ```json
|
|
866
|
+
* "/usr/local/bin/node"
|
|
815
867
|
* ```
|
|
816
868
|
* @since v0.1.100
|
|
817
869
|
*/
|
|
@@ -994,18 +1046,18 @@ declare module "node:process" {
|
|
|
994
1046
|
*
|
|
995
1047
|
* An example of this object looks like:
|
|
996
1048
|
*
|
|
997
|
-
* ```
|
|
1049
|
+
* ```json
|
|
998
1050
|
* {
|
|
999
|
-
* TERM:
|
|
1000
|
-
* SHELL:
|
|
1001
|
-
* USER:
|
|
1002
|
-
* PATH:
|
|
1003
|
-
* PWD:
|
|
1004
|
-
* EDITOR:
|
|
1005
|
-
* SHLVL:
|
|
1006
|
-
* HOME:
|
|
1007
|
-
* LOGNAME:
|
|
1008
|
-
* _:
|
|
1051
|
+
* "TERM": "xterm-256color",
|
|
1052
|
+
* "SHELL": "/usr/local/bin/bash",
|
|
1053
|
+
* "USER": "maciej",
|
|
1054
|
+
* "PATH": "~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin",
|
|
1055
|
+
* "PWD": "/Users/maciej",
|
|
1056
|
+
* "EDITOR": "vim",
|
|
1057
|
+
* "SHLVL": "1",
|
|
1058
|
+
* "HOME": "/Users/maciej",
|
|
1059
|
+
* "LOGNAME": "maciej",
|
|
1060
|
+
* "_": "/usr/local/bin/node"
|
|
1009
1061
|
* }
|
|
1010
1062
|
* ```
|
|
1011
1063
|
*
|
|
@@ -1540,29 +1592,28 @@ declare module "node:process" {
|
|
|
1540
1592
|
*
|
|
1541
1593
|
* An example of the possible output looks like:
|
|
1542
1594
|
*
|
|
1543
|
-
* ```
|
|
1595
|
+
* ```json
|
|
1544
1596
|
* {
|
|
1545
|
-
* target_defaults:
|
|
1546
|
-
* { cflags: [],
|
|
1547
|
-
* default_configuration:
|
|
1548
|
-
* defines: [],
|
|
1549
|
-
* include_dirs: [],
|
|
1550
|
-
* libraries: [] },
|
|
1551
|
-
* variables:
|
|
1597
|
+
* "target_defaults":
|
|
1598
|
+
* { "cflags": [],
|
|
1599
|
+
* "default_configuration": "Release",
|
|
1600
|
+
* "defines": [],
|
|
1601
|
+
* "include_dirs": [],
|
|
1602
|
+
* "libraries": [] },
|
|
1603
|
+
* "variables":
|
|
1552
1604
|
* {
|
|
1553
|
-
* host_arch:
|
|
1554
|
-
* napi_build_version: 5,
|
|
1555
|
-
* node_install_npm:
|
|
1556
|
-
* node_prefix:
|
|
1557
|
-
* node_shared_cares:
|
|
1558
|
-
* node_shared_http_parser:
|
|
1559
|
-
* node_shared_libuv:
|
|
1560
|
-
* node_shared_zlib:
|
|
1561
|
-
* node_use_openssl:
|
|
1562
|
-
* node_shared_openssl:
|
|
1563
|
-
*
|
|
1564
|
-
*
|
|
1565
|
-
* v8_use_snapshot: 1
|
|
1605
|
+
* "host_arch": "x64",
|
|
1606
|
+
* "napi_build_version": 5,
|
|
1607
|
+
* "node_install_npm": "true",
|
|
1608
|
+
* "node_prefix": "",
|
|
1609
|
+
* "node_shared_cares": "false",
|
|
1610
|
+
* "node_shared_http_parser": "false",
|
|
1611
|
+
* "node_shared_libuv": "false",
|
|
1612
|
+
* "node_shared_zlib": "false",
|
|
1613
|
+
* "node_use_openssl": "true",
|
|
1614
|
+
* "node_shared_openssl": "false",
|
|
1615
|
+
* "target_arch": "x64",
|
|
1616
|
+
* "v8_use_snapshot": 1
|
|
1566
1617
|
* }
|
|
1567
1618
|
* }
|
|
1568
1619
|
* ```
|
|
@@ -1876,13 +1927,13 @@ declare module "node:process" {
|
|
|
1876
1927
|
*
|
|
1877
1928
|
* `process.release` contains the following properties:
|
|
1878
1929
|
*
|
|
1879
|
-
* ```
|
|
1930
|
+
* ```json
|
|
1880
1931
|
* {
|
|
1881
|
-
* name:
|
|
1882
|
-
* lts:
|
|
1883
|
-
* sourceUrl:
|
|
1884
|
-
* headersUrl:
|
|
1885
|
-
* libUrl:
|
|
1932
|
+
* "name": "node",
|
|
1933
|
+
* "lts": "Hydrogen",
|
|
1934
|
+
* "sourceUrl": "https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz",
|
|
1935
|
+
* "headersUrl": "https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz",
|
|
1936
|
+
* "libUrl": "https://nodejs.org/download/release/v18.12.0/win-x64/node.lib"
|
|
1886
1937
|
* }
|
|
1887
1938
|
* ```
|
|
1888
1939
|
*
|