@types/node
Advanced tools
Comparing version 20.11.28 to 20.11.29
@@ -44,4 +44,4 @@ /** | ||
* | ||
* See the `Implementation considerations section` for more information. | ||
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js) | ||
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information. | ||
* @see [source](https://github.com/nodejs/node/blob/v20.11.1/lib/dns.js) | ||
*/ | ||
@@ -51,3 +51,11 @@ declare module "dns" { | ||
// Supported getaddrinfo flags. | ||
/** | ||
* Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are | ||
* only returned if the current system has at least one IPv4 address configured. | ||
*/ | ||
export const ADDRCONFIG: number; | ||
/** | ||
* If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported | ||
* on some operating systems (e.g. FreeBSD 10.1). | ||
*/ | ||
export const V4MAPPED: number; | ||
@@ -60,7 +68,24 @@ /** | ||
export interface LookupOptions { | ||
family?: number | undefined; | ||
/** | ||
* The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted | ||
* as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used | ||
* with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned. | ||
* @default 0 | ||
*/ | ||
family?: number | "IPv4" | "IPv6" | undefined; | ||
/** | ||
* One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v20.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be | ||
* passed by bitwise `OR`ing their values. | ||
*/ | ||
hints?: number | undefined; | ||
/** | ||
* When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. | ||
* @default false | ||
*/ | ||
all?: boolean | undefined; | ||
/** | ||
* @default true | ||
* When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 | ||
* addresses are placed before IPv6 addresses. Default value is configurable using {@link setDefaultResultOrder()} | ||
* or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). | ||
* @default true (addresses are not reordered) | ||
*/ | ||
@@ -76,3 +101,10 @@ verbatim?: boolean | undefined; | ||
export interface LookupAddress { | ||
/** | ||
* A string representation of an IPv4 or IPv6 address. | ||
*/ | ||
address: string; | ||
/** | ||
* `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a | ||
* bug in the name resolution service used by the operating system. | ||
*/ | ||
family: number; | ||
@@ -86,3 +118,3 @@ } | ||
* | ||
* With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the | ||
* With the `all` option set to `true`, the arguments for `callback` change to `(err, addresses)`, with `addresses` being an array of objects with the | ||
* properties `address` and `family`. | ||
@@ -99,3 +131,4 @@ * | ||
* important consequences on the behavior of any Node.js program. Please take some | ||
* time to consult the `Implementation considerations section` before using`dns.lookup()`. | ||
* time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) | ||
* before using `dns.lookup()`. | ||
* | ||
@@ -121,3 +154,4 @@ * Example usage: | ||
* | ||
* If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. | ||
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v20.x/api/util.html#utilpromisifyoriginal) ed | ||
* version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties. | ||
* @since v0.1.90 | ||
@@ -159,5 +193,6 @@ */ | ||
* If `address` is not a valid IP address, a `TypeError` will be thrown. | ||
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. | ||
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. | ||
* | ||
* On an error, `err` is an `Error` object, where `err.code` is the error code. | ||
* On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, | ||
* where `err.code` is the error code. | ||
* | ||
@@ -172,3 +207,4 @@ * ```js | ||
* | ||
* If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. | ||
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v20.x/api/util.html#utilpromisifyoriginal) ed | ||
* version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. | ||
* @since v0.11.14 | ||
@@ -284,3 +320,3 @@ */ | ||
* Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array | ||
* of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource | ||
* of the resource records. The `callback` function has arguments `(err, records)`. When successful, `records` will be an array of resource | ||
* records. The type and structure of individual results varies based on `rrtype`: | ||
@@ -290,3 +326,4 @@ * | ||
* | ||
* On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. | ||
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, | ||
* where `err.code` is one of the `DNS error codes`. | ||
* @since v0.1.27 | ||
@@ -377,3 +414,3 @@ * @param hostname Host name to resolve. | ||
/** | ||
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function | ||
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function | ||
* will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). | ||
@@ -403,3 +440,3 @@ * @since v0.1.16 | ||
/** | ||
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function | ||
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function | ||
* will contain an array of IPv6 addresses. | ||
@@ -429,4 +466,4 @@ * @since v0.1.16 | ||
/** | ||
* Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function | ||
* will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). | ||
* Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The `addresses` argument passed to the `callback` function | ||
* will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). | ||
* @since v0.3.2 | ||
@@ -442,3 +479,3 @@ */ | ||
/** | ||
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function | ||
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. The `addresses` argument passed to the `callback` function | ||
* will contain an array of certification authority authorization records | ||
@@ -456,4 +493,4 @@ * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). | ||
/** | ||
* Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will | ||
* contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). | ||
* Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. The `addresses` argument passed to the `callback` function will | ||
* contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). | ||
* @since v0.1.27 | ||
@@ -469,3 +506,3 @@ */ | ||
/** | ||
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of | ||
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of | ||
* objects with the following properties: | ||
@@ -500,4 +537,4 @@ * | ||
/** | ||
* Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will | ||
* contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). | ||
* Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. The `addresses` argument passed to the `callback` function will | ||
* contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). | ||
* @since v0.1.90 | ||
@@ -513,3 +550,3 @@ */ | ||
/** | ||
* Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will | ||
* Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will | ||
* be an array of strings containing the reply records. | ||
@@ -559,3 +596,3 @@ * @since v6.0.0 | ||
/** | ||
* Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will | ||
* Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. The `addresses` argument passed to the `callback` function will | ||
* be an array of objects with the following properties: | ||
@@ -586,3 +623,3 @@ * | ||
/** | ||
* Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a | ||
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a | ||
* two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of | ||
@@ -627,4 +664,4 @@ * one record. Depending on the use case, these could be either joined together or | ||
* | ||
* 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 [RFC | ||
* 8482](https://tools.ietf.org/html/rfc8482). | ||
* 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 | ||
* [RFC 8482](https://tools.ietf.org/html/rfc8482). | ||
*/ | ||
@@ -642,4 +679,4 @@ export function resolveAny( | ||
* | ||
* On error, `err` is an `Error` object, where `err.code` is | ||
* one of the `DNS error codes`. | ||
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is | ||
* one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). | ||
* @since v0.1.16 | ||
@@ -652,7 +689,8 @@ */ | ||
/** | ||
* Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: | ||
* Get the default value for `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). | ||
* The value could be: | ||
* | ||
* * `ipv4first`: for `verbatim` defaulting to `false`. | ||
* * `verbatim`: for `verbatim` defaulting to `true`. | ||
* @since v20.1.0 | ||
* @since v18.17.0 | ||
*/ | ||
@@ -679,10 +717,10 @@ export function getDefaultResultOrder(): "ipv4first" | "verbatim"; | ||
* | ||
* The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). | ||
* The {@link setServers} method affects only {@link resolve}, `dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). | ||
* | ||
* This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). | ||
* That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with | ||
* That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with | ||
* subsequent servers provided. Fallback DNS servers will only be used if the | ||
* earlier ones time out or result in some other error. | ||
* @since v0.11.3 | ||
* @param servers array of `RFC 5952` formatted addresses | ||
* @param servers array of [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952#section-6) formatted addresses | ||
*/ | ||
@@ -707,3 +745,4 @@ export function setServers(servers: readonly string[]): void; | ||
/** | ||
* Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: | ||
* Set the default value of `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). | ||
* The value could be: | ||
* | ||
@@ -714,4 +753,5 @@ * * `ipv4first`: sets default `verbatim` `false`. | ||
* The default is `verbatim` and {@link setDefaultResultOrder} have higher | ||
* priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default | ||
* dns orders in workers. | ||
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using | ||
* [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main | ||
* thread won't affect the default dns orders in workers. | ||
* @since v16.4.0, v14.18.0 | ||
@@ -722,29 +762,33 @@ * @param order must be `'ipv4first'` or `'verbatim'`. | ||
// Error codes | ||
export const NODATA: string; | ||
export const FORMERR: string; | ||
export const SERVFAIL: string; | ||
export const NOTFOUND: string; | ||
export const NOTIMP: string; | ||
export const REFUSED: string; | ||
export const BADQUERY: string; | ||
export const BADNAME: string; | ||
export const BADFAMILY: string; | ||
export const BADRESP: string; | ||
export const CONNREFUSED: string; | ||
export const TIMEOUT: string; | ||
export const EOF: string; | ||
export const FILE: string; | ||
export const NOMEM: string; | ||
export const DESTRUCTION: string; | ||
export const BADSTR: string; | ||
export const BADFLAGS: string; | ||
export const NONAME: string; | ||
export const BADHINTS: string; | ||
export const NOTINITIALIZED: string; | ||
export const LOADIPHLPAPI: string; | ||
export const ADDRGETNETWORKPARAMS: string; | ||
export const CANCELLED: string; | ||
export const NODATA: "NODATA"; | ||
export const FORMERR: "FORMERR"; | ||
export const SERVFAIL: "SERVFAIL"; | ||
export const NOTFOUND: "NOTFOUND"; | ||
export const NOTIMP: "NOTIMP"; | ||
export const REFUSED: "REFUSED"; | ||
export const BADQUERY: "BADQUERY"; | ||
export const BADNAME: "BADNAME"; | ||
export const BADFAMILY: "BADFAMILY"; | ||
export const BADRESP: "BADRESP"; | ||
export const CONNREFUSED: "TIMEOUT"; | ||
export const TIMEOUT: "TIMEOUT"; | ||
export const EOF: "EOF"; | ||
export const FILE: "FILE"; | ||
export const NOMEM: "NOMEM"; | ||
export const DESTRUCTION: "DESTRUCTION"; | ||
export const BADSTR: "BADSTR"; | ||
export const BADFLAGS: "BADFLAGS"; | ||
export const NONAME: "NONAME"; | ||
export const BADHINTS: "BADHINTS"; | ||
export const NOTINITIALIZED: "NOTINITIALIZED"; | ||
export const LOADIPHLPAPI: "LOADIPHLPAPI"; | ||
export const ADDRGETNETWORKPARAMS: "ADDRGETNETWORKPARAMS"; | ||
export const CANCELLED: "CANCELLED"; | ||
export interface ResolverOptions { | ||
/** | ||
* Query timeout in milliseconds, or `-1` to use the default timeout. | ||
*/ | ||
timeout?: number | undefined; | ||
/** | ||
* The number of tries the resolver will try contacting each name server before giving up. | ||
* @default 4 | ||
@@ -758,3 +802,3 @@ */ | ||
* Creating a new resolver uses the default server settings. Setting | ||
* the servers used for a resolver using `resolver.setServers()` does not affect | ||
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnssetserversservers) does not affect | ||
* other resolvers: | ||
@@ -761,0 +805,0 @@ * |
@@ -46,5 +46,5 @@ /** | ||
* | ||
* With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. | ||
* With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`. | ||
* | ||
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. | ||
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. | ||
* Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when | ||
@@ -54,7 +54,7 @@ * the host name does not exist but also when the lookup fails in other ways | ||
* | ||
* `dnsPromises.lookup()` does not necessarily have anything to do with the DNS | ||
* [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS | ||
* protocol. The implementation uses an operating system facility that can | ||
* associate names with addresses and vice versa. This implementation can have | ||
* subtle but important consequences on the behavior of any Node.js program. Please | ||
* take some time to consult the `Implementation considerations section` before | ||
* take some time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) before | ||
* using `dnsPromises.lookup()`. | ||
@@ -96,5 +96,5 @@ * | ||
* If `address` is not a valid IP address, a `TypeError` will be thrown. | ||
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. | ||
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. | ||
* | ||
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. | ||
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. | ||
* | ||
@@ -125,3 +125,4 @@ * ```js | ||
* | ||
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. | ||
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` | ||
* is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). | ||
* @since v10.6.0 | ||
@@ -149,3 +150,3 @@ * @param hostname Host name to resolve. | ||
/** | ||
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 | ||
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4 | ||
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). | ||
@@ -159,3 +160,3 @@ * @since v10.6.0 | ||
/** | ||
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 | ||
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6 | ||
* addresses. | ||
@@ -200,3 +201,3 @@ * @since v10.6.0 | ||
* the `Promise` is resolved with an array of objects containing available | ||
* certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). | ||
* certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). | ||
* @since v15.0.0, v14.17.0 | ||
@@ -213,3 +214,3 @@ */ | ||
/** | ||
* Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects | ||
* Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects | ||
* containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). | ||
@@ -220,3 +221,3 @@ * @since v10.6.0 | ||
/** | ||
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array | ||
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array | ||
* of objects with the following properties: | ||
@@ -245,3 +246,3 @@ * | ||
/** | ||
* Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server | ||
* Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server | ||
* records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). | ||
@@ -252,3 +253,3 @@ * @since v10.6.0 | ||
/** | ||
* Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings | ||
* Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings | ||
* containing the reply records. | ||
@@ -286,3 +287,3 @@ * @since v10.6.0 | ||
/** | ||
* Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with | ||
* Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with | ||
* the following properties: | ||
@@ -307,3 +308,3 @@ * | ||
/** | ||
* Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array | ||
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array | ||
* of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of | ||
@@ -319,3 +320,4 @@ * one record. Depending on the use case, these could be either joined together or | ||
* | ||
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. | ||
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` | ||
* is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). | ||
* @since v10.6.0 | ||
@@ -325,3 +327,4 @@ */ | ||
/** | ||
* Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: | ||
* Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). | ||
* The value could be: | ||
* | ||
@@ -366,5 +369,6 @@ * * `ipv4first`: for `verbatim` defaulting to `false`. | ||
* | ||
* The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have | ||
* higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the | ||
* default dns orders in workers. | ||
* The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) | ||
* have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). | ||
* When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) | ||
* from the main thread won't affect the default dns orders in workers. | ||
* @since v16.4.0, v14.18.0 | ||
@@ -374,2 +378,26 @@ * @param order must be `'ipv4first'` or `'verbatim'`. | ||
function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void; | ||
const NODATA: "NODATA"; | ||
const FORMERR: "FORMERR"; | ||
const SERVFAIL: "SERVFAIL"; | ||
const NOTFOUND: "NOTFOUND"; | ||
const NOTIMP: "NOTIMP"; | ||
const REFUSED: "REFUSED"; | ||
const BADQUERY: "BADQUERY"; | ||
const BADNAME: "BADNAME"; | ||
const BADFAMILY: "BADFAMILY"; | ||
const BADRESP: "BADRESP"; | ||
const CONNREFUSED: "TIMEOUT"; | ||
const TIMEOUT: "TIMEOUT"; | ||
const EOF: "EOF"; | ||
const FILE: "FILE"; | ||
const NOMEM: "NOMEM"; | ||
const DESTRUCTION: "DESTRUCTION"; | ||
const BADSTR: "BADSTR"; | ||
const BADFLAGS: "BADFLAGS"; | ||
const NONAME: "NONAME"; | ||
const BADHINTS: "BADHINTS"; | ||
const NOTINITIALIZED: "NOTINITIALIZED"; | ||
const LOADIPHLPAPI: "LOADIPHLPAPI"; | ||
const ADDRGETNETWORKPARAMS: "ADDRGETNETWORKPARAMS"; | ||
const CANCELLED: "CANCELLED"; | ||
/** | ||
@@ -379,3 +407,3 @@ * An independent resolver for DNS requests. | ||
* Creating a new resolver uses the default server settings. Setting | ||
* the servers used for a resolver using `resolver.setServers()` does not affect | ||
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetserversservers) does not affect | ||
* other resolvers: | ||
@@ -421,2 +449,7 @@ * | ||
constructor(options?: ResolverOptions); | ||
/** | ||
* Cancel all outstanding DNS queries made by this resolver. The corresponding | ||
* callbacks will be called with an error with code `ECANCELLED`. | ||
* @since v8.3.0 | ||
*/ | ||
cancel(): void; | ||
@@ -438,2 +471,17 @@ getServers: typeof getServers; | ||
reverse: typeof reverse; | ||
/** | ||
* The resolver instance will send its requests from the specified IP address. | ||
* This allows programs to specify outbound interfaces when used on multi-homed | ||
* systems. | ||
* | ||
* If a v4 or v6 address is not specified, it is set to the default and the | ||
* operating system will choose a local address automatically. | ||
* | ||
* The resolver will use the v4 local address when making requests to IPv4 DNS | ||
* servers, and the v6 local address when making requests to IPv6 DNS servers. | ||
* The `rrtype` of resolution requests has no impact on the local address used. | ||
* @since v15.1.0, v14.17.0 | ||
* @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. | ||
* @param [ipv6='::0'] A string representation of an IPv6 address. | ||
*/ | ||
setLocalAddress(ipv4?: string, ipv6?: string): void; | ||
@@ -440,0 +488,0 @@ setServers: typeof setServers; |
{ | ||
"name": "@types/node", | ||
"version": "20.11.28", | ||
"version": "20.11.29", | ||
"description": "TypeScript definitions for node", | ||
@@ -215,4 +215,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", | ||
}, | ||
"typesPublisherContentHash": "7900e0785e353d745686ab0f8c416d180dda643bd51b6a43e09c772a1d845f55", | ||
"typesPublisherContentHash": "601e89c10ccbef86517c0e5c93b1ded9d6c14a61a4f2ddfde003e0eac55e8f2f", | ||
"typeScriptVersion": "4.7" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 15 Mar 2024 07:35:57 GMT | ||
* Last updated: Mon, 18 Mar 2024 19:35:28 GMT | ||
* Dependencies: [undici-types](https://npmjs.com/package/undici-types) | ||
@@ -14,0 +14,0 @@ |
2012072
45293
44
292