|
1 | | -import{ |
2 | | -connectasinnerConnect, |
3 | | -MapStateToPropsParam, |
4 | | -MapDispatchToPropsParam, |
5 | | -MergeProps, |
6 | | -Options, |
7 | | -InferableComponentEnhancer, |
8 | | -DispatchProp, |
9 | | -InferableComponentEnhancerWithProps, |
10 | | -}from'react-redux' |
11 | 1 | import{StoreState}from'../models/store.model' |
| 2 | +import{ActionCreatorDefinition,StateToProps}from'redux-ts' |
12 | 3 |
|
13 | | -exportinterfaceConnect<TStore>{ |
14 | | -():InferableComponentEnhancer<DispatchProp> |
15 | | - |
16 | | -<TStateProps={},no_dispatch={},TOwnProps={},State=TStore>( |
17 | | -mapStateToProps:MapStateToPropsParam<TStateProps,TOwnProps,State>, |
18 | | -):InferableComponentEnhancerWithProps< |
19 | | -TStateProps&DispatchProp&TOwnProps, |
20 | | -TOwnProps |
21 | | -> |
22 | | - |
23 | | -<no_state={},TDispatchProps={},TOwnProps={}>( |
24 | | -mapStateToProps:null|undefined, |
25 | | -mapDispatchToProps:MapDispatchToPropsParam<TDispatchProps,TOwnProps>, |
26 | | -):InferableComponentEnhancerWithProps<TDispatchProps&TOwnProps,TOwnProps> |
27 | | - |
28 | | -<TStateProps={},TDispatchProps={},TOwnProps={},State=TStore>( |
29 | | -mapStateToProps:MapStateToPropsParam<TStateProps,TOwnProps,State>, |
30 | | -mapDispatchToProps:MapDispatchToPropsParam<TDispatchProps,TOwnProps>, |
31 | | -):InferableComponentEnhancerWithProps< |
32 | | -TStateProps&TDispatchProps&TOwnProps, |
33 | | -TOwnProps |
34 | | -> |
35 | | - |
36 | | -< |
37 | | -TStateProps={}, |
38 | | -no_dispatch={}, |
39 | | -TOwnProps={}, |
40 | | -TMergedProps={}, |
41 | | -State=TStore |
42 | | ->( |
43 | | -mapStateToProps:MapStateToPropsParam<TStateProps,TOwnProps,State>, |
44 | | -mapDispatchToProps:null|undefined, |
45 | | -mergeProps:MergeProps<TStateProps,undefined,TOwnProps,TMergedProps>, |
46 | | -):InferableComponentEnhancerWithProps<TMergedProps,TOwnProps> |
47 | | - |
48 | | -<no_state={},TDispatchProps={},TOwnProps={},TMergedProps={}>( |
49 | | -mapStateToProps:null|undefined, |
50 | | -mapDispatchToProps:MapDispatchToPropsParam<TDispatchProps,TOwnProps>, |
51 | | -mergeProps:MergeProps<undefined,TDispatchProps,TOwnProps,TMergedProps>, |
52 | | -):InferableComponentEnhancerWithProps<TMergedProps,TOwnProps> |
53 | | - |
54 | | -<no_state={},no_dispatch={},TOwnProps={},TMergedProps={}>( |
55 | | -mapStateToProps:null|undefined, |
56 | | -mapDispatchToProps:null|undefined, |
57 | | -mergeProps:MergeProps<undefined,undefined,TOwnProps,TMergedProps>, |
58 | | -):InferableComponentEnhancerWithProps<TMergedProps,TOwnProps> |
59 | | - |
60 | | -< |
61 | | -TStateProps={}, |
62 | | -TDispatchProps={}, |
63 | | -TOwnProps={}, |
64 | | -TMergedProps={}, |
65 | | -State=TStore |
66 | | ->( |
67 | | -mapStateToProps:MapStateToPropsParam<TStateProps,TOwnProps,State>, |
68 | | -mapDispatchToProps:MapDispatchToPropsParam<TDispatchProps,TOwnProps>, |
69 | | -mergeProps:MergeProps< |
70 | | -TStateProps, |
71 | | -TDispatchProps, |
72 | | -TOwnProps, |
73 | | -TMergedProps |
74 | | ->, |
75 | | -):InferableComponentEnhancerWithProps<TMergedProps,TOwnProps> |
76 | | - |
77 | | -<TStateProps={},no_dispatch={},TOwnProps={},State=TStore>( |
78 | | -mapStateToProps:MapStateToPropsParam<TStateProps,TOwnProps,State>, |
79 | | -mapDispatchToProps:null|undefined, |
80 | | -mergeProps:null|undefined, |
81 | | -options:Options<State,TStateProps,TOwnProps>, |
82 | | -):InferableComponentEnhancerWithProps<DispatchProp&TStateProps,TOwnProps> |
83 | | - |
84 | | -<TStateProps={},TDispatchProps={},TOwnProps={}>( |
85 | | -mapStateToProps:null|undefined, |
86 | | -mapDispatchToProps:MapDispatchToPropsParam<TDispatchProps,TOwnProps>, |
87 | | -mergeProps:null|undefined, |
88 | | -options:Options<{},TStateProps,TOwnProps>, |
89 | | -):InferableComponentEnhancerWithProps<TDispatchProps,TOwnProps> |
90 | | - |
91 | | -<TStateProps={},TDispatchProps={},TOwnProps={},State=TStore>( |
92 | | -mapStateToProps:MapStateToPropsParam<TStateProps,TOwnProps,State>, |
93 | | -mapDispatchToProps:MapDispatchToPropsParam<TDispatchProps,TOwnProps>, |
94 | | -mergeProps:null|undefined, |
95 | | -options:Options<State,TStateProps,TOwnProps>, |
96 | | -):InferableComponentEnhancerWithProps< |
97 | | -TStateProps&TDispatchProps, |
98 | | -TOwnProps |
99 | | -> |
100 | | - |
101 | | -< |
102 | | -TStateProps={}, |
103 | | -TDispatchProps={}, |
104 | | -TOwnProps={}, |
105 | | -TMergedProps={}, |
106 | | -State=TStore |
107 | | ->( |
108 | | -mapStateToProps:MapStateToPropsParam<TStateProps,TOwnProps,State>, |
109 | | -mapDispatchToProps:MapDispatchToPropsParam<TDispatchProps,TOwnProps>, |
110 | | -mergeProps:MergeProps< |
111 | | -TStateProps, |
112 | | -TDispatchProps, |
113 | | -TOwnProps, |
114 | | -TMergedProps |
115 | | ->, |
116 | | -options:Options<State,TStateProps,TOwnProps,TMergedProps>, |
117 | | -):InferableComponentEnhancerWithProps<TMergedProps,TOwnProps> |
118 | | -} |
119 | | - |
120 | | -exportconstconnect:Connect<StoreState>=innerConnect |
| 4 | +exportconstmapStoreToProps:StateToProps<StoreState>=map=>map |