mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Missing definitions in module "dns"
Add loads of `Any*Record` blocks to fill it in as well. Missing definition for `dns.resolveAny` and `dns.resolve(domain, 'ANY')` in `@types/node`
This commit is contained in:
Vendored
+23
@@ -25,6 +25,7 @@
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Zane Hannan AU <https://github.com/ZaneHannanAU>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -2560,10 +2561,18 @@ declare module "dns" {
|
||||
ttl: number;
|
||||
}
|
||||
|
||||
export interface AnyRecordWithTtl extends RecordWithTtl {
|
||||
type: "A" | "AAAA";
|
||||
}
|
||||
|
||||
export interface MxRecord {
|
||||
priority: number;
|
||||
exchange: string;
|
||||
}
|
||||
|
||||
export interface AnyMxRecord extends MxRecord {
|
||||
type: "MX";
|
||||
}
|
||||
|
||||
export interface NaptrRecord {
|
||||
flags: string;
|
||||
@@ -2574,6 +2583,10 @@ declare module "dns" {
|
||||
preference: number;
|
||||
}
|
||||
|
||||
export interface AnyNaptrRecord extends NaptrRecord {
|
||||
type: "NAPTR"
|
||||
}
|
||||
|
||||
export interface SoaRecord {
|
||||
nsname: string;
|
||||
hostmaster: string;
|
||||
@@ -2584,6 +2597,10 @@ declare module "dns" {
|
||||
minttl: number;
|
||||
}
|
||||
|
||||
export interface AnySoaRecord extends SoaRecord {
|
||||
type: "SOA";
|
||||
}
|
||||
|
||||
export interface SrvRecord {
|
||||
priority: number;
|
||||
weight: number;
|
||||
@@ -2591,9 +2608,14 @@ declare module "dns" {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AnySrvRecord extends SrvRecord {
|
||||
type: "SRV";
|
||||
}
|
||||
|
||||
export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord>) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
|
||||
@@ -2637,6 +2659,7 @@ declare module "dns" {
|
||||
export function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||
}
|
||||
|
||||
export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord>) => void): void;
|
||||
export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
|
||||
export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
|
||||
|
||||
Reference in New Issue
Block a user