Remove extra imports in jsdoc

The symbols are already imported (es6 import)
This commit is contained in:
Frederic Junod
2018-09-06 15:57:32 +02:00
parent e32b3b5957
commit a6861f5f49
11 changed files with 141 additions and 141 deletions

View File

@@ -105,10 +105,10 @@ class GML3 extends GMLBase {
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @private * @private
* @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString. * @return {MultiLineString|undefined} MultiLineString.
*/ */
readMultiCurve_(node, objectStack) { readMultiCurve_(node, objectStack) {
/** @type {Array<import("../geom/LineString.js").default>} */ /** @type {Array<LineString>} */
const lineStrings = pushParseAndPop([], const lineStrings = pushParseAndPop([],
this.MULTICURVE_PARSERS_, node, objectStack, this); this.MULTICURVE_PARSERS_, node, objectStack, this);
if (lineStrings) { if (lineStrings) {
@@ -123,10 +123,10 @@ class GML3 extends GMLBase {
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @private * @private
* @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon. * @return {MultiPolygon|undefined} MultiPolygon.
*/ */
readMultiSurface_(node, objectStack) { readMultiSurface_(node, objectStack) {
/** @type {Array<import("../geom/Polygon.js").default>} */ /** @type {Array<Polygon>} */
const polygons = pushParseAndPop([], const polygons = pushParseAndPop([],
this.MULTISURFACE_PARSERS_, node, objectStack, this); this.MULTISURFACE_PARSERS_, node, objectStack, this);
if (polygons) { if (polygons) {
@@ -234,7 +234,7 @@ class GML3 extends GMLBase {
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @private * @private
* @return {import("../geom/Polygon.js").default|undefined} Polygon. * @return {Polygon|undefined} Polygon.
*/ */
readSurface_(node, objectStack) { readSurface_(node, objectStack) {
/** @type {Array<Array<number>>} */ /** @type {Array<Array<number>>} */
@@ -258,7 +258,7 @@ class GML3 extends GMLBase {
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @private * @private
* @return {import("../geom/LineString.js").default|undefined} LineString. * @return {LineString|undefined} LineString.
*/ */
readCurve_(node, objectStack) { readCurve_(node, objectStack) {
/** @type {Array<number>} */ /** @type {Array<number>} */
@@ -436,7 +436,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Element} node Node. * @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. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */
@@ -532,7 +532,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {import("../geom/Polygon.js").default} geometry Polygon geometry. * @param {Polygon} geometry Polygon geometry.
* @param {Array<*>} objectStack Node stack. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */
@@ -560,7 +560,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {import("../geom/LineString.js").default} geometry LineString geometry. * @param {LineString} geometry LineString geometry.
* @param {Array<*>} objectStack Node stack. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */
@@ -585,7 +585,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {import("../geom/MultiPolygon.js").default} geometry MultiPolygon geometry. * @param {MultiPolygon} geometry MultiPolygon geometry.
* @param {Array<*>} objectStack Node stack. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */
@@ -626,7 +626,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {import("../geom/MultiLineString.js").default} geometry MultiLineString geometry. * @param {MultiLineString} geometry MultiLineString geometry.
* @param {Array<*>} objectStack Node stack. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */
@@ -659,7 +659,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry. * @param {Polygon} polygon Polygon geometry.
* @param {Array<*>} objectStack Node stack. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */
@@ -686,7 +686,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../geom/LineString.js").default} line LineString geometry. * @param {LineString} line LineString geometry.
* @param {Array<*>} objectStack Node stack. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */
@@ -700,7 +700,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry. * @param {Polygon} polygon Polygon geometry.
* @param {Array<*>} objectStack Node stack. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */
@@ -712,7 +712,7 @@ class GML3 extends GMLBase {
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../geom/LineString.js").default} line LineString geometry. * @param {LineString} line LineString geometry.
* @param {Array<*>} objectStack Node stack. * @param {Array<*>} objectStack Node stack.
* @private * @private
*/ */

View File

@@ -132,7 +132,7 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {Array<import("../Feature.js").default> | undefined} Features. * @return {Array<Feature> | undefined} Features.
*/ */
readFeaturesInternal(node, objectStack) { readFeaturesInternal(node, objectStack) {
const localName = node.localName; const localName = node.localName;
@@ -240,7 +240,7 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../Feature.js").default} Feature. * @return {Feature} Feature.
*/ */
readFeatureElement(node, objectStack) { readFeatureElement(node, objectStack) {
let n; let n;
@@ -281,7 +281,7 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Point.js").default|undefined} Point. * @return {Point|undefined} Point.
*/ */
readPoint(node, objectStack) { readPoint(node, objectStack) {
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack); const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
@@ -293,7 +293,7 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/MultiPoint.js").default|undefined} MultiPoint. * @return {MultiPoint|undefined} MultiPoint.
*/ */
readMultiPoint(node, objectStack) { readMultiPoint(node, objectStack) {
/** @type {Array<Array<number>>} */ /** @type {Array<Array<number>>} */
@@ -309,10 +309,10 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString. * @return {MultiLineString|undefined} MultiLineString.
*/ */
readMultiLineString(node, objectStack) { readMultiLineString(node, objectStack) {
/** @type {Array<import("../geom/LineString.js").default>} */ /** @type {Array<LineString>} */
const lineStrings = pushParseAndPop([], const lineStrings = pushParseAndPop([],
this.MULTILINESTRING_PARSERS_, node, objectStack, this); this.MULTILINESTRING_PARSERS_, node, objectStack, this);
if (lineStrings) { if (lineStrings) {
@@ -323,10 +323,10 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon. * @return {MultiPolygon|undefined} MultiPolygon.
*/ */
readMultiPolygon(node, objectStack) { readMultiPolygon(node, objectStack) {
/** @type {Array<import("../geom/Polygon.js").default>} */ /** @type {Array<Polygon>} */
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this); const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
if (polygons) { if (polygons) {
return new MultiPolygon(polygons); return new MultiPolygon(polygons);
@@ -363,7 +363,7 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/LineString.js").default|undefined} LineString. * @return {LineString|undefined} LineString.
*/ */
readLineString(node, objectStack) { readLineString(node, objectStack) {
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack); const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
@@ -395,7 +395,7 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/LinearRing.js").default|undefined} LinearRing. * @return {LinearRing|undefined} LinearRing.
*/ */
readLinearRing(node, objectStack) { readLinearRing(node, objectStack) {
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack); const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
@@ -407,7 +407,7 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Polygon.js").default|undefined} Polygon. * @return {Polygon|undefined} Polygon.
*/ */
readPolygon(node, objectStack) { readPolygon(node, objectStack) {
/** @type {Array<Array<number>>} */ /** @type {Array<Array<number>>} */

View File

@@ -38,7 +38,7 @@ const SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' +
/** /**
* @const * @const
* @type {Object<string, function(Node, Array<*>): (import("../Feature.js").default|undefined)>} * @type {Object<string, function(Node, Array<*>): (Feature|undefined)>}
*/ */
const FEATURE_READER = { const FEATURE_READER = {
'rte': readRte, 'rte': readRte,
@@ -84,7 +84,7 @@ const GPX_SERIALIZERS = makeStructureNS(
/** /**
* @typedef {Object} Options * @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 * to process `extensions` nodes. To prevent memory leaks, this callback function must
* not store any references to the node. Note that the `extensions` * not store any references to the node. Note that the `extensions`
* node is not allowed in GPX 1.0. Moreover, only `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'); this.dataProjection = getProjection('EPSG:4326');
/** /**
* @type {function(import("../Feature.js").default, Node)|undefined} * @type {function(Feature, Node)|undefined}
* @private * @private
*/ */
this.readExtensions_ = options.readExtensions; this.readExtensions_ = options.readExtensions;
} }
/** /**
* @param {Array<import("../Feature.js").default>} features List of features. * @param {Array<Feature>} features List of features.
* @private * @private
*/ */
handleReadExtensions_(features) { handleReadExtensions_(features) {
@@ -182,7 +182,7 @@ class GPX extends XMLFeature {
return []; return [];
} }
if (node.localName == 'gpx') { if (node.localName == 'gpx') {
/** @type {Array<import("../Feature.js").default>} */ /** @type {Array<Feature>} */
const features = pushParseAndPop([], GPX_PARSERS, const features = pushParseAndPop([], GPX_PARSERS,
node, [this.getReadOptions(node, opt_options)]); node, [this.getReadOptions(node, opt_options)]);
if (features) { if (features) {
@@ -200,7 +200,7 @@ class GPX extends XMLFeature {
* LineString geometries are output as routes (`<rte>`), and MultiLineString * LineString geometries are output as routes (`<rte>`), and MultiLineString
* as tracks (`<trk>`). * as tracks (`<trk>`).
* *
* @param {Array<import("../Feature.js").default>} features Features. * @param {Array<Feature>} features Features.
* @param {import("./Feature.js").WriteOptions=} opt_options Options. * @param {import("./Feature.js").WriteOptions=} opt_options Options.
* @return {Node} Node. * @return {Node} Node.
* @override * @override
@@ -475,7 +475,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
* @return {Node|undefined} Node. * @return {Node|undefined} Node.
*/ */
function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) { 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) { if (geometry) {
const nodeName = GEOMETRY_TYPE_TO_NODENAME[geometry.getType()]; const nodeName = GEOMETRY_TYPE_TO_NODENAME[geometry.getType()];
if (nodeName) { if (nodeName) {
@@ -522,7 +522,7 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
* @param {LayoutOptions} layoutOptions Layout options. * @param {LayoutOptions} layoutOptions Layout options.
* @param {Array<number>} flatCoordinates Flat coordinates. * @param {Array<number>} flatCoordinates Flat coordinates.
* @param {Array<number>=} ends Ends. * @param {Array<number>=} ends Ends.
* @return {import("../geom/GeometryLayout.js").default} Layout. * @return {GeometryLayout} Layout.
*/ */
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) { function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
let layout = GeometryLayout.XY; let layout = GeometryLayout.XY;
@@ -630,7 +630,7 @@ function parseTrkSeg(node, objectStack) {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../Feature.js").default|undefined} Track. * @return {Feature|undefined} Track.
*/ */
function readRte(node, objectStack) { function readRte(node, objectStack) {
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
@@ -658,7 +658,7 @@ function readRte(node, objectStack) {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../Feature.js").default|undefined} Track. * @return {Feature|undefined} Track.
*/ */
function readTrk(node, objectStack) { function readTrk(node, objectStack) {
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
@@ -689,7 +689,7 @@ function readTrk(node, objectStack) {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../Feature.js").default|undefined} Waypoint. * @return {Feature|undefined} Waypoint.
*/ */
function readWpt(node, objectStack) { function readWpt(node, objectStack) {
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
@@ -773,7 +773,7 @@ function writeWptType(node, coordinate, objectStack) {
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../Feature.js").default} feature Feature. * @param {Feature} feature Feature.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writeRte(node, feature, objectStack) { function writeRte(node, feature, objectStack) {
@@ -782,7 +782,7 @@ function writeRte(node, feature, objectStack) {
const context = {node: node, 'properties': properties}; const context = {node: node, 'properties': properties};
let geometry = feature.getGeometry(); let geometry = feature.getGeometry();
if (geometry) { if (geometry) {
geometry = /** @type {import("../geom/LineString.js").default} */ (transformWithOptions(geometry, true, options)); geometry = /** @type {LineString} */ (transformWithOptions(geometry, true, options));
context['geometryLayout'] = geometry.getLayout(); context['geometryLayout'] = geometry.getLayout();
properties['rtept'] = geometry.getCoordinates(); properties['rtept'] = geometry.getCoordinates();
} }
@@ -797,7 +797,7 @@ function writeRte(node, feature, objectStack) {
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../Feature.js").default} feature Feature. * @param {Feature} feature Feature.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writeTrk(node, feature, objectStack) { function writeTrk(node, feature, objectStack) {
@@ -807,7 +807,7 @@ function writeTrk(node, feature, objectStack) {
const context = {node: node, 'properties': properties}; const context = {node: node, 'properties': properties};
let geometry = feature.getGeometry(); let geometry = feature.getGeometry();
if (geometry) { if (geometry) {
geometry = /** @type {import("../geom/MultiLineString.js").default} */ geometry = /** @type {MultiLineString} */
(transformWithOptions(geometry, true, options)); (transformWithOptions(geometry, true, options));
properties['trkseg'] = geometry.getLineStrings(); properties['trkseg'] = geometry.getLineStrings();
} }
@@ -822,7 +822,7 @@ function writeTrk(node, feature, objectStack) {
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../geom/LineString.js").default} lineString LineString. * @param {LineString} lineString LineString.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writeTrkSeg(node, lineString, objectStack) { function writeTrkSeg(node, lineString, objectStack) {
@@ -837,7 +837,7 @@ function writeTrkSeg(node, lineString, objectStack) {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {import("../Feature.js").default} feature Feature. * @param {Feature} feature Feature.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writeWpt(node, feature, objectStack) { function writeWpt(node, feature, objectStack) {
@@ -846,7 +846,7 @@ function writeWpt(node, feature, objectStack) {
context['properties'] = feature.getProperties(); context['properties'] = feature.getProperties();
let geometry = feature.getGeometry(); let geometry = feature.getGeometry();
if (geometry) { if (geometry) {
geometry = /** @type {import("../geom/Point.js").default} */ geometry = /** @type {Point} */
(transformWithOptions(geometry, true, options)); (transformWithOptions(geometry, true, options));
context['geometryLayout'] = geometry.getLayout(); context['geometryLayout'] = geometry.getLayout();
writeWptType(node, geometry.getCoordinates(), objectStack); writeWptType(node, geometry.getCoordinates(), objectStack);

View File

@@ -35,10 +35,10 @@ import {createElementNS, getAllTextContent, isDocument, isNode, makeArrayExtende
/** /**
* @typedef {Object} Vec2 * @typedef {Object} Vec2
* @property {number} x * @property {number} x
* @property {import("../style/IconAnchorUnits.js").default} xunits * @property {IconAnchorUnits} xunits
* @property {number} y * @property {number} y
* @property {import("../style/IconAnchorUnits.js").default} yunits * @property {IconAnchorUnits} yunits
* @property {import("../style/IconOrigin.js").default} origin * @property {IconOrigin} origin
*/ */
/** /**
@@ -79,7 +79,7 @@ const SCHEMA_LOCATION = 'http://www.opengis.net/kml/2.2 ' +
/** /**
* @type {Object<string, import("../style/IconAnchorUnits.js").default>} * @type {Object<string, IconAnchorUnits>}
*/ */
const ICON_ANCHOR_UNITS_MAP = { const ICON_ANCHOR_UNITS_MAP = {
'fraction': IconAnchorUnits.FRACTION, 'fraction': IconAnchorUnits.FRACTION,
@@ -190,13 +190,13 @@ const KML_SERIALIZERS = makeStructureNS(
let DEFAULT_COLOR; let DEFAULT_COLOR;
/** /**
* @type {import("../style/Fill.js").default} * @type {Fill}
*/ */
let DEFAULT_FILL_STYLE = null; let DEFAULT_FILL_STYLE = null;
/** /**
* Get the default fill style (or null if not yet set). * 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() { export function getDefaultFillStyle() {
return DEFAULT_FILL_STYLE; return DEFAULT_FILL_STYLE;
@@ -208,12 +208,12 @@ export function getDefaultFillStyle() {
let DEFAULT_IMAGE_STYLE_ANCHOR; let DEFAULT_IMAGE_STYLE_ANCHOR;
/** /**
* @type {import("../style/IconAnchorUnits.js").default} * @type {IconAnchorUnits}
*/ */
let DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS; let DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS;
/** /**
* @type {import("../style/IconAnchorUnits.js").default} * @type {IconAnchorUnits}
*/ */
let DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS; let DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS;
@@ -251,57 +251,57 @@ export function getDefaultImageStyle() {
let DEFAULT_NO_IMAGE_STYLE; let DEFAULT_NO_IMAGE_STYLE;
/** /**
* @type {import("../style/Stroke.js").default} * @type {Stroke}
*/ */
let DEFAULT_STROKE_STYLE = null; let DEFAULT_STROKE_STYLE = null;
/** /**
* Get the default stroke style (or null if not yet set). * 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() { export function getDefaultStrokeStyle() {
return DEFAULT_STROKE_STYLE; return DEFAULT_STROKE_STYLE;
} }
/** /**
* @type {import("../style/Stroke.js").default} * @type {Stroke}
*/ */
let DEFAULT_TEXT_STROKE_STYLE; let DEFAULT_TEXT_STROKE_STYLE;
/** /**
* @type {import("../style/Text.js").default} * @type {Text}
*/ */
let DEFAULT_TEXT_STYLE = null; let DEFAULT_TEXT_STYLE = null;
/** /**
* Get the default text style (or null if not yet set). * 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() { export function getDefaultTextStyle() {
return DEFAULT_TEXT_STYLE; return DEFAULT_TEXT_STYLE;
} }
/** /**
* @type {import("../style/Style.js").default} * @type {Style}
*/ */
let DEFAULT_STYLE = null; let DEFAULT_STYLE = null;
/** /**
* Get the default style (or null if not yet set). * 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() { export function getDefaultStyle() {
return DEFAULT_STYLE; return DEFAULT_STYLE;
} }
/** /**
* @type {Array<import("../style/Style.js").default>} * @type {Array<Style>}
*/ */
let DEFAULT_STYLE_ARRAY = null; let DEFAULT_STYLE_ARRAY = null;
/** /**
* Get the default style array (or null if not yet set). * Get the default style array (or null if not yet set).
* @return {Array<import("../style/Style.js").default>} The default style. * @return {Array<Style>} The default style.
*/ */
export function getDefaultStyleArray() { export function getDefaultStyleArray() {
return DEFAULT_STYLE_ARRAY; return DEFAULT_STYLE_ARRAY;
@@ -377,7 +377,7 @@ function createStyleDefaults() {
* @typedef {Object} Options * @typedef {Object} Options
* @property {boolean} [extractStyles=true] Extract styles from the KML. * @property {boolean} [extractStyles=true] Extract styles from the KML.
* @property {boolean} [showPointNames=true] Show names as labels for placemarks which contain points. * @property {boolean} [showPointNames=true] Show names as labels for placemarks which contain points.
* @property {Array<import("../style/Style.js").default>} [defaultStyle] Default style. The * @property {Array<Style>} [defaultStyle] Default style. The
* default default style is the same as Google Earth. * default default style is the same as Google Earth.
* @property {boolean} [writeStyles=true] Write styles into KML. * @property {boolean} [writeStyles=true] Write styles into KML.
*/ */
@@ -420,7 +420,7 @@ class KML extends XMLFeature {
/** /**
* @private * @private
* @type {Array<import("../style/Style.js").default>} * @type {Array<Style>}
*/ */
this.defaultStyle_ = options.defaultStyle ? this.defaultStyle_ = options.defaultStyle ?
options.defaultStyle : DEFAULT_STYLE_ARRAY; options.defaultStyle : DEFAULT_STYLE_ARRAY;
@@ -441,7 +441,7 @@ class KML extends XMLFeature {
/** /**
* @private * @private
* @type {!Object<string, (Array<import("../style/Style.js").default>|string)>} * @type {!Object<string, (Array<Style>|string)>}
*/ */
this.sharedStyles_ = {}; this.sharedStyles_ = {};
@@ -458,7 +458,7 @@ class KML extends XMLFeature {
* @param {Node} node Node. * @param {Node} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @private * @private
* @return {Array<import("../Feature.js").default>|undefined} Features. * @return {Array<Feature>|undefined} Features.
*/ */
readDocumentOrFolder_(node, objectStack) { readDocumentOrFolder_(node, objectStack) {
// FIXME use scope somehow // FIXME use scope somehow
@@ -470,7 +470,7 @@ class KML extends XMLFeature {
'Style': this.readSharedStyle_.bind(this), 'Style': this.readSharedStyle_.bind(this),
'StyleMap': this.readSharedStyleMap_.bind(this) 'StyleMap': this.readSharedStyleMap_.bind(this)
}); });
/** @type {Array<import("../Feature.js").default>} */ /** @type {Array<Feature>} */
const features = pushParseAndPop([], parsersNS, node, objectStack, this); const features = pushParseAndPop([], parsersNS, node, objectStack, this);
if (features) { if (features) {
return features; return features;
@@ -483,7 +483,7 @@ class KML extends XMLFeature {
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @private * @private
* @return {import("../Feature.js").default|undefined} Feature. * @return {Feature|undefined} Feature.
*/ */
readPlacemark_(node, objectStack) { readPlacemark_(node, objectStack) {
const object = pushParseAndPop({'geometry': null}, const object = pushParseAndPop({'geometry': null},
@@ -823,7 +823,7 @@ class KML extends XMLFeature {
* Encode an array of features in the KML format as an XML node. GeometryCollections, * Encode an array of features in the KML format as an XML node. GeometryCollections,
* MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries. * MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries.
* *
* @param {Array<import("../Feature.js").default>} features Features. * @param {Array<Feature>} features Features.
* @param {import("./Feature.js").WriteOptions=} opt_options Options. * @param {import("./Feature.js").WriteOptions=} opt_options Options.
* @return {Node} Node. * @return {Node} Node.
* @override * @override
@@ -855,9 +855,9 @@ class KML extends XMLFeature {
/** /**
* @param {import("../style/Style.js").default|undefined} foundStyle Style. * @param {Style|undefined} foundStyle Style.
* @param {string} name Name. * @param {string} name Name.
* @return {import("../style/Style.js").default} style Style. * @return {Style} style Style.
*/ */
function createNameStyleFunction(foundStyle, name) { function createNameStyleFunction(foundStyle, name) {
let textStyle = null; let textStyle = null;
@@ -902,10 +902,10 @@ function createNameStyleFunction(foundStyle, name) {
/** /**
* @param {Array<import("../style/Style.js").default>|undefined} style Style. * @param {Array<Style>|undefined} style Style.
* @param {string} styleUrl Style URL. * @param {string} styleUrl Style URL.
* @param {Array<import("../style/Style.js").default>} defaultStyle Default style. * @param {Array<Style>} defaultStyle Default style.
* @param {!Object<string, (Array<import("../style/Style.js").default>|string)>} sharedStyles Shared styles. * @param {!Object<string, (Array<Style>|string)>} sharedStyles Shared styles.
* @param {boolean|undefined} showPointNames true to show names for point placemarks. * @param {boolean|undefined} showPointNames true to show names for point placemarks.
* @return {import("../style/Style.js").StyleFunction} Feature style function. * @return {import("../style/Style.js").StyleFunction} Feature style function.
*/ */
@@ -913,13 +913,13 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles,
return ( return (
/** /**
* @param {import("../Feature.js").default} feature feature. * @param {Feature} feature feature.
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @return {Array<import("../style/Style.js").default>} Style. * @return {Array<Style>} Style.
*/ */
function(feature, resolution) { function(feature, resolution) {
let drawName = showPointNames; let drawName = showPointNames;
/** @type {import("../style/Style.js").default|undefined} */ /** @type {Style|undefined} */
let nameStyle; let nameStyle;
let name = ''; let name = '';
if (drawName) { if (drawName) {
@@ -960,11 +960,11 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles,
/** /**
* @param {Array<import("../style/Style.js").default>|string|undefined} styleValue Style value. * @param {Array<Style>|string|undefined} styleValue Style value.
* @param {Array<import("../style/Style.js").default>} defaultStyle Default style. * @param {Array<Style>} defaultStyle Default style.
* @param {!Object<string, (Array<import("../style/Style.js").default>|string)>} sharedStyles * @param {!Object<string, (Array<Style>|string)>} sharedStyles
* Shared styles. * Shared styles.
* @return {Array<import("../style/Style.js").default>} Style. * @return {Array<Style>} Style.
*/ */
function findStyle(styleValue, defaultStyle, sharedStyles) { function findStyle(styleValue, defaultStyle, sharedStyles) {
if (Array.isArray(styleValue)) { if (Array.isArray(styleValue)) {
@@ -1105,7 +1105,7 @@ const STYLE_MAP_PARSERS = makeStructureNS(
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {Array<import("../style/Style.js").default>|string|undefined} StyleMap. * @return {Array<Style>|string|undefined} StyleMap.
*/ */
function readStyleMapValue(node, objectStack) { function readStyleMapValue(node, objectStack) {
return pushParseAndPop(undefined, return pushParseAndPop(undefined,
@@ -1397,7 +1397,7 @@ const GX_MULTITRACK_GEOMETRY_PARSERS = makeStructureNS(
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString. * @return {MultiLineString|undefined} MultiLineString.
*/ */
function readGxMultiTrack(node, objectStack) { function readGxMultiTrack(node, objectStack) {
const lineStrings = pushParseAndPop([], const lineStrings = pushParseAndPop([],
@@ -1425,7 +1425,7 @@ const GX_TRACK_PARSERS = makeStructureNS(
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/LineString.js").default|undefined} LineString. * @return {LineString|undefined} LineString.
*/ */
function readGxTrack(node, objectStack) { function readGxTrack(node, objectStack) {
const gxTrackObject = pushParseAndPop( const gxTrackObject = pushParseAndPop(
@@ -1513,7 +1513,7 @@ const EXTRUDE_AND_ALTITUDE_MODE_PARSERS = makeStructureNS(
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/LineString.js").default|undefined} LineString. * @return {LineString|undefined} LineString.
*/ */
function readLineString(node, objectStack) { function readLineString(node, objectStack) {
const properties = pushParseAndPop({}, const properties = pushParseAndPop({},
@@ -1534,7 +1534,7 @@ function readLineString(node, objectStack) {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Polygon.js").default|undefined} Polygon. * @return {Polygon|undefined} Polygon.
*/ */
function readLinearRing(node, objectStack) { function readLinearRing(node, objectStack) {
const properties = pushParseAndPop({}, const properties = pushParseAndPop({},
@@ -1628,7 +1628,7 @@ function readMultiGeometry(node, objectStack) {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Point.js").default|undefined} Point. * @return {Point|undefined} Point.
*/ */
function readPoint(node, objectStack) { function readPoint(node, objectStack) {
const properties = pushParseAndPop({}, const properties = pushParseAndPop({},
@@ -1660,7 +1660,7 @@ const FLAT_LINEAR_RINGS_PARSERS = makeStructureNS(
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Polygon.js").default|undefined} Polygon. * @return {Polygon|undefined} Polygon.
*/ */
function readPolygon(node, objectStack) { function readPolygon(node, objectStack) {
const properties = pushParseAndPop(/** @type {Object<string,*>} */ ({}), const properties = pushParseAndPop(/** @type {Object<string,*>} */ ({}),
@@ -1700,7 +1700,7 @@ const STYLE_PARSERS = makeStructureNS(
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {Array<import("../style/Style.js").default>} Style. * @return {Array<Style>} Style.
*/ */
function readStyle(node, objectStack) { function readStyle(node, objectStack) {
const styleObject = pushParseAndPop( const styleObject = pushParseAndPop(
@@ -1708,7 +1708,7 @@ function readStyle(node, objectStack) {
if (!styleObject) { if (!styleObject) {
return null; return null;
} }
let fillStyle = /** @type {import("../style/Fill.js").default} */ let fillStyle = /** @type {Fill} */
('fillStyle' in styleObject ? ('fillStyle' in styleObject ?
styleObject['fillStyle'] : DEFAULT_FILL_STYLE); styleObject['fillStyle'] : DEFAULT_FILL_STYLE);
const fill = /** @type {boolean|undefined} */ (styleObject['fill']); const fill = /** @type {boolean|undefined} */ (styleObject['fill']);
@@ -1721,10 +1721,10 @@ function readStyle(node, objectStack) {
if (imageStyle == DEFAULT_NO_IMAGE_STYLE) { if (imageStyle == DEFAULT_NO_IMAGE_STYLE) {
imageStyle = undefined; imageStyle = undefined;
} }
const textStyle = /** @type {import("../style/Text.js").default} */ const textStyle = /** @type {Text} */
('textStyle' in styleObject ? ('textStyle' in styleObject ?
styleObject['textStyle'] : DEFAULT_TEXT_STYLE); styleObject['textStyle'] : DEFAULT_TEXT_STYLE);
let strokeStyle = /** @type {import("../style/Stroke.js").default} */ let strokeStyle = /** @type {Stroke} */
('strokeStyle' in styleObject ? ('strokeStyle' in styleObject ?
styleObject['strokeStyle'] : DEFAULT_STROKE_STYLE); styleObject['strokeStyle'] : DEFAULT_STROKE_STYLE);
const outline = /** @type {boolean|undefined} */ const outline = /** @type {boolean|undefined} */
@@ -1745,7 +1745,7 @@ function readStyle(node, objectStack) {
/** /**
* Reads an array of geometries and creates arrays for common geometry * Reads an array of geometries and creates arrays for common geometry
* properties. Then sets them to the multi geometry. * properties. Then sets them to the multi geometry.
* @param {import("../geom/MultiPoint.js").default|import("../geom/MultiLineString.js").default|import("../geom/MultiPolygon.js").default} multiGeometry A multi-geometry. * @param {MultiPoint|MultiLineString|MultiPolygon} multiGeometry A multi-geometry.
* @param {Array<import("../geom/Geometry.js").default>} geometries List of geometries. * @param {Array<import("../geom/Geometry.js").default>} geometries List of geometries.
*/ */
function setCommonGeometryProperties(multiGeometry, geometries) { function setCommonGeometryProperties(multiGeometry, geometries) {
@@ -1861,10 +1861,10 @@ function pairDataParser(node, objectStack) {
if (styleUrl) { if (styleUrl) {
objectStack[objectStack.length - 1] = styleUrl; objectStack[objectStack.length - 1] = styleUrl;
} }
const Style = /** @type {import("../style/Style.js").default} */ const style = /** @type {Style} */
(pairObject['Style']); (pairObject['Style']);
if (Style) { if (style) {
objectStack[objectStack.length - 1] = Style; objectStack[objectStack.length - 1] = style;
} }
} }
} }
@@ -2205,7 +2205,7 @@ const DOCUMENT_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {Array<import("../Feature.js").default>} features Features. * @param {Array<Feature>} features Features.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @this {KML} * @this {KML}
*/ */
@@ -2409,7 +2409,7 @@ const LABEL_STYLE_SERIALIZERS = makeStructureNS(
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../style/Text.js").default} style style. * @param {Text} style style.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writeLabelStyle(node, style, objectStack) { function writeLabelStyle(node, style, objectStack) {
@@ -2455,7 +2455,7 @@ const LINE_STYLE_SERIALIZERS = makeStructureNS(
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../style/Stroke.js").default} style style. * @param {Stroke} style style.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writeLineStyle(node, style, objectStack) { function writeLineStyle(node, style, objectStack) {
@@ -2566,18 +2566,18 @@ function writeMultiGeometry(node, geometry, objectStack) {
/** @type {function(*, Array<*>, string=): (Node|undefined)} */ /** @type {function(*, Array<*>, string=): (Node|undefined)} */
let factory; let factory;
if (type == GeometryType.GEOMETRY_COLLECTION) { if (type == GeometryType.GEOMETRY_COLLECTION) {
geometries = /** @type {import("../geom/GeometryCollection.js").default} */ (geometry).getGeometries(); geometries = /** @type {GeometryCollection} */ (geometry).getGeometries();
factory = GEOMETRY_NODE_FACTORY; factory = GEOMETRY_NODE_FACTORY;
} else if (type == GeometryType.MULTI_POINT) { } else if (type == GeometryType.MULTI_POINT) {
geometries = /** @type {import("../geom/MultiPoint.js").default} */ (geometry).getPoints(); geometries = /** @type {MultiPoint} */ (geometry).getPoints();
factory = POINT_NODE_FACTORY; factory = POINT_NODE_FACTORY;
} else if (type == GeometryType.MULTI_LINE_STRING) { } else if (type == GeometryType.MULTI_LINE_STRING) {
geometries = geometries =
(/** @type {import("../geom/MultiLineString.js").default} */ (geometry)).getLineStrings(); (/** @type {MultiLineString} */ (geometry)).getLineStrings();
factory = LINE_STRING_NODE_FACTORY; factory = LINE_STRING_NODE_FACTORY;
} else if (type == GeometryType.MULTI_POLYGON) { } else if (type == GeometryType.MULTI_POLYGON) {
geometries = geometries =
(/** @type {import("../geom/MultiPolygon.js").default} */ (geometry)).getPolygons(); (/** @type {MultiPolygon} */ (geometry)).getPolygons();
factory = POLYGON_NODE_FACTORY; factory = POLYGON_NODE_FACTORY;
} else { } else {
assert(false, 39); // Unknown geometry type assert(false, 39); // Unknown geometry type
@@ -2658,7 +2658,7 @@ const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
* FIXME currently we do serialize arbitrary/custom feature properties * FIXME currently we do serialize arbitrary/custom feature properties
* (ExtendedData). * (ExtendedData).
* @param {Element} node Node. * @param {Element} node Node.
* @param {import("../Feature.js").default} feature Feature. * @param {Feature} feature Feature.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @this {KML} * @this {KML}
*/ */
@@ -2798,7 +2798,7 @@ const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../geom/Polygon.js").default} polygon Polygon. * @param {Polygon} polygon Polygon.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writePolygon(node, polygon, objectStack) { function writePolygon(node, polygon, objectStack) {
@@ -2838,7 +2838,7 @@ const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../style/Fill.js").default} style Style. * @param {Fill} style Style.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writePolyStyle(node, style, objectStack) { function writePolyStyle(node, style, objectStack) {
@@ -2884,7 +2884,7 @@ const STYLE_SERIALIZERS = makeStructureNS(
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {import("../style/Style.js").default} style Style. * @param {Style} style Style.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
*/ */
function writeStyle(node, style, objectStack) { function writeStyle(node, style, objectStack) {

View File

@@ -23,7 +23,7 @@ import RenderFeature from '../render/Feature.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {function((import("../geom/Geometry.js").default|Object<string,*>)=)|function(import("../geom/GeometryType.js").default,Array<number>,(Array<number>|Array<Array<number>>),Object<string,*>,number)} [featureClass] * @property {function((import("../geom/Geometry.js").default|Object<string,*>)=)|function(GeometryType,Array<number>,(Array<number>|Array<Array<number>>),Object<string,*>,number)} [featureClass]
* Class for features returned by {@link module:ol/format/MVT#readFeatures}. Set to * Class for features returned by {@link module:ol/format/MVT#readFeatures}. Set to
* {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of * {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature}, * decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
@@ -55,7 +55,7 @@ class MVT extends FeatureFormat {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};
/** /**
* @type {import("../proj/Projection.js").default} * @type {Projection}
*/ */
this.dataProjection = new Projection({ this.dataProjection = new Projection({
code: '', code: '',
@@ -65,7 +65,7 @@ class MVT extends FeatureFormat {
/** /**
* @private * @private
* @type {function((import("../geom/Geometry.js").default|Object<string,*>)=)| * @type {function((import("../geom/Geometry.js").default|Object<string,*>)=)|
* function(import("../geom/GeometryType.js").default,Array<number>, * function(GeometryType,Array<number>,
* (Array<number>|Array<Array<number>>),Object<string,*>,number)} * (Array<number>|Array<Array<number>>),Object<string,*>,number)}
*/ */
this.featureClass_ = options.featureClass ? this.featureClass_ = options.featureClass ?
@@ -167,7 +167,7 @@ class MVT extends FeatureFormat {
* @param {Object} pbf PBF * @param {Object} pbf PBF
* @param {Object} rawFeature Raw Mapbox feature. * @param {Object} rawFeature Raw Mapbox feature.
* @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @param {import("./Feature.js").ReadOptions=} opt_options Read options.
* @return {import("../Feature.js").default|import("../render/Feature.js").default} Feature. * @return {import("../Feature.js").default|RenderFeature} Feature.
*/ */
createFeature_(pbf, rawFeature, opt_options) { createFeature_(pbf, rawFeature, opt_options) {
const type = rawFeature.type; const type = rawFeature.type;
@@ -252,7 +252,7 @@ class MVT extends FeatureFormat {
const pbf = new PBF(/** @type {ArrayBuffer} */ (source)); const pbf = new PBF(/** @type {ArrayBuffer} */ (source));
const pbfLayers = pbf.readFields(layersPBFReader, {}); const pbfLayers = pbf.readFields(layersPBFReader, {});
/** @type {Array<import("../Feature.js").default|import("../render/Feature.js").default>} */ /** @type {Array<import("../Feature.js").default|RenderFeature>} */
const features = []; const features = [];
for (const name in pbfLayers) { for (const name in pbfLayers) {
if (layers && layers.indexOf(name) == -1) { if (layers && layers.indexOf(name) == -1) {
@@ -397,10 +397,10 @@ function readRawFeature(pbf, layer, i) {
* @param {number} type The raw feature's geometry type * @param {number} type The raw feature's geometry type
* @param {number} numEnds Number of ends of the flat coordinates of the * @param {number} numEnds Number of ends of the flat coordinates of the
* geometry. * geometry.
* @return {import("../geom/GeometryType.js").default} The geometry type. * @return {GeometryType} The geometry type.
*/ */
function getGeometryType(type, numEnds) { function getGeometryType(type, numEnds) {
/** @type {import("../geom/GeometryType.js").default} */ /** @type {GeometryType} */
let geometryType; let geometryType;
if (type === 1) { if (type === 1) {
geometryType = numEnds === 1 ? geometryType = numEnds === 1 ?

View File

@@ -16,7 +16,7 @@ import {get as getProjection} from '../proj.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {number} [factor=1e5] The factor by which the coordinates values will be scaled. * @property {number} [factor=1e5] The factor by which the coordinates values will be scaled.
* @property {import("../geom/GeometryLayout.js").default} [geometryLayout='XY'] Layout of the * @property {GeometryLayout} [geometryLayout='XY'] Layout of the
* feature geometries created by the format reader. * feature geometries created by the format reader.
*/ */
@@ -59,7 +59,7 @@ class Polyline extends TextFeature {
/** /**
* @private * @private
* @type {import("../geom/GeometryLayout.js").default} * @type {GeometryLayout}
*/ */
this.geometryLayout_ = options.geometryLayout ? this.geometryLayout_ = options.geometryLayout ?
options.geometryLayout : GeometryLayout.XY; options.geometryLayout : GeometryLayout.XY;
@@ -123,7 +123,7 @@ class Polyline extends TextFeature {
* @inheritDoc * @inheritDoc
*/ */
writeGeometryText(geometry, opt_options) { writeGeometryText(geometry, opt_options) {
geometry = /** @type {import("../geom/LineString.js").default} */ geometry = /** @type {LineString} */
(transformWithOptions(geometry, true, this.adaptOptions(opt_options))); (transformWithOptions(geometry, true, this.adaptOptions(opt_options)));
const flatCoordinates = geometry.getFlatCoordinates(); const flatCoordinates = geometry.getFlatCoordinates();
const stride = geometry.getStride(); const stride = geometry.getStride();

View File

@@ -91,7 +91,7 @@ class TopoJSON extends JSONFeature {
if (transform) { if (transform) {
transformArcs(arcs, scale, translate); transformArcs(arcs, scale, translate);
} }
/** @type {Array<import("../Feature.js").default>} */ /** @type {Array<Feature>} */
const features = []; const features = [];
const topoJSONFeatures = topoJSONTopology.objects; const topoJSONFeatures = topoJSONTopology.objects;
const property = this.layerName_; const property = this.layerName_;
@@ -181,7 +181,7 @@ function concatenateArcs(indices, arcs) {
* @param {TopoJSONGeometry} object TopoJSON object. * @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array<number>} scale Scale for each dimension. * @param {Array<number>} scale Scale for each dimension.
* @param {Array<number>} translate Translation for each dimension. * @param {Array<number>} translate Translation for each dimension.
* @return {import("../geom/Point.js").default} Geometry. * @return {Point} Geometry.
*/ */
function readPointGeometry(object, scale, translate) { function readPointGeometry(object, scale, translate) {
const coordinates = object.coordinates; const coordinates = object.coordinates;
@@ -198,7 +198,7 @@ function readPointGeometry(object, scale, translate) {
* @param {TopoJSONGeometry} object TopoJSON object. * @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array<number>} scale Scale for each dimension. * @param {Array<number>} scale Scale for each dimension.
* @param {Array<number>} translate Translation for each dimension. * @param {Array<number>} translate Translation for each dimension.
* @return {import("../geom/MultiPoint.js").default} Geometry. * @return {MultiPoint} Geometry.
*/ */
function readMultiPointGeometry(object, scale, translate) { function readMultiPointGeometry(object, scale, translate) {
const coordinates = object.coordinates; const coordinates = object.coordinates;
@@ -216,7 +216,7 @@ function readMultiPointGeometry(object, scale, translate) {
* *
* @param {TopoJSONGeometry} object TopoJSON object. * @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs. * @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
* @return {import("../geom/LineString.js").default} Geometry. * @return {LineString} Geometry.
*/ */
function readLineStringGeometry(object, arcs) { function readLineStringGeometry(object, arcs) {
const coordinates = concatenateArcs(object.arcs, arcs); const coordinates = concatenateArcs(object.arcs, arcs);
@@ -229,7 +229,7 @@ function readLineStringGeometry(object, arcs) {
* *
* @param {TopoJSONGeometry} object TopoJSON object. * @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs. * @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
* @return {import("../geom/MultiLineString.js").default} Geometry. * @return {MultiLineString} Geometry.
*/ */
function readMultiLineStringGeometry(object, arcs) { function readMultiLineStringGeometry(object, arcs) {
const coordinates = []; const coordinates = [];
@@ -245,7 +245,7 @@ function readMultiLineStringGeometry(object, arcs) {
* *
* @param {TopoJSONGeometry} object TopoJSON object. * @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs. * @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
* @return {import("../geom/Polygon.js").default} Geometry. * @return {Polygon} Geometry.
*/ */
function readPolygonGeometry(object, arcs) { function readPolygonGeometry(object, arcs) {
const coordinates = []; const coordinates = [];
@@ -261,7 +261,7 @@ function readPolygonGeometry(object, arcs) {
* *
* @param {TopoJSONGeometry} object TopoJSON object. * @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs. * @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
* @return {import("../geom/MultiPolygon.js").default} Geometry. * @return {MultiPolygon} Geometry.
*/ */
function readMultiPolygonGeometry(object, arcs) { function readMultiPolygonGeometry(object, arcs) {
const coordinates = []; const coordinates = [];
@@ -291,7 +291,7 @@ function readMultiPolygonGeometry(object, arcs) {
* object to. * object to.
* @param {string} name Name of the `Topology`'s child object. * @param {string} name Name of the `Topology`'s child object.
* @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @param {import("./Feature.js").ReadOptions=} opt_options Read options.
* @return {Array<import("../Feature.js").default>} Array of features. * @return {Array<Feature>} Array of features.
*/ */
function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) { function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {
const geometries = collection.geometries; const geometries = collection.geometries;
@@ -315,7 +315,7 @@ function readFeaturesFromGeometryCollection(collection, arcs, scale, translate,
* object to. * object to.
* @param {string} name Name of the `Topology`'s child object. * @param {string} name Name of the `Topology`'s child object.
* @param {import("./Feature.js").ReadOptions=} opt_options Read options. * @param {import("./Feature.js").ReadOptions=} opt_options Read options.
* @return {import("../Feature.js").default} Feature. * @return {Feature} Feature.
*/ */
function readFeatureFromGeometry(object, arcs, scale, translate, property, name, opt_options) { function readFeatureFromGeometry(object, arcs, scale, translate, property, name, opt_options) {
let geometry; let geometry;

View File

@@ -83,7 +83,7 @@ const TRANSACTION_SERIALIZERS = {
* @typedef {Object} Options * @typedef {Object} Options
* @property {Object<string, string>|string} [featureNS] The namespace URI used for features. * @property {Object<string, string>|string} [featureNS] The namespace URI used for features.
* @property {Array<string>|string} [featureType] The feature type to parse. Only used for read operations. * @property {Array<string>|string} [featureType] The feature type to parse. Only used for read operations.
* @property {import("./GMLBase.js").default} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`. * @property {GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
* @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default. * @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
*/ */
@@ -226,7 +226,7 @@ class WFS extends XMLFeature {
/** /**
* @private * @private
* @type {import("./GMLBase.js").default} * @type {GMLBase}
*/ */
this.gmlFormat_ = options.gmlFormat ? this.gmlFormat_ = options.gmlFormat ?
options.gmlFormat : new GML3(); options.gmlFormat : new GML3();

View File

@@ -17,7 +17,7 @@ import SimpleGeometry from '../geom/SimpleGeometry.js';
/** /**
* @enum {function (new:import("../geom/Geometry.js").default, Array, import("../geom/GeometryLayout.js").default)} * @enum {function (new:import("../geom/Geometry.js").default, Array, GeometryLayout)}
*/ */
const GeometryConstructor = { const GeometryConstructor = {
'POINT': Point, 'POINT': Point,
@@ -249,7 +249,7 @@ class Parser {
this.token_; this.token_;
/** /**
* @type {import("../geom/GeometryLayout.js").default} * @type {GeometryLayout}
* @private * @private
*/ */
this.layout_ = GeometryLayout.XY; this.layout_ = GeometryLayout.XY;
@@ -298,7 +298,7 @@ class Parser {
/** /**
* Try to parse the dimensional info. * Try to parse the dimensional info.
* @return {import("../geom/GeometryLayout.js").default} The layout. * @return {GeometryLayout} The layout.
* @private * @private
*/ */
parseGeometryLayout_() { parseGeometryLayout_() {
@@ -659,7 +659,7 @@ class WKT extends TextFeature {
const geometry = this.readGeometryFromText(text, opt_options); const geometry = this.readGeometryFromText(text, opt_options);
if (this.splitCollection_ && if (this.splitCollection_ &&
geometry.getType() == GeometryType.GEOMETRY_COLLECTION) { geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
geometries = (/** @type {import("../geom/GeometryCollection.js").default} */ (geometry)) geometries = (/** @type {GeometryCollection} */ (geometry))
.getGeometriesArray(); .getGeometriesArray();
} else { } else {
geometries = [geometry]; geometries = [geometry];
@@ -724,7 +724,7 @@ class WKT extends TextFeature {
/** /**
* @param {import("../geom/Point.js").default} geom Point geometry. * @param {Point} geom Point geometry.
* @return {string} Coordinates part of Point as WKT. * @return {string} Coordinates part of Point as WKT.
*/ */
function encodePointGeometry(geom) { function encodePointGeometry(geom) {
@@ -737,7 +737,7 @@ function encodePointGeometry(geom) {
/** /**
* @param {import("../geom/MultiPoint.js").default} geom MultiPoint geometry. * @param {MultiPoint} geom MultiPoint geometry.
* @return {string} Coordinates part of MultiPoint as WKT. * @return {string} Coordinates part of MultiPoint as WKT.
*/ */
function encodeMultiPointGeometry(geom) { function encodeMultiPointGeometry(geom) {
@@ -751,7 +751,7 @@ function encodeMultiPointGeometry(geom) {
/** /**
* @param {import("../geom/GeometryCollection.js").default} geom GeometryCollection geometry. * @param {GeometryCollection} geom GeometryCollection geometry.
* @return {string} Coordinates part of GeometryCollection as WKT. * @return {string} Coordinates part of GeometryCollection as WKT.
*/ */
function encodeGeometryCollectionGeometry(geom) { function encodeGeometryCollectionGeometry(geom) {
@@ -765,7 +765,7 @@ function encodeGeometryCollectionGeometry(geom) {
/** /**
* @param {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} geom LineString geometry. * @param {LineString|import("../geom/LinearRing.js").default} geom LineString geometry.
* @return {string} Coordinates part of LineString as WKT. * @return {string} Coordinates part of LineString as WKT.
*/ */
function encodeLineStringGeometry(geom) { function encodeLineStringGeometry(geom) {
@@ -779,7 +779,7 @@ function encodeLineStringGeometry(geom) {
/** /**
* @param {import("../geom/MultiLineString.js").default} geom MultiLineString geometry. * @param {MultiLineString} geom MultiLineString geometry.
* @return {string} Coordinates part of MultiLineString as WKT. * @return {string} Coordinates part of MultiLineString as WKT.
*/ */
function encodeMultiLineStringGeometry(geom) { function encodeMultiLineStringGeometry(geom) {
@@ -793,7 +793,7 @@ function encodeMultiLineStringGeometry(geom) {
/** /**
* @param {import("../geom/Polygon.js").default} geom Polygon geometry. * @param {Polygon} geom Polygon geometry.
* @return {string} Coordinates part of Polygon as WKT. * @return {string} Coordinates part of Polygon as WKT.
*/ */
function encodePolygonGeometry(geom) { function encodePolygonGeometry(geom) {
@@ -807,7 +807,7 @@ function encodePolygonGeometry(geom) {
/** /**
* @param {import("../geom/MultiPolygon.js").default} geom MultiPolygon geometry. * @param {MultiPolygon} geom MultiPolygon geometry.
* @return {string} Coordinates part of MultiPolygon as WKT. * @return {string} Coordinates part of MultiPolygon as WKT.
*/ */
function encodeMultiPolygonGeometry(geom) { function encodeMultiPolygonGeometry(geom) {
@@ -820,7 +820,7 @@ function encodeMultiPolygonGeometry(geom) {
} }
/** /**
* @param {import("../geom/SimpleGeometry.js").default} geom SimpleGeometry geometry. * @param {SimpleGeometry} geom SimpleGeometry geometry.
* @return {string} Potential dimensional information for WKT type. * @return {string} Potential dimensional information for WKT type.
*/ */
function encodeGeometryLayout(geom) { function encodeGeometryLayout(geom) {

View File

@@ -54,7 +54,7 @@ class WMSGetFeatureInfo extends XMLFeature {
/** /**
* @private * @private
* @type {import("./GML2.js").default} * @type {GML2}
*/ */
this.gmlFormat_ = new GML2(); this.gmlFormat_ = new GML2();

View File

@@ -51,7 +51,7 @@ class WMTSCapabilities extends XML {
super(); super();
/** /**
* @type {import("./OWS.js").default} * @type {OWS}
* @private * @private
*/ */
this.owsParser_ = new OWS(); this.owsParser_ = new OWS();