import { Descriptor, ContainerServiceMap, ContainerKeys, TypeOfService, ILifetime, ServiceContainer } from "./interfaces"; import { MapOf } from "../interfaces"; export interface ActivationContextInfo { name: string; service: string; } /** This class is created once per `Container.resolve` method call and used to * cache dependencies and to track created instances. The activation context * tracks services with `context` activation type. */ export declare class ActivationContext { _cache: MapOf; _services: ContainerServiceMap; _visited: MapOf; _name: string; _service: Descriptor; _container: ServiceContainer; _parent: ActivationContext | undefined; /** Creates a new activation context with the specified parameters. * @param container the container which starts the activation process * @param services the initial service registrations * @param name the name of the service being activated, this parameter is * used for the debug purpose. * @param service the service to activate, this parameter is used for the * debug purpose. */ constructor(container: ServiceContainer, services: ContainerServiceMap, name: string, service: Descriptor); /** the name of the current resolving dependency */ getName(): string; /** Returns the container for which 'resolve' method was called */ getContainer(): ServiceContainer; /** Resolves the specified dependency in the current context * @param name The name of the dependency being resolved */ resolve>(name: K): TypeOfService; /** Resolves the specified dependency with the specified default value if * the dependency is missing. * * @param name The name of the dependency being resolved * @param def A default value to return in case of the specified dependency * is missing. */ resolve, T>(name: K, def: T): TypeOfService | T; /** Resolves the specified dependency and returns undefined in case if the * dependency is missing. * * @param name The name of the dependency being resolved */ resolve>(name: K, def: undefined): TypeOfService | undefined; /** * registers services local to the the activation context * * @name{string} the name of the service * @service{string} the service descriptor to register */ register(name: K, service: Descriptor): void; createLifetime(): ILifetime; activate(d: Descriptor, name: string): T; visit(id: string): any; getStack(): ActivationContextInfo[]; private enter; /** Creates a clone for the current context, used to protect it from modifications */ clone(): this; }