@triviality/core
Version:
Purely typed service container
17 lines (16 loc) • 878 B
TypeScript
import type { FeatureFactoryContext } from './FeatureFactoryContext';
import { ServiceFunctionReferenceContainerInterface } from '../Container/ServiceFunctionReferenceContainerInterface';
import { FF } from '../FeatureFactory';
/**
* TODO: rename everything as invoke context.
*/
export interface InvokeContext {
context: FeatureFactoryContext<any>;
container: ServiceFunctionReferenceContainerInterface;
featureFactory: FF<any, any>;
}
export declare const getCurrentContext: <T>() => FeatureFactoryContext<T>;
export declare const getCurrentFeatureFactory: () => import("../FeatureFactory").FeatureFactory<{}, {}>;
export declare const getCurrentContainer: () => ServiceFunctionReferenceContainerInterface<any>;
export declare const inCurrentContext: () => boolean;
export declare const withGlobalContext: (context: InvokeContext, callback: () => void) => void;