From cb1b62852708536407d535aae31af77fef68cdd4 Mon Sep 17 00:00:00 2001 From: areel Date: Fri, 30 Aug 2013 21:29:47 +0100 Subject: [PATCH 1/2] eventName should be an object to support multiple event names: see code below taken from Backbone code base // Bind an event to a `callback` function. Passing `"all"` will bind // the callback to all events fired. on: function(name, callback, context) { if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; ======== // Implement fancy features of the Events API such as multiple event // names `"change blur"` and jQuery-style event maps `{change: action}` // in terms of the existing API. var eventsApi = function(obj, action, name, rest) { if (!name) return true; // Handle event maps. if (typeof name === 'object') { for (var key in name) { obj[action].apply(obj, [key, name[key]].concat(rest)); } return false; } Signed-off-by: areel --- backbone/backbone.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 0635a1247..1a6f3d8fe 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -67,7 +67,7 @@ declare module Backbone { } class Events { - on(eventName: string, callback: (...args: any[]) => void , context?: any): any; + on(eventName: any, callback: (...args: any[]) => void , context?: any): any; off(eventName?: string, callback?: (...args: any[]) => void , context?: any): any; trigger(eventName: string, ...args: any[]): any; bind(eventName: string, callback: (...args: any[]) => void , context?: any): any; From 34ce0b4ab98c930c8051671c93a992a080a33d27 Mon Sep 17 00:00:00 2001 From: areel Date: Sat, 31 Aug 2013 01:08:19 +0100 Subject: [PATCH 2/2] Correct ElementView to inherit from CellView Provide deepSupplement with options defaults. --- jointjs/jointjs.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jointjs/jointjs.d.ts b/jointjs/jointjs.d.ts index d3e6a204e..547263021 100644 --- a/jointjs/jointjs.d.ts +++ b/jointjs/jointjs.d.ts @@ -77,7 +77,7 @@ declare module joint { snapToGrid(p): { x: number; y: number; }; } - class ElementView { + class ElementView extends CellView { scale(sx: number, sy: number); } class CellView extends Backbone.View { @@ -110,6 +110,6 @@ declare module joint { function mixin(objects: any[]): any; function supplement(objects: any[]): any; function deepMixin(objects: any[]): any; - function deepSupplement(objects: any[]): any; + function deepSupplement(objects: any[], defaultIndicator?: any): any; } } \ No newline at end of file