Move WFS typedefs to typedefs.js

By renaming them so they're no longer in any subnamespaces, they no longer need to be in their own file.
This commit is contained in:
Peter Robins
2016-05-19 08:19:57 +00:00
parent be2fc808be
commit 4044ae4cd0
4 changed files with 32 additions and 38 deletions

View File

@@ -130,7 +130,7 @@ ol.format.WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
* Read transaction response of the source.
*
* @param {Document|Node|Object|string} source Source.
* @return {ol.format.WFS.TransactionResponse|undefined} Transaction response.
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
* @api stable
*/
ol.format.WFS.prototype.readTransactionResponse = function(source) {
@@ -153,7 +153,7 @@ ol.format.WFS.prototype.readTransactionResponse = function(source) {
* Read feature collection metadata of the source.
*
* @param {Document|Node|Object|string} source Source.
* @return {ol.format.WFS.FeatureCollectionMetadata|undefined}
* @return {ol.WFSFeatureCollectionMetadata|undefined}
* FeatureCollection metadata.
* @api stable
*/
@@ -176,7 +176,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
/**
* @param {Document} doc Document.
* @return {ol.format.WFS.FeatureCollectionMetadata|undefined}
* @return {ol.WFSFeatureCollectionMetadata|undefined}
* FeatureCollection metadata.
*/
ol.format.WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc) {
@@ -206,7 +206,7 @@ ol.format.WFS.FEATURE_COLLECTION_PARSERS_ = {
/**
* @param {Node} node Node.
* @return {ol.format.WFS.FeatureCollectionMetadata|undefined}
* @return {ol.WFSFeatureCollectionMetadata|undefined}
* FeatureCollection metadata.
*/
ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
@@ -219,7 +219,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
node.getAttribute('numberOfFeatures'));
result['numberOfFeatures'] = value;
return ol.xml.pushParseAndPop(
/** @type {ol.format.WFS.FeatureCollectionMetadata} */ (result),
/** @type {ol.WFSFeatureCollectionMetadata} */ (result),
ol.format.WFS.FEATURE_COLLECTION_PARSERS_, node, [], this.gmlFormat_);
};
@@ -318,7 +318,7 @@ ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_ = {
/**
* @param {Document} doc Document.
* @return {ol.format.WFS.TransactionResponse|undefined} Transaction response.
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
*/
ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
@@ -334,7 +334,7 @@ ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
/**
* @param {Node} node Node.
* @return {ol.format.WFS.TransactionResponse|undefined} Transaction response.
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
*/
ol.format.WFS.prototype.readTransactionResponseFromNode = function(node) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
@@ -342,7 +342,7 @@ ol.format.WFS.prototype.readTransactionResponseFromNode = function(node) {
goog.asserts.assert(node.localName == 'TransactionResponse',
'localName should be TransactionResponse');
return ol.xml.pushParseAndPop(
/** @type {ol.format.WFS.TransactionResponse} */({}),
/** @type {ol.WFSTransactionResponse} */({}),
ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_, node, []);
};

View File

@@ -1,26 +0,0 @@
/**
* typedefs for the WFS sub-sub-namespace
* See typedefs.js for more details
*/
goog.provide('ol.format.WFS.FeatureCollectionMetadata');
goog.provide('ol.format.WFS.TransactionResponse');
/**
* Number of features; bounds/extent.
* @typedef {{numberOfFeatures: number,
* bounds: ol.Extent}}
* @api stable
*/
ol.format.WFS.FeatureCollectionMetadata;
/**
* Total deleted; total inserted; total updated; array of insert ids.
* @typedef {{totalDeleted: number,
* totalInserted: number,
* totalUpdated: number,
* insertIds: Array.<string>}}
* @api stable
*/
ol.format.WFS.TransactionResponse;

View File

@@ -4,15 +4,12 @@
* These look like vars (or var properties), but in fact are simply identifiers
* for the Closure compiler. Originally they were included in the appropriate
* namespace file, but with the move away from Closure namespaces and towards
* self-contained standard modules are now all in this file, with two exceptions.
* self-contained standard modules are now all in this file.
* Unlike the other type definitions - enums and constructor functions - they
* are not code and so are not imported or exported. They are only referred to
* in type-defining comments used by the Closure compiler, and so should not
* appear in module code.
*
* The 2 exceptions are the WFS typedefs which are in a sub-sub-namespace and
* are API. These have been put in their own separate file.
*
* When the code is converted to ES6 modules, the namespace structure will
* disappear, and these typedefs will have to be renamed accordingly, but the
* namespace structure is maintained for the present for backwards compatibility.
@@ -477,6 +474,26 @@ ol.WebglBufferCacheEntry;
ol.WebglTextureCacheEntry;
/**
* Number of features; bounds/extent.
* @typedef {{numberOfFeatures: number,
* bounds: ol.Extent}}
* @api stable
*/
ol.WFSFeatureCollectionMetadata;
/**
* Total deleted; total inserted; total updated; array of insert ids.
* @typedef {{totalDeleted: number,
* totalInserted: number,
* totalUpdated: number,
* insertIds: Array.<string>}}
* @api stable
*/
ol.WFSTransactionResponse;
/**
* @typedef {{type: number, value: (number|string|undefined), position: number}}
*/