@types/node 16.18.77 → 16.18.79
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 v16.18/README.md +1 -1
- node v16.18/package.json +2 -2
- node v16.18/tls.d.ts +2 -1
- node v16.18/ts4.8/crypto.d.ts +5 -2
- node v16.18/ts4.8/diagnostics_channel.d.ts +1 -1
- node v16.18/ts4.8/dns/promises.d.ts +1 -0
- node v16.18/ts4.8/dns.d.ts +1 -0
- node v16.18/ts4.8/events.d.ts +49 -0
- node v16.18/ts4.8/http.d.ts +3 -2
- node v16.18/ts4.8/index.d.ts +1 -1
- node v16.18/ts4.8/os.d.ts +0 -1
- node v16.18/ts4.8/perf_hooks.d.ts +1 -1
- node v16.18/ts4.8/stream.d.ts +38 -2
- node v16.18/ts4.8/tls.d.ts +2 -1
node v16.18/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/v16.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 01 Feb 2024 17:35:23 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
node v16.18/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.18.
|
|
3
|
+
"version": "16.18.79",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -222,6 +222,6 @@
|
|
|
222
222
|
},
|
|
223
223
|
"scripts": {},
|
|
224
224
|
"dependencies": {},
|
|
225
|
-
"typesPublisherContentHash": "
|
|
225
|
+
"typesPublisherContentHash": "052d62dae6ffb01bc2ee31005dcedbade3b7287f6e0ea97a6302c5d2fd41aec9",
|
|
226
226
|
"typeScriptVersion": "4.6"
|
|
227
227
|
}
|
node v16.18/tls.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
declare module "tls" {
|
|
12
12
|
import { X509Certificate } from "node:crypto";
|
|
13
13
|
import * as net from "node:net";
|
|
14
|
+
import * as stream from "stream";
|
|
14
15
|
const CLIENT_RENEG_LIMIT: number;
|
|
15
16
|
const CLIENT_RENEG_WINDOW: number;
|
|
16
17
|
interface Certificate {
|
|
@@ -140,7 +141,7 @@ declare module "tls" {
|
|
|
140
141
|
/**
|
|
141
142
|
* Construct a new tls.TLSSocket object from an existing TCP socket.
|
|
142
143
|
*/
|
|
143
|
-
constructor(socket: net.Socket, options?: TLSSocketOptions);
|
|
144
|
+
constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions);
|
|
144
145
|
/**
|
|
145
146
|
* Returns `true` if the peer certificate was signed by one of the CAs specified
|
|
146
147
|
* when creating the `tls.TLSSocket` instance, otherwise `false`.
|
node v16.18/ts4.8/crypto.d.ts
CHANGED
|
@@ -1205,11 +1205,13 @@ declare module "crypto" {
|
|
|
1205
1205
|
format?: KeyFormat | undefined;
|
|
1206
1206
|
type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
|
|
1207
1207
|
passphrase?: string | Buffer | undefined;
|
|
1208
|
+
encoding?: string | undefined;
|
|
1208
1209
|
}
|
|
1209
1210
|
interface PublicKeyInput {
|
|
1210
1211
|
key: string | Buffer;
|
|
1211
1212
|
format?: KeyFormat | undefined;
|
|
1212
1213
|
type?: "pkcs1" | "spki" | undefined;
|
|
1214
|
+
encoding?: string | undefined;
|
|
1213
1215
|
}
|
|
1214
1216
|
/**
|
|
1215
1217
|
* Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`.
|
|
@@ -3490,12 +3492,13 @@ declare module "crypto" {
|
|
|
3490
3492
|
*/
|
|
3491
3493
|
disableEntropyCache?: boolean | undefined;
|
|
3492
3494
|
}
|
|
3495
|
+
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
3493
3496
|
/**
|
|
3494
3497
|
* Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
|
|
3495
3498
|
* cryptographic pseudorandom number generator.
|
|
3496
3499
|
* @since v15.6.0
|
|
3497
3500
|
*/
|
|
3498
|
-
function randomUUID(options?: RandomUUIDOptions):
|
|
3501
|
+
function randomUUID(options?: RandomUUIDOptions): UUID;
|
|
3499
3502
|
interface X509CheckOptions {
|
|
3500
3503
|
/**
|
|
3501
3504
|
* @default 'always'
|
|
@@ -3978,7 +3981,7 @@ declare module "crypto" {
|
|
|
3978
3981
|
* The UUID is generated using a cryptographic pseudorandom number generator.
|
|
3979
3982
|
* @since v16.7.0
|
|
3980
3983
|
*/
|
|
3981
|
-
randomUUID():
|
|
3984
|
+
randomUUID(): UUID;
|
|
3982
3985
|
CryptoKey: CryptoKeyConstructor;
|
|
3983
3986
|
}
|
|
3984
3987
|
// This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
|
|
@@ -57,6 +57,7 @@ declare module "diagnostics_channel" {
|
|
|
57
57
|
* @return The named channel object
|
|
58
58
|
*/
|
|
59
59
|
function channel(name: string | symbol): Channel;
|
|
60
|
+
type ChannelListener = (message: unknown, name: string | symbol) => void;
|
|
60
61
|
/**
|
|
61
62
|
* Register a message handler to subscribe to this channel. This message handler will be run synchronously
|
|
62
63
|
* whenever a message is published to the channel. Any errors thrown in the message handler will
|
|
@@ -96,7 +97,6 @@ declare module "diagnostics_channel" {
|
|
|
96
97
|
* @returns `true` if the handler was found, `false` otherwise
|
|
97
98
|
*/
|
|
98
99
|
function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean;
|
|
99
|
-
type ChannelListener = (message: unknown, name: string | symbol) => void;
|
|
100
100
|
/**
|
|
101
101
|
* The class `Channel` represents an individual named channel within the data
|
|
102
102
|
* pipeline. It is use to track subscribers and to publish messages when there
|
|
@@ -353,6 +353,7 @@ declare module "dns/promises" {
|
|
|
353
353
|
resolve4: typeof resolve4;
|
|
354
354
|
resolve6: typeof resolve6;
|
|
355
355
|
resolveAny: typeof resolveAny;
|
|
356
|
+
resolveCaa: typeof resolveCaa;
|
|
356
357
|
resolveCname: typeof resolveCname;
|
|
357
358
|
resolveMx: typeof resolveMx;
|
|
358
359
|
resolveNaptr: typeof resolveNaptr;
|
node v16.18/ts4.8/dns.d.ts
CHANGED
|
@@ -761,6 +761,7 @@ declare module "dns" {
|
|
|
761
761
|
resolve4: typeof resolve4;
|
|
762
762
|
resolve6: typeof resolve6;
|
|
763
763
|
resolveAny: typeof resolveAny;
|
|
764
|
+
resolveCaa: typeof resolveCaa;
|
|
764
765
|
resolveCname: typeof resolveCname;
|
|
765
766
|
resolveMx: typeof resolveMx;
|
|
766
767
|
resolveNaptr: typeof resolveNaptr;
|
node v16.18/ts4.8/events.d.ts
CHANGED
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/events.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module "events" {
|
|
38
|
+
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
|
39
|
+
|
|
38
40
|
interface EventEmitterOptions {
|
|
39
41
|
/**
|
|
40
42
|
* Enables automatic capturing of promise rejection.
|
|
@@ -72,6 +74,9 @@ declare module "events" {
|
|
|
72
74
|
*/
|
|
73
75
|
class EventEmitter {
|
|
74
76
|
constructor(options?: EventEmitterOptions);
|
|
77
|
+
|
|
78
|
+
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
|
79
|
+
|
|
75
80
|
/**
|
|
76
81
|
* Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
|
77
82
|
* event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
|
@@ -314,10 +319,54 @@ declare module "events" {
|
|
|
314
319
|
*/
|
|
315
320
|
signal?: AbortSignal | undefined;
|
|
316
321
|
}
|
|
322
|
+
|
|
323
|
+
export interface EventEmitterReferencingAsyncResource extends AsyncResource {
|
|
324
|
+
readonly eventEmitter: EventEmitterAsyncResource;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions {
|
|
328
|
+
/**
|
|
329
|
+
* The type of async event, this is required when instantiating `EventEmitterAsyncResource`
|
|
330
|
+
* directly rather than as a child class.
|
|
331
|
+
* @default new.target.name if instantiated as a child class.
|
|
332
|
+
*/
|
|
333
|
+
name?: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that require
|
|
338
|
+
* manual async tracking. Specifically, all events emitted by instances of
|
|
339
|
+
* `EventEmitterAsyncResource` will run within its async context.
|
|
340
|
+
*
|
|
341
|
+
* The EventEmitterAsyncResource class has the same methods and takes the
|
|
342
|
+
* same options as EventEmitter and AsyncResource themselves.
|
|
343
|
+
* @throws if `options.name` is not provided when instantiated directly.
|
|
344
|
+
* @since v17.4.0, v16.14.0
|
|
345
|
+
*/
|
|
346
|
+
export class EventEmitterAsyncResource extends EventEmitter {
|
|
347
|
+
/**
|
|
348
|
+
* @param options Only optional in child class.
|
|
349
|
+
*/
|
|
350
|
+
constructor(options?: EventEmitterAsyncResourceOptions);
|
|
351
|
+
/**
|
|
352
|
+
* Call all destroy hooks. This should only ever be called once. An
|
|
353
|
+
* error will be thrown if it is called more than once. This must be
|
|
354
|
+
* manually called. If the resource is left to be collected by the GC then
|
|
355
|
+
* the destroy hooks will never be called.
|
|
356
|
+
*/
|
|
357
|
+
emitDestroy(): void;
|
|
358
|
+
/** The unique asyncId assigned to the resource. */
|
|
359
|
+
readonly asyncId: number;
|
|
360
|
+
/** The same triggerAsyncId that is passed to the AsyncResource constructor. */
|
|
361
|
+
readonly triggerAsyncId: number;
|
|
362
|
+
/** The underlying AsyncResource */
|
|
363
|
+
readonly asyncResource: EventEmitterReferencingAsyncResource;
|
|
364
|
+
}
|
|
317
365
|
}
|
|
318
366
|
global {
|
|
319
367
|
namespace NodeJS {
|
|
320
368
|
interface EventEmitter {
|
|
369
|
+
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
|
321
370
|
/**
|
|
322
371
|
* Alias for `emitter.on(eventName, listener)`.
|
|
323
372
|
* @since v0.1.26
|
node v16.18/ts4.8/http.d.ts
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
declare module "http" {
|
|
43
43
|
import * as stream from "node:stream";
|
|
44
44
|
import { URL } from "node:url";
|
|
45
|
+
import { EventEmitter } from "node:events";
|
|
45
46
|
import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net";
|
|
46
47
|
// incoming headers will never contain number
|
|
47
48
|
interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
|
|
@@ -1216,9 +1217,9 @@ declare module "http" {
|
|
|
1216
1217
|
* ```
|
|
1217
1218
|
* @since v0.3.4
|
|
1218
1219
|
*/
|
|
1219
|
-
class Agent {
|
|
1220
|
+
class Agent extends EventEmitter {
|
|
1220
1221
|
/**
|
|
1221
|
-
* By default set to 256
|
|
1222
|
+
* By default set to 256. For agents with `keepAlive` enabled, this
|
|
1222
1223
|
* sets the maximum number of sockets that will be left open in the free
|
|
1223
1224
|
* state.
|
|
1224
1225
|
* @since v0.11.7
|
node v16.18/ts4.8/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
// NOTE: These definitions support NodeJS and TypeScript 4.
|
|
25
|
+
// NOTE: These definitions support NodeJS and TypeScript 4.9+.
|
|
26
26
|
|
|
27
27
|
// Reference required types from the default lib:
|
|
28
28
|
/// <reference lib="es2020" />
|
node v16.18/ts4.8/os.d.ts
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*/
|
|
31
31
|
declare module "perf_hooks" {
|
|
32
32
|
import { AsyncResource } from "node:async_hooks";
|
|
33
|
-
type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http";
|
|
33
|
+
type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns";
|
|
34
34
|
interface NodeGCPerformanceDetail {
|
|
35
35
|
/**
|
|
36
36
|
* When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
|
node v16.18/ts4.8/stream.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
declare module "stream" {
|
|
20
20
|
import { Abortable, EventEmitter } from "node:events";
|
|
21
|
-
import { Blob } from "node:buffer";
|
|
21
|
+
import { Blob as NodeBlob } from "node:buffer";
|
|
22
22
|
import * as streamPromises from "node:stream/promises";
|
|
23
23
|
import * as streamConsumers from "node:stream/consumers";
|
|
24
24
|
class internal extends EventEmitter {
|
|
@@ -45,6 +45,12 @@ declare module "stream" {
|
|
|
45
45
|
encoding?: BufferEncoding | undefined;
|
|
46
46
|
read?(this: Readable, size: number): void;
|
|
47
47
|
}
|
|
48
|
+
interface ArrayOptions {
|
|
49
|
+
/** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */
|
|
50
|
+
concurrency?: number;
|
|
51
|
+
/** allows destroying the stream if the signal is aborted. */
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}
|
|
48
54
|
/**
|
|
49
55
|
* @since v0.9.4
|
|
50
56
|
*/
|
|
@@ -397,6 +403,36 @@ declare module "stream" {
|
|
|
397
403
|
*/
|
|
398
404
|
wrap(stream: NodeJS.ReadableStream): this;
|
|
399
405
|
push(chunk: any, encoding?: BufferEncoding): boolean;
|
|
406
|
+
/**
|
|
407
|
+
* The iterator created by this method gives users the option to cancel the destruction
|
|
408
|
+
* of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`,
|
|
409
|
+
* or if the iterator should destroy the stream if the stream emitted an error during iteration.
|
|
410
|
+
* @since v16.3.0
|
|
411
|
+
* @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator,
|
|
412
|
+
* or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
|
|
413
|
+
* **Default: `true`**.
|
|
414
|
+
*/
|
|
415
|
+
iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator<any>;
|
|
416
|
+
/**
|
|
417
|
+
* This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
|
|
418
|
+
* If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
|
|
419
|
+
* @since v17.4.0, v16.14.0
|
|
420
|
+
* @param fn a function to map over every chunk in the stream. Async or not.
|
|
421
|
+
* @returns a stream mapped with the function *fn*.
|
|
422
|
+
*/
|
|
423
|
+
map(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
|
|
424
|
+
/**
|
|
425
|
+
* This method allows filtering the stream. For each chunk in the stream the *fn* function will be called
|
|
426
|
+
* and if it returns a truthy value, the chunk will be passed to the result stream.
|
|
427
|
+
* If the *fn* function returns a promise - that promise will be `await`ed.
|
|
428
|
+
* @since v17.4.0, v16.14.0
|
|
429
|
+
* @param fn a function to filter chunks from the stream. Async or not.
|
|
430
|
+
* @returns a stream filtered with the predicate *fn*.
|
|
431
|
+
*/
|
|
432
|
+
filter(
|
|
433
|
+
fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
|
|
434
|
+
options?: ArrayOptions,
|
|
435
|
+
): Readable;
|
|
400
436
|
_destroy(error: Error | null, callback: (error?: Error | null) => void): void;
|
|
401
437
|
/**
|
|
402
438
|
* Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable
|
|
@@ -848,7 +884,7 @@ declare module "stream" {
|
|
|
848
884
|
static from(
|
|
849
885
|
src:
|
|
850
886
|
| Stream
|
|
851
|
-
|
|
|
887
|
+
| NodeBlob
|
|
852
888
|
| ArrayBuffer
|
|
853
889
|
| string
|
|
854
890
|
| Iterable<any>
|
node v16.18/ts4.8/tls.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
declare module "tls" {
|
|
12
12
|
import { X509Certificate } from "node:crypto";
|
|
13
13
|
import * as net from "node:net";
|
|
14
|
+
import * as stream from "stream";
|
|
14
15
|
const CLIENT_RENEG_LIMIT: number;
|
|
15
16
|
const CLIENT_RENEG_WINDOW: number;
|
|
16
17
|
interface Certificate {
|
|
@@ -140,7 +141,7 @@ declare module "tls" {
|
|
|
140
141
|
/**
|
|
141
142
|
* Construct a new tls.TLSSocket object from an existing TCP socket.
|
|
142
143
|
*/
|
|
143
|
-
constructor(socket: net.Socket, options?: TLSSocketOptions);
|
|
144
|
+
constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions);
|
|
144
145
|
/**
|
|
145
146
|
* Returns `true` if the peer certificate was signed by one of the CAs specified
|
|
146
147
|
* when creating the `tls.TLSSocket` instance, otherwise `false`.
|