Merge pull request #451 from Diullei/master

resolved conflicts to pullrequest #442
This commit is contained in:
Diullei Gomes
2013-04-03 04:59:45 -07:00
2 changed files with 19 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ declare module "durandal/app" {
/**
* The events parameter is a space delimited string containing one or more event identifiers. When one of these events is triggered, the callback is called and passed the event data provided by the trigger. The special events value of "all" binds all events on the object to the callback. If a context is provided, it will be bound to this for the callback. If the callback is omitted, then a promise-like object is returned from on. This object represents a subscription and has a then function used to register callbacks.
*/
export var on: (events: string, callback: Function, context?) => any;
export var on: (events: string, callback: Function, context?) => IEventSubscription;
/**
* Unwires callbacks from events. If no context is specified, all callbacks with different contexts will be removed. If no callback is specified, all callbacks for the event will be removed. If no event is specified, all event callbacks on the object will be removed.
*/
@@ -419,7 +419,7 @@ declare module "durandal/plugins/router" {
/**
* Works the same as mapRoute except that routes are automatically added to the visibleRoutes array.
*/
export var mapNav: (url: string, moduleId?: string, name?: string) => routeInfo;
export var mapNav: (url: string, moduleId: string, name: string) => routeInfo;
/**
* 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.
*/
@@ -436,3 +436,17 @@ declare module "durandal/plugins/router" {
*/
export var activate: (defaultRoute: string) => JQueryPromise;
}
interface IEventSubscription
{
/**
* This function adding callback to event subscription
*/
then(thenCallback: any): void;
/**
* This function removing current subscription from event handlers
*/
off(): void;
}

View File

@@ -203,4 +203,6 @@ interface RequireDefine {
// Ambient declarations for 'require' and 'define'
declare var require: Require;
declare var define: RequireDefine;
declare var requirejs: Require;
declare var req: Require;
declare var define: RequireDefine;