Fix some types

This commit is contained in:
ahocevar
2018-04-27 00:26:03 +02:00
parent ce84c3bf57
commit 59d904e509
25 changed files with 103 additions and 102 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ const Icon = function(opt_options) {
6); // A defined and non-empty `src` or `image` must be provided
/**
* @type {module:ol/ImageState~ImageState}
* @type {module:ol/ImageState}
*/
const imageState = options.src !== undefined ?
ImageState.IDLE : ImageState.LOADED;
+4 -4
View File
@@ -15,7 +15,7 @@ import {shared as iconImageCache} from '../style/IconImageCache.js';
* @param {string|undefined} src Src.
* @param {module:ol/size~Size} size Size.
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/ImageState~ImageState} imageState Image state.
* @param {module:ol/ImageState} imageState Image state.
* @param {module:ol/color~Color} color Color.
* @extends {module:ol/events/EventTarget}
*/
@@ -61,7 +61,7 @@ const IconImage = function(image, src, size, crossOrigin, imageState, color) {
/**
* @private
* @type {module:ol/ImageState~ImageState}
* @type {module:ol/ImageState}
*/
this.imageState_ = imageState;
@@ -96,7 +96,7 @@ inherits(IconImage, EventTarget);
* @param {string} src Src.
* @param {module:ol/size~Size} size Size.
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/ImageState~ImageState} imageState Image state.
* @param {module:ol/ImageState} imageState Image state.
* @param {module:ol/color~Color} color Color.
* @return {module:ol/style/IconImage} Icon image.
*/
@@ -169,7 +169,7 @@ IconImage.prototype.getImage = function(pixelRatio) {
/**
* @return {module:ol/ImageState~ImageState} Image state.
* @return {module:ol/ImageState} Image state.
*/
IconImage.prototype.getImageState = function() {
return this.imageState_;
+1 -1
View File
@@ -137,7 +137,7 @@ ImageStyle.prototype.getHitDetectionImage = function(pixelRatio) {};
/**
* @abstract
* @return {module:ol/ImageState~ImageState} Image state.
* @return {module:ol/ImageState} Image state.
*/
ImageStyle.prototype.getImageState = function() {};
+14 -2
View File
@@ -7,6 +7,18 @@ import CircleStyle from '../style/Circle.js';
import Fill from '../style/Fill.js';
import Stroke from '../style/Stroke.js';
/**
* A function that takes an {@link module:ol/Feature} and a `{number}`
* representing the view's resolution. The function should return a
* {@link module:ol/style/Style} or an array of them. This way e.g. a
* vector layer can be styled.
*
* @typedef {function((module:ol/Feature|module:ol/render/Feature), number):
* (module:ol/style/Style|Array.<module:ol/style/Style>)} Function
*/
/**
* A function that takes an {@link module:ol/Feature} as argument and returns an
* {@link module:ol/geom/Geometry} that will be rendered and styled for the feature.
@@ -312,9 +324,9 @@ Style.prototype.setZIndex = function(zIndex) {
* Convert the provided object into a style function. Functions passed through
* unchanged. Arrays of module:ol/style/Style or single style objects wrapped in a
* new style function.
* @param {module:ol/style~StyleFunction|Array.<module:ol/style/Style>|module:ol/style/Style} obj
* @param {module:ol/style/Style~Function|Array.<module:ol/style/Style>|module:ol/style/Style} obj
* A style function, a single style, or an array of styles.
* @return {module:ol/style~StyleFunction} A style function.
* @return {module:ol/style/Style~Function} A style function.
*/
export function toFunction(obj) {
let styleFunction;
+4 -4
View File
@@ -24,7 +24,7 @@ const DEFAULT_FILL_COLOR = '#333';
* @property {number} [offsetY=0] Vertical text offset in pixels. A positive will shift the text down.
* @property {boolean} [overflow=false] For polygon labels or when `placement` is set to `'line'`, allow text to exceed
* the width of the polygon at the label position or the length of the path that it follows.
* @property {module:ol/style/TextPlacement~TextPlacement|string} [placement] Text placement.
* @property {module:ol/style/TextPlacement|string} [placement] Text placement.
* @property {number} [scale] Scale.
* @property {boolean} [rotateWithView=false] Whether to rotate the text with the view.
* @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).
@@ -114,7 +114,7 @@ const Text = function(opt_options) {
/**
* @private
* @type {module:ol/style/TextPlacement~TextPlacement|string}
* @type {module:ol/style/TextPlacement|string}
*/
this.placement_ = options.placement !== undefined ? options.placement : TextPlacement.POINT;
@@ -221,7 +221,7 @@ Text.prototype.getMaxAngle = function() {
/**
* Get the label placement.
* @return {module:ol/style/TextPlacement~TextPlacement|string} Text placement.
* @return {module:ol/style/TextPlacement|string} Text placement.
* @api
*/
Text.prototype.getPlacement = function() {
@@ -417,7 +417,7 @@ Text.prototype.setOffsetY = function(offsetY) {
/**
* Set the text placement.
*
* @param {module:ol/style/TextPlacement~TextPlacement|string} placement Placement.
* @param {module:ol/style/TextPlacement|string} placement Placement.
* @api
*/
Text.prototype.setPlacement = function(placement) {