*add registerResolver method
This commit is contained in:
parent
7c3da38a15
commit
1e8924d5ac
21
src/index.ts
21
src/index.ts
|
@ -9,12 +9,6 @@ import { createModule, ResolverModule } from "./module.js";
|
||||||
const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A";
|
const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A";
|
||||||
|
|
||||||
export class DnsClient extends Client {
|
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>> {
|
get resolvers(): Promise<Set<ResolverModule>> {
|
||||||
return this.callModuleReturn("getResolvers").then((resolvers: string[]) => {
|
return this.callModuleReturn("getResolvers").then((resolvers: string[]) => {
|
||||||
return new Set(
|
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(
|
public async resolve(
|
||||||
domain: string,
|
domain: string,
|
||||||
options: ResolverOptions = { type: DNS_RECORD_TYPE.CONTENT },
|
options: ResolverOptions = { type: DNS_RECORD_TYPE.CONTENT },
|
||||||
|
|
Loading…
Reference in New Issue