Farmbot-Web-App/frontend/redux/interfaces.ts

23 lines
657 B
TypeScript
Raw Normal View History

2017-06-29 12:54:02 -06:00
import { Everything } from "../interfaces";
2019-12-27 13:58:44 -07:00
import { Store as ReduxStore, Reducer, AnyAction } from "redux";
import { Actions } from "../constants";
2017-06-29 12:54:02 -06:00
2019-11-06 10:15:10 -07:00
export type Store = ReduxStore<Everything>;
2017-06-29 12:54:02 -06:00
export interface ReduxAction<T> {
readonly type: Actions;
2017-06-29 12:54:02 -06:00
readonly payload: T;
}
/** The "getState()" function, typically passed in by Redux Thunk Middleware. */
export type GetState = () => Everything;
/** A Redux Thunk function. */
export interface Thunk {
(dispatch: Function, getState: GetState): unknown;
2017-06-29 12:54:02 -06:00
}
export type EnvName = "test" | "production" | "development" | "*";
2019-12-27 13:58:44 -07:00
export type Reducers = Reducer<Omit<Everything, "dispatch">, AnyAction>;