Improve some null types for strictNullChecks

This commit is contained in:
EvertEt
2022-02-06 19:35:41 +01:00
parent 459cd51ae2
commit 25e1d6c5d6
17 changed files with 37 additions and 37 deletions
+12 -12
View File
@@ -195,13 +195,13 @@ const KML_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
let DEFAULT_COLOR;
/**
* @type {Fill}
* @type {Fill|null}
*/
let DEFAULT_FILL_STYLE = null;
/**
* Get the default fill style (or null if not yet set).
* @return {Fill} The default fill style.
* @return {Fill|null} The default fill style.
*/
export function getDefaultFillStyle() {
return DEFAULT_FILL_STYLE;
@@ -233,13 +233,13 @@ let DEFAULT_IMAGE_STYLE_SIZE;
let DEFAULT_IMAGE_STYLE_SRC;
/**
* @type {import("../style/Image.js").default}
* @type {import("../style/Image.js").default|null}
*/
let DEFAULT_IMAGE_STYLE = null;
/**
* Get the default image style (or null if not yet set).
* @return {import("../style/Image.js").default} The default image style.
* @return {import("../style/Image.js").default|null} The default image style.
*/
export function getDefaultImageStyle() {
return DEFAULT_IMAGE_STYLE;
@@ -251,13 +251,13 @@ export function getDefaultImageStyle() {
let DEFAULT_NO_IMAGE_STYLE;
/**
* @type {Stroke}
* @type {Stroke|null}
*/
let DEFAULT_STROKE_STYLE = null;
/**
* Get the default stroke style (or null if not yet set).
* @return {Stroke} The default stroke style.
* @return {Stroke|null} The default stroke style.
*/
export function getDefaultStrokeStyle() {
return DEFAULT_STROKE_STYLE;
@@ -269,39 +269,39 @@ export function getDefaultStrokeStyle() {
let DEFAULT_TEXT_STROKE_STYLE;
/**
* @type {Text}
* @type {Text|null}
*/
let DEFAULT_TEXT_STYLE = null;
/**
* Get the default text style (or null if not yet set).
* @return {Text} The default text style.
* @return {Text|null} The default text style.
*/
export function getDefaultTextStyle() {
return DEFAULT_TEXT_STYLE;
}
/**
* @type {Style}
* @type {Style|null}
*/
let DEFAULT_STYLE = null;
/**
* Get the default style (or null if not yet set).
* @return {Style} The default style.
* @return {Style|null} The default style.
*/
export function getDefaultStyle() {
return DEFAULT_STYLE;
}
/**
* @type {Array<Style>}
* @type {Array<Style>|null}
*/
let DEFAULT_STYLE_ARRAY = null;
/**
* Get the default style array (or null if not yet set).
* @return {Array<Style>} The default style.
* @return {Array<Style>|null} The default style.
*/
export function getDefaultStyleArray() {
return DEFAULT_STYLE_ARRAY;
+2 -2
View File
@@ -62,7 +62,7 @@ class WkbReader {
this.isLittleEndian_ = false;
this.hasZ_ = false;
this.hasM_ = false;
/** @type {number} */
/** @type {number|null} */
this.srid_ = null;
this.layout_ = GeometryLayout.XY;
@@ -356,7 +356,7 @@ class WkbReader {
}
/**
* @return {number} SRID in the EWKB. `null` if not defined.
* @return {number|null} SRID in the EWKB. `null` if not defined.
*/
getSrid() {
return this.srid_;