Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark optional property with square brackets #7975

Merged
merged 1 commit into from Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/ol/View.js
Expand Up @@ -146,9 +146,8 @@ import Units from './proj/Units.js';
* the animation.
* @property {ol.Coordinate|undefined} anchor Optional anchor to remained fixed
* during a rotation or resolution animation.
* @property {number|undefined} duration The duration of the animation in milliseconds
* (defaults to `1000`).
* @property {undefined|function(number):number} easing The easing function used
* @property {number|undefined} [duration=1000] The duration of the animation in milliseconds.
* @property {undefined|function(number):number} [easing] The easing function used
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry for the inaccurate review. You should have removed the undefined in all places where you set the type in square parentheses. The babel-plugin-closure-jsdoc will resolve that to the correct type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will do a follow-up pr

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #7979

* during the animation (defaults to {@link ol.easing.inAndOut}).
* The function will be called for each frame with a number representing a
* fraction of the animation's duration. The function should return a number
Expand Down
17 changes: 8 additions & 9 deletions src/ol/control/Rotate.js
Expand Up @@ -12,18 +12,17 @@ import {inherits} from '../index.js';

/**
* @typedef {Object} Options
* @property {string|undefined} className CSS class name. Default is `'ol-rotate'`.
* @property {string|Element|undefined} label Text label to use for the rotate button.
* Default is `'⇧'`. Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|undefined} tipLabel Text label to use for the rotate tip. Default is
* `'Reset rotation'`
* @property {number|undefined} duration Animation duration in milliseconds. Default is `250`.
* @property {boolean|undefined} autoHide Hide the control when rotation is 0. Default is `true`.
* @property {string|undefined} [className='ol-rotate'] CSS class name.
* @property {string|Element|undefined} [label='⇧'] Text label to use for the rotate button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|undefined} [tipLabel='Reset rotation'] Text label to use for the rotate tip.
* @property {number|undefined} [duration=250] Animation duration in milliseconds.
* @property {boolean|undefined} [autoHide=true] Hide the control when rotation is 0.
* @property {function(ol.MapEvent)|undefined} render Function called when the control should
* be re-rendered. This is called in a `requestAnimationFrame` callback.
* @property {function()|undefined} resetNorth Function called when the control is clicked.
* @property {function()|undefined} [resetNorth] Function called when the control is clicked.
* This will override the default `resetNorth`.
* @property {Element|string|undefined} target Specify a target if you want the control to be
* @property {Element|string|undefined} [target] Specify a target if you want the control to be
* rendered outside of the map's viewport.
*/

Expand Down
22 changes: 10 additions & 12 deletions src/ol/control/Zoom.js
Expand Up @@ -11,18 +11,16 @@ import {easeOut} from '../easing.js';

/**
* @typedef {Object} Options
* @property {number|undefined} duration Animation duration in milliseconds. Default is `250`.
* @property {string|undefined} className CSS class name. Default is `'ol-zoom'`.
* @property {string|Element|undefined} zoomInLabel Text label to use for the zoom-in
* button. Default is `'+'`. Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|Element|undefined} zoomOutLabel Text label to use for the zoom-out button.
* Default is `'-'`. Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|undefined} zoomInTipLabel Text label to use for the button tip. Default is
* `'Zoom in'`.
* @property {string|undefined} zoomOutTipLabel Text label to use for the button tip. Default is
* `'Zoom out'`.
* @property {number|undefined} delta The zoom delta applied on each click.
* @property {Element|string|undefined} target Specify a target if you want the control to be
* @property {number|undefined} [duration=250] Animation duration in milliseconds.
* @property {string|undefined} [className='ol-zoom'] CSS class name.
* @property {string|Element|undefined} [zoomInLabel='+'] Text label to use for the zoom-in
* button. Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|Element|undefined} [zoomOutLabel='-'] Text label to use for the zoom-out button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|undefined} [zoomInTipLabel='Zoom in'] Text label to use for the button tip.
* @property {string|undefined} [zoomOutTipLabel='Zoom out'] Text label to use for the button tip.
* @property {number|undefined} [delta=1] The zoom delta applied on each click.
* @property {Element|string|undefined} [target] Specify a target if you want the control to be
* rendered outside of the map's viewport.
*/

Expand Down
2 changes: 1 addition & 1 deletion src/ol/control/ZoomSlider.js
Expand Up @@ -28,7 +28,7 @@ const Direction = {
/**
* @typedef {Object} Options
* @property {string|undefined} className CSS class name.
* @property {number|undefined} duration Animation duration in milliseconds. Default is `200`.
* @property {number|undefined} [duration=200] Animation duration in milliseconds.
* @property {number|undefined} maxResolution Maximum resolution.
* @property {number|undefined} minResolution Minimum resolution.
* @property {function(ol.MapEvent)|undefined} render Function called when the control
Expand Down