@baizey/dependency-injection
Version:
A simple typescript dependency injection
14 lines (13 loc) • 541 B
TypeScript
import { Provider } from './Provider';
import { LifetimeCollection, Selector } from '../ServiceCollection';
import { ScopeContext } from './ScopeContext';
export declare class ServiceProvider<E = any> implements Provider<E> {
readonly instances: Partial<{
[key in keyof E]: any;
}>;
readonly lifetimes: LifetimeCollection<E>;
readonly proxy: E;
constructor(lifetimes: LifetimeCollection<E>);
createProxy(context?: ScopeContext<E>): E;
provide<T>(selector: Selector<T, E>, context?: ScopeContext<E>): T;
}