UNPKG

plain-ioc

Version:

Plain inversion of control container

14 lines (13 loc) 596 B
import { Dependency } from './Dependency'; import { DependencyKey } from './DependencyKey'; import { DependencyFacroty } from './DependencyFacroty'; export declare class Container { dependencies: Map<DependencyKey, Dependency<any>>; initInstances: Map<DependencyKey, any>; bind<T>(key: DependencyKey, factory: DependencyFacroty<T>): void; unbind(key: DependencyKey): void; bindSingleton<T>(key: DependencyKey, factory: DependencyFacroty<T>): void; isBound(key: DependencyKey): boolean; resolve<T>(key: DependencyKey): T; keyToString(key: DependencyKey): string; }