proxydi
Version:
A typed hierarchical DI container that resolves circular dependencies via Proxy
13 lines (12 loc) • 737 B
TypeScript
import { DependencyId, DependencyClass, ResolveScope } from './types';
/**
* Registers an injection for multiple dependencies of the same type.
*
* @param dependencyId - Dependency identifier to resolve all instances from container hierarchy.
* @param scope - Bitwise enum to control where to search (Parent | Current | Children). Defaults to Children.
* @returns A decorator function for class fields.
*
* The decorated field will receive an array of all dependencies with the given ID
* from the container hierarchy according to the scope parameter.
*/
export declare const injectAll: (dependencyId: DependencyId | DependencyClass<any>, scope?: ResolveScope) => (_value: unknown, context: ClassFieldDecoratorContext) => void;