Skip to content

lib.dom.d.ts Document interface missing createNSResolver method. #29487

@evxn

Description

@evxn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions