Skip to content

Commit

Permalink
Better TypeScript declarations (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
bensgroi authored and hally9k committed Jul 19, 2018
1 parent c3a6593 commit 88326fe
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ export interface ReduxUIRouterAction {
payload: any;
}

/**
* The type of a redux-ui-router route
*/
export interface ReduxUIRoute {
name: string;
params: any;
url: string;
}

/**
* The shape of the state tree used to manage the state of redux-ui-router
*/
export interface ReduxUIRouterState {
currentState: Object;
currentParams: Object;
prevState: Object;
prevParams: Object;
currentState: ReduxUIRoute;
currentParams: any;
prevState: ReduxUIRoute;
prevParams: any;
}

/**
Expand All @@ -39,7 +48,7 @@ export var ngReduxUiRouter: string;
* @param {Object} options - (optional) Options object
* @return {Object} Action object
*/
export function stateGo(to: string, params?: Object, options?: Object): ReduxUIRouterAction;
export function stateGo(to: string, params?: any, options?: any): ReduxUIRouterAction;

/**
* This action create will trigger a $state.reload in the UiRouter Middleware.
Expand All @@ -63,7 +72,7 @@ export function stateReload(state: any): ReduxUIRouterAction;
* @param {Object} options - (optional) Options object
* @return {Object} Action object
*/
export function stateTransitionTo(to: string, params?: Object, options?: Object): ReduxUIRouterAction;
export function stateTransitionTo(to: string, params?: any, options?: any): ReduxUIRouterAction;

/**
* The default export is the name of the provided angular module
Expand Down

0 comments on commit 88326fe

Please sign in to comment.