mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Merge pull request #26407 from r3nya/node-dns-lookup
[node] Add dns.lookupService method
This commit is contained in:
7
types/node/index.d.ts
vendored
7
types/node/index.d.ts
vendored
@@ -24,6 +24,7 @@
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -2540,6 +2541,12 @@ declare module "dns" {
|
||||
export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
|
||||
}
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export namespace lookupService {
|
||||
export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
||||
}
|
||||
|
||||
export interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
|
||||
@@ -3114,6 +3114,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
2
types/node/v4/index.d.ts
vendored
2
types/node/v4/index.d.ts
vendored
@@ -1450,6 +1450,8 @@ declare module "dns" {
|
||||
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
|
||||
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export interface MxRecord {
|
||||
priority: number;
|
||||
exchange: string;
|
||||
|
||||
@@ -1184,6 +1184,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
2
types/node/v6/index.d.ts
vendored
2
types/node/v6/index.d.ts
vendored
@@ -2062,6 +2062,8 @@ declare module "dns" {
|
||||
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
|
||||
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export interface MxRecord {
|
||||
priority: number;
|
||||
exchange: string;
|
||||
|
||||
@@ -2395,6 +2395,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
2
types/node/v7/index.d.ts
vendored
2
types/node/v7/index.d.ts
vendored
@@ -2105,6 +2105,8 @@ declare module "dns" {
|
||||
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
|
||||
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
|
||||
@@ -2386,6 +2386,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
7
types/node/v8/index.d.ts
vendored
7
types/node/v8/index.d.ts
vendored
@@ -21,6 +21,7 @@
|
||||
// Bruno Scheufler <https://github.com/brunoscheufler>
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
@@ -2444,6 +2445,12 @@ declare module "dns" {
|
||||
export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
|
||||
}
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export namespace lookupService {
|
||||
export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
||||
}
|
||||
|
||||
export interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
|
||||
@@ -3075,6 +3075,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
7
types/node/v9/index.d.ts
vendored
7
types/node/v9/index.d.ts
vendored
@@ -24,6 +24,7 @@
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -2525,6 +2526,12 @@ declare module "dns" {
|
||||
export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
|
||||
}
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export namespace lookupService {
|
||||
export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
||||
}
|
||||
|
||||
export interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
|
||||
@@ -3108,6 +3108,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user