import { ContainerInstance } from './container-instance.class'; import { ContainerIdentifier } from './types/container-identifier.type'; /** * The container registry is responsible for holding the default and every * created container instance for later access. * * _Note: This class is for internal use and it's API may break in minor or * patch releases without warning._ */ export declare class ContainerRegistry { /** * The list of all known container. Created containers are automatically added * to this list. Two container cannot be registered with the same ID. * * This map doesn't contains the default container. */ private static readonly containerMap; /** * Registers the given container instance or throws an error. * * _Note: This function is auto-called when a Container instance is created, * it doesn't need to be called manually!_ * * @param container the container to add to the registry */ static registerContainer(container: ContainerInstance): void; /** * Returns true if a container exists with the given ID or false otherwise. * * @param container the ID of the container */ static hasContainer(id: ContainerIdentifier): boolean; /** * Returns the container for requested ID or throws an error if no container * is registered with the given ID. * * @param container the ID of the container */ static getContainer(id: ContainerIdentifier): ContainerInstance; /** * Removes the given container from the registry and disposes all services * registered only in this container. * * This function throws an error if no * - container exists with the given ID * - any of the registered services threw an error during it's disposal * * @param container the container to remove from the registry */ static removeContainer(container: ContainerInstance): Promise; }