Use 'Element' type instead of 'Node'

This commit is contained in:
Frederic Junod
2018-08-31 11:30:24 +02:00
parent 6b851720d9
commit 20a347b0c9
14 changed files with 202 additions and 202 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ class XML {
/**
* Read the source document.
*
* @param {Document|Node|string} source The XML source.
* @param {Document|Element|string} source The XML source.
* @return {Object} An object representing the source.
* @api
*/
@@ -21,7 +21,7 @@ class XML {
if (isDocument(source)) {
return this.readFromDocument(/** @type {Document} */ (source));
} else if (isNode(source)) {
return this.readFromNode(/** @type {Node} */ (source));
return this.readFromNode(/** @type {Element} */ (source));
} else if (typeof source === 'string') {
const doc = parse(source);
return this.readFromDocument(doc);
@@ -39,7 +39,7 @@ class XML {
/**
* @abstract
* @param {Node} node Node.
* @param {Element} node Node.
* @return {Object} Object
*/
readFromNode(node) {}