Transformed types

Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e):

    jscodeshift --transform ts.js src
This commit is contained in:
Tim Schaub
2018-09-05 08:05:29 -06:00
parent f2aaaa19e1
commit ccfacc5ee6
239 changed files with 3999 additions and 3999 deletions
+59 -59
View File
@@ -52,10 +52,10 @@ const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
class GML3 extends GMLBase {
/**
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
* @param {import("./GMLBase.js").Options=} opt_options Optional configuration object.
*/
constructor(opt_options) {
const options = /** @type {module:ol/format/GMLBase~Options} */
const options = /** @type {import("./GMLBase.js").Options} */
(opt_options ? opt_options : {});
super(options);
@@ -105,10 +105,10 @@ class GML3 extends GMLBase {
* @param {Element} node Node.
* @param {Array<*>} objectStack Object stack.
* @private
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
* @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString.
*/
readMultiCurve_(node, objectStack) {
/** @type {Array<module:ol/geom/LineString>} */
/** @type {Array<import("../geom/LineString.js").default>} */
const lineStrings = pushParseAndPop([],
this.MULTICURVE_PARSERS_, node, objectStack, this);
if (lineStrings) {
@@ -123,10 +123,10 @@ class GML3 extends GMLBase {
* @param {Element} node Node.
* @param {Array<*>} objectStack Object stack.
* @private
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
* @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon.
*/
readMultiSurface_(node, objectStack) {
/** @type {Array<module:ol/geom/Polygon>} */
/** @type {Array<import("../geom/Polygon.js").default>} */
const polygons = pushParseAndPop([],
this.MULTISURFACE_PARSERS_, node, objectStack, this);
if (polygons) {
@@ -234,7 +234,7 @@ class GML3 extends GMLBase {
* @param {Element} node Node.
* @param {Array<*>} objectStack Object stack.
* @private
* @return {module:ol/geom/Polygon|undefined} Polygon.
* @return {import("../geom/Polygon.js").default|undefined} Polygon.
*/
readSurface_(node, objectStack) {
/** @type {Array<Array<number>>} */
@@ -258,7 +258,7 @@ class GML3 extends GMLBase {
* @param {Element} node Node.
* @param {Array<*>} objectStack Object stack.
* @private
* @return {module:ol/geom/LineString|undefined} LineString.
* @return {import("../geom/LineString.js").default|undefined} LineString.
*/
readCurve_(node, objectStack) {
/** @type {Array<number>} */
@@ -276,7 +276,7 @@ class GML3 extends GMLBase {
* @param {Element} node Node.
* @param {Array<*>} objectStack Object stack.
* @private
* @return {module:ol/extent~Extent|undefined} Envelope.
* @return {import("../extent.js").Extent|undefined} Envelope.
*/
readEnvelope_(node, objectStack) {
/** @type {Array<number>} */
@@ -380,7 +380,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/Point} value Point geometry.
* @param {import("../geom/Point.js").default} value Point geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -436,7 +436,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
* @param {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} value Geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -460,7 +460,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/Point} geometry Point geometry.
* @param {import("../geom/Point.js").default} geometry Point geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -477,7 +477,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/extent~Extent} extent Extent.
* @param {import("../extent.js").Extent} extent Extent.
* @param {Array<*>} objectStack Node stack.
*/
writeEnvelope(node, extent, objectStack) {
@@ -488,7 +488,7 @@ class GML3 extends GMLBase {
}
const keys = ['lowerCorner', 'upperCorner'];
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
({node: node}), this.ENVELOPE_SERIALIZERS_,
OBJECT_PROPERTY_NODE_FACTORY,
values,
@@ -497,7 +497,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
* @param {import("../geom/LinearRing.js").default} geometry LinearRing geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -532,7 +532,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
* @param {import("../geom/Polygon.js").default} geometry Polygon geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -560,7 +560,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/LineString} geometry LineString geometry.
* @param {import("../geom/LineString.js").default} geometry LineString geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -585,7 +585,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
* @param {import("../geom/MultiPolygon.js").default} geometry MultiPolygon geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -606,7 +606,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
* @param {import("../geom/MultiPoint.js").default} geometry MultiPoint geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -626,7 +626,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
* @param {import("../geom/MultiLineString.js").default} geometry MultiLineString geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -647,7 +647,7 @@ class GML3 extends GMLBase {
/**
* @param {Node} node Node.
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -659,7 +659,7 @@ class GML3 extends GMLBase {
/**
* @param {Node} node Node.
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -674,7 +674,7 @@ class GML3 extends GMLBase {
/**
* @param {Node} node Node.
* @param {module:ol/geom/Point} point Point geometry.
* @param {import("../geom/Point.js").default} point Point geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -686,7 +686,7 @@ class GML3 extends GMLBase {
/**
* @param {Node} node Node.
* @param {module:ol/geom/LineString} line LineString geometry.
* @param {import("../geom/LineString.js").default} line LineString geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -700,7 +700,7 @@ class GML3 extends GMLBase {
/**
* @param {Node} node Node.
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -712,7 +712,7 @@ class GML3 extends GMLBase {
/**
* @param {Node} node Node.
* @param {module:ol/geom/LineString} line LineString geometry.
* @param {import("../geom/LineString.js").default} line LineString geometry.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -725,11 +725,11 @@ class GML3 extends GMLBase {
/**
* @param {Node} node Node.
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
* @param {import("../geom/Geometry.js").default|import("../extent.js").Extent} geometry Geometry.
* @param {Array<*>} objectStack Node stack.
*/
writeGeometryElement(node, geometry, objectStack) {
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
const context = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[objectStack.length - 1]);
const item = assign({}, context);
item.node = node;
let value;
@@ -741,9 +741,9 @@ class GML3 extends GMLBase {
value = geometry;
}
} else {
value = transformWithOptions(/** @type {module:ol/geom/Geometry} */ (geometry), true, context);
value = transformWithOptions(/** @type {import("../geom/Geometry.js").default} */ (geometry), true, context);
}
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
(item), this.GEOMETRY_SERIALIZERS_,
this.GEOMETRY_NODE_FACTORY_, [value],
objectStack, undefined, this);
@@ -751,7 +751,7 @@ class GML3 extends GMLBase {
/**
* @param {Element} node Node.
* @param {module:ol/Feature} feature Feature.
* @param {import("../Feature.js").default} feature Feature.
* @param {Array<*>} objectStack Node stack.
*/
writeFeatureElement(node, feature, objectStack) {
@@ -788,7 +788,7 @@ class GML3 extends GMLBase {
}
const item = assign({}, context);
item.node = node;
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
(item), context.serializers,
makeSimpleNodeFactory(undefined, featureNS),
values,
@@ -797,7 +797,7 @@ class GML3 extends GMLBase {
/**
* @param {Node} node Node.
* @param {Array<module:ol/Feature>} features Features.
* @param {Array<import("../Feature.js").default>} features Features.
* @param {Array<*>} objectStack Node stack.
* @private
*/
@@ -811,7 +811,7 @@ class GML3 extends GMLBase {
this.writeFeatureElement, this);
const item = assign({}, context);
item.node = node;
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
(item),
serializers,
makeSimpleNodeFactory(featureType, featureNS), features,
@@ -848,7 +848,7 @@ class GML3 extends GMLBase {
const multiCurve = context['multiCurve'];
let nodeName;
if (!Array.isArray(value)) {
nodeName = /** @type {module:ol/geom/Geometry} */ (value).getType();
nodeName = /** @type {import("../geom/Geometry.js").default} */ (value).getType();
if (nodeName === 'MultiPolygon' && multiSurface === true) {
nodeName = 'MultiSurface';
} else if (nodeName === 'Polygon' && surface === true) {
@@ -868,8 +868,8 @@ class GML3 extends GMLBase {
/**
* Encode a geometry in GML 3.1.1 Simple Features.
*
* @param {module:ol/geom/Geometry} geometry Geometry.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @param {import("../geom/Geometry.js").default} geometry Geometry.
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
* @return {Node} Node.
* @override
* @api
@@ -890,8 +890,8 @@ class GML3 extends GMLBase {
/**
* Encode an array of features in the GML 3.1.1 format as an XML node.
*
* @param {Array<module:ol/Feature>} features Features.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @param {Array<import("../Feature.js").default>} features Features.
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
* @return {Element} Node.
* @override
* @api
@@ -920,7 +920,7 @@ class GML3 extends GMLBase {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
@@ -933,7 +933,7 @@ GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
@@ -946,7 +946,7 @@ GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.GEOMETRY_PARSERS_ = {
@@ -976,7 +976,7 @@ GML3.prototype.GEOMETRY_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.MULTICURVE_PARSERS_ = {
@@ -991,7 +991,7 @@ GML3.prototype.MULTICURVE_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.MULTISURFACE_PARSERS_ = {
@@ -1006,7 +1006,7 @@ GML3.prototype.MULTISURFACE_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.CURVEMEMBER_PARSERS_ = {
@@ -1020,7 +1020,7 @@ GML3.prototype.CURVEMEMBER_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
@@ -1033,7 +1033,7 @@ GML3.prototype.SURFACEMEMBER_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.SURFACE_PARSERS_ = {
@@ -1045,7 +1045,7 @@ GML3.prototype.SURFACE_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.CURVE_PARSERS_ = {
@@ -1057,7 +1057,7 @@ GML3.prototype.CURVE_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.ENVELOPE_PARSERS_ = {
@@ -1072,7 +1072,7 @@ GML3.prototype.ENVELOPE_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.PATCHES_PARSERS_ = {
@@ -1085,7 +1085,7 @@ GML3.prototype.PATCHES_PARSERS_ = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
* @private
*/
GML3.prototype.SEGMENTS_PARSERS_ = {
@@ -1100,8 +1100,8 @@ GML3.prototype.SEGMENTS_PARSERS_ = {
* Encode an array of features in GML 3.1.1 Simple Features.
*
* @function
* @param {Array<module:ol/Feature>} features Features.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @param {Array<import("../Feature.js").default>} features Features.
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
* @return {string} Result.
* @api
*/
@@ -1109,7 +1109,7 @@ GML3.prototype.writeFeatures;
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
* @private
*/
GML3.prototype.RING_SERIALIZERS_ = {
@@ -1121,7 +1121,7 @@ GML3.prototype.RING_SERIALIZERS_ = {
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
* @private
*/
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
@@ -1133,7 +1133,7 @@ GML3.prototype.ENVELOPE_SERIALIZERS_ = {
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
* @private
*/
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
@@ -1147,7 +1147,7 @@ GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
* @private
*/
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
@@ -1159,7 +1159,7 @@ GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
* @private
*/
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
@@ -1173,7 +1173,7 @@ GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
* @private
*/
GML3.prototype.GEOMETRY_SERIALIZERS_ = {