@getodk/xpath 0.1.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.
Files changed (104) hide show
  1. package/README.md +158 -0
  2. package/dist/.vite/manifest.json +21 -0
  3. package/dist/context/Context.d.ts +27 -0
  4. package/dist/context/EvaluationContext.d.ts +48 -0
  5. package/dist/evaluations/BooleanEvaluation.d.ts +12 -0
  6. package/dist/evaluations/DateTimeLikeEvaluation.d.ts +23 -0
  7. package/dist/evaluations/Evaluation.d.ts +18 -0
  8. package/dist/evaluations/EvaluationType.d.ts +7 -0
  9. package/dist/evaluations/LocationPathEvaluation.d.ts +113 -0
  10. package/dist/evaluations/NodeEvaluation.d.ts +22 -0
  11. package/dist/evaluations/NumberEvaluation.d.ts +12 -0
  12. package/dist/evaluations/StringEvaluation.d.ts +13 -0
  13. package/dist/evaluations/ValueEvaluation.d.ts +24 -0
  14. package/dist/evaluator/Evaluator.d.ts +41 -0
  15. package/dist/evaluator/NamespaceResolver.d.ts +48 -0
  16. package/dist/evaluator/expression/AbsoluteLocationPathExpressionEvaluator.d.ts +7 -0
  17. package/dist/evaluator/expression/BinaryExpressionEvaluator.d.ts +11 -0
  18. package/dist/evaluator/expression/BooleanBinaryExpressionEvaluator.d.ts +17 -0
  19. package/dist/evaluator/expression/ExpressionEvaluator.d.ts +8 -0
  20. package/dist/evaluator/expression/FilterPathExpressionEvaluator.d.ts +12 -0
  21. package/dist/evaluator/expression/FunctionCallExpressionEvaluator.d.ts +16 -0
  22. package/dist/evaluator/expression/LocationPathEvaluator.d.ts +23 -0
  23. package/dist/evaluator/expression/LocationPathExpressionEvaluator.d.ts +8 -0
  24. package/dist/evaluator/expression/NumberExpressionEvaluator.d.ts +10 -0
  25. package/dist/evaluator/expression/NumberLiteralExpressionEvaluator.d.ts +8 -0
  26. package/dist/evaluator/expression/NumericBinaryExpressionEvaluator.d.ts +12 -0
  27. package/dist/evaluator/expression/RelativeLocationPathExpressionEvaluator.d.ts +7 -0
  28. package/dist/evaluator/expression/StringExpressionEvaluator.d.ts +10 -0
  29. package/dist/evaluator/expression/StringLiteralExpressionEvaluator.d.ts +8 -0
  30. package/dist/evaluator/expression/UnaryExpressionEvaluator.d.ts +10 -0
  31. package/dist/evaluator/expression/UnionExpressionEvaluator.d.ts +11 -0
  32. package/dist/evaluator/expression/factory.d.ts +5 -0
  33. package/dist/evaluator/functions/BooleanFunction.d.ts +6 -0
  34. package/dist/evaluator/functions/FunctionAlias.d.ts +4 -0
  35. package/dist/evaluator/functions/FunctionImplementation.d.ts +39 -0
  36. package/dist/evaluator/functions/FunctionLibrary.d.ts +21 -0
  37. package/dist/evaluator/functions/FunctionLibraryCollection.d.ts +41 -0
  38. package/dist/evaluator/functions/NodeSetFunction.d.ts +7 -0
  39. package/dist/evaluator/functions/NumberFunction.d.ts +6 -0
  40. package/dist/evaluator/functions/StringFunction.d.ts +6 -0
  41. package/dist/evaluator/functions/TypedFunctionImplementation.d.ts +8 -0
  42. package/dist/evaluator/functions/index.d.ts +1 -0
  43. package/dist/evaluator/result/BaseResult.d.ts +34 -0
  44. package/dist/evaluator/result/BooleanResult.d.ts +12 -0
  45. package/dist/evaluator/result/NodeSetResult.d.ts +55 -0
  46. package/dist/evaluator/result/NumberResult.d.ts +12 -0
  47. package/dist/evaluator/result/PrimitiveResult.d.ts +12 -0
  48. package/dist/evaluator/result/ResultType.d.ts +13 -0
  49. package/dist/evaluator/result/StringResult.d.ts +12 -0
  50. package/dist/evaluator/result/index.d.ts +7 -0
  51. package/dist/evaluator/step/Step.d.ts +129 -0
  52. package/dist/expressionParser-1Kzq3bIy.js +2356 -0
  53. package/dist/expressionParser-1Kzq3bIy.js.map +1 -0
  54. package/dist/expressionParser.d.ts +2 -0
  55. package/dist/expressionParser.js +2 -0
  56. package/dist/expressionParser.js.map +1 -0
  57. package/dist/functions/_shared/number.d.ts +11 -0
  58. package/dist/functions/_shared/string.d.ts +3 -0
  59. package/dist/functions/enketo/index.d.ts +2 -0
  60. package/dist/functions/fn/boolean.d.ts +8 -0
  61. package/dist/functions/fn/index.d.ts +2 -0
  62. package/dist/functions/fn/node-set.d.ts +11 -0
  63. package/dist/functions/fn/number.d.ts +7 -0
  64. package/dist/functions/fn/string.d.ts +13 -0
  65. package/dist/functions/javarosa/index.d.ts +2 -0
  66. package/dist/functions/javarosa/string.d.ts +2 -0
  67. package/dist/functions/xforms/boolean.d.ts +6 -0
  68. package/dist/functions/xforms/datetime.d.ts +10 -0
  69. package/dist/functions/xforms/geo.d.ts +3 -0
  70. package/dist/functions/xforms/index.d.ts +2 -0
  71. package/dist/functions/xforms/node-set.d.ts +8 -0
  72. package/dist/functions/xforms/number.d.ts +29 -0
  73. package/dist/functions/xforms/select.d.ts +6 -0
  74. package/dist/functions/xforms/string.d.ts +10 -0
  75. package/dist/index.d.ts +3 -0
  76. package/dist/index.js +31976 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/lib/collections/sort.d.ts +1 -0
  79. package/dist/lib/datetime/coercion.d.ts +4 -0
  80. package/dist/lib/datetime/constants.d.ts +6 -0
  81. package/dist/lib/datetime/functions.d.ts +5 -0
  82. package/dist/lib/datetime/predicates.d.ts +5 -0
  83. package/dist/lib/dom/assertions.d.ts +4 -0
  84. package/dist/lib/dom/predicates.d.ts +11 -0
  85. package/dist/lib/dom/sort.d.ts +1 -0
  86. package/dist/lib/dom/traversal.d.ts +21 -0
  87. package/dist/lib/dom/types.d.ts +21 -0
  88. package/dist/lib/dom/xml.d.ts +1 -0
  89. package/dist/lib/iterators/Reiterable.d.ts +15 -0
  90. package/dist/lib/iterators/common.d.ts +17 -0
  91. package/dist/lib/iterators/index.d.ts +3 -0
  92. package/dist/lib/regex/escape.d.ts +1 -0
  93. package/dist/shared/constants.d.ts +13 -0
  94. package/dist/shared/index.d.ts +2 -0
  95. package/dist/shared/interface.d.ts +33 -0
  96. package/dist/static/grammar/ExpressionParser.d.ts +27 -0
  97. package/dist/static/grammar/SyntaxLanguage.d.ts +5 -0
  98. package/dist/static/grammar/SyntaxNode.d.ts +144 -0
  99. package/dist/static/grammar/SyntaxTree.d.ts +6 -0
  100. package/dist/static/grammar/TreeSitterXPathParser.d.ts +38 -0
  101. package/dist/static/grammar/type-names.d.ts +89 -0
  102. package/dist/xforms/XFormsItextTranslations.d.ts +26 -0
  103. package/dist/xforms/XFormsXPathEvaluator.d.ts +18 -0
  104. package/package.json +76 -0
