From c6847b9509b61befa88cf30cdfadb86a5af55fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 10 May 2019 15:25:18 +0200 Subject: [PATCH] Use the [] syntax in simple cases --- api/src/Map.js | 8 ++--- api/src/Querent.js | 2 +- api/src/Themes.js | 2 +- api/src/constants.js | 2 +- contribs/gmf/apps/desktop/Controller.js | 6 ++-- contribs/gmf/apps/desktop_alt/Controller.js | 6 ++-- contribs/gmf/apps/mobile/Controller.js | 2 +- contribs/gmf/apps/mobile_alt/Controller.js | 2 +- contribs/gmf/apps/oeedit/Controller.js | 6 ++-- contribs/gmf/examples/displayquerygrid.js | 2 +- contribs/gmf/examples/displayquerywindow.js | 2 +- contribs/gmf/examples/editfeature.js | 2 +- contribs/gmf/examples/elevation.js | 2 +- contribs/gmf/examples/print.js | 2 +- contribs/gmf/src/authentication/Service.js | 18 +++++----- contribs/gmf/src/authentication/component.js | 2 +- contribs/gmf/src/contextualdata/component.js | 4 +-- .../src/controllers/AbstractAppController.js | 4 +-- contribs/gmf/src/disclaimer/component.js | 2 +- .../gmf/src/drawing/drawFeatureComponent.js | 2 +- contribs/gmf/src/editing/EditFeature.js | 6 ++-- .../gmf/src/editing/editFeatureComponent.js | 2 +- contribs/gmf/src/filters/SavedFilters.js | 8 ++--- .../src/filters/filterselectorComponent.js | 2 +- .../src/import/importdatasourceComponent.js | 6 ++-- .../wmtsCapabilityLayertreeComponent.js | 2 +- contribs/gmf/src/layertree/TreeManager.js | 4 +-- contribs/gmf/src/layertree/component.js | 2 +- .../gmf/src/layertree/timeSliderComponent.js | 6 ++-- contribs/gmf/src/lidarprofile/Plot.js | 6 ++-- contribs/gmf/src/lidarprofile/Utils.js | 26 +++++++------- .../gmf/src/map/mousepositionComponent.js | 4 +-- .../gmf/src/mobile/measure/pointComponent.js | 6 ++-- .../gmf/src/mobile/navigation/component.js | 2 +- contribs/gmf/src/objectediting/coordinate.js | 8 ++--- .../gmf/src/objectediting/toolsComponent.js | 2 +- contribs/gmf/src/permalink/Permalink.js | 6 ++-- contribs/gmf/src/print/component.js | 12 +++---- contribs/gmf/src/profile/component.js | 6 ++-- contribs/gmf/src/query/gridComponent.js | 16 ++++----- contribs/gmf/src/raster/component.js | 6 ++-- contribs/gmf/src/search/component.js | 14 ++++---- contribs/gmf/src/theme/Themes.js | 2 +- contribs/gmf/src/theme/selectorComponent.js | 2 +- contribs/gmf/src/themes.js | 22 ++++++------ examples/backgroundlayer.js | 2 +- examples/colorpicker.js | 2 +- examples/disclaimer.js | 2 +- examples/elevationProfile.js | 2 +- examples/scaleselector.js | 2 +- src/Menu.js | 4 +-- src/WFSDescribeFeatureType.js | 2 +- src/datasource/OGC.js | 14 ++++---- src/download/Csv.js | 8 ++--- src/editing/exportfeaturesComponent.js | 4 +-- src/filter/RuleHelper.js | 2 +- src/filter/component.js | 2 +- src/filter/ruleComponent.js | 2 +- src/format/Attribute.js | 2 +- src/format/FeatureHash.js | 36 +++++++++---------- src/format/WFSAttribute.js | 2 +- src/grid/Config.js | 6 ++-- src/interaction/ModifyRectangle.js | 4 +-- src/map/FeatureOverlayMgr.js | 2 +- src/map/LayerHelper.js | 10 +++--- src/map/scaleselector.js | 8 ++--- src/message/Message.js | 12 +++---- src/message/Notification.js | 2 +- src/misc/AutoProjection.js | 2 +- src/misc/FeatureHelper.js | 4 +-- src/misc/ToolActivateMgr.js | 2 +- src/misc/colorpickerComponent.js | 4 +-- src/misc/decorate.js | 4 +-- src/misc/filters.js | 4 +-- src/misc/getBrowserLanguage.js | 4 +-- src/misc/php-date-formatter.js | 2 +- src/misc/swipe.js | 2 +- src/misc/syncArrays.js | 4 +-- src/print/Utils.js | 6 ++-- src/print/mapfish-print-v3.js | 22 ++++++------ src/query/Keyboard.js | 2 +- src/query/Querent.js | 22 ++++++------ src/routing/NominatimService.js | 6 ++-- src/routing/RoutingComponent.js | 8 ++--- src/routing/RoutingService.js | 8 ++--- src/rule/Date.js | 2 +- src/rule/Geometry.js | 2 +- src/rule/Rule.js | 6 ++-- src/rule/Select.js | 12 +++---- src/rule/Text.js | 2 +- src/search/createLocationSearchBloodhound.js | 10 +++--- src/source/AsitVD.js | 2 +- src/statemanager/Location.js | 8 ++--- src/statemanager/Service.js | 4 +-- src/statemanager/WfsPermalink.js | 14 ++++---- src/utils.js | 2 +- 96 files changed, 279 insertions(+), 279 deletions(-) diff --git a/api/src/Map.js b/api/src/Map.js index ba77c4c53d8a..beb573a30394 100644 --- a/api/src/Map.js +++ b/api/src/Map.js @@ -248,7 +248,7 @@ class Map { /** * @param {string} layer Name of the layer to fetch the features from - * @param {Array} ids List of ids + * @param {string[]} ids List of ids * @param {boolean} [highlight=false] Whether to add the features on * the map or not. */ @@ -283,7 +283,7 @@ class Map { * @param {string} name Name. * @param {string} url URL. * @param {Object} [options] Options - * @property {Array} [attr=['title', 'description']] + * @property {string[]} [attr=['title', 'description']] * @property {function()} [success] * @property {function()} [error] */ @@ -375,7 +375,7 @@ class Map { /** - * @param {Array} keys Keys. + * @param {string[]} keys Keys. * @param {Array<*>} values Values. * @returns {Object} Object. * @private @@ -393,7 +393,7 @@ function zip(keys, values) { /** * @param {Object} obj Object. - * @param {Array} keys keys. + * @param {string[]} keys keys. * @returns {Object} Object. * @private * @hidden diff --git a/api/src/Querent.js b/api/src/Querent.js index 737d51f2b5d2..4413797c2733 100644 --- a/api/src/Querent.js +++ b/api/src/Querent.js @@ -14,7 +14,7 @@ import olFormatWFS from 'ol/format/WFS.js'; * - feature ids must exist * * @param {string} layer Name of the layer to query - * @param {Array} ids List of ids + * @param {string[]} ids List of ids * @return {Promise>} Promise. * @hidden */ diff --git a/api/src/Themes.js b/api/src/Themes.js index 7db9f42884ac..f40f1288c13b 100644 --- a/api/src/Themes.js +++ b/api/src/Themes.js @@ -153,7 +153,7 @@ export function writeOverlayDefs(config, ogcServers, opt_ogcServer) { /** * Returns a list of OpenLayers layer objects from the given layer names. * - * @param {Array} layerNames List of layer names + * @param {string[]} layerNames List of layer names * @return {Promise} Promise. * @hidden */ diff --git a/api/src/constants.js b/api/src/constants.js index 620313ae36d0..8681c9104a32 100644 --- a/api/src/constants.js +++ b/api/src/constants.js @@ -5,7 +5,7 @@ import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js'; * @typedef {Object} APIConfig * @property {?string} themesUrl * @property {string} projection - * @property {Array} resolutions + * @property {number[]} resolutions * @property {[number, number, number, number]} [extent] * @property {string} backgroundLayer */ diff --git a/contribs/gmf/apps/desktop/Controller.js b/contribs/gmf/apps/desktop/Controller.js index ac1109b4f3a3..4f3cf084512b 100644 --- a/contribs/gmf/apps/desktop/Controller.js +++ b/contribs/gmf/apps/desktop/Controller.js @@ -47,17 +47,17 @@ class Controller extends AbstractDesktopController { }, $scope, $injector); /** - * @type {Array} + * @type {string[]} */ this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326']; /** - * @type {Array} + * @type {number[]} */ this.scaleSelectorValues = [250000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 250, 100, 50]; /** - * @type {Array} + * @type {string[]} */ this.elevationLayers = ['aster', 'srtm']; diff --git a/contribs/gmf/apps/desktop_alt/Controller.js b/contribs/gmf/apps/desktop_alt/Controller.js index 18c89e33380b..762a3a97356f 100644 --- a/contribs/gmf/apps/desktop_alt/Controller.js +++ b/contribs/gmf/apps/desktop_alt/Controller.js @@ -53,7 +53,7 @@ class Controller extends AbstractDesktopController { }, $scope, $injector); /** - * @type {Array} + * @type {string[]} */ this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326']; @@ -68,12 +68,12 @@ class Controller extends AbstractDesktopController { this.showInfobar = true; /** - * @type {Array} + * @type {number[]} */ this.scaleSelectorValues = [250000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 250, 100, 50]; /** - * @type {Array} + * @type {string[]} */ this.elevationLayers = ['srtm-partial']; diff --git a/contribs/gmf/apps/mobile/Controller.js b/contribs/gmf/apps/mobile/Controller.js index 831bdaafb15a..f0e45dfe0875 100644 --- a/contribs/gmf/apps/mobile/Controller.js +++ b/contribs/gmf/apps/mobile/Controller.js @@ -57,7 +57,7 @@ class Controller extends AbstractMobileController { ]; /** - * @type {Array} + * @type {string[]} */ this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326']; diff --git a/contribs/gmf/apps/mobile_alt/Controller.js b/contribs/gmf/apps/mobile_alt/Controller.js index 9937ec505d85..314c083cb3a2 100644 --- a/contribs/gmf/apps/mobile_alt/Controller.js +++ b/contribs/gmf/apps/mobile_alt/Controller.js @@ -63,7 +63,7 @@ class Controller extends AbstractMobileController { this.searchDelay = 50; /** - * @type {Array} + * @type {string[]} */ this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326']; diff --git a/contribs/gmf/apps/oeedit/Controller.js b/contribs/gmf/apps/oeedit/Controller.js index 41cc2788d3cf..cfad91d12b24 100644 --- a/contribs/gmf/apps/oeedit/Controller.js +++ b/contribs/gmf/apps/oeedit/Controller.js @@ -151,17 +151,17 @@ class Controller extends AbstractDesktopController { }); /** - * @type {Array} + * @type {string[]} */ this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326']; /** - * @type {Array} + * @type {number[]} */ this.scaleSelectorValues = [250000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 250, 100, 50]; /** - * @type {Array} + * @type {string[]} */ this.elevationLayers = ['aster', 'srtm']; diff --git a/contribs/gmf/examples/displayquerygrid.js b/contribs/gmf/examples/displayquerygrid.js index 66a6dff756fa..9fd6a95a8dab 100644 --- a/contribs/gmf/examples/displayquerygrid.js +++ b/contribs/gmf/examples/displayquerygrid.js @@ -143,7 +143,7 @@ function MainController(gmfThemes, gmfDataSourcesManager, ngeoFeatureOverlayMgr) gmfDataSourcesManager.setDatasourceMap(this.map); /** - * @type {Array|undefined} + * @type {Object[]|undefined} * export */ this.themes = undefined; diff --git a/contribs/gmf/examples/displayquerywindow.js b/contribs/gmf/examples/displayquerywindow.js index 83a89cbc6697..3f3b783d1672 100644 --- a/contribs/gmf/examples/displayquerywindow.js +++ b/contribs/gmf/examples/displayquerywindow.js @@ -146,7 +146,7 @@ function MainController(gmfThemes, gmfDataSourcesManager, gmfDataSourcesManager.setDatasourceMap(this.map); /** - * @type {Array|undefined} + * @type {Object[]|undefined} * export */ this.themes = undefined; diff --git a/contribs/gmf/examples/editfeature.js b/contribs/gmf/examples/editfeature.js index 6d1a5321b576..e633f0af30c4 100644 --- a/contribs/gmf/examples/editfeature.js +++ b/contribs/gmf/examples/editfeature.js @@ -194,7 +194,7 @@ MainController.prototype.insertFeature = function() { throw new Error('Missing resolution'); } const buffer = resolution * -50; // 50 pixel buffer inside the extent - const size = /** @type {Array} */ (map.getSize()); + const size = /** @type {number[]} */ (map.getSize()); const extent = olExtent.buffer( view.calculateExtent(size), buffer diff --git a/contribs/gmf/examples/elevation.js b/contribs/gmf/examples/elevation.js index 11edd89720c8..76c4262c69db 100644 --- a/contribs/gmf/examples/elevation.js +++ b/contribs/gmf/examples/elevation.js @@ -34,7 +34,7 @@ module.constant('angularLocaleScript', '../build/angular-locale_{{locale}}.js'); */ function MainController() { /** - * @type {Array} + * @type {string[]} */ this.elevationLayers = ['aster', 'srtm']; diff --git a/contribs/gmf/examples/print.js b/contribs/gmf/examples/print.js index 37c03a7a1ee2..5b2698c3bf95 100644 --- a/contribs/gmf/examples/print.js +++ b/contribs/gmf/examples/print.js @@ -76,7 +76,7 @@ function MainController(gmfThemes, ngeoFeatureOverlayMgr) { }; /** - * @type {Array|undefined} + * @type {Object[]|undefined} */ this.themes = undefined; diff --git a/contribs/gmf/src/authentication/Service.js b/contribs/gmf/src/authentication/Service.js index 2c9425498665..d91920a45275 100644 --- a/contribs/gmf/src/authentication/Service.js +++ b/contribs/gmf/src/authentication/Service.js @@ -6,12 +6,12 @@ import olEventsEventTarget from 'ol/events/Target.js'; /** * Availables functionalities. * @typedef {Object} AuthenticationFunctionalities - * @property {Array} default_basemap Base maps to use by default. - * @property {Array} default_theme Theme to use by default. - * @property {Array} [filterable_layers] A list of layer names that can be filtered. - * @property {Array} [open_panel] When set, contains the name of the panel to open upon loading + * @property {string[]} default_basemap Base maps to use by default. + * @property {string[]} default_theme Theme to use by default. + * @property {string[]} [filterable_layers] A list of layer names that can be filtered. + * @property {string[]} [open_panel] When set, contains the name of the panel to open upon loading * an application. - * @property {Array} [preset_layer_filter] Default filtrable datasource name. + * @property {string[]} [preset_layer_filter] Default filtrable datasource name. */ /** @@ -26,7 +26,7 @@ import olEventsEventTarget from 'ol/events/Target.js'; * @property {AuthenticationFunctionalities|null} functionalities Configured functionalities of the user * @property {boolean|null} is_password_changed True if the password of the user has been changed. * False otherwise. - * @property {Array} roles Roles information. + * @property {RoleInfo[]} roles Roles information. * @property {string|null} username The name of the user. */ @@ -45,7 +45,7 @@ import olEventsEventTarget from 'ol/events/Target.js'; * @typedef {Object} AuthenticationLoginResponse * @property {AuthenticationFunctionalities} [functionalities] * @property {boolean} [is_password_changed] - * @property {Array} [roles] + * @property {RoleInfo[]} [roles] * @property {string} [username] */ @@ -214,14 +214,14 @@ export class AuthenticationService extends olEventsEventTarget { } /** - * @return {Array} The roles IDs. + * @return {number[]} The roles IDs. */ getRolesIds() { return this.user_.roles ? this.user_.roles.map((role) => role.id) : []; } /** - * @return {Array} The roles names. + * @return {string[]} The roles names. */ getRolesNames() { return this.user_.roles ? this.user_.roles.map((role) => role.name) : []; diff --git a/contribs/gmf/src/authentication/component.js b/contribs/gmf/src/authentication/component.js index 4f0e9c5a851e..e4fc99ee597e 100644 --- a/contribs/gmf/src/authentication/component.js +++ b/contribs/gmf/src/authentication/component.js @@ -413,7 +413,7 @@ class AuthenticationController { } /** - * @param {string|Array} errors Errors. + * @param {string|string[]} errors Errors. * @param {MessageType} [messageType] Type. * @private */ diff --git a/contribs/gmf/src/contextualdata/component.js b/contribs/gmf/src/contextualdata/component.js index fc9aac95dafd..c79a490b465c 100644 --- a/contribs/gmf/src/contextualdata/component.js +++ b/contribs/gmf/src/contextualdata/component.js @@ -40,7 +40,7 @@ const module = angular.module('gmfContextualdata', [ * example for a usage sample. * * @htmlAttribute {import("ol/Map.js").default} map The map. - * @htmlAttribute {Array} projections The list of projections. + * @htmlAttribute {number[]} projections The list of projections. * @htmlAttribute {Function} callback A function called after server * (raster) data is received in case some additional computing is required. * Optional. @@ -96,7 +96,7 @@ export function ContextualdataController($compile, $timeout, $scope, gmfRaster, this.map = null; /** - * @type {Array} + * @type {number[]} */ this.projections = []; diff --git a/contribs/gmf/src/controllers/AbstractAppController.js b/contribs/gmf/src/controllers/AbstractAppController.js index 27e2ae8cc197..a79753eb0609 100644 --- a/contribs/gmf/src/controllers/AbstractAppController.js +++ b/contribs/gmf/src/controllers/AbstractAppController.js @@ -255,7 +255,7 @@ export function AbstractAppController(config, map, $scope, $injector) { */ this.searchDatasources = [{ labelKey: 'label', - groupValues: /** @type {Array} **/ ($injector.get('gmfSearchGroups')), + groupValues: /** @type {string[]} **/ ($injector.get('gmfSearchGroups')), groupActions: /** @type {Array} **/( $injector.get('gmfSearchActions')), projection: `EPSG:${config.srid || 21781}`, @@ -679,7 +679,7 @@ export function AbstractAppController(config, map, $scope, $injector) { /** * @param {Array} layers Layers list. - * @param {Array} labels default_basemap list. + * @param {string[]} labels default_basemap list. * @return {?import("ol/layer/Base.js").default} layer or null * @private * @hidden diff --git a/contribs/gmf/src/disclaimer/component.js b/contribs/gmf/src/disclaimer/component.js index 3f33d0b80e32..6f3ccb9b4066 100644 --- a/contribs/gmf/src/disclaimer/component.js +++ b/contribs/gmf/src/disclaimer/component.js @@ -93,7 +93,7 @@ function DisclamerController( this.msg; /** - * @type {Array} + * @type {string[]} */ this.msgs_ = []; diff --git a/contribs/gmf/src/drawing/drawFeatureComponent.js b/contribs/gmf/src/drawing/drawFeatureComponent.js index b47ac299e603..29f23f6e7085 100644 --- a/contribs/gmf/src/drawing/drawFeatureComponent.js +++ b/contribs/gmf/src/drawing/drawFeatureComponent.js @@ -719,7 +719,7 @@ Controller.prototype.handleMapContextMenu_ = function(evt) { /** - * @param {?Array} vertexInfo Vertex information, in case a + * @param {?number[]} vertexInfo Vertex information, in case a * vertex was clicked using the right button. * @param {Event|import('ol/events/Event.js').default} evt Event. * @private diff --git a/contribs/gmf/src/editing/EditFeature.js b/contribs/gmf/src/editing/EditFeature.js index 4552b8831389..e6fc820edfd9 100644 --- a/contribs/gmf/src/editing/EditFeature.js +++ b/contribs/gmf/src/editing/EditFeature.js @@ -49,7 +49,7 @@ export function EditingEditFeature($http, gmfLayersUrl) { * Build a query to the MapFish protocol to fetch features from a list * of layer ids inside a specified extent. * - * @param {Array} layerIds List of layer ids to get the features from. + * @param {number[]} layerIds List of layer ids to get the features from. * @param {import("ol/extent.js").Extent} extent The extent where to get the features from. * @return {angular.IPromise} Promise. */ @@ -70,8 +70,8 @@ EditingEditFeature.prototype.getFeaturesInExtent = function(layerIds, extent) { * define the url to the GMF Protocol (layers) a dummy promise returns an * empty array of features if the url is not defined. * - * @param {Array} layerIds List of layer ids to get the features from. - * @param {Array} filters List of comparison filters + * @param {string[]} layerIds List of layer ids to get the features from. + * @param {ComparisonFilter[]} filters List of comparison filters * @return {angular.IPromise} Promise. */ EditingEditFeature.prototype.getFeaturesWithComparisonFilters = function(layerIds, filters) { diff --git a/contribs/gmf/src/editing/editFeatureComponent.js b/contribs/gmf/src/editing/editFeatureComponent.js index 5803a9e65f19..bb4cf1a30eca 100644 --- a/contribs/gmf/src/editing/editFeatureComponent.js +++ b/contribs/gmf/src/editing/editFeatureComponent.js @@ -517,7 +517,7 @@ function Controller($element, $q, $scope, $timeout, this.serverErrorType = null; /** - * @type {?Array} + * @type {?number[]} * @private */ this.vertexInfo_ = null; diff --git a/contribs/gmf/src/filters/SavedFilters.js b/contribs/gmf/src/filters/SavedFilters.js index 35827750d754..d754e527ee1b 100644 --- a/contribs/gmf/src/filters/SavedFilters.js +++ b/contribs/gmf/src/filters/SavedFilters.js @@ -42,7 +42,7 @@ export class SavedFilter { this.currentDataSourceId_ = null; /** - * @type {Array} + * @type {SavedFilterItem[]} * @private */ this.currentDataSourceItems_ = []; @@ -73,7 +73,7 @@ export class SavedFilter { } /** - * @type {Array} + * @type {SavedFilterItem[]} * @private */ this.items_ = []; @@ -92,7 +92,7 @@ export class SavedFilter { } /** - * @return {Array} Items + * @return {SavedFilterItem[]} Items */ get currentDataSourceItems() { return this.currentDataSourceItems_; @@ -107,7 +107,7 @@ export class SavedFilter { } /** - * @return {Array} Items + * @return {SavedFilterItem[]} Items */ get items() { return this.items_; diff --git a/contribs/gmf/src/filters/filterselectorComponent.js b/contribs/gmf/src/filters/filterselectorComponent.js index addd2a432ca6..8d6ccb59cd59 100644 --- a/contribs/gmf/src/filters/filterselectorComponent.js +++ b/contribs/gmf/src/filters/filterselectorComponent.js @@ -244,7 +244,7 @@ class FilterSelectorController { this.filtrableDataSources = []; /** - * @type {?Array} + * @type {?string[]} * @private */ this.filtrableLayerNodeNames_ = null; diff --git a/contribs/gmf/src/import/importdatasourceComponent.js b/contribs/gmf/src/import/importdatasourceComponent.js index ebb6a809c94b..5564ea149713 100644 --- a/contribs/gmf/src/import/importdatasourceComponent.js +++ b/contribs/gmf/src/import/importdatasourceComponent.js @@ -182,7 +182,7 @@ class Controller { this.mode = Mode.ONLINE; /** - * @type {Array} + * @type {string[]} */ this.modes = [Mode.LOCAL, Mode.ONLINE]; @@ -216,7 +216,7 @@ class Controller { */ this.serversEngine_ = null; - /** @type {?Array} */ + /** @type {?ExternalOGCServer[]} */ const servers = $injector.has('gmfExternalOGCServers') ? $injector.get('gmfExternalOGCServers') : null; @@ -232,7 +232,7 @@ class Controller { * https://stackoverflow.com/questions/22059933/twitter-typeahead-js-how-to-return-all-matched-elements-within-a-string * * @param {string} datum Datum. - * @return {Array} List of datum tokenizers. + * @return {string[]} List of datum tokenizers. */ datumTokenizer: (datum) => { console.assert(typeof datum == 'string'); diff --git a/contribs/gmf/src/import/wmtsCapabilityLayertreeComponent.js b/contribs/gmf/src/import/wmtsCapabilityLayertreeComponent.js index 3697e835c877..dd28b4ef817b 100644 --- a/contribs/gmf/src/import/wmtsCapabilityLayertreeComponent.js +++ b/contribs/gmf/src/import/wmtsCapabilityLayertreeComponent.js @@ -81,7 +81,7 @@ class Controller { /** * List of WMTS Capability Layer objects. - * @type {Array} + * @type {Object[]} */ this.layers = []; diff --git a/contribs/gmf/src/layertree/TreeManager.js b/contribs/gmf/src/layertree/TreeManager.js index 2ca633286b3f..2dd33347e497 100644 --- a/contribs/gmf/src/layertree/TreeManager.js +++ b/contribs/gmf/src/layertree/TreeManager.js @@ -410,7 +410,7 @@ LayertreeTreeManager.prototype.removeAll = function() { * Clone a group node and recursively set all child node `isChecked` using * the given list of layer names. * @param {import('gmf/themes.js').GmfGroup} group The original group node. - * @param {Array} names Array of node names to check (i.e. that + * @param {string[]} names Array of node names to check (i.e. that * should have their checkbox checked) * @return {import('gmf/themes.js').GmfGroup} Cloned node. * @private @@ -426,7 +426,7 @@ LayertreeTreeManager.prototype.cloneGroupNode_ = function(group, names) { * Set the child nodes metadata `isChecked` if its name is among the list of * given names. If a child node also has children, check those instead. * @param {import('gmf/themes.js').GmfGroup|import('gmf/themes.js').GmfLayer} node The original node. - * @param {Array} names Array of node names to check (i.e. that + * @param {string[]} names Array of node names to check (i.e. that * should have their checkbox checked) * @private */ diff --git a/contribs/gmf/src/layertree/component.js b/contribs/gmf/src/layertree/component.js index c14f2e9431c6..154dafc6aaf0 100644 --- a/contribs/gmf/src/layertree/component.js +++ b/contribs/gmf/src/layertree/component.js @@ -275,7 +275,7 @@ function Controller($element, $scope, ngeoLayerHelper, this.ngeoWMSTime_ = ngeoWMSTime; /** - * @type {Object>} + * @type {Object} * @private */ this.groupNodeStates_ = {}; diff --git a/contribs/gmf/src/layertree/timeSliderComponent.js b/contribs/gmf/src/layertree/timeSliderComponent.js index 90541d5b2f46..631b6825e361 100644 --- a/contribs/gmf/src/layertree/timeSliderComponent.js +++ b/contribs/gmf/src/layertree/timeSliderComponent.js @@ -169,7 +169,7 @@ function Controller(ngeoWMSTime) { /** * Used when WMS time object has a property 'values' instead of an interval - * @type {?Array} + * @type {?number[]} */ this.timeValueList = null; @@ -185,7 +185,7 @@ function Controller(ngeoWMSTime) { /** * Model for the ui-slider directive (date in ms format) - * @type {Array|number} + * @type {number[]|number} */ this.dates = []; } @@ -219,7 +219,7 @@ Controller.prototype.init = function() { * TimeSliderController.prototype.getTimeValueList_ - Get a list of time value instead * of using the wmstime interval as a list of possibles values * @private - * @return {Array} - List of timestamp representing possible values + * @return {number[]} - List of timestamp representing possible values */ Controller.prototype.getTimeValueList_ = function() { if (!this.time) { diff --git a/contribs/gmf/src/lidarprofile/Plot.js b/contribs/gmf/src/lidarprofile/Plot.js index cca85b3b93bc..fed32df6026b 100644 --- a/contribs/gmf/src/lidarprofile/Plot.js +++ b/contribs/gmf/src/lidarprofile/Plot.js @@ -77,7 +77,7 @@ export default class { this.height_ = 0; /** - * @type {Array} + * @type {number[]} */ this.previousDomainX = []; @@ -140,8 +140,8 @@ export default class { /** * Setup the SVG components of the D3 chart - * @param {Array} rangeX range of the x scale - * @param {Array} rangeY range of the y scale + * @param {number[]} rangeX range of the x scale + * @param {number[]} rangeY range of the y scale */ setupPlot(rangeX, rangeY) { if (!this.manager_.config) { diff --git a/contribs/gmf/src/lidarprofile/Utils.js b/contribs/gmf/src/lidarprofile/Utils.js index e99fe255c141..eefe8a9c1be5 100644 --- a/contribs/gmf/src/lidarprofile/Utils.js +++ b/contribs/gmf/src/lidarprofile/Utils.js @@ -32,12 +32,12 @@ import {select as d3select} from 'd3'; /** * The object containing all points in profile * @typedef {Object} LidarprofilePoints - * @property {Array} [distance] - * @property {Array} [altitude] - * @property {Array>} [color_packed] - * @property {Array} [intensity] - * @property {Array} [classification] - * @property {Array>} [coords] + * @property {number[]} [distance] + * @property {number[]} [altitude] + * @property {number[][]} [color_packed] + * @property {number[]} [intensity] + * @property {number[]} [classification] + * @property {number[][]} [coords] */ @@ -48,8 +48,8 @@ import {select as d3select} from 'd3'; * @property {number} [cy] * @property {number} [distance] * @property {number} [altitude] - * @property {Array} [color_packed] - * @property {Array} [coords] + * @property {number[]} [color_packed] + * @property {number[]} [coords] * @property {number} [intensity] * @property {number} [classification] * @property {boolean} [set] @@ -70,7 +70,7 @@ export default class { * @param {number} dRight domain maximum * @return {{ * bufferGeom: olFeature, - * bufferStyle: Array, + * bufferStyle: olStyleStyle[], * clippedLine: Array, * distanceOffset: number * }} Object with clipped lined coordinates and left domain value @@ -288,7 +288,7 @@ export default class { /** * Transforms a lidarprofile into multiple single points sorted by distance. * @param {LidarprofilePoints} profilePoints in the profile - * @return {Array} An array of Lidar Points. + * @return {LidarPoint[]} An array of Lidar Points. */ getFlatPointsByDistance(profilePoints) { const points = []; @@ -310,7 +310,7 @@ export default class { /** * Get the data for a CSV export of the profile. - * @param {Array} points A list of lidar profile point objects. + * @param {LidarPoint[]} points A list of lidar profile point objects. * @return {Array>} Objects for a csv export (column: value). */ getCSVData(points) { @@ -335,7 +335,7 @@ export default class { /** * Find the maximum value in am array of numbers - * @param {(Array)} array of number + * @param {(number[])} array of number * @return {number} the maximum of input array */ arrayMax(array) { @@ -345,7 +345,7 @@ export default class { /** * Find the minimum value in am array of numbers - * @param {Array} array of number + * @param {number[]} array of number * @return {number} the minimum of input array */ arrayMin(array) { diff --git a/contribs/gmf/src/map/mousepositionComponent.js b/contribs/gmf/src/map/mousepositionComponent.js index 5dc4c72d7672..9992801400c0 100644 --- a/contribs/gmf/src/map/mousepositionComponent.js +++ b/contribs/gmf/src/map/mousepositionComponent.js @@ -71,7 +71,7 @@ function gmfMapMousepositionTemplateUrl($attrs, gmfMapMousepositionTemplateUrl) * * * @htmlAttribute {import("ol/Map.js").default} gmf-mouseposition-map The map. - * @htmlAttribute {Array} + * @htmlAttribute {MousePositionProjection[]} * gmf-mouseposition-projection The list of the projections. * * @ngdoc component @@ -108,7 +108,7 @@ function Controller($element, $filter, $scope, gettextCatalog) { this.map = null; /** - * @type {Array} + * @type {MousePositionProjection[]} */ this.projections = []; diff --git a/contribs/gmf/src/mobile/measure/pointComponent.js b/contribs/gmf/src/mobile/measure/pointComponent.js index 948669bd1567..159ca86be5f6 100644 --- a/contribs/gmf/src/mobile/measure/pointComponent.js +++ b/contribs/gmf/src/mobile/measure/pointComponent.js @@ -69,7 +69,7 @@ module.run( * or deactivate the component. * @htmlAttribute {number=} gmf-mobile-measurepoint-coordinatedecimals number * of decimal to display for the coordinate. - * @htmlAttribute {Array} + * @htmlAttribute {LayerConfig[]} * gmf-mobile-measurepoint-layersconfig Raster elevation layers to get * information under the point and its configuaration. * @htmlAttribute {import("ol/Map.js").default} gmf-mobile-measurepoint-map The map. @@ -182,7 +182,7 @@ export function MobileMeasurePointController(gettextCatalog, $scope, $filter, gm this.coordinateDecimals = coordinateDecimalsFn ? coordinateDecimalsFn() : 0; /** - * @type {Array} + * @type {LayerConfig[]} * @private */ this.layersConfig = []; @@ -231,7 +231,7 @@ export function MobileMeasurePointController(gettextCatalog, $scope, $filter, gm this.drawInteraction = null; /** - * @type {() => Array} + * @type {() => LayerConfig[]} */ this.getLayersConfigFn = () => []; diff --git a/contribs/gmf/src/mobile/navigation/component.js b/contribs/gmf/src/mobile/navigation/component.js index aef41ef3c35d..698be1accec8 100644 --- a/contribs/gmf/src/mobile/navigation/component.js +++ b/contribs/gmf/src/mobile/navigation/component.js @@ -96,7 +96,7 @@ function Controller() { /** * Stack of slid-in items. * @private - * @type {Array} + * @type {JQuery[]} */ this.slid_ = []; diff --git a/contribs/gmf/src/objectediting/coordinate.js b/contribs/gmf/src/objectediting/coordinate.js index d6c109f7ad82..204fc602a2b8 100644 --- a/contribs/gmf/src/objectediting/coordinate.js +++ b/contribs/gmf/src/objectediting/coordinate.js @@ -24,16 +24,16 @@ export function coordinatesToXY0(coordinates) { * Convert a given coordinate or list of coordinates of any 'nesting' level * to XY, i.e. remove any extra dimensions to the coordinates and keep only 2. * - * @template {number|Coordinate|Array|Array>} T - * @param {Array} coordinates Coordinates + * @template {number|Coordinate|Coordinate[]|Coordinate[][]} T + * @param {T[]} coordinates Coordinates * @param {number} nesting Nesting level. - * @return {Array} Converted coordinates. + * @return {T[]} Converted coordinates. * @private * @hidden */ function toXY(coordinates, nesting) { if (nesting === 0) { - return /** @type {Array} */(coordinatesToXY0(/** @type {Coordinate} */(coordinates))); + return /** @type {T[]} */(coordinatesToXY0(/** @type {Coordinate} */(coordinates))); } else { for (let i = 0, ii = coordinates.length; i < ii; i++) { // @ts-ignore: TypeScript is not able to do recurtion with deferent type in generic diff --git a/contribs/gmf/src/objectediting/toolsComponent.js b/contribs/gmf/src/objectediting/toolsComponent.js index 5dd1901ed52b..cef7ac082de6 100644 --- a/contribs/gmf/src/objectediting/toolsComponent.js +++ b/contribs/gmf/src/objectediting/toolsComponent.js @@ -237,7 +237,7 @@ function Controller($injector, $scope, ngeoToolActivateMgr) { this.geomTypePolygon = ngeoGeometryType.POLYGON; /** - * @type {Array} + * @type {string[]} * @private */ this.toolActiveNames_ = []; diff --git a/contribs/gmf/src/permalink/Permalink.js b/contribs/gmf/src/permalink/Permalink.js index c524494dc109..3291bf306e0c 100644 --- a/contribs/gmf/src/permalink/Permalink.js +++ b/contribs/gmf/src/permalink/Permalink.js @@ -41,7 +41,7 @@ import {CollectionEvent} from 'ol/Collection.js'; * style for the crosshair feature added by the permalink service. * @property {boolean} [crosshairEnabledByDefault] Display the crosshair, gets overridden by the * `map_crosshair` parameter. Default is `false`. - * @property {Array} [projectionCodes] EPSG codes (e.g. 'EPSG:3857' or '3857'). + * @property {string[]} [projectionCodes] EPSG codes (e.g. 'EPSG:3857' or '3857'). * The permalink service will accept coordinates in these projections and try to detect which projection * the given coordinates are in. * @property {boolean} [useLocalStorage] Store the values in the local storage. Default is `false`. @@ -1070,7 +1070,7 @@ PermalinkService.prototype.refreshFirstLevelGroups = function() { /** * Return true if there is a theme specified in the URL path. * @private - * @param {Array} pathElements Array of path elements. + * @param {string[]} pathElements Array of path elements. * @return {boolean} theme in path. */ PermalinkService.prototype.themeInUrl_ = function(pathElements) { @@ -1424,7 +1424,7 @@ PermalinkService.prototype.getWfsPermalinkData_ = function() { /** * Create a filter group for a given prefix from the query params. * @param {string} prefix E.g. `wfs_` or `wfs_0_`. - * @param {Array} paramKeys All param keys starting with `wfs_`. + * @param {string[]} paramKeys All param keys starting with `wfs_`. * @return {import('ngeo/statemanager/WfsPermalink.js').WfsPermalinkFilterGroup|null} A filter group. * @private */ diff --git a/contribs/gmf/src/print/component.js b/contribs/gmf/src/print/component.js index 812d40a91335..5a1b412c2103 100644 --- a/contribs/gmf/src/print/component.js +++ b/contribs/gmf/src/print/component.js @@ -195,7 +195,7 @@ function gmfPrintTemplateUrl($element, $attrs, gmfPrintTemplateUrl) { * property's name of the field. * Example: {'comments': 'demo', 'legend': false}. Doesn't work for the dpi * and the scale. Server's values are used in priority. - * @htmlAttribute {Array} gmf-print-hiddenattributes The list of attributes that should be hidden. + * @htmlAttribute {string[]} gmf-print-hiddenattributes The list of attributes that should be hidden. * @ngdoc component * @ngname gmfPrint */ @@ -422,7 +422,7 @@ export class PrintController { this.statusTimeoutPromise_ = null; /** - * @type {?Array} + * @type {?number[]} * @private */ this.onDragPreviousMousePosition_ = null; @@ -460,7 +460,7 @@ export class PrintController { /** * Formats availables in capabilities. - * @type {Array} + * @type {string[]} * @private */ this.formats_ = []; @@ -523,7 +523,7 @@ export class PrintController { this.smtpSupported = false; /** - * @type {Array} + * @type {string[]} */ this.hiddenAttributeNames = []; @@ -1275,7 +1275,7 @@ export class PrintController { /** * @param {number} scale The scale to get the legend (for wms layers only). * @param {number} dpi The DPI. - * @param {Array} bbox The bbox. + * @param {number[]} bbox The bbox. * @return {Object?} Legend object for print report or null. * @private */ @@ -1283,7 +1283,7 @@ export class PrintController { if (!this.map) { throw new Error('Missing map'); } - const legend = {classes: /** @type {Array} */([])}; + const legend = {classes: /** @type {any[]} */([])}; const gettextCatalog = this.gettextCatalog_; // Get layers from layertree only. diff --git a/contribs/gmf/src/profile/component.js b/contribs/gmf/src/profile/component.js index 8e2917b1559b..20408107bff2 100644 --- a/contribs/gmf/src/profile/component.js +++ b/contribs/gmf/src/profile/component.js @@ -223,7 +223,7 @@ export function ProfileController($scope, $http, $element, $filter, gettextCatal this.linesConfiguration_ = null; /** - * @type {Array} + * @type {string[]} * @private */ this.layersNames_ = []; @@ -240,7 +240,7 @@ export function ProfileController($scope, $http, $element, $filter, gettextCatal this.line = null; /** - * @type {Array} + * @type {Object[]} */ this.profileData = []; @@ -623,7 +623,7 @@ ProfileController.prototype.getStyle = function(layerName) { /** * Return a copy of the existing layer names. - * @return {Array} The names of layers. + * @return {string[]} The names of layers. */ ProfileController.prototype.getLayersNames = function() { return this.layersNames_.slice(0); diff --git a/contribs/gmf/src/query/gridComponent.js b/contribs/gmf/src/query/gridComponent.js index 9bf7130a5892..13957283ccee 100644 --- a/contribs/gmf/src/query/gridComponent.js +++ b/contribs/gmf/src/query/gridComponent.js @@ -38,7 +38,7 @@ import 'bootstrap/js/src/dropdown.js'; * E.g. `'two_wheels_park': ['velo_park', 'moto_park']}` merges the sources * with label `velo_park` and `moto_park` into a new source `two_wheels_park`. * - * @typedef {Object>} GridMergeTabs + * @typedef {Object} GridMergeTabs */ @@ -237,7 +237,7 @@ export function QueryGridController($injector, $scope, ngeoQueryResult, ngeoMapQ /** * IDs of the grid sources in the order they were loaded. - * @type {Array} + * @type {string[]} */ this.loadedGridSources = []; @@ -393,7 +393,7 @@ QueryGridController.prototype.$onInit = function() { /** * Returns a list of grid sources in the order they were loaded. - * @return {Array} Grid sources. + * @return {GridSource[]} Grid sources. */ QueryGridController.prototype.getGridSources = function() { return this.loadedGridSources.map(sourceLabel => this.gridSources[sourceLabel]); @@ -636,8 +636,8 @@ QueryGridController.prototype.collectData_ = function(source) { /** * Remove all unwanted columns. - * @param {Array} allProperties A row. - * @param {Array} featureGeometriesNames Geometry names. + * @param {Object[]} allProperties A row. + * @param {string[]} featureGeometriesNames Geometry names. * @private */ QueryGridController.prototype.cleanProperties_ = function(allProperties, featureGeometriesNames) { @@ -657,7 +657,7 @@ QueryGridController.prototype.cleanProperties_ = function(allProperties, feature /** * Remove columns that will be completely empty between each properties. - * @param {Array} allProperties A row. + * @param {Object[]} allProperties A row. * @private */ QueryGridController.prototype.removeEmptyColumnsFn_ = function(allProperties) { @@ -691,7 +691,7 @@ QueryGridController.prototype.removeEmptyColumnsFn_ = function(allProperties) { /** - * @param {?Array} data Grid rows. + * @param {?Object[]} data Grid rows. * @param {import('ngeo/statemanager/WfsPermalink.js').QueryResultSource} source Query source. * @return {boolean} Returns true if a grid was created. * @private @@ -719,7 +719,7 @@ QueryGridController.prototype.makeGrid_ = function(data, source) { /** - * @param {Array} data Grid rows. + * @param {Object[]} data Grid rows. * @return {?import("ngeo/grid/Config.js").default} Grid config. * @private */ diff --git a/contribs/gmf/src/raster/component.js b/contribs/gmf/src/raster/component.js index e14035c3f468..2155bb34c903 100644 --- a/contribs/gmf/src/raster/component.js +++ b/contribs/gmf/src/raster/component.js @@ -336,7 +336,7 @@ module.controller('GmfElevationController', Controller); * * * @htmlAttribute {import("ol/Map.js").default} gmf-elevationwidget-map The map. - * @htmlAttribute {Array} gmf-elevationwidget-layers The list of + * @htmlAttribute {string[]} gmf-elevationwidget-layers The list of * layers. * @htmlAttribute {boolean} gmf-elevationwidget-active Whether to activate the * elevation component. @@ -370,7 +370,7 @@ function WidgetController() { this.map = null; /** - * @type {Array} + * @type {string[]} */ this.layers = []; @@ -403,7 +403,7 @@ module.controller('gmfElevationwidgetController', WidgetController); /** * @typedef {Object} LayerConfig * @property {string} [filter] - * @property {Array} [args] + * @property {string[]} [args] * @property {string} [postfix] * @property {string} [separator] */ diff --git a/contribs/gmf/src/search/component.js b/contribs/gmf/src/search/component.js index 1bd21175fb89..d17663e1f417 100644 --- a/contribs/gmf/src/search/component.js +++ b/contribs/gmf/src/search/component.js @@ -41,9 +41,9 @@ import SimpleGeometry from 'ol/geom/SimpleGeometry.js'; * data set. See: https://github.com/twitter/typeahead.js/blob/master/doc/bloodhound.md * @property {string} labelKey The name of a corresponding GeoJSON property key in the current dataset. * The bound value of this property key will be used as label. - * @property {Array} [groupValues] Possible values for the 'layer_name' key. + * @property {string[]} [groupValues] Possible values for the 'layer_name' key. * Used to define groups of dataset. - * @property {Array} [groupActions] List of allowed actions. The list may contain a + * @property {gmfSearchAction[]} [groupActions] List of allowed actions. The list may contain a * combination of `add_theme`, `add_group` or `add_layer` * @property {string} [projection] The geometry's projection for this set of data. * @property {Twitter.Typeahead.Dataset} [typeaheadDatasetOptions] The optional Twitter.Typeahead. @@ -184,7 +184,7 @@ function gmfSearchTemplateUrl($element, $attrs, gmfSearchTemplateUrl) { * where the key ifor its style is the value of the constant * 'gmf.COORDINATES_LAYER_NAME'. The 'default' key is used to apply the * default style. - * @htmlAttribute {Array} gmf-search-coordinatesprojections codes + * @htmlAttribute {string[]} gmf-search-coordinatesprojections codes * of supported projections for coordinates search (projections must be * defined in ol3). If not provided, only the map's view projection * format will be supported. @@ -384,13 +384,13 @@ class SearchController { /** * Supported projections for coordinates search. - * @type {Array} + * @type {string[]} */ this.coordinatesProjections = []; /** * Supported projections for coordinates search. - * @type {Array} + * @type {olProj.Projection[]} */ this.coordinatesProjectionsInstances = []; @@ -401,7 +401,7 @@ class SearchController { this.featureOverlay_ = ngeoFeatureOverlayMgr.getFeatureOverlay(); /** - * @type {Array} + * @type {SearchComponentDatasource[]} */ this.datasources = []; @@ -1032,7 +1032,7 @@ class SearchController { } else if (actionName == 'add_group') { this.gmfTreeManager_.addGroupByName(actionData, true); } else if (actionName == 'add_layer') { - const groupActions = /** @type {Array} */ ( + const groupActions = /** @type {gmfSearchAction[]} */ ( this.datasources[0].groupActions); let datasourcesActionsHaveAddLayer; groupActions.forEach((groupAction) => { diff --git a/contribs/gmf/src/theme/Themes.js b/contribs/gmf/src/theme/Themes.js index 3ce8b37c8757..8ff1d6841891 100644 --- a/contribs/gmf/src/theme/Themes.js +++ b/contribs/gmf/src/theme/Themes.js @@ -123,7 +123,7 @@ export class ThemesService extends olEventsEventTarget { /** * @param {import('gmf/themes.js').GmfGroup|import('gmf/themes.js').GmfLayer} item A group or a leaf. - * @param {Array} array Array of ids; + * @param {string[]} array Array of ids; */ const getIds = function(item, array) { array.push(olUtilGetUid(item)); diff --git a/contribs/gmf/src/theme/selectorComponent.js b/contribs/gmf/src/theme/selectorComponent.js index 130a36c09fc6..a804f1ea1575 100644 --- a/contribs/gmf/src/theme/selectorComponent.js +++ b/contribs/gmf/src/theme/selectorComponent.js @@ -126,7 +126,7 @@ function Controller($scope, gmfThemeManager, gmfThemes) { this.gmfThemes_ = gmfThemes; /** - * @type {Array} + * @type {Object[]} */ this.themes = []; diff --git a/contribs/gmf/src/themes.js b/contribs/gmf/src/themes.js index 2a0caca8de1d..3ae1a41da85a 100644 --- a/contribs/gmf/src/themes.js +++ b/contribs/gmf/src/themes.js @@ -10,15 +10,15 @@ /** * @typedef {Object} GmfThemesResponse * @property {Array} background_layers - * @property {Array} errors + * @property {string[]} errors * @property {GmfOgcServers} ogcServers - * @property {Array} themes + * @property {GmfTheme[]} themes */ /** * @typedef {Object} GmfRootNode - * @property {Array} children + * @property {GmfGroup[]} children */ @@ -38,7 +38,7 @@ * @property {number} id (GmfBaseNode) * @property {GmfMetaData} metadata (GmfBaseNode) * @property {string} name (GmfBaseNode) - * @property {Array} children The first level layer groups. + * @property {GmfGroup[]} children The first level layer groups. * @property {GmfFunctionalities} functionalities */ @@ -104,7 +104,7 @@ * @property {boolean} [editable] (GmfLayer) * @property {string} [style] (GmfLayer) * @property {string} type (GmfLayer) - * @property {Array} childLayers + * @property {GmfLayerChildLayer[]} childLayers * @property {string} layers The comma separated list of WMS layers or groups. * @property {number} maxResolutionHint The max resolution where the layer is visible. * @property {number} minResolutionHint The min resolution where the layer is visible. @@ -163,11 +163,11 @@ /** * @typedef {Object} GmfFunctionalities - * @property {Array} [default_basemap] The default base map. - * @property {Array} [open_panel] When set, contains the name of the panel to open upon loading an + * @property {string[]} [default_basemap] The default base map. + * @property {string[]} [open_panel] When set, contains the name of the panel to open upon loading an * application. * Note: although this is a list, only one can be defined. - * @property {Array} [preset_layer_filter] Name of the layer (data source) that should be toggled + * @property {string[]} [preset_layer_filter] Name of the layer (data source) that should be toggled * in the filter tool upon loading an application. * Note: although this is a list, only one can be defined. */ @@ -177,11 +177,11 @@ * @typedef {Object} GmfMetaData * @property {boolean} [copyable=false] Whether the geometry from this data source can be copied to other data * sources or not. For WMS layers. - * @property {Array} [directedFilterAttributes] List of attribute names which should have rules + * @property {string[]} [directedFilterAttributes] List of attribute names which should have rules * already ready when using the filter tools. For WMS layers. * @property {string} [disclaimer] The disclaimer text for this element. * For WMS and WMTS layers, layer groups and themes. - * @property {Array} [enumeratedAttributes] List of attribute names which have enumerated attribute + * @property {string[]} [enumeratedAttributes] List of attribute names which have enumerated attribute * values (for filters purpose). For WMS layers. * @property {boolean} [exclusiveGroup=false] Whether the group contain children that have to be mutually * exclusive, meaning that only one child may be ON at any time. @@ -238,7 +238,7 @@ /** * @typedef {Object} GmfLayerAttributeValuesResponse - * @property {Array} items + * @property {GmfLayerAttributeValue[]} items */ diff --git a/examples/backgroundlayer.js b/examples/backgroundlayer.js index de8e373594a5..0ec7d74e8a02 100644 --- a/examples/backgroundlayer.js +++ b/examples/backgroundlayer.js @@ -69,7 +69,7 @@ function BackgroundlayerController($http, ngeoBackgroundLayerMgr) { this.map = null; /** - * @type {Array|undefined} + * @type {Object[]|undefined} */ this.bgLayers = undefined; diff --git a/examples/colorpicker.js b/examples/colorpicker.js index da52c333a586..09363abfda23 100644 --- a/examples/colorpicker.js +++ b/examples/colorpicker.js @@ -33,7 +33,7 @@ function ColorPickerController() { /** * The colors set. - * @type {Array>} + * @type {string[][]} * @const */ this.colors = [ diff --git a/examples/disclaimer.js b/examples/disclaimer.js index 461ba6dfef9e..7125b3eaec16 100644 --- a/examples/disclaimer.js +++ b/examples/disclaimer.js @@ -71,7 +71,7 @@ function MainController(ngeoDisclaimer) { this.errorMsg_ = 'Disclaimer with error style'; /** - * @type {Array} + * @type {string[]} * @private */ this.inMapMsgs_ = [ diff --git a/examples/elevationProfile.js b/examples/elevationProfile.js index f8f5513a0841..79dd2e457177 100644 --- a/examples/elevationProfile.js +++ b/examples/elevationProfile.js @@ -87,7 +87,7 @@ function MainController($http, $scope) { vectorLayer.setMap(map); /** - * @type {Array} + * @type {Object[]} */ this.profilePoisData = [ {sort: 1, dist: 1000, title: 'First POI', id: 12345}, diff --git a/examples/scaleselector.js b/examples/scaleselector.js index 652dd245e638..4c8a8778e389 100644 --- a/examples/scaleselector.js +++ b/examples/scaleselector.js @@ -42,7 +42,7 @@ function MainController($scope) { /** * The zoom level/scale map object for the ngeoScaleselector directive. - * @type {Array} + * @type {number[]} * @const */ this.scales = [200000000, 100000000, 50000000, 25000000, 12000000]; diff --git a/src/Menu.js b/src/Menu.js index 1b1b63b41864..2c42b95640a7 100644 --- a/src/Menu.js +++ b/src/Menu.js @@ -18,7 +18,7 @@ import olOverlayPositioning from 'ol/OverlayPositioning.js'; * The options for the contextual menu overlay. * * @typedef {Object} MenuOptions - * @property {Array} actions A list of menu actions. + * @property {MenuActionOptions[]} actions A list of menu actions. * @property {boolean} [autoClose=true] Whether to automatically close the contextual menu when an action is * clicked or not. * @property {string} [title] A title to display as header of the contextual menu. @@ -83,7 +83,7 @@ export default class extends olOverlay { }).appendTo(contentEl); /** - * @type {Array} + * @type {JQuery[]} * @private */ this.actions_ = []; diff --git a/src/WFSDescribeFeatureType.js b/src/WFSDescribeFeatureType.js index b47f7fb727be..92087c0adf60 100644 --- a/src/WFSDescribeFeatureType.js +++ b/src/WFSDescribeFeatureType.js @@ -32,7 +32,7 @@ const NAMESPACE_URIS_ = [ */ function makeStructureNS(namespaceURIs, structure) { return /** @type {parsersStructure} */(/** @type {any} */(olXml.makeStructureNS( - /** @type {Array} */(namespaceURIs), structure))); + /** @type {string[]} */(namespaceURIs), structure))); } /** diff --git a/src/datasource/OGC.js b/src/datasource/OGC.js index 504f7d6c3228..2392c719bb9c 100644 --- a/src/datasource/OGC.js +++ b/src/datasource/OGC.js @@ -99,7 +99,7 @@ export const WMSInfoFormat = { * @property {boolean} [filtrable] Whether the data source is filtrable or not. * @property {string} [geometryName] The name of the geometry attribute. * @property {string} [ogcImageType] The type of images to fetch by queries by the (WMS) or (WMTS). - * @property {Array} [ogcLayers] A list of layer definitions that are used by (WMS) and (WFS) + * @property {OGCLayer[]} [ogcLayers] A list of layer definitions that are used by (WMS) and (WFS) * queries. * These are **not** used by the (WMTS) queries (the wmtsLayers is used by WMTS queries). * @property {string} [ogcServerType] The type of OGC server. @@ -160,8 +160,8 @@ export const WMSInfoFormat = { * @property {string} [minDefValue] * @property {TimePropertyModeEnum} mode * @property {TimePropertyResolutionEnum} [resolution] - * @property {Array} [values] - * @property {Array} interval + * @property {string[]} [values] + * @property {number[]} interval */ @@ -283,7 +283,7 @@ class OGC extends ngeoDatasourceDataSource { * A list of layer definitions that are used by (WMS) and (WFS) queries. * These are **not** used by the (WMTS) queries (the wmtsLayers is used * by WMTS queries). - * @type {?Array} + * @type {?OGCLayer[]} * @private */ this.ogcLayers_ = options.ogcLayers || null; @@ -577,7 +577,7 @@ class OGC extends ngeoDatasourceDataSource { } /** - * @return {?Array} OGC layers + * @return {?OGCLayer[]} OGC layers */ get ogcLayers() { return this.ogcLayers_; @@ -890,7 +890,7 @@ class OGC extends ngeoDatasourceDataSource { * @param {number} res Resolution. * @param {boolean} queryableOnly Whether to additionally check if the * OGC layer is queryable as well or not. Defaults to `false`. - * @return {Array} The OGC layer names that are in range. + * @return {string[]} The OGC layer names that are in range. */ getInRangeOGCLayerNames(res, queryableOnly = false) { @@ -917,7 +917,7 @@ class OGC extends ngeoDatasourceDataSource { * Returns the list of OGC layer names. * @param {boolean} queryableOnly Whether to additionally check if the * OGC layer is queryable as well or not. Defaults to `false`. - * @return {Array} The OGC layer names. + * @return {string[]} The OGC layer names. */ getOGCLayerNames(queryableOnly = false) { diff --git a/src/download/Csv.js b/src/download/Csv.js index 0915f7c65d18..d2f37a50473e 100644 --- a/src/download/Csv.js +++ b/src/download/Csv.js @@ -82,8 +82,8 @@ export function DownloadCsvService($injector, gettextCatalog) { /** * Generate a CSV. * - * @param {Array} data Entries/objects to include in the CSV. - * @param {Array} columnDefs Column definitions. + * @param {Object[]} data Entries/objects to include in the CSV. + * @param {GridColumnDef[]} columnDefs Column definitions. * @return {string} The CSV file as string. */ DownloadCsvService.prototype.generateCsv = function(data, columnDefs) { @@ -131,8 +131,8 @@ DownloadCsvService.prototype.getRow_ = function(values) { /** * Generate a CSV and start a download with the generated file. * - * @param {Array} data Entries/objects to include in the CSV. - * @param {Array} columnDefs Column definitions. + * @param {Object[]} data Entries/objects to include in the CSV. + * @param {GridColumnDef[]} columnDefs Column definitions. * @param {string} fileName The CSV file name, without the extension. */ DownloadCsvService.prototype.startDownload = function(data, columnDefs, fileName) { diff --git a/src/editing/exportfeaturesComponent.js b/src/editing/exportfeaturesComponent.js index cf7b7f6a0e88..23707b83ff07 100644 --- a/src/editing/exportfeaturesComponent.js +++ b/src/editing/exportfeaturesComponent.js @@ -105,7 +105,7 @@ function Controller($element, $injector, $scope, ngeoFeatureHelper) { this.menu_ = null; /** - * @type {Array} + * @type {JQuery[]} * @private */ this.items_ = []; @@ -138,7 +138,7 @@ function Controller($element, $injector, $scope, ngeoFeatureHelper) { } /** - * @type {Array} + * @type {string[]} * @private */ this.formats_ = formats; diff --git a/src/filter/RuleHelper.js b/src/filter/RuleHelper.js index 6fd641726178..bf49ed355713 100644 --- a/src/filter/RuleHelper.js +++ b/src/filter/RuleHelper.js @@ -344,7 +344,7 @@ export class RuleHelper { /** * @param {Array} rules Rules - * @return {Array} List of serialized rule options. + * @return {AnyOptions[]} List of serialized rule options. */ serializeRules(rules) { return rules.map((rule) => { diff --git a/src/filter/component.js b/src/filter/component.js index 14e552540b5b..29e63f492f97 100644 --- a/src/filter/component.js +++ b/src/filter/component.js @@ -178,7 +178,7 @@ class FilterController { // === Inner properties === /** - * @type {Array} + * @type {FilterCondition[]} */ this.conditions = [ { diff --git a/src/filter/ruleComponent.js b/src/filter/ruleComponent.js index 6bd2c7c3622f..f276ffd618d7 100644 --- a/src/filter/ruleComponent.js +++ b/src/filter/ruleComponent.js @@ -263,7 +263,7 @@ class RuleController { this.toolActivate_ = null;// = new ngeo.misc.ToolActivate(this.rule, 'active'); /** - * @type {Array} + * @type {Function[]} * @private */ this.unlisteners_ = []; diff --git a/src/format/Attribute.js b/src/format/Attribute.js index 9ed793c25867..b39500f0b75d 100644 --- a/src/format/Attribute.js +++ b/src/format/Attribute.js @@ -23,7 +23,7 @@ import ngeoFormatAttributeType from 'ngeo/format/AttributeType.js'; * @property {string} [geomType] (AttributeBase) * @property {string} [numType] (AttributeBase) * @property {string} [type] (AttributeBase) - * @property {Array} [choices] The list of possible values for the attribute. + * @property {string[]} [choices] The list of possible values for the attribute. * @property {number} [maxLength] Specifies the maximum number of character for the attribute value. * @property {string} [name] The attribute name. * @property {string} [alias] The attribute alias diff --git a/src/format/FeatureHash.js b/src/format/FeatureHash.js index e8d5bfbd5772..aa6cd65b3c3b 100644 --- a/src/format/FeatureHash.js +++ b/src/format/FeatureHash.js @@ -199,8 +199,8 @@ class FeatureHash extends olFormatTextFeature { * two dimensions and in latitude, longitude order. * corresponding to a geometry's coordinates. * @param {string} text Text. - * @param {Array=} opt_flatCoordinates Flat coordinates array. - * @return {Array} Flat coordinates. + * @param {number[]=} opt_flatCoordinates Flat coordinates array. + * @return {number[]} Flat coordinates. * @private */ decodeCoordinates_(text, opt_flatCoordinates) { @@ -239,7 +239,7 @@ class FeatureHash extends olFormatTextFeature { * Encode an array of number (corresponding to some coordinates) into a * logical sequence of characters. The coordinates are assumed to be in * two dimensions and in latitude, longitude order. - * @param {Array} flatCoordinates Flat coordinates. + * @param {number[]} flatCoordinates Flat coordinates. * @param {number} stride Stride. * @param {number} offset Offset. * @param {number} end End. @@ -373,7 +373,7 @@ class FeatureHash extends olFormatTextFeature { * @override */ writeFeatureText(feature, opt_options) { - const /** @type {Array} */ encodedParts = []; + const /** @type {string[]} */ encodedParts = []; // encode geometry @@ -392,7 +392,7 @@ class FeatureHash extends olFormatTextFeature { // encode properties - const /** @type {Array} */ encodedProperties = []; + const /** @type {string[]} */ encodedProperties = []; const propFunction = this.propertiesFunction_(feature); for (const key in propFunction) { const value = propFunction[key]; @@ -537,7 +537,7 @@ function encodeNumber_(num) { * styles's array. * @param {Array} styles Styles. * @param {import("ol/geom/GeometryType.js").default} geometryType Geometry type. - * @param {Array} encodedStyles Encoded styles array. + * @param {string[]} encodedStyles Encoded styles array. * @private * @hidden */ @@ -574,7 +574,7 @@ function encodeStyles_(styles, geometryType, encodedStyles) { * Transform an {@link import("ol/style/Stroke.js").default} into a logical sequence of * characters and put the result into the given encoded styles's array. * @param {import("ol/style/Stroke.js").default} strokeStyle Stroke style. - * @param {Array} encodedStyles Encoded styles array. + * @param {string[]} encodedStyles Encoded styles array. * @private * @hidden */ @@ -586,7 +586,7 @@ function encodeStyleLine_(strokeStyle, encodedStyles) { * Transform an {@link import("ol/style/Circle.js").default} into a logical sequence of * characters and put the result into the given encoded styles's array. * @param {import("ol/style/Image.js").default} imageStyle Image style. - * @param {Array} encodedStyles Encoded styles array. + * @param {string[]} encodedStyles Encoded styles array. * @private * @hidden */ @@ -614,7 +614,7 @@ function encodeStylePoint_(imageStyle, encodedStyles) { * the given encoded styles's array. * @param {import("ol/style/Fill.js").default} fillStyle Fill style. * @param {import("ol/style/Stroke.js").default} strokeStyle Stroke style. - * @param {Array} encodedStyles Encoded styles array. + * @param {string[]} encodedStyles Encoded styles array. * @private * @hidden */ @@ -630,7 +630,7 @@ function encodeStylePolygon_(fillStyle, strokeStyle, encodedStyles) { * a logical sequence of characters and put the result into the given encoded * styles's array. * @param {import("ol/style/Fill.js").default} fillStyle Fill style. - * @param {Array} encodedStyles Encoded styles array. + * @param {string[]} encodedStyles Encoded styles array. * @param {string=} [propertyName='fillColor'] Property name. * @private * @hidden @@ -657,7 +657,7 @@ function encodeStyleFill_(fillStyle, encodedStyles, propertyName = 'fillColor') * Transform an {@link import("ol/style/Stroke.js").default} into a logical sequence of * characters and put the result into the given encoded styles's array. * @param {import("ol/style/Stroke.js").default} strokeStyle Stroke style. - * @param {Array} encodedStyles Encoded styles array. + * @param {string[]} encodedStyles Encoded styles array. * @private * @hidden */ @@ -685,7 +685,7 @@ function encodeStyleStroke_(strokeStyle, encodedStyles) { * Transform an {@link import("ol/style/Text.js").default} into a logical sequence of characters and * put the result into the given encoded styles's array. * @param {import("ol/style/Text.js").default} textStyle Text style. - * @param {Array} encodedStyles Encoded styles array. + * @param {string[]} encodedStyles Encoded styles array. * @private * @hidden */ @@ -879,7 +879,7 @@ function setStyleInFeature_(text, feature) { let fillStyle = null; if (fillColor !== undefined) { fillStyle = new olStyleFill({ - color: /** @type {Array|string} */ (fillColor) + color: /** @type {number[]|string} */ (fillColor) }); } let strokeStyle = null; @@ -888,7 +888,7 @@ function setStyleInFeature_(text, feature) { throw new Error('Missing strokeWidth'); } strokeStyle = new olStyleStroke({ - color: /** @type {Array|string} */ (strokeColor), + color: /** @type {number[]|string} */ (strokeColor), width: strokeWidth }); } @@ -915,7 +915,7 @@ function setStyleInFeature_(text, feature) { textStyle = new olStyleText({ font: `${fontSize} sans-serif`, fill: new olStyleFill({ - color: /** @type {Array|string} */ (fontColor) + color: /** @type {number[]|string} */ (fontColor) }) }); } @@ -1155,11 +1155,11 @@ function writeMultiPointGeometry_(geometry) { /** * Helper to encode an {@link import("ol/geom/Polygon.js").default} geometry. - * @param {Array} flatCoordinates Flat coordinates. + * @param {number[]} flatCoordinates Flat coordinates. * @param {number} stride Stride. * @param {number} offset Offset. - * @param {Array} ends Ends. - * @param {Array} textArray Text array. + * @param {number[]} ends Ends. + * @param {string[]} textArray Text array. * @return {number} The new offset. * @private * @hidden diff --git a/src/format/WFSAttribute.js b/src/format/WFSAttribute.js index e67612cb70bf..693326358a1c 100644 --- a/src/format/WFSAttribute.js +++ b/src/format/WFSAttribute.js @@ -17,7 +17,7 @@ export default class { /** - * @param {Array} complexTypeElements Complex type element + * @param {Object[]} complexTypeElements Complex type element * @return {Array} Attributes */ read(complexTypeElements) { diff --git a/src/grid/Config.js b/src/grid/Config.js index 50221135397f..8edd35c99622 100644 --- a/src/grid/Config.js +++ b/src/grid/Config.js @@ -1,7 +1,7 @@ import {getUid as olUtilGetUid} from 'ol/util.js'; /** - * @param {Array|undefined} data Entries/objects to be shown in a grid. + * @param {Object[]|undefined} data Entries/objects to be shown in a grid. * @param {Array|undefined} columnDefs Column definition of a * grid. * @constructor @@ -10,7 +10,7 @@ import {getUid as olUtilGetUid} from 'ol/util.js'; */ function GridConfig(data, columnDefs) { /** - * @type {Array|undefined} + * @type {Object[]|undefined} */ this.data = data; @@ -58,7 +58,7 @@ GridConfig.prototype.getSelectedCount = function() { /** * Returns the selected rows. - * @return {Array} Selected rows in the current ordering. + * @return {Object[]} Selected rows in the current ordering. */ GridConfig.prototype.getSelectedRows = function() { if (!this.data) { diff --git a/src/interaction/ModifyRectangle.js b/src/interaction/ModifyRectangle.js index 162d626c5833..54693bc59589 100644 --- a/src/interaction/ModifyRectangle.js +++ b/src/interaction/ModifyRectangle.js @@ -421,8 +421,8 @@ class ModifyRectangle extends olInteractionPointer { * @property {import("ol/pixel.js").Pixel} originPixel * @property {import("ol/geom/Point.js").default} siblingXPoint * @property {import("ol/geom/Point.js").default} siblingYPoint - * @property {Array} vectorX - * @property {Array} vectorY + * @property {number[]} vectorX + * @property {number[]} vectorY */ diff --git a/src/map/FeatureOverlayMgr.js b/src/map/FeatureOverlayMgr.js index 288ec85cc725..e380e369c31d 100644 --- a/src/map/FeatureOverlayMgr.js +++ b/src/map/FeatureOverlayMgr.js @@ -46,7 +46,7 @@ export function FeatureOverlayMgr() { this.featureUidToGroupIndex_ = {}; /** - * @type {Array} + * @type {MapFeatureOverlayGroup[]} * @private */ this.groups_ = []; diff --git a/src/map/LayerHelper.js b/src/map/LayerHelper.js index fb8f484dec2d..2058384f9a49 100644 --- a/src/map/LayerHelper.js +++ b/src/map/LayerHelper.js @@ -312,9 +312,9 @@ LayerHelper.prototype.getFlatLayers = function(layer) { * Computed opacity is a custom 'back-up' value that contains * the calculated value of all ancestors and the given layer. * @param {import("ol/layer/Base.js").default} layer The base layer, mostly a group of layers. - * @param {Array} array An array to add layers. + * @param {olLayerLayer[]} array An array to add layers. * @param {number|undefined} computedOpacity Opacity inherited from ancestor layer groups. - * @return {Array} Layers. + * @return {olLayerLayer[]} Layers. * @private */ LayerHelper.prototype.getFlatLayers_ = function(layer, array, computedOpacity) { @@ -394,7 +394,7 @@ LayerHelper.prototype.getWMTSLegendURL = function(layer) { * @param {number=} opt_legendHeight the legend height. * @param {string=} opt_servertype the OpenLayers server type. * @param {number=} opt_dpi the DPI. - * @param {Array=} opt_bbox the bbox. + * @param {number[]=} opt_bbox the bbox. * @param {string=} opt_srs The projection code. * @param {Object=} opt_additionalQueryString Additional query string parameters. * @return {string|undefined} The legend URL or undefined. @@ -529,11 +529,11 @@ LayerHelper.prototype.updateWMSLayerState = function(layer, names, opt_time) { /** * @param {import("ol/layer/Image.js").default} layer The WMS layer. - * @return {Array|undefined} List of query source ids, a.k.a. + * @return {number[]|undefined} List of query source ids, a.k.a. * the data source ids this layer is composed of. */ LayerHelper.prototype.getQuerySourceIds = function(layer) { - return /** @type {Array|undefined} */ ( + return /** @type {number[]|undefined} */ ( layer.get('querySourceIds')); }; diff --git a/src/map/scaleselector.js b/src/map/scaleselector.js index 5f576d6c4d88..bff56184a612 100644 --- a/src/map/scaleselector.js +++ b/src/map/scaleselector.js @@ -84,7 +84,7 @@ module.run( * * See our live example: [../examples/scaleselector.html](../examples/scaleselector.html) * - * @htmlAttribute {Array} ngeo-scaleselector The available scales. + * @htmlAttribute {number[]} ngeo-scaleselector The available scales. * @htmlAttribute {import("ol/Map.js").default} ngeo-scaleselector-map The map. * @htmlAttribute {ScaleselectorOptions} ngeo-scaleselector-options * Optional. The configuration options. @@ -125,14 +125,14 @@ class ScaleselectorController { /** * The zoom level/scale map object. - * @type {Array} + * @type {number[]} */ - this.scales = /** @type {Array} */ + this.scales = /** @type {number[]} */ ($scope.$eval(scalesExpr)); console.assert(this.scales !== undefined); /** - * @type {Array} + * @type {number[]} */ this.zoomLevels = []; diff --git a/src/message/Message.js b/src/message/Message.js index 1ec5b6e152ab..5ec27075ff8e 100644 --- a/src/message/Message.js +++ b/src/message/Message.js @@ -69,7 +69,7 @@ export default class { /** * Display the given error message or list of error messages. * - * @param {string|Array} message Message or list of messages. + * @param {string|string[]} message Message or list of messages. */ error(message) { this.show(this.getMessageObjects(message, MessageType.ERROR)); @@ -77,7 +77,7 @@ export default class { /** * Display the given info message or list of info messages. - * @param {string|Array} message Message or list of messages. + * @param {string|string[]} message Message or list of messages. */ info(message) { this.show(this.getMessageObjects(message, MessageType.INFORMATION)); @@ -85,7 +85,7 @@ export default class { /** * Display the given success message or list of success messages. - * @param {string|Array} message Message or list of messages. + * @param {string|string[]} message Message or list of messages. */ success(message) { this.show(this.getMessageObjects(message, MessageType.SUCCESS)); @@ -93,7 +93,7 @@ export default class { /** * Display the given warning message or list of warning messages. - * @param {string|Array} message Message or list of messages. + * @param {string|string[]} message Message or list of messages. */ warn(message) { this.show(this.getMessageObjects(message, MessageType.WARNING)); @@ -107,11 +107,11 @@ export default class { * @param {string|Message|Array} * object A message or list of messages as text or configuration objects. * @param {string=} opt_type The type of message to override the messages with. - * @return {Array} List of message objects. + * @return {Message[]} List of message objects. * @protected */ getMessageObjects(object, opt_type) { - /** @type {Array} */ + /** @type {Message[]} */ const msgObjects = []; const defaultType = MessageType.INFORMATION; diff --git a/src/message/Notification.js b/src/message/Notification.js index 374805848335..5000b285f624 100644 --- a/src/message/Notification.js +++ b/src/message/Notification.js @@ -61,7 +61,7 @@ export class MessageNotification extends ngeoMessageMessage { /** * Display the given message string or object or list of message strings or * objects. - * @param {string|Array|import('ngeo/message/Message.js').Message|Array} + * @param {string|string[]|import('ngeo/message/Message.js').Message|Array} * object A message or list of messages as text or configuration objects. */ notify(object) { diff --git a/src/misc/AutoProjection.js b/src/misc/AutoProjection.js index d7f04d4d1ffd..7fa43a85b991 100644 --- a/src/misc/AutoProjection.js +++ b/src/misc/AutoProjection.js @@ -34,7 +34,7 @@ AutoProjectionService.prototype.stringToCoordinates = function(str) { /** * Get an array of projections corresponding to their EPSG codes. Log an error * for each code that are not defined in ol projections. - * @param {Array} projectionsCodes EPSG codes (e.g. 'EPSG:3857', + * @param {string[]} projectionsCodes EPSG codes (e.g. 'EPSG:3857', * 'epsg:3857' or '3857'). * @return {Array} An array of projections. */ diff --git a/src/misc/FeatureHelper.js b/src/misc/FeatureHelper.js index 6c9c198ea5fb..073403cece59 100644 --- a/src/misc/FeatureHelper.js +++ b/src/misc/FeatureHelper.js @@ -569,7 +569,7 @@ FeatureHelper.prototype.createEditingStyles = function(feature) { * @param {import("ol/Feature.js").default} feature Feature. * @param {import("ol/coordinate.js").Coordinate} coordinate Coordinate. * @param {number} resolution Current map view resolution. - * @return {?Array} The indexes of the vertex (coordinate) that hits. + * @return {?number[]} The indexes of the vertex (coordinate) that hits. */ FeatureHelper.prototype.getVertexInfoAtCoordinate = function( feature, coordinate, resolution @@ -761,7 +761,7 @@ FeatureHelper.prototype.getVertexStyle = function(opt_incGeomFunc) { * Remove a vertex from a feature using the given information (indexes). * * @param {import("ol/Feature.js").default} feature Feature. - * @param {Array} vertexInfo The indexes of the vertex + * @param {number[]} vertexInfo The indexes of the vertex * (coordinate) to remove. */ FeatureHelper.prototype.removeVertex = function(feature, vertexInfo) { diff --git a/src/misc/ToolActivateMgr.js b/src/misc/ToolActivateMgr.js index 4f53bbe8bacf..684a9aa99856 100644 --- a/src/misc/ToolActivateMgr.js +++ b/src/misc/ToolActivateMgr.js @@ -41,7 +41,7 @@ import angular from 'angular'; export function ToolActivateMgr($rootScope) { /** - * @type {Object>} + * @type {Object} * @private */ this.groups_ = {}; diff --git a/src/misc/colorpickerComponent.js b/src/misc/colorpickerComponent.js index ae93cb1789c3..c55cc7731c3d 100644 --- a/src/misc/colorpickerComponent.js +++ b/src/misc/colorpickerComponent.js @@ -66,7 +66,7 @@ module.directive('ngeoColorpicker', colorPickerComponent); /** * Default colors for the colorpicker - * @type {Array>} + * @type {string[][]} * @private * @hidden */ @@ -94,7 +94,7 @@ function Controller() { /** * The set of color - * @type {Array>} + * @type {string[][]} */ this.colors = this.colors || DEFAULT_COLORS; diff --git a/src/misc/decorate.js b/src/misc/decorate.js index 0e10ff6a306b..f7aaed3f7731 100644 --- a/src/misc/decorate.js +++ b/src/misc/decorate.js @@ -91,12 +91,12 @@ export function layerLoading(layer, $scope) { let source; /** - * @type {Array} + * @type {string[]} */ let incrementEvents = []; /** - * @type {Array} + * @type {string[]} */ let decrementEvents = []; diff --git a/src/misc/filters.js b/src/misc/filters.js index f6f0aeee1b3e..8ffb650cfb01 100644 --- a/src/misc/filters.js +++ b/src/misc/filters.js @@ -408,7 +408,7 @@ module.filter('ngeoTrustHtml', trustHtmlFilter); * @ngInject * @ngdoc filter * @param {angular.ISCEService} $sce Angular sce service. - * @param {Array} + * @param {StringToHtmlReplacement[]} * ngeoStringToHtmlReplacements List of replacements for string to html. * @ngname ngeoTrustHtmlAuto */ @@ -540,7 +540,7 @@ module.filter('ngeoDuration', DurationFilter); /** - * @type {Array} + * @type {StringToHtmlReplacement[]} * @ngname ngeoStringToHtmlReplacements * @hidden */ diff --git a/src/misc/getBrowserLanguage.js b/src/misc/getBrowserLanguage.js index 2d44eb51baf1..1c104be4468f 100644 --- a/src/misc/getBrowserLanguage.js +++ b/src/misc/getBrowserLanguage.js @@ -12,7 +12,7 @@ const module = angular.module('ngeoGetBrowserLanguage', []); * Provides a function that returns the most appropriate 2-letter * language code depending on the list of available languages and the browser * languages settings. - * @typedef {function(Array):string} miscGetBrowserLanguage + * @typedef {function(string[]):string} miscGetBrowserLanguage */ @@ -33,7 +33,7 @@ const module = angular.module('ngeoGetBrowserLanguage', []); function factory($window) { return ( /** - * @param {Array} availableLanguages Available languages. + * @param {string[]} availableLanguages Available languages. * @return {string} The "best" language code. */ function(availableLanguages) { diff --git a/src/misc/php-date-formatter.js b/src/misc/php-date-formatter.js index e69736acf58f..a2f0eb0d22d6 100644 --- a/src/misc/php-date-formatter.js +++ b/src/misc/php-date-formatter.js @@ -91,7 +91,7 @@ function _extend(out) { * @private * @hidden * @param {string} val Value - * @param {Array} arr Argument + * @param {string[]} arr Argument * @returns {number} */ function _indexOf(val, arr) { diff --git a/src/misc/swipe.js b/src/misc/swipe.js index 07dd87f6aeae..cb313ce4b58b 100644 --- a/src/misc/swipe.js +++ b/src/misc/swipe.js @@ -99,7 +99,7 @@ module.factory('$verticalSwipe', [function() { * @name $verticalSwipe#bind * @param {JQuery} element Element. * @param {Object} eventHandlers - Event handlers object with `start`, `cancel` and `end` callbacks - * @param {Array} pointerTypes - Types of pointer + * @param {string[]} pointerTypes - Types of pointer * * @description * The main method of `$verticalSwipe`. It takes an element to be watched for swipe motions, and an diff --git a/src/misc/syncArrays.js b/src/misc/syncArrays.js index 3e82bc2eb516..a55f0fee8073 100644 --- a/src/misc/syncArrays.js +++ b/src/misc/syncArrays.js @@ -17,8 +17,8 @@ * * This will return a function that can be called to cancel synchronization. * - * @param {Array} arr1 Array 1. - * @param {Array} arr2 Array 2. + * @param {T[]} arr1 Array 1. + * @param {T[]} arr2 Array 2. * @param {boolean} reverse `true` if arr2 is in reverse order, `false` * otherwise. * @param {angular.IScope} scope Angular scope. Used to watch arr1 and arr2 diff --git a/src/print/Utils.js b/src/print/Utils.js index c6592b6765d3..ccd999b5072b 100644 --- a/src/print/Utils.js +++ b/src/print/Utils.js @@ -122,7 +122,7 @@ PrintUtils.prototype.createPrintMaskPostcompose = function(getSize, getScale, op /** * @param {CanvasRenderingContext2D} context Context of the Postcompose event. - * @param {Array} center Center of the viewport (x; y). + * @param {number[]} center Center of the viewport (x; y). * @param {number} extentHalfWidth Extent half width. * @param {number} extentHalfHeight Extent half height. * @private @@ -145,7 +145,7 @@ PrintUtils.prototype.drawPrintZone_ = function(context, center, /** * @param {CanvasRenderingContext2D} context Context of the Postcompose event. - * @param {Array} center Center of the viewport (x; y). + * @param {number[]} center Center of the viewport (x; y). * @param {number} extentHalfWidth Extent half width. * @param {number} extentHalfHeight Extent half height. * @param {number} rotation Rotation value in radians. @@ -185,7 +185,7 @@ PrintUtils.prototype.drawPrintZoneWithRotation_ = function(context, center, * @param {import("ol/size.js").Size} mapSize Size of the map on the screen (px). * @param {number} mapResolution Resolution of the map on the screen. * @param {import("ol/size.js").Size} printMapSize Size of the map on the paper (dots). - * @param {Array} printMapScales Supported map scales on the paper. + * @param {number[]} printMapScales Supported map scales on the paper. * The scales are provided as scale denominators, sorted in ascending order. * E.g. `[500, 1000, 2000, 4000]`. * @return {number} The best scale. `-1` is returned if there is no optimal diff --git a/src/print/mapfish-print-v3.js b/src/print/mapfish-print-v3.js index e69a00f57763..d11a2080b2a4 100644 --- a/src/print/mapfish-print-v3.js +++ b/src/print/mapfish-print-v3.js @@ -33,7 +33,7 @@ /** * @typedef {Object} DataSourceTableObject - * @property {Array} columns + * @property {string[]} columns * @property {Array>} data */ @@ -63,11 +63,11 @@ /** * @typedef {Object} MapFishPrintMap - * @property {Array} bbox - * @property {Array} center + * @property {number[]} bbox + * @property {number[]} center * @property {number} scale * @property {number} dpi - * @property {Array} layers + * @property {MapFishPrintLayer[]} layers * @property {string} projection * @property {number} rotation */ @@ -103,9 +103,9 @@ * @property {number} opacity (MapFishPrintLayer) * @property {string} baseURL * @property {Object} customParams - * @property {Array} layers + * @property {string[]} layers * @property {string} serverType - * @property {Array} [styles] + * @property {string[]} [styles] * @property {string} version * @property {boolean} useNativeAngle * @property {string} imageFormat @@ -116,9 +116,9 @@ * @typedef {Object} MapFishPrintWmtsMatrix * @property {string} identifier * @property {number} scaleDenominator - * @property {Array} tileSize - * @property {Array} topLeftCorner - * @property {Array} matrixSize + * @property {number[]} tileSize + * @property {number[]} topLeftCorner + * @property {number[]} matrixSize */ @@ -132,7 +132,7 @@ * @property {Object} dimensionParams * @property {string} imageFormat * @property {string} layer - * @property {Array} matrices + * @property {MapFishPrintWmtsMatrix[]} matrices * @property {string} matrixSet * @property {string} requestEncoding * @property {string} style @@ -159,7 +159,7 @@ /** * @typedef {Object} MapFishPrintSymbolizers - * @property {Array} symbolizers + * @property {MapFishPrintSymbolizer[]} symbolizers */ diff --git a/src/query/Keyboard.js b/src/query/Keyboard.js index c0504cd718ff..47f1dc0b5af1 100644 --- a/src/query/Keyboard.js +++ b/src/query/Keyboard.js @@ -34,7 +34,7 @@ export class QueryKeyboard { this.keyRemove_ = 'x'; /** - * @type {Array} + * @type {string[]} * @private */ this.keys_ = [this.keyAdd_, this.keyRemove_]; diff --git a/src/query/Querent.js b/src/query/Querent.js index c85157ffd363..54de589b85e8 100644 --- a/src/query/Querent.js +++ b/src/query/Querent.js @@ -18,8 +18,8 @@ import olSourceImageWMS from 'ol/source/ImageWMS.js'; * `wfs` list. * * @typedef {Object} QueryableDataSources - * @property {Array} wms List of queryable data sources that support WMS. - * @property {Array} wfs List of queryable data sources that support WFS. + * @property {ngeoDatasourceOGC[]} wms List of queryable data sources that support WMS. + * @property {ngeoDatasourceOGC[]} wfs List of queryable data sources that support WFS. */ @@ -219,8 +219,8 @@ export class Querent { getQueryableDataSources(dataSources, map) { const queryableDataSources = { - wfs: /** @type{Array} */([]), - wms: /** @type{Array} */([]), + wfs: /** @type{ngeoDatasourceOGC[]} */([]), + wms: /** @type{ngeoDatasourceOGC[]} */([]), }; const resolution = map.getView().getResolution(); if (!resolution) { @@ -487,9 +487,9 @@ export class Querent { * types if one is given. * @param {ngeoDatasourceOGC} dataSource that contains the format object. * @param {boolean} wfs Whether the query was WFS or WMS. - * @param {Array=} opt_types An array of type if you want to set the + * @param {string[]=} opt_types An array of type if you want to set the * type of the format object. - * @return {Array} The types defined in the format. + * @return {string[]} The types defined in the format. * @private */ getSetOlFormatTypes_(dataSource, wfs, opt_types) { @@ -564,7 +564,7 @@ export class Querent { for (const dataSources of combinedDataSources) { /** @type {?import('ol/format/WFS.js').WriteGetFeatureOptions} */ let getFeatureCommonOptions = null; - /** @type{Array} */ + /** @type{string[]} */ let featureTypes = []; /** @type {?string} */ let url = null; @@ -786,7 +786,7 @@ export class Querent { for (const dataSources of combinedDataSources) { let url; - /** @type {Array} */ + /** @type {string[]} */ let LAYERS = []; let INFO_FORMAT; let activeDimensionsSet = false; @@ -908,7 +908,7 @@ export class Querent { } /** - * @param {Array} dataSources List of + * @param {ngeoDatasourceOGC[]} dataSources List of * queryable data sources that supports WFS. * @return {CombinedDataSources} Combined lists of data sources. * @private @@ -940,7 +940,7 @@ export class Querent { } /** - * @param {Array} dataSources List of + * @param {ngeoDatasourceOGC[]} dataSources List of * queryable data sources that supports WMS. * @return {CombinedDataSources} Combined lists of data sources. * @private @@ -1060,7 +1060,7 @@ function handleCombinedQueryResult_(response) { /** - * @typedef {Array>} CombinedDataSources + * @typedef {ngeoDatasourceOGC[][]} CombinedDataSources */ diff --git a/src/routing/NominatimService.js b/src/routing/NominatimService.js index 61a08962d16b..408bce56c6e5 100644 --- a/src/routing/NominatimService.js +++ b/src/routing/NominatimService.js @@ -25,7 +25,7 @@ import ngeoMiscDebounce from 'ngeo/misc/debounce.js'; * OSM data by name and address. * @param {angular.IHttpService} $http Angular http service. * @param {angular.auto.IInjectorService} $injector Main injector. - * @param {import("ngeo/misc/debounce.js").miscDebounce): void, (function(Array): void)|undefined): void>} ngeoDebounce + * @param {import("ngeo/misc/debounce.js").miscDebounce} ngeoDebounce * ngeo Debounce service. * @constructor * @ngdoc service @@ -43,7 +43,7 @@ export function NominatimService($http, $injector, ngeoDebounce) { this.$http_ = $http; /** - * @type {import("ngeo/misc/debounce.js").miscDebounce): void, (function(Array): void)|undefined): void>} + * @type {import("ngeo/misc/debounce.js").miscDebounce} * @private */ this.ngeoDebounce_ = ngeoDebounce; @@ -159,7 +159,7 @@ NominatimService.prototype.reverse = function(coordinate, params) { */ NominatimService.prototype.typeaheadSource_ = function(query, syncResults, asyncResults) { /** - * @param {angular.IHttpResponse>} resp + * @param {angular.IHttpResponse} resp */ const onSuccess_ = function(resp) { /** diff --git a/src/routing/RoutingComponent.js b/src/routing/RoutingComponent.js index ce515645ac42..8c0c92b9d60c 100644 --- a/src/routing/RoutingComponent.js +++ b/src/routing/RoutingComponent.js @@ -166,7 +166,7 @@ class Controller { this.targetFeature_ = null; /** - * @type {Array} + * @type {RoutingVia[]} */ this.viaArray = []; @@ -303,7 +303,7 @@ class Controller { if (!this.map) { return []; } - /** @type {Array} */ + /** @type {olFeature[]} */ let parsedRoutes = []; const format = new olFormatGeoJSON(); const formatConfig = { @@ -312,7 +312,7 @@ class Controller { }; // if there are is useful "legs" data, parse this if (route.legs) { - /** @type {Array>} */ + /** @type {olFeature[][]} */ const parsedRoutes_ = route.legs.map(leg => leg.steps.map(step => new olFeature({ geometry: format.readGeometry(step.geometry, formatConfig) }))); @@ -338,7 +338,7 @@ class Controller { const vias = this.viaArray.filter(via => via.feature !== null).map( via => this.getLonLatFromPoint_(via.feature) ); - const route = /** @type Array> */([coordFrom].concat(vias, [coordTo])); + const route = /** @type Array */([coordFrom].concat(vias, [coordTo])); /** * @param {angular.IHttpResponse} resp diff --git a/src/routing/RoutingService.js b/src/routing/RoutingService.js index af157893c213..0b4d9bd350fc 100644 --- a/src/routing/RoutingService.js +++ b/src/routing/RoutingService.js @@ -11,7 +11,7 @@ import angular from 'angular'; /** * @typedef {Object} RoutingOptions * @property {string} [backendUrl] - * @property {Array} [profiles] + * @property {RoutingProfile[]} [profiles] */ @@ -75,13 +75,13 @@ export function RoutingService($http, $injector) { /** * @typedef {Object} Routes - * @property {Array} routes + * @property {Route[]} routes */ /** * @typedef {Object} Route - * @property {Array} [legs] + * @property {Leg[]} [legs] * @property {string} [geometry] * @property {number} distance * @property {number} duration @@ -90,7 +90,7 @@ export function RoutingService($http, $injector) { /** * @typedef {Object} Leg - * @property {Array} steps + * @property {Step[]} steps */ diff --git a/src/rule/Date.js b/src/rule/Date.js index 45134b84a0c7..fd988902def3 100644 --- a/src/rule/Date.js +++ b/src/rule/Date.js @@ -11,7 +11,7 @@ import ngeoRuleRule from 'ngeo/rule/Rule.js'; * @property {number} [lowerBoundary] (RuleOptions) * @property {string} name (RuleOptions) * @property {string} [operator] (RuleOptions) - * @property {Array} [operators] (RuleOptions) + * @property {string[]} [operators] (RuleOptions) * @property {string} propertyName (RuleOptions) * @property {string} [type] (RuleOptions) * @property {number} [upperBoundary] (RuleOptions) diff --git a/src/rule/Geometry.js b/src/rule/Geometry.js index 8973bcb8099c..6fcde1287c19 100644 --- a/src/rule/Geometry.js +++ b/src/rule/Geometry.js @@ -15,7 +15,7 @@ import olFormatGeoJSON from 'ol/format/GeoJSON.js'; * @property {number} [lowerBoundary] (RuleOptions) * @property {string} name (RuleOptions) * @property {string} [operator] (RuleOptions) - * @property {Array} [operators] (RuleOptions) + * @property {string[]} [operators] (RuleOptions) * @property {string} propertyName (RuleOptions) * @property {string} [type] (RuleOptions) * @property {number} [upperBoundary] (RuleOptions) diff --git a/src/rule/Rule.js b/src/rule/Rule.js index 393f4295119c..f94b7c539729 100644 --- a/src/rule/Rule.js +++ b/src/rule/Rule.js @@ -11,7 +11,7 @@ import * as olEvents from 'ol/events.js'; * mutually exclusives. * @property {string} name The human-readable name of the rule. * @property {string} [operator] The rule operator. - * @property {Array} [operators] The rule operators. + * @property {string[]} [operators] The rule operators. * @property {string} propertyName The property name (a.k.a. the attribute name). * @property {string} [type] The type of rule. * @property {number} [upperBoundary] The upper boundary of the rule. The expression and boundaries are @@ -173,7 +173,7 @@ export default class Rule { /** * A list of rule operators. - * @type {?Array} + * @type {?string[]} * @private */ this.operators_ = options.operators || null; @@ -240,7 +240,7 @@ export default class Rule { } /** - * @return {?Array} Operators + * @return {?string[]} Operators */ get operators() { return this.operators_; diff --git a/src/rule/Select.js b/src/rule/Select.js index d3ad58462642..3ae73ca5c568 100644 --- a/src/rule/Select.js +++ b/src/rule/Select.js @@ -5,14 +5,14 @@ import ngeoRuleRule, {RuleOperatorType} from 'ngeo/rule/Rule.js'; /** * extends import('ngeo/rule/Rule.js').RuleOptions * @typedef {Object} SelectOptions - * @property {Array} choices List of choices available for selection. + * @property {string[]} choices List of choices available for selection. * @property {boolean} [active=false] (RuleOptions) * @property {number|string} [expression] (RuleOptions) * @property {boolean} [isCustom] (RuleOptions) * @property {number} [lowerBoundary] (RuleOptions) * @property {string} name (RuleOptions) * @property {string} [operator] (RuleOptions) - * @property {Array} [operators] (RuleOptions) + * @property {string[]} [operators] (RuleOptions) * @property {string} propertyName (RuleOptions) * @property {string} [type] (RuleOptions) * @property {number} [upperBoundary] (RuleOptions) @@ -43,7 +43,7 @@ export default class extends ngeoRuleRule { // === STATIC properties (i.e. that never change) === /** - * @type {Array} + * @type {string[]} * @private */ this.choices_ = options.choices; @@ -52,7 +52,7 @@ export default class extends ngeoRuleRule { // === Static property getters/setters === /** - * @return {Array} Choices + * @return {string[]} Choices */ get choices() { return this.choices_; @@ -61,10 +61,10 @@ export default class extends ngeoRuleRule { // === Calculated property getters === /** - * @return {Array} Selected choices + * @return {string[]} Selected choices */ get selectedChoices() { - /** @type {Array} */ + /** @type {string[]} */ let selectedChoices; if (this.expression) { const stringExpression = String(this.expression); diff --git a/src/rule/Text.js b/src/rule/Text.js index 74b5d7a4612c..aed11b5b4a69 100644 --- a/src/rule/Text.js +++ b/src/rule/Text.js @@ -21,7 +21,7 @@ import ngeoRuleRule, {RuleOperatorType} from 'ngeo/rule/Rule.js'; * @property {number} [lowerBoundary] (RuleOptions) * @property {string} name (RuleOptions) * @property {string} [operator] (RuleOptions) - * @property {Array} [operators] (RuleOptions) + * @property {string[]} [operators] (RuleOptions) * @property {string} propertyName (RuleOptions) * @property {string} [type] (RuleOptions) * @property {number} [upperBoundary] (RuleOptions) diff --git a/src/search/createLocationSearchBloodhound.js b/src/search/createLocationSearchBloodhound.js index 47ddb13a7912..951ee91576d1 100644 --- a/src/search/createLocationSearchBloodhound.js +++ b/src/search/createLocationSearchBloodhound.js @@ -21,7 +21,7 @@ import 'corejs-typeahead'; * @property {number} y * @property {string} geom_st_box2d * @property {olGeomPoint} geometry - * @property {?Array} bbox + * @property {?number[]} bbox */ @@ -33,7 +33,7 @@ import 'corejs-typeahead'; /** * @typedef {Object} Results - * @property {Array} results + * @property {Result[]} results */ @@ -55,7 +55,7 @@ import 'corejs-typeahead'; /** * @param {LocationSearchOptions=} opt_options Options. - * @return {Bloodhound>} The Bloodhound object. + * @return {Bloodhound} The Bloodhound object. * @private * @hidden */ @@ -103,7 +103,7 @@ function createLocationSearchBloodhound(opt_options) { } }; - /** @type {Bloodhound.BloodhoundOptions|Results>} */ + /** @type {Bloodhound.BloodhoundOptions} */ const bloodhoundOptions = { remote: { url: 'https://api3.geo.admin.ch/rest/services/api/SearchServer?type=locations&searchText=%QUERY', @@ -182,7 +182,7 @@ function createLocationSearchBloodhound(opt_options) { Object.assign(bloodhoundOptions, bhOptions); Object.assign(bloodhoundOptions.remote, remoteOptions); - return /** @type {Bloodhound>} */(new Bloodhound(bloodhoundOptions)); + return /** @type {Bloodhound} */(new Bloodhound(bloodhoundOptions)); } diff --git a/src/source/AsitVD.js b/src/source/AsitVD.js index eeaf51ffc21c..6046d7cbf70f 100644 --- a/src/source/AsitVD.js +++ b/src/source/AsitVD.js @@ -10,7 +10,7 @@ import olTilegridWMTS from 'ol/tilegrid/WMTS.js'; /** - * @type {Array} + * @type {number[]} * @private * @hidden */ diff --git a/src/statemanager/Location.js b/src/statemanager/Location.js index 4454ec9d73d1..29b0c1019bb8 100644 --- a/src/statemanager/Location.js +++ b/src/statemanager/Location.js @@ -225,7 +225,7 @@ StatemanagerLocation.prototype.getFragmentParamAsInt = function(key) { /** * Get an array with all existing param's keys in the location's URI. - * @return {Array} Param keys. + * @return {string[]} Param keys. */ StatemanagerLocation.prototype.getParamKeys = function() { const keys = []; @@ -238,7 +238,7 @@ StatemanagerLocation.prototype.getParamKeys = function() { /** * Get an array with all existing param's keys from the fragment of the location's URI. - * @return {Array} Param keys. + * @return {string[]} Param keys. */ StatemanagerLocation.prototype.getFragmentParamKeys = function() { const keys = []; @@ -253,7 +253,7 @@ StatemanagerLocation.prototype.getFragmentParamKeys = function() { * Get an array with all existing param's keys in the location's URI that start * with the given prefix. * @param {string} prefix Key prefix. - * @return {Array} Param keys. + * @return {string[]} Param keys. */ StatemanagerLocation.prototype.getParamKeysWithPrefix = function(prefix) { const keys = []; @@ -270,7 +270,7 @@ StatemanagerLocation.prototype.getParamKeysWithPrefix = function(prefix) { * Get an array with all existing param's keys from the fragment of the location's URI * that start with the given prefix. * @param {string} prefix Key prefix. - * @return {Array} Param keys. + * @return {string[]} Param keys. */ StatemanagerLocation.prototype.getFragmentParamKeysWithPrefix = function(prefix) { const keys = []; diff --git a/src/statemanager/Service.js b/src/statemanager/Service.js index 28816d39ddc9..0afd33ecc401 100644 --- a/src/statemanager/Service.js +++ b/src/statemanager/Service.js @@ -9,7 +9,7 @@ import ngeoStatemanagerLocation from 'ngeo/statemanager/Location.js'; export class StatemanagerService { /** * @param {import("ngeo/statemanager/Location.js").StatemanagerLocation} ngeoLocation ngeo location service. - * @param {Array} ngeoUsedKeyRegexp regexp used to identify the used keys. + * @param {RegExp[]} ngeoUsedKeyRegexp regexp used to identify the used keys. * @ngInject */ constructor(ngeoLocation, ngeoUsedKeyRegexp) { @@ -27,7 +27,7 @@ export class StatemanagerService { /** - * @type {Array} + * @type {RegExp[]} */ this.usedKeyRegexp = ngeoUsedKeyRegexp; diff --git a/src/statemanager/WfsPermalink.js b/src/statemanager/WfsPermalink.js index c5aa753c198f..9db488bf3ddf 100644 --- a/src/statemanager/WfsPermalink.js +++ b/src/statemanager/WfsPermalink.js @@ -48,7 +48,7 @@ import olFormatWFS from 'ol/format/WFS.js'; * The options for the WFS query service (permalink). * * @typedef {Object} WfsPermalinkOptions - * @property {Array} wfsTypes The queryable WFS types. + * @property {WfsType[]} wfsTypes The queryable WFS types. * @property {number} [pointRecenterZoom] Zoom level to use when result is a single point feature. If not set * the map is not zoomed to a specific zoom level. * @property {number} [maxFeatures=50] The maximum number of records per request the query service should ask. @@ -60,19 +60,19 @@ import olFormatWFS from 'ol/format/WFS.js'; /** * @typedef {Object} WfsPermalinkData * @property {string} wfsType - * @property {Array} filterGroups + * @property {WfsPermalinkFilterGroup[]} filterGroups * @property {boolean} showFeatures */ /** * @typedef {Object} WfsPermalinkFilter * @property {string} property - * @property {Array|string} condition + * @property {string[]|string} condition */ /** * @typedef {Object} WfsPermalinkFilterGroup - * @property {Array} filters + * @property {WfsPermalinkFilter[]} filters */ /** @@ -272,12 +272,12 @@ WfsPermalinkService.prototype.issueRequest_ = function(wfsType, filter, map, sho /** - * @param {Array} features Features. + * @param {Feature[]} features Features. * @return {import('ol/extent.js').Extent} The extent of all features. * @private */ WfsPermalinkService.prototype.getExtent_ = function(features) { - return /** @type{import('ol/extent.js').Extent} */(/** @type{Array} */(features).reduce( + return /** @type{import('ol/extent.js').Extent} */(/** @type{any[]} */(features).reduce( (extent, feature) => { if (feature instanceof Feature) { const geometry = feature.getGeometry(); @@ -293,7 +293,7 @@ WfsPermalinkService.prototype.getExtent_ = function(features) { /** * Create OGC filters for the filter groups extracted from the query params. * - * @param {Array} filterGroups Filter groups. + * @param {WfsPermalinkFilterGroup[]} filterGroups Filter groups. * @return {?import("ol/format/filter/Filter.js").default} OGC filters. * @private */ diff --git a/src/utils.js b/src/utils.js index 71415caa3757..06a60b544e94 100644 --- a/src/utils.js +++ b/src/utils.js @@ -57,7 +57,7 @@ export function colorZeroPadding(hex) { /** * Converts a color from RGB to hex representation. - * @param {Array} rgb rgb representation of the color. + * @param {number[]} rgb rgb representation of the color. * @return {string} hex representation of the color. * @hidden */