-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
69 lines (60 loc) · 1.19 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
export interface Server {
host: string;
port?: number;
punycode?: boolean;
query?: string;
}
export interface Proxy {
ipaddress: string;
port: number;
type?: number;
}
export interface LookupOptions {
/**
* Even if we find data before a failed follow, the entire lookup will fail.
*
* @default false
*/
strictFollow?: boolean;
follow?: number;
timeout?: number;
server?: Server;
proxy?: Proxy;
encoding?: BufferEncoding;
punycode?: boolean;
bind?: string;
verbose?: boolean;
}
export interface LookupResult {
server: string;
data: string;
}
interface WithServer {
serverUrl: URL;
serverConfig: Server;
}
interface WithProxy {
proxyUrl: URL;
proxyConfig?: Proxy;
}
export interface LookupConfig extends WithServer, Partial<WithProxy> {
addr: string;
options?: LookupOptions;
}
export interface LookupConfigWithProxy
extends Omit<LookupConfig, keyof WithProxy>,
WithProxy {}
export interface IpLocation {
address: string;
city: string;
region: string;
postalCode: string;
country: string;
}
export enum WhoisKey {
Address = "address",
City = "city",
Region = "stateprov",
PostalCode = "postalcode",
Country = "country",
}