1
1
export interface AnyAction {
2
2
type : any ;
3
3
}
4
+ export declare type Meta = null | {
5
+ [ key : string ] : any ;
6
+ } ;
4
7
export interface Action < P > extends AnyAction {
5
8
type : string ;
6
9
payload : P ;
7
10
error ?: boolean ;
8
- meta ?: Object | null ;
11
+ meta ?: Meta ;
9
12
}
10
13
export interface Success < P , S > {
11
14
params : P ;
@@ -18,35 +21,22 @@ export interface Failure<P, E> {
18
21
export declare function isType < P > ( action : AnyAction , actionCreator : ActionCreator < P > ) : action is Action < P > ;
19
22
export interface ActionCreator < P > {
20
23
type : string ;
21
- ( payload : P , meta ?: Object | null ) : Action < P > ;
24
+ ( payload : P , meta ?: Meta ) : Action < P > ;
22
25
}
23
26
export interface EmptyActionCreator extends ActionCreator < undefined > {
24
- ( payload ?: undefined , meta ?: Object | null ) : Action < undefined > ;
27
+ ( payload ?: undefined , meta ?: Meta ) : Action < undefined > ;
25
28
}
26
29
export interface AsyncActionCreators < P , S , E > {
27
30
type : string ;
28
31
started : ActionCreator < P > ;
29
32
done : ActionCreator < Success < P , S > > ;
30
33
failed : ActionCreator < Failure < P , E > > ;
31
34
}
32
- export interface EmptySuccess < S > {
33
- result : S ;
34
- }
35
- export interface EmptyFailure < E > {
36
- error : E ;
37
- }
38
- export interface EmptyAsyncActionCreators < S , E > {
39
- type : string ;
40
- started : EmptyActionCreator ;
41
- done : ActionCreator < EmptySuccess < S > > ;
42
- failed : ActionCreator < EmptyFailure < E > > ;
43
- }
44
35
export interface ActionCreatorFactory {
45
- ( type : string , commonMeta ?: Object | null , error ?: boolean ) : EmptyActionCreator ;
46
- < P > ( type : string , commonMeta ?: Object | null , isError ?: boolean ) : ActionCreator < P > ;
47
- < P > ( type : string , commonMeta ?: Object | null , isError ?: ( payload : P ) => boolean ) : ActionCreator < P > ;
48
- async < P , S > ( type : string , commonMeta ?: Object | null ) : AsyncActionCreators < P , S , any > ;
49
- async < undefined , S , E > ( type : string , commonMeta ?: Object | null ) : EmptyAsyncActionCreators < S , E > ;
50
- async < P , S , E > ( type : string , commonMeta ?: Object | null ) : AsyncActionCreators < P , S , E > ;
36
+ ( type : string , commonMeta ?: Meta , error ?: boolean ) : EmptyActionCreator ;
37
+ < P > ( type : string , commonMeta ?: Meta , isError ?: boolean ) : ActionCreator < P > ;
38
+ < P > ( type : string , commonMeta ?: Meta , isError ?: ( payload : P ) => boolean ) : ActionCreator < P > ;
39
+ async < P , S > ( type : string , commonMeta ?: Meta ) : AsyncActionCreators < P , S , any > ;
40
+ async < P , S , E > ( type : string , commonMeta ?: Meta ) : AsyncActionCreators < P , S , E > ;
51
41
}
52
42
export default function actionCreatorFactory ( prefix ?: string | null , defaultIsError ?: ( payload : any ) => boolean ) : ActionCreatorFactory ;
0 commit comments