diff --git a/src/ol/render/canvas.js b/src/ol/render/canvas.js index 2e34e42b42..fb8a9873c5 100644 --- a/src/ol/render/canvas.js +++ b/src/ol/render/canvas.js @@ -13,6 +13,28 @@ import {create as createTransform} from '../transform.js'; */ +/** + * @typedef {Object} FillStrokeState + * @property {module:ol/colorlike~ColorLike} [currentFillStyle] + * @property {module:ol/colorlike~ColorLike} [currentStrokeStyle] + * @property string{} [currentLineCap] + * @property {Array.} currentLineDash + * @property {number} [currentLineDashOffset] + * @property {string} [currentLineJoin] + * @property {number} [currentLineWidth] + * @property {number} [currentMiterLimit] + * @property {number} [lastStroke] + * @property {module:ol/colorlike~ColorLike} [fillStyle] + * @property {module:ol/colorlike~ColorLike} [strokeStyle] + * @property {string} [lineCap] + * @property {Array.} lineDash + * @property {number} [lineDashOffset] + * @property {string} [lineJoin] + * @property {number} [lineWidth] + * @property {number} [miterLimit] + */ + + /** * @const * @type {string} diff --git a/src/ol/render/canvas/Replay.js b/src/ol/render/canvas/Replay.js index 09a44a0325..fac7974624 100644 --- a/src/ol/render/canvas/Replay.js +++ b/src/ol/render/canvas/Replay.js @@ -147,9 +147,9 @@ const CanvasReplay = function(tolerance, maxExtent, resolution, pixelRatio, over /** * @protected - * @type {ol.CanvasFillStrokeState} + * @type {module:ol/render/canvas~FillStrokeState} */ - this.state = /** @type {ol.CanvasFillStrokeState} */ ({}); + this.state = /** @type {module:ol/render/canvas~FillStrokeState} */ ({}); /** * @private @@ -957,7 +957,7 @@ CanvasReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { /** - * @param {ol.CanvasFillStrokeState} state State. + * @param {module:ol/render/canvas~FillStrokeState} state State. * @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry. * @return {Array.<*>} Fill instruction. */ @@ -973,7 +973,7 @@ CanvasReplay.prototype.createFill = function(state, geometry) { /** - * @param {ol.CanvasFillStrokeState} state State. + * @param {module:ol/render/canvas~FillStrokeState} state State. */ CanvasReplay.prototype.applyStroke = function(state) { this.instructions.push(this.createStroke(state)); @@ -981,7 +981,7 @@ CanvasReplay.prototype.applyStroke = function(state) { /** - * @param {ol.CanvasFillStrokeState} state State. + * @param {module:ol/render/canvas~FillStrokeState} state State. * @return {Array.<*>} Stroke instruction. */ CanvasReplay.prototype.createStroke = function(state) { @@ -995,8 +995,8 @@ CanvasReplay.prototype.createStroke = function(state) { /** - * @param {ol.CanvasFillStrokeState} state State. - * @param {function(this:ol.render.canvas.Replay, ol.CanvasFillStrokeState, (module:ol/geom/Geometry~Geometry|ol.render.Feature)):Array.<*>} createFill Create fill. + * @param {module:ol/render/canvas~FillStrokeState} state State. + * @param {function(this:ol.render.canvas.Replay, module:ol/render/canvas~FillStrokeState, (module:ol/geom/Geometry~Geometry|ol.render.Feature)):Array.<*>} createFill Create fill. * @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry. */ CanvasReplay.prototype.updateFillStyle = function(state, createFill, geometry) { @@ -1011,8 +1011,8 @@ CanvasReplay.prototype.updateFillStyle = function(state, createFill, geometry) { /** - * @param {ol.CanvasFillStrokeState} state State. - * @param {function(this:ol.render.canvas.Replay, ol.CanvasFillStrokeState)} applyStroke Apply stroke. + * @param {module:ol/render/canvas~FillStrokeState} state State. + * @param {function(this:ol.render.canvas.Replay, module:ol/render/canvas~FillStrokeState)} applyStroke Apply stroke. */ CanvasReplay.prototype.updateStrokeStyle = function(state, applyStroke) { const strokeStyle = state.strokeStyle; diff --git a/src/ol/typedefs.js b/src/ol/typedefs.js index e6e3e1db7d..594ed393a8 100644 --- a/src/ol/typedefs.js +++ b/src/ol/typedefs.js @@ -21,28 +21,6 @@ const ol = {}; */ -/** - * @typedef {{currentFillStyle: (module:ol/colorlike~ColorLike|undefined), - * currentStrokeStyle: (module:ol/colorlike~ColorLike|undefined), - * currentLineCap: (string|undefined), - * currentLineDash: Array., - * currentLineDashOffset: (number|undefined), - * currentLineJoin: (string|undefined), - * currentLineWidth: (number|undefined), - * currentMiterLimit: (number|undefined), - * lastStroke: (number|undefined), - * fillStyle: (module:ol/colorlike~ColorLike|undefined), - * strokeStyle: (module:ol/colorlike~ColorLike|undefined), - * lineCap: (string|undefined), - * lineDash: Array., - * lineDashOffset: (number|undefined), - * lineJoin: (string|undefined), - * lineWidth: (number|undefined), - * miterLimit: (number|undefined)}|null} - */ -ol.CanvasFillStrokeState; - - /** * @typedef {{lineCap: string, * lineDash: Array.,