Skip to content

Commit 50acaa0

Browse files
author
codershiba
authored
🤖 Merge PR DefinitelyTyped#69508 [@types/node] Types for Node v20.13.1 by @codershiba
1 parent 1b81ede commit 50acaa0

46 files changed

Lines changed: 926 additions & 259 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

types/node/assert.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* The `node:assert` module provides a set of assertion functions for verifying
33
* invariants.
4-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/assert.js)
4+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/assert.js)
55
*/
66
declare module "assert" {
77
/**

types/node/async_hooks.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* import async_hooks from 'node:async_hooks';
1313
* ```
1414
* @experimental
15-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/async_hooks.js)
15+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/async_hooks.js)
1616
*/
1717
declare module "async_hooks" {
1818
/**

types/node/buffer.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
4242
* const buf7 = Buffer.from('tést', 'latin1');
4343
* ```
44-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/buffer.js)
44+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/buffer.js)
4545
*/
4646
declare module "buffer" {
4747
import { BinaryLike } from "node:crypto";

types/node/child_process.d.ts

Lines changed: 31 additions & 29 deletions
Large diffs are not rendered by default.

types/node/cluster.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* ```
5151
*
5252
* On Windows, it is not yet possible to set up a named pipe server in a worker.
53-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/cluster.js)
53+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/cluster.js)
5454
*/
5555
declare module "cluster" {
5656
import * as child from "node:child_process";

types/node/console.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* myConsole.warn(`Danger ${name}! Danger!`);
5555
* // Prints: Danger Will Robinson! Danger!, to err
5656
* ```
57-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/console.js)
57+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/console.js)
5858
*/
5959
declare module "console" {
6060
import console = require("node:console");

types/node/crypto.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* // Prints:
1515
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
1616
* ```
17-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/crypto.js)
17+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/crypto.js)
1818
*/
1919
declare module "crypto" {
2020
import * as stream from "node:stream";
@@ -470,6 +470,7 @@ declare module "crypto" {
470470
* // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
471471
* ```
472472
* @since v0.1.94
473+
* @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances.
473474
*/
474475
class Hmac extends stream.Transform {
475476
private constructor();

types/node/dgram.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* server.bind(41234);
2424
* // Prints: server listening 0.0.0.0:41234
2525
* ```
26-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/dgram.js)
26+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dgram.js)
2727
*/
2828
declare module "dgram" {
2929
import { AddressInfo } from "node:net";

types/node/diagnostics_channel.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* should generally include the module name to avoid collisions with data from
2121
* other modules.
2222
* @since v15.1.0, v14.17.0
23-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/diagnostics_channel.js)
23+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/diagnostics_channel.js)
2424
*/
2525
declare module "diagnostics_channel" {
2626
import { AsyncLocalStorage } from "node:async_hooks";
@@ -419,6 +419,9 @@ declare module "diagnostics_channel" {
419419
* This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all
420420
* events should have any bound stores set to match this trace context.
421421
*
422+
* To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
423+
* which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
424+
*
422425
* ```js
423426
* import diagnostics_channel from 'node:diagnostics_channel';
424427
*
@@ -451,6 +454,9 @@ declare module "diagnostics_channel" {
451454
* returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all
452455
* events should have any bound stores set to match this trace context.
453456
*
457+
* To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
458+
* which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
459+
*
454460
* ```js
455461
* import diagnostics_channel from 'node:diagnostics_channel';
456462
*
@@ -502,6 +508,9 @@ declare module "diagnostics_channel" {
502508
* The callback will also be run with `channel.runStores(context, ...)` which
503509
* enables context loss recovery in some cases.
504510
*
511+
* To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions
512+
* which are added after the trace begins will not receive future events from that trace, only future traces will be seen.
513+
*
505514
* ```js
506515
* import diagnostics_channel from 'node:diagnostics_channel';
507516
* import { AsyncLocalStorage } from 'node:async_hooks';

types/node/dns.d.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* ```
4343
*
4444
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information.
45-
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/dns.js)
45+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dns.js)
4646
*/
4747
declare module "dns" {
4848
import * as dnsPromises from "node:dns/promises";
@@ -64,7 +64,7 @@ declare module "dns" {
6464
export const ALL: number;
6565
export interface LookupOptions {
6666
/**
67-
* The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted
67+
* The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted
6868
* as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used
6969
* with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned.
7070
* @default 0
@@ -80,9 +80,18 @@ declare module "dns" {
8080
* @default false
8181
*/
8282
all?: boolean | undefined;
83+
/**
84+
* When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
85+
* by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
86+
* addresses before IPv4 addresses. Default value is configurable using
87+
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
88+
* @default `verbatim` (addresses are not reordered)
89+
*/
90+
order?: "ipv4first" | "ipv6first" | "verbatim" | undefined;
8391
/**
8492
* When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4
85-
* addresses are placed before IPv6 addresses. Default value is configurable using {@link setDefaultResultOrder()}
93+
* addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified,
94+
* `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
8695
* or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
8796
* @default true (addresses are not reordered)
8897
*/
@@ -663,14 +672,15 @@ declare module "dns" {
663672
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
664673
): void;
665674
/**
666-
* Get the default value for `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
675+
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
667676
* The value could be:
668677
*
669-
* * `ipv4first`: for `verbatim` defaulting to `false`.
670-
* * `verbatim`: for `verbatim` defaulting to `true`.
678+
* * `ipv4first`: for `order` defaulting to `ipv4first`.
679+
* * `ipv6first`: for `order` defaulting to `ipv6first`.
680+
* * `verbatim`: for `order` defaulting to `verbatim`.
671681
* @since v18.17.0
672682
*/
673-
export function getDefaultResultOrder(): "ipv4first" | "verbatim";
683+
export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim";
674684
/**
675685
* Sets the IP address and port of servers to be used when performing DNS
676686
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
@@ -717,20 +727,21 @@ declare module "dns" {
717727
*/
718728
export function getServers(): string[];
719729
/**
720-
* Set the default value of `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
730+
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
721731
* The value could be:
722732
*
723-
* * `ipv4first`: sets default `verbatim` `false`.
724-
* * `verbatim`: sets default `verbatim` `true`.
733+
* * `ipv4first`: sets default `order` to `ipv4first`.
734+
* * `ipv6first`: sets default `order` to `ipv6first`.
735+
* * `verbatim`: sets default `order` to `verbatim`.
725736
*
726737
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
727738
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using
728739
* [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
729740
* thread won't affect the default dns orders in workers.
730741
* @since v16.4.0, v14.18.0
731-
* @param order must be `'ipv4first'` or `'verbatim'`.
742+
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
732743
*/
733-
export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
744+
export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
734745
// Error codes
735746
export const NODATA: "NODATA";
736747
export const FORMERR: "FORMERR";

0 commit comments

Comments
 (0)