libresolver/dist/resolverModule.d.ts

40 lines
1.2 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-20 01:00:58 +00:00
getSupportedTlds(): string[];
getSupportedTlds(): Promise<string[]>;
getSupportedTlds(): any;
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-20 01:00:58 +00:00
getSupportedTlds(): string[];
getSupportedTlds(): Promise<string[]>;
2023-02-19 23:20:17 +00:00
isTldSupported(domain: string): Promise<boolean>;
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