libresolver/dist/resolverModule.d.ts

26 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
import { RpcNetwork } from "@lumeweb/dht-rpc-client";
declare class ResolverRegistry {
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-18 15:01:28 +00:00
export interface ResolverModule {
2022-08-19 19:45:08 +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:45:08 +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 {};
//# sourceMappingURL=resolverModule.d.ts.map