ajsfw
Version:
Ajs Framework
28 lines (27 loc) • 1.67 kB
TypeScript
import { CtorTyped } from "ajsfw/types/index";
import { IContainer } from "./IContainer";
export declare class Container implements IContainer {
private __transientServices;
private __scopedServices;
private __singletonServices;
private __scopedInstances;
private __singletonInstances;
constructor();
addTransient<S>(serviceInterfaceIdentifier: S, serviceConstructor: CtorTyped<S>, ...serviceConfiguration: any[]): Container;
addScoped<S>(serviceInterfaceIdentifier: S, serviceConstructor: CtorTyped<S>, ...serviceConfiguration: any[]): Container;
addSingleton<S>(serviceInterfaceIdentifier: S, classToConstruct: CtorTyped<S>, ...serviceConfiguration: any[]): Container;
resolve<S>(serviceInterfaceIdentifier: S, throwUnresolvedException?: boolean): Promise<S>;
releaseSingletonInstanceReference(serviceInstance: any): void;
releaseScopedInstanceReference(serviceInstance: any): boolean;
private __addService(serviceList, service);
private __getService(serviceList, serviceInterfaceIdentifier);
private __getServiceInstance(instanceList, serviceInstance);
private __findServiceInstance(instanceList, serviceInterfaceIdentifier);
private __releaseInstanceReference(instanceList, serviceInstance);
private __resolve<S>(serviceInterfaceIdentifier);
private __resolveTransient<S>(serviceInterfaceIdentifier);
private __resolveScoped<S>(serviceInterfaceIdentifier);
private __resolveSingleton<S>(serviceInterfaceIdentifier);
private __constructService<S>(serviceList, instanceList, serviceInterfaceIdentifier);
private __resolveParameters(service);
}