import { RefObject } from 'react'; import Connection from './Connection.js'; export declare type PropConfig = ['value', any] | [string, string]; export declare type PropsConfig = { [key: string]: PropConfig | undefined; }; export declare type NodePathMap = { [key: string]: string; }; export interface ChildConfig { className?: string; children?: ChildNode[]; connections?: ConnectionConfig[]; deps?: { [key: string]: any; }; id?: string; props?: PropsConfig; ref?: RefObject; state?: { [key: string]: any; }; type: string; } export declare type ChildNode = string | ChildConfig; export declare type BlockConfig = ChildNode[]; export declare enum ActionTypes { UPDATE = "UPDATE", RESET = "RESET" } export interface SetStateAction { type: ActionTypes.UPDATE; path: string; key: string; value: any; } export interface ResetStateAction { type: ActionTypes.RESET; state: State; } export declare type ActionType = SetStateAction | ResetStateAction; export declare type StateNode = { [key: string]: any; children: State; }; export declare type State = (StateNode | null)[]; export declare type Dispatcher = (action: ActionType) => void; export declare type UpdateStateGenFunc = (path: string) => UpdateStateFunc; export declare type UpdateStateFunc = (key: string, value: any) => void; export declare type GetStateFunc = (path: string) => StateNode; export interface IBlockContext { getState: GetStateFunc; state: State; updateState: UpdateStateGenFunc; connections: ConnectionDict; } export declare type ActionHookMap = { [key: string]: PromiseDict; }; export declare type ConnectionConfig = { action: string; hooks: HookDict; }; export declare type ConnectionDict = { [key: string]: Connection; }; export declare type ConnectionMap = { hooks: Set; owns: string; }; export interface ConnectedConfig extends ChildConfig { connectionMap: ConnectionMap; children?: ConnectedNode[]; } export declare type ConnectedNode = string | ConnectedConfig; export declare type MethodCall = (args: { [key: string]: any; }) => any; export declare type MethodDict = { [key: string]: MethodCall; }; export declare type PromiseDict = { [key: string]: (args: { [key: string]: any; }) => Promise; }; export declare type HookDict = { [key: string]: string[]; }; export interface ConnectionResult { connectedConfig: ConnectedNode[]; connections: ConnectionDict; nodePathMap: NodePathMap; } //# sourceMappingURL=types.d.ts.map