Skip to content

Commit

Permalink
Typescript 2.8 default type fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shakeskeyboarde committed Jul 29, 2019
1 parent 68b5252 commit e26cb19
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ export type ReducersMapObject<S = any, A extends Action = Action> = {
*
* @template M Object map of reducers as provided to `combineReducers(map: M)`.
*/
export type StateFromReducersMapObject<M> = M extends ReducersMapObject
export type StateFromReducersMapObject<M> = M extends ReducersMapObject<
any,
any
>
? { [P in keyof M]: M[P] extends Reducer<infer S, any> ? S : never }
: never

Expand Down Expand Up @@ -106,7 +109,10 @@ export type ActionFromReducer<R> = R extends Reducer<any, infer A> ? A : never
*
* @template M Object map of reducers as provided to `combineReducers(map: M)`.
*/
export type ActionFromReducersMapObject<M> = M extends ReducersMapObject
export type ActionFromReducersMapObject<M> = M extends ReducersMapObject<
any,
any
>
? ActionFromReducer<ReducerFromReducersMapObject<M>>
: never

Expand Down

0 comments on commit e26cb19

Please sign in to comment.