@types/redux-actions
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -7,3 +7,2 @@ // Type definitions for redux-actions 2.2 | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
@@ -27,8 +26,8 @@ export as namespace ReduxActions; | ||
export interface ReducerMap<State> { | ||
[actionType: string]: Reducer<State, any> | ReducerNextThrow<State, any>; | ||
export interface ReducerMap<State, Payload> { | ||
[actionType: string]: Reducer<State, Payload> | ReducerNextThrow<State, Payload>; | ||
} | ||
export interface ReducerMapMeta<State, Meta> { | ||
[actionType: string]: ReducerMeta<State, any, Meta> | ReducerNextThrowMeta<State, any, Meta>; | ||
export interface ReducerMapMeta<State, Payload, Meta> { | ||
[actionType: string]: ReducerMeta<State, Payload, Meta> | ReducerNextThrowMeta<State, Payload, Meta>; | ||
} | ||
@@ -46,3 +45,9 @@ | ||
export type ActionFunctions<Payload> = ActionFunctionAny<Action<Payload>>; | ||
export type ActionFunctions<Payload> = | ||
ActionFunction0<Action<Payload>> | | ||
ActionFunction1<any, Action<Payload>> | | ||
ActionFunction2<any, any, Action<Payload>> | | ||
ActionFunction3<any, any, any, Action<Payload>> | | ||
ActionFunction4<any, any, any, any, Action<Payload>> | | ||
ActionFunctionAny<Action<Payload>>; | ||
@@ -54,3 +59,7 @@ export type Reducer<State, Payload> = (state: State, action: Action<Payload>) => State; | ||
/** argument inferring borrowed from lodash definitions */ | ||
export type ActionFunction<R, T1 = undefined, T2 = undefined, T3 = undefined, T4 = undefined> = (t1?: T1, t2?: T2, t3?: T3, t4?: T4) => R; | ||
export type ActionFunction0<R> = () => R; | ||
export type ActionFunction1<T1, R> = (t1: T1) => R; | ||
export type ActionFunction2<T1, T2, R> = (t1: T1, t2: T2) => R; | ||
export type ActionFunction3<T1, T2, T3, R> = (t1: T1, t2: T2, t3: T3) => R; | ||
export type ActionFunction4<T1, T2, T3, T4, R> = (t1: T1, t2: T2, t3: T3, t4: T4) => R; | ||
export type ActionFunctionAny<R> = (...args: any[]) => R; | ||
@@ -60,12 +69,32 @@ | ||
actionType: string | ||
): ActionFunction<Action<void>>; | ||
): ActionFunction0<Action<void>>; | ||
export function createAction<Payload, Arg1 = undefined, Arg2 = undefined, Arg3 = undefined, Arg4 = undefined>( | ||
export function createAction<Payload>( | ||
actionType: string, | ||
payloadCreator: ActionFunction<Payload, Arg1, Arg2, Arg3, Arg4> | ||
): ActionFunction<Action<Payload>, Arg1, Arg2, Arg3, Arg4>; | ||
payloadCreator: ActionFunction0<Payload> | ||
): ActionFunction0<Action<Payload>>; | ||
export function createAction<Payload, Arg1>( | ||
actionType: string, | ||
payloadCreator: ActionFunction1<Arg1, Payload> | ||
): ActionFunction1<Arg1, Action<Payload>>; | ||
export function createAction<Payload, Arg1, Arg2>( | ||
actionType: string, | ||
payloadCreator: ActionFunction2<Arg1, Arg2, Payload> | ||
): ActionFunction2<Arg1, Arg2, Action<Payload>>; | ||
export function createAction<Payload, Arg1, Arg2, Arg3>( | ||
actionType: string, | ||
payloadCreator: ActionFunction3<Arg1, Arg2, Arg3, Payload> | ||
): ActionFunction3<Arg1, Arg2, Arg3, Action<Payload>>; | ||
export function createAction<Payload, Arg1, Arg2, Arg3, Arg4>( | ||
actionType: string, | ||
payloadCreator: ActionFunction4<Arg1, Arg2, Arg3, Arg4, Payload> | ||
): ActionFunction4<Arg1, Arg2, Arg3, Arg4, Action<Payload>>; | ||
export function createAction<Payload>( | ||
actionType: string | ||
): ActionFunction<Action<Payload>, Payload>; | ||
): ActionFunction1<Payload, Action<Payload>>; | ||
@@ -78,7 +107,25 @@ export function createAction<Payload, Meta>( | ||
export function createAction<Payload, Meta, Arg1>( | ||
actionType: string, | ||
payloadCreator: ActionFunction1<Arg1, Payload>, | ||
metaCreator: ActionFunction1<Arg1, Meta> | ||
): ActionFunction1<Arg1, ActionMeta<Payload, Meta>>; | ||
export function createAction<Payload, Meta, Arg1, Arg2>( | ||
actionType: string, | ||
payloadCreator: ActionFunction2<Arg1, Arg2, Payload>, | ||
metaCreator: ActionFunction2<Arg1, Arg2, Meta> | ||
): ActionFunction2<Arg1, Arg2, ActionMeta<Payload, Meta>>; | ||
export function createAction<Payload, Meta, Arg1, Arg2, Arg3>( | ||
actionType: string, | ||
payloadCreator: ActionFunction3<Arg1, Arg2, Arg3, Payload>, | ||
metaCreator: ActionFunction3<Arg1, Arg2, Arg3, Meta> | ||
): ActionFunction3<Arg1, Arg2, Arg3, ActionMeta<Payload, Meta>>; | ||
export function createAction<Payload, Meta, Arg1, Arg2, Arg3, Arg4>( | ||
actionType: string, | ||
payloadCreator: ActionFunction<Payload, Arg1, Arg2, Arg3, Arg4>, | ||
metaCreator: ActionFunction<Meta, Arg1, Arg2, Arg3, Arg4> | ||
): ActionFunction<ActionMeta<Payload, Meta>, Arg1, Arg2, Arg3, Arg4>; | ||
payloadCreator: ActionFunction4<Arg1, Arg2, Arg3, Arg4, Payload>, | ||
metaCreator: ActionFunction4<Arg1, Arg2, Arg3, Arg4, Meta> | ||
): ActionFunction4<Arg1, Arg2, Arg3, Arg4, ActionMeta<Payload, Meta>>; | ||
@@ -97,15 +144,20 @@ export function handleAction<State, Payload>( | ||
export function handleActions<State>( | ||
reducerMap: ReducerMap<State>, | ||
export function handleActions<StateAndPayload>( | ||
reducerMap: ReducerMap<StateAndPayload, StateAndPayload>, | ||
initialState: StateAndPayload | ||
): Reducer<StateAndPayload, StateAndPayload>; | ||
export function handleActions<State, Payload>( | ||
reducerMap: ReducerMap<State, Payload>, | ||
initialState: State | ||
): Reducer<State, any>; | ||
): Reducer<State, Payload>; | ||
export function handleActions<State, Meta>( | ||
reducerMap: ReducerMapMeta<State, Meta>, | ||
export function handleActions<State, Payload, Meta>( | ||
reducerMap: ReducerMapMeta<State, Payload, Meta>, | ||
initialState: State | ||
): ReducerMeta<State, any, Meta>; | ||
): ReducerMeta<State, Payload, Meta>; | ||
export function combineActions(...actionTypes: Array<ActionFunctions<any> | string>): string; | ||
export interface ActionMap<Payload, Meta = undefined> { | ||
export interface ActionMap<Payload, Meta> { | ||
[actionType: string]: | ||
@@ -119,3 +171,3 @@ ActionMap<Payload, Meta> | | ||
export function createActions<Payload>( | ||
actionMap: ActionMap<Payload>, | ||
actionMap: ActionMap<Payload, any>, | ||
...identityActions: string[] | ||
@@ -125,8 +177,1 @@ ): { | ||
}; | ||
export function createActions<Payload, Meta>( | ||
actionMap: ActionMap<Payload, Meta>, | ||
...identityActions: string[] | ||
): { | ||
[actionName: string]: ActionFunctionAny<ActionMeta<Payload, Meta>> | ||
}; |
{ | ||
"name": "@types/redux-actions", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "TypeScript definitions for redux-actions", | ||
@@ -30,4 +30,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "4be7edbd4f2367e271e6585bdc2c22b159dc655731b983beb3f3bcbf6e9f723c", | ||
"typeScriptVersion": "2.3" | ||
"typesPublisherContentHash": "55851bf0edb32612468e1152632749bdcc92a4e4e4361c5e910f79097a36eab1", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 20 Sep 2017 22:08:06 GMT | ||
* Last updated: Tue, 26 Sep 2017 18:18:49 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: ReduxActions |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8868
136