Make sure that optional args are typed accordingly

This commit is contained in:
Andreas Hocevar
2020-02-20 12:39:31 +01:00
parent d6eb66f083
commit 608d515f1f
5 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ export class CollectionEvent extends Event {
/** /**
* @param {CollectionEventType} type Type. * @param {CollectionEventType} type Type.
* @param {*=} opt_element Element. * @param {*=} opt_element Element.
* @param {number} opt_index The index of the added or removed element. * @param {number=} opt_index The index of the added or removed element.
*/ */
constructor(type, opt_element, opt_index) { constructor(type, opt_element, opt_index) {
super(type); super(type);

View File

@@ -349,7 +349,7 @@ class IIIFInfo {
} }
/** /**
* @param {PreferredOptions} opt_preferredOptions Optional options for preferred format and quality. * @param {PreferredOptions=} opt_preferredOptions Optional options for preferred format and quality.
* @returns {import("../source/IIIF.js").Options} IIIF tile source ready constructor options. * @returns {import("../source/IIIF.js").Options} IIIF tile source ready constructor options.
* @api * @api
*/ */

View File

@@ -457,7 +457,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
* @param {number} squaredTolerance Squared render tolerance. * @param {number} squaredTolerance Squared render tolerance.
* @param {import("../../style/Style.js").default|Array<import("../../style/Style.js").default>} styles The style or array of styles. * @param {import("../../style/Style.js").default|Array<import("../../style/Style.js").default>} styles The style or array of styles.
* @param {import("../../render/canvas/BuilderGroup.js").default} builderGroup Builder group. * @param {import("../../render/canvas/BuilderGroup.js").default} builderGroup Builder group.
* @param {import("../../proj.js").TransformFunction} opt_transform Transform from user to view projection. * @param {import("../../proj.js").TransformFunction=} opt_transform Transform from user to view projection.
* @return {boolean} `true` if an image is loading. * @return {boolean} `true` if an image is loading.
*/ */
renderFeature(feature, squaredTolerance, styles, builderGroup, opt_transform) { renderFeature(feature, squaredTolerance, styles, builderGroup, opt_transform) {

View File

@@ -71,7 +71,7 @@ export function createSnapToZero(opt_tolerance) {
return ( return (
/** /**
* @param {number|undefined} rotation Rotation. * @param {number|undefined} rotation Rotation.
* @param {boolean} opt_isMoving True if an interaction or animation is in progress. * @param {boolean=} opt_isMoving True if an interaction or animation is in progress.
* @return {number|undefined} Rotation. * @return {number|undefined} Rotation.
*/ */
function(rotation, opt_isMoving) { function(rotation, opt_isMoving) {

View File

@@ -59,7 +59,7 @@ function formatPercentage(percentage) {
class IIIF extends TileImage { class IIIF extends TileImage {
/** /**
* @param {Options} opt_options Tile source options. Use {@link import("../format/IIIFInfo.js").IIIFInfo} * @param {Options=} opt_options Tile source options. Use {@link import("../format/IIIFInfo.js").IIIFInfo}
* to parse Image API service information responses into constructor options. * to parse Image API service information responses into constructor options.
* @api * @api
*/ */