@michaelganchas/ts-inject
Version:
A lightweight TypeScript dependency injection library
11 lines (10 loc) • 433 B
TypeScript
type Constructor<T> = new (...args: any[]) => T;
/**
* Autowire a class constructor with resolved dependencies.
*
* @param ClassDef - The target class constructor
* @param keys - Keys of dependencies to inject from DI container
* @return A function that returns a new instance of the class with injected dependencies
*/
export declare const autowire: <T>(ClassDef: Constructor<T>, keys: PropertyKey[]) => (() => T);
export {};