2022-08-18 14:58:17 +00:00
|
|
|
import type { DNSResult, ResolverOptions } from "./types.js";
|
2022-08-19 19:49:56 +00:00
|
|
|
import type { RpcNetwork } from "@lumeweb/dht-rpc-client";
|
2022-08-19 19:45:08 +00:00
|
|
|
declare class ResolverRegistry {
|
2022-08-19 19:49:56 +00:00
|
|
|
private _resolvers;
|
|
|
|
private _rpcNetwork;
|
|
|
|
constructor(network?: RpcNetwork);
|
|
|
|
get resolvers(): Set<ResolverModule>;
|
|
|
|
get rpcNetwork(): RpcNetwork;
|
|
|
|
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-18 15:01:28 +00:00
|
|
|
export interface ResolverModule {
|
2022-08-19 19:49:56 +00:00
|
|
|
constructor(resolver: ResolverRegistry): any;
|
|
|
|
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
|