@@ -1659,6 +1659,8 @@ interface EventListener {
16591659 (evt: Event): void;
16601660}
16611661
1662+ type XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; };
1663+
16621664/** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */
16631665interface ANGLE_instanced_arrays {
16641666 drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void;
@@ -4139,7 +4141,7 @@ interface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndEleme
41394141}
41404142
41414143/** Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. */
4142- interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, GlobalEventHandlers, DocumentAndElementEventHandlers {
4144+ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers {
41434145 /**
41444146 * Sets or gets the URL for the current document.
41454147 */
@@ -4520,7 +4522,6 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
45204522 */
45214523 elementFromPoint(x: number, y: number): Element | null;
45224524 elementsFromPoint(x: number, y: number): Element[];
4523- evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | ((prefix: string) => string | null) | null, type: number, result: XPathResult | null): XPathResult;
45244525 /**
45254526 * Executes a command on the current document, current selection, or the given range.
45264527 * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
@@ -17433,37 +17434,30 @@ declare var XMLSerializer: {
1743317434};
1743417435
1743517436/** The XPathEvaluator interface allows to compile and evaluate XPath expressions. */
17436- interface XPathEvaluator {
17437- createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
17438- createNSResolver(nodeResolver?: Node): XPathNSResolver;
17439- evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | ((prefix: string) => string | null) | null, type: number, result: XPathResult | null): XPathResult;
17437+ interface XPathEvaluator extends XPathEvaluatorBase {
1744017438}
1744117439
1744217440declare var XPathEvaluator: {
1744317441 prototype: XPathEvaluator;
1744417442 new(): XPathEvaluator;
1744517443};
1744617444
17445+ interface XPathEvaluatorBase {
17446+ createExpression(expression: string, resolver?: XPathNSResolver | null): XPathExpression;
17447+ createNSResolver(nodeResolver: Node): XPathNSResolver;
17448+ evaluate(expression: string, contextNode: Node, resolver?: XPathNSResolver | null, type?: number, result?: XPathResult | null): XPathResult;
17449+ }
17450+
1744717451/** This interface is a compiled XPath expression that can be evaluated on a document or specific node to return information its DOM tree. */
1744817452interface XPathExpression {
17449- evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult;
17453+ evaluate(contextNode: Node, type? : number, result? : XPathResult | null): XPathResult;
1745017454}
1745117455
1745217456declare var XPathExpression: {
1745317457 prototype: XPathExpression;
1745417458 new(): XPathExpression;
1745517459};
1745617460
17457- /** The XPathNSResolver interface permits prefix strings in an XPath expression to be properly bound to namespace URI strings. */
17458- interface XPathNSResolver {
17459- lookupNamespaceURI(prefix: string): string | null;
17460- }
17461-
17462- declare var XPathNSResolver: {
17463- prototype: XPathNSResolver;
17464- new(): XPathNSResolver;
17465- };
17466-
1746717461/** The results generated by evaluating an XPath expression within the context of a given node. */
1746817462interface XPathResult {
1746917463 readonly booleanValue: boolean;
@@ -17473,8 +17467,8 @@ interface XPathResult {
1747317467 readonly singleNodeValue: Node | null;
1747417468 readonly snapshotLength: number;
1747517469 readonly stringValue: string;
17476- iterateNext(): Node;
17477- snapshotItem(index: number): Node;
17470+ iterateNext(): Node | null ;
17471+ snapshotItem(index: number): Node | null ;
1747817472 readonly ANY_TYPE: number;
1747917473 readonly ANY_UNORDERED_NODE_TYPE: number;
1748017474 readonly BOOLEAN_TYPE: number;
0 commit comments