@getodk/xforms-engine 0.1.0 → 0.1.1

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 (99) hide show
  1. package/dist/.vite/manifest.json +1 -0
  2. package/dist/XFormDOM.d.ts +1 -0
  3. package/dist/XFormDataType.d.ts +2 -1
  4. package/dist/XFormDefinition.d.ts +1 -0
  5. package/dist/body/BodyDefinition.d.ts +3 -2
  6. package/dist/body/BodyElementDefinition.d.ts +5 -4
  7. package/dist/body/RepeatDefinition.d.ts +4 -3
  8. package/dist/body/UnsupportedBodyElementDefinition.d.ts +3 -2
  9. package/dist/body/control/ControlDefinition.d.ts +3 -2
  10. package/dist/body/control/InputDefinition.d.ts +1 -0
  11. package/dist/body/control/select/ItemDefinition.d.ts +4 -3
  12. package/dist/body/control/select/ItemsetDefinition.d.ts +4 -3
  13. package/dist/body/control/select/ItemsetNodesetContext.d.ts +3 -2
  14. package/dist/body/control/select/ItemsetNodesetExpression.d.ts +2 -1
  15. package/dist/body/control/select/ItemsetValueExpression.d.ts +2 -1
  16. package/dist/body/control/select/SelectDefinition.d.ts +5 -4
  17. package/dist/body/group/BaseGroupDefinition.d.ts +5 -4
  18. package/dist/body/group/LogicalGroupDefinition.d.ts +1 -0
  19. package/dist/body/group/PresentationGroupDefinition.d.ts +3 -2
  20. package/dist/body/group/RepeatGroupDefinition.d.ts +3 -2
  21. package/dist/body/group/StructuralGroupDefinition.d.ts +1 -0
  22. package/dist/body/text/HintDefinition.d.ts +4 -4
  23. package/dist/body/text/LabelDefinition.d.ts +7 -7
  24. package/dist/body/text/TextElementDefinition.d.ts +8 -7
  25. package/dist/body/text/TextElementOutputPart.d.ts +2 -1
  26. package/dist/body/text/TextElementPart.d.ts +5 -4
  27. package/dist/body/text/TextElementReferencePart.d.ts +2 -1
  28. package/dist/body/text/TextElementStaticPart.d.ts +2 -1
  29. package/dist/client/BaseNode.d.ts +4 -3
  30. package/dist/client/EngineConfig.d.ts +2 -1
  31. package/dist/client/GroupNode.d.ts +6 -5
  32. package/dist/client/RepeatInstanceNode.d.ts +7 -6
  33. package/dist/client/RepeatRangeNode.d.ts +7 -6
  34. package/dist/client/RootNode.d.ts +5 -4
  35. package/dist/client/SelectNode.d.ts +7 -6
  36. package/dist/client/StringNode.d.ts +6 -5
  37. package/dist/client/SubtreeNode.d.ts +5 -4
  38. package/dist/client/TextRange.d.ts +2 -1
  39. package/dist/client/hierarchy.d.ts +9 -8
  40. package/dist/client/index.d.ts +3 -2
  41. package/dist/expression/DependencyContext.d.ts +2 -1
  42. package/dist/expression/DependentExpression.d.ts +3 -2
  43. package/dist/index.d.ts +2 -1
  44. package/dist/index.js +1263 -1394
  45. package/dist/index.js.map +1 -1
  46. package/dist/instance/Group.d.ts +13 -13
  47. package/dist/instance/RepeatInstance.d.ts +14 -14
  48. package/dist/instance/RepeatRange.d.ts +16 -17
  49. package/dist/instance/Root.d.ts +17 -16
  50. package/dist/instance/SelectField.d.ts +16 -16
  51. package/dist/instance/StringField.d.ts +16 -16
  52. package/dist/instance/Subtree.d.ts +12 -12
  53. package/dist/instance/abstract/DescendantNode.d.ts +14 -14
  54. package/dist/instance/abstract/InstanceNode.d.ts +18 -17
  55. package/dist/instance/children.d.ts +2 -1
  56. package/dist/instance/hierarchy.d.ts +8 -7
  57. package/dist/instance/index.d.ts +4 -3
  58. package/dist/instance/internal-api/EvaluationContext.d.ts +5 -4
  59. package/dist/instance/internal-api/InstanceConfig.d.ts +3 -2
  60. package/dist/instance/internal-api/SubscribableDependency.d.ts +2 -1
  61. package/dist/instance/internal-api/TranslationContext.d.ts +2 -1
  62. package/dist/instance/internal-api/ValueContext.d.ts +4 -3
  63. package/dist/instance/resource.d.ts +3 -2
  64. package/dist/instance/text/TextChunk.d.ts +4 -3
  65. package/dist/instance/text/TextRange.d.ts +2 -1
  66. package/dist/lib/dom/query.d.ts +3 -2
  67. package/dist/lib/reactivity/createChildrenState.d.ts +4 -3
  68. package/dist/lib/reactivity/createComputedExpression.d.ts +4 -3
  69. package/dist/lib/reactivity/createSelectItems.d.ts +4 -3
  70. package/dist/lib/reactivity/createValueState.d.ts +3 -2
  71. package/dist/lib/reactivity/materializeCurrentStateChildren.d.ts +4 -3
  72. package/dist/lib/reactivity/node-state/createClientState.d.ts +7 -6
  73. package/dist/lib/reactivity/node-state/createCurrentState.d.ts +5 -4
  74. package/dist/lib/reactivity/node-state/createEngineState.d.ts +4 -3
  75. package/dist/lib/reactivity/node-state/createSharedNodeState.d.ts +7 -6
  76. package/dist/lib/reactivity/node-state/createSpecifiedPropertyDescriptor.d.ts +2 -1
  77. package/dist/lib/reactivity/node-state/createSpecifiedState.d.ts +3 -2
  78. package/dist/lib/reactivity/node-state/representations.d.ts +2 -1
  79. package/dist/lib/reactivity/scope.d.ts +2 -1
  80. package/dist/lib/reactivity/text/createFieldHint.d.ts +4 -3
  81. package/dist/lib/reactivity/text/createNodeLabel.d.ts +4 -3
  82. package/dist/lib/reactivity/text/createTextRange.d.ts +6 -5
  83. package/dist/lib/reactivity/types.d.ts +2 -1
  84. package/dist/lib/xpath/analysis.d.ts +2 -1
  85. package/dist/model/BindComputation.d.ts +2 -1
  86. package/dist/model/BindDefinition.d.ts +6 -5
  87. package/dist/model/DescendentNodeDefinition.d.ts +6 -5
  88. package/dist/model/ModelBindMap.d.ts +4 -3
  89. package/dist/model/ModelDefinition.d.ts +2 -1
  90. package/dist/model/NodeDefinition.d.ts +10 -9
  91. package/dist/model/RepeatInstanceDefinition.d.ts +3 -2
  92. package/dist/model/RepeatSequenceDefinition.d.ts +3 -2
  93. package/dist/model/RepeatTemplateDefinition.d.ts +4 -3
  94. package/dist/model/RootDefinition.d.ts +5 -4
  95. package/dist/model/SubtreeDefinition.d.ts +4 -3
  96. package/dist/model/ValueNodeDefinition.d.ts +5 -4
  97. package/dist/solid.js +1253 -1387
  98. package/dist/solid.js.map +1 -1
  99. package/package.json +14 -18
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "src/index.ts": {
3
3
  "file": "solid.js",
4
+ "name": "solid",
4
5
  "src": "src/index.ts",
5
6
  "isEntry": true
6
7
  }
