Skip to content

Commit 0f9fe17

Browse files
Fix: update typings to fit with umd module
1 parent 2b7e490 commit 0f9fe17

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

Diff for: index.d.ts

+31-28
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
1-
export interface Reducer extends Function {
2-
(state: any, action: any): any;
3-
}
1+
declare namespace ngRedux {
2+
export interface Reducer extends Function {
3+
(state: any, action: any): any;
4+
}
45

5-
export interface Dispatch extends Function {
6-
(action: any): any;
7-
}
6+
export interface Dispatch extends Function {
7+
(action: any): any;
8+
}
89

9-
export interface MiddlewareArg {
10-
dispatch: Dispatch;
11-
getState: Function;
12-
}
10+
export interface MiddlewareArg {
11+
dispatch: Dispatch;
12+
getState: Function;
13+
}
1314

14-
export interface Middleware extends Function {
15-
(obj: MiddlewareArg): Function;
16-
}
15+
export interface Middleware extends Function {
16+
(obj: MiddlewareArg): Function;
17+
}
1718

18-
export interface INgRedux {
19-
getReducer(): Reducer;
20-
replaceReducer(nextReducer: Reducer): void;
21-
dispatch(action: any): any;
22-
getState(): any;
23-
subscribe(listener: Function): Function;
24-
connect(
25-
mapStateToTarget: (state: any) => Object,
26-
mapDispatchToTarget?: Object | ((dispatch: Function) => Object)
27-
): (target: Function | Object) => () => void;
28-
}
19+
export interface INgRedux {
20+
getReducer(): Reducer;
21+
replaceReducer(nextReducer: Reducer): void;
22+
dispatch(action: any): any;
23+
getState(): any;
24+
subscribe(listener: Function): Function;
25+
connect(
26+
mapStateToTarget: (state: any) => Object,
27+
mapDispatchToTarget?: Object | ((dispatch: Function) => Object)
28+
): (target: Function | Object) => () => void;
29+
}
2930

30-
export interface INgReduxProvider {
31-
createStoreWith(reducer: Reducer, middlewares?: Array<Middleware | string>, storeEnhancers?: Function[], initialState?: any): void;
31+
export interface INgReduxProvider {
32+
createStoreWith(reducer: Reducer, middlewares?: Array<Middleware | string>, storeEnhancers?: Function[], initialState?: any): void;
33+
}
3234
}
3335

34-
export var ngRedux: string;
35-
export default ngRedux;
36+
declare var ngRedux: string;
37+
export as namespace ngRedux;
38+
export = ngRedux;

0 commit comments

Comments
 (0)