diff options
author | 2023-10-02 14:11:47 -0700 | |
---|---|---|
committer | 2023-10-02 14:11:55 -0700 | |
commit | 0c3c57cc35503d90768620fa8ec2c4d1ad5cca52 (patch) | |
tree | 37520d1977f8c0bbfb638427be3aec83e9dd2bb4 | |
parent | 237a5ada4750ff255781d91e004e5e9570f031a2 (diff) | |
download | bun-0c3c57cc35503d90768620fa8ec2c4d1ad5cca52.tar.gz bun-0c3c57cc35503d90768620fa8ec2c4d1ad5cca52.tar.zst bun-0c3c57cc35503d90768620fa8ec2c4d1ad5cca52.zip |
Add dns.reverse and dns.getServers to types
-rw-r--r-- | packages/bun-types/dns.d.ts | 14 | ||||
-rw-r--r-- | packages/bun-types/tests/dns.test-d.ts | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/packages/bun-types/dns.d.ts b/packages/bun-types/dns.d.ts index 247227fc2..8eee83361 100644 --- a/packages/bun-types/dns.d.ts +++ b/packages/bun-types/dns.d.ts @@ -701,10 +701,10 @@ declare module "dns" { * one of the `DNS error codes`. * @since v0.1.16 */ - // export function reverse( - // ip: string, - // callback: (err: ErrnoException | null, hostnames: string[]) => void, - // ): void; + export function reverse( + ip: string, + callback: (err: ErrnoException | null, hostnames: string[]) => void, + ): void; /** * Sets the IP address and port of servers to be used when performing DNS * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted @@ -749,7 +749,7 @@ declare module "dns" { * ``` * @since v0.11.3 */ - // export function getServers(): string[]; + export function getServers(): string[]; /** * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: * @@ -841,7 +841,7 @@ declare module "dns" { * @since v8.3.0 */ cancel(): void; - // getServers: typeof getServers; + getServers: typeof getServers; resolve: typeof resolve; resolve4: typeof resolve4; resolve6: typeof resolve6; @@ -854,7 +854,7 @@ declare module "dns" { resolveSoa: typeof resolveSoa; resolveSrv: typeof resolveSrv; resolveTxt: typeof resolveTxt; - // reverse: typeof reverse; + 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 diff --git a/packages/bun-types/tests/dns.test-d.ts b/packages/bun-types/tests/dns.test-d.ts new file mode 100644 index 000000000..3f701f346 --- /dev/null +++ b/packages/bun-types/tests/dns.test-d.ts @@ -0,0 +1,5 @@ +import * as dns from "node:dns"; + +dns.resolve("asdf", "A", () => {}); +dns.reverse("asdf", () => {}); +dns.getServers(); |