diff --git a/index.d.ts b/index.d.ts index 7c62f0df79..a80a59c037 100644 --- a/index.d.ts +++ b/index.d.ts @@ -43,7 +43,7 @@ export interface Action { * * @template S State object type. */ -export type Reducer = (state: S | undefined, action: A) => S; +export type Reducer = (state: S | undefined, action: A) => S; /** * Object whose values correspond to different reducer functions. @@ -93,8 +93,8 @@ export function combineReducers(reducers: ReducersMapObject): Reducer; * transform, delay, ignore, or otherwise interpret actions or async actions * before passing them to the next middleware. */ -export interface Dispatch { - (action: A): A; +export interface Dispatch { + (input: TInput): TReturn; } /** @@ -138,7 +138,7 @@ export interface Store { * Note that, if you use a custom middleware, it may wrap `dispatch()` to * return something else (for example, a Promise you can await). */ - dispatch: Dispatch; + dispatch: Dispatch; /** * Reads the state tree managed by the store. @@ -254,7 +254,7 @@ export const createStore: StoreCreator; /* middleware */ export interface MiddlewareAPI { - dispatch: Dispatch; + dispatch: Dispatch; getState(): S; } @@ -267,8 +267,8 @@ export interface MiddlewareAPI { * logging actions, performing side effects like routing, or turning an * asynchronous API call into a series of synchronous actions. */ -export interface Middleware { - (api: MiddlewareAPI): (next: Dispatch) => Dispatch; +export interface Middleware { + (api: MiddlewareAPI): (next: Dispatch) => Dispatch; } /** @@ -340,19 +340,19 @@ export interface ActionCreatorsMapObject { * creator wrapped into the `dispatch` call. If you passed a function as * `actionCreator`, the return value will also be a single function. */ -export function bindActionCreators>(actionCreator: A, dispatch: Dispatch): A; +export function bindActionCreators>(actionCreator: A, dispatch: Dispatch): A; export function bindActionCreators< A extends ActionCreator, B extends ActionCreator - >(actionCreator: A, dispatch: Dispatch): B; + >(actionCreator: A, dispatch: Dispatch): B; -export function bindActionCreators(actionCreators: M, dispatch: Dispatch): M; +export function bindActionCreators(actionCreators: M, dispatch: Dispatch): M; export function bindActionCreators< M extends ActionCreatorsMapObject, N extends ActionCreatorsMapObject - >(actionCreators: M, dispatch: Dispatch): N; + >(actionCreators: M, dispatch: Dispatch): N; /* compose */