UNPKG

fetch-dns

Version:

A drop-in replacement of Node's 'dns' module using 'fetch' and DNS-over-HTTPS

38 lines 1.44 kB
import { Record } from "./Record"; interface HasIsEmpty { isEmpty(): boolean; } interface RecordEntry<T extends Record.recordtype.Any> { record: Record.Typed<T>; ttl: number; } declare class RecordCache<T extends Record.recordtype.Any> implements HasIsEmpty { private readonly _records; private readonly _setAt; private readonly _setPit; constructor(records: RecordEntry<T>[]); _listenForClean(): void; get records(): RecordEntry<T>[]; private clean; isEmpty(): boolean; } declare class ResultCache implements HasIsEmpty { private readonly _mapping; private readonly _subdomains; constructor(); _listenForClean(): void; isEmpty(): boolean; private clean; getRecordCache<T extends Record.recordtype.Any>(rrtype: T): RecordCache<T> | false; getSubdomain(sub: string): ResultCache; private setRecordCache; setResult<T extends Record.recordtype.Any>(domainParts: string[], rrtype: T, records: RecordEntry<T>[]): void; getResult<T extends Record.recordtype.Any>(domainParts: string[], rrtype: T): Record.Typed<T>[] | false; } declare const _default: { readonly root: ResultCache; put<T extends Record.recordtype.Any>(hostname: string, rrtype: T, records: RecordEntry<T>[]): void; check<T_1 extends Record.recordtype.Any>(hostname: string, rrtype: T_1): false | Record.Typed<T_1>[]; }; export default _default; //# sourceMappingURL=Cache.d.ts.map