TypeScript Version: 3.3.0-dev.20190119
Search Terms: XPathEvaluator, Document, lib.dom.d.ts, createNSResolver
Code
document.createNSResolver(document);
Expected behavior:
Document should have the method createNSResolver.
Actually, according to w3c Document interface should extend XPathEvaluator interface (which has 3 methods: createExpression, createNSResolver and evaluate). Right now lib.dom.d.ts Document interface contains only evaluate method, the other two are missing.
"The evaluation of XPath expressions is provided by XPathEvaluator. In a DOM implementation which supports the XPath 3.0 feature, as described above, the XPathEvaluator interface will be implemented on the same object which implements the Document interface"
https://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
https://developer.mozilla.org/en-US/docs/Web/API/XPathEvaluator
Actual behavior:
Error: TS2339: Property 'createNSResolver' does not exist on type 'Document'.
Playground Link: https://www.typescriptlang.org/play/index.html#src=document.createNSResolver(document)%3B
Related Issues: #26437
TypeScript Version: 3.3.0-dev.20190119
Search Terms: XPathEvaluator, Document, lib.dom.d.ts, createNSResolver
Code
Expected behavior:
Documentshould have the methodcreateNSResolver.Actually, according to w3c
Documentinterface should extendXPathEvaluatorinterface (which has 3 methods:createExpression,createNSResolverandevaluate). Right now lib.dom.d.tsDocumentinterface contains onlyevaluatemethod, the other two are missing."The evaluation of XPath expressions is provided by XPathEvaluator. In a DOM implementation which supports the XPath 3.0 feature, as described above, the XPathEvaluator interface will be implemented on the same object which implements the Document interface"
https://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
https://developer.mozilla.org/en-US/docs/Web/API/XPathEvaluator
Actual behavior:
Error: TS2339: Property 'createNSResolver' does not exist on type 'Document'.
Playground Link: https://www.typescriptlang.org/play/index.html#src=document.createNSResolver(document)%3B
Related Issues: #26437