@rokkit.ts/dependency-injection
Version:
TypeScript dependency injection library using decorators for the rokkit.ts framework and other projects
39 lines (38 loc) • 1.6 kB
TypeScript
import { InjectorConstructorArgument } from './injectorConstructorArgument';
/**
* @description The Injector class is used to store type information about a specific userObject. These information
* could be used to construct an instance of the defined userObject.
* @class Injector
* @param T extends objects
*/
export declare class Injector<T extends object> {
private readonly className;
private readonly classType;
private classConstructorArguments;
constructor(classConstructor: new (...args: any[]) => T, classConstructorArguments: InjectorConstructorArgument[]);
/**
* @description Accessor for the ClassName of the userObject
* @return string
*/
get ClassName(): string;
/**
* @description Accessor for the ClassConstructorArguments of the userObject
* @return InjectorConstructorArgument[]
*/
get ClassConstructorArguments(): InjectorConstructorArgument[];
/**
* @description Accessor for the ClassConstructorArguments of the userObject
* @param classConstructorArguments
*/
set ClassConstructorArguments(classConstructorArguments: InjectorConstructorArgument[]);
/**
* @description Creates an instance of the userObject. Therefore checks the constructorArguments for injected
* values or special user objects. Every user object argument that has no explicit provided value will be query by
* the dependencyInjectionAssembler.
* @return T
*/
createInstance(): T;
private mapToValue;
private getConstructorArgs;
private sortInjectorConstructorArguments;
}