Skip to content
Permalink
Browse files

Add type annotations to public methods in dimensions

  • Loading branch information
ChadKillingsworth committed Apr 6, 2012
1 parent 9845450 commit 41403d1d3995df06d5edec9e9a6e9c2a95369a2d
Showing with 13 additions and 2 deletions.
  1. +13 −2 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;

0 comments on commit 41403d1

Please sign in to comment.
You can’t perform that action at this time.