1
+ import type { Action , UnknownAction , ActionCreatorsMapObject } from 'redux'
1
2
import type { ThunkAction } from './src/index'
2
3
3
4
/**
@@ -15,26 +16,27 @@ declare module 'redux' {
15
16
* Overload for bindActionCreators redux function, returns expects responses
16
17
* from thunk actions
17
18
*/
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
+ // }
32
34
33
35
/*
34
36
* Overload to add thunk support to Redux's dispatch() function.
35
37
* Useful for react-redux or any other library which could use this type.
36
38
*/
37
- export interface Dispatch < A extends Action = AnyAction > {
39
+ export interface Dispatch < A extends Action = UnknownAction > {
38
40
< ReturnType = any , State = any , ExtraThunkArg = any > (
39
41
thunkAction : ThunkAction < ReturnType , State , ExtraThunkArg , A >
40
42
) : ReturnType
0 commit comments