@types/redux-actions
Advanced tools
Comparing version 0.8.34 to 1.2.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for redux-actions v0.8.0 | ||
// Type definitions for redux-actions 1.2 | ||
// Project: https://github.com/acdlite/redux-actions | ||
@@ -26,18 +26,62 @@ // Definitions by: Jack Hsu <https://github.com/jaysoo>, Alex Gorbatchev <https://github.com/alexgorbatchev> | ||
interface ReducerMap<State, Payload> { | ||
[actionType: string]: Reducer<State, Payload>; | ||
[actionType: string]: Reducer<State, Payload> | ReducerNextThrow<State, Payload>; | ||
} | ||
interface Reducer<State, Payload> { | ||
(state: State, action: Action<Payload>): State; | ||
interface ReducerMapMeta<State, Payload, Meta> { | ||
[actionType: string]: Reducer<State, Payload> | ReducerNextThrow<State, Payload>; | ||
} | ||
interface ReducerMeta<State, Payload, Meta> extends Reducer<State, Payload> { | ||
(state: State, action: ActionMeta<Payload, Meta>): State; | ||
interface ReducerNextThrow<State, Payload> { | ||
next?(state: State, action: Action<Payload>): State; | ||
throw?(state: State, action: Action<Payload>): State; | ||
} | ||
interface ReducerNextThrowMeta<State, Payload, Meta> { | ||
next?(state: State, action: ActionMeta<Payload, Meta>): State; | ||
throw?(state: State, action: ActionMeta<Payload, Meta>): State; | ||
} | ||
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>>; | ||
type Reducer<State, Payload> = (state: State, action: Action<Payload>) => State; | ||
type ReducerMeta<State, Payload, Meta> = (state: State, action: ActionMeta<Payload, Meta>) => State; | ||
/** argument inferring borrowed from lodash definitions */ | ||
type ActionFunction0<R> = () => R; | ||
type ActionFunction1<T1, R> = (t1: T1) => R; | ||
type ActionFunction2<T1, T2, R> = (t1: T1, t2: T2) => R; | ||
type ActionFunction3<T1, T2, T3, R> = (t1: T1, t2: T2, t3: T3) => R; | ||
type ActionFunction4<T1, T2, T3, T4, R> = (t1: T1, t2: T2, t3: T3, t4: T4) => R; | ||
type ActionFunctionAny<R> = (...args: any[]) => R; | ||
export function createAction<Payload>( | ||
actionType: string, | ||
payloadCreator?: (...args: any[]) => Payload, | ||
): (...args: any[]) => Action<Payload>; | ||
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 | ||
): ActionFunctionAny<Action<Payload>>; | ||
export function createAction<Payload, Meta>( | ||
@@ -49,10 +93,5 @@ actionType: string, | ||
export function handleAction<StateAndPayload>( | ||
actionType: { toString: () => string }, | ||
reducer: Reducer<StateAndPayload, StateAndPayload> | ReducerMap<StateAndPayload, StateAndPayload> | ||
): Reducer<StateAndPayload, StateAndPayload>; | ||
export function handleAction<State, Payload>( | ||
actionType: { toString(): string }, | ||
reducer: Reducer<State, Payload> | ReducerMap<State, Payload> | ||
actionType: string | ActionFunctions<Payload>, | ||
reducer: Reducer<State, Payload> | ReducerNextThrow<State, Payload> | ||
): Reducer<State, Payload>; | ||
@@ -62,3 +101,3 @@ | ||
actionType: { toString(): string }, | ||
reducer: ReducerMeta<State, Payload, Meta> | ReducerMap<State, Payload> | ||
reducer: ReducerMeta<State, Payload, Meta> | ReducerNextThrowMeta<State, Payload, Meta> | ||
): Reducer<State, Payload>; | ||
@@ -68,3 +107,3 @@ | ||
reducerMap: ReducerMap<StateAndPayload, StateAndPayload>, | ||
initialState?: StateAndPayload | ||
initialState: StateAndPayload | ||
): Reducer<StateAndPayload, StateAndPayload>; | ||
@@ -74,8 +113,8 @@ | ||
reducerMap: ReducerMap<State, Payload>, | ||
initialState?: State | ||
initialState: State | ||
): Reducer<State, Payload>; | ||
export function combineActions( | ||
...actionTypes: { toString(): string }[] | ||
): { toString(): string }; | ||
...actionTypes: Array<ActionFunctions<any>> | ||
): Array<ActionFunctions<any>>; | ||
} |
{ | ||
"name": "@types/redux-actions", | ||
"version": "0.8.34", | ||
"version": "1.2.0", | ||
"description": "TypeScript definitions for redux-actions", | ||
@@ -15,3 +15,4 @@ "license": "MIT", | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "a7c9784a327b6a30bdccaaa56b765f4e308e295e185477ff4ea714439539ae8a" | ||
"typesPublisherContentHash": "f5db180db85997af0f24c7b33bd3a51a2234509db0da65aee98f8d56197cda7a", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -8,7 +8,6 @@ # Installation | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/redux-actions | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/redux-actions | ||
Additional Details | ||
* Last updated: Tue, 29 Nov 2016 20:54:33 GMT | ||
* File structure: UMD | ||
* Last updated: Tue, 27 Dec 2016 06:08:45 GMT | ||
* Library Dependencies: none | ||
@@ -15,0 +14,0 @@ * Module Dependencies: none |
@@ -5,4 +5,5 @@ { | ||
"moduleDependencies": [], | ||
"libraryMajorVersion": 0, | ||
"libraryMinorVersion": 8, | ||
"libraryMajorVersion": 1, | ||
"libraryMinorVersion": 2, | ||
"typeScriptVersion": "2.0", | ||
"libraryName": "redux-actions", | ||
@@ -12,8 +13,9 @@ "typingsPackageName": "redux-actions", | ||
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped", | ||
"sourceBranch": "types-2.0", | ||
"kind": "UMD", | ||
"sourceBranch": "master", | ||
"globals": [ | ||
"ReduxActions" | ||
], | ||
"declaredModules": [], | ||
"declaredModules": [ | ||
"redux-actions" | ||
], | ||
"files": [ | ||
@@ -23,3 +25,3 @@ "index.d.ts" | ||
"hasPackageJson": false, | ||
"contentHash": "a7c9784a327b6a30bdccaaa56b765f4e308e295e185477ff4ea714439539ae8a" | ||
"contentHash": "f5db180db85997af0f24c7b33bd3a51a2234509db0da65aee98f8d56197cda7a" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6680
115
1
18