@getodk/xpath 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ export type AdapterAttribute<T extends XPathNode> = Extract<T, XPathAttribute>;
6
6
  export type AdapterText<T extends XPathNode> = Extract<T, XPathText>;
7
7
  export type AdapterComment<T extends XPathNode> = Extract<T, XPathComment>;
8
8
  export type AdapterProcessingInstruction<T extends XPathNode> = Extract<T, XPathProcessingInstruction>;
9
+ export type AdapterNode<T extends XPathNode> = AdapterChildNode<T> | AdapterParentNode<T>;
9
10
  export type AdapterParentNode<T extends XPathNode> = AdapterDocument<T> | AdapterElement<T>;
10
11
  export type AdapterChildNode<T extends XPathNode> = AdapterElement<T> | AdapterText<T> | AdapterComment<T> | AdapterAttribute<T> | AdapterProcessingInstruction<T>;
11
12
  export type AdapterQualifiedNamedNode<T extends XPathNode> = AdapterElement<T> | AdapterAttribute<T>;
@@ -1,5 +1,5 @@
1
1
  import { XPathNode } from './XPathNode.ts';
2
- import { AdapterAttribute, AdapterChildNode, AdapterDocument, AdapterElement, AdapterNamespaceDeclaration, AdapterParentNode } from './XPathNodeKindAdapter.ts';
2
+ import { AdapterAttribute, AdapterChildNode, AdapterDocument, AdapterElement, AdapterNamespaceDeclaration, AdapterNode } from './XPathNodeKindAdapter.ts';
3
3
  export type DocumentOrderComparison = -1 | 0 | 1;
4
4
  export interface XPathTraversalAdapter<T extends XPathNode> {
5
5
  /**
@@ -14,7 +14,7 @@ export interface XPathTraversalAdapter<T extends XPathNode> {
14
14
  readonly getContainingDocument: (node: T) => AdapterDocument<T>;
15
15
  readonly getNamespaceDeclarations: (node: T) => ReadonlyArray<AdapterNamespaceDeclaration<T>>;
16
16
  readonly getAttributes: (node: T) => ReadonlyArray<AdapterAttribute<T>>;
17
- readonly getParentNode: (node: T) => AdapterParentNode<T> | null;
17
+ readonly getParentNode: (node: T) => AdapterNode<T> | null;
18
18
  readonly getChildNodes: (node: T) => ReadonlyArray<AdapterChildNode<T>>;
19
19
  readonly getChildElements: (node: T) => ReadonlyArray<AdapterElement<T>>;
20
20
  readonly getPreviousSiblingNode: (node: T) => AdapterChildNode<T> | null;
@@ -23,6 +23,7 @@ export interface EvaluatorNodeConvenienceMethodOptions<T extends XPathNode, Asse
23
23
  readonly assertExists?: AssertExists;
24
24
  }
25
25
  type EvaluatedNode<T extends XPathNode, U extends T | UnwrapAdapterNode<T>, AssertExists extends boolean> = AssertExists extends true ? U : U | null;
26
+ export declare const clearCache: () => void;
26
27
  export declare class Evaluator<T extends XPathNode> {
27
28
  readonly domProvider: XPathDOMProvider<T>;
28
29
  protected readonly parser: ExpressionParser;
@@ -31,6 +31,7 @@ export declare const staticNamespaces: StaticNamespaces<"xf", "http://www.w3.org
31
31
  readonly xml: "http://www.w3.org/XML/1998/namespace";
32
32
  readonly xmlns: "http://www.w3.org/2000/xmlns/";
33
33
  }>;
34
+ export declare const clearCache: () => void;
34
35
  type XPathNSResolverFunction = (prefix: string | null) => string | null;
35
36
  interface XPathNSResolverObject {
36
37
  readonly lookupNamespaceURI: XPathNSResolverFunction;
@@ -1,3 +1,5 @@
1
+ import { BooleanFunction } from '../../evaluator/functions/BooleanFunction.ts';
1
2
  import { NumberFunction } from '../../evaluator/functions/NumberFunction.ts';
2
3
  export declare const area: NumberFunction;
3
4
  export declare const distance: NumberFunction;
5
+ export declare const geofence: BooleanFunction;
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@
18
18
  * - - -
19
19
  */
20
20
  export type * from './evaluator/Evaluator.ts';
21
- export { Evaluator } from './evaluator/Evaluator.ts';
21
+ export { clearCache, Evaluator } from './evaluator/Evaluator.ts';
22
22
  /**
23
23
  * - - -
24
24
  * {@link XPathDOMAdapter}, associated values and types