Transformed types

Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e):

    jscodeshift --transform ts.js src
This commit is contained in:
Tim Schaub
2018-09-05 08:05:29 -06:00
parent f2aaaa19e1
commit ccfacc5ee6
239 changed files with 3999 additions and 3999 deletions

View File

@@ -18,14 +18,14 @@ import WebGLBuffer from '../../webgl/Buffer.js';
class WebGLCircleReplay extends WebGLReplay {
/**
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @param {import("../../extent.js").Extent} maxExtent Max extent.
*/
constructor(tolerance, maxExtent) {
super(tolerance, maxExtent);
/**
* @private
* @type {module:ol/render/webgl/circlereplay/defaultshader/Locations}
* @type {import("./circlereplay/defaultshader/Locations.js").default}
*/
this.defaultLocations_ = null;
@@ -172,7 +172,7 @@ class WebGLCircleReplay extends WebGLReplay {
getDeleteResourcesFunction(context) {
// We only delete our stuff here. The shaders and the program may
// be used by other CircleReplay instances (for other layers). And
// they will be deleted when disposing of the module:ol/webgl/Context~WebGLContext
// they will be deleted when disposing of the import("../../webgl/Context.js").WebGLContext
// object.
const verticesBuffer = this.verticesBuffer;
const indicesBuffer = this.indicesBuffer;
@@ -296,7 +296,7 @@ class WebGLCircleReplay extends WebGLReplay {
/**
* @private
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {Object} skippedFeaturesHash Ids of features to skip.
*/
drawReplaySkipping_(gl, context, skippedFeaturesHash) {

View File

@@ -8,7 +8,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
class WebGLImageReplay extends WebGLTextureReplay {
/**
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @param {import("../../extent.js").Extent} maxExtent Max extent.
*/
constructor(tolerance, maxExtent) {
super(tolerance, maxExtent);

View File

@@ -10,12 +10,12 @@ import WebGLReplayGroup from '../webgl/ReplayGroup.js';
class WebGLImmediateRenderer extends VectorContext {
/**
* @param {module:ol/webgl/Context} context Context.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {import("../../coordinate.js").Coordinate} center Center.
* @param {number} resolution Resolution.
* @param {number} rotation Rotation.
* @param {module:ol/size~Size} size Size.
* @param {module:ol/extent~Extent} extent Extent.
* @param {import("../../size.js").Size} size Size.
* @param {import("../../extent.js").Extent} extent Extent.
* @param {number} pixelRatio Pixel ratio.
*/
constructor(context, center, resolution, rotation, size, extent, pixelRatio) {
@@ -58,38 +58,38 @@ class WebGLImmediateRenderer extends VectorContext {
/**
* @private
* @type {module:ol/style/Image}
* @type {import("../../style/Image.js").default}
*/
this.imageStyle_ = null;
/**
* @private
* @type {module:ol/style/Fill}
* @type {import("../../style/Fill.js").default}
*/
this.fillStyle_ = null;
/**
* @private
* @type {module:ol/style/Stroke}
* @type {import("../../style/Stroke.js").default}
*/
this.strokeStyle_ = null;
/**
* @private
* @type {module:ol/style/Text}
* @type {import("../../style/Text.js").default}
*/
this.textStyle_ = null;
}
/**
* @param {module:ol/render/webgl/ReplayGroup} replayGroup Replay group.
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
* @param {import("./ReplayGroup.js").default} replayGroup Replay group.
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry.
* @private
*/
drawText_(replayGroup, geometry) {
const context = this.context_;
const replay = /** @type {module:ol/render/webgl/TextReplay} */ (
const replay = /** @type {import("./TextReplay.js").default} */ (
replayGroup.getReplay(0, ReplayType.TEXT));
replay.setTextStyle(this.textStyle_);
replay.drawText(geometry, null);
@@ -109,7 +109,7 @@ class WebGLImmediateRenderer extends VectorContext {
* Set the rendering style. Note that since this is an immediate rendering API,
* any `zIndex` on the provided style will be ignored.
*
* @param {module:ol/style/Style} style The rendering style.
* @param {import("../../style/Style.js").default} style The rendering style.
* @override
* @api
*/
@@ -123,7 +123,7 @@ class WebGLImmediateRenderer extends VectorContext {
* Render a geometry into the canvas. Call
* {@link ol/render/webgl/Immediate#setStyle} first to set the rendering style.
*
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry The geometry to render.
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry The geometry to render.
* @override
* @api
*/
@@ -131,28 +131,28 @@ class WebGLImmediateRenderer extends VectorContext {
const type = geometry.getType();
switch (type) {
case GeometryType.POINT:
this.drawPoint(/** @type {module:ol/geom/Point} */ (geometry), null);
this.drawPoint(/** @type {import("../../geom/Point.js").default} */ (geometry), null);
break;
case GeometryType.LINE_STRING:
this.drawLineString(/** @type {module:ol/geom/LineString} */ (geometry), null);
this.drawLineString(/** @type {import("../../geom/LineString.js").default} */ (geometry), null);
break;
case GeometryType.POLYGON:
this.drawPolygon(/** @type {module:ol/geom/Polygon} */ (geometry), null);
this.drawPolygon(/** @type {import("../../geom/Polygon.js").default} */ (geometry), null);
break;
case GeometryType.MULTI_POINT:
this.drawMultiPoint(/** @type {module:ol/geom/MultiPoint} */ (geometry), null);
this.drawMultiPoint(/** @type {import("../../geom/MultiPoint.js").default} */ (geometry), null);
break;
case GeometryType.MULTI_LINE_STRING:
this.drawMultiLineString(/** @type {module:ol/geom/MultiLineString} */ (geometry), null);
this.drawMultiLineString(/** @type {import("../../geom/MultiLineString.js").default} */ (geometry), null);
break;
case GeometryType.MULTI_POLYGON:
this.drawMultiPolygon(/** @type {module:ol/geom/MultiPolygon} */ (geometry), null);
this.drawMultiPolygon(/** @type {import("../../geom/MultiPolygon.js").default} */ (geometry), null);
break;
case GeometryType.GEOMETRY_COLLECTION:
this.drawGeometryCollection(/** @type {module:ol/geom/GeometryCollection} */ (geometry), null);
this.drawGeometryCollection(/** @type {import("../../geom/GeometryCollection.js").default} */ (geometry), null);
break;
case GeometryType.CIRCLE:
this.drawCircle(/** @type {module:ol/geom/Circle} */ (geometry), null);
this.drawCircle(/** @type {import("../../geom/Circle.js").default} */ (geometry), null);
break;
default:
// pass
@@ -189,7 +189,7 @@ class WebGLImmediateRenderer extends VectorContext {
drawPoint(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {module:ol/render/webgl/ImageReplay} */ (
const replay = /** @type {import("./ImageReplay.js").default} */ (
replayGroup.getReplay(0, ReplayType.IMAGE));
replay.setImageStyle(this.imageStyle_);
replay.drawPoint(geometry, data);
@@ -215,7 +215,7 @@ class WebGLImmediateRenderer extends VectorContext {
drawMultiPoint(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {module:ol/render/webgl/ImageReplay} */ (
const replay = /** @type {import("./ImageReplay.js").default} */ (
replayGroup.getReplay(0, ReplayType.IMAGE));
replay.setImageStyle(this.imageStyle_);
replay.drawMultiPoint(geometry, data);
@@ -240,7 +240,7 @@ class WebGLImmediateRenderer extends VectorContext {
drawLineString(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {module:ol/render/webgl/LineStringReplay} */ (
const replay = /** @type {import("./LineStringReplay.js").default} */ (
replayGroup.getReplay(0, ReplayType.LINE_STRING));
replay.setFillStrokeStyle(null, this.strokeStyle_);
replay.drawLineString(geometry, data);
@@ -265,7 +265,7 @@ class WebGLImmediateRenderer extends VectorContext {
drawMultiLineString(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {module:ol/render/webgl/LineStringReplay} */ (
const replay = /** @type {import("./LineStringReplay.js").default} */ (
replayGroup.getReplay(0, ReplayType.LINE_STRING));
replay.setFillStrokeStyle(null, this.strokeStyle_);
replay.drawMultiLineString(geometry, data);
@@ -290,7 +290,7 @@ class WebGLImmediateRenderer extends VectorContext {
drawPolygon(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {module:ol/render/webgl/PolygonReplay} */ (
const replay = /** @type {import("./PolygonReplay.js").default} */ (
replayGroup.getReplay(0, ReplayType.POLYGON));
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
replay.drawPolygon(geometry, data);
@@ -315,7 +315,7 @@ class WebGLImmediateRenderer extends VectorContext {
drawMultiPolygon(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {module:ol/render/webgl/PolygonReplay} */ (
const replay = /** @type {import("./PolygonReplay.js").default} */ (
replayGroup.getReplay(0, ReplayType.POLYGON));
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
replay.drawMultiPolygon(geometry, data);
@@ -340,7 +340,7 @@ class WebGLImmediateRenderer extends VectorContext {
drawCircle(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {module:ol/render/webgl/CircleReplay} */ (
const replay = /** @type {import("./CircleReplay.js").default} */ (
replayGroup.getReplay(0, ReplayType.CIRCLE));
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
replay.drawCircle(geometry, data);

View File

@@ -38,14 +38,14 @@ const Instruction = {
class WebGLLineStringReplay extends WebGLReplay {
/**
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @param {import("../../extent.js").Extent} maxExtent Max extent.
*/
constructor(tolerance, maxExtent) {
super(tolerance, maxExtent);
/**
* @private
* @type {module:ol/render/webgl/linestringreplay/defaultshader/Locations}
* @type {import("./linestringreplay/defaultshader/Locations.js").default}
*/
this.defaultLocations_ = null;
@@ -386,7 +386,7 @@ class WebGLLineStringReplay extends WebGLReplay {
}
/**
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
* @param {number=} opt_index Index count.
*/
setPolygonStyle(feature, opt_index) {
@@ -532,7 +532,7 @@ class WebGLLineStringReplay extends WebGLReplay {
/**
* @private
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {Object} skippedFeaturesHash Ids of features to skip.
*/
drawReplaySkipping_(gl, context, skippedFeaturesHash) {

View File

@@ -31,15 +31,15 @@ import WebGLBuffer from '../../webgl/Buffer.js';
/**
* @typedef {Object} PolygonSegment
* @property {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0
* @property {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1
* @property {PolygonVertex} p0
* @property {PolygonVertex} p1
*/
class WebGLPolygonReplay extends WebGLReplay {
/**
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @param {import("../../extent.js").Extent} maxExtent Max extent.
*/
constructor(tolerance, maxExtent) {
super(tolerance, maxExtent);
@@ -49,7 +49,7 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @type {module:ol/render/webgl/polygonreplay/defaultshader/Locations}
* @type {import("./polygonreplay/defaultshader/Locations.js").default}
*/
this.defaultLocations_ = null;
@@ -143,8 +143,8 @@ class WebGLPolygonReplay extends WebGLReplay {
* @private
* @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.
* @param {import("../../structs/LinkedList.js").default} list Linked list.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
* @param {boolean} clockwise Coordinate order should be clockwise.
*/
processFlatCoordinates_(flatCoordinates, stride, list, rtree, clockwise) {
@@ -152,11 +152,11 @@ class WebGLPolygonReplay extends WebGLReplay {
0, flatCoordinates.length, stride);
let i, ii;
let n = this.vertices.length / 2;
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
/** @type {PolygonVertex} */
let start;
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
/** @type {PolygonVertex} */
let p0;
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
/** @type {PolygonVertex} */
let p1;
const extents = [];
const segments = [];
@@ -194,7 +194,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.
* @param {import("../../structs/LinkedList.js").default} list Polygons ring.
* @return {Array<number>} Max X coordinates.
*/
getMaxCoords_(list) {
@@ -215,8 +215,8 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* Classifies the points of a polygon list as convex, reflex. Removes collinear vertices.
* @private
* @param {module:ol/structs/LinkedList} list Polygon ring.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {import("../../structs/LinkedList.js").default} list Polygon ring.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
* @param {boolean} ccw The orientation of the polygon is counter-clockwise.
* @return {boolean} There were reclassified points.
*/
@@ -250,11 +250,11 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/structs/LinkedList} hole Linked list of the hole.
* @param {import("../../structs/LinkedList.js").default} hole Linked list of the hole.
* @param {number} holeMaxX Maximum X value of the hole.
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
* @param {number} listMaxX Maximum X value of the polygon.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
* @return {boolean} Bridging was successful.
*/
bridgeHole_(hole, holeMaxX, list, listMaxX, rtree) {
@@ -264,11 +264,11 @@ class WebGLPolygonReplay extends WebGLReplay {
}
const p1 = seg.p1;
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
/** @type {PolygonVertex} */
const p2 = {x: listMaxX, y: p1.y, i: -1};
let minDist = Infinity;
let i, ii, bestPoint;
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
/** @type {PolygonVertex} */
let p5;
const intersectingSegments = this.getIntersections_({p0: p1, p1: p2}, rtree, true);
@@ -325,8 +325,8 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
*/
triangulate_(list, rtree) {
let ccw = false;
@@ -374,8 +374,8 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
* @param {boolean} simple The polygon is simple.
* @param {boolean} ccw Orientation of the polygon is counter-clockwise.
* @return {boolean} There were processed ears.
@@ -432,8 +432,8 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
* @param {boolean=} opt_touch Resolve touching segments.
* @return {boolean} There were resolved intersections.
*/
@@ -499,8 +499,8 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
* @return {boolean} The polygon is simple.
*/
isSimple_(list, rtree) {
@@ -517,7 +517,7 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
* @return {boolean} Orientation is clockwise.
*/
isClockwise_(list) {
@@ -536,8 +536,8 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
*/
splitPolygon_(list, rtree) {
const start = list.firstItem();
@@ -582,13 +582,13 @@ class WebGLPolygonReplay extends WebGLReplay {
* @param {number} x X coordinate.
* @param {number} y Y coordinate.
* @param {number} i Index.
* @return {module:ol/render/webgl/PolygonReplay~PolygonVertex} List item.
* @return {PolygonVertex} List item.
*/
createPoint_(x, y, i) {
let numVertices = this.vertices.length;
this.vertices[numVertices++] = x;
this.vertices[numVertices++] = y;
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
/** @type {PolygonVertex} */
const p = {
x: x,
y: y,
@@ -600,11 +600,11 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0 First point of segment.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1 Second point of segment.
* @param {module:ol/structs/LinkedList} list Polygon ring.
* @param {module:ol/structs/RBush=} opt_rtree Insert the segment into the R-Tree.
* @return {module:ol/render/webgl/PolygonReplay~PolygonSegment} segment.
* @param {PolygonVertex} p0 First point of segment.
* @param {PolygonVertex} p1 Second point of segment.
* @param {import("../../structs/LinkedList.js").default} list Polygon ring.
* @param {import("../../structs/RBush.js").default=} opt_rtree Insert the segment into the R-Tree.
* @return {PolygonSegment} segment.
*/
insertItem_(p0, p1, list, opt_rtree) {
const seg = {
@@ -621,10 +621,10 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/render/webgl/PolygonReplay~PolygonSegment} s0 Segment before the remove candidate.
* @param {module:ol/render/webgl/PolygonReplay~PolygonSegment} s1 Remove candidate segment.
* @param {module:ol/structs/LinkedList} list Polygon ring.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {PolygonSegment} s0 Segment before the remove candidate.
* @param {PolygonSegment} s1 Remove candidate segment.
* @param {import("../../structs/LinkedList.js").default} list Polygon ring.
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
*/
removeItem_(s0, s1, list, rtree) {
if (list.getCurrItem() === s1) {
@@ -638,12 +638,12 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0 First point.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1 Second point.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Third point.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {PolygonVertex} p0 First point.
* @param {PolygonVertex} p1 Second point.
* @param {PolygonVertex} p2 Third point.
* @param {import("../../structs/RBush.js").default} 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<PolygonVertex>} Points in the triangle.
*/
getPointsInTriangle_(p0, p1, p2, rtree, opt_reflex) {
const result = [];
@@ -667,10 +667,10 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/render/webgl/PolygonReplay~PolygonSegment} segment Segment.
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
* @param {PolygonSegment} segment Segment.
* @param {import("../../structs/RBush.js").default} 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<PolygonSegment>} Intersecting segments.
*/
getIntersections_(segment, rtree, opt_touch) {
const p0 = segment.p0;
@@ -693,10 +693,10 @@ class WebGLPolygonReplay extends WebGLReplay {
* See http://paulbourke.net/geometry/pointlineplane/.
*
* @private
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0 First point.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1 Second point.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Third point.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p3 Fourth point.
* @param {PolygonVertex} p0 First point.
* @param {PolygonVertex} p1 Second point.
* @param {PolygonVertex} p2 Third point.
* @param {PolygonVertex} p3 Fourth point.
* @param {boolean=} opt_touch Touching segments should be considered an intersection.
* @return {Array<number>|undefined} Intersection coordinates.
*/
@@ -716,11 +716,11 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0 Point before the start of the diagonal.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1 Start point of the diagonal.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Ear candidate.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p3 End point of the diagonal.
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p4 Point after the end of the diagonal.
* @param {PolygonVertex} p0 Point before the start of the diagonal.
* @param {PolygonVertex} p1 Start point of the diagonal.
* @param {PolygonVertex} p2 Ear candidate.
* @param {PolygonVertex} p3 End point of the diagonal.
* @param {PolygonVertex} p4 Point after the end of the diagonal.
* @return {boolean} Diagonal is inside the polygon.
*/
diagonalIsInside_(p0, p1, p2, p3, p4) {
@@ -966,7 +966,7 @@ class WebGLPolygonReplay extends WebGLReplay {
/**
* @private
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {Object} skippedFeaturesHash Ids of features to skip.
*/
drawReplaySkipping_(gl, context, skippedFeaturesHash) {

View File

@@ -18,7 +18,7 @@ import {ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, TRIANGLES,
class WebGLReplay extends VectorContext {
/**
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @param {import("../../extent.js").Extent} maxExtent Max extent.
*/
constructor(tolerance, maxExtent) {
super();
@@ -32,7 +32,7 @@ class WebGLReplay extends VectorContext {
/**
* @protected
* @const
* @type {module:ol/extent~Extent}
* @type {import("../../extent.js").Extent}
*/
this.maxExtent = maxExtent;
@@ -42,25 +42,25 @@ class WebGLReplay extends VectorContext {
* we use the "Rendering Relative to Eye" technique described in the "3D
* Engine Design for Virtual Globes" book.
* @protected
* @type {module:ol/coordinate~Coordinate}
* @type {import("../../coordinate.js").Coordinate}
*/
this.origin = getCenter(maxExtent);
/**
* @private
* @type {module:ol/transform~Transform}
* @type {import("../../transform.js").Transform}
*/
this.projectionMatrix_ = createTransform();
/**
* @private
* @type {module:ol/transform~Transform}
* @type {import("../../transform.js").Transform}
*/
this.offsetRotateMatrix_ = createTransform();
/**
* @private
* @type {module:ol/transform~Transform}
* @type {import("../../transform.js").Transform}
*/
this.offsetScaleMatrix_ = createTransform();
@@ -78,7 +78,7 @@ class WebGLReplay extends VectorContext {
/**
* @protected
* @type {?module:ol/webgl/Buffer}
* @type {?import("../../webgl/Buffer.js").default}
*/
this.indicesBuffer = null;
@@ -92,7 +92,7 @@ class WebGLReplay extends VectorContext {
/**
* Start index per feature (the feature).
* @protected
* @type {Array<module:ol/Feature|module:ol/render/Feature>}
* @type {Array<import("../../Feature.js").default|import("../Feature.js").default>}
*/
this.startIndicesFeature = [];
@@ -104,14 +104,14 @@ class WebGLReplay extends VectorContext {
/**
* @protected
* @type {?module:ol/webgl/Buffer}
* @type {?import("../../webgl/Buffer.js").default}
*/
this.verticesBuffer = null;
/**
* Optional parameter for PolygonReplay instances.
* @protected
* @type {module:ol/render/webgl/LineStringReplay|undefined}
* @type {import("./LineStringReplay.js").default|undefined}
*/
this.lineStringReplay = undefined;
@@ -119,14 +119,14 @@ class WebGLReplay extends VectorContext {
/**
* @abstract
* @param {module:ol/webgl/Context} context WebGL context.
* @param {import("../../webgl/Context.js").default} context WebGL context.
* @return {function()} Delete resources function.
*/
getDeleteResourcesFunction(context) {}
/**
* @abstract
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
*/
finish(context) {}
@@ -134,13 +134,13 @@ class WebGLReplay extends VectorContext {
* @abstract
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {module:ol/size~Size} size Size.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {import("../../size.js").Size} size Size.
* @param {number} pixelRatio Pixel ratio.
* @return {module:ol/render/webgl/circlereplay/defaultshader/Locations|
module:ol/render/webgl/linestringreplay/defaultshader/Locations|
module:ol/render/webgl/polygonreplay/defaultshader/Locations|
module:ol/render/webgl/texturereplay/defaultshader/Locations} Locations.
* @return {import("./circlereplay/defaultshader/Locations.js").default|
import("./linestringreplay/defaultshader/Locations.js").default|
import("./polygonreplay/defaultshader/Locations.js").default|
import("./texturereplay/defaultshader/Locations.js").default} Locations.
*/
setUpProgram(gl, context, size, pixelRatio) {}
@@ -148,10 +148,10 @@ class WebGLReplay extends VectorContext {
* @abstract
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/render/webgl/circlereplay/defaultshader/Locations|
module:ol/render/webgl/linestringreplay/defaultshader/Locations|
module:ol/render/webgl/polygonreplay/defaultshader/Locations|
module:ol/render/webgl/texturereplay/defaultshader/Locations} locations Locations.
* @param {import("./circlereplay/defaultshader/Locations.js").default|
import("./linestringreplay/defaultshader/Locations.js").default|
import("./polygonreplay/defaultshader/Locations.js").default|
import("./texturereplay/defaultshader/Locations.js").default} locations Locations.
*/
shutDownProgram(gl, locations) {}
@@ -159,7 +159,7 @@ class WebGLReplay extends VectorContext {
* @abstract
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {boolean} hitDetection Hit detection mode.
*/
@@ -169,10 +169,10 @@ class WebGLReplay extends VectorContext {
* @abstract
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
* @param {import("../../extent.js").Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
* @return {T|undefined} Callback result.
* @template T
*/
@@ -181,11 +181,11 @@ class WebGLReplay extends VectorContext {
/**
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
* @param {import("../../extent.js").Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
* @return {T|undefined} Callback result.
* @template T
*/
@@ -204,9 +204,9 @@ class WebGLReplay extends VectorContext {
/**
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
* @return {T|undefined} Callback result.
* @template T
*/
@@ -223,17 +223,17 @@ class WebGLReplay extends VectorContext {
}
/**
* @param {module:ol/webgl/Context} context Context.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {import("../../coordinate.js").Coordinate} center Center.
* @param {number} resolution Resolution.
* @param {number} rotation Rotation.
* @param {module:ol/size~Size} size Size.
* @param {import("../../size.js").Size} size Size.
* @param {number} pixelRatio Pixel ratio.
* @param {number} opacity Global opacity.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
* @param {import("../../extent.js").Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
* @return {T|undefined} Callback result.
* @template T
*/
@@ -338,7 +338,7 @@ class WebGLReplay extends VectorContext {
/**
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {number} start Start index.
* @param {number} end End index.
*/

View File

@@ -19,9 +19,9 @@ import WebGLTextReplay from '../webgl/TextReplay.js';
const HIT_DETECTION_SIZE = [1, 1];
/**
* @type {Object<module:ol/render/ReplayType,
* function(new: module:ol/render/webgl/Replay, number,
* module:ol/extent~Extent)>}
* @type {Object<import("../ReplayType.js").default,
* function(new: import("./Replay.js").default, number,
* import("../../extent.js").Extent)>}
*/
const BATCH_CONSTRUCTORS = {
'Circle': WebGLCircleReplay,
@@ -35,14 +35,14 @@ const BATCH_CONSTRUCTORS = {
class WebGLReplayGroup extends ReplayGroup {
/**
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @param {import("../../extent.js").Extent} maxExtent Max extent.
* @param {number=} opt_renderBuffer Render buffer.
*/
constructor(tolerance, maxExtent, opt_renderBuffer) {
super();
/**
* @type {module:ol/extent~Extent}
* @type {import("../../extent.js").Extent}
* @private
*/
this.maxExtent_ = maxExtent;
@@ -62,20 +62,20 @@ class WebGLReplayGroup extends ReplayGroup {
/**
* @private
* @type {!Object<string,
* Object<module:ol/render/ReplayType, module:ol/render/webgl/Replay>>}
* Object<import("../ReplayType.js").default, import("./Replay.js").default>>}
*/
this.replaysByZIndex_ = {};
}
/**
* @param {module:ol/style/Style} style Style.
* @param {import("../../style/Style.js").default} style Style.
* @param {boolean} group Group with previous replay.
*/
addDeclutter(style, group) {}
/**
* @param {module:ol/webgl/Context} context WebGL context.
* @param {import("../../webgl/Context.js").default} context WebGL context.
* @return {function()} Delete resources function.
*/
getDeleteResourcesFunction(context) {
@@ -99,7 +99,7 @@ class WebGLReplayGroup extends ReplayGroup {
}
/**
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
*/
finish(context) {
let zKey;
@@ -141,11 +141,11 @@ class WebGLReplayGroup extends ReplayGroup {
}
/**
* @param {module:ol/webgl/Context} context Context.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {import("../../coordinate.js").Coordinate} center Center.
* @param {number} resolution Resolution.
* @param {number} rotation Rotation.
* @param {module:ol/size~Size} size Size.
* @param {import("../../size.js").Size} size Size.
* @param {number} pixelRatio Pixel ratio.
* @param {number} opacity Global opacity.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
@@ -181,17 +181,17 @@ class WebGLReplayGroup extends ReplayGroup {
/**
* @private
* @param {module:ol/webgl/Context} context Context.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {import("../../coordinate.js").Coordinate} center Center.
* @param {number} resolution Resolution.
* @param {number} rotation Rotation.
* @param {module:ol/size~Size} size Size.
* @param {import("../../size.js").Size} size Size.
* @param {number} pixelRatio Pixel ratio.
* @param {number} opacity Global opacity.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting
* @param {import("../../extent.js").Extent=} opt_hitExtent Hit extent: Only features intersecting
* this extent are checked.
* @return {T|undefined} Callback result.
* @template T
@@ -234,16 +234,16 @@ class WebGLReplayGroup extends ReplayGroup {
}
/**
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {module:ol/webgl/Context} context Context.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {import("../../coordinate.js").Coordinate} center Center.
* @param {number} resolution Resolution.
* @param {number} rotation Rotation.
* @param {module:ol/size~Size} size Size.
* @param {import("../../size.js").Size} size Size.
* @param {number} pixelRatio Pixel ratio.
* @param {number} opacity Global opacity.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} callback Feature callback.
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} callback Feature callback.
* @return {T|undefined} Callback result.
* @template T
*/
@@ -265,7 +265,7 @@ class WebGLReplayGroup extends ReplayGroup {
/**
* @type {module:ol/extent~Extent}
* @type {import("../../extent.js").Extent}
*/
let hitExtent;
if (this.renderBuffer_ !== undefined) {
@@ -278,7 +278,7 @@ class WebGLReplayGroup extends ReplayGroup {
coordinate, resolution, rotation, HIT_DETECTION_SIZE,
pixelRatio, opacity, skippedFeaturesHash,
/**
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
* @return {?} Callback result.
*/
function(feature) {
@@ -295,12 +295,12 @@ class WebGLReplayGroup extends ReplayGroup {
}
/**
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {module:ol/webgl/Context} context Context.
* @param {module:ol/coordinate~Coordinate} center Center.
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {import("../../coordinate.js").Coordinate} center Center.
* @param {number} resolution Resolution.
* @param {number} rotation Rotation.
* @param {module:ol/size~Size} size Size.
* @param {import("../../size.js").Size} size Size.
* @param {number} pixelRatio Pixel ratio.
* @param {number} opacity Global opacity.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
@@ -325,7 +325,7 @@ class WebGLReplayGroup extends ReplayGroup {
coordinate, resolution, rotation, HIT_DETECTION_SIZE,
pixelRatio, opacity, skippedFeaturesHash,
/**
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
* @return {boolean} Is there a feature?
*/
function(feature) {

View File

@@ -16,7 +16,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
/**
* @typedef {Object} GlyphAtlas
* @property {module:ol/style/AtlasManager} atlas
* @property {import("../../style/AtlasManager.js").default} atlas
* @property {Object<string, number>} width
* @property {number} height
*/
@@ -25,7 +25,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
class WebGLTextReplay extends WebGLTextureReplay {
/**
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @param {import("../../extent.js").Extent} maxExtent Max extent.
*/
constructor(tolerance, maxExtent) {
super(tolerance, maxExtent);
@@ -50,14 +50,14 @@ class WebGLTextReplay extends WebGLTextureReplay {
/**
* @private
* @type {{strokeColor: (module:ol/colorlike~ColorLike|null),
* @type {{strokeColor: (import("../../colorlike.js").ColorLike|null),
* lineCap: (string|undefined),
* lineDash: Array<number>,
* lineDashOffset: (number|undefined),
* lineJoin: (string|undefined),
* lineWidth: number,
* miterLimit: (number|undefined),
* fillColor: (module:ol/colorlike~ColorLike|null),
* fillColor: (import("../../colorlike.js").ColorLike|null),
* font: (string|undefined),
* scale: (number|undefined)}}
*/
@@ -106,13 +106,13 @@ class WebGLTextReplay extends WebGLTextureReplay {
/**
* @private
* @type {Object<string, module:ol/render/webgl/TextReplay~GlyphAtlas>}
* @type {Object<string, GlyphAtlas>}
*/
this.atlases_ = {};
/**
* @private
* @type {module:ol/render/webgl/TextReplay~GlyphAtlas|undefined}
* @type {GlyphAtlas|undefined}
*/
this.currAtlas_ = undefined;
@@ -139,20 +139,20 @@ class WebGLTextReplay extends WebGLTextureReplay {
stride = geometry.getStride();
break;
case GeometryType.CIRCLE:
flatCoordinates = /** @type {module:ol/geom/Circle} */ (geometry).getCenter();
flatCoordinates = /** @type {import("../../geom/Circle.js").default} */ (geometry).getCenter();
break;
case GeometryType.LINE_STRING:
flatCoordinates = /** @type {module:ol/geom/LineString} */ (geometry).getFlatMidpoint();
flatCoordinates = /** @type {import("../../geom/LineString.js").default} */ (geometry).getFlatMidpoint();
break;
case GeometryType.MULTI_LINE_STRING:
flatCoordinates = /** @type {module:ol/geom/MultiLineString} */ (geometry).getFlatMidpoints();
flatCoordinates = /** @type {import("../../geom/MultiLineString.js").default} */ (geometry).getFlatMidpoints();
end = flatCoordinates.length;
break;
case GeometryType.POLYGON:
flatCoordinates = /** @type {module:ol/geom/Polygon} */ (geometry).getFlatInteriorPoint();
flatCoordinates = /** @type {import("../../geom/Polygon.js").default} */ (geometry).getFlatInteriorPoint();
break;
case GeometryType.MULTI_POLYGON:
flatCoordinates = /** @type {module:ol/geom/MultiPolygon} */ (geometry).getFlatInteriorPoints();
flatCoordinates = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getFlatInteriorPoints();
end = flatCoordinates.length;
break;
default:
@@ -394,7 +394,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
/**
* @private
* @param {Object} state Font attributes.
* @return {module:ol/render/webgl/TextReplay~GlyphAtlas} Glyph atlas.
* @return {GlyphAtlas} Glyph atlas.
*/
getAtlas_(state) {
let params = [];

View File

@@ -13,7 +13,7 @@ import {createTexture} from '../../webgl/Context.js';
class WebGLTextureReplay extends WebGLReplay {
/**
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @param {import("../../extent.js").Extent} maxExtent Max extent.
*/
constructor(tolerance, maxExtent) {
super(tolerance, maxExtent);
@@ -62,7 +62,7 @@ class WebGLTextureReplay extends WebGLReplay {
/**
* @protected
* @type {module:ol/render/webgl/texturereplay/defaultshader/Locations}
* @type {import("./texturereplay/defaultshader/Locations.js").default}
*/
this.defaultLocations = null;
@@ -350,7 +350,7 @@ class WebGLTextureReplay extends WebGLReplay {
*
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {module:ol/webgl/Context} context Context.
* @param {import("../../webgl/Context.js").default} context Context.
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features
* to skip.
* @param {Array<WebGLTexture>} textures Textures.