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

@@ -25,9 +25,9 @@ const tmpTransform = createTransform();
* through the API is limited to getting the type and extent of the geometry.
*
* @param {module:ol/geom/GeometryType} type Geometry type.
* @param {Array.<number>} flatCoordinates Flat coordinates. These always need
* @param {Array<number>} flatCoordinates Flat coordinates. These always need
* to be right-handed for polygons.
* @param {Array.<number>|Array.<Array.<number>>} ends Ends or Endss.
* @param {Array<number>|Array<Array<number>>} ends Ends or Endss.
* @param {Object.<string, *>} properties Properties.
* @param {number|string|undefined} id Feature id.
*/
@@ -53,25 +53,25 @@ class RenderFeature {
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.flatCoordinates_ = flatCoordinates;
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.flatInteriorPoints_ = null;
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.flatMidpoints_ = null;
/**
* @private
* @type {Array.<number>|Array.<Array.<number>>}
* @type {Array<number>|Array<Array<number>>}
*/
this.ends_ = ends;
@@ -110,7 +110,7 @@ class RenderFeature {
}
/**
* @return {Array.<number>} Flat interior points.
* @return {Array<number>} Flat interior points.
*/
getFlatInteriorPoint() {
if (!this.flatInteriorPoints_) {
@@ -122,7 +122,7 @@ class RenderFeature {
}
/**
* @return {Array.<number>} Flat interior points.
* @return {Array<number>} Flat interior points.
*/
getFlatInteriorPoints() {
if (!this.flatInteriorPoints_) {
@@ -135,7 +135,7 @@ class RenderFeature {
}
/**
* @return {Array.<number>} Flat midpoint.
* @return {Array<number>} Flat midpoint.
*/
getFlatMidpoint() {
if (!this.flatMidpoints_) {
@@ -146,7 +146,7 @@ class RenderFeature {
}
/**
* @return {Array.<number>} Flat midpoints.
* @return {Array<number>} Flat midpoints.
*/
getFlatMidpoints() {
if (!this.flatMidpoints_) {
@@ -176,7 +176,7 @@ class RenderFeature {
}
/**
* @return {Array.<number>} Flat coordinates.
* @return {Array<number>} Flat coordinates.
*/
getOrientedFlatCoordinates() {
return this.flatCoordinates_;
@@ -240,7 +240,7 @@ class RenderFeature {
/**
* @return {Array.<number>|Array.<Array.<number>>} Ends or endss.
* @return {Array<number>|Array<Array<number>>} Ends or endss.
*/
RenderFeature.prototype.getEnds =
RenderFeature.prototype.getEndss = function() {
@@ -249,7 +249,7 @@ RenderFeature.prototype.getEndss = function() {
/**
* @return {Array.<number>} Flat coordinates.
* @return {Array<number>} Flat coordinates.
*/
RenderFeature.prototype.getFlatCoordinates =
RenderFeature.prototype.getOrientedFlatCoordinates;

View File

@@ -19,7 +19,7 @@ import {create as createTransform} from '../transform.js';
* @property {module:ol/colorlike~ColorLike} [currentFillStyle]
* @property {module:ol/colorlike~ColorLike} [currentStrokeStyle]
* @property {string} [currentLineCap]
* @property {Array.<number>} currentLineDash
* @property {Array<number>} currentLineDash
* @property {number} [currentLineDashOffset]
* @property {string} [currentLineJoin]
* @property {number} [currentLineWidth]
@@ -28,7 +28,7 @@ import {create as createTransform} from '../transform.js';
* @property {module:ol/colorlike~ColorLike} [fillStyle]
* @property {module:ol/colorlike~ColorLike} [strokeStyle]
* @property {string} [lineCap]
* @property {Array.<number>} lineDash
* @property {Array<number>} lineDash
* @property {number} [lineDashOffset]
* @property {string} [lineJoin]
* @property {number} [lineWidth]
@@ -39,7 +39,7 @@ import {create as createTransform} from '../transform.js';
/**
* @typedef {Object} StrokeState
* @property {string} lineCap
* @property {Array.<number>} lineDash
* @property {Array<number>} lineDash
* @property {number} lineDashOffset
* @property {string} lineJoin
* @property {number} lineWidth
@@ -65,7 +65,7 @@ import {create as createTransform} from '../transform.js';
* in the group, i.e. 2 when an image and a text are grouped, or 1 otherwise.
* In addition to these four elements, declutter instruction arrays (i.e. the
* arguments to {@link module:ol/render/canvas~drawImage} are appended to the array.
* @typedef {Array.<*>} DeclutterGroup
* @typedef {Array<*>} DeclutterGroup
*/
@@ -92,7 +92,7 @@ export const defaultLineCap = 'round';
/**
* @const
* @type {Array.<number>}
* @type {Array<number>}
*/
export const defaultLineDash = [];
@@ -141,7 +141,7 @@ export const defaultTextBaseline = 'middle';
/**
* @const
* @type {Array.<number>}
* @type {Array<number>}
*/
export const defaultPadding = [0, 0, 0, 0];

View File

@@ -103,7 +103,7 @@ class CanvasImageReplay extends CanvasReplay {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.

View File

@@ -224,7 +224,7 @@ class CanvasImmediateRenderer extends VectorContext {
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.pixelCoordinates_ = [];
@@ -237,7 +237,7 @@ class CanvasImmediateRenderer extends VectorContext {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -290,7 +290,7 @@ class CanvasImmediateRenderer extends VectorContext {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -339,7 +339,7 @@ class CanvasImmediateRenderer extends VectorContext {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -367,9 +367,9 @@ class CanvasImmediateRenderer extends VectorContext {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {Array.<number>} ends Ends.
* @param {Array<number>} ends Ends.
* @param {number} stride Stride.
* @private
* @return {number} End.

View File

@@ -23,25 +23,25 @@ const Instruction = {
/**
* @type {Array.<Instruction>}
* @type {Array<Instruction>}
*/
export const fillInstruction = [Instruction.FILL];
/**
* @type {Array.<Instruction>}
* @type {Array<Instruction>}
*/
export const strokeInstruction = [Instruction.STROKE];
/**
* @type {Array.<Instruction>}
* @type {Array<Instruction>}
*/
export const beginPathInstruction = [Instruction.BEGIN_PATH];
/**
* @type {Array.<Instruction>}
* @type {Array<Instruction>}
*/
export const closePathInstruction = [Instruction.CLOSE_PATH];

View File

@@ -18,7 +18,7 @@ class CanvasLineStringReplay extends CanvasReplay {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.

View File

@@ -24,9 +24,9 @@ class CanvasPolygonReplay extends CanvasReplay {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {Array.<number>} ends Ends.
* @param {Array<number>} ends Ends.
* @param {number} stride Stride.
* @private
* @return {number} End.

View File

@@ -104,13 +104,13 @@ class CanvasReplay extends VectorContext {
/**
* @private
* @type {Array.<*>}
* @type {Array<*>}
*/
this.beginGeometryInstruction1_ = null;
/**
* @private
* @type {Array.<*>}
* @type {Array<*>}
*/
this.beginGeometryInstruction2_ = null;
@@ -122,19 +122,19 @@ class CanvasReplay extends VectorContext {
/**
* @protected
* @type {Array.<*>}
* @type {Array<*>}
*/
this.instructions = [];
/**
* @protected
* @type {Array.<number>}
* @type {Array<number>}
*/
this.coordinates = [];
/**
* @private
* @type {!Object.<number,module:ol/coordinate~Coordinate|Array.<module:ol/coordinate~Coordinate>|Array.<Array.<module:ol/coordinate~Coordinate>>>}
* @type {!Object.<number,module:ol/coordinate~Coordinate|Array<module:ol/coordinate~Coordinate>|Array<Array<module:ol/coordinate~Coordinate>>>}
*/
this.coordinateCache_ = {};
@@ -146,13 +146,13 @@ class CanvasReplay extends VectorContext {
/**
* @protected
* @type {Array.<*>}
* @type {Array<*>}
*/
this.hitDetectionInstructions = [];
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.pixelCoordinates_ = null;
@@ -176,8 +176,8 @@ class CanvasReplay extends VectorContext {
* @param {module:ol/coordinate~Coordinate} p2 2nd point of the background box.
* @param {module:ol/coordinate~Coordinate} p3 3rd point of the background box.
* @param {module:ol/coordinate~Coordinate} p4 4th point of the background box.
* @param {Array.<*>} fillInstruction Fill instruction.
* @param {Array.<*>} strokeInstruction Stroke instruction.
* @param {Array<*>} fillInstruction Fill instruction.
* @param {Array<*>} strokeInstruction Stroke instruction.
*/
replayTextBackground_(context, p1, p2, p3, p4, fillInstruction, strokeInstruction) {
context.beginPath();
@@ -191,7 +191,7 @@ class CanvasReplay extends VectorContext {
this.fill_(context);
}
if (strokeInstruction) {
this.setStrokeStyle_(context, /** @type {Array.<*>} */ (strokeInstruction));
this.setStrokeStyle_(context, /** @type {Array<*>} */ (strokeInstruction));
context.stroke();
}
}
@@ -212,9 +212,9 @@ class CanvasReplay extends VectorContext {
* @param {number} scale Scale.
* @param {boolean} snapToPixel Snap to pixel.
* @param {number} width Width.
* @param {Array.<number>} padding Padding.
* @param {Array.<*>} fillInstruction Fill instruction.
* @param {Array.<*>} strokeInstruction Stroke instruction.
* @param {Array<number>} padding Padding.
* @param {Array<*>} fillInstruction Fill instruction.
* @param {Array<*>} strokeInstruction Stroke instruction.
*/
replayImage_(
context,
@@ -304,8 +304,8 @@ class CanvasReplay extends VectorContext {
} else if (intersects) {
if (fillStroke) {
this.replayTextBackground_(context, p1, p2, p3, p4,
/** @type {Array.<*>} */ (fillInstruction),
/** @type {Array.<*>} */ (strokeInstruction));
/** @type {Array<*>} */ (fillInstruction),
/** @type {Array<*>} */ (strokeInstruction));
}
drawImage(context, transform, opacity, image, originX, originY, w, h, x, y, scale);
}
@@ -313,8 +313,8 @@ class CanvasReplay extends VectorContext {
/**
* @protected
* @param {Array.<number>} dashArray Dash array.
* @return {Array.<number>} Dash array with pixel ratio applied
* @param {Array<number>} dashArray Dash array.
* @return {Array<number>} Dash array with pixel ratio applied
*/
applyPixelRatio(dashArray) {
const pixelRatio = this.pixelRatio;
@@ -324,7 +324,7 @@ class CanvasReplay extends VectorContext {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -378,11 +378,11 @@ class CanvasReplay extends VectorContext {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {Array.<number>} ends Ends.
* @param {Array<number>} ends Ends.
* @param {number} stride Stride.
* @param {Array.<number>} replayEnds Replay ends.
* @param {Array<number>} replayEnds Replay ends.
* @return {number} Offset.
*/
drawCustomCoordinates_(flatCoordinates, offset, ends, stride, replayEnds) {
@@ -476,7 +476,7 @@ class CanvasReplay extends VectorContext {
/**
* @private
* @param {CanvasRenderingContext2D} context Context.
* @param {Array.<*>} instruction Instruction.
* @param {Array<*>} instruction Instruction.
*/
setStrokeStyle_(context, instruction) {
context.strokeStyle = /** @type {module:ol/colorlike~ColorLike} */ (instruction[1]);
@@ -486,7 +486,7 @@ class CanvasReplay extends VectorContext {
context.miterLimit = /** @type {number} */ (instruction[5]);
if (CANVAS_LINE_DASH) {
context.lineDashOffset = /** @type {number} */ (instruction[7]);
context.setLineDash(/** @type {Array.<number>} */ (instruction[6]));
context.setLineDash(/** @type {Array<number>} */ (instruction[6]));
}
}
@@ -532,7 +532,7 @@ class CanvasReplay extends VectorContext {
* @param {module:ol/transform~Transform} transform Transform.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip.
* @param {Array.<*>} instructions Instructions array.
* @param {Array<*>} instructions Instructions array.
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
* @param {module:ol/extent~Extent=} opt_hitExtent Only check features that intersect this
* extent.
@@ -547,7 +547,7 @@ class CanvasReplay extends VectorContext {
featureCallback,
opt_hitExtent
) {
/** @type {Array.<number>} */
/** @type {Array<number>} */
let pixelCoordinates;
if (this.pixelCoordinates_ && equals(transform, this.renderedTransform_)) {
pixelCoordinates = this.pixelCoordinates_;
@@ -677,7 +677,7 @@ class CanvasReplay extends VectorContext {
let padding, backgroundFill, backgroundStroke;
if (instruction.length > 16) {
padding = /** @type {Array.<number>} */ (instruction[16]);
padding = /** @type {Array<number>} */ (instruction[16]);
backgroundFill = /** @type {boolean} */ (instruction[17]);
backgroundStroke = /** @type {boolean} */ (instruction[18]);
} else {
@@ -693,8 +693,8 @@ class CanvasReplay extends VectorContext {
pixelCoordinates[d], pixelCoordinates[d + 1], image, anchorX, anchorY,
declutterGroup, height, opacity, originX, originY, rotation, scale,
snapToPixel, width, padding,
backgroundFill ? /** @type {Array.<*>} */ (lastFillInstruction) : null,
backgroundStroke ? /** @type {Array.<*>} */ (lastStrokeInstruction) : null);
backgroundFill ? /** @type {Array<*>} */ (lastFillInstruction) : null,
backgroundStroke ? /** @type {Array<*>} */ (lastStrokeInstruction) : null);
}
this.renderDeclutter_(declutterGroup, feature);
++i;
@@ -822,7 +822,7 @@ class CanvasReplay extends VectorContext {
context.stroke();
pendingStroke = 0;
}
this.setStrokeStyle_(context, /** @type {Array.<*>} */ (instruction));
this.setStrokeStyle_(context, /** @type {Array<*>} */ (instruction));
++i;
break;
case CanvasInstruction.STROKE:
@@ -966,7 +966,7 @@ class CanvasReplay extends VectorContext {
/**
* @param {module:ol/render/canvas~FillStrokeState} state State.
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
* @return {Array.<*>} Fill instruction.
* @return {Array<*>} Fill instruction.
*/
createFill(state, geometry) {
const fillStyle = state.fillStyle;
@@ -987,7 +987,7 @@ class CanvasReplay extends VectorContext {
/**
* @param {module:ol/render/canvas~FillStrokeState} state State.
* @return {Array.<*>} Stroke instruction.
* @return {Array<*>} Stroke instruction.
*/
createStroke(state) {
return [
@@ -1000,7 +1000,7 @@ class CanvasReplay extends VectorContext {
/**
* @param {module:ol/render/canvas~FillStrokeState} state State.
* @param {function(this:module:ol/render/canvas/Replay, module:ol/render/canvas~FillStrokeState, (module:ol/geom/Geometry|module:ol/render/Feature)):Array.<*>} createFill Create fill.
* @param {function(this:module:ol/render/canvas/Replay, module:ol/render/canvas~FillStrokeState, (module:ol/geom/Geometry|module:ol/render/Feature)):Array<*>} createFill Create fill.
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
*/
updateFillStyle(state, createFill, geometry) {

View File

@@ -21,7 +21,7 @@ import {create as createTransform, compose as composeTransform} from '../../tran
/**
* @type {Object.<module:ol/render/ReplayType,
* function(new: module:ol/render/canvas/Replay, number, module:ol/extent~Extent,
* number, number, boolean, Array.<module:ol/render/canvas~DeclutterGroup>)>}
* number, number, boolean, Array<module:ol/render/canvas~DeclutterGroup>)>}
*/
const BATCH_CONSTRUCTORS = {
'Circle': CanvasPolygonReplay,
@@ -154,7 +154,7 @@ class CanvasReplayGroup extends ReplayGroup {
}
/**
* @param {Array.<module:ol/render/ReplayType>} replays Replays.
* @param {Array<module:ol/render/ReplayType>} replays Replays.
* @return {boolean} Has replays of the provided types.
*/
hasReplays(replays) {
@@ -265,7 +265,7 @@ class CanvasReplayGroup extends ReplayGroup {
}
}
/** @type {Array.<number>} */
/** @type {Array<number>} */
const zs = Object.keys(this.replaysByZIndex_).map(Number);
zs.sort(numberSafeCompareFunction);
@@ -300,7 +300,7 @@ class CanvasReplayGroup extends ReplayGroup {
/**
* @param {module:ol/transform~Transform} transform Transform.
* @return {Array.<number>} Clip coordinates.
* @return {Array<number>} Clip coordinates.
*/
getClipCoords(transform) {
const maxExtent = this.maxExtent_;
@@ -353,7 +353,7 @@ class CanvasReplayGroup extends ReplayGroup {
* @param {module:ol/transform~Transform} transform Transform.
* @param {number} viewRotation View rotation.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {Array.<module:ol/render/ReplayType>=} opt_replayTypes Ordered replay types to replay.
* @param {Array<module:ol/render/ReplayType>=} opt_replayTypes Ordered replay types to replay.
* Default is {@link module:ol/render/replay~ORDER}
* @param {Object.<string, module:ol/render/canvas~DeclutterGroup>=} opt_declutterReplays Declutter replays.
*/
@@ -366,7 +366,7 @@ class CanvasReplayGroup extends ReplayGroup {
opt_declutterReplays
) {
/** @type {Array.<number>} */
/** @type {Array<number>} */
const zs = Object.keys(this.replaysByZIndex_).map(Number);
zs.sort(numberSafeCompareFunction);
@@ -407,7 +407,7 @@ class CanvasReplayGroup extends ReplayGroup {
/**
* This cache is used for storing calculated pixel circles for increasing performance.
* It is a static property to allow each Replaygroup to access it.
* @type {Object.<number, Array.<Array.<(boolean|undefined)>>>}
* @type {Object.<number, Array<Array<(boolean|undefined)>>>}
*/
const circleArrayCache = {
0: [[true]]
@@ -417,7 +417,7 @@ const circleArrayCache = {
/**
* This method fills a row in the array from the given coordinate to the
* middle with `true`.
* @param {Array.<Array.<(boolean|undefined)>>} array The array that will be altered.
* @param {Array<Array<(boolean|undefined)>>} array The array that will be altered.
* @param {number} x X coordinate.
* @param {number} y Y coordinate.
*/
@@ -442,7 +442,7 @@ function fillCircleArrayRowToMiddle(array, x, y) {
* It uses the midpoint circle algorithm.
* A cache is used to increase performance.
* @param {number} radius Radius.
* @returns {Array.<Array.<(boolean|undefined)>>} An array with marked circle points.
* @returns {Array<Array<(boolean|undefined)>>} An array with marked circle points.
*/
export function getCircleArray(radius) {
if (circleArrayCache[radius] !== undefined) {
@@ -483,7 +483,7 @@ export function getCircleArray(radius) {
/**
* @param {!Object.<string, Array.<*>>} declutterReplays Declutter replays.
* @param {!Object.<string, Array<*>>} declutterReplays Declutter replays.
* @param {CanvasRenderingContext2D} context Context.
* @param {number} rotation Rotation.
*/

View File

@@ -34,7 +34,7 @@ class CanvasTextReplay extends CanvasReplay {
/**
* @private
* @type {Array.<HTMLCanvasElement>}
* @type {Array<HTMLCanvasElement>}
*/
this.labels_ = null;
@@ -520,8 +520,8 @@ class CanvasTextReplay extends CanvasReplay {
/**
* @param {string} font Font to use for measuring.
* @param {Array.<string>} lines Lines to measure.
* @param {Array.<number>} widths Array will be populated with the widths of
* @param {Array<string>} lines Lines to measure.
* @param {Array<number>} widths Array will be populated with the widths of
* each line.
* @return {number} Width of the whole text.
*/

View File

@@ -6,7 +6,7 @@ import ReplayType from '../render/ReplayType.js';
/**
* @const
* @type {Array.<module:ol/render/ReplayType>}
* @type {Array<module:ol/render/ReplayType>}
*/
export const ORDER = [
ReplayType.POLYGON,

View File

@@ -26,7 +26,7 @@ export const DEFAULT_LINECAP = 'round';
/**
* @const
* @type {Array.<number>}
* @type {Array<number>}
*/
export const DEFAULT_LINEDASH = [];

View File

@@ -31,13 +31,13 @@ class WebGLCircleReplay extends WebGLReplay {
/**
* @private
* @type {Array.<Array.<Array.<number>|number>>}
* @type {Array<Array<Array<number>|number>>}
*/
this.styles_ = [];
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.styleIndices_ = [];
@@ -49,9 +49,9 @@ class WebGLCircleReplay extends WebGLReplay {
/**
* @private
* @type {{fillColor: (Array.<number>|null),
* strokeColor: (Array.<number>|null),
* lineDash: Array.<number>,
* @type {{fillColor: (Array<number>|null),
* strokeColor: (Array<number>|null),
* lineDash: Array<number>,
* lineDashOffset: (number|undefined),
* lineWidth: (number|undefined),
* changed: boolean}|null}
@@ -69,7 +69,7 @@ class WebGLCircleReplay extends WebGLReplay {
/**
* @private
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -136,8 +136,8 @@ class WebGLCircleReplay extends WebGLReplay {
this.styles_.pop();
if (this.styles_.length) {
const lastState = this.styles_[this.styles_.length - 1];
this.state_.fillColor = /** @type {Array.<number>} */ (lastState[0]);
this.state_.strokeColor = /** @type {Array.<number>} */ (lastState[1]);
this.state_.fillColor = /** @type {Array<number>} */ (lastState[0]);
this.state_.strokeColor = /** @type {Array<number>} */ (lastState[1]);
this.state_.lineWidth = /** @type {number} */ (lastState[2]);
this.state_.changed = false;
}
@@ -242,8 +242,8 @@ class WebGLCircleReplay extends WebGLReplay {
for (i = this.styleIndices_.length - 1; i >= 0; --i) {
start = this.styleIndices_[i];
nextStyle = this.styles_[i];
this.setFillStyle_(gl, /** @type {Array.<number>} */ (nextStyle[0]));
this.setStrokeStyle_(gl, /** @type {Array.<number>} */ (nextStyle[1]),
this.setFillStyle_(gl, /** @type {Array<number>} */ (nextStyle[0]));
this.setStrokeStyle_(gl, /** @type {Array<number>} */ (nextStyle[1]),
/** @type {number} */ (nextStyle[2]));
this.drawElements(gl, context, start, end);
end = start;
@@ -260,8 +260,8 @@ class WebGLCircleReplay extends WebGLReplay {
end = this.startIndices[featureIndex + 1];
for (i = this.styleIndices_.length - 1; i >= 0; --i) {
nextStyle = this.styles_[i];
this.setFillStyle_(gl, /** @type {Array.<number>} */ (nextStyle[0]));
this.setStrokeStyle_(gl, /** @type {Array.<number>} */ (nextStyle[1]),
this.setFillStyle_(gl, /** @type {Array<number>} */ (nextStyle[0]));
this.setStrokeStyle_(gl, /** @type {Array<number>} */ (nextStyle[1]),
/** @type {number} */ (nextStyle[2]));
groupStart = this.styleIndices_[i];
@@ -305,8 +305,8 @@ class WebGLCircleReplay extends WebGLReplay {
end = start = this.startIndices[featureIndex + 1];
for (i = this.styleIndices_.length - 1; i >= 0; --i) {
nextStyle = this.styles_[i];
this.setFillStyle_(gl, /** @type {Array.<number>} */ (nextStyle[0]));
this.setStrokeStyle_(gl, /** @type {Array.<number>} */ (nextStyle[1]),
this.setFillStyle_(gl, /** @type {Array<number>} */ (nextStyle[0]));
this.setStrokeStyle_(gl, /** @type {Array<number>} */ (nextStyle[1]),
/** @type {number} */ (nextStyle[2]));
groupStart = this.styleIndices_[i];
@@ -335,7 +335,7 @@ class WebGLCircleReplay extends WebGLReplay {
/**
* @private
* @param {WebGLRenderingContext} gl gl.
* @param {Array.<number>} color Color.
* @param {Array<number>} color Color.
*/
setFillStyle_(gl, color) {
gl.uniform4fv(this.defaultLocations_.u_fillColor, color);
@@ -344,7 +344,7 @@ class WebGLCircleReplay extends WebGLReplay {
/**
* @private
* @param {WebGLRenderingContext} gl gl.
* @param {Array.<number>} color Color.
* @param {Array<number>} color Color.
* @param {number} lineWidth Line width.
*/
setStrokeStyle_(gl, color, lineWidth) {

View File

@@ -14,25 +14,25 @@ class WebGLImageReplay extends WebGLTextureReplay {
super(tolerance, maxExtent);
/**
* @type {Array.<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>}
* @type {Array<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>}
* @protected
*/
this.images_ = [];
/**
* @type {Array.<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>}
* @type {Array<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>}
* @protected
*/
this.hitDetectionImages_ = [];
/**
* @type {Array.<WebGLTexture>}
* @type {Array<WebGLTexture>}
* @private
*/
this.textures_ = [];
/**
* @type {Array.<WebGLTexture>}
* @type {Array<WebGLTexture>}
* @private
*/
this.hitDetectionTextures_ = [];

View File

@@ -51,21 +51,21 @@ class WebGLLineStringReplay extends WebGLReplay {
/**
* @private
* @type {Array.<Array.<?>>}
* @type {Array<Array<?>>}
*/
this.styles_ = [];
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.styleIndices_ = [];
/**
* @private
* @type {{strokeColor: (Array.<number>|null),
* @type {{strokeColor: (Array<number>|null),
* lineCap: (string|undefined),
* lineDash: Array.<number>,
* lineDash: Array<number>,
* lineDashOffset: (number|undefined),
* lineJoin: (string|undefined),
* lineWidth: (number|undefined),
@@ -88,7 +88,7 @@ class WebGLLineStringReplay extends WebGLReplay {
/**
* Draw one segment.
* @private
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -269,9 +269,9 @@ class WebGLLineStringReplay extends WebGLReplay {
}
/**
* @param {Array.<number>} p0 Last coordinates.
* @param {Array.<number>} p1 Current coordinates.
* @param {Array.<number>} p2 Next coordinates.
* @param {Array<number>} p0 Last coordinates.
* @param {Array<number>} p1 Current coordinates.
* @param {Array<number>} p2 Next coordinates.
* @param {number} product Sign, instruction, and rounding product.
* @param {number} numVertices Vertex counter.
* @return {number} Vertex counter.
@@ -291,7 +291,7 @@ class WebGLLineStringReplay extends WebGLReplay {
/**
* Check if the linestring can be drawn (i. e. valid).
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -362,8 +362,8 @@ class WebGLLineStringReplay extends WebGLReplay {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array.<Array.<number>>} holeFlatCoordinates Hole flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {Array<Array<number>>} holeFlatCoordinates Hole flat coordinates.
* @param {number} stride Stride.
*/
drawPolygonCoordinates(flatCoordinates, holeFlatCoordinates, stride) {
@@ -611,7 +611,7 @@ class WebGLLineStringReplay extends WebGLReplay {
/**
* @private
* @param {WebGLRenderingContext} gl gl.
* @param {Array.<number>} color Color.
* @param {Array<number>} color Color.
* @param {number} lineWidth Line width.
* @param {number} miterLimit Miter limit.
*/

View File

@@ -55,19 +55,19 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @type {Array.<Array.<number>>}
* @type {Array<Array<number>>}
*/
this.styles_ = [];
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.styleIndices_ = [];
/**
* @private
* @type {{fillColor: (Array.<number>|null),
* @type {{fillColor: (Array<number>|null),
* changed: boolean}|null}
*/
this.state_ = {
@@ -79,8 +79,8 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* Draw one polygon.
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array.<Array.<number>>} holeFlatCoordinates Hole flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {Array<Array<number>>} holeFlatCoordinates Hole flat coordinates.
* @param {number} stride Stride.
* @private
*/
@@ -141,7 +141,7 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* Inserts flat coordinates in a linked list and adds them to the vertex buffer.
* @private
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} stride Stride.
* @param {module:ol/structs/LinkedList} list Linked list.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
@@ -195,7 +195,7 @@ class WebGLPolygonReplay extends WebGLReplay {
* Returns the rightmost coordinates of a polygon on the X axis.
* @private
* @param {module:ol/structs/LinkedList} list Polygons ring.
* @return {Array.<number>} Max X coordinates.
* @return {Array<number>} Max X coordinates.
*/
getMaxCoords_(list) {
const start = list.firstItem();
@@ -643,7 +643,7 @@ class WebGLPolygonReplay extends WebGLReplay {
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Third point.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {boolean=} opt_reflex Only include reflex points.
* @return {Array.<module:ol/render/webgl/PolygonReplay~PolygonVertex>} Points in the triangle.
* @return {Array<module:ol/render/webgl/PolygonReplay~PolygonVertex>} Points in the triangle.
*/
getPointsInTriangle_(p0, p1, p2, rtree, opt_reflex) {
const result = [];
@@ -670,7 +670,7 @@ class WebGLPolygonReplay extends WebGLReplay {
* @param {module:ol/render/webgl/PolygonReplay~PolygonSegment} segment Segment.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {boolean=} opt_touch Touching segments should be considered an intersection.
* @return {Array.<module:ol/render/webgl/PolygonReplay~PolygonSegment>} Intersecting segments.
* @return {Array<module:ol/render/webgl/PolygonReplay~PolygonSegment>} Intersecting segments.
*/
getIntersections_(segment, rtree, opt_touch) {
const p0 = segment.p0;
@@ -698,7 +698,7 @@ class WebGLPolygonReplay extends WebGLReplay {
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Third point.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p3 Fourth point.
* @param {boolean=} opt_touch Touching segments should be considered an intersection.
* @return {Array.<number>|undefined} Intersection coordinates.
* @return {Array<number>|undefined} Intersection coordinates.
*/
calculateIntersection_(p0, p1, p2, p3, opt_touch) {
const denom = (p3.y - p2.y) * (p1.x - p0.x) - (p3.x - p2.x) * (p1.y - p0.y);
@@ -1005,7 +1005,7 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {WebGLRenderingContext} gl gl.
* @param {Array.<number>} color Color.
* @param {Array<number>} color Color.
*/
setFillStyle_(gl, color) {
gl.uniform4fv(this.defaultLocations_.u_color, color);

View File

@@ -66,13 +66,13 @@ class WebGLReplay extends VectorContext {
/**
* @private
* @type {Array.<number>}
* @type {Array<number>}
*/
this.tmpMat4_ = create();
/**
* @protected
* @type {Array.<number>}
* @type {Array<number>}
*/
this.indices = [];
@@ -85,20 +85,20 @@ class WebGLReplay extends VectorContext {
/**
* Start index per feature (the index).
* @protected
* @type {Array.<number>}
* @type {Array<number>}
*/
this.startIndices = [];
/**
* Start index per feature (the feature).
* @protected
* @type {Array.<module:ol/Feature|module:ol/render/Feature>}
* @type {Array<module:ol/Feature|module:ol/render/Feature>}
*/
this.startIndicesFeature = [];
/**
* @protected
* @type {Array.<number>}
* @type {Array<number>}
*/
this.vertices = [];

View File

@@ -14,7 +14,7 @@ import WebGLPolygonReplay from '../webgl/PolygonReplay.js';
import WebGLTextReplay from '../webgl/TextReplay.js';
/**
* @type {Array.<number>}
* @type {Array<number>}
*/
const HIT_DETECTION_SIZE = [1, 1];
@@ -160,7 +160,7 @@ class WebGLReplayGroup extends ReplayGroup {
opacity,
skippedFeaturesHash
) {
/** @type {Array.<number>} */
/** @type {Array<number>} */
const zs = Object.keys(this.replaysByZIndex_).map(Number);
zs.sort(numberSafeCompareFunction);
@@ -209,7 +209,7 @@ class WebGLReplayGroup extends ReplayGroup {
oneByOne,
opt_hitExtent
) {
/** @type {Array.<number>} */
/** @type {Array<number>} */
const zs = Object.keys(this.replaysByZIndex_).map(Number);
zs.sort(function(a, b) {
return b - a;

View File

@@ -32,13 +32,13 @@ class WebGLTextReplay extends WebGLTextureReplay {
/**
* @private
* @type {Array.<HTMLCanvasElement>}
* @type {Array<HTMLCanvasElement>}
*/
this.images_ = [];
/**
* @private
* @type {Array.<WebGLTexture>}
* @type {Array<WebGLTexture>}
*/
this.textures_ = [];
@@ -52,7 +52,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
* @private
* @type {{strokeColor: (module:ol/colorlike~ColorLike|null),
* lineCap: (string|undefined),
* lineDash: Array.<number>,
* lineDash: Array<number>,
* lineDashOffset: (number|undefined),
* lineJoin: (string|undefined),
* lineWidth: number,
@@ -209,8 +209,8 @@ class WebGLTextReplay extends WebGLTextureReplay {
/**
* @private
* @param {Array.<string>} lines Label to draw split to lines.
* @return {Array.<number>} Size of the label in pixels.
* @param {Array<string>} lines Label to draw split to lines.
* @return {Array<number>} Size of the label in pixels.
*/
getTextSize_(lines) {
const self = this;
@@ -236,7 +236,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
/**
* @private
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -427,7 +427,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
/**
* @private
* @param {Array.<string|number>} params Array of parameters.
* @param {Array<string|number>} params Array of parameters.
* @return {string} Hash string.
*/
calculateHash_(params) {

View File

@@ -31,13 +31,13 @@ class WebGLTextureReplay extends WebGLReplay {
this.anchorY = undefined;
/**
* @type {Array.<number>}
* @type {Array<number>}
* @protected
*/
this.groupIndices = [];
/**
* @type {Array.<number>}
* @type {Array<number>}
* @protected
*/
this.hitDetectionGroupIndices = [];
@@ -130,7 +130,7 @@ class WebGLTextureReplay extends WebGLReplay {
}
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array<number>} flatCoordinates Flat coordinates.
* @param {number} offset Offset.
* @param {number} end End.
* @param {number} stride Stride.
@@ -233,8 +233,8 @@ class WebGLTextureReplay extends WebGLReplay {
/**
* @protected
* @param {Array.<WebGLTexture>} textures Textures.
* @param {Array.<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>} images Images.
* @param {Array<WebGLTexture>} textures Textures.
* @param {Array<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>} images Images.
* @param {!Object.<string, WebGLTexture>} texturePerImage Texture cache.
* @param {WebGLRenderingContext} gl Gl.
*/
@@ -353,8 +353,8 @@ class WebGLTextureReplay extends WebGLReplay {
* @param {module:ol/webgl/Context} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip.
* @param {Array.<WebGLTexture>} textures Textures.
* @param {Array.<number>} groupIndices Texture group indices.
* @param {Array<WebGLTexture>} textures Textures.
* @param {Array<number>} groupIndices Texture group indices.
*/
drawReplaySkipping(gl, context, skippedFeaturesHash, textures, groupIndices) {
let featureIndex = 0;
@@ -462,14 +462,14 @@ class WebGLTextureReplay extends WebGLReplay {
* @abstract
* @protected
* @param {boolean=} opt_all Return hit detection textures with regular ones.
* @returns {Array.<WebGLTexture>} Textures.
* @returns {Array<WebGLTexture>} Textures.
*/
getTextures(opt_all) {}
/**
* @abstract
* @protected
* @returns {Array.<WebGLTexture>} Textures.
* @returns {Array<WebGLTexture>} Textures.
*/
getHitDetectionTextures() {}
}