@lillallol/dic
Version:
My own dependency injection container.
39 lines (38 loc) • 1.27 kB
TypeScript
/**
* @description
* Dependency injection container constructor.
*/
export declare const Dic: import("./publicApi").DicCtor;
/**
* @description
* It returns a string representation of the dependency graph starting from the
* provided abstraction.
*/
export declare const printDependencyGraph: (parameters: {
dic: import("./publicApi").IDic;
rootAbstraction: symbol;
TYPES: import("./publicApi").ITYPES;
}) => string;
/**
* @description
* Provide `TYPES` to get back an identity function that provides intellisense
* for the keys of `TYPES`. This function can be used to have refactor-able
* names in the specification of unit tests.
*/
export declare const namesFactory: <T extends import("./publicApi").ITYPES>() => <N extends keyof T>(name: N) => N;
/**
* @description
* It throws error when:
*
* * the dependency graph of the provided entry abstractions
* does not use all the registered abstractions
* * `TYPES` has extra or missing abstractions
* * there are cycles in the dependency graph
*
*/
export declare const validateDependencyGraph: (parameters: {
dic: import("./publicApi").IDic;
entryPointAbstractions: symbol[];
TYPES: import("./publicApi").ITYPES;
ignoreAbstractions?: symbol[] | undefined;
}) => void;