proxydi
Version:
A typed hierarchical DI container that resolves circular dependencies via Proxy
11 lines (10 loc) • 477 B
TypeScript
import { DependencyId } from './types';
/**
* Registers an injection for dependency injection.
*
* @param dependencyId - Optional dependecy identifier. If omitted, the property name is used.
* @returns A decorator function for class fields.
*
* The decorated field will receive its dependency from the same container as the injection owner.
*/
export declare const inject: (dependencyId?: DependencyId) => (_value: unknown, context: ClassFieldDecoratorContext) => void;