-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.d.ts
39 lines (35 loc) · 946 Bytes
/
index.d.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
export interface TldData {
tld: string;
tldUpdated: number;
tldCreated: number;
whoisServer: string[];
registry: string | false;
version: number;
sampleDomains: any;
type: string;
isIDN: boolean;
rdapServers: string[];
rdapUpdated: number;
ianaUrl: string;
[key: string]: any
}
export interface DomainParseResult {
hostname: string;
tldData: TldData | false;
domain: string;
tld: string;
}
/**
* Returns object of TLD or false if TLD is not known.
* @param tld The TLD to get details for.
*/
export function tldDetails(tld: string): TldData | false;
/**
* Returns all TLDs as iteration JSON object or false in case of error.
*/
export function tlds(): { [key: string]: TldData } | false;
/**
* Parses the given hostname and returns details about it.
* @param hostname The hostname to parse.
*/
export function parseDomain(hostname: string): DomainParseResult | null;