1+ import type { Action , UnknownAction , ActionCreatorsMapObject } from 'redux'
12import type { ThunkAction } from './src/index'
23
34/**
@@ -15,26 +16,27 @@ declare module 'redux' {
1516 * Overload for bindActionCreators redux function, returns expects responses
1617 * from thunk actions
1718 */
18- function bindActionCreators <
19- ActionCreators extends ActionCreatorsMapObject < any >
20- > (
21- actionCreators : ActionCreators ,
22- dispatch : Dispatch
23- ) : {
24- [ ActionCreatorName in keyof ActionCreators ] : ReturnType <
25- ActionCreators [ ActionCreatorName ]
26- > extends ThunkAction < any , any , any , any >
27- ? (
28- ...args : Parameters < ActionCreators [ ActionCreatorName ] >
29- ) => ReturnType < ReturnType < ActionCreators [ ActionCreatorName ] > >
30- : ActionCreators [ ActionCreatorName ]
31- }
19+ // TODO Fix this post-3.0.1
20+ // export function bindActionCreators<
21+ // ActionCreators extends ActionCreatorsMapObject<any>
22+ // >(
23+ // actionCreators: ActionCreators,
24+ // dispatch: Dispatch
25+ // ): {
26+ // [ActionCreatorName in keyof ActionCreators]: ReturnType<
27+ // ActionCreators[ActionCreatorName]
28+ // > extends ThunkAction<any, any, any, any>
29+ // ? (
30+ // ...args: Parameters<ActionCreators[ActionCreatorName]>
31+ // ) => ReturnType<ReturnType<ActionCreators[ActionCreatorName]>>
32+ // : ActionCreators[ActionCreatorName]
33+ // }
3234
3335 /*
3436 * Overload to add thunk support to Redux's dispatch() function.
3537 * Useful for react-redux or any other library which could use this type.
3638 */
37- export interface Dispatch < A extends Action = AnyAction > {
39+ export interface Dispatch < A extends Action = UnknownAction > {
3840 < ReturnType = any , State = any , ExtraThunkArg = any > (
3941 thunkAction : ThunkAction < ReturnType , State , ExtraThunkArg , A >
4042 ) : ReturnType
0 commit comments