Skip to content

Commit

Permalink
Use the [] syntax in simple cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed May 20, 2019
1 parent 60de310 commit c6847b9
Show file tree
Hide file tree
Showing 96 changed files with 279 additions and 279 deletions.
8 changes: 4 additions & 4 deletions api/src/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class Map {

/**
* @param {string} layer Name of the layer to fetch the features from
* @param {Array<string>} ids List of ids
* @param {string[]} ids List of ids
* @param {boolean} [highlight=false] Whether to add the features on
* the map or not.
*/
Expand Down Expand Up @@ -283,7 +283,7 @@ class Map {
* @param {string} name Name.
* @param {string} url URL.
* @param {Object} [options] Options
* @property {Array<string>} [attr=['title', 'description']]
* @property {string[]} [attr=['title', 'description']]
* @property {function()} [success]
* @property {function()} [error]
*/
Expand Down Expand Up @@ -375,7 +375,7 @@ class Map {


/**
* @param {Array<string>} keys Keys.
* @param {string[]} keys Keys.
* @param {Array<*>} values Values.
* @returns {Object<string, *>} Object.
* @private
Expand All @@ -393,7 +393,7 @@ function zip(keys, values) {

/**
* @param {Object<string, *>} obj Object.
* @param {Array<string>} keys keys.
* @param {string[]} keys keys.
* @returns {Object<string, *>} Object.
* @private
* @hidden
Expand Down
2 changes: 1 addition & 1 deletion api/src/Querent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>} ids List of ids
* @param {string[]} ids List of ids
* @return {Promise<Array<import('ol/Feature.js').default>>} Promise.
* @hidden
*/
Expand Down
2 changes: 1 addition & 1 deletion api/src/Themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>} layerNames List of layer names
* @param {string[]} layerNames List of layer names
* @return {Promise} Promise.
* @hidden
*/
Expand Down
2 changes: 1 addition & 1 deletion api/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
* @typedef {Object} APIConfig
* @property {?string} themesUrl
* @property {string} projection
* @property {Array<number>} resolutions
* @property {number[]} resolutions
* @property {[number, number, number, number]} [extent]
* @property {string} backgroundLayer
*/
Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/apps/desktop/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ class Controller extends AbstractDesktopController {
}, $scope, $injector);

/**
* @type {Array<string>}
* @type {string[]}
*/
this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326'];

/**
* @type {Array<number>}
* @type {number[]}
*/
this.scaleSelectorValues = [250000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 250, 100, 50];

/**
* @type {Array<string>}
* @type {string[]}
*/
this.elevationLayers = ['aster', 'srtm'];

Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/apps/desktop_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Controller extends AbstractDesktopController {
}, $scope, $injector);

/**
* @type {Array<string>}
* @type {string[]}
*/
this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326'];

