*add registerResolver method

This commit is contained in:
Derrick Hammer 2023-04-09 14:15:40 -04:00
parent 7c3da38a15
commit 1e8924d5ac
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 15 additions and 6 deletions

View File

@ -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<void> {
return this.callModuleReturn("register");
}
public async clear(): Promise<void> {
return this.callModuleReturn("clear");
}
get resolvers(): Promise<Set<ResolverModule>> {
return this.callModuleReturn("getResolvers").then((resolvers: string[]) => {
return new Set(
@ -24,6 +18,21 @@ export class DnsClient extends Client {
);
});
}
public async register(): Promise<void> {
return this.callModuleReturn("register");
}
public async registerResolver(module: string): Promise<void> {
const bag = await this.loadBound(module);
const ret = await bag.callModule("register");
return ret[0];
}
public async clear(): Promise<void> {
return this.callModuleReturn("clear");
}
public async resolve(
domain: string,
options: ResolverOptions = { type: DNS_RECORD_TYPE.CONTENT },