Use imports for enum types

This commit is contained in:
Andreas Hocevar
2020-04-05 08:54:32 +02:00
parent c8d5fc418c
commit b0f20d6bd6
33 changed files with 77 additions and 77 deletions

View File

@@ -558,7 +558,7 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
* @param {LayoutOptions} layoutOptions Layout options.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {Array<number>=} ends Ends.
* @return {GeometryLayout} Layout.
* @return {import("../geom/GeometryLayout.js").default} Layout.
*/
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
let layout = GeometryLayout.XY;

View File

@@ -57,10 +57,10 @@ import {transformGeometryWithOptions} from './Feature.js';
/**
* @typedef {Object} Vec2
* @property {number} x
* @property {IconAnchorUnits} xunits
* @property {import("../style/IconAnchorUnits").default} xunits
* @property {number} y
* @property {IconAnchorUnits} yunits
* @property {IconOrigin} origin
* @property {import("../style/IconAnchorUnits").default} yunits
* @property {import("../style/IconOrigin.js").default} origin
*/
/**
@@ -96,7 +96,7 @@ const SCHEMA_LOCATION =
'https://developers.google.com/kml/schema/kml22gx.xsd';
/**
* @type {Object<string, IconAnchorUnits>}
* @type {Object<string, import("../style/IconAnchorUnits").default>}
*/
const ICON_ANCHOR_UNITS_MAP = {
'fraction': IconAnchorUnits.FRACTION,
@@ -212,12 +212,12 @@ export function getDefaultFillStyle() {
let DEFAULT_IMAGE_STYLE_ANCHOR;
/**
* @type {IconAnchorUnits}
* @type {import("../style/IconAnchorUnits").default}
*/
let DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS;
/**
* @type {IconAnchorUnits}
* @type {import("../style/IconAnchorUnits").default}
*/
let DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS;

View File

@@ -421,10 +421,10 @@ function readRawFeature(pbf, layer, i) {
* @param {number} type The raw feature's geometry type
* @param {number} numEnds Number of ends of the flat coordinates of the
* geometry.
* @return {GeometryType} The geometry type.
* @return {import("../geom/GeometryType.js").default} The geometry type.
*/
function getGeometryType(type, numEnds) {
/** @type {GeometryType} */
/** @type {import("../geom/GeometryType.js").default} */
let geometryType;
if (type === 1) {
geometryType =

View File

@@ -55,7 +55,7 @@ class Polyline extends TextFeature {
/**
* @private
* @type {GeometryLayout}
* @type {import("../geom/GeometryLayout").default}
*/
this.geometryLayout_ = options.geometryLayout
? options.geometryLayout

View File

@@ -16,7 +16,7 @@ import {transformGeometryWithOptions} from './Feature.js';
/**
* Geometry constructors
* @enum {function (new:import("../geom/Geometry.js").default, Array, GeometryLayout)}
* @enum {function (new:import("../geom/Geometry.js").default, Array, import("../geom/GeometryLayout.js").default)}
*/
const GeometryConstructor = {
'POINT': Point,
@@ -241,7 +241,7 @@ class Parser {
this.token_;
/**
* @type {GeometryLayout}
* @type {import("../geom/GeometryLayout.js").default}
* @private
*/
this.layout_ = GeometryLayout.XY;
@@ -290,7 +290,7 @@ class Parser {
/**
* Try to parse the dimensional info.
* @return {GeometryLayout} The layout.
* @return {import("../geom/GeometryLayout.js").default} The layout.
* @private
*/
parseGeometryLayout_() {