Mark optional property with square brackets

This commit is contained in:
Frederic Junod
2018-03-13 13:26:34 +01:00
parent bb3072153b
commit 403a7bdfc7
7 changed files with 41 additions and 52 deletions

View File

@@ -13,26 +13,23 @@ import {visibleAtResolution} from '../layer/Layer.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {string|undefined} className CSS class name. Default is * @property {string} [className='ol-attribution'] CSS class name.
* `'ol-attribution'`. * @property {Element|string} [target] Specify a target if you
* @property {Element|string|undefined} target Specify a target if you
* want the control to be rendered outside of the map's * want the control to be rendered outside of the map's
* viewport. * viewport.
* @property {boolean|undefined} collapsible Specify if attributions can * @property {boolean} [collapsible=true] Specify if attributions can
* be collapsed. If you use an OSM source, should be set to `false` — see * be collapsed. If you use an OSM source, should be set to `false` — see
* {@link https://www.openstreetmap.org/copyright OSM Copyright} — * {@link https://www.openstreetmap.org/copyright OSM Copyright} —
* Default is `true`. * @property {boolean} [collapsed=true] Specify if attributions should
* @property {boolean|undefined} collapsed Specify if attributions should * be collapsed at startup.
* be collapsed at startup. Default is `true`. * @property {string} [tipLabel='Attributions'] Text label to use for the button tip.
* @property {string|undefined} tipLabel Text label to use for the button * @property {string} [label='i'] Text label to use for the
* tip. Default is `'Attributions'` * collapsed attributions button.
* @property {string|Element|undefined} label Text label to use for the
* collapsed attributions button. Default is `'i'`.
* Instead of text, also an element (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|Element|undefined} collapseLabel Text label to use * @property {string|Element} [collapseLabel='»'] Text label to use
* for the expanded attributions button. Default is `'»'`. * for the expanded attributions button.
* Instead of text, also an element (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @property {function(ol.MapEvent)|undefined} render Function called when * @property {function(ol.MapEvent)} [render] Function called when
* the control should be re-rendered. This is called in a `requestAnimationFrame` * the control should be re-rendered. This is called in a `requestAnimationFrame`
* callback. * callback.
*/ */

View File

@@ -23,18 +23,15 @@ const COORDINATE_FORMAT = 'coordinateFormat';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {string|undefined} className CSS class name. Default is * @property {string} [className='ol-mouse-position'] CSS class name.
* `'ol-mouse-position'`. * @property {module:ol/coordinate~CoordinateFormat} [coordinateFormat] Coordinate format.
* @property {module:ol/coordinate~CoordinateFormat|undefined} coordinateFormat
* Coordinate format.
* @property {ol.ProjectionLike} projection Projection. * @property {ol.ProjectionLike} projection Projection.
* @property {function(ol.MapEvent)|undefined} render Function called when the * @property {function(ol.MapEvent)} [render] Function called when the
* control should be re-rendered. This is called in a `requestAnimationFrame` * control should be re-rendered. This is called in a `requestAnimationFrame`
* callback. * callback.
* @property {Element|string|undefined} target Specify a target if you want the * @property {Element|string} [target] Specify a target if you want the
* control to be rendered outside of the map's viewport. * control to be rendered outside of the map's viewport.
* @property {string|undefined} undefinedHTML Markup for undefined coordinates. * @property {string} [undefinedHTML=''] Markup for undefined coordinates.
* Default is `''` (empty string).
*/ */

View File

@@ -38,26 +38,22 @@ const MIN_RATIO = 0.1;
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {boolean|undefined} collapsed Whether the control should start collapsed * @property {boolean} [collapsed=true] Whether the control should start collapsed
* or not (expanded). Default to `true`. * or not (expanded).
* @property {string|Element|undefined} collapseLabel Text label to use for the * @property {string|Element} [collapseLabel='«'] Text label to use for the
* expanded overviewmap button. Default is `'«'`. Instead of text, also an element * expanded overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.
* (e.g. a `span` element) can be used. * @property {boolean} [collapsible=true] Whether the control can be collapsed or not.
* @property {boolean|undefined} collapsible Whether the control can be collapsed * @property {string|Element} [label='»'] Text label to use for the collapsed
* or not. Default to `true`. * overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|Element|undefined} label Text label to use for the collapsed * @property {Array.<ol.layer.Layer>|ol.Collection.<ol.layer.Layer>} [layers]
* overviewmap button. Default is `'»'`. Instead of text, also an element
* (e.g. a `span` element) can be used.
* @property {Array.<ol.layer.Layer>|ol.Collection.<ol.layer.Layer>|undefined} layers
* Layers for the overview map. If not set, then all main map layers are used * Layers for the overview map. If not set, then all main map layers are used
* instead. * instead.
* @property {function(ol.MapEvent)|undefined} render Function called when the control * @property {function(ol.MapEvent)} [render] Function called when the control
* should be re-rendered. This is called in a `requestAnimationFrame` callback. * should be re-rendered. This is called in a `requestAnimationFrame` callback.
* @property {Element|string|undefined} target Specify a target if you want the control * @property {Element|string} [target] Specify a target if you want the control
* to be rendered outside of the map's viewport. * to be rendered outside of the map's viewport.
* @property {string|undefined} tipLabel Text label to use for the button tip. Default * @property {string} [tipLabel='Overview map'] Text label to use for the button tip.
* is `'Overview map'`. * @property {ol.View} [view] Custom view for the overview map. If not provided,
* @property {ol.View|undefined} view Custom view for the overview map. If not provided,
* a default view with an EPSG:3857 projection will be used. * a default view with an EPSG:3857 projection will be used.
*/ */

View File

@@ -18,7 +18,7 @@ import {inherits} from '../index.js';
* @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip. * @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip.
* @property {number} [duration=250] Animation duration in milliseconds. * @property {number} [duration=250] Animation duration in milliseconds.
* @property {boolean} [autoHide=true] Hide the control when rotation is 0. * @property {boolean} [autoHide=true] Hide the control when rotation is 0.
* @property {function(ol.MapEvent)|undefined} render Function called when the control should * @property {function(ol.MapEvent)} [render] Function called when the control should
* be re-rendered. This is called in a `requestAnimationFrame` callback. * be re-rendered. This is called in a `requestAnimationFrame` callback.
* @property {function()} [resetNorth] Function called when the control is clicked. * @property {function()} [resetNorth] Function called when the control is clicked.
* This will override the default `resetNorth`. * This will override the default `resetNorth`.

View File

@@ -27,13 +27,13 @@ const LEADING_DIGITS = [1, 2, 5];
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {string|undefined} className CSS Class name. Default is `'ol-scale-line'`. * @property {string} [className='ol-scale-line'] CSS Class name.
* @property {number|undefined} minWidth Minimum width in pixels. Default is `64`. * @property {number} [minWidth=64] Minimum width in pixels.
* @property {function(ol.MapEvent)|undefined} render Function called when the control * @property {function(ol.MapEvent)} [render] Function called when the control
* should be re-rendered. This is called in a `requestAnimationFrame` callback. * should be re-rendered. This is called in a `requestAnimationFrame` callback.
* @property {Element|string|undefined} target Specify a target if you want the control * @property {Element|string} [target] Specify a target if you want the control
* to be rendered outside of the map's viewport. * to be rendered outside of the map's viewport.
* @property {ol.control.ScaleLineUnits|string|undefined} units Units. Default is `'metric'`. * @property {ol.control.ScaleLineUnits|string} [units='metric'] Units.
*/ */

View File

@@ -31,7 +31,7 @@ const Direction = {
* @property {number} [duration=200] Animation duration in milliseconds. * @property {number} [duration=200] Animation duration in milliseconds.
* @property {number|undefined} maxResolution Maximum resolution. * @property {number|undefined} maxResolution Maximum resolution.
* @property {number|undefined} minResolution Minimum resolution. * @property {number|undefined} minResolution Minimum resolution.
* @property {function(ol.MapEvent)|undefined} render Function called when the control * @property {function(ol.MapEvent)} [render] Function called when the control
* should be re-rendered. This is called in a `requestAnimationFrame` callback. * should be re-rendered. This is called in a `requestAnimationFrame` callback.
*/ */

View File

@@ -10,14 +10,13 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {string|undefined} className Class name. Default is `'ol-zoom-extent'`. * @property {string} [className='ol-zoom-extent'] Class name.
* @property {Element|string|undefined} target Specify a target if you want the control * @property {Element|string} [target] Specify a target if you want the control
* to be rendered outside of the map's viewport. * to be rendered outside of the map's viewport.
* @property {string|Element|undefined} label Text label to use for the button. Default * @property {string|Element} [label='E'] Text label to use for the button.
* is `'E'`. Instead of text, also an element (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|undefined} tipLabel Text label to use for the button tip. Default * @property {string} [tipLabel='Zoom to extent'] Text label to use for the button tip.
* is `'Zoom to extent'`. * @property {ol.Extent} [extent] The extent to zoom to. If undefined the validity
* @property {ol.Extent|undefined} extent The extent to zoom to. If undefined the validity
* extent of the view projection is used. * extent of the view projection is used.
*/ */