*Update dist
This commit is contained in:
parent
2b747e72fa
commit
f60d29b95a
|
@ -4,6 +4,7 @@ let resolver;
|
|||
export function setup(rm) {
|
||||
addHandler("resolve", handleResolve);
|
||||
addHandler("register", handleRegister);
|
||||
addHandler("getSupportedTlds", handleGetSupportedTlds);
|
||||
onmessage = handleMessage;
|
||||
resolver = rm;
|
||||
}
|
||||
|
@ -30,4 +31,7 @@ async function handleResolve(aq) {
|
|||
}
|
||||
aq.respond(ret);
|
||||
}
|
||||
function handleGetSupportedTlds(aq) {
|
||||
aq.respond(resolver.getSupportedTlds());
|
||||
}
|
||||
export * from "./resolverRegistry.js";
|
||||
|
|
|
@ -20,5 +20,6 @@ export declare class ResolverModule {
|
|||
options: ResolverOptions,
|
||||
bypassCache: boolean
|
||||
): Promise<DNSResult>;
|
||||
getSupportedTlds(): Promise<string[]>;
|
||||
}
|
||||
export { RpcNetwork };
|
||||
|
|
|
@ -48,5 +48,12 @@ export class ResolverModule {
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
async getSupportedTlds() {
|
||||
const [ret, err] = await callModule(this.domain, "getSupportedTlds");
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
export { RpcNetwork };
|
||||
|
|
Loading…
Reference in New Issue