import { Action , StoreEnhancer , Dispatch , Store , Reducer } from 'redux' ; import { StateWithFx } from './helpers' ; export type Effect = { effect : string ; [ key ] : any ; } ; export type Effects = Effect [ ] ; export interface StoreCreator { < S , A extends Action > ( reducer , enhancer ? ) : FXStore < S > ; < S , A extends Action > ( reducer , preloadedState , enhancer ? ) : FXStore < S > ; } export interface FXReducer < S > { ( state , action ) : S | StateWithFx < S > ; } export interface FXHandler < S > { ( params , getState , dispatch ) : void ; } export interface FXParams { [ key ] : any ; } export interface RegisteredFXs < S > { [ key ] : FXHandler < S > ; } export type QueuedFX = [ string , FXParams ] ; export interface FXStore < S > extends Store < S > { registerFX ( id , handler ) : void ; replaceEffectfulReducer ( reducer ) : void ; }