Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add type annotations to public methods in dimensions

  • Loading branch information...
commit 41403d1d3995df06d5edec9e9a6e9c2a95369a2d 1 parent 9845450
@ChadKillingsworth ChadKillingsworth authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/dimensions.js
View
15 src/dimensions.js
@@ -6,7 +6,10 @@ jQuery.expandedEach( { Height: "height", Width: "width" }, function( name, type
scrollProp = "scroll" + name,
offsetProp = "offset" + name;
- // innerHeight and innerWidth
+ /**
+ * innerHeight and innerWidth
+ * @return {?number}
+ */
jQuery.fn[ "inner" + name ] = function() {
var elem = this[0];
return elem ?
@@ -16,7 +19,11 @@ jQuery.expandedEach( { Height: "height", Width: "width" }, function( name, type
null;
};
- // outerHeight and outerWidth
+ /**
+ * outerHeight and outerWidth
+ * @param {boolean=} margin
+ * @return {?number}
+ */
jQuery.fn[ "outer" + name ] = function( margin ) {
var elem = this[0];
return elem ?
@@ -26,6 +33,10 @@ jQuery.expandedEach( { Height: "height", Width: "width" }, function( name, type
null;
};
+ /**
+ * @param {(string|number|function(number,number))=} value
+ * @return {(number|!jQuery)}
+ */
jQuery.fn[ name.toLowerCase() ] = function( value ) {
return jQuery.access( this, function( elem, type, value ) {
var doc, docElemProp, orig, ret;
Please sign in to comment.
Something went wrong with that request. Please try again.