import { Action } from '@ngrx/store'; import { ActionClass, mapSyncActions, mapAsyncActions, actionFactory } from './actions'; import { Obj } from '../models/models'; let defaultActions = [ 'Search', // 'Remove', // 'Create', // 'Update', ]; type DefaultActions = { Search: T; Search_Complete: T; }; type FooActions = { Overview: T; Overview_Complete: T; }; type ActionTpl = { actions: Obj; types: Obj; } type defaultTpl = { actions: DefaultActions; types: { SEARCH: string, SEARCH_COMPLETE: string, }; }; // interface StructObj { // bars: defaultTpl; // foos: { // actions: FooActions; // types: { // OVERVIEW: string, // OVERVIEW_COMPLETE: string, // }; // }; // }; // type StructObj = Obj<{ types: Obj, actions: Obj }>; type StructObj = { [k: string]: T } | any; let types = { foos: ['Overview'], // defaultActions }; export let actions = > mapAsyncActions(types); // export let bars = actionFactory('bars', defaultActions);