Get rid of olx.js and typedef.js typedefs for ol

This commit is contained in:
Andreas Hocevar
2018-03-08 18:42:57 +01:00
parent 8f0ffe2043
commit 95d6251dbb
198 changed files with 2262 additions and 2698 deletions

View File

@@ -43,10 +43,10 @@ const BaseLayer = function(options) {
this.setProperties(properties);
/**
* @type {ol.LayerState}
* @type {module:ol/layer/Layer~State}
* @private
*/
this.state_ = /** @type {ol.LayerState} */ ({
this.state_ = /** @type {module:ol/layer/Layer~State} */ ({
layer: /** @type {ol.layer.Layer} */ (this),
managed: true
});
@@ -73,7 +73,7 @@ BaseLayer.prototype.getType = function() {
/**
* @return {ol.LayerState} Layer state.
* @return {module:ol/layer/Layer~State} Layer state.
*/
BaseLayer.prototype.getLayerState = function() {
this.state_.opacity = clamp(this.getOpacity(), 0, 1);
@@ -99,22 +99,22 @@ BaseLayer.prototype.getLayersArray = function(opt_array) {};
/**
* @abstract
* @param {Array.<ol.LayerState>=} opt_states Optional list of layer
* @param {Array.<module:ol/layer/Layer~State>=} opt_states Optional list of layer
* states (to be modified in place).
* @return {Array.<ol.LayerState>} List of layer states.
* @return {Array.<module:ol/layer/Layer~State>} List of layer states.
*/
BaseLayer.prototype.getLayerStatesArray = function(opt_states) {};
/**
* Return the {@link ol.Extent extent} of the layer or `undefined` if it
* Return the {@link module:ol/extent~Extent extent} of the layer or `undefined` if it
* will be visible regardless of extent.
* @return {ol.Extent|undefined} The layer extent.
* @return {module:ol/extent~Extent|undefined} The layer extent.
* @observable
* @api
*/
BaseLayer.prototype.getExtent = function() {
return /** @type {ol.Extent|undefined} */ (this.get(LayerProperty.EXTENT));
return /** @type {module:ol/extent~Extent|undefined} */ (this.get(LayerProperty.EXTENT));
};
@@ -184,7 +184,7 @@ BaseLayer.prototype.getZIndex = function() {
/**
* Set the extent at which the layer is visible. If `undefined`, the layer
* will be visible at all extents.
* @param {ol.Extent|undefined} extent The extent of the layer.
* @param {module:ol/extent~Extent|undefined} extent The extent of the layer.
* @observable
* @api
*/

View File

@@ -47,13 +47,13 @@ const LayerGroup = function(opt_options) {
/**
* @private
* @type {Array.<ol.EventsKey>}
* @type {Array.<module:ol/events~EventsKey>}
*/
this.layersListenerKeys_ = [];
/**
* @private
* @type {Object.<string, Array.<ol.EventsKey>>}
* @type {Object.<string, Array.<module:ol/events~EventsKey>>}
*/
this.listenerKeys_ = {};

View File

@@ -11,6 +11,21 @@ import {assign} from '../obj.js';
import RenderEventType from '../render/EventType.js';
import SourceState from '../source/State.js';
/**
* @typedef {Object} State
* @property {module:ol/layer/Layer~Layer} layer
* @property {number} opacity
* @property {module:ol/source/Source~State} sourceState
* @property {boolean} visible
* @property {boolean} managed
* @property {module:ol/extent~Extent} [extent]
* @property {number} zIndex
* @property {number} maxResolution
* @property {number} minResolution
*/
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
@@ -42,19 +57,19 @@ const Layer = function(options) {
/**
* @private
* @type {?ol.EventsKey}
* @type {?module:ol/events~EventsKey}
*/
this.mapPrecomposeKey_ = null;
/**
* @private
* @type {?ol.EventsKey}
* @type {?module:ol/events~EventsKey}
*/
this.mapRenderKey_ = null;
/**
* @private
* @type {?ol.EventsKey}
* @type {?module:ol/events~EventsKey}
*/
this.sourceChangeKey_ = null;
@@ -77,7 +92,7 @@ inherits(Layer, BaseLayer);
* Return `true` if the layer is visible, and if the passed resolution is
* between the layer's minResolution and maxResolution. The comparison is
* inclusive for `minResolution` and exclusive for `maxResolution`.
* @param {ol.LayerState} layerState Layer state.
* @param {module:ol/layer/Layer~State} layerState Layer state.
* @param {number} resolution Resolution.
* @return {boolean} The layer is visible at the given resolution.
*/

View File

@@ -58,14 +58,14 @@ const VectorLayer = function(opt_options) {
/**
* User provided style.
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
* @type {ol.style.Style|Array.<ol.style.Style>|module:ol/style~StyleFunction}
* @private
*/
this.style_ = null;
/**
* Style function for use within the library.
* @type {ol.StyleFunction|undefined}
* @type {module:ol/style~StyleFunction|undefined}
* @private
*/
this.styleFunction_ = undefined;
@@ -133,7 +133,7 @@ VectorLayer.prototype.getRenderBuffer = function() {
* order.
*/
VectorLayer.prototype.getRenderOrder = function() {
return /** @type {ol.RenderOrderFunction|null|undefined} */ (this.get(Property.RENDER_ORDER));
return /** @type {module:ol/render~OrderFunction|null|undefined} */ (this.get(Property.RENDER_ORDER));
};
@@ -149,7 +149,7 @@ VectorLayer.prototype.getSource;
/**
* Get the style for features. This returns whatever was passed to the `style`
* option at construction or to the `setStyle` method.
* @return {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
* @return {ol.style.Style|Array.<ol.style.Style>|module:ol/style~StyleFunction}
* Layer style.
* @api
*/
@@ -160,7 +160,7 @@ VectorLayer.prototype.getStyle = function() {
/**
* Get the style function.
* @return {ol.StyleFunction|undefined} Layer style function.
* @return {module:ol/style~StyleFunction|undefined} Layer style function.
* @api
*/
VectorLayer.prototype.getStyleFunction = function() {
@@ -187,7 +187,7 @@ VectorLayer.prototype.getUpdateWhileInteracting = function() {
/**
* @param {ol.RenderOrderFunction|null|undefined} renderOrder
* @param {module:ol/render~OrderFunction|null|undefined} renderOrder
* Render order.
*/
VectorLayer.prototype.setRenderOrder = function(renderOrder) {
@@ -202,7 +202,7 @@ VectorLayer.prototype.setRenderOrder = function(renderOrder) {
* it is `null` the layer has no style (a `null` style), so only features
* that have their own styles will be rendered in the layer. See
* {@link ol.style} for information on the default style.
* @param {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|null|undefined}
* @param {ol.style.Style|Array.<ol.style.Style>|module:ol/style~StyleFunction|null|undefined}
* style Layer style.
* @api
*/