*Add types
This commit is contained in:
parent
d6b581819f
commit
dbe35225be
|
@ -2,5 +2,8 @@
|
||||||
"name": "@lumeweb/resolver-common",
|
"name": "@lumeweb/resolver-common",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Common code and interfaces for the DNS resolver modules",
|
"description": "Common code and interfaces for the DNS resolver modules",
|
||||||
"main": "dist/index.js"
|
"main": "dist/index.js",
|
||||||
|
"dependencies": {
|
||||||
|
"@lumeweb/resolver": "https://github.com/LumeWeb/resolver.git#modular"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import type { DNSResult, ResolverOptions } from "./types.js";
|
import type { DNSResult, ResolverOptions } from "./types.js";
|
||||||
import { getTld } from "./util.js";
|
import { getTld } from "./util.js";
|
||||||
|
import ResolverRegistry from "@lumeweb/resolver";
|
||||||
|
|
||||||
export interface ResolverModule {
|
export interface ResolverModule {
|
||||||
constructor(resolver: any): void;
|
constructor(resolver: ResolverRegistry): void;
|
||||||
|
|
||||||
resolve(
|
resolve(
|
||||||
domain: string,
|
domain: string,
|
||||||
|
@ -12,9 +13,9 @@ export interface ResolverModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
export abstract class AbstractResolverModule {
|
export abstract class AbstractResolverModule {
|
||||||
protected resolver: any;
|
protected resolver: ResolverRegistry;
|
||||||
|
|
||||||
constructor(resolver: any) {
|
constructor(resolver: ResolverRegistry) {
|
||||||
this.resolver = resolver;
|
this.resolver = resolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue