Improve some null types to prepare for strictNullChecks

This commit is contained in:
EvertEt
2022-01-30 12:15:46 +01:00
parent 12f8bae261
commit e3d3d24f05
20 changed files with 41 additions and 39 deletions

View File

@@ -168,7 +168,7 @@ class DragAndDrop extends Interaction {
/**
* @private
* @type {HTMLElement}
* @type {HTMLElement|null}
*/
this.target = options.target ? options.target : null;
}

View File

@@ -257,14 +257,14 @@ class Draw extends PointerInteraction {
/**
* Target source for drawn features.
* @type {VectorSource}
* @type {VectorSource|null}
* @private
*/
this.source_ = options.source ? options.source : null;
/**
* Target collection for drawn features.
* @type {import("../Collection.js").default<Feature>}
* @type {import("../Collection.js").default<Feature>|null}
* @private
*/
this.features_ = options.features ? options.features : null;
@@ -1022,7 +1022,7 @@ class Draw extends PointerInteraction {
/**
* Stop drawing without adding the sketch feature to the target layer.
* @return {Feature<import("../geom/SimpleGeometry.js").default>} The sketch feature (or null if none).
* @return {Feature<import("../geom/SimpleGeometry.js").default>|null} The sketch feature (or null if none).
* @private
*/
abortDrawing_() {

View File

@@ -115,7 +115,7 @@ class Snap extends PointerInteraction {
super(pointerOptions);
/**
* @type {import("../source/Vector.js").default}
* @type {import("../source/Vector.js").default|null}
* @private
*/
this.source_ = options.source ? options.source : null;
@@ -133,7 +133,7 @@ class Snap extends PointerInteraction {
this.edge_ = options.edge !== undefined ? options.edge : true;
/**
* @type {import("../Collection.js").default<import("../Feature.js").default>}
* @type {import("../Collection.js").default<import("../Feature.js").default>|null}
* @private
*/
this.features_ = options.features ? options.features : null;

View File

@@ -169,7 +169,7 @@ class Translate extends PointerInteraction {
this.startCoordinate_ = null;
/**
* @type {Collection<import("../Feature.js").default>}
* @type {Collection<import("../Feature.js").default>|null}
* @private
*/
this.features_ = options.features !== undefined ? options.features : null;