proxydi
Version:
A typed hierarchical DI container that resolves circular dependencies via Proxy
14 lines (13 loc) • 853 B
TypeScript
import { InstancedServiceClass, ServiceId } from './types';
export declare const autoInjectableServices: Record<ServiceId, InstancedServiceClass<any>>;
/**
* Decorator that registers a class as an auto-injectable service for dependency injection.
*
* @param serviceId - Optional service identifier. If omitted, the class name is used.
* @returns A class decorator function.
*
* Note: During dependency resolution, any container that does not have an instance for the specified service identifier
* will create an instance of the decorated class. However, if a container already has an instance with that identifier
* prior to resolution, the decorated class will be ignored by that container.
*/
export declare const autoInjectableService: (serviceId?: ServiceId) => (value: InstancedServiceClass<any>, context: ClassDecoratorContext) => void;