*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;
|
clear(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ResolverModuleConstructor {
|
export interface ResolverModule {
|
||||||
new (resolver: ResolverRegistry);
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ResolverModule extends ResolverModuleConstructor {
|
|
||||||
resolve(
|
resolve(
|
||||||
domain: string,
|
domain: string,
|
||||||
options: ResolverOptions,
|
options: ResolverOptions,
|
||||||
|
@ -30,10 +26,18 @@ export interface ResolverModule extends ResolverModuleConstructor {
|
||||||
|
|
||||||
// ts-ignore
|
// ts-ignore
|
||||||
export abstract class AbstractResolverModule {
|
export abstract class AbstractResolverModule {
|
||||||
protected resolver: ResolverRegistry;
|
constructor(resolver?: ResolverRegistry) {
|
||||||
|
this._resolver = resolver;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(resolver: ResolverRegistry) {
|
private _resolver?: ResolverRegistry;
|
||||||
this.resolver = resolver;
|
|
||||||
|
get resolver(): ResolverRegistry {
|
||||||
|
return this._resolver as ResolverRegistry;
|
||||||
|
}
|
||||||
|
|
||||||
|
set resolver(value: ResolverRegistry) {
|
||||||
|
this._resolver = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract resolve(
|
abstract resolve(
|
||||||
|
|
Loading…
Reference in New Issue