From b98b49c0a90e94022bab5f55ee724eecafc2395c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Hedr=C3=A9n?= Date: Mon, 26 May 2014 20:33:36 +0200 Subject: [PATCH 1/4] Updated according to changes in Flight 1.1.4. --- flight/flight.d.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/flight/flight.d.ts b/flight/flight.d.ts index a00f6d958..4936c0baf 100644 --- a/flight/flight.d.ts +++ b/flight/flight.d.ts @@ -1,6 +1,6 @@ /// -// Type definitions for Flight 1.1.1 +// Type definitions for Flight 1.1.4 // Project: http://flightjs.github.com/flight/ // Definitions by: Jonathan Hedrén // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,10 +9,26 @@ declare module Flight { export interface Base { + /** + * Most Components and Mixins need to define attributes. In Flight, + * default values are assigned by passing an object to the attributes + * function. + * + * NOTE: this.attributes replaces the now deprecated this.defaultAttrs. + * However, for backwards compatibility, if you are using this.defaultAttrs + * then all the old attribute behavior remains in place. + */ + attributes(obj: Object): void; + + /** * Most Components and Mixins need to define attributes. In Flight, * default values are assigned by passing an object to the defaultAttrs * function. + * + * NOTE: this.attributes replaces the now deprecated this.defaultAttrs. + * However, for backwards compatibility, if you are using this.defaultAttrs + * then all the old attribute behavior remains in place. */ defaultAttrs(obj: Object): void; @@ -181,7 +197,6 @@ declare module Flight { $node: JQuery; } - export interface AdviceStatic { withAdvice(): Function; } From 7e009c5644b3c57c5cbc1934c9da097a5db06108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Hedr=C3=A9n?= Date: Mon, 26 May 2014 22:09:54 +0200 Subject: [PATCH 2/4] Updated tests. --- flight/flight-tests.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flight/flight-tests.ts b/flight/flight-tests.ts index 1bfe68d3a..c65db88aa 100644 --- a/flight/flight-tests.ts +++ b/flight/flight-tests.ts @@ -4,8 +4,12 @@ declare var els: Element[]; declare var mixinFn: Function; function TestComponent() { - var self: Flight.Component = this; - + var self: Flight.Component = this; + + self.attributes({ + fooSelector: '.bar' + }); + self.defaultAttrs({ fooSelector: '.bar' }); From 7d5f85d5e0661bbf139175dba7d1948e97701ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Hedr=C3=A9n?= Date: Mon, 26 May 2014 22:14:11 +0200 Subject: [PATCH 3/4] Touched file to trigger travisci. --- flight/flight-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/flight-tests.ts b/flight/flight-tests.ts index c65db88aa..9c66fa8b4 100644 --- a/flight/flight-tests.ts +++ b/flight/flight-tests.ts @@ -18,7 +18,7 @@ function TestComponent() { var el: HTMLElement = data.el; self.select('fooSelector').addClass('bar'); }; - + self.around('initialize', function () { }); self.before('initialize', function () { }); self.after("initialize", function () { From b740c2862d16a566c52ccfaa01b3fb067afb1dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Hedr=C3=A9n?= Date: Mon, 26 May 2014 22:54:52 +0200 Subject: [PATCH 4/4] Tabs to spaces --- flight/flight.d.ts | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/flight/flight.d.ts b/flight/flight.d.ts index 4936c0baf..328ada551 100644 --- a/flight/flight.d.ts +++ b/flight/flight.d.ts @@ -9,26 +9,25 @@ declare module Flight { export interface Base { - /** - * Most Components and Mixins need to define attributes. In Flight, - * default values are assigned by passing an object to the attributes - * function. - * - * NOTE: this.attributes replaces the now deprecated this.defaultAttrs. - * However, for backwards compatibility, if you are using this.defaultAttrs - * then all the old attribute behavior remains in place. - */ - attributes(obj: Object): void; - - + /** + * Most Components and Mixins need to define attributes. In Flight, + * default values are assigned by passing an object to the attributes + * function. + * + * NOTE: this.attributes replaces the now deprecated this.defaultAttrs. + * However, for backwards compatibility, if you are using this.defaultAttrs + * then all the old attribute behavior remains in place. + */ + attributes(obj: Object): void; + /** * Most Components and Mixins need to define attributes. In Flight, * default values are assigned by passing an object to the defaultAttrs * function. - * - * NOTE: this.attributes replaces the now deprecated this.defaultAttrs. - * However, for backwards compatibility, if you are using this.defaultAttrs - * then all the old attribute behavior remains in place. + * + * NOTE: this.attributes replaces the now deprecated this.defaultAttrs. + * However, for backwards compatibility, if you are using this.defaultAttrs + * then all the old attribute behavior remains in place. */ defaultAttrs(obj: Object): void;