UNPKG

proxydi

Version:

A typed hierarchical DI container that resolves circular dependencies via Proxy

15 lines (14 loc) 859 B
import { DependencyClass, DependencyId } from './types'; export declare const injectableClasses: Record<DependencyId, DependencyClass<any>>; /** * Registers a class as an automatically injectable for dependency injection container. * * @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 function injectable(dependencyId?: DependencyId): any; export declare function findInjectableId(injectable: DependencyClass<any>): DependencyId;