@@ -1,4 +1,5 @@
1
1
  import { XFormsXPathEvaluator } from '@getodk/xpath';
2
+
2
3
  interface XFormDOMNormalizationOptions {
3
4
  readonly isNormalized: boolean;
4
5
  }
@@ -1,4 +1,5 @@
1
- import type { CollectionValues } from '../../common/types/collections/CollectionValues.ts';
1
+ import { CollectionValues } from '../../common/types/collections/CollectionValues.ts';
2
+
2
3
  /**
3
4
  * Like JavaRosa. Presumably for explicit types which aren't impelemnted?
4
5
  */
@@ -1,6 +1,7 @@
1
1
  import { XFormDOM } from './XFormDOM.ts';
2
2
  import { BodyDefinition } from './body/BodyDefinition.ts';
3
3
  import { ModelDefinition } from './model/ModelDefinition.ts';
4
+
4
5
  export declare class XFormDefinition {
5
6
  readonly sourceXML: string;
6
7
  readonly xformDOM: XFormDOM;
@@ -1,12 +1,13 @@
1
- import type { XFormDefinition } from '../XFormDefinition.ts';
1
+ import { XFormDefinition } from '../XFormDefinition.ts';
2
2
  import { DependencyContext } from '../expression/DependencyContext.ts';
3
3
  import { UnsupportedBodyElementDefinition } from './UnsupportedBodyElementDefinition.ts';
4
4
  import { InputDefinition } from './control/InputDefinition.ts';
5
- import type { AnySelectDefinition } from './control/select/SelectDefinition.ts';
5
+ import { AnySelectDefinition } from './control/select/SelectDefinition.ts';
6
6
  import { LogicalGroupDefinition } from './group/LogicalGroupDefinition.ts';
7
7
  import { PresentationGroupDefinition } from './group/PresentationGroupDefinition.ts';
8
8
  import { RepeatGroupDefinition } from './group/RepeatGroupDefinition.ts';
9
9
  import { StructuralGroupDefinition } from './group/StructuralGroupDefinition.ts';
10
+
10
11
  export interface BodyElementParentContext {
11
12
  readonly reference: string | null;
12
13
  readonly element: Element;
@@ -1,8 +1,9 @@
1
- import type { XFormDefinition } from '../XFormDefinition.ts';
1
+ import { XFormDefinition } from '../XFormDefinition.ts';
2
2
  import { DependencyContext } from '../expression/DependencyContext.ts';
3
- import type { BodyElementParentContext } from './BodyDefinition.ts';
4
- import type { HintDefinition } from './text/HintDefinition.ts';
5
- import type { LabelDefinition } from './text/LabelDefinition.ts';
3
+ import { BodyElementParentContext } from './BodyDefinition.ts';
4
+ import { HintDefinition } from './text/HintDefinition.ts';
5
+ import { LabelDefinition } from './text/LabelDefinition.ts';
6
+
6
7
  /**
7
8
  * These category names roughly correspond to each of the ODK XForms spec's
8
9
  * {@link https://getodk.github.io/xforms-spec/#body-elements | Body Elements}
@@ -1,7 +1,8 @@
1
- import type { XFormDefinition } from '../XFormDefinition.ts';
2
- import type { BodyElementDefinitionArray } from './BodyDefinition.ts';
1
+ import { XFormDefinition } from '../XFormDefinition.ts';
2
+ import { BodyElementDefinitionArray } from './BodyDefinition.ts';
3
3
  import { BodyElementDefinition } from './BodyElementDefinition.ts';
4
- import type { RepeatGroupDefinition } from './group/RepeatGroupDefinition.ts';
4
+ import { RepeatGroupDefinition } from './group/RepeatGroupDefinition.ts';
5
+
5
6
  export declare class RepeatDefinition extends BodyElementDefinition<'repeat'> {
6
7
  readonly groupDefinition: RepeatGroupDefinition;
7
8
  readonly category = "structure";
@@ -1,6 +1,7 @@
1
- import type { XFormDefinition } from '../XFormDefinition.ts';
2
- import type { BodyElementParentContext } from './BodyDefinition.ts';
1
+ import { XFormDefinition } from '../XFormDefinition.ts';
2
+ import { BodyElementParentContext } from './BodyDefinition.ts';
3
3
  import { BodyElementDefinition } from './BodyElementDefinition.ts';
4
+
4
5
  export declare class UnsupportedBodyElementDefinition extends BodyElementDefinition<'UNSUPPORTED'> {
5
6
  static isCompatible(): boolean;
6
7
  readonly category = "UNSUPPORTED";
@@ -1,8 +1,9 @@
1
- import type { XFormDefinition } from '../../XFormDefinition.ts';
2
- import type { BodyElementParentContext } from '../BodyDefinition.ts';
1
+ import { XFormDefinition } from '../../XFormDefinition.ts';
2
+ import { BodyElementParentContext } from '../BodyDefinition.ts';
3
3
  import { BodyElementDefinition } from '../BodyElementDefinition.ts';
4
4
  import { HintDefinition } from '../text/HintDefinition.ts';
5
5
  import { LabelDefinition } from '../text/LabelDefinition.ts';
6
+
6
7
  type ControlType = 'input' | 'range' | 'rank' | 'select' | 'select1' | 'trigger' | 'upload';
7
8
  export declare abstract class ControlDefinition<Type extends ControlType> extends BodyElementDefinition<Type> {
8
9
  readonly category = "control";
@@ -1,4 +1,5 @@
1
1
  import { ControlDefinition } from './ControlDefinition.ts';
2
+
2
3
  export declare class InputDefinition extends ControlDefinition<'input'> {
3
4
  static isCompatible(localName: string): boolean;
4
5
  readonly type = "input";
@@ -1,8 +1,9 @@
1
- import { type ItemElement } from '../../../lib/dom/query.ts';
2
- import type { XFormDefinition } from '../../../XFormDefinition.ts';
1
+ import { ItemElement } from '../../../lib/dom/query.ts';
2
+ import { XFormDefinition } from '../../../XFormDefinition.ts';
3
3
  import { BodyElementDefinition } from '../../BodyElementDefinition.ts';
4
4
  import { LabelDefinition } from '../../text/LabelDefinition.ts';
5
- import type { AnySelectDefinition } from './SelectDefinition.ts';
5
+ import { AnySelectDefinition } from './SelectDefinition.ts';
6
+
6
7
  export declare class ItemDefinition extends BodyElementDefinition<'item'> {
7
8
  readonly parent: AnySelectDefinition;
8
9
  readonly category = "support";
@@ -1,10 +1,11 @@
1
- import { type ItemsetElement } from '../../../lib/dom/query.ts';
2
- import type { XFormDefinition } from '../../../XFormDefinition.ts';
1
+ import { ItemsetElement } from '../../../lib/dom/query.ts';
2
+ import { XFormDefinition } from '../../../XFormDefinition.ts';
3
3
  import { BodyElementDefinition } from '../../BodyElementDefinition.ts';
4
4
  import { LabelDefinition } from '../../text/LabelDefinition.ts';
5
5
  import { ItemsetNodesetExpression } from './ItemsetNodesetExpression.ts';
6
6
  import { ItemsetValueExpression } from './ItemsetValueExpression.ts';
7
- import type { AnySelectDefinition } from './SelectDefinition.ts';
7
+ import { AnySelectDefinition } from './SelectDefinition.ts';
8
+
8
9
  export declare class ItemsetDefinition extends BodyElementDefinition<'itemset'> {
9
10
  readonly category = "support";
10
11
  readonly type = "itemset";
@@ -1,6 +1,7 @@
1
1
  import { DependencyContext } from '../../../expression/DependencyContext.ts';
2
- import type { AnyDependentExpression } from '../../../expression/DependentExpression.ts';
3
- import type { ItemsetDefinition } from './ItemsetDefinition.ts';
2
+ import { AnyDependentExpression } from '../../../expression/DependentExpression.ts';
3
+ import { ItemsetDefinition } from './ItemsetDefinition.ts';
4
+
4
5
  export declare class ItemsetNodesetContext extends DependencyContext {
5
6
  protected readonly itemset: ItemsetDefinition;
6
7
  readonly parentReference: null;
@@ -1,5 +1,6 @@
1
1
  import { DependentExpression } from '../../../expression/DependentExpression.ts';
2
- import type { ItemsetDefinition } from './ItemsetDefinition.ts';
2
+ import { ItemsetDefinition } from './ItemsetDefinition.ts';
3
+
3
4
  export declare class ItemsetNodesetExpression extends DependentExpression<'nodes'> {
4
5
  constructor(itemset: ItemsetDefinition, nodesetExpression: string);
5
6
  }
@@ -1,5 +1,6 @@
1
1
  import { DependentExpression } from '../../../expression/DependentExpression.ts';
2
- import type { ItemsetDefinition } from './ItemsetDefinition.ts';
2
+ import { ItemsetDefinition } from './ItemsetDefinition.ts';
3
+
3
4
  export declare class ItemsetValueExpression extends DependentExpression<'string'> {
4
5
  readonly itemset: ItemsetDefinition;
5
6
  constructor(itemset: ItemsetDefinition, expression: string);
@@ -1,10 +1,11 @@
1
- import type { CollectionValues } from '../../../../../common/types/collections/CollectionValues.ts';
2
- import type { LocalNamedElement } from '../../../../../common/types/dom.ts';
3
- import type { XFormDefinition } from '../../../XFormDefinition.ts';
4
- import type { AnyBodyElementDefinition, BodyElementParentContext } from '../../BodyDefinition.ts';
1
+ import { CollectionValues } from '../../../../../common/types/collections/CollectionValues.ts';
2
+ import { LocalNamedElement } from '../../../../../common/types/dom.ts';
3
+ import { XFormDefinition } from '../../../XFormDefinition.ts';
4
+ import { AnyBodyElementDefinition, BodyElementParentContext } from '../../BodyDefinition.ts';
5
5
  import { ControlDefinition } from '../ControlDefinition.ts';
6
6
  import { ItemDefinition } from './ItemDefinition.ts';
7
7
  import { ItemsetDefinition } from './ItemsetDefinition.ts';
8
+
8
9
  declare const selectLocalNames: Set<"select" | "rank" | "select1">;
9
10
  export type SelectType = CollectionValues<typeof selectLocalNames>;
10
11
  export interface SelectElement extends LocalNamedElement<SelectType> {
@@ -1,7 +1,8 @@
1
- import type { XFormDefinition } from '../../XFormDefinition.ts';
2
- import { type BodyElementDefinitionArray, type BodyElementParentContext } from '../BodyDefinition.ts';
1
+ import { XFormDefinition } from '../../XFormDefinition.ts';
2
+ import { BodyElementDefinitionArray, BodyElementParentContext } from '../BodyDefinition.ts';
3
3
  import { BodyElementDefinition } from '../BodyElementDefinition.ts';
4
4
  import { LabelDefinition } from '../text/LabelDefinition.ts';
5
+
5
6
  /**
6
7
  * These type names are derived from **and expand upon** the language used in
7
8
  * the ODK XForms spec to describe various group usage. Whereas the spec
@@ -42,5 +43,5 @@ export declare abstract class BaseGroupDefinition<Type extends GroupType> extend
42
43
  constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element, children?: BodyElementDefinitionArray);
43
44
  getChildren(element: Element): BodyElementDefinitionArray;
44
45
  }
45
- export declare const repeatGroup: <T extends BaseGroupDefinition<any>>(groupDefinition: T) => Extract<T, BaseGroupDefinition<"repeat-group">> | null;
46
- export declare const nonRepeatGroup: <T extends BaseGroupDefinition<any>>(groupDefinition: T) => Exclude<T, BaseGroupDefinition<"repeat-group">> | null;
46
+ export declare const repeatGroup: <T extends BaseGroupDefinition<any>>(groupDefinition: T) => Extract<T, BaseGroupDefinition<'repeat-group'>> | null;
47
+ export declare const nonRepeatGroup: <T extends BaseGroupDefinition<any>>(groupDefinition: T) => Exclude<T, BaseGroupDefinition<'repeat-group'>> | null;
@@ -1,4 +1,5 @@
1
1
  import { BaseGroupDefinition } from './BaseGroupDefinition.ts';
2
+
2
3
  export declare class LogicalGroupDefinition extends BaseGroupDefinition<'logical-group'> {
3
4
  static isCompatible(localName: string, element: Element): boolean;
4
5
  readonly type = "logical-group";
@@ -1,7 +1,8 @@
1
- import type { XFormDefinition } from '../../XFormDefinition.ts';
2
- import type { BodyElementParentContext } from '../BodyDefinition.ts';
1
+ import { XFormDefinition } from '../../XFormDefinition.ts';
2
+ import { BodyElementParentContext } from '../BodyDefinition.ts';
3
3
  import { LabelDefinition } from '../text/LabelDefinition.ts';
4
4
  import { BaseGroupDefinition } from './BaseGroupDefinition.ts';
5
+
5
6
  export declare class PresentationGroupDefinition extends BaseGroupDefinition<'presentation-group'> {
6
7
  static isCompatible(localName: string, element: Element): boolean;
7
8
  readonly type = "presentation-group";
@@ -1,7 +1,8 @@
1
- import type { XFormDefinition } from '../../XFormDefinition.ts';
2
- import type { BodyElementDefinitionArray, BodyElementParentContext } from '../BodyDefinition.ts';
1
+ import { XFormDefinition } from '../../XFormDefinition.ts';
2
+ import { BodyElementDefinitionArray, BodyElementParentContext } from '../BodyDefinition.ts';
3
3
  import { RepeatDefinition } from '../RepeatDefinition.ts';
4
4
  import { BaseGroupDefinition } from './BaseGroupDefinition.ts';
5
+
5
6
  export declare class RepeatGroupDefinition extends BaseGroupDefinition<'repeat-group'> {
6
7
  static isCompatible(localName: string, element: Element): boolean;
7
8
  readonly type = "repeat-group";
@@ -1,4 +1,5 @@
1
1
  import { BaseGroupDefinition } from './BaseGroupDefinition.ts';
2
+
2
3
  export declare class StructuralGroupDefinition extends BaseGroupDefinition<'structural-group'> {
3
4
  static isCompatible(localName: string, element: Element): boolean;
4
5
  readonly type = "structural-group";
@@ -1,7 +1,7 @@
1
- import type { XFormDefinition } from '../../XFormDefinition.ts';
2
- import type { AnyControlDefinition } from '../control/ControlDefinition.ts';
3
- import type { TextElement } from './TextElementDefinition.ts';
4
- import { TextElementDefinition } from './TextElementDefinition.ts';
1
+ import { XFormDefinition } from '../../XFormDefinition.ts';
2
+ import { AnyControlDefinition } from '../control/ControlDefinition.ts';
3
+ import { TextElement, TextElementDefinition } from './TextElementDefinition.ts';
4
+
5
5
  export interface HintElement extends TextElement {
6
6
  readonly localName: 'hint';
7
7
  }
@@ -1,10 +1,10 @@
1
- import type { XFormDefinition } from '../../XFormDefinition.ts';
2
- import type { AnyControlDefinition } from '../control/ControlDefinition.ts';
3
- import type { ItemDefinition } from '../control/select/ItemDefinition.ts';
4
- import type { ItemsetDefinition } from '../control/select/ItemsetDefinition.ts';
5
- import type { BaseGroupDefinition } from '../group/BaseGroupDefinition.ts';
6
- import type { TextElement, TextElementOwner } from './TextElementDefinition.ts';
7
- import { TextElementDefinition } from './TextElementDefinition.ts';
1
+ import { XFormDefinition } from '../../XFormDefinition.ts';
2
+ import { AnyControlDefinition } from '../control/ControlDefinition.ts';
3
+ import { ItemDefinition } from '../control/select/ItemDefinition.ts';
4
+ import { ItemsetDefinition } from '../control/select/ItemsetDefinition.ts';
5
+ import { BaseGroupDefinition } from '../group/BaseGroupDefinition.ts';
6
+ import { TextElement, TextElementOwner, TextElementDefinition } from './TextElementDefinition.ts';
7
+
8
8
  export interface LabelElement extends TextElement {
9
9
  readonly localName: 'label';
10
10
  }
@@ -1,14 +1,15 @@
1
- import type { XFormDefinition } from '../../XFormDefinition.ts';
2
- import { type AnyDependentExpression } from '../../expression/DependentExpression.ts';
3
- import type { AnyGroupElementDefinition } from '../BodyDefinition.ts';
1
+ import { XFormDefinition } from '../../XFormDefinition.ts';
2
+ import { AnyDependentExpression } from '../../expression/DependentExpression.ts';
3
+ import { AnyGroupElementDefinition } from '../BodyDefinition.ts';
4
4
  import { BodyElementDefinition } from '../BodyElementDefinition.ts';
5
- import type { InputDefinition } from '../control/InputDefinition.ts';
6
- import type { ItemDefinition } from '../control/select/ItemDefinition.ts';
7
- import type { ItemsetDefinition } from '../control/select/ItemsetDefinition.ts';
8
- import type { AnySelectDefinition } from '../control/select/SelectDefinition.ts';
5
+ import { InputDefinition } from '../control/InputDefinition.ts';
6
+ import { ItemDefinition } from '../control/select/ItemDefinition.ts';
7
+ import { ItemsetDefinition } from '../control/select/ItemsetDefinition.ts';
8
+ import { AnySelectDefinition } from '../control/select/SelectDefinition.ts';
9
9
  import { TextElementOutputPart } from './TextElementOutputPart.ts';
10
10
  import { TextElementReferencePart } from './TextElementReferencePart.ts';
11
11
  import { TextElementStaticPart } from './TextElementStaticPart.ts';
12
+
12
13
  export type TextElementType = 'hint' | 'label';
13
14
  export interface TextElement extends Element {
14
15
  readonly localName: TextElementType;
@@ -1,5 +1,6 @@
1
- import type { AnyTextElementDefinition } from './TextElementDefinition.ts';
1
+ import { AnyTextElementDefinition } from './TextElementDefinition.ts';
2
2
  import { TextElementPart } from './TextElementPart.ts';
3
+
3
4
  interface OutputElement extends Element {
4
5
  readonly localName: 'output';
5
6
  getAttribute(name: 'value'): string;
@@ -1,8 +1,9 @@
1
1
  import { DependentExpression } from '../../expression/DependentExpression.ts';
2
- import type { AnyTextElementDefinition } from './TextElementDefinition.ts';
3
- import type { TextElementOutputPart } from './TextElementOutputPart.ts';
4
- import type { TextElementReferencePart } from './TextElementReferencePart.ts';
5
- import type { TextElementStaticPart } from './TextElementStaticPart.ts';
2
+ import { AnyTextElementDefinition } from './TextElementDefinition.ts';
3
+ import { TextElementOutputPart } from './TextElementOutputPart.ts';
4
+ import { TextElementReferencePart } from './TextElementReferencePart.ts';
5
+ import { TextElementStaticPart } from './TextElementStaticPart.ts';
6
+
6
7
  export type TextElementPartType = 'output' | 'reference' | 'static';
7
8
  export declare abstract class TextElementPart<Type extends TextElementPartType> extends DependentExpression<'string'> {
8
9
  readonly type: Type;
@@ -1,5 +1,6 @@
1
- import type { AnyTextElementDefinition, TextElement } from './TextElementDefinition.ts';
1
+ import { AnyTextElementDefinition, TextElement } from './TextElementDefinition.ts';
2
2
  import { TextElementPart } from './TextElementPart.ts';
3
+
3
4
  export declare class TextElementReferencePart extends TextElementPart<'reference'> {
4
5
  static from(context: AnyTextElementDefinition, element: TextElement): TextElementReferencePart | null;
5
6
  protected constructor(context: AnyTextElementDefinition, expression: string);
@@ -1,5 +1,6 @@
1
- import type { AnyTextElementDefinition } from './TextElementDefinition.ts';
1
+ import { AnyTextElementDefinition } from './TextElementDefinition.ts';
2
2
  import { TextElementPart } from './TextElementPart.ts';
3
+
3
4
  export declare class TextElementStaticPart extends TextElementPart<'static'> {
4
5
  readonly stringValue: string;
5
6
  constructor(context: AnyTextElementDefinition, node: Text);
@@ -1,6 +1,7 @@
1
- import type { AnyNodeDefinition } from '../model/NodeDefinition.ts';
2
- import type { InstanceNodeType } from './node-types.js';
3
- import type { TextRange } from './TextRange.ts';
1
+ import { AnyNodeDefinition } from '../model/NodeDefinition.ts';
2
+ import { InstanceNodeType } from './node-types.js';
3
+ import { TextRange } from './TextRange.ts';
4
+
4
5
  export interface BaseNodeState {
5
6
  /**
6
7
  * Location path reference to the node's primary instance state. This property
@@ -1,4 +1,5 @@
1
- import type { OpaqueReactiveObjectFactory } from './OpaqueReactiveObjectFactory.ts';
1
+ import { OpaqueReactiveObjectFactory } from './OpaqueReactiveObjectFactory.ts';
2
+
2
3
  /**
3
4
  * @todo this is currently a strict subset of the web standard `Response`. Is it
4
5
  * sufficient? Ways it might not be:
@@ -1,8 +1,9 @@
1
- import type { NonRepeatGroupElementDefinition } from '../body/BodyDefinition.ts';
2
- import type { SubtreeDefinition } from '../model/SubtreeDefinition.ts';
3
- import type { BaseNode, BaseNodeState } from './BaseNode.ts';
4
- import type { RootNode } from './RootNode.ts';
5
- import type { GeneralChildNode, GeneralParentNode } from './hierarchy.ts';
1
+ import { NonRepeatGroupElementDefinition } from '../body/BodyDefinition.ts';
2
+ import { SubtreeDefinition } from '../model/SubtreeDefinition.ts';
3
+ import { BaseNode, BaseNodeState } from './BaseNode.ts';
4
+ import { RootNode } from './RootNode.ts';
5
+ import { GeneralChildNode, GeneralParentNode } from './hierarchy.ts';
6
+
6
7
  export interface GroupNodeState extends BaseNodeState {
7
8
  get hint(): null;
8
9
  get children(): readonly GeneralChildNode[];
@@ -1,9 +1,10 @@
1
- import type { RepeatInstanceDefinition } from '../model/RepeatInstanceDefinition.ts';
2
- import type { RepeatTemplateDefinition } from '../model/RepeatTemplateDefinition.ts';
3
- import type { BaseNode, BaseNodeState } from './BaseNode.ts';
4
- import type { RepeatRangeNode } from './RepeatRangeNode.ts';
5
- import type { RootNode } from './RootNode.ts';
6
- import type { GeneralChildNode } from './hierarchy.ts';
1
+ import { RepeatInstanceDefinition } from '../model/RepeatInstanceDefinition.ts';
2
+ import { RepeatTemplateDefinition } from '../model/RepeatTemplateDefinition.ts';
3
+ import { BaseNode, BaseNodeState } from './BaseNode.ts';
4
+ import { RepeatRangeNode } from './RepeatRangeNode.ts';
5
+ import { RootNode } from './RootNode.ts';
6
+ import { GeneralChildNode } from './hierarchy.ts';
7
+
7
8
  export interface RepeatInstanceNodeState extends BaseNodeState {
8
9
  get hint(): null;
9
10
  get children(): readonly GeneralChildNode[];
@@ -1,9 +1,10 @@
1
- import type { RepeatSequenceDefinition } from '../model/RepeatSequenceDefinition.ts';
2
- import type { BaseNode, BaseNodeState } from './BaseNode.ts';
3
- import type { RepeatInstanceNode } from './RepeatInstanceNode.ts';
4
- import type { RootNode } from './RootNode.ts';
5
- import type { TextRange } from './TextRange.ts';
6
- import type { GeneralParentNode } from './hierarchy.ts';
1
+ import { RepeatSequenceDefinition } from '../model/RepeatSequenceDefinition.ts';
2
+ import { BaseNode, BaseNodeState } from './BaseNode.ts';
3
+ import { RepeatInstanceNode } from './RepeatInstanceNode.ts';
4
+ import { RootNode } from './RootNode.ts';
5
+ import { TextRange } from './TextRange.ts';
6
+ import { GeneralParentNode } from './hierarchy.ts';
7
+
7
8
  export interface RepeatRangeNodeState extends BaseNodeState {
8
9
  get hint(): null;
9
10
  get label(): TextRange<'label'> | null;
@@ -1,7 +1,8 @@
1
- import type { RootDefinition } from '../model/RootDefinition.ts';
2
- import type { BaseNode, BaseNodeState } from './BaseNode.ts';
3
- import type { ActiveLanguage, FormLanguage, FormLanguages } from './FormLanguage.ts';
4
- import type { GeneralChildNode } from './hierarchy.ts';
1
+ import { RootDefinition } from '../model/RootDefinition.ts';
2
+ import { BaseNode, BaseNodeState } from './BaseNode.ts';
3
+ import { ActiveLanguage, FormLanguage, FormLanguages } from './FormLanguage.ts';
4
+ import { GeneralChildNode } from './hierarchy.ts';
5
+
5
6
  export interface RootNodeState extends BaseNodeState {
6
7
  /**
7
8
  * This, along with {@link RootNode.languages} is the most significant break
@@ -1,9 +1,10 @@
1
- import type { AnySelectDefinition } from '../body/control/select/SelectDefinition.ts';
2
- import type { ValueNodeDefinition } from '../model/ValueNodeDefinition.ts';
3
- import type { BaseNode, BaseNodeState } from './BaseNode.ts';
4
- import type { RootNode } from './RootNode.ts';
5
- import type { TextRange } from './TextRange.ts';
6
- import type { GeneralParentNode } from './hierarchy.ts';
1
+ import { AnySelectDefinition } from '../body/control/select/SelectDefinition.ts';
2
+ import { ValueNodeDefinition } from '../model/ValueNodeDefinition.ts';
3
+ import { BaseNode, BaseNodeState } from './BaseNode.ts';
4
+ import { RootNode } from './RootNode.ts';
5
+ import { TextRange } from './TextRange.ts';
6
+ import { GeneralParentNode } from './hierarchy.ts';
7
+
7
8
  export interface SelectItem {
8
9
  get value(): string;
9
10
  get label(): TextRange<'label'> | null;
@@ -1,8 +1,9 @@
1
- import type { InputDefinition } from '../body/control/InputDefinition.ts';
2
- import type { ValueNodeDefinition } from '../model/ValueNodeDefinition.ts';
3
- import type { BaseNode, BaseNodeState } from './BaseNode.ts';
4
- import type { RootNode } from './RootNode.ts';
5
- import type { GeneralParentNode } from './hierarchy.ts';
1
+ import { InputDefinition } from '../body/control/InputDefinition.ts';
2
+ import { ValueNodeDefinition } from '../model/ValueNodeDefinition.ts';
3
+ import { BaseNode, BaseNodeState } from './BaseNode.ts';
4
+ import { RootNode } from './RootNode.ts';
5
+ import { GeneralParentNode } from './hierarchy.ts';
6
+
6
7
  export interface StringNodeState extends BaseNodeState {
7
8
  get children(): null;
8
9
  get valueOptions(): null;
@@ -1,7 +1,8 @@
1
- import type { SubtreeDefinition as BaseSubtreeDefinition } from '../model/SubtreeDefinition.ts';
2
- import type { BaseNode, BaseNodeState } from './BaseNode.ts';
3
- import type { RootNode } from './RootNode.ts';
4
- import type { GeneralChildNode, GeneralParentNode } from './hierarchy.ts';
1
+ import { SubtreeDefinition as BaseSubtreeDefinition } from '../model/SubtreeDefinition.ts';
2
+ import { BaseNode, BaseNodeState } from './BaseNode.ts';
3
+ import { RootNode } from './RootNode.ts';
4
+ import { GeneralChildNode, GeneralParentNode } from './hierarchy.ts';
5
+
5
6
  export interface SubtreeNodeState extends BaseNodeState {
6
7
  get label(): null;
7
8
  get hint(): null;
@@ -1,4 +1,5 @@
1
- import type { ActiveLanguage } from './FormLanguage.ts';
1
+ import { ActiveLanguage } from './FormLanguage.ts';
2
+
2
3
  export type TextChunkSource = 'itext' | 'output' | 'static';
3
4
  /**
4
5
  * @todo This (and everything else to do with {@link TextRange}s is for
@@ -1,11 +1,12 @@
1
- import type { ExpandUnion } from '../../../common/types/helpers.d.ts';
2
- import type { GroupNode } from './GroupNode.ts';
3
- import type { RepeatInstanceNode } from './RepeatInstanceNode.ts';
4
- import type { RepeatRangeNode } from './RepeatRangeNode.ts';
5
- import type { RootNode } from './RootNode.ts';
6
- import type { SelectNode } from './SelectNode.ts';
7
- import type { StringNode } from './StringNode.ts';
8
- import type { SubtreeNode } from './SubtreeNode.ts';
1
+ import { ExpandUnion } from '../../../common/types/helpers.d.ts';
2
+ import { GroupNode } from './GroupNode.ts';
3
+ import { RepeatInstanceNode } from './RepeatInstanceNode.ts';
4
+ import { RepeatRangeNode } from './RepeatRangeNode.ts';
5
+ import { RootNode } from './RootNode.ts';
6
+ import { SelectNode } from './SelectNode.ts';
7
+ import { StringNode } from './StringNode.ts';
8
+ import { SubtreeNode } from './SubtreeNode.ts';
9
+
9
10
  export type AnyLeafNode = SelectNode | StringNode;
10
11
  /**
11
12
  * Any of the concrete node types which may be a parent of any other node.
@@ -1,5 +1,6 @@
1
- import type { EngineConfig } from './EngineConfig.ts';
2
- import type { RootNode } from './RootNode.ts';
1
+ import { EngineConfig } from './EngineConfig.ts';
2
+ import { RootNode } from './RootNode.ts';
3
+
3
4
  export type FormResource = Blob | URL | string;
4
5
  export interface InitializeFormOptions {
5
6
  readonly config: EngineConfig;
@@ -1,4 +1,5 @@
1
- import type { AnyDependentExpression } from './DependentExpression.ts';
1
+ import { AnyDependentExpression } from './DependentExpression.ts';
2
+
2
3
  export declare abstract class DependencyContext {
3
4
  abstract get parentReference(): string | null;
4
5
  abstract get reference(): string | null;
@@ -1,5 +1,6 @@
1
- import type { XFormsXPathEvaluator } from '@getodk/xpath';
2
- import type { DependencyContext } from './DependencyContext.ts';
1
+ import { XFormsXPathEvaluator } from '@getodk/xpath';
2
+ import { DependencyContext } from './DependencyContext.ts';
3
+
3
4
  declare const evaluatorMethodsByResultType: {
4
5
  readonly boolean: "evaluateBoolean";
5
6
  readonly nodes: "evaluateNodes";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { InitializeForm } from './index.ts';
1
+ import { InitializeForm } from './index.ts';
2
+
2
3
  export declare const initializeForm: InitializeForm;
3
4
  export type * from './client/EngineConfig.ts';
4
5
  export type * from './client/FormLanguage.ts';