@@ -4,50 +4,34 @@ import { Store as ReduxStore, CombinedState } from 'redux';
4
4
import { ThunkAction as IThunkAction , ThunkDispatch as IThunkDispatch } from 'redux-thunk' ;
5
5
import * as reducers from 'ducks' ;
6
6
7
- /**
8
- * Store type
9
- */
7
+ /** Store type. */
10
8
export type Store = ReduxStore < CombinedState < i . ReduxState > , i . ActionTypes > ;
11
9
12
- /**
13
- * Generates a list of all actions types
14
- */
10
+ /** Generates a list of all actions types. */
15
11
export type ActionTypes = i . ValueOf < {
16
12
[ Reducer in keyof typeof reducers ] : Parameters < typeof reducers [ Reducer ] > [ 1 ] ;
17
13
} > ;
18
14
19
- /**
20
- * Generates a union of all action names
21
- */
15
+ /** Generates a union of all action names. */
22
16
export type ActionTypeNames = i . ValueOf < {
23
17
[ Reducer in keyof typeof reducers ] : Parameters < typeof reducers [ Reducer ] > [ 1 ] [ 'type' ] ;
24
18
} > ;
25
19
26
- /**
27
- * Shape of a Redux action
28
- * P = shape of payload
29
- */
20
+ /** Shape of a Redux action. */
30
21
export type Action < P = any > = {
31
22
type : i . ActionTypeNames ;
32
23
payload ?: P ;
33
24
error ?: boolean ;
34
25
meta ?: any ;
35
26
} ;
36
27
37
- /**
38
- * Thunk action type with pre-filled generics
39
- * ReturnType = return type of function
40
- */
28
+ /** Thunk action type with pre-filled generics. */
41
29
type ExtraArgument = i . AnyObject ;
42
30
export type ThunkAction < ReturnType = void > = IThunkAction < ReturnType , i . ReduxState , ExtraArgument , i . Action > ;
43
31
44
- /**
45
- * Thunk Dispatch action with pre-filled generics
46
- */
32
+ /** Thunk Dispatch action with pre-filled generics. */
47
33
export type ThunkDispatch = IThunkDispatch < i . ReduxState , any , i . Action > ;
48
34
49
- /**
50
- * Generator type for thunk actions
51
- */
35
+ /** Generator type for thunk actions. */
52
36
export type BaseThunkAction < Fn extends ( ...args : any ) => any > =
53
37
( ...args : Parameters < Fn > ) => i . ThunkAction < ReturnType < Fn > > ;
0 commit comments