|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+// flow-typed signature: 0ed284c5a2e97a9e3c0e87af3dedc09d
|
|
|
2
|
+// flow-typed version: bdf1e66252/react-redux_v5.x.x/flow_>=v0.30.x
|
|
|
3
|
+
|
|
|
4
|
+import type { Dispatch, Store } from 'redux'
|
|
|
5
|
+
|
|
|
6
|
+declare module 'react-redux' {
|
|
|
7
|
+
|
|
|
8
|
+ /*
|
|
|
9
|
+
|
|
|
10
|
+ S = State
|
|
|
11
|
+ A = Action
|
|
|
12
|
+ OP = OwnProps
|
|
|
13
|
+ SP = StateProps
|
|
|
14
|
+ DP = DispatchProps
|
|
|
15
|
+
|
|
|
16
|
+ */
|
|
|
17
|
+
|
|
|
18
|
+ declare type MapStateToProps<S, OP: Object, SP: Object> = (state: S, ownProps: OP) => SP | MapStateToProps<S, OP, SP>;
|
|
|
19
|
+
|
|
|
20
|
+ declare type MapDispatchToProps<A, OP: Object, DP: Object> = ((dispatch: Dispatch<A>, ownProps: OP) => DP) | DP;
|
|
|
21
|
+
|
|
|
22
|
+ declare type MergeProps<SP, DP: Object, OP: Object, P: Object> = (stateProps: SP, dispatchProps: DP, ownProps: OP) => P;
|
|
|
23
|
+
|
|
|
24
|
+ declare type StatelessComponent<P> = (props: P) => ?React$Element<any>;
|
|
|
25
|
+
|
|
|
26
|
+ declare class ConnectedComponent<OP, P, Def, St> extends React$Component<void, OP, void> {
|
|
|
27
|
+ static WrappedComponent: Class<React$Component<Def, P, St>>;
|
|
|
28
|
+ getWrappedInstance(): React$Component<Def, P, St>;
|
|
|
29
|
+ static defaultProps: void;
|
|
|
30
|
+ props: OP;
|
|
|
31
|
+ state: void;
|
|
|
32
|
+ }
|
|
|
33
|
+
|
|
|
34
|
+ declare type ConnectedComponentClass<OP, P, Def, St> = Class<ConnectedComponent<OP, P, Def, St>>;
|
|
|
35
|
+
|
|
|
36
|
+ declare type Connector<OP, P> = {
|
|
|
37
|
+ (component: StatelessComponent<P>): ConnectedComponentClass<OP, P, void, void>;
|
|
|
38
|
+ <Def, St>(component: Class<React$Component<Def, P, St>>): ConnectedComponentClass<OP, P, Def, St>;
|
|
|
39
|
+ };
|
|
|
40
|
+
|
|
|
41
|
+ declare class Provider<S, A> extends React$Component<void, { store: Store<S, A>, children?: any }, void> { }
|
|
|
42
|
+
|
|
|
43
|
+ declare type ConnectOptions = {
|
|
|
44
|
+ pure?: boolean,
|
|
|
45
|
+ withRef?: boolean
|
|
|
46
|
+ };
|
|
|
47
|
+
|
|
|
48
|
+ declare type Null = null | void;
|
|
|
49
|
+
|
|
|
50
|
+ declare function connect<A, OP>(
|
|
|
51
|
+ ...rest: Array<void> // <= workaround for https://github.com/facebook/flow/issues/2360
|
|
|
52
|
+ ): Connector<OP, $Supertype<{ dispatch: Dispatch<A> } & OP>>;
|
|
|
53
|
+
|
|
|
54
|
+ declare function connect<A, OP>(
|
|
|
55
|
+ mapStateToProps: Null,
|
|
|
56
|
+ mapDispatchToProps: Null,
|
|
|
57
|
+ mergeProps: Null,
|
|
|
58
|
+ options: ConnectOptions
|
|
|
59
|
+ ): Connector<OP, $Supertype<{ dispatch: Dispatch<A> } & OP>>;
|
|
|
60
|
+
|
|
|
61
|
+ declare function connect<S, A, OP, SP>(
|
|
|
62
|
+ mapStateToProps: MapStateToProps<S, OP, SP>,
|
|
|
63
|
+ mapDispatchToProps: Null,
|
|
|
64
|
+ mergeProps: Null,
|
|
|
65
|
+ options?: ConnectOptions
|
|
|
66
|
+ ): Connector<OP, $Supertype<SP & { dispatch: Dispatch<A> } & OP>>;
|
|
|
67
|
+
|
|
|
68
|
+ declare function connect<A, OP, DP>(
|
|
|
69
|
+ mapStateToProps: Null,
|
|
|
70
|
+ mapDispatchToProps: MapDispatchToProps<A, OP, DP>,
|
|
|
71
|
+ mergeProps: Null,
|
|
|
72
|
+ options?: ConnectOptions
|
|
|
73
|
+ ): Connector<OP, $Supertype<DP & OP>>;
|
|
|
74
|
+
|
|
|
75
|
+ declare function connect<S, A, OP, SP, DP>(
|
|
|
76
|
+ mapStateToProps: MapStateToProps<S, OP, SP>,
|
|
|
77
|
+ mapDispatchToProps: MapDispatchToProps<A, OP, DP>,
|
|
|
78
|
+ mergeProps: Null,
|
|
|
79
|
+ options?: ConnectOptions
|
|
|
80
|
+ ): Connector<OP, $Supertype<SP & DP & OP>>;
|
|
|
81
|
+
|
|
|
82
|
+ declare function connect<S, A, OP, SP, DP, P>(
|
|
|
83
|
+ mapStateToProps: MapStateToProps<S, OP, SP>,
|
|
|
84
|
+ mapDispatchToProps: MapDispatchToProps<A, OP, DP>,
|
|
|
85
|
+ mergeProps: MergeProps<SP, DP, OP, P>,
|
|
|
86
|
+ options?: ConnectOptions
|
|
|
87
|
+ ): Connector<OP, P>;
|
|
|
88
|
+
|
|
|
89
|
+}
|