##// END OF EJS Templates
working on fluent configuration
working on fluent configuration

File last commit:

r132:0866c6259285 ioc ts support
r132:0866c6259285 ioc ts support
Show More
RegistrationBuilder.ts
37 lines | 1.3 KiB | video/mp2t | TypeScriptLexer
/ src / main / ts / di / fluent / RegistrationBuilder.ts
cin
working on fluent configuration
r132 import { ServiceRecordBuilder, ExtractDependency, RegistrationVisitor, ServiceRegistration } from "./interfaces";
cin
working on fluent configuration
r128 import { ActivationType } from "../interfaces";
cin
working on fluent configuration
r132 export class RegistrationBuilder<T, S extends object> implements ServiceRegistration {
cin
working on fluent configuration
r128 private _activationType: ActivationType = "call";
private _overrides: { [m in keyof S]?: (...args: any) => void } | undefined;
override<K extends keyof S>(name: K, builder: S[K], raw: true): this;
override<K extends keyof S>(name: K, builder: (t: ServiceRecordBuilder<S[K], S>) => void): this;
override<K extends keyof S, V>(name: S[K] extends ExtractDependency<V, S> ? K : never, value: V): this;
override<K extends keyof S>(name: K, builder: S[K] | ((t: ServiceRecordBuilder<S[K], S>) => void), raw: boolean = false) {
if (!this._overrides)
this._overrides = {};
if (raw) {
} else if (builder instanceof Function) {
} else {
}
return this;
}
activate(activation: ActivationType) {
this._activationType = activation;
return this;
}
inject<M extends keyof T, P extends any[]>(member: T[M] extends (...params: ExtractDependency<P, S>) => any ? M : never, ...params: P) {
return this;
}
cin
working on fluent configuration
r132 visit(visitor: RegistrationVisitor) {
cin
working on fluent configuration
r128
}
cin
working on fluent configuration
r132 }