*add a setter for the resolver object and dont use constructor based init
This commit is contained in:
parent
68640a2bb8
commit
f4283e2d8f
|
@ -12,11 +12,7 @@ declare class ResolverRegistry {
|
|||
clear(): void;
|
||||
}
|
||||
|
||||
export interface ResolverModuleConstructor {
|
||||
new (resolver: ResolverRegistry);
|
||||
}
|
||||
|
||||
export interface ResolverModule extends ResolverModuleConstructor {
|
||||
export interface ResolverModule {
|
||||
resolve(
|
||||
domain: string,
|
||||
options: ResolverOptions,
|
||||
|
@ -30,10 +26,18 @@ export interface ResolverModule extends ResolverModuleConstructor {
|
|||
|
||||
// ts-ignore
|
||||
export abstract class AbstractResolverModule {
|
||||
protected resolver: ResolverRegistry;
|
||||
constructor(resolver?: ResolverRegistry) {
|
||||
this._resolver = resolver;
|
||||
}
|
||||
|
||||
constructor(resolver: ResolverRegistry) {
|
||||
this.resolver = resolver;
|
||||
private _resolver?: ResolverRegistry;
|
||||
|
||||
get resolver(): ResolverRegistry {
|
||||
return this._resolver as ResolverRegistry;
|
||||
}
|
||||
|
||||
set resolver(value: ResolverRegistry) {
|
||||
this._resolver = value;
|
||||
}
|
||||
|
||||
abstract resolve(
|
||||
|
|
Loading…
Reference in New Issue