*Update dist

This commit is contained in:
Derrick Hammer 2022-08-19 11:21:13 -04:00
parent 2b747e72fa
commit f60d29b95a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 12 additions and 0 deletions

4
dist/index.js vendored
View File

@ -4,6 +4,7 @@ let resolver;
export function setup(rm) { export function setup(rm) {
addHandler("resolve", handleResolve); addHandler("resolve", handleResolve);
addHandler("register", handleRegister); addHandler("register", handleRegister);
addHandler("getSupportedTlds", handleGetSupportedTlds);
onmessage = handleMessage; onmessage = handleMessage;
resolver = rm; resolver = rm;
} }
@ -30,4 +31,7 @@ async function handleResolve(aq) {
} }
aq.respond(ret); aq.respond(ret);
} }
function handleGetSupportedTlds(aq) {
aq.respond(resolver.getSupportedTlds());
}
export * from "./resolverRegistry.js"; export * from "./resolverRegistry.js";

View File

@ -20,5 +20,6 @@ export declare class ResolverModule {
options: ResolverOptions, options: ResolverOptions,
bypassCache: boolean bypassCache: boolean
): Promise<DNSResult>; ): Promise<DNSResult>;
getSupportedTlds(): Promise<string[]>;
} }
export { RpcNetwork }; export { RpcNetwork };

View File

@ -48,5 +48,12 @@ export class ResolverModule {
} }
return ret; return ret;
} }
async getSupportedTlds() {
const [ret, err] = await callModule(this.domain, "getSupportedTlds");
if (err) {
throw new Error(err);
}
return ret;
}
} }
export { RpcNetwork }; export { RpcNetwork };