From e5d4ce49e480fad27f8bae262de6e0f8ff2abf5d Mon Sep 17 00:00:00 2001 From: dballance Date: Thu, 10 Dec 2015 21:20:44 -0600 Subject: [PATCH] Fix typings in packaged index.d.ts Convert typescript typings to an external module. --- index.d.ts | 60 +++++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/index.d.ts b/index.d.ts index bdb3833..18d3255 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,39 +1,35 @@ -declare module ngRedux { - - interface Reducer extends Function { - (state: any, action: any): any; - } +export interface Reducer extends Function { + (state: any, action: any): any; +} - interface Dispatch extends Function { - (action: any): any; - } +export interface Dispatch extends Function { + (action: any): any; +} - interface MiddlewareArg { - dispatch: Dispatch; - getState: Function; - } +export interface MiddlewareArg { + dispatch: Dispatch; + getState: Function; +} - interface Middleware extends Function { - (obj: MiddlewareArg): Function; - } +export interface Middleware extends Function { + (obj: MiddlewareArg): Function; +} - 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 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; +} - interface INgReduxProvider { - createStoreWith(reducer: Reducer, middlewares?: Array, storeEnhancers?: Function[]): void; - } +export interface INgReduxProvider { + createStoreWith(reducer: Reducer, middlewares?: Array, storeEnhancers?: Function[]): void; } -declare module "ngRedux" { - export = ngRedux; -} \ No newline at end of file +export var ngRedux: string; +export default ngRedux; \ No newline at end of file