Skip to content

Commit 56a51e3

Browse files
committed
Merge pull request #35 from sstorie/master
Adding a typescript definition file.
2 parents 981625b + 7c1df51 commit 56a51e3

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

index.d.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
declare module ngRedux {
2+
3+
interface Reducer extends Function {
4+
(state: any, action: any): any;
5+
}
6+
7+
interface Dispatch extends Function {
8+
(action: any): any;
9+
}
10+
11+
interface MiddlewareArg {
12+
dispatch: Dispatch;
13+
getState: Function;
14+
}
15+
16+
interface Middleware extends Function {
17+
(obj: MiddlewareArg): Function;
18+
}
19+
20+
interface INgRedux {
21+
getReducer(): Reducer;
22+
replaceReducer(nextReducer: Reducer): void;
23+
dispatch(action: any): any;
24+
getState(): any;
25+
subscribe(listener: Function): Function;
26+
connect(
27+
mapStateToTarget: (state: any) => Object,
28+
mapDispatchToTarget?: Object | ((dispatch: Function) => Object)
29+
): (target: Function | Object) => () => void;
30+
}
31+
32+
interface INgReduxProvider {
33+
createStoreWith(reducer: Reducer, middlewares?: Array<Middleware | string>, storeEnhancers?: Function[]): void;
34+
}
35+
}
36+
37+
declare module "ngRedux" {
38+
export = ngRedux;
39+
}

0 commit comments

Comments
 (0)