diff --git a/src/ol/format/GML3.js b/src/ol/format/GML3.js index 8ecdfaa31b..276d7b2e73 100644 --- a/src/ol/format/GML3.js +++ b/src/ol/format/GML3.js @@ -105,10 +105,10 @@ class GML3 extends GMLBase { * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. * @private - * @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString. + * @return {MultiLineString|undefined} MultiLineString. */ readMultiCurve_(node, objectStack) { - /** @type {Array} */ + /** @type {Array} */ const lineStrings = pushParseAndPop([], this.MULTICURVE_PARSERS_, node, objectStack, this); if (lineStrings) { @@ -123,10 +123,10 @@ class GML3 extends GMLBase { * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. * @private - * @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon. + * @return {MultiPolygon|undefined} MultiPolygon. */ readMultiSurface_(node, objectStack) { - /** @type {Array} */ + /** @type {Array} */ const polygons = pushParseAndPop([], this.MULTISURFACE_PARSERS_, node, objectStack, this); if (polygons) { @@ -234,7 +234,7 @@ class GML3 extends GMLBase { * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. * @private - * @return {import("../geom/Polygon.js").default|undefined} Polygon. + * @return {Polygon|undefined} Polygon. */ readSurface_(node, objectStack) { /** @type {Array>} */ @@ -258,7 +258,7 @@ class GML3 extends GMLBase { * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. * @private - * @return {import("../geom/LineString.js").default|undefined} LineString. + * @return {LineString|undefined} LineString. */ readCurve_(node, objectStack) { /** @type {Array} */ @@ -436,7 +436,7 @@ class GML3 extends GMLBase { /** * @param {Element} node Node. - * @param {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} value Geometry. + * @param {LineString|import("../geom/LinearRing.js").default} value Geometry. * @param {Array<*>} objectStack Node stack. * @private */ @@ -532,7 +532,7 @@ class GML3 extends GMLBase { /** * @param {Element} node Node. - * @param {import("../geom/Polygon.js").default} geometry Polygon geometry. + * @param {Polygon} geometry Polygon geometry. * @param {Array<*>} objectStack Node stack. * @private */ @@ -560,7 +560,7 @@ class GML3 extends GMLBase { /** * @param {Element} node Node. - * @param {import("../geom/LineString.js").default} geometry LineString geometry. + * @param {LineString} geometry LineString geometry. * @param {Array<*>} objectStack Node stack. * @private */ @@ -585,7 +585,7 @@ class GML3 extends GMLBase { /** * @param {Element} node Node. - * @param {import("../geom/MultiPolygon.js").default} geometry MultiPolygon geometry. + * @param {MultiPolygon} geometry MultiPolygon geometry. * @param {Array<*>} objectStack Node stack. * @private */ @@ -626,7 +626,7 @@ class GML3 extends GMLBase { /** * @param {Element} node Node. - * @param {import("../geom/MultiLineString.js").default} geometry MultiLineString geometry. + * @param {MultiLineString} geometry MultiLineString geometry. * @param {Array<*>} objectStack Node stack. * @private */ @@ -659,7 +659,7 @@ class GML3 extends GMLBase { /** * @param {Node} node Node. - * @param {import("../geom/Polygon.js").default} polygon Polygon geometry. + * @param {Polygon} polygon Polygon geometry. * @param {Array<*>} objectStack Node stack. * @private */ @@ -686,7 +686,7 @@ class GML3 extends GMLBase { /** * @param {Node} node Node. - * @param {import("../geom/LineString.js").default} line LineString geometry. + * @param {LineString} line LineString geometry. * @param {Array<*>} objectStack Node stack. * @private */ @@ -700,7 +700,7 @@ class GML3 extends GMLBase { /** * @param {Node} node Node. - * @param {import("../geom/Polygon.js").default} polygon Polygon geometry. + * @param {Polygon} polygon Polygon geometry. * @param {Array<*>} objectStack Node stack. * @private */ @@ -712,7 +712,7 @@ class GML3 extends GMLBase { /** * @param {Node} node Node. - * @param {import("../geom/LineString.js").default} line LineString geometry. + * @param {LineString} line LineString geometry. * @param {Array<*>} objectStack Node stack. * @private */ diff --git a/src/ol/format/GMLBase.js b/src/ol/format/GMLBase.js index 3cd7b0db52..f07f0cd9ce 100644 --- a/src/ol/format/GMLBase.js +++ b/src/ol/format/GMLBase.js @@ -132,7 +132,7 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {Array | undefined} Features. + * @return {Array | undefined} Features. */ readFeaturesInternal(node, objectStack) { const localName = node.localName; @@ -240,7 +240,7 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../Feature.js").default} Feature. + * @return {Feature} Feature. */ readFeatureElement(node, objectStack) { let n; @@ -281,7 +281,7 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../geom/Point.js").default|undefined} Point. + * @return {Point|undefined} Point. */ readPoint(node, objectStack) { const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack); @@ -293,7 +293,7 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../geom/MultiPoint.js").default|undefined} MultiPoint. + * @return {MultiPoint|undefined} MultiPoint. */ readMultiPoint(node, objectStack) { /** @type {Array>} */ @@ -309,10 +309,10 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString. + * @return {MultiLineString|undefined} MultiLineString. */ readMultiLineString(node, objectStack) { - /** @type {Array} */ + /** @type {Array} */ const lineStrings = pushParseAndPop([], this.MULTILINESTRING_PARSERS_, node, objectStack, this); if (lineStrings) { @@ -323,10 +323,10 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon. + * @return {MultiPolygon|undefined} MultiPolygon. */ readMultiPolygon(node, objectStack) { - /** @type {Array} */ + /** @type {Array} */ const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this); if (polygons) { return new MultiPolygon(polygons); @@ -363,7 +363,7 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../geom/LineString.js").default|undefined} LineString. + * @return {LineString|undefined} LineString. */ readLineString(node, objectStack) { const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack); @@ -395,7 +395,7 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../geom/LinearRing.js").default|undefined} LinearRing. + * @return {LinearRing|undefined} LinearRing. */ readLinearRing(node, objectStack) { const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack); @@ -407,7 +407,7 @@ class GMLBase extends XMLFeature { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../geom/Polygon.js").default|undefined} Polygon. + * @return {Polygon|undefined} Polygon. */ readPolygon(node, objectStack) { /** @type {Array>} */ diff --git a/src/ol/format/GPX.js b/src/ol/format/GPX.js index 0eea104a34..c5631723ef 100644 --- a/src/ol/format/GPX.js +++ b/src/ol/format/GPX.js @@ -38,7 +38,7 @@ const SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' + /** * @const - * @type {Object): (import("../Feature.js").default|undefined)>} + * @type {Object): (Feature|undefined)>} */ const FEATURE_READER = { 'rte': readRte, @@ -84,7 +84,7 @@ const GPX_SERIALIZERS = makeStructureNS( /** * @typedef {Object} Options - * @property {function(import("../Feature.js").default, Node)} [readExtensions] Callback function + * @property {function(Feature, Node)} [readExtensions] Callback function * to process `extensions` nodes. To prevent memory leaks, this callback function must * not store any references to the node. Note that the `extensions` * node is not allowed in GPX 1.0. Moreover, only `extensions` @@ -131,14 +131,14 @@ class GPX extends XMLFeature { this.dataProjection = getProjection('EPSG:4326'); /** - * @type {function(import("../Feature.js").default, Node)|undefined} + * @type {function(Feature, Node)|undefined} * @private */ this.readExtensions_ = options.readExtensions; } /** - * @param {Array} features List of features. + * @param {Array} features List of features. * @private */ handleReadExtensions_(features) { @@ -182,7 +182,7 @@ class GPX extends XMLFeature { return []; } if (node.localName == 'gpx') { - /** @type {Array} */ + /** @type {Array} */ const features = pushParseAndPop([], GPX_PARSERS, node, [this.getReadOptions(node, opt_options)]); if (features) { @@ -200,7 +200,7 @@ class GPX extends XMLFeature { * LineString geometries are output as routes (``), and MultiLineString * as tracks (``). * - * @param {Array} features Features. + * @param {Array} features Features. * @param {import("./Feature.js").WriteOptions=} opt_options Options. * @return {Node} Node. * @override @@ -475,7 +475,7 @@ const GEOMETRY_TYPE_TO_NODENAME = { * @return {Node|undefined} Node. */ function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) { - const geometry = /** @type {import("../Feature.js").default} */ (value).getGeometry(); + const geometry = /** @type {Feature} */ (value).getGeometry(); if (geometry) { const nodeName = GEOMETRY_TYPE_TO_NODENAME[geometry.getType()]; if (nodeName) { @@ -522,7 +522,7 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) { * @param {LayoutOptions} layoutOptions Layout options. * @param {Array} flatCoordinates Flat coordinates. * @param {Array=} ends Ends. - * @return {import("../geom/GeometryLayout.js").default} Layout. + * @return {GeometryLayout} Layout. */ function applyLayoutOptions(layoutOptions, flatCoordinates, ends) { let layout = GeometryLayout.XY; @@ -630,7 +630,7 @@ function parseTrkSeg(node, objectStack) { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../Feature.js").default|undefined} Track. + * @return {Feature|undefined} Track. */ function readRte(node, objectStack) { const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); @@ -658,7 +658,7 @@ function readRte(node, objectStack) { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../Feature.js").default|undefined} Track. + * @return {Feature|undefined} Track. */ function readTrk(node, objectStack) { const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); @@ -689,7 +689,7 @@ function readTrk(node, objectStack) { /** * @param {Element} node Node. * @param {Array<*>} objectStack Object stack. - * @return {import("../Feature.js").default|undefined} Waypoint. + * @return {Feature|undefined} Waypoint. */ function readWpt(node, objectStack) { const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); @@ -773,7 +773,7 @@ function writeWptType(node, coordinate, objectStack) { /** * @param {Node} node Node. - * @param {import("../Feature.js").default} feature Feature. + * @param {Feature} feature Feature. * @param {Array<*>} objectStack Object stack. */ function writeRte(node, feature, objectStack) { @@ -782,7 +782,7 @@ function writeRte(node, feature, objectStack) { const context = {node: node, 'properties': properties}; let geometry = feature.getGeometry(); if (geometry) { - geometry = /** @type {import("../geom/LineString.js").default} */ (transformWithOptions(geometry, true, options)); + geometry = /** @type {LineString} */ (transformWithOptions(geometry, true, options)); context['geometryLayout'] = geometry.getLayout(); properties['rtept'] = geometry.getCoordinates(); } @@ -797,7 +797,7 @@ function writeRte(node, feature, objectStack) { /** * @param {Node} node Node. - * @param {import("../Feature.js").default} feature Feature. + * @param {Feature} feature Feature. * @param {Array<*>} objectStack Object stack. */ function writeTrk(node, feature, objectStack) { @@ -807,7 +807,7 @@ function writeTrk(node, feature, objectStack) { const context = {node: node, 'properties': properties}; let geometry = feature.getGeometry(); if (geometry) { - geometry = /** @type {import("../geom/MultiLineString.js").default} */ + geometry = /** @type {MultiLineString} */ (transformWithOptions(geometry, true, options)); properties['trkseg'] = geometry.getLineStrings(); } @@ -822,7 +822,7 @@ function writeTrk(node, feature, objectStack) { /** * @param {Node} node Node. - * @param {import("../geom/LineString.js").default} lineString LineString. + * @param {LineString} lineString LineString. * @param {Array<*>} objectStack Object stack. */ function writeTrkSeg(node, lineString, objectStack) { @@ -837,7 +837,7 @@ function writeTrkSeg(node, lineString, objectStack) { /** * @param {Element} node Node. - * @param {import("../Feature.js").default} feature Feature. + * @param {Feature} feature Feature. * @param {Array<*>} objectStack Object stack. */ function writeWpt(node, feature, objectStack) { @@ -846,7 +846,7 @@ function writeWpt(node, feature, objectStack) { context['properties'] = feature.getProperties(); let geometry = feature.getGeometry(); if (geometry) { - geometry = /** @type {import("../geom/Point.js").default} */ + geometry = /** @type {Point} */ (transformWithOptions(geometry, true, options)); context['geometryLayout'] = geometry.getLayout(); writeWptType(node, geometry.getCoordinates(), objectStack); diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js index 836e42d35e..03fed80185 100644 --- a/src/ol/format/KML.js +++ b/src/ol/format/KML.js @@ -35,10 +35,10 @@ import {createElementNS, getAllTextContent, isDocument, isNode, makeArrayExtende /** * @typedef {Object} Vec2 * @property {number} x - * @property {import("../style/IconAnchorUnits.js").default} xunits + * @property {IconAnchorUnits} xunits * @property {number} y - * @property {import("../style/IconAnchorUnits.js").default} yunits - * @property {import("../style/IconOrigin.js").default} origin + * @property {IconAnchorUnits} yunits + * @property {IconOrigin} origin */ /** @@ -79,7 +79,7 @@ const SCHEMA_LOCATION = 'http://www.opengis.net/kml/2.2 ' + /** - * @type {Object} + * @type {Object} */ const ICON_ANCHOR_UNITS_MAP = { 'fraction': IconAnchorUnits.FRACTION, @@ -190,13 +190,13 @@ const KML_SERIALIZERS = makeStructureNS( let DEFAULT_COLOR; /** - * @type {import("../style/Fill.js").default} + * @type {Fill} */ let DEFAULT_FILL_STYLE = null; /** * Get the default fill style (or null if not yet set). - * @return {import("../style/Fill.js").default} The default fill style. + * @return {Fill} The default fill style. */ export function getDefaultFillStyle() { return DEFAULT_FILL_STYLE; @@ -208,12 +208,12 @@ export function getDefaultFillStyle() { let DEFAULT_IMAGE_STYLE_ANCHOR; /** - * @type {import("../style/IconAnchorUnits.js").default} + * @type {IconAnchorUnits} */ let DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS; /** - * @type {import("../style/IconAnchorUnits.js").default} + * @type {IconAnchorUnits} */ let DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS; @@ -251,57 +251,57 @@ export function getDefaultImageStyle() { let DEFAULT_NO_IMAGE_STYLE; /** - * @type {import("../style/Stroke.js").default} + * @type {Stroke} */ let DEFAULT_STROKE_STYLE = null; /** * Get the default stroke style (or null if not yet set). - * @return {import("../style/Stroke.js").default} The default stroke style. + * @return {Stroke} The default stroke style. */ export function getDefaultStrokeStyle() { return DEFAULT_STROKE_STYLE; } /** - * @type {import("../style/Stroke.js").default} + * @type {Stroke} */ let DEFAULT_TEXT_STROKE_STYLE; /** - * @type {import("../style/Text.js").default} + * @type {Text} */ let DEFAULT_TEXT_STYLE = null; /** * Get the default text style (or null if not yet set). - * @return {import("../style/Text.js").default} The default text style. + * @return {Text} The default text style. */ export function getDefaultTextStyle() { return DEFAULT_TEXT_STYLE; } /** - * @type {import("../style/Style.js").default} + * @type {Style} */ let DEFAULT_STYLE = null; /** * Get the default style (or null if not yet set). - * @return {import("../style/Style.js").default} The default style. + * @return {Style} The default style. */ export function getDefaultStyle() { return DEFAULT_STYLE; } /** - * @type {Array} + * @type {Array