diff --git a/src/ol/events.js b/src/ol/events.js index 814a69dbc5..a427d9d58f 100644 --- a/src/ol/events.js +++ b/src/ol/events.js @@ -3,7 +3,6 @@ goog.provide('ol.events.EventType'); goog.provide('ol.events.KeyCode'); goog.require('ol.object'); -goog.require('ol.EventTargetLike'); /** diff --git a/src/ol/events/eventtarget.js b/src/ol/events/eventtarget.js index fda4ade727..0c547506ad 100644 --- a/src/ol/events/eventtarget.js +++ b/src/ol/events/eventtarget.js @@ -5,6 +5,7 @@ goog.require('ol.Disposable'); goog.require('ol.events'); goog.require('ol.events.Event'); + /** * @classdesc * A simplified implementation of the W3C DOM Level 2 EventTarget interface. diff --git a/src/ol/format/ogc/filter.js b/src/ol/format/ogc/filter.js index ba486a91d9..e341b47027 100644 --- a/src/ol/format/ogc/filter.js +++ b/src/ol/format/ogc/filter.js @@ -18,8 +18,6 @@ goog.provide('ol.format.ogc.filter.IsNull'); goog.provide('ol.format.ogc.filter.IsBetween'); goog.provide('ol.format.ogc.filter.IsLike'); -goog.require('ol.Extent'); - /** * Create a logical `` operator between two filter conditions. @@ -365,7 +363,7 @@ ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) { /** * @public - * @type {!ol.Extent} + * @type {ol.Extent} */ this.extent = extent; diff --git a/src/ol/structs/lrucache.js b/src/ol/structs/lrucache.js index 4f1ee6cde1..f44c55af5c 100644 --- a/src/ol/structs/lrucache.js +++ b/src/ol/structs/lrucache.js @@ -133,7 +133,7 @@ ol.structs.LRUCache.prototype.get = function(key) { if (entry === this.newest_) { return entry.value_; } else if (entry === this.oldest_) { - this.oldest_ = this.oldest_.newer; + this.oldest_ = /** @type {ol.LRUCacheEntry} */ (this.oldest_.newer); this.oldest_.older = null; } else { entry.newer.older = entry.older; @@ -216,7 +216,7 @@ ol.structs.LRUCache.prototype.pop = function() { if (entry.newer) { entry.newer.older = null; } - this.oldest_ = entry.newer; + this.oldest_ = /** @type {ol.LRUCacheEntry} */ (entry.newer); if (!this.oldest_) { this.newest_ = null; } @@ -244,12 +244,12 @@ ol.structs.LRUCache.prototype.set = function(key, value) { 'key is not a standard property of objects (e.g. "__proto__")'); goog.asserts.assert(!(key in this.entries_), 'key is not used already'); - var entry = { + var entry = /** @type {ol.LRUCacheEntry} */ ({ key_: key, newer: null, older: this.newest_, value_: value - }; + }); if (!this.newest_) { this.oldest_ = entry; } else { diff --git a/src/ol/typedefs.js b/src/ol/typedefs.js index 67341c7c0e..ffe8677a77 100644 --- a/src/ol/typedefs.js +++ b/src/ol/typedefs.js @@ -11,13 +11,7 @@ * appear in module code. * * They are now all in the `ol` namespace. - * - * In principle, typedefs should not have a `goog.provide` nor should files which - * refer to a typedef in comments need a `goog.require`. However, goog.provides - * are needed for 2 cases, both to prevent compiler errors/warnings. */ -goog.provide('ol.Extent'); -goog.provide('ol.EventTargetLike'); /** @@ -126,7 +120,7 @@ ol.ColorLike; /** * An array of numbers representing an xy coordinate. Example: `[16, 48]`. - * @typedef {Array.} ol.Coordinate + * @typedef {Array.} */ ol.Coordinate; @@ -161,15 +155,6 @@ ol.DragBoxEndConditionType; ol.DrawGeometryFunctionType; -/** - * @typedef {EventTarget|ol.events.EventTarget| - * {addEventListener: function(string, Function, boolean=), - * removeEventListener: function(string, Function, boolean=), - * dispatchEvent: function(string)}} - */ -ol.EventTargetLike; - - /** * A function that takes an {@link ol.MapBrowserEvent} and returns a * `{boolean}`. If the condition is met, true should be returned. @@ -202,6 +187,12 @@ ol.EventsKey; ol.EventsListenerFunctionType; +/** + * @typedef {EventTarget|ol.events.EventTarget} + */ +ol.EventTargetLike; + + /** * An array of numbers representing an extent: `[minx, miny, maxx, maxy]`. * @typedef {Array.} @@ -318,8 +309,8 @@ ol.LoadingStrategy; /** * @typedef {{key_: string, - * newer: ol.LRUCacheEntry, - * older: ol.LRUCacheEntry, + * newer: Object, + * older: Object, * value_: *}} */ ol.LRUCacheEntry; diff --git a/tasks/build.js b/tasks/build.js index 445d780589..0fe827e0fb 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -206,6 +206,7 @@ function build(config, paths, callback) { concatenate(paths, callback); } else { log.info('ol', 'Compiling ' + paths.length + ' sources'); + paths = paths.concat('src/ol/typedefs.js'); options.compile.js = paths.concat(options.compile.js || []); closure.compile(options, callback); }