Merge pull request #1249 from fredj/apidoc_function

More precise {function} jsdoc definition
This commit is contained in:
Frédéric Junod
2013-11-07 13:22:30 -08:00
4 changed files with 19 additions and 15 deletions

View File

@@ -112,11 +112,11 @@ ol.Collection.prototype.extend = function(arr) {
/**
* Iterate over each element, calling the provided callback.
* @param {Function} f The function to call for every element. This function
* takes 3 arguments (the element, the index and the array). The return
* value is ignored.
* @param {Object=} opt_obj The object to be used as the value of 'this'
* within f.
* @param {function(this: S, T, number, Array.<T>): ?} f The function to call
* for every element. This function takes 3 arguments (the element, the
* index and the array). The return value is ignored.
* @param {S=} opt_obj The object to be used as the value of 'this' within f.
* @template T,S
* @todo stability experimental
*/
ol.Collection.prototype.forEach = function(f, opt_obj) {

View File

@@ -251,7 +251,7 @@ ol.Object.prototype.notifyInternal_ = function(key) {
/**
* Listen for a certain type of event.
* @param {string|Array.<string>} type The event type or array of event types.
* @param {Function} listener The listener function.
* @param {function(?): ?} listener The listener function.
* @param {Object=} opt_scope Object is whose scope to call
* the listener.
* @return {goog.events.Key} Unique key for the listener.
@@ -265,7 +265,7 @@ ol.Object.prototype.on = function(type, listener, opt_scope) {
/**
* Listen once for a certain type of event.
* @param {string|Array.<string>} type The event type or array of event types.
* @param {Function} listener The listener function.
* @param {function(?): ?} listener The listener function.
* @param {Object=} opt_scope Object is whose scope to call
* the listener.
* @return {goog.events.Key} Unique key for the listener.
@@ -343,7 +343,7 @@ ol.Object.prototype.unbind = function(key) {
/**
* Unlisten for a certain type of event.
* @param {string|Array.<string>} type The event type or array of event types.
* @param {Function} listener The listener function.
* @param {function(?): ?} listener The listener function.
* @param {Object=} opt_scope Object is whose scope to call
* the listener.
* @todo stability experimental
@@ -354,9 +354,9 @@ ol.Object.prototype.un = function(type, listener, opt_scope) {
/**
* Removes an event listener which was added with listen() by the key returned
* by on().
* @param {?number} key Key.
* Removes an event listener which was added with `listen()` by the key returned
* by `on()` or `once()`.
* @param {goog.events.Key} key Key.
* @todo stability experimental
*/
ol.Object.prototype.unByKey = function(key) {

View File

@@ -96,8 +96,12 @@ ol.structs.LRUCache.prototype.containsKey = function(key) {
/**
* @param {Function} f Function.
* @param {Object=} opt_obj Object.
* @param {function(this: S, *, string, ol.structs.LRUCache): ?} f The function
* to call for every entry from the oldest to the newer. This function takes
* 3 arguments (the entry value, the entry key and the LRUCache object).
* The return value is ignored.
* @param {S=} opt_obj The object to be used as the value of 'this' within f.
* @template S
*/
ol.structs.LRUCache.prototype.forEach = function(f, opt_obj) {
var entry = this.oldest_;

View File

@@ -20,7 +20,7 @@ ol.TilePriorityFunction;
* @extends {ol.structs.PriorityQueue}
* @param {ol.TilePriorityFunction} tilePriorityFunction
* Tile priority function.
* @param {Function} tileChangeCallback
* @param {function(): ?} tileChangeCallback
* Function called on each tile change event.
*/
ol.TileQueue = function(tilePriorityFunction, tileChangeCallback) {
@@ -44,7 +44,7 @@ ol.TileQueue = function(tilePriorityFunction, tileChangeCallback) {
/**
* @private
* @type {Function}
* @type {function(): ?}
*/
this.tileChangeCallback_ = tileChangeCallback;