diff --git a/index.d.ts b/index.d.ts index 9d464d1..182fbf7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,5 @@ declare module 'whoiser' { - interface Options { + export interface Options { /** * WHOIS server to query. */ @@ -39,14 +39,14 @@ declare module 'whoiser' { querySuffix?: string } - type OptionsIp = Pick - type OptionsAsn = OptionsIp - type OptionsQuery = Omit - type OptionsTld = Pick - type OptionsDomain = Omit - type OptionsGeneric = OptionsIp | OptionsTld | OptionsDomain + export type OptionsIp = Pick + export type OptionsAsn = OptionsIp + export type OptionsQuery = Omit + export type OptionsTld = Pick + export type OptionsDomain = Omit + export type OptionsGeneric = OptionsIp | OptionsTld | OptionsDomain - interface WhoisSearchResult { + export interface WhoisSearchResult { [key: string]: string | Array | WhoisSearchResult } @@ -56,7 +56,7 @@ declare module 'whoiser' { * * @returns {Promise} */ - function allTlds(): Promise + export function allTlds(): Promise /** * Get WHOIS data for an AS number @@ -65,7 +65,7 @@ declare module 'whoiser' { * @param {OptionsAsn} options * @returns {Promise} Parsed WHOIS server response */ - function asn(asn: string | number, options?: OptionsAsn): Promise + export function asn(asn: string | number, options?: OptionsAsn): Promise /** * Get parsed WHOIS data for a domain @@ -74,7 +74,7 @@ declare module 'whoiser' { * @param {OptionsDomain} options * @returns {Promise} Parsed WHOIS server response */ - function domain(domain: string, options?: OptionsDomain): Promise + export function domain(domain: string, options?: OptionsDomain): Promise /** * Get WHOIS data for a IP @@ -83,7 +83,7 @@ declare module 'whoiser' { * @param {OptionsIp} options * @returns {Promise} Parsed WHOIS server response */ - function ip(ip: string, options?: OptionsIp): Promise + export function ip(ip: string, options?: OptionsIp): Promise /** * Query a WHOIS server for data @@ -91,7 +91,7 @@ declare module 'whoiser' { * @param {OptionsQuery} options * @returns {Promise} Raw WHOIS server response */ - function query(options: OptionsQuery): Promise + export function query(options: OptionsQuery): Promise /** * Get WHOIS data for a TLD @@ -100,7 +100,7 @@ declare module 'whoiser' { * @param {OptionsTld} options * @returns {Promise} Parsed WHOIS server response */ - function tld(tld: string, options?: OptionsTld): Promise + export function tld(tld: string, options?: OptionsTld): Promise /** * Tries to guess query type and get WHOIS data @@ -109,7 +109,7 @@ declare module 'whoiser' { * @param {Options} options * @returns {Promise} Parsed WHOIS server response */ - function whoiser(query: string, options?: OptionsGeneric): Promise + export function whoiser(query: string, options?: OptionsGeneric): Promise - export = whoiser + export default whoiser }