Use Array<Foo> instead of Array.<Foo>

This commit is contained in:
Tim Schaub
2018-07-25 18:32:43 -07:00
parent 5a6502572f
commit d12ef20b12
184 changed files with 1194 additions and 1194 deletions

View File

@@ -13,7 +13,7 @@ import {get as getProjection} from '../proj.js';
/**
* @typedef {Object} Options
* @property {Array.<function(new: module:ol/format/Feature)>} [formatConstructors] Format constructors.
* @property {Array<function(new: module:ol/format/Feature)>} [formatConstructors] Format constructors.
* @property {module:ol/source/Vector} [source] Optional vector source where features will be added. If a source is provided
* all existing features will be removed and new features will be added when
* they are dropped on the target. If you want to add features to a vector
@@ -47,7 +47,7 @@ class DragAndDropEvent extends Event {
/**
* @param {module:ol/interaction/DragAndDrop~DragAndDropEventType} type Type.
* @param {File} file File.
* @param {Array.<module:ol/Feature>=} opt_features Features.
* @param {Array<module:ol/Feature>=} opt_features Features.
* @param {module:ol/proj/Projection=} opt_projection Projection.
*/
constructor(type, file, opt_features, opt_projection) {
@@ -56,7 +56,7 @@ class DragAndDropEvent extends Event {
/**
* The features parsed from dropped data.
* @type {Array.<module:ol/Feature>|undefined}
* @type {Array<module:ol/Feature>|undefined}
* @api
*/
this.features = opt_features;
@@ -101,7 +101,7 @@ class DragAndDrop extends Interaction {
/**
* @private
* @type {Array.<function(new: module:ol/format/Feature)>}
* @type {Array<function(new: module:ol/format/Feature)>}
*/
this.formatConstructors_ = options.formatConstructors ?
options.formatConstructors : [];
@@ -115,7 +115,7 @@ class DragAndDrop extends Interaction {
/**
* @private
* @type {Array.<module:ol/events~EventsKey>}
* @type {Array<module:ol/events~EventsKey>}
*/
this.dropListenKeys_ = null;
@@ -220,7 +220,7 @@ class DragAndDrop extends Interaction {
* @param {string} text Text.
* @param {module:ol/format/Feature~ReadOptions} options Read options.
* @private
* @return {Array.<module:ol/Feature>} Features.
* @return {Array<module:ol/Feature>} Features.
*/
tryReadFeatures_(format, text, options) {
try {

View File

@@ -56,7 +56,7 @@ import {createEditingStyle} from '../style/Style.js';
* @property {module:ol/events/condition~Condition} [finishCondition] A function
* that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
* boolean to indicate whether the drawing can be finished.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style for sketch features.
* @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction]
* Function that is called when a geometry's coordinates are updated.
@@ -86,7 +86,7 @@ import {createEditingStyle} from '../style/Style.js';
* arguments, and returns a geometry. The optional existing geometry is the
* geometry that is returned when the function is called without a second
* argument.
* @typedef {function(!Array.<module:ol/coordinate~Coordinate>, module:ol/geom/SimpleGeometry=):
* @typedef {function(!Array<module:ol/coordinate~Coordinate>, module:ol/geom/SimpleGeometry=):
* module:ol/geom/SimpleGeometry} GeometryFunction
*/
@@ -272,7 +272,7 @@ class Draw extends PointerInteraction {
if (!geometryFunction) {
if (this.type_ === GeometryType.CIRCLE) {
/**
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates
* The coordinates.
* @param {module:ol/geom/SimpleGeometry=} opt_geometry Optional geometry.
* @return {module:ol/geom/SimpleGeometry} A geometry.
@@ -296,7 +296,7 @@ class Draw extends PointerInteraction {
Constructor = Polygon;
}
/**
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates
* The coordinates.
* @param {module:ol/geom/SimpleGeometry=} opt_geometry Optional geometry.
* @return {module:ol/geom/SimpleGeometry} A geometry.
@@ -358,7 +358,7 @@ class Draw extends PointerInteraction {
/**
* Sketch coordinates. Used when drawing a line or polygon.
* @type {module:ol/coordinate~Coordinate|Array.<module:ol/coordinate~Coordinate>|Array.<Array.<module:ol/coordinate~Coordinate>>}
* @type {module:ol/coordinate~Coordinate|Array<module:ol/coordinate~Coordinate>|Array<Array<module:ol/coordinate~Coordinate>>}
* @private
*/
this.sketchCoords_ = null;
@@ -372,7 +372,7 @@ class Draw extends PointerInteraction {
/**
* Sketch line coordinates. Used when drawing a polygon or circle.
* @type {Array.<module:ol/coordinate~Coordinate>}
* @type {Array<module:ol/coordinate~Coordinate>}
* @private
*/
this.sketchLineCoords_ = null;
@@ -580,7 +580,7 @@ class Draw extends PointerInteraction {
}
last[0] = coordinate[0];
last[1] = coordinate[1];
this.geometryFunction_(/** @type {!Array.<module:ol/coordinate~Coordinate>} */ (this.sketchCoords_), geometry);
this.geometryFunction_(/** @type {!Array<module:ol/coordinate~Coordinate>} */ (this.sketchCoords_), geometry);
if (this.sketchPoint_) {
const sketchPointGeom = /** @type {module:ol/geom/Point} */ (this.sketchPoint_.getGeometry());
sketchPointGeom.setCoordinates(coordinate);

View File

@@ -20,12 +20,12 @@ import {createEditingStyle} from '../style/Style.js';
* @typedef {Object} Options
* @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no
* initial extent.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [boxStyle]
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [boxStyle]
* Style for the drawn extent box. Defaults to
* {@link module:ol/style/Style~createEditing()['Polygon']}
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
* pointer close enough to a segment or vertex for editing.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [pointerStyle]
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [pointerStyle]
* Style for the cursor used to draw the extent. Defaults to
* {@link module:ol/style/Style~createEditing()['Point']}
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps

View File

@@ -60,12 +60,12 @@ const ModifyEventType = {
/**
* @typedef {Object} SegmentData
* @property {Array.<number>} [depth]
* @property {Array<number>} [depth]
* @property {module:ol/Feature} feature
* @property {module:ol/geom/SimpleGeometry} geometry
* @property {number} index
* @property {Array.<module:ol/extent~Extent>} segment
* @property {Array.<module:ol/interaction/Modify~SegmentData>} [featureSegments]
* @property {Array<module:ol/extent~Extent>} segment
* @property {Array<module:ol/interaction/Modify~SegmentData>} [featureSegments]
*/
@@ -87,7 +87,7 @@ const ModifyEventType = {
* features. Default is {@link module:ol/events/condition~always}.
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
* pointer close enough to a segment or vertex for editing.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style used for the features being modified. By default the default edit
* style is used (see {@link module:ol/style}).
* @property {module:ol/source/Vector} [source] The vector source with
@@ -388,7 +388,7 @@ class Modify extends PointerInteraction {
*/
removeFeatureSegmentData_(feature) {
const rBush = this.rBush_;
const /** @type {Array.<module:ol/interaction/Modify~SegmentData>} */ nodesToRemove = [];
const /** @type {Array<module:ol/interaction/Modify~SegmentData>} */ nodesToRemove = [];
rBush.forEach(
/**
* @param {module:ol/interaction/Modify~SegmentData} node RTree node.
@@ -948,7 +948,7 @@ class Modify extends PointerInteraction {
/**
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
* @param {number} index Index.
* @param {Array.<number>|undefined} depth Depth.
* @param {Array<number>|undefined} depth Depth.
* @param {number} delta Delta (1 or -1).
* @private
*/

View File

@@ -136,7 +136,7 @@ class PointerInteraction extends Interaction {
this.trackedPointers_ = {};
/**
* @type {Array.<module:ol/pointer/PointerEvent>}
* @type {Array<module:ol/pointer/PointerEvent>}
* @protected
*/
this.targetPointers = [];
@@ -169,7 +169,7 @@ class PointerInteraction extends Interaction {
/**
* @param {Array.<module:ol/pointer/PointerEvent>} pointerEvents List of events.
* @param {Array<module:ol/pointer/PointerEvent>} pointerEvents List of events.
* @return {module:ol/pixel~Pixel} Centroid pixel.
*/
export function centroid(pointerEvents) {

View File

@@ -55,13 +55,13 @@ const SelectEventType = {
* feature removes all from the selection.
* See `toggle`, `add`, `remove` options for adding/removing extra features to/
* from the selection.
* @property {Array.<module:ol/layer/Layer>|function(module:ol/layer/Layer): boolean} [layers]
* @property {Array<module:ol/layer/Layer>|function(module:ol/layer/Layer): boolean} [layers]
* A list of layers from which features should be selected. Alternatively, a
* filter function can be provided. The function will be called for each layer
* in the map and should return `true` for layers that you want to be
* selectable. If the option is absent, all visible layers will be considered
* selectable.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style for the selected features. By default the default edit style is used
* (see {@link module:ol/style}).
* @property {module:ol/events/condition~Condition} [removeCondition] A function
@@ -105,8 +105,8 @@ const SelectEventType = {
class SelectEvent extends Event {
/**
* @param {SelectEventType} type The event type.
* @param {Array.<module:ol/Feature>} selected Selected features.
* @param {Array.<module:ol/Feature>} deselected Deselected features.
* @param {Array<module:ol/Feature>} selected Selected features.
* @param {Array<module:ol/Feature>} deselected Deselected features.
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Associated
* {@link module:ol/MapBrowserEvent}.
*/
@@ -115,14 +115,14 @@ class SelectEvent extends Event {
/**
* Selected features array.
* @type {Array.<module:ol/Feature>}
* @type {Array<module:ol/Feature>}
* @api
*/
this.selected = selected;
/**
* Deselected features array.
* @type {Array.<module:ol/Feature>}
* @type {Array<module:ol/Feature>}
* @api
*/
this.deselected = deselected;

View File

@@ -29,7 +29,7 @@ import RBush from '../structs/RBush.js';
/**
* @typedef {Object} SegmentData
* @property {module:ol/Feature} feature
* @property {Array.<module:ol/coordinate~Coordinate>} segment
* @property {Array<module:ol/coordinate~Coordinate>} segment
*/
@@ -105,7 +105,7 @@ class Snap extends PointerInteraction {
this.features_ = options.features ? options.features : null;
/**
* @type {Array.<module:ol/events~EventsKey>}
* @type {Array<module:ol/events~EventsKey>}
* @private
*/
this.featuresListenerKeys_ = [];
@@ -224,7 +224,7 @@ class Snap extends PointerInteraction {
}
/**
* @return {module:ol/Collection.<module:ol/Feature>|Array.<module:ol/Feature>} Features.
* @return {module:ol/Collection.<module:ol/Feature>|Array<module:ol/Feature>} Features.
* @private
*/
getFeatures_() {
@@ -235,7 +235,7 @@ class Snap extends PointerInteraction {
features = this.source_.getFeatures();
}
return (
/** @type {!Array.<module:ol/Feature>|!module:ol/Collection.<module:ol/Feature>} */ (features)
/** @type {!Array<module:ol/Feature>|!module:ol/Collection.<module:ol/Feature>} */ (features)
);
}

View File

@@ -40,7 +40,7 @@ const TranslateEventType = {
* @typedef {Object} Options
* @property {module:ol/Collection.<module:ol/Feature>} [features] Only features contained in this collection will be able to be translated. If
* not specified, all features on the map will be able to be translated.
* @property {Array.<module:ol/layer/Layer>|function(module:ol/layer/Layer): boolean} [layers] A list of layers from which features should be
* @property {Array<module:ol/layer/Layer>|function(module:ol/layer/Layer): boolean} [layers] A list of layers from which features should be
* translated. Alternatively, a filter function can be provided. The
* function will be called for each layer in the map and should return
* `true` for layers that you want to be translatable. If the option is