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

View File

@@ -18,7 +18,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
*/
const FEATURE_COLLECTION_PARSERS = {
'http://www.opengis.net/gml': {
@@ -30,7 +30,7 @@ const FEATURE_COLLECTION_PARSERS = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
*/
const TRANSACTION_SUMMARY_PARSERS = {
'http://www.opengis.net/wfs': {
@@ -43,7 +43,7 @@ const TRANSACTION_SUMMARY_PARSERS = {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
*/
const TRANSACTION_RESPONSE_PARSERS = {
'http://www.opengis.net/wfs': {
@@ -56,7 +56,7 @@ const TRANSACTION_RESPONSE_PARSERS = {
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
*/
const QUERY_SERIALIZERS = {
'http://www.opengis.net/wfs': {
@@ -66,7 +66,7 @@ const QUERY_SERIALIZERS = {
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
*/
const TRANSACTION_SERIALIZERS = {
'http://www.opengis.net/wfs': {
@@ -83,7 +83,7 @@ const TRANSACTION_SERIALIZERS = {
* @typedef {Object} Options
* @property {Object<string, string>|string} [featureNS] The namespace URI used for features.
* @property {Array<string>|string} [featureType] The feature type to parse. Only used for read operations.
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
* @property {import("./GMLBase.js").default} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
* @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
*/
@@ -105,8 +105,8 @@ const TRANSACTION_SERIALIZERS = {
* @property {number} [count] Number of features to retrieve when paging. This is a
* WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services. Please note that some
* Web Feature Services have repurposed `maxfeatures` instead.
* @property {module:ol/extent~Extent} [bbox] Extent to use for the BBOX filter.
* @property {module:ol/format/filter/Filter} [filter] Filter condition. See
* @property {import("../extent.js").Extent} [bbox] Extent to use for the BBOX filter.
* @property {import("./filter/Filter.js").default} [filter] Filter condition. See
* {@link module:ol/format/Filter} for more information.
* @property {string} [resultType] Indicates what response should be returned,
* E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features.
@@ -124,7 +124,7 @@ const TRANSACTION_SERIALIZERS = {
* @property {boolean} [hasZ] Must be set to true if the transaction is for
* a 3D layer. This will allow the Z coordinate to be included in the transaction.
* @property {Array<Object>} nativeElements Native elements. Currently not supported.
* @property {module:ol/format/GMLBase~Options} [gmlOptions] GML options for the WFS transaction writer.
* @property {import("./GMLBase.js").Options} [gmlOptions] GML options for the WFS transaction writer.
* @property {string} [version='1.1.0'] WFS version to use for the transaction. Can be either `1.0.0` or `1.1.0`.
*/
@@ -133,7 +133,7 @@ const TRANSACTION_SERIALIZERS = {
* Number of features; bounds/extent.
* @typedef {Object} FeatureCollectionMetadata
* @property {number} numberOfFeatures
* @property {module:ol/extent~Extent} bounds
* @property {import("../extent.js").Extent} bounds
*/
@@ -205,7 +205,7 @@ const DEFAULT_VERSION = '1.1.0';
class WFS extends XMLFeature {
/**
* @param {module:ol/format/WFS~Options=} opt_options Optional configuration object.
* @param {Options=} opt_options Optional configuration object.
*/
constructor(opt_options) {
super();
@@ -226,7 +226,7 @@ class WFS extends XMLFeature {
/**
* @private
* @type {module:ol/format/GMLBase}
* @type {import("./GMLBase.js").default}
*/
this.gmlFormat_ = options.gmlFormat ?
options.gmlFormat : new GML3();
@@ -257,7 +257,7 @@ class WFS extends XMLFeature {
* @inheritDoc
*/
readFeaturesFromNode(node, opt_options) {
const context = /** @type {module:ol/xml~NodeStackItem} */ ({
const context = /** @type {import("../xml.js").NodeStackItem} */ ({
'featureType': this.featureType_,
'featureNS': this.featureNS_
});
@@ -279,7 +279,7 @@ class WFS extends XMLFeature {
* Read transaction response of the source.
*
* @param {Document|Element|Object|string} source Source.
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
* @return {TransactionResponse|undefined} Transaction response.
* @api
*/
readTransactionResponse(source) {
@@ -300,7 +300,7 @@ class WFS extends XMLFeature {
* Read feature collection metadata of the source.
*
* @param {Document|Element|Object|string} source Source.
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
* @return {FeatureCollectionMetadata|undefined}
* FeatureCollection metadata.
* @api
*/
@@ -321,7 +321,7 @@ class WFS extends XMLFeature {
/**
* @param {Document} doc Document.
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
* @return {FeatureCollectionMetadata|undefined}
* FeatureCollection metadata.
*/
readFeatureCollectionMetadataFromDocument(doc) {
@@ -335,7 +335,7 @@ class WFS extends XMLFeature {
/**
* @param {Element} node Node.
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
* @return {FeatureCollectionMetadata|undefined}
* FeatureCollection metadata.
*/
readFeatureCollectionMetadataFromNode(node) {
@@ -344,13 +344,13 @@ class WFS extends XMLFeature {
node.getAttribute('numberOfFeatures'));
result['numberOfFeatures'] = value;
return pushParseAndPop(
/** @type {module:ol/format/WFS~FeatureCollectionMetadata} */ (result),
/** @type {FeatureCollectionMetadata} */ (result),
FEATURE_COLLECTION_PARSERS, node, [], this.gmlFormat_);
}
/**
* @param {Document} doc Document.
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
* @return {TransactionResponse|undefined} Transaction response.
*/
readTransactionResponseFromDocument(doc) {
for (let n = doc.firstChild; n; n = n.nextSibling) {
@@ -363,18 +363,18 @@ class WFS extends XMLFeature {
/**
* @param {Element} node Node.
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
* @return {TransactionResponse|undefined} Transaction response.
*/
readTransactionResponseFromNode(node) {
return pushParseAndPop(
/** @type {module:ol/format/WFS~TransactionResponse} */({}),
/** @type {TransactionResponse} */({}),
TRANSACTION_RESPONSE_PARSERS, node, []);
}
/**
* Encode format as WFS `GetFeature` and return the Node.
*
* @param {module:ol/format/WFS~WriteGetFeatureOptions} options Options.
* @param {WriteGetFeatureOptions} options Options.
* @return {Node} Result.
* @api
*/
@@ -417,7 +417,7 @@ class WFS extends XMLFeature {
}
}
node.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', this.schemaLocation_);
/** @type {module:ol/xml~NodeStackItem} */
/** @type {import("../xml.js").NodeStackItem} */
const context = {
node: node,
'srsName': options.srsName,
@@ -436,10 +436,10 @@ class WFS extends XMLFeature {
/**
* Encode format as WFS `Transaction` and return the Node.
*
* @param {Array<module:ol/Feature>} inserts The features to insert.
* @param {Array<module:ol/Feature>} updates The features to update.
* @param {Array<module:ol/Feature>} deletes The features to delete.
* @param {module:ol/format/WFS~WriteTransactionOptions} options Write options.
* @param {Array<import("../Feature.js").default>} inserts The features to insert.
* @param {Array<import("../Feature.js").default>} updates The features to update.
* @param {Array<import("../Feature.js").default>} deletes The features to delete.
* @param {WriteTransactionOptions} options Write options.
* @return {Node} Result.
* @api
*/
@@ -451,7 +451,7 @@ class WFS extends XMLFeature {
node.setAttribute('service', 'WFS');
node.setAttribute('version', version);
let baseObj;
/** @type {module:ol/xml~NodeStackItem} */
/** @type {import("../xml.js").NodeStackItem} */
let obj;
if (options) {
baseObj = options.gmlOptions ? options.gmlOptions : {};
@@ -549,7 +549,7 @@ function readTransactionSummary(node, objectStack) {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
*/
const OGC_FID_PARSERS = {
'http://www.opengis.net/ogc': {
@@ -571,7 +571,7 @@ function fidParser(node, objectStack) {
/**
* @const
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
*/
const INSERT_RESULTS_PARSERS = {
'http://www.opengis.net/wfs': {
@@ -593,7 +593,7 @@ function readInsertResults(node, objectStack) {
/**
* @param {Element} node Node.
* @param {module:ol/Feature} feature Feature.
* @param {import("../Feature.js").default} feature Feature.
* @param {Array<*>} objectStack Node stack.
*/
function writeFeature(node, feature, objectStack) {
@@ -644,7 +644,7 @@ function getTypeName(featurePrefix, featureType) {
/**
* @param {Element} node Node.
* @param {module:ol/Feature} feature Feature.
* @param {import("../Feature.js").default} feature Feature.
* @param {Array<*>} objectStack Node stack.
*/
function writeDelete(node, feature, objectStack) {
@@ -665,7 +665,7 @@ function writeDelete(node, feature, objectStack) {
/**
* @param {Element} node Node.
* @param {module:ol/Feature} feature Feature.
* @param {import("../Feature.js").default} feature Feature.
* @param {Array<*>} objectStack Node stack.
*/
function writeUpdate(node, feature, objectStack) {
@@ -692,7 +692,7 @@ function writeUpdate(node, feature, objectStack) {
values.push({name: name, value: value});
}
}
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */ (
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */ (
{'gmlVersion': context['gmlVersion'], node: node,
'hasZ': context['hasZ'], 'srsName': context['srsName']}),
TRANSACTION_SERIALIZERS,
@@ -751,7 +751,7 @@ function writeNative(node, nativeElement, objectStack) {
/**
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
*/
const GETFEATURE_SERIALIZERS = {
'http://www.opengis.net/wfs': {
@@ -804,7 +804,7 @@ function writeQuery(node, featureType, objectStack) {
if (featureNS) {
node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);
}
const item = /** @type {module:ol/xml~NodeStackItem} */ (assign({}, context));
const item = /** @type {import("../xml.js").NodeStackItem} */ (assign({}, context));
item.node = node;
pushSerializeAndPop(item,
QUERY_SERIALIZERS,
@@ -821,11 +821,11 @@ function writeQuery(node, featureType, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/Filter} filter Filter.
* @param {import("./filter/Filter.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeFilterCondition(node, filter, objectStack) {
/** @type {module:ol/xml~NodeStackItem} */
/** @type {import("../xml.js").NodeStackItem} */
const item = {node: node};
pushSerializeAndPop(item,
GETFEATURE_SERIALIZERS,
@@ -836,7 +836,7 @@ function writeFilterCondition(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/Bbox} filter Filter.
* @param {import("./filter/Bbox.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeBboxFilter(node, filter, objectStack) {
@@ -850,7 +850,7 @@ function writeBboxFilter(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/Contains} filter Filter.
* @param {import("./filter/Contains.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeContainsFilter(node, filter, objectStack) {
@@ -864,7 +864,7 @@ function writeContainsFilter(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/Intersects} filter Filter.
* @param {import("./filter/Intersects.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeIntersectsFilter(node, filter, objectStack) {
@@ -878,7 +878,7 @@ function writeIntersectsFilter(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/Within} filter Filter.
* @param {import("./filter/Within.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeWithinFilter(node, filter, objectStack) {
@@ -892,7 +892,7 @@ function writeWithinFilter(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/During} filter Filter.
* @param {import("./filter/During.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeDuringFilter(node, filter, objectStack) {
@@ -917,11 +917,11 @@ function writeDuringFilter(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/LogicalNary} filter Filter.
* @param {import("./filter/LogicalNary.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeLogicalFilter(node, filter, objectStack) {
/** @type {module:ol/xml~NodeStackItem} */
/** @type {import("../xml.js").NodeStackItem} */
const item = {node: node};
const conditions = filter.conditions;
for (let i = 0, ii = conditions.length; i < ii; ++i) {
@@ -936,11 +936,11 @@ function writeLogicalFilter(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/Not} filter Filter.
* @param {import("./filter/Not.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeNotFilter(node, filter, objectStack) {
/** @type {module:ol/xml~NodeStackItem} */
/** @type {import("../xml.js").NodeStackItem} */
const item = {node: node};
const condition = filter.condition;
pushSerializeAndPop(item,
@@ -952,7 +952,7 @@ function writeNotFilter(node, filter, objectStack) {
/**
* @param {Element} node Node.
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
* @param {import("./filter/ComparisonBinary.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeComparisonFilter(node, filter, objectStack) {
@@ -966,7 +966,7 @@ function writeComparisonFilter(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/IsNull} filter Filter.
* @param {import("./filter/IsNull.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeIsNullFilter(node, filter, objectStack) {
@@ -976,7 +976,7 @@ function writeIsNullFilter(node, filter, objectStack) {
/**
* @param {Node} node Node.
* @param {module:ol/format/filter/IsBetween} filter Filter.
* @param {import("./filter/IsBetween.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeIsBetweenFilter(node, filter, objectStack) {
@@ -994,7 +994,7 @@ function writeIsBetweenFilter(node, filter, objectStack) {
/**
* @param {Element} node Node.
* @param {module:ol/format/filter/IsLike} filter Filter.
* @param {import("./filter/IsLike.js").default} filter Filter.
* @param {Array<*>} objectStack Node stack.
*/
function writeIsLikeFilter(node, filter, objectStack) {
@@ -1056,7 +1056,7 @@ function writeTimeInstant(node, time) {
/**
* Encode filter as WFS `Filter` and return the Node.
*
* @param {module:ol/format/filter/Filter} filter Filter.
* @param {import("./filter/Filter.js").default} filter Filter.
* @return {Node} Result.
* @api
*/
@@ -1074,7 +1074,7 @@ export function writeFilter(filter) {
*/
function writeGetFeature(node, featureTypes, objectStack) {
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
const item = /** @type {module:ol/xml~NodeStackItem} */ (assign({}, context));
const item = /** @type {import("../xml.js").NodeStackItem} */ (assign({}, context));
item.node = node;
pushSerializeAndPop(item,
GETFEATURE_SERIALIZERS,