From 6f53f3b564b71db23575c261b31d18a93fd935a4 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Fri, 7 Nov 2014 14:32:57 -0500 Subject: [PATCH] Update TypeScript API - allow state params definitions as an array or object - add missing reloadOnSearch field - simplify ITypedState interface - fix a whitespace consistency issue --- api/angular-ui-router.d.ts | 43 +++++++++++++------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/api/angular-ui-router.d.ts b/api/angular-ui-router.d.ts index 8dd428323..e661ed8b2 100644 --- a/api/angular-ui-router.d.ts +++ b/api/angular-ui-router.d.ts @@ -15,29 +15,16 @@ declare module ng.ui { controllerProvider?: any; resolve?: {}; url?: string; - params?: any[]; + params?: any; views?: {}; abstract?: boolean; onEnter?: (...args: any[]) => void; onExit?: (...args: any[]) => void; data?: any; + reloadOnSearch?: boolean; } - - interface ITypedState { - name?: string; - template?: string; - templateUrl?: string; - templateProvider?: () => string; - controller?: any; - controllerAs?: string; - controllerProvider?: any; - resolve?: {}; - url?: string; - params?: any[]; - views?: {}; - abstract?: boolean; - onEnter?: (...args: any[]) => void; - onExit?: (...args: any[]) => void; + + interface ITypedState extends IState { data?: T; } @@ -115,19 +102,19 @@ declare module ng.ui { } interface IUrlRouterService { - /* - * Triggers an update; the same update that happens when the address bar - * url changes, aka $locationChangeSuccess. - * - * This method is useful when you need to use preventDefault() on the - * $locationChangeSuccess event, perform some custom logic (route protection, - * auth, config, redirection, etc) and then finally proceed with the transition - * by calling $urlRouter.sync(). - * - */ + /* + * Triggers an update; the same update that happens when the address bar + * url changes, aka $locationChangeSuccess. + * + * This method is useful when you need to use preventDefault() on the + * $locationChangeSuccess event, perform some custom logic (route protection, + * auth, config, redirection, etc) and then finally proceed with the transition + * by calling $urlRouter.sync(). + * + */ sync(): void; } - + interface IUiViewScrollProvider { /* * Reverts back to using the core $anchorScroll service for scrolling