UNPKG

proxydi

Version:

A typed hierarchical DI container that resolves circular dependencies via Proxy

14 lines (13 loc) 837 B
import { InstancedDependency, DependencyId } from './types'; export declare const autoInjectableClasses: Record<DependencyId, InstancedDependency<any>>; /** * Registers a class as an auto-injectable for dependency injection. * * @param dependencyId - Optional dependency 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 dependency 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 autoInjectable: (dependencyId?: DependencyId) => (value: InstancedDependency<any>, context: ClassDecoratorContext) => void;