import { NewAction, Action } from "../action/types"; import { StoreDispatchApi } from "../store/types"; // https://stackoverflow.com/a/49936686 // https://github.com/krzkaczor/ts-essentials/blob/4bfaf215f1aae39a7be70d178b2226ebdbbcec61/lib/types.ts#L9 export type DeepPartial = { [P in keyof T]?: T[P] extends Array ? Array> : T[P] extends ReadonlyArray ? ReadonlyArray> : DeepPartial; }; // https://stackoverflow.com/a/50677584 export type FirstArgument = T extends (arg1: infer U, ...args: any[]) => any ? U : any; export type Thunk = ( store: T ) => any; export type BatchAction = NewAction & { payload: Action[]; meta: { batch: true; batchId: number; newBatch: boolean; }; }; export interface Dictionary { [index: string]: T; }