forked from ember-redux/ember-redux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
62 lines (46 loc) · 1.86 KB
/
index.d.ts
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Type definitions for ember-redux 3.0.0
// Project: https://github.com/ember-redux/ember-redux
// Definitions by: Toran Billups <https://github.com/toranb>
// TypeScript Version: 2.4
import * as Redux from 'redux';
export = EmberRedux;
declare namespace EmberRedux {
type Dispatch = Redux.Dispatch;
type ActionCreator<A> = Redux.ActionCreator<A>;
export interface DispatchProp<T> {
dispatch: Dispatch
}
export function connect<TStateProps>(
mapStateToProps: MapStateToPropsParam<TStateProps>
): any;
export function connect<no_state, TDispatchProps>(
mapStateToProps: null | undefined,
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps>
): any;
export function connect<TStateProps, TDispatchProps>(
mapStateToProps: MapStateToPropsParam<TStateProps>,
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps>
): any;
interface MapStateToProps<TStateProps> {
(state: any): TStateProps;
}
interface MapStateToPropsFactory<TStateProps> {
(initialState: any): MapStateToProps<TStateProps>;
}
type MapStateToPropsParam<TStateProps> = MapStateToProps<TStateProps> | MapStateToPropsFactory<TStateProps>;
interface MapDispatchToPropsFunction<TDispatchProps> {
(dispatch: Dispatch): TDispatchProps;
}
interface MapDispatchToPropsObject {
[name: string]: ActionCreator<any>;
}
type MapDispatchToProps<TDispatchProps> =
MapDispatchToPropsFunction<TDispatchProps> | MapDispatchToPropsObject;
interface MapDispatchToPropsFactory<TDispatchProps> {
(dispatch: Dispatch): MapDispatchToProps<TDispatchProps>;
}
type MapDispatchToPropsParam<TDispatchProps> = MapDispatchToProps<TDispatchProps> | MapDispatchToPropsFactory<TDispatchProps>;
export function route<Function>(
routeFunc: Function
): any;
}