@hapiness/core
Version:
Project to have a HapiJS (https://hapijs.com/) based framework to create easier NodeJS back-end with some awesome features
27 lines (26 loc) • 883 B
TypeScript
import { Type, ReflectiveInjector } from 'injection-js';
import { CoreProvide } from './interfaces';
import { Observable } from 'rxjs';
export declare class DependencyInjection {
private static logger;
/**
* Create a new DI and
* can inherits from a parent DI
*
* @param {Type<T>[]} providers
* @param {ReflectiveInjector} parent?
* @returns Observable<ReflectiveInjector>
*/
static createAndResolve(providers: Type<any>[] | CoreProvide[], parent?: ReflectiveInjector): Observable<ReflectiveInjector>;
/**
* Instantiate a component
* resolving its dependencies
* without inject the component
* into the DI
*
* @param {Type<T>} component
* @param {ReflectiveInjector} di
* @returns T
*/
static instantiateComponent<T>(component: Type<T>, di: ReflectiveInjector): Observable<T>;
}