forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
redux-action-utils.d.ts
37 lines (31 loc) · 1.32 KB
/
redux-action-utils.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Type definitions for redux-action-utils 2.0.0
// Project: https://github.com/insin/redux-action-utils
// Definitions by: Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "redux-action-utils" {
export interface Action {
type: string;
}
export interface ActionCreator<T> {
(...data: any[]): Action & T;
}
export interface OptionsActionCreator<T> {
(data: T): Action & T;
}
/**
* Creates an action creator which will create an action object with the given type.
*/
export function actionCreator<T>(type: string, ...props: string[]): ActionCreator<T>;
/**
* Creates an action creator which will create an action object with the given type.
*/
export function actionCreator<T>(type: string, props: string[]): ActionCreator<T>;
/**
* Creates an action creator which takes a single object argument and adds its properties to the action object.
*/
export function optionsActionCreator<T>(type: string, ...props: string[]): OptionsActionCreator<T>;
/**
* Creates an action creator which takes a single object argument and adds its properties to the action object.
*/
export function optionsActionCreator<T>(type: string, props: string[]): OptionsActionCreator<T>;
}