diff --git a/src/index.ts b/src/index.ts index 01a2dbe..0d510e0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,12 +9,6 @@ import { createModule, ResolverModule } from "./module.js"; const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A"; export class DnsClient extends Client { - public async register(): Promise { - return this.callModuleReturn("register"); - } - public async clear(): Promise { - return this.callModuleReturn("clear"); - } get resolvers(): Promise> { return this.callModuleReturn("getResolvers").then((resolvers: string[]) => { return new Set( @@ -24,6 +18,21 @@ export class DnsClient extends Client { ); }); } + + public async register(): Promise { + return this.callModuleReturn("register"); + } + + public async registerResolver(module: string): Promise { + const bag = await this.loadBound(module); + const ret = await bag.callModule("register"); + return ret[0]; + } + + public async clear(): Promise { + return this.callModuleReturn("clear"); + } + public async resolve( domain: string, options: ResolverOptions = { type: DNS_RECORD_TYPE.CONTENT },