libresolver/dist/resolverModule.d.ts

36 lines
1.1 KiB
TypeScript
Raw Normal View History

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 {
2023-02-19 22:47:50 +00:00
get resolvers(): Set<ResolverModule> | Promise<Set<ResolverModule>>;
2022-08-19 19:49:56 +00:00
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>;
2023-02-19 23:03:47 +00:00
getSupportedTlds(): string[] | Promise<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>;
2023-02-19 23:03:47 +00:00
getSupportedTlds(): string[] | Promise<string[]>;
isTldSupported(domain: string): boolean | Promise<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