@@ -1659,6 +1659,8 @@ interface EventListener {
1659
1659
(evt: Event): void;
1660
1660
}
1661
1661
1662
+ type XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; };
1663
+
1662
1664
/** 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. */
1663
1665
interface ANGLE_instanced_arrays {
1664
1666
drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void;
@@ -4139,7 +4141,7 @@ interface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndEleme
4139
4141
}
4140
4142
4141
4143
/** 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 {
4143
4145
/**
4144
4146
* Sets or gets the URL for the current document.
4145
4147
*/
@@ -4520,7 +4522,6 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
4520
4522
*/
4521
4523
elementFromPoint(x: number, y: number): Element | null;
4522
4524
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;
4524
4525
/**
4525
4526
* Executes a command on the current document, current selection, or the given range.
4526
4527
* @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: {
17433
17434
};
17434
17435
17435
17436
/** 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 {
17440
17438
}
17441
17439
17442
17440
declare var XPathEvaluator: {
17443
17441
prototype: XPathEvaluator;
17444
17442
new(): XPathEvaluator;
17445
17443
};
17446
17444
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
+
17447
17451
/** This interface is a compiled XPath expression that can be evaluated on a document or specific node to return information its DOM tree. */
17448
17452
interface XPathExpression {
17449
- evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult;
17453
+ evaluate(contextNode: Node, type? : number, result? : XPathResult | null): XPathResult;
17450
17454
}
17451
17455
17452
17456
declare var XPathExpression: {
17453
17457
prototype: XPathExpression;
17454
17458
new(): XPathExpression;
17455
17459
};
17456
17460
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
-
17467
17461
/** The results generated by evaluating an XPath expression within the context of a given node. */
17468
17462
interface XPathResult {
17469
17463
readonly booleanValue: boolean;
@@ -17473,8 +17467,8 @@ interface XPathResult {
17473
17467
readonly singleNodeValue: Node | null;
17474
17468
readonly snapshotLength: number;
17475
17469
readonly stringValue: string;
17476
- iterateNext(): Node;
17477
- snapshotItem(index: number): Node;
17470
+ iterateNext(): Node | null ;
17471
+ snapshotItem(index: number): Node | null ;
17478
17472
readonly ANY_TYPE: number;
17479
17473
readonly ANY_UNORDERED_NODE_TYPE: number;
17480
17474
readonly BOOLEAN_TYPE: number;
0 commit comments