metaf-react
Version:
Resolvable component and injection root for adding DI/IoC to React App
27 lines • 1.42 kB
TypeScript
import { AbstractResolvable, /* Constructable, */ IInjections } from 'metaf-resolvable';
export declare type IRequirements = any[];
export declare type State<I extends IInjections = {}> = new () => AbstractResolvable</* ISyncDependencies< */ I>;
export interface IState {
/**
* Resolvable state factory
* @description creates new class with resolved `injections` as `dependencies` and
* inform `ApplicationRoot` that it should fit specific `requirements`
* @template I type of injections' dictionary
* @template R type of requirements' tuple
* @param injections dependencies that will be used by component directly
* @param requirements dependencies that should exist in code that use this component
* @returns state class to extend
*/
<I extends IInjections = {}, R extends IRequirements = []>(injections: I, ...requirements: R): State<I>;
/**
* Resolvable state factory
* @description creates new class without `dependencies` but with
* informing `ApplicationRoot` that it should fit specific `requirements`
* @template R type of requirements' tuple
* @param requirements dependencies that should exist in code that use this class
* @returns state class to extend
*/
<R extends IRequirements = []>(...requirements: R): State;
}
export declare const State: IState;
//# sourceMappingURL=State.d.ts.map