export type ActionKind = "L0" | "L1" | "L2" | "L3" | "L4" | "Req"; export type Action = { kind: TKind; type: Type; payload: TPayload; }; export type Reducer = (state: TState, action: TAction) => TState; export interface IApplicationSpec { state: { [Kind in Exclude]: object; }; actions: { [Kind in ActionKind]: Action; }; } export interface ClientMetaState { connected: boolean; error?: unknown; id: string; timeOffset: number; } export interface ClientStoreState { L1: TSpec["state"]["L1"]; L2: TSpec["state"]["L2"]; L3: TSpec["state"]["L3"]; L4: TSpec["state"]["L4"]; meta: ClientMetaState; } export interface ServerStoreState { L0: TSpec["state"]["L0"]; L1: TSpec["state"]["L1"]; L2: Record; L3: Record; }