2022-08-18 14:58:17 +00:00
|
|
|
import type { DNSResult, ResolverOptions } from "./types.js";
|
2022-08-19 19:45:08 +00:00
|
|
|
declare class ResolverRegistry {
|
2022-08-19 19:49:56 +00:00
|
|
|
get resolvers(): Set<ResolverModule>;
|
|
|
|
resolve(
|
|
|
|
domain: string,
|
|
|
|
options?: ResolverOptions,
|
|
|
|
bypassCache?: boolean
|
|
|
|
): Promise<DNSResult>;
|
|
|
|
register(resolver: ResolverModule): void;
|
|
|
|
clear(): void;
|
2022-08-19 19:45:08 +00:00
|
|
|
}
|
2022-08-20 06:49:08 +00:00
|
|
|
export interface ResolverModuleConstructor {
|
|
|
|
new (resolver: ResolverRegistry): any;
|
|
|
|
}
|
|
|
|
export interface ResolverModule extends ResolverModuleConstructor {
|
2022-08-19 19:49:56 +00:00
|
|
|
resolve(
|
|
|
|
domain: string,
|
|
|
|
options: ResolverOptions,
|
|
|
|
bypassCache: boolean
|
|
|
|
): Promise<DNSResult>;
|
|
|
|
getSupportedTlds(): string[];
|
2022-08-18 14:58:17 +00:00
|
|
|
}
|
2022-08-19 18:48:35 +00:00
|
|
|
export declare abstract class AbstractResolverModule {
|
2022-08-19 19:49:56 +00:00
|
|
|
protected resolver: ResolverRegistry;
|
|
|
|
constructor(resolver: ResolverRegistry);
|
|
|
|
abstract resolve(
|
|
|
|
domain: string,
|
|
|
|
options: ResolverOptions,
|
|
|
|
bypassCache: boolean
|
|
|
|
): Promise<DNSResult>;
|
|
|
|
getSupportedTlds(): string[];
|
|
|
|
isTldSupported(domain: string): boolean;
|
2022-08-18 14:58:17 +00:00
|
|
|
}
|
2022-08-19 19:45:08 +00:00
|
|
|
export {};
|
2022-08-19 19:49:56 +00:00
|
|
|
//# sourceMappingURL=resolverModule.d.ts.map
|