Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 26 additions & 29 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
import { Unsubscribe } from 'redux';

declare namespace ngRedux {
export interface Reducer extends Function {
(state: any, action: any): any;
}
export interface Reducer extends Function {
(state: any, action: any): any;
}

export interface Dispatch extends Function {
(action: any): any;
}
export interface Dispatch extends Function {
(action: any): any;
}

export interface MiddlewareArg {
dispatch: Dispatch;
getState: Function;
}
export interface MiddlewareArg {
dispatch: Dispatch;
getState: Function;
}

export interface Middleware extends Function {
(obj: MiddlewareArg): 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): Unsubscribe;
connect(
mapStateToTarget: (state: any) => Object,
mapDispatchToTarget?: Object | ((dispatch: Function) => Object)
): (target: Function | Object) => () => void;
}
export interface INgRedux {
getReducer(): Reducer;
replaceReducer(nextReducer: Reducer): void;
dispatch(action: any): any;
getState(): any;
subscribe(listener: Function): Unsubscribe;
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[], initialState?: any): void;
}
export interface INgReduxProvider {
createStoreWith(reducer: Reducer, middlewares?: Array<Middleware | string>, storeEnhancers?: Function[], initialState?: any): void;
}

declare var ngRedux: string;
export as namespace ngRedux;
export default ngRedux;