Flow: Flow doesn't have a few XPath-related properties in the standard libdefs

Created on 15 May 2018  路  2Comments  路  Source: facebook/flow

I just saw a StackOverflow question where someone wanted to use Flow to type some stuff related to XPath:

const xmlDoc: XMLDocument = new DOMParser().parseFromString(xmlString,"text/xml");

xmlDoc.evaluate(xPath, xmlDoc, null, XPathResult.ANY_TYPE, null);

It looks like they can just use Document in place of XMLDocument, but the current definition of Document doesn't seem to have an evaluate method. In addition, I don't see XPathResult defined anywhere. Are these things that we/you would be interested in adding to the libdefs?

Accepting PRs Library definitions

Most helpful comment

Well, if something exists in specs but missed in libdefs, I think, it should be fixed.

All 2 comments

Well, if something exists in specs but missed in libdefs, I think, it should be fixed.

Feel free to PR 馃憤

Was this page helpful?
0 / 5 - 0 ratings