*Update dist
This commit is contained in:
parent
2bd13bb71b
commit
6f6a79599c
|
@ -1,6 +1,19 @@
|
||||||
import { ResolverModuleConstructor } from "./resolverRegistry.js";
|
import type { DNSResult } from "@lumeweb/libresolver";
|
||||||
export declare function setup(rm: ResolverModuleConstructor): void;
|
import { DnsClient } from "@lumeweb/kernel-dns-client";
|
||||||
export * from "./resolverRegistry.js";
|
import { ResolverOptions } from "@lumeweb/libresolver/src/types.js";
|
||||||
|
export interface ResolverModule {
|
||||||
|
get resolver(): DnsClient;
|
||||||
|
set resolver(value: DnsClient);
|
||||||
|
resolve(
|
||||||
|
domain: string,
|
||||||
|
options: ResolverOptions,
|
||||||
|
bypassCache: boolean
|
||||||
|
): Promise<DNSResult>;
|
||||||
|
getSupportedTlds(): string[];
|
||||||
|
getSupportedTlds(): Promise<string[]>;
|
||||||
|
getSupportedTlds(): any;
|
||||||
|
}
|
||||||
|
export declare function setup(rm: ResolverModule): void;
|
||||||
export * from "@lumeweb/libresolver/dist/util.js";
|
export * from "@lumeweb/libresolver/dist/util.js";
|
||||||
export * from "@lumeweb/libresolver/dist/types.js";
|
export * from "@lumeweb/libresolver/dist/types.js";
|
||||||
export { AbstractResolverModule } from "@lumeweb/libresolver/dist/resolverModule.js";
|
export { AbstractResolverModule } from "@lumeweb/libresolver/dist/resolverModule.js";
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { addHandler, handleMessage } from "libkmodule";
|
import { addHandler, handleMessage } from "libkmodule";
|
||||||
import { ResolverRegistry, } from "./resolverRegistry.js";
|
|
||||||
import { DNS_RECORD_TYPE } from "@lumeweb/libresolver";
|
import { DNS_RECORD_TYPE } from "@lumeweb/libresolver";
|
||||||
import { dnsClient } from "./client.js";
|
import { dnsClient } from "./client.js";
|
||||||
let resolver;
|
let resolver;
|
||||||
|
@ -8,7 +7,8 @@ export function setup(rm) {
|
||||||
addHandler("register", handleRegister);
|
addHandler("register", handleRegister);
|
||||||
addHandler("getSupportedTlds", handleGetSupportedTlds);
|
addHandler("getSupportedTlds", handleGetSupportedTlds);
|
||||||
onmessage = handleMessage;
|
onmessage = handleMessage;
|
||||||
resolver = new rm(new ResolverRegistry());
|
resolver = rm;
|
||||||
|
resolver.resolver = dnsClient;
|
||||||
}
|
}
|
||||||
async function handleRegister(aq) {
|
async function handleRegister(aq) {
|
||||||
await dnsClient.register();
|
await dnsClient.register();
|
||||||
|
@ -36,7 +36,6 @@ async function handleResolve(aq) {
|
||||||
function handleGetSupportedTlds(aq) {
|
function handleGetSupportedTlds(aq) {
|
||||||
aq.respond(resolver.getSupportedTlds());
|
aq.respond(resolver.getSupportedTlds());
|
||||||
}
|
}
|
||||||
export * from "./resolverRegistry.js";
|
|
||||||
export * from "@lumeweb/libresolver/dist/util.js";
|
export * from "@lumeweb/libresolver/dist/util.js";
|
||||||
export * from "@lumeweb/libresolver/dist/types.js";
|
export * from "@lumeweb/libresolver/dist/types.js";
|
||||||
export { AbstractResolverModule } from "@lumeweb/libresolver/dist/resolverModule.js";
|
export { AbstractResolverModule } from "@lumeweb/libresolver/dist/resolverModule.js";
|
||||||
|
|
Loading…
Reference in New Issue