From 469b9a8bc5a3224403cb2e7d19c5995a46f30992 Mon Sep 17 00:00:00 2001 From: Marc-Andre Roy Date: Fri, 22 Mar 2013 11:18:26 -0400 Subject: [PATCH 1/2] Update definition file for durandal.d.ts - Make applicationHost parameter optional in setRoot - Add missing activeRoute definition - Add missing useConvention definition - Add missing handleInvalidRoute definition - Change mapRoute definition so you can pass an URL with all the other parameters as you will usealy do or you pass a RouteInfo object without having to give it any other parameter. moduleId, name and visible are now optional. --- durandal/durandal.d.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/durandal/durandal.d.ts b/durandal/durandal.d.ts index 5e85b3f67..c5c5de3b1 100644 --- a/durandal/durandal.d.ts +++ b/durandal/durandal.d.ts @@ -64,7 +64,7 @@ declare module "durandal/app" { * @param transition If you have a splash screen, you may want to specify an optional transition to animate from the splash to your main shell. * @param applicationHost parameter is optional. If provided it should be an element id for the node into which the UI should be composed. If it is not provided the default is to look for an element with an id of "applicationHost". */ - export var setRoot: (root: any, transition: string, applicationHost: string) => void; + export var setRoot: (root: any, transition: string, applicationHost?: string) => void; /** * If you intend to run on mobile, you should also call app.adaptToDevice() before setting the root. */ @@ -368,6 +368,10 @@ declare module "durandal/plugins/router" { * An observable whose value is the currently active item/module/page. */ export var activeItem: IDurandalViewModelActiveItem; + /** + * An observable whose value is the currently active route. + */ + export var activeRoute: KnockoutObservableAny; /** * called after an a new module is composed */ @@ -376,6 +380,10 @@ declare module "durandal/plugins/router" { * Causes the router to move backwards in page history. */ export var navigateBack: () => void; + /** + * Use router default convention. + */ + export var useConvention: () => void; /** * Causes the router to navigate to a specific url. */ @@ -400,6 +408,10 @@ declare module "durandal/plugins/router" { * This should not normally be overwritten. But advanced users can override this to completely transform the developer's routeInfo input into the final version used to configure the router. */ export var prepareRouteInfo: (info: routeInfo) => void; + /** + * This should not normally be overwritten. But advanced users can override this to completely transform the developer's routeInfo input into the final version used to configure the router. + */ + export var handleInvalidRoute: (route: routeInfo, parameters: any) => void; /** * Once the router is required, you can call router.mapAuto(). This is the most basic configuration option. When you call this function (with no parameters) it tells the router to directly correlate route parameters to module names in the viewmodels folder. */ @@ -411,7 +423,7 @@ declare module "durandal/plugins/router" { /** * You can pass a single routeInfo to this function, or you can pass the basic configuration parameters. url is your url pattern, moduleId is the module path this pattern will map to, name is used as the document title and visible determines whether or not to include it in the router's visibleRoutes array for easy navigation UI binding. */ - export var mapRoute: (url: string, moduleId: string, name: string, visible: bool) => routeInfo; + export var mapRoute: (urlOrRouteInfo: any, moduleId?: string, name?: string, visible?: bool) => routeInfo; /** * This function takes an array of routeInfo objects or a single routeInfo object and uses it to configure the router. The finalized routeInfo (or array of infos) is returned. */ @@ -423,4 +435,4 @@ declare module "durandal/plugins/router" { * After you've configured the router, you need to activate it. This is usually done in your shell. The activate function of the router returns a promise that resolves when the router is ready to start. To use the router, you should add an activate function to your shell and return the result from that. The application startup infrastructure of Durandal will detect your shell's activate function and call it at the appropriate time, waiting for it's promise to resolve. This allows Durandal to properly orchestrate the timing of composition and databinding along with animations and splash screen display. */ export var activate: (defaultRoute: string) => JQueryPromise; -} \ No newline at end of file +} From 10890574d3c6fddbe0acae1943ee02935d55ff8e Mon Sep 17 00:00:00 2001 From: Marc-Andre Roy Date: Fri, 22 Mar 2013 16:18:55 -0400 Subject: [PATCH 2/2] Add backgroundpositionClass to definition Add backgroundpositionClass to ToastrOptions interface --- toastr/toastr.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toastr/toastr.d.ts b/toastr/toastr.d.ts index f1a038704..8d3047ad7 100644 --- a/toastr/toastr.d.ts +++ b/toastr/toastr.d.ts @@ -62,6 +62,10 @@ interface ToastrOptions { */ positionClass?: string; /** + * Where toast should be displayed - background + */ + backgroundpositionClass?: string; + /** * Time in milliseconds that the toast should be displayed */ timeOut?: number; @@ -146,4 +150,4 @@ interface Toastr { version: string; } -declare var toastr: Toastr; \ No newline at end of file +declare var toastr: Toastr;