*Add types

This commit is contained in:
Derrick Hammer 2022-08-18 13:02:27 -04:00
parent d6b581819f
commit dbe35225be
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 8 additions and 4 deletions

View File

@ -2,5 +2,8 @@
"name": "@lumeweb/resolver-common",
"version": "0.1.0",
"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"
}
}

View File

@ -1,8 +1,9 @@
import type { DNSResult, ResolverOptions } from "./types.js";
import { getTld } from "./util.js";
import ResolverRegistry from "@lumeweb/resolver";
export interface ResolverModule {
constructor(resolver: any): void;
constructor(resolver: ResolverRegistry): void;
resolve(
domain: string,
@ -12,9 +13,9 @@ export interface ResolverModule {
}
export abstract class AbstractResolverModule {
protected resolver: any;
protected resolver: ResolverRegistry;
constructor(resolver: any) {
constructor(resolver: ResolverRegistry) {
this.resolver = resolver;
}