Module type for ol.ColorLike

This commit is contained in:
Frederic Junod
2018-03-19 09:24:32 +01:00
parent 2d9014ce11
commit f5aa7d7867
5 changed files with 19 additions and 19 deletions

View File

@@ -482,7 +482,7 @@ CanvasReplay.prototype.fill_ = function(context) {
* @param {Array.<*>} instruction Instruction.
*/
CanvasReplay.prototype.setStrokeStyle_ = function(context, instruction) {
context.strokeStyle = /** @type {ol.ColorLike} */ (instruction[1]);
context.strokeStyle = /** @type {module:ol/colorlike~ColorLike} */ (instruction[1]);
context.lineWidth = /** @type {number} */ (instruction[2]);
context.lineCap = /** @type {string} */ (instruction[3]);
context.lineJoin = /** @type {string} */ (instruction[4]);
@@ -814,7 +814,7 @@ CanvasReplay.prototype.replay_ = function(
}
}
context.fillStyle = /** @type {ol.ColorLike} */ (instruction[1]);
context.fillStyle = /** @type {module:ol/colorlike~ColorLike} */ (instruction[1]);
++i;
break;
case CanvasInstruction.SET_STROKE_STYLE:

View File

@@ -44,14 +44,14 @@ const WebGLTextReplay = function(tolerance, maxExtent) {
/**
* @private
* @type {{strokeColor: (ol.ColorLike|null),
* @type {{strokeColor: (module:ol/colorlike~ColorLike|null),
* lineCap: (string|undefined),
* lineDash: Array.<number>,
* lineDashOffset: (number|undefined),
* lineJoin: (string|undefined),
* lineWidth: number,
* miterLimit: (number|undefined),
* fillColor: (ol.ColorLike|null),
* fillColor: (module:ol/colorlike~ColorLike|null),
* font: (string|undefined),
* scale: (number|undefined)}}
*/

View File

@@ -18,7 +18,7 @@ const Fill = function(opt_options) {
/**
* @private
* @type {ol.Color|ol.ColorLike}
* @type {ol.Color|module:ol/colorlike~ColorLike}
*/
this.color_ = options.color !== undefined ? options.color : null;
@@ -31,7 +31,7 @@ const Fill = function(opt_options) {
/**
* Clones the style. The color is not cloned if it is an {@link ol.ColorLike}.
* Clones the style. The color is not cloned if it is an {@link module:ol/colorlike~ColorLike}.
* @return {ol.style.Fill} The cloned style.
* @api
*/
@@ -45,7 +45,7 @@ Fill.prototype.clone = function() {
/**
* Get the fill color.
* @return {ol.Color|ol.ColorLike} Color.
* @return {ol.Color|module:ol/colorlike~ColorLike} Color.
* @api
*/
Fill.prototype.getColor = function() {
@@ -56,7 +56,7 @@ Fill.prototype.getColor = function() {
/**
* Set the color.
*
* @param {ol.Color|ol.ColorLike} color Color.
* @param {ol.Color|module:ol/colorlike~ColorLike} color Color.
* @api
*/
Fill.prototype.setColor = function(color) {

View File

@@ -20,7 +20,7 @@ const Stroke = function(opt_options) {
/**
* @private
* @type {ol.Color|ol.ColorLike}
* @type {ol.Color|module:ol/colorlike~ColorLike}
*/
this.color_ = options.color !== undefined ? options.color : null;
@@ -89,7 +89,7 @@ Stroke.prototype.clone = function() {
/**
* Get the stroke color.
* @return {ol.Color|ol.ColorLike} Color.
* @return {ol.Color|module:ol/colorlike~ColorLike} Color.
* @api
*/
Stroke.prototype.getColor = function() {
@@ -160,7 +160,7 @@ Stroke.prototype.getWidth = function() {
/**
* Set the color.
*
* @param {ol.Color|ol.ColorLike} color Color.
* @param {ol.Color|module:ol/colorlike~ColorLike} color Color.
* @api
*/
Stroke.prototype.setColor = function(color) {

View File

@@ -70,7 +70,7 @@ ol.Attribution;
/**
* @typedef {{fillStyle: ol.ColorLike}}
* @typedef {{fillStyle: module:ol/colorlike~ColorLike}}
*/
ol.CanvasFillState;
@@ -91,8 +91,8 @@ ol.CanvasFunctionType;
/**
* @typedef {{currentFillStyle: (ol.ColorLike|undefined),
* currentStrokeStyle: (ol.ColorLike|undefined),
* @typedef {{currentFillStyle: (module:ol/colorlike~ColorLike|undefined),
* currentStrokeStyle: (module:ol/colorlike~ColorLike|undefined),
* currentLineCap: (string|undefined),
* currentLineDash: Array.<number>,
* currentLineDashOffset: (number|undefined),
@@ -100,8 +100,8 @@ ol.CanvasFunctionType;
* currentLineWidth: (number|undefined),
* currentMiterLimit: (number|undefined),
* lastStroke: (number|undefined),
* fillStyle: (ol.ColorLike|undefined),
* strokeStyle: (ol.ColorLike|undefined),
* fillStyle: (module:ol/colorlike~ColorLike|undefined),
* strokeStyle: (module:ol/colorlike~ColorLike|undefined),
* lineCap: (string|undefined),
* lineDash: Array.<number>,
* lineDashOffset: (number|undefined),
@@ -119,7 +119,7 @@ ol.CanvasFillStrokeState;
* lineJoin: string,
* lineWidth: number,
* miterLimit: number,
* strokeStyle: ol.ColorLike}}
* strokeStyle: module:ol/colorlike~ColorLike}}
*/
ol.CanvasStrokeState;
@@ -133,7 +133,7 @@ ol.CanvasTextState;
/**
* @typedef {{strokeStyle: (ol.ColorLike|undefined), strokeWidth: number,
* @typedef {{strokeStyle: (module:ol/colorlike~ColorLike|undefined), strokeWidth: number,
* size: number, lineDash: Array.<number>}}
*/
ol.CircleRenderOptions;
@@ -223,7 +223,7 @@ ol.RasterOperation;
/**
* @typedef {{
* strokeStyle: (ol.ColorLike|undefined),
* strokeStyle: (module:ol/colorlike~ColorLike|undefined),
* strokeWidth: number,
* size: number,
* lineCap: string,