From 40adcdd3adf8d61d3fee48fd435e2e52285ccc27 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 9 Jan 2014 13:35:13 +0000 Subject: [PATCH 1/4] jQuery: offsetWidth, offsetHeight, position JSDoc removed invalid overloads, added JSDoc, changed position to use JQueryCoordinates. Added position test suite. --- jquery/jquery-tests.ts | 18 ++++++++++++------ jquery/jquery.d.ts | 17 ++++++++++++++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index e8b11f182..35a954e95 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -1802,16 +1802,22 @@ function test_innerWidth() { function test_outerHeight() { var p = $("p:first"); - $("p:last").text("outerHeight:" + p.outerHeight(true)); - p.outerHeight(p.outerHeight() * 2).outerHeight(); - p.outerHeight(p.outerHeight() * 2, true).outerHeight(); + $("p:last").text( + "outerHeight:" + p.outerHeight() + + " , outerHeight( true ):" + p.outerHeight(true)); } function test_outerWidth() { var p = $("p:first"); - $("p:last").text("outerWidth:" + p.outerWidth(true)); - p.outerWidth(p.outerWidth() * 2).outerWidth(); - p.outerWidth(p.outerWidth() * 2, true).outerWidth(); + $("p:last").text( + "outerWidth:" + p.outerWidth() + + " , outerWidth( true ):" + p.outerWidth(true)); +} + +function test_position() { + var p = $("p:first"); + var position = p.position(); + $("p:last").text("left: " + position.left + ", top: " + position.top); } function test_insertAfter() { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index e0018f654..01e75e118 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1048,13 +1048,24 @@ interface JQuery { */ offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; + /** + * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ outerHeight(includeMargin?: boolean): number; - outerHeight(value: number, includeMargin?: boolean): JQuery; + /** + * Get the current computed width for the first element in the set of matched elements, including padding and border. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ outerWidth(includeMargin?: boolean): number; - outerWidth(value: number, includeMargin?: boolean): JQuery; - position(): { top: number; left: number; }; + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + */ + position(): JQueryCoordinates; scrollLeft(): number; scrollLeft(value: number): JQuery; From 8bda915f3766026c53cb91be99ae5587632bd8e0 Mon Sep 17 00:00:00 2001 From: bolkhovsky Date: Thu, 9 Jan 2014 18:06:50 +0400 Subject: [PATCH 2/4] fix methods accessors --- openlayers/openlayers.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index ea489bc12..ba9f6baea 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -611,7 +611,7 @@ declare module OpenLayers { * openlayers.org homepage: * http://trac.openlayers.org/wiki/SettingZoomLevels */ - private initResolutions(): void; + initResolutions(): void; /** * Method: resolutionsFromScales @@ -635,7 +635,7 @@ declare module OpenLayers { * Returns: * {Array({Number})} Array of resolutions. */ - private calculateResolutions(props: Object): number[]; + calculateResolutions(props: Object): number[]; /** * APIMethod: getResolution @@ -760,7 +760,7 @@ declare module OpenLayers { * Returns: * {Integer} the z-index of this layer */ - private getZIndex(): number; + getZIndex(): number; /** * Method: setZIndex @@ -768,7 +768,7 @@ declare module OpenLayers { * Parameters: * zIndex - {Integer} */ - private setZIndex(zIndex: number): void; + setZIndex(zIndex: number): void; /** * Method: adjustBounds @@ -781,7 +781,7 @@ declare module OpenLayers { * Parameters: * bounds - {} */ - private adjustBounds(bounds: Bounds): Bounds; + adjustBounds(bounds: Bounds): Bounds; static CLASS_NAME: string; } From 40210142d6c937c3320dbaf48c045c4a353fcbdd Mon Sep 17 00:00:00 2001 From: anwalkers Date: Thu, 9 Jan 2014 10:11:00 -0800 Subject: [PATCH 3/4] added invertExtent to d3.d.ts --- d3/d3.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 0c0be2178..d10935770 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -2635,6 +2635,7 @@ declare module D3 { (): any[]; }; copy(): QuantizeScale; + invertExtent(y: any): any[]; } export interface ThresholdScale extends Scale { From cca98c346edc2bf21b47130d2a1030c779c43296 Mon Sep 17 00:00:00 2001 From: anwalkers Date: Thu, 9 Jan 2014 10:16:24 -0800 Subject: [PATCH 4/4] moved invertExtent(y: any): any[]; to Scale interface from QuantizeScale interface --- d3/d3.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index d10935770..126f2d95b 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -2442,6 +2442,7 @@ declare module D3 { (values: any[]): Scale; (): any[]; }; + invertExtent(y: any): any[]; copy(): Scale; } @@ -2635,7 +2636,6 @@ declare module D3 { (): any[]; }; copy(): QuantizeScale; - invertExtent(y: any): any[]; } export interface ThresholdScale extends Scale {