Skip to content

Commit

Permalink
FIX: @type about Js doc
Browse files Browse the repository at this point in the history
  • Loading branch information
neo-garaix committed Jan 30, 2025
1 parent 7e54450 commit e1fcf93
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 25 deletions.
12 changes: 12 additions & 0 deletions assets/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
6 changes: 3 additions & 3 deletions assets/src/components/FeaturesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down Expand Up @@ -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()) {
Expand All @@ -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()) {
Expand Down
10 changes: 6 additions & 4 deletions assets/src/modules/Action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions assets/src/modules/Digitizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions assets/src/modules/FeaturesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
4 changes: 2 additions & 2 deletions assets/src/modules/LocateByLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
6 changes: 3 additions & 3 deletions assets/src/modules/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
2 changes: 1 addition & 1 deletion assets/src/modules/SelectionTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'){
Expand Down
5 changes: 0 additions & 5 deletions assets/src/modules/State.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion assets/src/modules/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e1fcf93

Please sign in to comment.