diff --git a/src/ol/format/Feature.js b/src/ol/format/Feature.js index e3386d33b6..b179b57b81 100644 --- a/src/ol/format/Feature.js +++ b/src/ol/format/Feature.js @@ -6,6 +6,16 @@ import {assign} from '../obj.js'; import {get as getProjection, equivalent as equivalentProjection, transformExtent} from '../proj.js'; +/** + * @typedef {typeof import("../Feature.js").default|typeof import("../render/Feature.js").default} FeatureClass + */ + + +/** + * @typedef {import("../Feature.js").default|import("../render/Feature.js").default} FeatureLike + */ + + /** * @typedef {Object} ReadOptions * @property {import("../proj.js").ProjectionLike} [dataProjection] Projection of the data we are reading. @@ -131,7 +141,7 @@ class FeatureFormat { * @abstract * @param {Document|Node|Object|string} source Source. * @param {ReadOptions=} opt_options Read options. - * @return {import("../Feature.js").default} Feature. + * @return {FeatureLike} Feature. */ readFeature(source, opt_options) {} @@ -141,7 +151,7 @@ class FeatureFormat { * @abstract * @param {Document|Node|ArrayBuffer|Object|string} source Source. * @param {ReadOptions=} opt_options Read options. - * @return {Array} Features. + * @return {Array} Features. */ readFeatures(source, opt_options) {} diff --git a/src/ol/format/MVT.js b/src/ol/format/MVT.js index ea69a1c8be..dfca63c325 100644 --- a/src/ol/format/MVT.js +++ b/src/ol/format/MVT.js @@ -5,8 +5,8 @@ import {assert} from '../asserts.js'; import PBF from 'pbf'; -import FeatureFormat, {transformWithOptions} from '../format/Feature.js'; -import FormatType from '../format/FormatType.js'; +import FeatureFormat, {transformWithOptions} from './Feature.js'; +import FormatType from './FormatType.js'; import GeometryLayout from '../geom/GeometryLayout.js'; import GeometryType from '../geom/GeometryType.js'; import LineString from '../geom/LineString.js'; @@ -23,17 +23,14 @@ import RenderFeature from '../render/Feature.js'; /** * @typedef {Object} Options - * @property {function((import("../geom/Geometry.js").default|Object)=)|function(GeometryType,Array,(Array|Array>),Object,number)} [featureClass] - * 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 - * decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature}, - * which is optimized for rendering and hit detection. - * @property {string} [geometryName='geometry'] Geometry name to use when creating - * features. - * @property {string} [layerName='layer'] Name of the feature attribute that - * holds the layer name. - * @property {Array} [layers] Layers to read features from. If not - * provided, features will be read from all layers. + * @property {import("./Feature.js").FeatureClass} [featureClass] 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 decreased rendering performance. The default is + * {@link module:ol/render/Feature~RenderFeature}, which is optimized for rendering and hit detection. + * @property {string} [geometryName='geometry'] Geometry name to use when creating features. + * @property {string} [layerName='layer'] Name of the feature attribute that holds the layer name. + * @property {Array} [layers] Layers to read features from. If not provided, features will be read from all + * layers. */ @@ -64,12 +61,9 @@ class MVT extends FeatureFormat { /** * @private - * @type {function((import("../geom/Geometry.js").default|Object)=)| - * function(GeometryType,Array, - * (Array|Array>),Object,number)} + * @type {import("./Feature.js").FeatureClass} */ - this.featureClass_ = options.featureClass ? - options.featureClass : RenderFeature; + this.featureClass_ = options.featureClass ? options.featureClass : RenderFeature; /** * @private diff --git a/src/ol/interaction/DragAndDrop.js b/src/ol/interaction/DragAndDrop.js index 40f131c57c..cce32ccb1f 100644 --- a/src/ol/interaction/DragAndDrop.js +++ b/src/ol/interaction/DragAndDrop.js @@ -56,7 +56,7 @@ class DragAndDropEvent extends Event { /** * The features parsed from dropped data. - * @type {Array|undefined} + * @type {Array|undefined} * @api */ this.features = opt_features; @@ -220,7 +220,7 @@ class DragAndDrop extends Interaction { * @param {string} text Text. * @param {import("../format/Feature.js").ReadOptions} options Read options. * @private - * @return {Array} Features. + * @return {Array} Features. */ tryReadFeatures_(format, text, options) { try {