forked from angular-redux/ng-redux
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
35 lines (29 loc) · 921 Bytes
/
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
export interface Reducer extends Function {
(state: any, action: any): any;
}
export interface Dispatch extends Function {
(action: any): any;
}
export interface MiddlewareArg {
dispatch: Dispatch;
getState: Function;
}
export interface Middleware extends Function {
(obj: MiddlewareArg): Function;
}
export interface INgRedux {
getReducer(): Reducer;
replaceReducer(nextReducer: Reducer): void;
dispatch(action: any): any;
getState(): any;
subscribe(listener: Function): Function;
connect(
mapStateToTarget: (state: any) => Object,
mapDispatchToTarget?: Object | ((dispatch: Function) => Object)
): (target: Function | Object) => () => void;
}
export interface INgReduxProvider {
createStoreWith(reducer: Reducer, middlewares?: Array<Middleware | string>, storeEnhancers?: Function[]): void;
}
export var ngRedux: string;
export default ngRedux;