From 8be5af2f45087d10ae1ccf4d77c20a7a04d586ed Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 15 Jul 2023 04:29:02 -0400 Subject: [PATCH] feat: add ready method to AbstractResolverModule --- src/resolverModule.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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; }