// flow-typed signature: cca4916b0213065533df8335c3285a4a // flow-typed version: cab04034e7/redux_v3.x.x/flow_>=v0.55.x declare module 'redux' { /* S = State A = Action D = Dispatch */ declare export type DispatchAPI = (action: A) => A; // declare export type Dispatch }> = DispatchAPI; declare export type ThunkAction = (dispatch: Dispatch, getState: () => S) => Promise | void; declare export type ThunkDispatch = (action: ThunkAction) => void; declare export type PlainDispatch}> = DispatchAPI; /* NEW: Dispatch is now a combination of these different dispatch types */ declare export type Dispatch = PlainDispatch & ThunkDispatch; // declare export type ThunkAction = (dispatch: D, getState: () => S) => Promise | void; // declare type ThunkDispatch = (action: ThunkAction>) => void; declare export type MiddlewareAPI = { dispatch: Dispatch; getState(): S; }; declare export type Store> = { // rewrite MiddlewareAPI members in order to get nicer error messages (intersections produce long messages) dispatch: D; getState(): S; subscribe(listener: () => void): () => void; replaceReducer(nextReducer: Reducer): void }; declare export type Reducer = (state: S | void, action: A) => S; declare export type CombinedReducer = (state: $Shape & {} | void, action: A) => S; declare export type Middleware = (api: MiddlewareAPI) => (next: PlainDispatch) => PlainDispatch; declare export type StoreCreator> = { (reducer: Reducer, enhancer?: StoreEnhancer): Store; (reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; }; declare export type StoreEnhancer> = (next: StoreCreator) => StoreCreator; declare export function createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store; declare export function createStore(reducer: Reducer, preloadedState?: S, enhancer?: StoreEnhancer): Store; declare export function applyMiddleware(...middlewares: Array>): StoreEnhancer; declare export type ActionCreator = (...args: Array) => A; declare export type ActionCreators = { [key: K]: ActionCreator }; declare export function bindActionCreators, D: DispatchAPI>(actionCreator: C, dispatch: D): C; declare export function bindActionCreators, D: DispatchAPI>(actionCreators: C, dispatch: D): C; // declare export function bindActionCreators, D: Dispatch>(actionCreator: C, dispatch: D): C; // declare export function bindActionCreators, D: Dispatch>(actionCreators: C, dispatch: D): C; declare export function combineReducers(reducers: O): CombinedReducer<$ObjMap(r: Reducer) => S>, A>; declare export var compose: $Compose; }