impair
Version:
impair is a React framework bringing several programming concepts together in order to provide a foundation for a layered, scalable, performant and enterprise level react application.
43 lines (42 loc) • 1.79 kB
TypeScript
import { DependencyContainer } from 'tsyringe';
type EventCallback = (...args: any[]) => void;
declare function on(event: string, cb: EventCallback): () => boolean | undefined;
declare function emit(event: string, data?: any): void;
declare function registerContainer(container: DependencyContainer, parent?: DependencyContainer): void;
declare function unregisterContainer(container: DependencyContainer): void;
declare function registerInstance(container: DependencyContainer, token: any, instance: any): void;
declare function getTree(): any;
declare function getContainerDetails(id: string): {
id: string;
services: {
tokenName: string;
}[];
} | null;
declare function getInstanceState(containerId: string, tokenName: string): {
state: Record<string, any>;
derived: Record<string, any>;
} | null;
declare function setStateValue(containerId: string, tokenName: string, key: string, value: any): boolean;
export declare function installHook(): {
registerContainer: typeof registerContainer;
unregisterContainer: typeof unregisterContainer;
registerInstance: typeof registerInstance;
getTree: typeof getTree;
getContainerDetails: typeof getContainerDetails;
getInstanceState: typeof getInstanceState;
setStateValue: typeof setStateValue;
on: typeof on;
emit: typeof emit;
} | undefined;
export declare function getDevtoolsHook(): {
registerContainer: typeof registerContainer;
unregisterContainer: typeof unregisterContainer;
registerInstance: typeof registerInstance;
getTree: typeof getTree;
getContainerDetails: typeof getContainerDetails;
getInstanceState: typeof getInstanceState;
setStateValue: typeof setStateValue;
on: typeof on;
emit: typeof emit;
} | null | undefined;
export {};