import { Type } from '../decorators/Injectable'; import InjectToken from './InjectToken'; export declare type Provider = { token: InjectToken | any; use: any; }; export default class Container { /** * A list of already instantiated classes, currently all classes are singletons */ private instances; /** * Any providers that have been explicitly defined */ private providers; static instantiate(providers?: Provider[]): Container; /** * Instantiate an @Injectable() class and return it * * @param target The class to instantiate * @param providers A list of providers, these take priority over automatic injection */ static bootstrap(target: Type, providers?: Provider[]): T; /** * Add providers * * @param providers */ addProviders(providers: Provider[]): this; /** * Instantiate the requested class and its' dependencies * * @param requested The class to instantiate * @param singleton If we should remember the instance of this class for future resolves * @param injectChain The parent chain of parents that requested this class */ resolve(requested: Type, singleton?: boolean, injectChain?: string[]): T; /** * Generate an instance of a class * * @param target The class to instantiate * @param providers A list of providers, these take priority over automatic injection */ instance(target: Type, providers?: Provider[]): T; /** * Get a provider from an InjectToken * * @param token */ private getProvider; }