mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-08 17:19:27 +08:00
update angular-ui-router state get to use union type
This commit is contained in:
@@ -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
|
||||
|
||||
11
types/angular-ui-router/index.d.ts
vendored
11
types/angular-ui-router/index.d.ts
vendored
@@ -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 <https://github.com/michelsalib>, Ivan Matiishyn <https://github.com/matiishyn>
|
||||
// Definitions by: Michel Salib <https://github.com/michelsalib>
|
||||
// Ivan Matiishyn <https://github.com/matiishyn>
|
||||
// Mike Haas <https://github.com/mikehaas763>
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user