@@ -0,0 +1 @@
1
+ export declare const seededRandomize: <T>(values: readonly T[], seed?: number) => T[];
@@ -0,0 +1,4 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ export declare const tryParseDateString: (value: string) => Date | null;
3
+ export declare const dateTimeFromString: (timeZone: Temporal.TimeZone, value: string) => Temporal.ZonedDateTime | null;
4
+ export declare const dateTimeFromNumber: (timeZone: Temporal.TimeZone, milliseconds: number) => Temporal.ZonedDateTime | null;
@@ -0,0 +1,6 @@
1
+ export declare const DAY_MILLISECONDS: number;
2
+ export declare const MILLISECOND_NANOSECONDS: bigint;
3
+ export declare const ISO_DATE_LIKE_PATTERN: RegExp;
4
+ export declare const ISO_TIME_LIKE_PATTERN: RegExp;
5
+ export declare const ISO_DATE_TIME_LIKE_PATTERN: RegExp;
6
+ export declare const ISO_DATE_OR_DATE_TIME_LIKE_PATTERN: RegExp;
@@ -0,0 +1,5 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ export declare const currentLocalDateTimeString: (timeZone: Temporal.TimeZone) => string;
3
+ export declare const localDateTimeString: (dateTime: Temporal.ZonedDateTime) => string;
4
+ export declare const localDateTimeOrDateString: (dateTime: Temporal.ZonedDateTime) => string;
5
+ export declare const now: (timeZone: Temporal.TimeZone) => Temporal.ZonedDateTime;
@@ -0,0 +1,5 @@
1
+ export declare const isISODateLike: (value: string) => boolean;
2
+ export declare const isISOTimeLike: (value: string) => boolean;
3
+ export declare const isISODateTimeLike: (value: string) => boolean;
4
+ export declare const isISODateOrDateTimeLike: (value: string) => boolean;
5
+ export declare const isValidTimeString: (value: string) => boolean;
@@ -0,0 +1,4 @@
1
+ import type { ContextParentNode } from './types.ts';
2
+ type AssertParentNode = (node: Node) => asserts node is ContextParentNode;
3
+ export declare const assertParentNode: AssertParentNode;
4
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { NamespaceAttribute } from './types';
2
+ export declare const isAttributeNode: (node: Node) => node is Attr;
3
+ export declare const isNamespaceAttribute: (attr: Attr) => attr is NamespaceAttribute;
4
+ export declare const isNamespaceNode: (node: Node) => node is NamespaceAttribute;
5
+ export declare const isCDataSection: (node: Node) => node is CDATASection;
6
+ export declare const isCommentNode: (node: Node) => node is Comment;
7
+ export declare const isDocumentNode: (node: Node) => node is Document;
8
+ export declare const isDocumentFragmentNode: (node: Node) => node is DocumentFragment;
9
+ export declare const isElementNode: (node: Node) => node is Element;
10
+ export declare const isProcessingInstructionNode: (node: Node) => node is ProcessingInstruction;
11
+ export declare const isTextNode: (node: Node) => node is Text;
@@ -0,0 +1 @@
1
+ export declare const sortDocumentOrder: (nodes: Iterable<Node>) => Node[];
@@ -0,0 +1,21 @@
1
+ import type { ContextDocument, ContextNode, ContextParentNode } from './types.ts';
2
+ export declare const getDocument: (node: Node) => Document;
3
+ export declare const getRootNode: (node: ContextNode) => ContextParentNode;
4
+ export declare const TreeWalkerFilter: {
5
+ readonly ANY: 975;
6
+ readonly ELEMENT: 1;
7
+ readonly TEXT: 12;
8
+ readonly COMMENT: 128;
9
+ readonly PROCESSING_INSTRUCTION: 64;
10
+ };
11
+ type TreeWalkerFilters = typeof TreeWalkerFilter;
12
+ export type TreeWalkerFilter = keyof TreeWalkerFilters;
13
+ export type TreeWalkerFilterFlag = TreeWalkerFilters[TreeWalkerFilter];
14
+ export type FilteredTreeWalker<Filter extends TreeWalkerFilter = TreeWalkerFilter> = TreeWalker & {
15
+ readonly whatToShow: TreeWalkerFilters[Filter];
16
+ };
17
+ export declare const getTreeWalker: <Filter extends "ELEMENT" | "ANY" | "COMMENT" | "PROCESSING_INSTRUCTION" | "TEXT" = "ANY">(contextDocument: ContextDocument, contextNode?: ContextNode, filter?: Filter) => FilteredTreeWalker<Filter>;
18
+ export type FilteredTreeWalkers = {
19
+ readonly [Filter in TreeWalkerFilter]: FilteredTreeWalker<Filter>;
20
+ };
21
+ export {};
@@ -0,0 +1,21 @@
1
+ export type ContextDocument = Document | XMLDocument;
2
+ type AnyContextNode = Attr | CDATASection | Comment | ContextDocument | DocumentType | Element | ProcessingInstruction | Text;
3
+ type MaybeNode<T extends Node> = Node & Partial<Omit<T, keyof Node>>;
4
+ export type MaybeAttrNode = MaybeNode<Attr>;
5
+ export type MaybeElementNode = AnyContextNode & Node & Partial<Element>;
6
+ export type MaybeProcessingInstructionNode = MaybeNode<ProcessingInstruction>;
7
+ export type MaybeNamedNode = MaybeNode<MaybeAttrNode | MaybeElementNode>;
8
+ export type ContextNode = AnyContextNode & Node;
9
+ export type MaybeDocumentOrElementNode = MaybeElementNode & Partial<ContextDocument>;
10
+ export type AnyParentNode = Extract<AnyContextNode, {
11
+ readonly children: any;
12
+ }>;
13
+ export type ContextParentNode = AnyParentNode & Node;
14
+ type AnyNamedNode = Attr | Element | ProcessingInstruction;
15
+ export type NamedNode = AnyNamedNode & Node;
16
+ export type NamespaceAttribute = Attr & ({
17
+ readonly name: 'xmlns';
18
+ } | {
19
+ readonly prefix: 'xmlns';
20
+ });
21
+ export {};
@@ -0,0 +1 @@
1
+ export declare const parseXMLDocument: (xml: string) => Document;
@@ -0,0 +1,15 @@
1
+ type BooleanPredicate<T> = (value: T) => boolean;
2
+ export declare class Reiterable<T> implements Iterable<T> {
3
+ protected source: Iterable<T> | Iterator<T>;
4
+ static from<T>(source: Iterable<T> | Iterator<T>): Reiterable<T>;
5
+ protected active: IterableIterator<T>;
6
+ protected cache: T[];
7
+ protected constructor(source: Iterable<T> | Iterator<T>);
8
+ [Symbol.iterator](): Iterator<T>;
9
+ entries(): IterableIterator<readonly [key: number, value: T]>;
10
+ keys(): IterableIterator<number>;
11
+ values(): IterableIterator<T>;
12
+ first(): T | void;
13
+ some(predicate: BooleanPredicate<T>): boolean;
14
+ }
15
+ export {};
@@ -0,0 +1,17 @@
1
+ type Iter<T> = Iterable<T> | Iterator<T>;
2
+ export declare function toIterableIterator<T>(iter: Iter<T>): IterableIterator<T>;
3
+ type MapIterated<T, U> = (value: T) => U;
4
+ export type MapIterable<T, U> = (iterable: Iter<T>) => IterableIterator<U>;
5
+ export declare const map: <T, U>(fn: MapIterated<T, U>) => MapIterable<T, U>;
6
+ export declare const eager: <T>(iterable: Iter<T>) => IterableIterator<T>;
7
+ type TypedGuardIterated<T, U extends T> = (value: T) => value is U;
8
+ type PredicateGuardIterated<T> = (value: T) => boolean;
9
+ type GuardIterated<T, U extends T> = PredicateGuardIterated<T & U> | TypedGuardIterated<T, U>;
10
+ type UnguardedIterated<Guard extends GuardIterated<any, any>> = Guard extends TypedGuardIterated<infer T, any> ? T : Guard extends PredicateGuardIterated<infer T> ? T : never;
11
+ type GuardedIterated<Guard extends GuardIterated<any, any>> = Guard extends TypedGuardIterated<infer T, infer U> ? T & U : Guard extends PredicateGuardIterated<infer T> ? T : never;
12
+ type FilterIterable<Guard extends GuardIterated<any, any>> = MapIterable<UnguardedIterated<Guard>, GuardedIterated<Guard>>;
13
+ export declare const filter: <Guard extends GuardIterated<any, any>>(guard: Guard) => FilterIterable<Guard>;
14
+ export declare const distinct: <T>(iterable: Iterable<T>) => Generator<T, void, unknown>;
15
+ type TeeResult<T> = [IterableIterator<T>, IterableIterator<T>];
16
+ export declare const tee: <T>(input: Iterable<T> | Iterator<T, any, undefined>) => TeeResult<T>;
17
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from 'itertools-ts';
2
+ export * from './common.ts';
3
+ export * from './Reiterable.ts';
@@ -0,0 +1 @@
1
+ export declare const escapeRegExp: (value: string) => string;
@@ -0,0 +1,13 @@
1
+ export declare const XPathResultTypes: {
2
+ readonly ANY_TYPE: 0;
3
+ readonly NUMBER_TYPE: 1;
4
+ readonly STRING_TYPE: 2;
5
+ readonly BOOLEAN_TYPE: 3;
6
+ readonly UNORDERED_NODE_ITERATOR_TYPE: 4;
7
+ readonly ORDERED_NODE_ITERATOR_TYPE: 5;
8
+ readonly UNORDERED_NODE_SNAPSHOT_TYPE: 6;
9
+ readonly ORDERED_NODE_SNAPSHOT_TYPE: 7;
10
+ readonly ANY_UNORDERED_NODE_TYPE: 8;
11
+ readonly FIRST_ORDERED_NODE_TYPE: 9;
12
+ };
13
+ export type XPathResultTypes = typeof XPathResultTypes;
@@ -0,0 +1,2 @@
1
+ export * from './constants.ts';
2
+ export type * from './interface.ts';
@@ -0,0 +1,33 @@
1
+ type LookupNamespaceURI = (prefix: string | null) => string | null;
2
+ export interface XPathNamespaceResolverObject {
3
+ readonly lookupNamespaceURI: LookupNamespaceURI;
4
+ }
5
+ export type XPathNSResolver = LookupNamespaceURI | XPathNamespaceResolverObject;
6
+ interface XPathResultStatic {
7
+ readonly ANY_TYPE: 0;
8
+ readonly NUMBER_TYPE: 1;
9
+ readonly STRING_TYPE: 2;
10
+ readonly BOOLEAN_TYPE: 3;
11
+ readonly UNORDERED_NODE_ITERATOR_TYPE: 4;
12
+ readonly ORDERED_NODE_ITERATOR_TYPE: 5;
13
+ readonly UNORDERED_NODE_SNAPSHOT_TYPE: 6;
14
+ readonly ORDERED_NODE_SNAPSHOT_TYPE: 7;
15
+ readonly ANY_UNORDERED_NODE_TYPE: 8;
16
+ readonly FIRST_ORDERED_NODE_TYPE: 9;
17
+ }
18
+ export type XPathResultType = XPathResultStatic[keyof XPathResultStatic];
19
+ export interface XPathResult extends XPathResultStatic {
20
+ readonly booleanValue: boolean;
21
+ readonly invalidIteratorState: boolean;
22
+ readonly numberValue: number;
23
+ readonly resultType: XPathResultType;
24
+ readonly singleNodeValue: Node | null;
25
+ readonly snapshotLength: number;
26
+ readonly stringValue: string;
27
+ iterateNext(): Node | null;
28
+ snapshotItem(index: number): Node | null;
29
+ }
30
+ export interface AnyXPathEvaluator {
31
+ evaluate(expression: string, contextNode: Node, namespaceResolver: XPathNSResolver | null, resultType: XPathResultType | null): XPathResult;
32
+ }
33
+ export {};
@@ -0,0 +1,27 @@
1
+ import { UpsertableMap } from '../../../../common/src/lib/collections/UpsertableMap.ts';
2
+ import type { SyntaxLanguageTypeName, SyntaxLanguage as TreeSitterLanguage } from './SyntaxLanguage.ts';
3
+ import type { XPathNode } from './SyntaxNode.ts';
4
+ import { type SyntaxTree as TreeSitterTree } from './SyntaxTree.ts';
5
+ import { TreeSitterXPathParser, type WebAssemblyResourceSpecifiers } from './TreeSitterXPathParser.ts';
6
+ declare class SyntaxLanguage implements TreeSitterLanguage {
7
+ readonly types: readonly SyntaxLanguageTypeName[];
8
+ constructor(tsLanguage: TreeSitterLanguage);
9
+ }
10
+ declare class SyntaxTree implements TreeSitterTree {
11
+ readonly language: SyntaxLanguage;
12
+ readonly rootNode: XPathNode;
13
+ constructor(tsTree: TreeSitterTree);
14
+ }
15
+ export interface ParseOptions {
16
+ readonly attemptErrorRecovery?: boolean;
17
+ }
18
+ export type BaseParser = ExpressionParser | TreeSitterXPathParser;
19
+ export declare class ExpressionParser {
20
+ protected readonly xpathParser: TreeSitterXPathParser;
21
+ static from(baseParser: BaseParser): ExpressionParser;
22
+ static init(resources: WebAssemblyResourceSpecifiers): Promise<ExpressionParser>;
23
+ protected constructor(xpathParser: TreeSitterXPathParser);
24
+ protected readonly cache: UpsertableMap<string, SyntaxTree>;
25
+ parse(expression: string, options?: ParseOptions): SyntaxTree;
26
+ }
27
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { AnySyntaxType } from './type-names.ts';
2
+ export type SyntaxLanguageTypeName = AnySyntaxType | undefined;
3
+ export interface SyntaxLanguage {
4
+ readonly types: readonly SyntaxLanguageTypeName[];
5
+ }
@@ -0,0 +1,144 @@
1
+ import type { AbbreviatedAbsoluteLocationPathType, AbbreviatedAxisTestType, AbbreviatedStepType, AbsoluteLocationPathType, AbsoluteRootLocationPathType, AdditionExprType, AndExprType, AnyBinaryExprType, AnySyntaxType, AnyUnaryExprType, ArgumentType, AxisNameType, AxisTestType, DivisionExprType, EqExprType, ExprType, FilterExprType, FilterPathExprType, FunctionCallType, FunctionNameType, GteExprType, GtExprType, LiteralType, LocalPartType, LteExprType, LtExprType, ModuloExprType, MultiplicationExprType, NeExprType, NodeTestType, NodeTypeTestType, NumberType, OrExprType, ParentType, PredicateType, PrefixedNameType, PrefixedWildcardNameTestType, PrefixType, ProcessingInstructionNameTestType, RelativeLocationPathType, RelativeStepSyntaxLiteral, SelfType, StepType, SubtractionExprType, UnionExprType, UnprefixedNameType, UnprefixedWildcardNameTestType, VariableReferenceType, XPathType } from './type-names.ts';
2
+ export interface SyntaxNode<Type extends AnySyntaxType, Children extends readonly UnknownSyntaxNode[], Text extends string = string> {
3
+ readonly type: Type;
4
+ readonly childCount: Children['length'];
5
+ readonly children: Children;
6
+ readonly text: Text;
7
+ child<Index extends number>(index: Index): `${Index}` extends keyof Children ? Children[Index] : Exclude<Children[Index], undefined> | null;
8
+ child(index: number): Exclude<Children[number], undefined> | null;
9
+ }
10
+ export interface ASyntaxNode extends SyntaxNode<AnySyntaxType, readonly ASyntaxNode[]> {
11
+ }
12
+ export interface UnknownSyntaxNode extends SyntaxNode<any, any> {
13
+ }
14
+ export interface TerminalSyntaxNode<Type extends AnySyntaxType> extends SyntaxNode<Type, readonly []> {
15
+ }
16
+ export interface UnaryExprSyntaxNode<Type extends AnyUnaryExprType> extends SyntaxNode<Type, readonly [AnyExprNode]> {
17
+ }
18
+ export interface BinaryExprSyntaxNode<Type extends AnyBinaryExprType> extends SyntaxNode<Type, readonly [AnyExprNode, AnyExprNode]> {
19
+ }
20
+ export interface TerminalTextLiteralSyntaxNode<Type extends AnySyntaxType, Text extends string> extends SyntaxNode<Type, readonly [], Text> {
21
+ }
22
+ export interface XPathNode extends SyntaxNode<XPathType, readonly [ExprNode]> {
23
+ }
24
+ export interface ExprNode extends SyntaxNode<ExprType, readonly [AnyExprNode]> {
25
+ }
26
+ export interface UnaryExprNode extends UnaryExprSyntaxNode<AnyUnaryExprType> {
27
+ }
28
+ export interface AdditionExprNode extends BinaryExprSyntaxNode<AdditionExprType> {
29
+ }
30
+ export interface AndExprNode extends BinaryExprSyntaxNode<AndExprType> {
31
+ }
32
+ export interface DivisionExprNode extends BinaryExprSyntaxNode<DivisionExprType> {
33
+ }
34
+ export interface EqExprNode extends BinaryExprSyntaxNode<EqExprType> {
35
+ }
36
+ export interface GtExprNode extends BinaryExprSyntaxNode<GtExprType> {
37
+ }
38
+ export interface GteExprNode extends BinaryExprSyntaxNode<GteExprType> {
39
+ }
40
+ export interface LtExprNode extends BinaryExprSyntaxNode<LtExprType> {
41
+ }
42
+ export interface LteExprNode extends BinaryExprSyntaxNode<LteExprType> {
43
+ }
44
+ export interface ModuloExprNode extends BinaryExprSyntaxNode<ModuloExprType> {
45
+ }
46
+ export interface MultiplicationExprNode extends BinaryExprSyntaxNode<MultiplicationExprType> {
47
+ }
48
+ export interface NeExprNode extends BinaryExprSyntaxNode<NeExprType> {
49
+ }
50
+ export interface OrExprNode extends BinaryExprSyntaxNode<OrExprType> {
51
+ }
52
+ export interface SubtractionExprNode extends BinaryExprSyntaxNode<SubtractionExprType> {
53
+ }
54
+ export interface UnionExprNode extends BinaryExprSyntaxNode<UnionExprType> {
55
+ }
56
+ type AnyUnaryExprNode = UnaryExprNode;
57
+ export type AnyBinaryExprNode = AdditionExprNode | AndExprNode | DivisionExprNode | EqExprNode | GteExprNode | GtExprNode | LteExprNode | LtExprNode | ModuloExprNode | MultiplicationExprNode | NeExprNode | OrExprNode | SubtractionExprNode | UnionExprNode;
58
+ export type FilterExprNodes = readonly [ExprNode] | readonly [FunctionCallNode] | readonly [LiteralNode] | readonly [NumberNode];
59
+ export interface FilterExprNode extends SyntaxNode<FilterExprType, FilterExprNodes> {
60
+ }
61
+ export interface FilterPathExprNode extends SyntaxNode<FilterPathExprType, readonly [FilterExprNode, ...Array<RelativeStepSyntaxLiteralNode | StepNode>]> {
62
+ }
63
+ type AbsoluteLocationPathNodes = readonly [AbbreviatedAbsoluteLocationPathNode] | readonly [AbsoluteRootLocationPathNode, ...RelativeLocationPathNodes];
64
+ export interface AbsoluteLocationPathNode extends SyntaxNode<AbsoluteLocationPathType, AbsoluteLocationPathNodes> {
65
+ }
66
+ export interface AbsoluteRootLocationPathNode extends TerminalTextLiteralSyntaxNode<AbsoluteRootLocationPathType, '/'> {
67
+ }
68
+ type RelativeLocationPathNodes = readonly [
69
+ StepNode,
70
+ ...Array<RelativeStepSyntaxLiteralNode | StepNode>
71
+ ];
72
+ export interface RelativeLocationPathNode extends SyntaxNode<RelativeLocationPathType, RelativeLocationPathNodes> {
73
+ }
74
+ export interface AbbreviatedAbsoluteLocationPathNode extends SyntaxNode<AbbreviatedAbsoluteLocationPathType, readonly [RelativeStepSyntaxLiteralNode, ...RelativeLocationPathNodes]> {
75
+ }
76
+ export interface AbbreviatedAxisTestNode extends SyntaxNode<AbbreviatedAxisTestType, readonly [NameTestNode]> {
77
+ }
78
+ export interface AbbreviatedStepNode extends TerminalTextLiteralSyntaxNode<AbbreviatedStepType, '..' | '.'> {
79
+ }
80
+ export type AxisNameText = 'ancestor-or-self' | 'ancestor' | 'attribute' | 'child' | 'descendant-or-self' | 'descendant' | 'following-sibling' | 'following' | 'namespace' | 'parent' | 'preceding-sibling' | 'preceding' | 'self';
81
+ export interface AxisNameNode extends TerminalTextLiteralSyntaxNode<AxisNameType, AxisNameText> {
82
+ }
83
+ export interface AxisTestNode extends SyntaxNode<AxisTestType, readonly [AxisNameNode, ...NodeTestNodes]> {
84
+ }
85
+ export type NameTestNode = ExplicitNameNode | PrefixedWildcardNameTestNode | UnprefixedWildcardNameTestNode;
86
+ export type NodeTypeTest = 'comment' | 'node' | 'processing-instruction' | 'text';
87
+ export type NodeTypeTestText = `${NodeTypeTest}${string}`;
88
+ export interface NodeTypeTestNode extends TerminalTextLiteralSyntaxNode<NodeTypeTestType, NodeTypeTestText> {
89
+ }
90
+ export interface ProcessingInstructionNameTestNode extends SyntaxNode<ProcessingInstructionNameTestType, readonly [LiteralNode]> {
91
+ }
92
+ export type NodeTestNodes = readonly [NameTestNode] | readonly [NodeTypeTestNode] | readonly [ProcessingInstructionNameTestNode];
93
+ export interface NodeTestNode extends SyntaxNode<NodeTestType, NodeTestNodes> {
94
+ }
95
+ type StepTestNode = AbbreviatedAxisTestNode | AxisTestNode | NodeTestNode;
96
+ type StepNodes = readonly [AbbreviatedStepNode] | readonly [StepTestNode, ...PredicateNode[]];
97
+ export interface StepNode extends SyntaxNode<StepType, StepNodes> {
98
+ }
99
+ export interface ParentNode extends TerminalTextLiteralSyntaxNode<ParentType, '..'> {
100
+ }
101
+ export interface SelfNode extends TerminalTextLiteralSyntaxNode<SelfType, '.'> {
102
+ }
103
+ export interface PredicateNode extends SyntaxNode<PredicateType, readonly [ExprNode]> {
104
+ }
105
+ export interface RelativeStepSyntaxLiteralNode extends TerminalTextLiteralSyntaxNode<RelativeStepSyntaxLiteral, '//'> {
106
+ }
107
+ type AnyLocationPathExprNode = AbsoluteLocationPathNode | FilterPathExprNode | RelativeLocationPathNode;
108
+ type AnyLocationPathNode = AbbreviatedAbsoluteLocationPathNode | AbbreviatedAxisTestNode | AbbreviatedStepNode | AbsoluteRootLocationPathNode | AnyLocationPathExprNode | AxisNameNode | AxisTestNode | FilterExprNode | NodeTestNode | NodeTypeTestNode | ParentNode | PredicateNode | ProcessingInstructionNameTestNode | RelativeStepSyntaxLiteralNode | SelfNode | StepNode;
109
+ export interface FunctionCallNode extends SyntaxNode<FunctionCallType, readonly [FunctionNameNode, ...ArgumentNode[]]> {
110
+ }
111
+ export interface FunctionNameNode extends SyntaxNode<FunctionNameType, readonly [ExplicitNameNode]> {
112
+ }
113
+ export interface ArgumentNode extends SyntaxNode<ArgumentType, readonly [ExprNode]> {
114
+ }
115
+ type AnyFunctionNode = ArgumentNode | FunctionCallNode | FunctionNameNode;
116
+ export interface PrefixNode extends TerminalSyntaxNode<PrefixType> {
117
+ }
118
+ export interface LocalPartNode extends TerminalSyntaxNode<LocalPartType> {
119
+ }
120
+ export interface PrefixedWildcardNameTestNode extends SyntaxNode<PrefixedWildcardNameTestType, readonly [PrefixNode]> {
121
+ }
122
+ export interface UnprefixedWildcardNameTestNode extends TerminalSyntaxNode<UnprefixedWildcardNameTestType> {
123
+ }
124
+ export interface PrefixedNameNode extends SyntaxNode<PrefixedNameType, readonly [PrefixNode, LocalPartNode]> {
125
+ }
126
+ export interface UnprefixedNameNode extends TerminalSyntaxNode<UnprefixedNameType> {
127
+ }
128
+ type ExplicitNameNode = PrefixedNameNode | UnprefixedNameNode;
129
+ export type AnyNameNode = LocalPartNode | PrefixedNameNode | PrefixedWildcardNameTestNode | PrefixNode | UnprefixedNameNode | UnprefixedWildcardNameTestNode;
130
+ export interface NumberNode extends TerminalSyntaxNode<NumberType> {
131
+ }
132
+ export interface LiteralNode extends TerminalSyntaxNode<LiteralType> {
133
+ }
134
+ type AnyLiteralNode = LiteralNode | NumberNode;
135
+ export interface VariableReferenceNode extends TerminalSyntaxNode<VariableReferenceType> {
136
+ }
137
+ type AnyContextuallyScopedNode = VariableReferenceNode;
138
+ export type AnyExprNode = AdditionExprNode | AndExprNode | AnyLocationPathExprNode | DivisionExprNode | EqExprNode | FunctionCallNode | GteExprNode | GtExprNode | LiteralNode | LteExprNode | LtExprNode | ModuloExprNode | MultiplicationExprNode | NeExprNode | NumberNode | OrExprNode | SubtractionExprNode | UnaryExprNode | UnionExprNode;
139
+ /**
140
+ * @alias {@link LiteralNode}
141
+ */
142
+ export type StringLiteralNode = LiteralNode;
143
+ export type AnySyntaxNode = AnyBinaryExprNode | AnyContextuallyScopedNode | AnyExprNode | AnyFunctionNode | AnyLiteralNode | AnyLocationPathNode | AnyNameNode | AnyUnaryExprNode | ExprNode | XPathNode;
144
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { SyntaxLanguage } from './SyntaxLanguage.ts';
2
+ import type { XPathNode } from './SyntaxNode.ts';
3
+ export interface SyntaxTree {
4
+ readonly language: SyntaxLanguage;
5
+ readonly rootNode: XPathNode;
6
+ }
@@ -0,0 +1,38 @@
1
+ import WebTreeSitter from 'web-tree-sitter';
2
+ type ParserConstructor = typeof WebTreeSitter;
3
+ type Parser = InstanceType<ParserConstructor>;
4
+ declare let Parser: ParserConstructor;
5
+ export interface WebAssemblyResourceSpecifiers {
6
+ readonly webTreeSitter: string;
7
+ readonly xpathLanguage: string;
8
+ }
9
+ /**
10
+ * `TreeSitterXPathParser` is a separate entry provided by @getodk/xpath as a
11
+ * simpler means to handle various conditions where the tree-sitter and
12
+ * @getodk/tree-sitter-xpath WASM resources need to be loaded before we can
13
+ * begin parsing XPath expressions.
14
+ *
15
+ * Note: Loading these resources is (for now) inherently asynchronous, as they
16
+ * are expected to be loaded with either file system or network calls. This has
17
+ * two consequences:
18
+ *
19
+ * 1. The `TreeSitterXPathParser` constructor cannot be called directly, because
20
+ * class constructors must be synchronous. As such, it is marked `protected`
21
+ * here, with the public interface being the static, async `init` method.
22
+ *
23
+ * 2. While the `init` call itself can happen in any context suited to handle
24
+ * its returned Promise, likely use cases (such as our own) will need to
25
+ * perform this async initialization upfront before (otherwise synchronous)
26
+ * XPath evaluation may proceed. This is more or less a solved problem for
27
+ * e.g. @getodk/xforms-engine, which uses ESM in environments supporting
28
+ * top-level `await`. But it will require extra consideration in environments
29
+ * which currently initialize synchronously (such as enketo-core, should we
30
+ * want to adopt this evaluator there).
31
+ */
32
+ export declare class TreeSitterXPathParser {
33
+ protected readonly parser: Parser;
34
+ static init(resources: WebAssemblyResourceSpecifiers): Promise<TreeSitterXPathParser>;
35
+ protected constructor(parser: Parser);
36
+ parse(expression: string): WebTreeSitter.Tree;
37
+ }
38
+ export {};
@@ -0,0 +1,89 @@
1
+ import type { SyntaxType, UnnamedType } from '@getodk/tree-sitter-xpath';
2
+ /**
3
+ * The root node of any parsed XPath expression's syntax tree.
4
+ *
5
+ * {@link XPathType} will _always_ have one child, of type {@link ExprType}.
6
+ *
7
+ */
8
+ export type XPathType = `${SyntaxType.Xpath}`;
9
+ /**
10
+ * A node representing any complete XPath expression or sub-expression, which
11
+ * may be either:
12
+ *
13
+ * - The direct and only child of {@link XPathType}, representing the top level
14
+ * of a parsed XPath expression.
15
+ *
16
+ * - A child of any node accepting a full sub-expression, e.g. those passed
17
+ * as arguments to a {@link FunctionCallType}
18
+ */
19
+ export type ExprType = `${SyntaxType.Expr}`;
20
+ type NonOperationExprType = FilterExprType | FilterPathExprType;
21
+ type OperationExprType = Exclude<Extract<SyntaxType, `${string}_expr`>, NonOperationExprType>;
22
+ export type UnaryExprType = `${SyntaxType.UnaryExpr}`;
23
+ export type AdditionExprType = `${SyntaxType.AdditionExpr}`;
24
+ export type AndExprType = `${SyntaxType.AndExpr}`;
25
+ export type DivisionExprType = `${SyntaxType.DivisionExpr}`;
26
+ export type EqExprType = `${SyntaxType.EqExpr}`;
27
+ export type GtExprType = `${SyntaxType.GtExpr}`;
28
+ export type GteExprType = `${SyntaxType.GteExpr}`;
29
+ export type LtExprType = `${SyntaxType.LtExpr}`;
30
+ export type LteExprType = `${SyntaxType.LteExpr}`;
31
+ export type ModuloExprType = `${SyntaxType.ModuloExpr}`;
32
+ export type MultiplicationExprType = `${SyntaxType.MultiplicationExpr}`;
33
+ export type NeExprType = `${SyntaxType.NeExpr}`;
34
+ export type OrExprType = `${SyntaxType.OrExpr}`;
35
+ export type SubtractionExprType = `${SyntaxType.SubtractionExpr}`;
36
+ export type UnionExprType = `${SyntaxType.UnionExpr}`;
37
+ export type BinaryExprType = AdditionExprType | AndExprType | DivisionExprType | EqExprType | GteExprType | GtExprType | LteExprType | LtExprType | ModuloExprType | MultiplicationExprType | NeExprType | OrExprType | SubtractionExprType | UnionExprType;
38
+ export type FilterExprType = `${SyntaxType.FilterExpr}`;
39
+ export type FilterPathExprType = `${SyntaxType.FilterPathExpr}`;
40
+ export type AbsoluteLocationPathType = `${SyntaxType.AbsoluteLocationPath}`;
41
+ export type AbsoluteRootLocationPathType = `${SyntaxType.AbsoluteRootLocationPath}`;
42
+ export type RelativeLocationPathType = `${SyntaxType.RelativeLocationPath}`;
43
+ /**
44
+ * @example ```xpath
45
+ * //any-descendant
46
+ * ```
47
+ */
48
+ export type AbbreviatedAbsoluteLocationPathType = `${SyntaxType.AbbreviatedAbsoluteLocationPath}`;
49
+ export type AbbreviatedAxisTestType = `${SyntaxType.AbbreviatedAxisTest}`;
50
+ export type AbbreviatedStepType = `${SyntaxType.AbbreviatedStep}`;
51
+ export type AxisNameType = `${SyntaxType.AxisName}`;
52
+ export type AxisTestType = `${SyntaxType.AxisTest}`;
53
+ export type NodeTestType = `${SyntaxType.NodeTest}`;
54
+ export type NodeTypeTestType = `${SyntaxType.NodeTypeTest}`;
55
+ export type ProcessingInstructionNameTestType = `${SyntaxType.ProcessingInstructionNameTest}`;
56
+ export type StepType = `${SyntaxType.Step}`;
57
+ export type ParentType = `${SyntaxType.Parent}`;
58
+ export type SelfType = `${SyntaxType.Self}`;
59
+ export type RelativeStepSyntaxLiteral = Extract<UnnamedType, '//'>;
60
+ export type PredicateType = `${SyntaxType.Predicate}`;
61
+ export type FunctionCallType = `${SyntaxType.FunctionCall}`;
62
+ export type FunctionNameType = `${SyntaxType.FunctionName}`;
63
+ export type ArgumentType = `${SyntaxType.Argument}`;
64
+ export type PrefixedNameType = `${SyntaxType.PrefixedName}`;
65
+ export type PrefixType = `${SyntaxType.Prefix}`;
66
+ export type LocalPartType = `${SyntaxType.LocalPart}`;
67
+ export type PrefixedWildcardNameTestType = `${SyntaxType.PrefixedWildcardNameTest}`;
68
+ export type UnprefixedNameType = `${SyntaxType.UnprefixedName}`;
69
+ export type UnprefixedWildcardNameTestType = `${SyntaxType.UnprefixedWildcardNameTest}`;
70
+ export type VariableReferenceType = `${SyntaxType.VariableReference}`;
71
+ export type NumberType = `${SyntaxType.Number}`;
72
+ export type LiteralType = `${SyntaxType.StringLiteral}`;
73
+ /**
74
+ * @alias {@link LiteralType}
75
+ */
76
+ export type StringLiteralType = LiteralType;
77
+ export type ErrorType = `${SyntaxType.ERROR}`;
78
+ type AnyApparentExprType = AdditionExprType | AndExprType | DivisionExprType | EqExprType | FilterPathExprType | FunctionCallType | GteExprType | GtExprType | LiteralType | LteExprType | LtExprType | ModuloExprType | MultiplicationExprType | NeExprType | NumberType | OrExprType | SubtractionExprType | UnaryExprType | UnionExprType;
79
+ export type AnyExprType = AnyApparentExprType;
80
+ export type AnyOperationExprType = OperationExprType;
81
+ export type AnyBinaryExprType = BinaryExprType;
82
+ export type AnyUnaryExprType = UnaryExprType;
83
+ export type AnyLocationPathType = AbbreviatedAbsoluteLocationPathType | AbbreviatedAxisTestType | AbbreviatedStepType | AbsoluteLocationPathType | AbsoluteRootLocationPathType | AxisNameType | AxisTestType | FilterExprType | FilterPathExprType | NodeTestType | NodeTypeTestType | ParentType | PredicateType | ProcessingInstructionNameTestType | RelativeLocationPathType | RelativeStepSyntaxLiteral | SelfType | StepType;
84
+ export type AnyFunctionType = ArgumentType | FunctionCallType | FunctionNameType;
85
+ export type AnyNameType = LocalPartType | PrefixedNameType | PrefixedWildcardNameTestType | PrefixType | UnprefixedNameType | UnprefixedWildcardNameTestType;
86
+ export type AnyLiteralType = LiteralType | NumberType;
87
+ export type AnyContextuallyScopedType = VariableReferenceType;
88
+ export type AnySyntaxType = AnyBinaryExprType | AnyContextuallyScopedType | AnyExprType | AnyFunctionType | AnyLiteralType | AnyLocationPathType | AnyNameType | AnyUnaryExprType | ExprType | XPathType;
89
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { KnownAttributeLocalNamedElement, LocalNamedElement } from '../../../common/types/dom.ts';
2
+ import type { ModelElement, XFormsXPathEvaluator } from './XFormsXPathEvaluator.ts';
3
+ export interface ItextRootElement extends LocalNamedElement<'itext'> {
4
+ }
5
+ export declare const getItextRoot: (modelElement: ModelElement) => ItextRootElement | null;
6
+ type TranslationLanguage = string;
7
+ interface TranslationTextElement extends KnownAttributeLocalNamedElement<'text', 'id'> {
8
+ }
9
+ type ItextID = string;
10
+ export declare const getTranslationTextByLanguage: (modelElement: ModelElement, language: TranslationLanguage, itextID: ItextID) => TranslationTextElement | null;
11
+ interface DefaultTextValueElement extends LocalNamedElement<'value'> {
12
+ getAttribute(name: 'form'): null;
13
+ getAttribute(name: string): string | null;
14
+ }
15
+ export declare const getDefaultTextValueElement: (textElement: TranslationTextElement) => DefaultTextValueElement | null;
16
+ export declare class XFormsItextTranslations {
17
+ protected readonly evaluator: XFormsXPathEvaluator;
18
+ protected readonly defaultLanguage: string | null;
19
+ protected readonly languages: readonly string[];
20
+ protected activeLanguage: string | null;
21
+ constructor(evaluator: XFormsXPathEvaluator);
22
+ getLanguages(): readonly string[];
23
+ getActiveLanguage(): string | null;
24
+ setActiveLanguage(language: string | null): string | null;
25
+ }
26
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { EvaluatorOptions } from '../evaluator/Evaluator.ts';
2
+ import { Evaluator } from '../evaluator/Evaluator.ts';
3
+ import type { AnyParentNode } from '../lib/dom/types.ts';
4
+ import { XFormsItextTranslations } from './XFormsItextTranslations.ts';
5
+ export interface ModelElement extends Element {
6
+ readonly localName: 'model';
7
+ }
8
+ interface XFormsXPathEvaluatorOptions extends EvaluatorOptions {
9
+ readonly rootNode: AnyParentNode;
10
+ }
11
+ export declare class XFormsXPathEvaluator extends Evaluator {
12
+ readonly rootNode: AnyParentNode;
13
+ readonly rootNodeDocument: XMLDocument;
14
+ readonly modelElement: ModelElement | null;
15
+ readonly translations: XFormsItextTranslations;
16
+ constructor(options: XFormsXPathEvaluatorOptions);
17
+ }
18
+ export {};
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@getodk/xpath",
3
+ "version": "0.1.0",
4
+ "license": "Apache-2.0",
5
+ "description": "XPath implementation for ODK Web Forms",
6
+ "type": "module",
7
+ "author": "getodk",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/getodk/web-forms",
11
+ "directory": "packages/xpath"
12
+ },
13
+ "bugs": "https://github.com/getodk/web-forms/issues",
14
+ "homepage": "https://getodk.org/",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "./expressionParser.js": {
21
+ "types": "./dist/expressionParser.d.ts",
22
+ "default": "./dist/expressionParser.js"
23
+ },
24
+ "./static/grammar/*.js": {
25
+ "types": "./dist/static/grammar/*.d.ts",
26
+ "default": "./dist/static/grammar/*.js"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "README.md"
32
+ ],
33
+ "engines": {
34
+ "node": "^18.19.1 || ^20.11.1",
35
+ "yarn": "1.22.19"
36
+ },
37
+ "scripts": {
38
+ "build": "npm-run-all -nl build:*",
39
+ "build:clean": "rimraf dist/",
40
+ "build:js": "vite build",
41
+ "dev": "vite",
42
+ "//": "echo '--continue-on-error is temporary, intent to show all test environments running in CI'",
43
+ "test": "npm-run-all --continue-on-error --print-name --print-label test-node:* test-browser:*",
44
+ "test-node:jsdom": "vitest run",
45
+ "test-browser:chromium": "BROWSER_NAME=chromium vitest run",
46
+ "test-browser:firefox": "BROWSER_NAME=firefox vitest run",
47
+ "test-browser:webkit": "BROWSER_NAME=webkit vitest run",
48
+ "test-watch:jsdom": "vitest",
49
+ "test-watch:chromium": "BROWSER_NAME=chromium vitest",
50
+ "test-watch:firefox": "BROWSER_NAME=firefox vitest",
51
+ "test-watch:webkit": "BROWSER_NAME=webkit vitest",
52
+ "test:types": "tsc --project ./tsconfig.json --emitDeclarationOnly false --noEmit"
53
+ },
54
+ "dependencies": {
55
+ "@js-temporal/polyfill": "^0.4.4",
56
+ "@getodk/common": "0.1.0",
57
+ "crypto-js": "^4.1.1",
58
+ "itertools-ts": "^1.23.0"
59
+ },
60
+ "devDependencies": {
61
+ "@babel/core": "^7.24.0",
62
+ "@getodk/tree-sitter-xpath": "0.1.0",
63
+ "@playwright/test": "^1.42.1",
64
+ "@types/crypto-js": "^4.1.2",
65
+ "@vitest/browser": "^1.3.1",
66
+ "babel-plugin-transform-jsbi-to-bigint": "^1.4.0",
67
+ "jsdom": "^24.0.0",
68
+ "vite": "^5.1.5",
69
+ "vite-plugin-babel": "^1.2.0",
70
+ "vite-plugin-dts": "^3.7.3",
71
+ "vite-plugin-no-bundle": "^3.0.0",
72
+ "vitest": "^1.3.1",
73
+ "vitest-github-actions-reporter": "^0.11.1",
74
+ "web-tree-sitter": "0.21.0"
75
+ }
76
+ }