mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
// 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>;
|
|
}
|
|
|