Expand All @@ -68,12 +68,12 @@ class Controller extends AbstractDesktopController {
this.showInfobar = true;

/**
* @type {Array<number>}
* @type {number[]}
*/
this.scaleSelectorValues = [250000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 250, 100, 50];

/**
* @type {Array<string>}
* @type {string[]}
*/
this.elevationLayers = ['srtm-partial'];

Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/apps/mobile/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Controller extends AbstractMobileController {
];

/**
* @type {Array<string>}
* @type {string[]}
*/
this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326'];

Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/apps/mobile_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Controller extends AbstractMobileController {
this.searchDelay = 50;

/**
* @type {Array<string>}
* @type {string[]}
*/
this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326'];

Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/apps/oeedit/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,17 @@ class Controller extends AbstractDesktopController {
});

/**
* @type {Array<string>}
* @type {string[]}
*/
this.searchCoordinatesProjections = [EPSG21781, EPSG2056, 'EPSG:4326'];

/**
* @type {Array<number>}
* @type {number[]}
*/
this.scaleSelectorValues = [250000, 100000, 50000, 20000, 10000, 5000, 2000, 1000, 500, 250, 100, 50];

/**
* @type {Array<string>}
* @type {string[]}
*/
this.elevationLayers = ['aster', 'srtm'];

Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/examples/displayquerygrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function MainController(gmfThemes, gmfDataSourcesManager, ngeoFeatureOverlayMgr)
gmfDataSourcesManager.setDatasourceMap(this.map);

/**
* @type {Array<Object>|undefined}
* @type {Object[]|undefined}
* export
*/
this.themes = undefined;
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/examples/displayquerywindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function MainController(gmfThemes, gmfDataSourcesManager,
gmfDataSourcesManager.setDatasourceMap(this.map);

/**
* @type {Array<Object>|undefined}
* @type {Object[]|undefined}
* export
*/
this.themes = undefined;
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/examples/editfeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<number>} */ (map.getSize());
const size = /** @type {number[]} */ (map.getSize());
const extent = olExtent.buffer(
view.calculateExtent(size),
buffer
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/examples/elevation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.constant('angularLocaleScript', '../build/angular-locale_{{locale}}.js');
*/
function MainController() {
/**
* @type {Array<string>}
* @type {string[]}
*/
this.elevationLayers = ['aster', 'srtm'];

Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/examples/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function MainController(gmfThemes, ngeoFeatureOverlayMgr) {
};

/**
* @type {Array<Object>|undefined}
* @type {Object[]|undefined}
*/
this.themes = undefined;

Expand Down
18 changes: 9 additions & 9 deletions contribs/gmf/src/authentication/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import olEventsEventTarget from 'ol/events/Target.js';
/**
* Availables functionalities.
* @typedef {Object} AuthenticationFunctionalities
* @property {Array<string>} default_basemap Base maps to use by default.
* @property {Array<string>} default_theme Theme to use by default.
* @property {Array<string>} [filterable_layers] A list of layer names that can be filtered.
* @property {Array<string>} [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<string>} [preset_layer_filter] Default filtrable datasource name.
* @property {string[]} [preset_layer_filter] Default filtrable datasource name.
*/

/**
Expand All @@ -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<RoleInfo>} roles Roles information.
* @property {RoleInfo[]} roles Roles information.
* @property {string|null} username The name of the user.
*/

Expand All @@ -45,7 +45,7 @@ import olEventsEventTarget from 'ol/events/Target.js';
* @typedef {Object} AuthenticationLoginResponse
* @property {AuthenticationFunctionalities} [functionalities]
* @property {boolean} [is_password_changed]
* @property {Array<RoleInfo>} [roles]
* @property {RoleInfo[]} [roles]
* @property {string} [username]
*/

Expand Down Expand Up @@ -214,14 +214,14 @@ export class AuthenticationService extends olEventsEventTarget {
}

/**
* @return {Array<number>} The roles IDs.
* @return {number[]} The roles IDs.
*/
getRolesIds() {
return this.user_.roles ? this.user_.roles.map((role) => role.id) : [];
}

/**
* @return {Array<string>} The roles names.
* @return {string[]} The roles names.
*/
getRolesNames() {
return this.user_.roles ? this.user_.roles.map((role) => role.name) : [];
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/authentication/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class AuthenticationController {
}

/**
* @param {string|Array<string>} errors Errors.
* @param {string|string[]} errors Errors.
* @param {MessageType} [messageType] Type.
* @private
*/
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/contextualdata/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<number>} 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.
Expand Down Expand Up @@ -96,7 +96,7 @@ export function ContextualdataController($compile, $timeout, $scope, gmfRaster,
this.map = null;

/**
* @type {Array<number>}
* @type {number[]}
*/
this.projections = [];

Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export function AbstractAppController(config, map, $scope, $injector) {
*/
this.searchDatasources = [{
labelKey: 'label',
groupValues: /** @type {Array<string>} **/ ($injector.get('gmfSearchGroups')),
groupValues: /** @type {string[]} **/ ($injector.get('gmfSearchGroups')),
groupActions: /** @type {Array<import('gmf/search/component.js').gmfSearchAction>} **/(
$injector.get('gmfSearchActions')),
projection: `EPSG:${config.srid || 21781}`,
Expand Down Expand Up @@ -679,7 +679,7 @@ export function AbstractAppController(config, map, $scope, $injector) {

/**
* @param {Array<import("ol/layer/Base.js").default>} layers Layers list.
* @param {Array<string>} labels default_basemap list.
* @param {string[]} labels default_basemap list.
* @return {?import("ol/layer/Base.js").default} layer or null
* @private
* @hidden
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/disclaimer/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function DisclamerController(
this.msg;

/**
* @type {Array<string>}
* @type {string[]}
*/
this.msgs_ = [];

Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/drawing/drawFeatureComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ Controller.prototype.handleMapContextMenu_ = function(evt) {


/**
* @param {?Array<number>} 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
Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/src/editing/EditFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<number>} 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<import("ol/Feature.js").default[]>} Promise.
*/
Expand All @@ -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<string>} layerIds List of layer ids to get the features from.
* @param {Array<ComparisonFilter>} 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<import("ol/Feature.js").default[]>} Promise.
*/
EditingEditFeature.prototype.getFeaturesWithComparisonFilters = function(layerIds, filters) {
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/editing/editFeatureComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ function Controller($element, $q, $scope, $timeout,
this.serverErrorType = null;

/**
* @type {?Array<number>}
* @type {?number[]}
* @private
*/
this.vertexInfo_ = null;
Expand Down
8 changes: 4 additions & 4 deletions contribs/gmf/src/filters/SavedFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class SavedFilter {
this.currentDataSourceId_ = null;

/**
* @type {Array<SavedFilterItem>}
* @type {SavedFilterItem[]}
* @private
*/
this.currentDataSourceItems_ = [];
Expand Down Expand Up @@ -73,7 +73,7 @@ export class SavedFilter {
}

/**
* @type {Array<SavedFilterItem>}
* @type {SavedFilterItem[]}
* @private
*/
this.items_ = [];
Expand All @@ -92,7 +92,7 @@ export class SavedFilter {
}

/**
* @return {Array<SavedFilterItem>} Items
* @return {SavedFilterItem[]} Items
*/
get currentDataSourceItems() {
return this.currentDataSourceItems_;
Expand All @@ -107,7 +107,7 @@ export class SavedFilter {
}

/**
* @return {Array<SavedFilterItem>} Items
* @return {SavedFilterItem[]} Items
*/
get items() {
return this.items_;
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/filters/filterselectorComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class FilterSelectorController {
this.filtrableDataSources = [];

/**
* @type {?Array<string>}
* @type {?string[]}
* @private
*/
this.filtrableLayerNodeNames_ = null;
Expand Down
Loading

0 comments on commit c6847b9

Please sign in to comment.