export type Dict = Record; export type UnionToIntersection = ( U extends any ? (k: U) => void : never ) extends (k: infer I) => void ? I : never; type Subdux = { initial: TState; }; type StateOf = D extends { initial: infer I } ? I : unknown; type ActionsOf = C extends { actions: infer A } ? { [K in keyof A]: Function; } : {}; type Subduxes = Record; export type DuxStateSubduxes = C extends { '*': infer I } ? { [key: string]: StateOf; [index: number]: StateOf; } : { [K in keyof C]: StateOf }; export type AggregateDuxState = TState & DuxStateSubduxes; type DuxActionsSubduxes = C extends object ? ActionsOf : unknown; type ItemsOf = C extends object ? C[keyof C] : unknown; export type AggregateDuxActions = TActions & UnionToIntersection>>;