From 6fb8560a58113a27222b5720734397151c207f50 Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Wed, 3 Apr 2013 08:53:04 -0300 Subject: [PATCH] resolved conflicts to pullrequest #442 --- durandal/durandal.d.ts | 18 ++++++++++++++++-- requirejs/require.d.ts | 4 +++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/durandal/durandal.d.ts b/durandal/durandal.d.ts index a5369261a..e7cf11ee4 100644 --- a/durandal/durandal.d.ts +++ b/durandal/durandal.d.ts @@ -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; + } \ No newline at end of file diff --git a/requirejs/require.d.ts b/requirejs/require.d.ts index e9351aa46..8faf0ce24 100644 --- a/requirejs/require.d.ts +++ b/requirejs/require.d.ts @@ -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; \ No newline at end of file