smartdns/dist/index.d.ts

45 lines
1.3 KiB
TypeScript
Raw Normal View History

2016-11-15 20:39:21 +00:00
export declare type TDnsProvider = 'google';
export declare type TDnsRecordType = 'A' | 'AAAA' | 'CNAME' | 'PTR' | 'MX' | 'NAPTR' | 'NS' | 'SOA' | 'SRV' | 'TXT';
2017-01-26 23:11:13 +00:00
export interface IDnsRecord {
chunked?: string[];
name: string;
type: TDnsRecordType;
value: string;
}
2016-11-15 20:39:21 +00:00
/**
* class dnsly offers methods for working with dns from a dns provider like Google DNS
*/
export declare class Dnsly {
dnsServerIp: string;
dnsServerPort: number;
/**
* constructor for class dnsly
*/
2017-01-26 23:11:13 +00:00
constructor(dnsProviderArg?: TDnsProvider);
2016-11-15 20:39:21 +00:00
/**
* gets a record
*/
2017-01-26 23:11:13 +00:00
getRecord(recordNameArg: string, recordTypeArg: TDnsRecordType): Promise<IDnsRecord[]>;
checkUntilAvailable(recordNameArg: string, recordTypeArg: TDnsRecordType, expectedValue: string): Promise<any>;
/**
* get A Dns Record
*/
getRecordA(recordNameArg: string): Promise<IDnsRecord[]>;
/**
* get AAAA Record
*/
getRecordAAAA(recordNameArg: string): Promise<IDnsRecord[]>;
/**
* gets a txt record
*/
getRecordTxt(recordNameArg: string): Promise<IDnsRecord[]>;
/**
* get oridinary record
*/
private getOrdinaryRecord(recordNameArg, recordTypeArg);
2016-11-15 20:39:21 +00:00
/**
* set the DNS provider
*/
private _setDnsProvider(dnsProvider);
}