Make some @param types more specific in media-models.js.

See #26870.


Built from https://develop.svn.wordpress.org/trunk@26991


git-svn-id: http://core.svn.wordpress.org/trunk@26868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-01-21 17:37:12 +00:00
parent 60986d43b4
commit 18b8c717f2

View File

@ -184,9 +184,12 @@ window.wp = window.wp || {};
*/ */
Attachment = media.model.Attachment = Backbone.Model.extend({ Attachment = media.model.Attachment = Backbone.Model.extend({
/** /**
* Triggered when attachment details change
*
* @param {string} method * @param {string} method
* @param {Backbone.Model} model * @param {wp.media.model.Attachment} model
* @param {Object} [options={}] * @param {Object} [options={}]
*
* @returns {Promise} * @returns {Promise}
*/ */
sync: function( method, model, options ) { sync: function( method, model, options ) {
@ -266,6 +269,8 @@ window.wp = window.wp || {};
} }
}, },
/** /**
* Convert date strings into Date objects.
*
* @param {Object} resp * @param {Object} resp
* @returns {Object} * @returns {Object}
*/ */
@ -274,7 +279,6 @@ window.wp = window.wp || {};
return resp; return resp;
} }
// Convert date strings into Date objects.
resp.date = new Date( resp.date ); resp.date = new Date( resp.date );
resp.modified = new Date( resp.modified ); resp.modified = new Date( resp.modified );
return resp; return resp;
@ -282,6 +286,9 @@ window.wp = window.wp || {};
/** /**
* @param {Object} data * @param {Object} data
* @param {Object} options * @param {Object} options
*
* @this Backbone.Model
*
* @returns {Promise} * @returns {Promise}
*/ */
saveCompat: function( data, options ) { saveCompat: function( data, options ) {
@ -310,7 +317,7 @@ window.wp = window.wp || {};
}, },
/** /**
* @param {string} id * @param {string} id
* @param {Backbone.Model} attachment * @param {Backbone.Model|undefined} attachment
* @returns {wp.media.model.Attachment} * @returns {wp.media.model.Attachment}
*/ */
get: _.memoize( function( id, attachment ) { get: _.memoize( function( id, attachment ) {
@ -479,7 +486,7 @@ window.wp = window.wp || {};
}, },
/** /**
* @param {Backbone.Collection} attachments * @param {wp.media.model.Attachments} attachments
* @param {object} [options={}] * @param {object} [options={}]
* @returns {wp.media.model.Attachments} Returns itself to allow chaining * @returns {wp.media.model.Attachments} Returns itself to allow chaining
*/ */
@ -496,7 +503,7 @@ window.wp = window.wp || {};
return this; return this;
}, },
/** /**
* @param {Backbone.Collection} attachments * @param {wp.media.model.Attachments} attachments
* @returns {wp.media.model.Attachments} Returns itself to allow chaining * @returns {wp.media.model.Attachments} Returns itself to allow chaining
*/ */
observe: function( attachments ) { observe: function( attachments ) {
@ -509,7 +516,7 @@ window.wp = window.wp || {};
return this; return this;
}, },
/** /**
* @param {Backbone.Collection} attachments * @param {wp.media.model.Attachments} attachments
* @returns {wp.media.model.Attachments} Returns itself to allow chaining * @returns {wp.media.model.Attachments} Returns itself to allow chaining
*/ */
unobserve: function( attachments ) { unobserve: function( attachments ) {
@ -529,9 +536,10 @@ window.wp = window.wp || {};
/** /**
* @access private * @access private
* *
* @param {Backbone.Model} attachment * @param {wp.media.model.Attachments} attachment
* @param {Backbone.Collction} attachments * @param {wp.media.model.Attachments} attachments
* @param {Object} options * @param {Object} options
*
* @returns {wp.media.model.Attachments} Returns itself to allow chaining * @returns {wp.media.model.Attachments} Returns itself to allow chaining
*/ */
_validateHandler: function( attachment, attachments, options ) { _validateHandler: function( attachment, attachments, options ) {
@ -546,7 +554,7 @@ window.wp = window.wp || {};
/** /**
* @access private * @access private
* *
* @param {Backbone.Collction} attachments * @param {wp.media.model.Attachments} attachments
* @param {Object} options * @param {Object} options
* @returns {wp.media.model.Attachments} Returns itself to allow chaining * @returns {wp.media.model.Attachments} Returns itself to allow chaining
*/ */
@ -554,7 +562,7 @@ window.wp = window.wp || {};
return this.validateAll( attachments, options ); return this.validateAll( attachments, options );
}, },
/** /**
* @param {Backbone.Collction} attachments * @param {wp.media.model.Attachments} attachments
* @returns {wp.media.model.Attachments} Returns itself to allow chaining * @returns {wp.media.model.Attachments} Returns itself to allow chaining
*/ */
mirror: function( attachments ) { mirror: function( attachments ) {
@ -759,7 +767,7 @@ window.wp = window.wp || {};
* wp.media.query * wp.media.query
* *
* @static * @static
* @returns {Attachments} * @returns {wp.media.model.Attachments}
*/ */
media.query = function( props ) { media.query = function( props ) {
return new Attachments( null, { return new Attachments( null, {
@ -1054,8 +1062,9 @@ window.wp = window.wp || {};
}, },
/** /**
* Triggered when toggling (clicking on) an attachment in the modal
* *
* @param {Backbone.Model} model * @param {undefined|boolean|wp.media.model.Attachment} model
* *
* @fires wp.media.model.Selection#selection:single * @fires wp.media.model.Selection#selection:single
* @fires wp.media.model.Selection#selection:unsingle * @fires wp.media.model.Selection#selection:unsingle