Skip to content

Commit 6f53f3b

Browse files
committed
Update TypeScript API
- allow state params definitions as an array or object - add missing reloadOnSearch field - simplify ITypedState interface - fix a whitespace consistency issue
1 parent 725cda6 commit 6f53f3b

File tree

1 file changed

+15
-28
lines changed

1 file changed

+15
-28
lines changed

api/angular-ui-router.d.ts

+15-28
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,16 @@ declare module ng.ui {
1515
controllerProvider?: any;
1616
resolve?: {};
1717
url?: string;
18-
params?: any[];
18+
params?: any;
1919
views?: {};
2020
abstract?: boolean;
2121
onEnter?: (...args: any[]) => void;
2222
onExit?: (...args: any[]) => void;
2323
data?: any;
24+
reloadOnSearch?: boolean;
2425
}
25-
26-
interface ITypedState<T> {
27-
name?: string;
28-
template?: string;
29-
templateUrl?: string;
30-
templateProvider?: () => string;
31-
controller?: any;
32-
controllerAs?: string;
33-
controllerProvider?: any;
34-
resolve?: {};
35-
url?: string;
36-
params?: any[];
37-
views?: {};
38-
abstract?: boolean;
39-
onEnter?: (...args: any[]) => void;
40-
onExit?: (...args: any[]) => void;
26+
27+
interface ITypedState<T> extends IState {
4128
data?: T;
4229
}
4330

@@ -115,19 +102,19 @@ declare module ng.ui {
115102
}
116103

117104
interface IUrlRouterService {
118-
/*
119-
* Triggers an update; the same update that happens when the address bar
120-
* url changes, aka $locationChangeSuccess.
121-
*
122-
* This method is useful when you need to use preventDefault() on the
123-
* $locationChangeSuccess event, perform some custom logic (route protection,
124-
* auth, config, redirection, etc) and then finally proceed with the transition
125-
* by calling $urlRouter.sync().
126-
*
127-
*/
105+
/*
106+
* Triggers an update; the same update that happens when the address bar
107+
* url changes, aka $locationChangeSuccess.
108+
*
109+
* This method is useful when you need to use preventDefault() on the
110+
* $locationChangeSuccess event, perform some custom logic (route protection,
111+
* auth, config, redirection, etc) and then finally proceed with the transition
112+
* by calling $urlRouter.sync().
113+
*
114+
*/
128115
sync(): void;
129116
}
130-
117+
131118
interface IUiViewScrollProvider {
132119
/*
133120
* Reverts back to using the core $anchorScroll service for scrolling

0 commit comments

Comments
 (0)