diff --git a/src/ol/collection.js b/src/ol/collection.js index 6e7365723d..2d11d303be 100644 --- a/src/ol/collection.js +++ b/src/ol/collection.js @@ -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.): ?} 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) { diff --git a/src/ol/object.js b/src/ol/object.js index 5f8bdb0968..70864f815a 100644 --- a/src/ol/object.js +++ b/src/ol/object.js @@ -251,7 +251,7 @@ ol.Object.prototype.notifyInternal_ = function(key) { /** * Listen for a certain type of event. * @param {string|Array.} 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.} 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.} 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) { diff --git a/src/ol/structs/lrucache.js b/src/ol/structs/lrucache.js index b8f0c0cafb..81c6d01022 100644 --- a/src/ol/structs/lrucache.js +++ b/src/ol/structs/lrucache.js @@ -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_; diff --git a/src/ol/tilequeue.js b/src/ol/tilequeue.js index 15b8f69ca3..5dad4a292f 100644 --- a/src/ol/tilequeue.js +++ b/src/ol/tilequeue.js @@ -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;