-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredux.ts
More file actions
29 lines (21 loc) · 758 Bytes
/
Copy pathredux.ts
File metadata and controls
29 lines (21 loc) · 758 Bytes
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
type ActionCreatorMap<ActionMap> = {
[key in keyof ActionMap]: (params?, arg2?, arg3?, arg4?) => ActionMap[key]
}
type ValueOf<ActionMap> = ActionMap[keyof ActionMap];
function returnType<ActionMap>(action:ActionCreatorMap<ActionMap>) {
type Action = ValueOf<ActionMap>;
return {} as any as Action;
}
const mockAction = returnType(action);
type ActionType = typeof mockAction;
type Reverse<T> = (arg: any) => T;
function returnResultType<T>(arg:Reverse<T>): T{
return {} as any as T;
}
type Reducer<S> = (state:s, action:any) => T;
type ReducersMap<FullState> = {
[ key in keyof FullState]: Reducer<FullState[key]>;
}
function returnStateType<Fullstate>(reducerMap: ReducersMap<Fullstate>): FullState {
return {} as any as FullState;
}