*Update dist
This commit is contained in:
parent
2b747e72fa
commit
f60d29b95a
|
@ -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";
|
||||||
|
|
|
@ -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 };
|
||||||
|
|
|
@ -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 };
|
||||||
|
|
Loading…
Reference in New Issue