diff --git a/types/angular-ui-router/angular-ui-router-tests.ts b/types/angular-ui-router/angular-ui-router-tests.ts index 8f9ec67486..406e94a1eb 100644 --- a/types/angular-ui-router/angular-ui-router-tests.ts +++ b/types/angular-ui-router/angular-ui-router-tests.ts @@ -197,6 +197,11 @@ class UrlLocatorTestService implements IUrlLocatorTestService { this.$state.get(this.$state.current); this.$state.get(this.$state.current, "yourState"); this.$state.get(this.$state.current, this.$state.current); + + // make sure get() accepts a discriminated union type as well + let myState: string | ng.ui.IState; + this.$state.get(myState); + this.$state.reload(); // http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#properties diff --git a/types/angular-ui-router/index.d.ts b/types/angular-ui-router/index.d.ts index f0b8ffd00b..4a1e147bf9 100644 --- a/types/angular-ui-router/index.d.ts +++ b/types/angular-ui-router/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for Angular JS (ui.router module) 1.1.5 +// Type definitions for Angular JS (ui.router module) 1.1.38 // Project: https://github.com/angular-ui/ui-router -// Definitions by: Michel Salib , Ivan Matiishyn +// Definitions by: Michel Salib +// Ivan Matiishyn +// Mike Haas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -272,10 +274,7 @@ declare module 'angular' { is(state: IState, params?: {}): boolean; href(state: IState, params?: {}, options?: IHrefOptions): string; href(state: string, params?: {}, options?: IHrefOptions): string; - get(state: string, context?: string): IState; - get(state: IState, context?: string): IState; - get(state: string, context?: IState): IState; - get(state: IState, context?: IState): IState; + get(state: string | IState, context?: string | IState): IState; get(): IState[]; /** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */ current: IState;