Update type annotations for GMLBase

This commit is contained in:
Andreas Hocevar
2022-04-01 14:59:16 +02:00
parent 432870362b
commit c6a2392a2e

View File

@@ -255,33 +255,28 @@ class GMLBase extends XMLFeature {
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Geometry.js").default|import("../extent.js").Extent|undefined} Geometry. * @return {import("../extent.js").Extent|undefined} Geometry.
*/ */
readExtentElement(node, objectStack) { readExtentElement(node, objectStack) {
const context = /** @type {Object} */ (objectStack[0]); const context = /** @type {Object} */ (objectStack[0]);
const extent = this.readGeometryOrExtent(node, objectStack); const extent = /** @type {import("../extent.js").Extent} */ (
return extent this.readGeometryOrExtent(node, objectStack)
? transformExtentWithOptions( );
/** @type {import("../extent.js").Extent} */ (extent), return extent ? transformExtentWithOptions(extent, context) : undefined;
context
)
: undefined;
} }
/** /**
* @param {Element} node Node. * @param {Element} node Node.
* @param {Array<*>} objectStack Object stack. * @param {Array<*>} objectStack Object stack.
* @return {import("../geom/Geometry.js").default|import("../extent.js").Extent|undefined} Geometry. * @return {import("../geom/Geometry.js").default|undefined} Geometry.
*/ */
readGeometryElement(node, objectStack) { readGeometryElement(node, objectStack) {
const context = /** @type {Object} */ (objectStack[0]); const context = /** @type {Object} */ (objectStack[0]);
const geometry = this.readGeometryOrExtent(node, objectStack); const geometry = /** @type {import("../geom/Geometry.js").default} */ (
this.readGeometryOrExtent(node, objectStack)
);
return geometry return geometry
? transformGeometryWithOptions( ? transformGeometryWithOptions(geometry, false, context)
/** @type {import("../geom/Geometry.js").default} */ (geometry),
false,
context
)
: undefined; : undefined;
} }
@@ -556,9 +551,8 @@ class GMLBase extends XMLFeature {
* @param {Element} node Node. * @param {Element} node Node.
* @param {import("./Feature.js").ReadOptions} [opt_options] Options. * @param {import("./Feature.js").ReadOptions} [opt_options] Options.
* @protected * @protected
* @return {import("../geom/Geometry.js").default|import("../extent.js").Extent} Geometry. * @return {import("../geom/Geometry.js").default} Geometry.
*/ */
//@ts-ignore
readGeometryFromNode(node, opt_options) { readGeometryFromNode(node, opt_options) {
const geometry = this.readGeometryElement(node, [ const geometry = this.readGeometryElement(node, [
this.getReadOptions(node, opt_options ? opt_options : {}), this.getReadOptions(node, opt_options ? opt_options : {}),