Make all typedefs work without provide/require
This commit is contained in:
committed by
Peter Robins
parent
2c29512c80
commit
1d20215bfa
@@ -3,7 +3,6 @@ goog.provide('ol.events.EventType');
|
||||
goog.provide('ol.events.KeyCode');
|
||||
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.EventTargetLike');
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 `<And>` 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;
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.<number>} ol.Coordinate
|
||||
* @typedef {Array.<number>}
|
||||
*/
|
||||
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.<number>}
|
||||
@@ -318,8 +309,8 @@ ol.LoadingStrategy;
|
||||
|
||||
/**
|
||||
* @typedef {{key_: string,
|
||||
* newer: ol.LRUCacheEntry,
|
||||
* older: ol.LRUCacheEntry,
|
||||
* newer: Object,
|
||||
* older: Object,
|
||||
* value_: *}}
|
||||
*/
|
||||
ol.LRUCacheEntry;
|
||||
|
||||
Reference in New Issue
Block a user