import { Type } from '../common/cli-types'; import { ProviderRef } from './provider-refs/provider-ref'; import { ProviderToken } from './providers'; /** * A super class that is applied to all application components that can inject dependencies within their constructors */ export declare class Injector { static providerName(key: ProviderToken): string; /** * Reference to the parent injector so that the providers can be resolved up the hierarchical tree */ parent?: Injector; /** * Constructor of the class which dependencies are injected into */ constructorRef: Type; /** * List of providers within the global dependency injection scope */ globalProviders: ProviderRef[]; /** * List of providers within the local dependency injection scope */ providers: ProviderRef[]; /** * Creates a new instance of the injector * @param cons constructor of the class which dependencies are injected into * @param globalProviders List of providers within the global dependency injection scope * @param parent Reference to the parent injector so that the providers can be resolved up the hierarchical tree */ constructor(cons: Type, globalProviders: ProviderRef[], parent?: Injector); /** * Creates a new instance of the injectors contructor, injecting dependencies where neccessary * @param callstack Previously resolved dependencies to determine circular references */ resolve(callstack?: ProviderToken[]): Promise; /** * Throws an appropriate error when a dependency cannot be resolved for a constructor argument * @param token inject token of the provider dependency */ private throwMissingProviderError; /** * Resolves a provider within the injector's scope, first checking local providers, then looking for providers within parent injectors and finally looking * injectors within the global scope * @param token inject token of the provider dependency */ private findProvider; }