diff --git a/src/resolverModule.ts b/src/resolverModule.ts index c61648e..b6ac91e 100644 --- a/src/resolverModule.ts +++ b/src/resolverModule.ts @@ -3,26 +3,33 @@ import { getTld, isPromise } from "./util.js"; declare class ResolverRegistry { get resolvers(): Set | Promise>; + resolve( domain: string, options?: ResolverOptions, - bypassCache?: boolean + bypassCache?: boolean, ): Promise; + register(resolver: ResolverModule): void; + clear(): void; } export interface ResolverModule { get resolver(): ResolverRegistry; + set resolver(value: ResolverRegistry); + resolve( domain: string, options: ResolverOptions, - bypassCache: boolean + bypassCache: boolean, ): Promise; getSupportedTlds(): string[]; + getSupportedTlds(): Promise; + getSupportedTlds(): any; } @@ -45,7 +52,7 @@ export abstract class AbstractResolverModule { abstract resolve( domain: string, options: ResolverOptions, - bypassCache: boolean + bypassCache: boolean, ): Promise; getSupportedTlds(): string[]; @@ -66,4 +73,6 @@ export abstract class AbstractResolverModule { return (supported as string[]).includes(getTld(domain)); } + + abstract ready(): Promise; }