*Change types so setup doesnt throw an error

*ts-ignore setting resolver
This commit is contained in:
Derrick Hammer 2023-02-19 21:12:57 -05:00
parent 6f6a79599c
commit 69bb1f7c60
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}