import { InjectFactory } from './inject-factory'; import { InjectToken } from './inject-token'; import { BasicTypeInjector } from './basic-type-injector'; import { TypeInjector, TypeInjectorBuilder } from './type-injector'; /** * A scope is a child injector that might provide additional values or override implementations. */ export declare class InjectorScope extends BasicTypeInjector { readonly ident: symbol & { description: string; }; private _parent; /** * Fluent construction of InjectorScopes. * * ```typescript * InjectorScope.construct() * .withIdent(Symbol.for('scope name')) * .fromParent(parentScope) * [...provide...] * .build(); * ``` * * @returns */ static construct(): { /** * @param ident - unique identifier of the scope */ withIdent: (ident: symbol) => { /** * @param parent - is used as fallback * @returns */ fromParent: (parent: TypeInjector) => TypeInjectorBuilder; }; }; private _ownInstances; private constructor(); /** * @internal */ getOptFactory(token: InjectToken): InjectFactory; private _createInOwnScope; /** * Do not create an own instance but ask parent scope for an instance. * * After checking that no own instance is needed this method can get called to * query the parent scope to resolve the token. This might create a new instance * in the (parent) parent if it doesn't exist yet. * * This instance is linked into _instances to prevent further calls with the same * token to repeat all dependency checks. * * @typeParam T - Type defined by the token. Will match the instance type returned by the parent scope. * @param token - {@link InjectToken} identifying the value to inject * @returns instance from parent + flag that it is from parent */ private _useInstanceFromParentScope; protected _markAsInCreation(token: InjectToken, factory: InjectFactory, scopeIdent?: symbol & { description: string; }): void; /** * Checks if there are own/overridden dependencies. * * Therefore this function will query for all dependencies which * might trigger lazy creation. But all of them are cached in the * appropriate scope and needed for the creation anyway so there's * not much wasted computing time (only a duplicate lookup). * * Even if it does not create the requested value it's important * to add it to the values in creation to detect dependency cycles. * * @param token - {@link InjectToken} identifying the value to inject * @param factory - {@link InjectFactory} providing the dependencies to check */ private _hasOwnDependencies; private _createWithSource; protected _createDependencyEntryLog(token: InjectToken, factory: InjectFactory): string; protected _create(token: InjectToken): T; } //# sourceMappingURL=injector-scope.d.ts.map