import { KeyMap, A2, Types, MapOption } from './utils.d' // ______________________________________________________ // // @ fromActions // IN type AC = (context: any) => Promise type ACPL = (context: any, payload: A2) => Promise type Action = AC | ACPL type Actions = { [K in keyof T]: Action } // OUT type DP = () => Promise type DPPL = (payload: A2) => Promise type Dispatcher = T extends AC ? DP : DPPL type Dispatches = { readonly [K in keyof T]: Dispatcher } type MapActions = (mapOption: MapOption) => any interface FromActionsReturn { readonly actionTypes: Types readonly dispatches: Dispatches readonly mapActions: MapActions } // DECL declare function fromActions>( actions: T, namespace: string ): FromActionsReturn // ______________________________________________________ // // @ exports export { Actions, Dispatches, MapActions, FromActionsReturn, fromActions }