*Update dist

This commit is contained in:
Derrick Hammer 2022-08-20 02:57:45 -04:00
parent 90330d8dcd
commit 89a17b5ac8
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 6 additions and 4 deletions

4
dist/index.d.ts vendored
View File

@ -1,3 +1,3 @@
import type { ResolverModule } from "@lumeweb/resolver-common"; import type { ResolverModuleConstructor } from "@lumeweb/resolver-common";
export declare function setup(rm: ResolverModule): void; export declare function setup(rm: ResolverModuleConstructor): void;
export * from "./resolverRegistry.js"; export * from "./resolverRegistry.js";

4
dist/index.js vendored
View File

@ -1,12 +1,14 @@
import { addHandler, handleMessage } from "libkmodule"; import { addHandler, handleMessage } from "libkmodule";
import { register } from "@lumeweb/kernel-dns-client"; import { register } from "@lumeweb/kernel-dns-client";
import { RpcNetwork } from "@lumeweb/kernel-rpc-client";
import { ResolverRegistry } from "./resolverRegistry.js";
let resolver; 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); addHandler("getSupportedTlds", handleGetSupportedTlds);
onmessage = handleMessage; onmessage = handleMessage;
resolver = rm; resolver = new rm(new ResolverRegistry(new RpcNetwork()));
} }
async function handleRegister(aq) { async function handleRegister(aq) {
await register(); await register();

View File

@ -19,7 +19,7 @@ export class ResolverRegistry {
return new Set(resolvers.map((resolver) => new ResolverModule(this, resolver))); return new Set(resolvers.map((resolver) => new ResolverModule(this, resolver)));
}); });
} }
async resolve(domain, options = { type: DNS_RECORD_TYPE.DEFAULT }, bypassCache = false) { async resolve(domain, options = { type: DNS_RECORD_TYPE.CONTENT }, bypassCache = false) {
let result; let result;
try { try {
result = await resolve(domain, options, bypassCache); result = await resolve(domain, options, bypassCache);