*Change types so setup doesnt throw an error
*ts-ignore setting resolver
This commit is contained in:
parent
6f6a79599c
commit
69bb1f7c60
|
@ -9,7 +9,7 @@ import { dnsClient } from "./client.js";
|
||||||
import { DnsClient } from "@lumeweb/kernel-dns-client";
|
import { DnsClient } from "@lumeweb/kernel-dns-client";
|
||||||
import { ResolverOptions } from "@lumeweb/libresolver/src/types.js";
|
import { ResolverOptions } from "@lumeweb/libresolver/src/types.js";
|
||||||
|
|
||||||
let resolver: ResolverModule;
|
let resolver: ResolverModule | ResolverModuleBase;
|
||||||
|
|
||||||
export interface ResolverModule {
|
export interface ResolverModule {
|
||||||
get resolver(): DnsClient;
|
get resolver(): DnsClient;
|
||||||
|
@ -25,12 +25,13 @@ export interface ResolverModule {
|
||||||
getSupportedTlds(): any;
|
getSupportedTlds(): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setup(rm: ResolverModule) {
|
export function setup(rm: ResolverModule | ResolverModuleBase) {
|
||||||
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 = rm;
|
||||||
|
// @ts-ignore
|
||||||
resolver.resolver = dnsClient;
|
resolver.resolver = dnsClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue