Compare commits
2 Commits
6f6a79599c
...
4642c10bf2
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 4642c10bf2 | |
Derrick Hammer | 69bb1f7c60 |
|
@ -1,4 +1,7 @@
|
|||
import type { DNSResult } from "@lumeweb/libresolver";
|
||||
import type {
|
||||
DNSResult,
|
||||
ResolverModule as ResolverModuleBase,
|
||||
} from "@lumeweb/libresolver";
|
||||
import { DnsClient } from "@lumeweb/kernel-dns-client";
|
||||
import { ResolverOptions } from "@lumeweb/libresolver/src/types.js";
|
||||
export interface ResolverModule {
|
||||
|
@ -13,7 +16,7 @@ export interface ResolverModule {
|
|||
getSupportedTlds(): Promise<string[]>;
|
||||
getSupportedTlds(): any;
|
||||
}
|
||||
export declare function setup(rm: ResolverModule): void;
|
||||
export declare function setup(rm: ResolverModule | ResolverModuleBase): void;
|
||||
export * from "@lumeweb/libresolver/dist/util.js";
|
||||
export * from "@lumeweb/libresolver/dist/types.js";
|
||||
export { AbstractResolverModule } from "@lumeweb/libresolver/dist/resolverModule.js";
|
||||
|
|
|
@ -8,6 +8,7 @@ export function setup(rm) {
|
|||
addHandler("getSupportedTlds", handleGetSupportedTlds);
|
||||
onmessage = handleMessage;
|
||||
resolver = rm;
|
||||
// @ts-ignore
|
||||
resolver.resolver = dnsClient;
|
||||
}
|
||||
async function handleRegister(aq) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { dnsClient } from "./client.js";
|
|||
import { DnsClient } from "@lumeweb/kernel-dns-client";
|
||||
import { ResolverOptions } from "@lumeweb/libresolver/src/types.js";
|
||||
|
||||
let resolver: ResolverModule;
|
||||
let resolver: ResolverModule | ResolverModuleBase;
|
||||
|
||||
export interface ResolverModule {
|
||||
get resolver(): DnsClient;
|
||||
|
@ -25,12 +25,13 @@ export interface ResolverModule {
|
|||
getSupportedTlds(): any;
|
||||
}
|
||||
|
||||
export function setup(rm: ResolverModule) {
|
||||
export function setup(rm: ResolverModule | ResolverModuleBase) {
|
||||
addHandler("resolve", handleResolve);
|
||||
addHandler("register", handleRegister);
|
||||
addHandler("getSupportedTlds", handleGetSupportedTlds);
|
||||
onmessage = handleMessage;
|
||||
resolver = rm;
|
||||
// @ts-ignore
|
||||
resolver.resolver = dnsClient;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue