import { IFetchApiResponse } from "../fetch/core"; import { StateStatus, StateKeyType } from "./state"; import { Dispatch } from "redux"; /** The Core Redux Action */ export interface IReduxAction { /** The action type */ type: string; /** The kind of action */ kind: string; } export interface IReduxActionStateKey { /** The action state key */ stateKey: StateKeyType; } export interface IPromiseActionBase extends IReduxAction, IReduxActionStateKey, Promise { /** Override the action ok payload */ modifyPayload?: (status: StateStatus, value?: any) => any; } /** Indicates an action that will be processed by the thunk middleware */ export interface IThunkAction extends IReduxAction { /** The action payload */ thunk: (dispatch: Dispatch, getState: () => TState) => T; kind: "thunk"; } /** Indicates an action that will be processed by the fetch api middleware */ export interface IFetchApiAction extends IPromiseActionBase> { kind: "fetch-api"; } /** Indicates an action that will be processed by the promise middleware */ export interface IPromiseAction extends IPromiseActionBase { kind: "promise"; } /** Indicates an action that will be processed by the store reducers */ export interface IReducerAction extends IReduxAction, IReduxActionStateKey { /** The action payload */ payload: T; /** The action status */ status?: StateStatus; kind: "reducer"; } /** Indicates an action that will be processed by the thunk middleware */ export declare function isThunkAction(action: IReduxAction): action is IThunkAction; /** Indicates an action that will be processed by the fetch api middleware */ export declare function isFetchApiAction(action: IReduxAction): action is IFetchApiAction; /** Indicates an action that will be processed by the promise middleware */ export declare function isPromiseAction(action: IReduxAction): action is IPromiseAction; /** Indicates an action that will be processed by the promise middleware */ export declare function isReducerAction(action: IReduxAction): action is IReducerAction;