Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -19,7 +19,7 @@ import SourceState from '../source/State.js';
|
||||
* @typedef {Object} Options
|
||||
* @property {number} [opacity=1] Opacity (0, 1).
|
||||
* @property {boolean} [visible=true] Visibility.
|
||||
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
|
||||
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
|
||||
* rendered outside of this extent.
|
||||
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
|
||||
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
|
||||
@@ -29,7 +29,7 @@ import SourceState from '../source/State.js';
|
||||
* visible.
|
||||
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
|
||||
* be visible.
|
||||
* @property {Array<module:ol/layer/Base>|module:ol/Collection<module:ol/layer/Base>} [layers] Child layers.
|
||||
* @property {Array<import("./Base.js").default>|import("../Collection.js").default<import("./Base.js").default>} [layers] Child layers.
|
||||
*/
|
||||
|
||||
|
||||
@@ -52,12 +52,12 @@ const Property = {
|
||||
*/
|
||||
class LayerGroup extends BaseLayer {
|
||||
/**
|
||||
* @param {module:ol/layer/Group~Options=} opt_options Layer options.
|
||||
* @param {Options=} opt_options Layer options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
|
||||
const options = opt_options || {};
|
||||
const baseOptions = /** @type {module:ol/layer/Group~Options} */ (assign({}, options));
|
||||
const baseOptions = /** @type {Options} */ (assign({}, options));
|
||||
delete baseOptions.layers;
|
||||
|
||||
let layers = options.layers;
|
||||
@@ -66,13 +66,13 @@ class LayerGroup extends BaseLayer {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("../events.js").EventsKey>}
|
||||
*/
|
||||
this.layersListenerKeys_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, Array<module:ol/events~EventsKey>>}
|
||||
* @type {Object<string, Array<import("../events.js").EventsKey>>}
|
||||
*/
|
||||
this.listenerKeys_ = {};
|
||||
|
||||
@@ -104,7 +104,7 @@ class LayerGroup extends BaseLayer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/events/Event} event Event.
|
||||
* @param {import("../events/Event.js").default} event Event.
|
||||
* @private
|
||||
*/
|
||||
handleLayersChanged_() {
|
||||
@@ -135,11 +135,11 @@ class LayerGroup extends BaseLayer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/Collection~CollectionEvent} collectionEvent CollectionEvent.
|
||||
* @param {import("../Collection.js").CollectionEvent} collectionEvent CollectionEvent.
|
||||
* @private
|
||||
*/
|
||||
handleLayersAdd_(collectionEvent) {
|
||||
const layer = /** @type {module:ol/layer/Base} */ (collectionEvent.element);
|
||||
const layer = /** @type {import("./Base.js").default} */ (collectionEvent.element);
|
||||
const key = getUid(layer).toString();
|
||||
this.listenerKeys_[key] = [
|
||||
listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),
|
||||
@@ -149,11 +149,11 @@ class LayerGroup extends BaseLayer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/Collection~CollectionEvent} collectionEvent CollectionEvent.
|
||||
* @param {import("../Collection.js").CollectionEvent} collectionEvent CollectionEvent.
|
||||
* @private
|
||||
*/
|
||||
handleLayersRemove_(collectionEvent) {
|
||||
const layer = /** @type {module:ol/layer/Base} */ (collectionEvent.element);
|
||||
const layer = /** @type {import("./Base.js").default} */ (collectionEvent.element);
|
||||
const key = getUid(layer).toString();
|
||||
this.listenerKeys_[key].forEach(unlistenByKey);
|
||||
delete this.listenerKeys_[key];
|
||||
@@ -163,21 +163,21 @@ class LayerGroup extends BaseLayer {
|
||||
/**
|
||||
* Returns the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}
|
||||
* in this group.
|
||||
* @return {!module:ol/Collection<module:ol/layer/Base>} Collection of
|
||||
* @return {!import("../Collection.js").default<import("./Base.js").default>} Collection of
|
||||
* {@link module:ol/layer/Base layers} that are part of this group.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getLayers() {
|
||||
return (
|
||||
/** @type {!module:ol/Collection<module:ol/layer/Base>} */ (this.get(Property.LAYERS))
|
||||
/** @type {!import("../Collection.js").default<import("./Base.js").default>} */ (this.get(Property.LAYERS))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}
|
||||
* in this group.
|
||||
* @param {!module:ol/Collection<module:ol/layer/Base>} layers Collection of
|
||||
* @param {!import("../Collection.js").default<import("./Base.js").default>} layers Collection of
|
||||
* {@link module:ol/layer/Base layers} that are part of this group.
|
||||
* @observable
|
||||
* @api
|
||||
|
||||
Reference in New Issue
Block a user