diff --git a/assets/eslint.config.mjs b/assets/eslint.config.mjs index 64adb0494f..9f6bef2ff8 100644 --- a/assets/eslint.config.mjs +++ b/assets/eslint.config.mjs @@ -35,6 +35,18 @@ export default [ $: "readonly", jQuery: "readonly", + + TemplateResult: "readonly", + SelectionTool: "readonly", + Digitizing: "readonly", + Geometry: "readonly", + Extent: "readonly", + ResponseError: "readonly", + HttpError: "readonly", + NetworkError: "readonly", + LocateByLayerConfig: "readonly", + Config: "readonly", + Layers: "readonly", }, }, rules: { diff --git a/assets/src/components/FeaturesTable.js b/assets/src/components/FeaturesTable.js index c1d6cd88f1..52db81136a 100644 --- a/assets/src/components/FeaturesTable.js +++ b/assets/src/components/FeaturesTable.js @@ -626,7 +626,7 @@ export default class FeaturesTable extends HTMLElement { /** * Build the columns of the table * @param {object} properties - Object containing the properties of the feature - * @returns {import("lit").TemplateResult} The columns of the table + * @returns {TemplateResult} The columns of the table */ buildColumns(properties) { @@ -656,7 +656,7 @@ export default class FeaturesTable extends HTMLElement { /** * Initialize tab with the first column "display_expression" * @param {object} properties - Object containing the properties of the feature - * @returns {import("lit").TemplateResult} The first column of the table + * @returns {TemplateResult} The first column of the table */ buildDisplayExpressionColumn(properties) { if (this.isGeneralLabelExisting()) { @@ -672,7 +672,7 @@ export default class FeaturesTable extends HTMLElement { /** * Initialize the labels of the table - * @returns {import("lit").TemplateResult} The labels of the table + * @returns {TemplateResult} The labels of the table */ buildLabels() { if (this.isAdditionalFieldsEmpty()) { diff --git a/assets/src/modules/Action.js b/assets/src/modules/Action.js index b0f1117290..c65d89a3b2 100644 --- a/assets/src/modules/Action.js +++ b/assets/src/modules/Action.js @@ -38,13 +38,15 @@ export default class Action { } /** - * @type {boolean} If the project has actions + * If the project has actions + * @type {boolean} */ hasActions = false; /** - * @type {string} Unique ID of an action object + * Unique ID of an action object * We allow only one active action at a time + * @type {string} */ ACTIVE_LIZMAP_ACTION = null; @@ -56,8 +58,8 @@ export default class Action { /** * Build the lizmap Action instance * @param {Map} map - OpenLayers map - * @param {import("../components/SelectionTool.js")} selectionTool - The lizmap selection tool - * @param {import("../components/Digitizing.js")} digitizing - The Lizmap digitizing instance + * @param {SelectionTool} selectionTool - The lizmap selection tool + * @param {Digitizing} digitizing - The Lizmap digitizing instance * @param {object} lizmap3 - The old lizmap object */ constructor(map, selectionTool, digitizing, lizmap3) { diff --git a/assets/src/modules/Digitizing.js b/assets/src/modules/Digitizing.js index 97acc71617..8f8c4c16a7 100644 --- a/assets/src/modules/Digitizing.js +++ b/assets/src/modules/Digitizing.js @@ -1038,7 +1038,7 @@ export class Digitizing { /** * Format length output. - * @param {import("ol/geom/Geometry").default} geom The geom. + * @param {Geometry} geom The geom. * @returns {string} The formatted length. */ formatLength(geom) { @@ -1070,7 +1070,7 @@ export class Digitizing { /** * Initializes measure tooltip and change event on a feature loaded from local storage. - * @param {import("ol/geom/Geometry").default} geom The geometry. + * @param {Geometry} geom The geometry. */ _initMeasureTooltipOnLoadedFeatures(geom){ // create overlays @@ -1093,7 +1093,7 @@ export class Digitizing { /** * Calculates measuements for a specific geometry. - * @param {import("ol/geom/Geometry").default} geom The geometry. + * @param {Geometry} geom The geometry. */ _setTooltipContentByGeom(geom){ if (geom instanceof Polygon) { diff --git a/assets/src/modules/FeaturesTable.js b/assets/src/modules/FeaturesTable.js index e7a899b0aa..4d63c2f131 100644 --- a/assets/src/modules/FeaturesTable.js +++ b/assets/src/modules/FeaturesTable.js @@ -41,9 +41,9 @@ export default class FeaturesTable { * @param {string|null} sortingField Field name to sort the features * @param {string|null} sortingOrder Sorting order * @returns {Promise} — A Promise that resolves with the result of parsing the response body text as JSON. - * @throws {import("./errors").ResponseError} In case of invalid content type (not application/json or application/vnd.geo+json) or invalid JSON - * @throws {import("./errors").HttpError} In case of not successful response (status not in the range 200–299) - * @throws {import("./errors").NetworkError} In case of catch exceptions + * @throws {ResponseError} In case of invalid content type (not application/json or application/vnd.geo+json) or invalid JSON + * @throws {HttpError} In case of not successful response (status not in the range 200–299) + * @throws {NetworkError} In case of catch exceptions */ getFeatures(layerId, filter = null, withGeometry = false, fields = 'null', additionalFields = [], limit = 1000, sortingField = null, sortingOrder = null) { diff --git a/assets/src/modules/LocateByLayer.js b/assets/src/modules/LocateByLayer.js index 50669d72ae..c88a60d770 100644 --- a/assets/src/modules/LocateByLayer.js +++ b/assets/src/modules/LocateByLayer.js @@ -17,8 +17,8 @@ import GeoJSON from 'ol/format/GeoJSON.js'; export default class LocateByLayer { /** * Build the lizmap LocateByLayer instance - * @param {import("config/Locate.js").LocateByLayerConfig} locateByLayer - The lizmap locateByLayer config - * @param {import("Config.js")[]} vectorLayerFeatureTypeList - The list of WFS feature type + * @param {LocateByLayerConfig} locateByLayer - The lizmap locateByLayer config + * @param {Config[]} vectorLayerFeatureTypeList - The list of WFS feature type * @param {Map} map - OpenLayers map * @param {object} lizmap3 - The old lizmap object */ diff --git a/assets/src/modules/Popup.js b/assets/src/modules/Popup.js index ec5babe081..846db9d4a0 100644 --- a/assets/src/modules/Popup.js +++ b/assets/src/modules/Popup.js @@ -18,10 +18,10 @@ export default class Popup { /** * Create a popup instance - * @param {import("Config.js")} initialConfig - The lizmap initial config instance - * @param {import("Layers.js")} lizmapState - The lizmap user interface state + * @param {Config} initialConfig - The lizmap initial config instance + * @param {Layers} lizmapState - The lizmap user interface state * @param {Map} map - OpenLayers map - * @param {import("../components/Digitizing.js")} digitizing - The Lizmap digitizing instance + * @param {Digitizing} digitizing - The Lizmap digitizing instance */ constructor(initialConfig, lizmapState, map, digitizing) { diff --git a/assets/src/modules/SelectionTool.js b/assets/src/modules/SelectionTool.js index 2bca320a65..3b3e2e2dbf 100644 --- a/assets/src/modules/SelectionTool.js +++ b/assets/src/modules/SelectionTool.js @@ -409,7 +409,7 @@ export default class SelectionTool { /** * select layer's features with a feature and a geometry operator * @param {string} targetFeatureType - target feature type - * @param {import("ol/Feature").default} selectionFeature - selection feature in map projection + * @param {Feature} selectionFeature - selection feature in map projection * @param {string} geomOperator - geometry operator */ selectLayerFeaturesFromSelectionFeature(targetFeatureType, selectionFeature, geomOperator = 'intersects'){ diff --git a/assets/src/modules/State.js b/assets/src/modules/State.js index b0385cdcfc..8179e48002 100644 --- a/assets/src/modules/State.js +++ b/assets/src/modules/State.js @@ -12,11 +12,6 @@ import { LayersAndGroupsCollection } from './state/Layer.js'; import { MapRootState } from './state/MapLayer.js'; import { TreeRootState } from './state/LayerTree.js'; -/** - * Lizmap config instance - * @typedef {import('./Config.js').Config} Config - */ - /** * @class * @name State diff --git a/assets/src/modules/map.js b/assets/src/modules/map.js index e4a7988304..b21f8e9a34 100644 --- a/assets/src/modules/map.js +++ b/assets/src/modules/map.js @@ -1092,7 +1092,7 @@ export default class map extends olMap { /** * Zoom to given geometry or extent - * @param {import("ol/geom/Geometry").default | import("ol/extent").Extent} geometryOrExtent The geometry or extent to zoom to. CRS is 4326 by default. + * @param {Geometry|Extent} geometryOrExtent The geometry or extent to zoom to. CRS is 4326 by default. * @param {object} [options] Options. */ zoomToGeometryOrExtent(geometryOrExtent, options) {