@getodk/xforms-engine 0.5.0 → 0.7.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.
- package/README.md +1 -1
- package/dist/client/BaseNode.d.ts +8 -4
- package/dist/client/BaseValueNode.d.ts +8 -4
- package/dist/client/GroupNode.d.ts +1 -0
- package/dist/client/InputNode.d.ts +32 -3
- package/dist/client/ModelValueNode.d.ts +1 -0
- package/dist/client/NoteNode.d.ts +24 -7
- package/dist/client/RangeNode.d.ts +36 -0
- package/dist/client/RankNode.d.ts +46 -0
- package/dist/client/RootNode.d.ts +21 -14
- package/dist/client/SelectNode.d.ts +47 -25
- package/dist/client/SubtreeNode.d.ts +1 -0
- package/dist/client/TriggerNode.d.ts +10 -6
- package/dist/client/constants.d.ts +11 -12
- package/dist/client/form/CreateFormInstance.d.ts +14 -0
- package/dist/client/form/EditFormInstance.d.ts +62 -0
- package/dist/client/form/FormInstance.d.ts +104 -0
- package/dist/client/form/FormInstanceConfig.d.ts +17 -0
- package/dist/client/form/FormResource.d.ts +1 -0
- package/dist/client/form/LoadForm.d.ts +79 -0
- package/dist/client/form/LoadFormResult.d.ts +67 -0
- package/dist/client/form/RestoreFormInstance.d.ts +8 -0
- package/dist/client/hierarchy.d.ts +5 -5
- package/dist/client/index.d.ts +37 -11
- package/dist/client/node-types.d.ts +2 -2
- package/dist/client/repeat/BaseRepeatRangeNode.d.ts +3 -4
- package/dist/client/repeat/RepeatInstanceNode.d.ts +4 -5
- package/dist/client/repeat/RepeatRangeControlledNode.d.ts +2 -2
- package/dist/client/repeat/RepeatRangeUncontrolledNode.d.ts +2 -2
- package/dist/client/resources.d.ts +1 -1
- package/dist/client/serialization/InstanceData.d.ts +12 -0
- package/dist/client/serialization/InstanceFile.d.ts +6 -0
- package/dist/client/serialization/InstancePayload.d.ts +93 -0
- package/dist/client/serialization/InstancePayloadOptions.d.ts +23 -0
- package/dist/client/serialization/InstanceState.d.ts +12 -0
- package/dist/client/submission/{SubmissionDefinition.d.ts → SubmissionMeta.d.ts} +1 -1
- package/dist/client/unsupported/UnsupportedControlNode.d.ts +1 -3
- package/dist/entrypoints/FormInstance.d.ts +20 -0
- package/dist/entrypoints/FormResult/BaseFormResult.d.ts +22 -0
- package/dist/entrypoints/FormResult/BaseInstantiableFormResult.d.ts +25 -0
- package/dist/entrypoints/FormResult/FormFailureResult.d.ts +17 -0
- package/dist/entrypoints/FormResult/FormSuccessResult.d.ts +15 -0
- package/dist/entrypoints/FormResult/FormWarningResult.d.ts +15 -0
- package/dist/entrypoints/createInstance.d.ts +9 -0
- package/dist/entrypoints/editInstance.d.ts +9 -0
- package/dist/entrypoints/index.d.ts +4 -0
- package/dist/entrypoints/loadForm.d.ts +4 -0
- package/dist/entrypoints/restoreInstance.d.ts +9 -0
- package/dist/error/LoadFormFailureError.d.ts +9 -0
- package/dist/error/MalformedInstanceDataError.d.ts +3 -0
- package/dist/error/RankMissingValueError.d.ts +3 -0
- package/dist/error/RankValueTypeError.d.ts +6 -0
- package/dist/error/SelectValueTypeError.d.ts +15 -0
- package/dist/error/TemplatedNodeAttributeSerializationError.d.ts +22 -0
- package/dist/error/XFormsSpecViolationError.d.ts +2 -0
- package/dist/index.d.ts +2 -34
- package/dist/index.js +7274 -5840
- package/dist/index.js.map +1 -1
- package/dist/instance/Group.d.ts +7 -5
- package/dist/instance/InputControl.d.ts +9 -6
- package/dist/instance/ModelValue.d.ts +7 -4
- package/dist/instance/Note.d.ts +14 -25
- package/dist/instance/PrimaryInstance.d.ts +36 -8
- package/dist/instance/RangeControl.d.ts +35 -0
- package/dist/instance/RankControl.d.ts +41 -0
- package/dist/instance/Root.d.ts +8 -9
- package/dist/instance/SelectControl.d.ts +67 -0
- package/dist/instance/Subtree.d.ts +7 -5
- package/dist/instance/TriggerControl.d.ts +10 -22
- package/dist/instance/abstract/DescendantNode.d.ts +11 -3
- package/dist/instance/abstract/InstanceNode.d.ts +10 -5
- package/dist/instance/abstract/ValueNode.d.ts +7 -6
- package/dist/instance/children/DescendantNodeInitOptions.d.ts +32 -0
- package/dist/instance/{children.d.ts → children/buildChildren.d.ts} +1 -1
- package/dist/instance/children/childrenInitOptions.d.ts +9 -0
- package/dist/instance/children/normalizeChildInitOptions.d.ts +2 -0
- package/dist/instance/hierarchy.d.ts +9 -9
- package/dist/instance/input/InitialInstanceState.d.ts +13 -0
- package/dist/instance/input/InstanceAttachmentMap.d.ts +19 -0
- package/dist/instance/internal-api/InstanceConfig.d.ts +2 -9
- package/dist/instance/internal-api/InstanceValueContext.d.ts +10 -1
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableInstance.d.ts +14 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableLeafNode.d.ts +32 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableParentNode.d.ts +18 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableTemplatedNode.d.ts +13 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableValueNode.d.ts +21 -0
- package/dist/instance/repeat/BaseRepeatRange.d.ts +11 -8
- package/dist/instance/repeat/RepeatInstance.d.ts +11 -7
- package/dist/instance/repeat/RepeatRangeControlled.d.ts +27 -3
- package/dist/instance/repeat/RepeatRangeUncontrolled.d.ts +4 -3
- package/dist/instance/resource.d.ts +5 -1
- package/dist/instance/unsupported/UploadControl.d.ts +32 -4
- package/dist/integration/xpath/EngineXPathEvaluator.d.ts +2 -2
- package/dist/integration/xpath/adapter/kind.d.ts +4 -10
- package/dist/integration/xpath/adapter/names.d.ts +1 -11
- package/dist/integration/xpath/adapter/traversal.d.ts +10 -9
- package/dist/integration/xpath/static-dom/StaticAttribute.d.ts +10 -4
- package/dist/integration/xpath/static-dom/StaticDocument.d.ts +13 -11
- package/dist/integration/xpath/static-dom/StaticElement.d.ts +25 -18
- package/dist/integration/xpath/static-dom/StaticNode.d.ts +1 -1
- package/dist/integration/xpath/static-dom/StaticParentNode.d.ts +13 -0
- package/dist/integration/xpath/static-dom/staticNodeName.d.ts +3 -0
- package/dist/lib/client-reactivity/instance-state/createNodeRangeInstanceState.d.ts +4 -0
- package/dist/lib/client-reactivity/instance-state/createParentNodeInstanceState.d.ts +4 -0
- package/dist/lib/client-reactivity/instance-state/createPrimaryInstanceState.d.ts +3 -0
- package/dist/lib/client-reactivity/instance-state/createRootInstanceState.d.ts +3 -0
- package/dist/lib/client-reactivity/instance-state/createTemplatedNodeInstanceState.d.ts +6 -0
- package/dist/lib/client-reactivity/instance-state/createValueNodeInstanceState.d.ts +3 -0
- package/dist/lib/client-reactivity/instance-state/prepareInstancePayload.d.ts +8 -0
- package/dist/lib/codecs/Geopoint/Geopoint.d.ts +48 -0
- package/dist/lib/codecs/Geopoint/GeopointValueCodec.d.ts +5 -0
- package/dist/lib/codecs/NoteCodec.d.ts +8 -0
- package/dist/lib/codecs/RangeCodec.d.ts +8 -0
- package/dist/lib/codecs/TempUnsupportedControlCodec.d.ts +7 -0
- package/dist/lib/codecs/TriggerCodec.d.ts +7 -0
- package/dist/lib/codecs/ValueArrayCodec.d.ts +11 -0
- package/dist/lib/codecs/ValueCodec.d.ts +2 -2
- package/dist/lib/codecs/getNoteCodec.d.ts +3 -0
- package/dist/lib/codecs/getSelectCodec.d.ts +5 -0
- package/dist/lib/codecs/getSharedValueCodec.d.ts +3 -2
- package/dist/lib/codecs/items/BaseItemCodec.d.ts +9 -0
- package/dist/lib/codecs/items/MultipleValueItemCodec.d.ts +14 -0
- package/dist/lib/codecs/items/SingleValueItemCodec.d.ts +24 -0
- package/dist/lib/dom/query.d.ts +1 -2
- package/dist/lib/names/NamespaceDeclaration.d.ts +45 -0
- package/dist/lib/names/NamespaceDeclarationMap.d.ts +137 -0
- package/dist/lib/names/NamespaceURL.d.ts +30 -0
- package/dist/lib/names/QualifiedName.d.ts +113 -0
- package/dist/lib/names/UnprefixedXFormsName.d.ts +4 -0
- package/dist/lib/number-parsers.d.ts +2 -0
- package/dist/lib/reactivity/createInstanceValueState.d.ts +2 -27
- package/dist/lib/reactivity/createItemCollection.d.ts +21 -0
- package/dist/lib/xml-serialization.d.ts +11 -2
- package/dist/parse/XFormDOM.d.ts +1 -1
- package/dist/parse/body/BodyDefinition.d.ts +2 -2
- package/dist/parse/body/appearance/rangeAppearanceParser.d.ts +3 -0
- package/dist/parse/body/control/InputControlDefinition.d.ts +3 -0
- package/dist/parse/body/control/ItemDefinition.d.ts +14 -0
- package/dist/parse/body/control/ItemsetDefinition.d.ts +18 -0
- package/dist/parse/body/control/RangeControlDefinition.d.ts +31 -2
- package/dist/parse/body/control/RankControlDefinition.d.ts +7 -3
- package/dist/parse/body/control/{select/SelectDefinition.d.ts → SelectControlDefinition.d.ts} +9 -9
- package/dist/parse/expression/ItemsetNodesetExpression.d.ts +1 -1
- package/dist/parse/expression/ItemsetValueExpression.d.ts +1 -1
- package/dist/parse/model/BindDefinition.d.ts +3 -1
- package/dist/parse/model/BindPreloadDefinition.d.ts +42 -0
- package/dist/parse/model/DescendentNodeDefinition.d.ts +4 -13
- package/dist/parse/model/ItextTranslationsDefinition.d.ts +18 -0
- package/dist/parse/model/LeafNodeDefinition.d.ts +9 -7
- package/dist/parse/model/ModelDefinition.d.ts +9 -2
- package/dist/parse/model/NodeDefinition.d.ts +30 -45
- package/dist/parse/model/NoteNodeDefinition.d.ts +7 -5
- package/dist/parse/model/RangeNodeDefinition.d.ts +42 -0
- package/dist/parse/model/RepeatDefinition.d.ts +62 -0
- package/dist/parse/model/RootAttributeDefinition.d.ts +21 -0
- package/dist/parse/model/RootAttributeMap.d.ts +24 -0
- package/dist/parse/model/RootDefinition.d.ts +15 -14
- package/dist/parse/model/SecondaryInstance/SecondaryInstancesDefinition.d.ts +15 -2
- package/dist/parse/model/SecondaryInstance/assertSecondaryInstanceDefinition.d.ts +5 -0
- package/dist/parse/model/SecondaryInstance/defineSecondaryInstance.d.ts +5 -0
- package/dist/parse/model/SecondaryInstance/sources/BlankSecondaryInstanceSource.d.ts +1 -7
- package/dist/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.d.ts +1 -1
- package/dist/parse/model/SecondaryInstance/sources/GeoJSONExternalSecondaryInstance.d.ts +1 -1
- package/dist/parse/model/SecondaryInstance/sources/InternalSecondaryInstanceSource.d.ts +1 -1
- package/dist/parse/model/SecondaryInstance/sources/SecondaryInstanceSource.d.ts +1 -1
- package/dist/parse/model/SecondaryInstance/sources/XMLExternalSecondaryInstanceSource.d.ts +1 -1
- package/dist/parse/model/{FormSubmissionDefinition.d.ts → SubmissionDefinition.d.ts} +2 -2
- package/dist/parse/model/SubtreeDefinition.d.ts +9 -7
- package/dist/parse/model/nodeDefinitionMap.d.ts +5 -0
- package/dist/parse/shared/parseInstanceXML.d.ts +21 -0
- package/dist/parse/shared/parseStaticDocumentFromDOMSubtree.d.ts +4 -22
- package/dist/parse/text/ItemLabelDefinition.d.ts +1 -1
- package/dist/parse/text/ItemsetLabelDefinition.d.ts +2 -2
- package/dist/parse/text/abstract/TextElementDefinition.d.ts +1 -1
- package/dist/parse/xpath/semantic-analysis.d.ts +1 -3
- package/dist/solid.js +7247 -5813
- package/dist/solid.js.map +1 -1
- package/package.json +15 -12
- package/src/client/BaseNode.ts +9 -4
- package/src/client/BaseValueNode.ts +8 -4
- package/src/client/GroupNode.ts +1 -0
- package/src/client/InputNode.ts +38 -2
- package/src/client/ModelValueNode.ts +1 -0
- package/src/client/NoteNode.ts +43 -7
- package/src/client/RangeNode.ts +51 -0
- package/src/client/RankNode.ts +54 -0
- package/src/client/RootNode.ts +30 -16
- package/src/client/SelectNode.ts +53 -26
- package/src/client/SubtreeNode.ts +1 -0
- package/src/client/TriggerNode.ts +12 -6
- package/src/client/constants.ts +12 -14
- package/src/client/form/CreateFormInstance.ts +19 -0
- package/src/client/form/EditFormInstance.ts +93 -0
- package/src/client/form/FormInstance.ts +114 -0
- package/src/client/form/FormInstanceConfig.ts +18 -0
- package/src/client/form/FormResource.ts +1 -0
- package/src/client/form/LoadForm.ts +92 -0
- package/src/client/form/LoadFormResult.ts +103 -0
- package/src/client/form/RestoreFormInstance.ts +14 -0
- package/src/client/hierarchy.ts +7 -8
- package/src/client/index.ts +47 -29
- package/src/client/node-types.ts +3 -5
- package/src/client/repeat/BaseRepeatRangeNode.ts +3 -4
- package/src/client/repeat/RepeatInstanceNode.ts +4 -8
- package/src/client/repeat/RepeatRangeControlledNode.ts +2 -2
- package/src/client/repeat/RepeatRangeUncontrolledNode.ts +2 -2
- package/src/client/resources.ts +2 -2
- package/src/client/serialization/InstanceData.ts +16 -0
- package/src/client/serialization/InstanceFile.ts +9 -0
- package/src/client/serialization/InstancePayload.ts +126 -0
- package/src/client/serialization/InstancePayloadOptions.ts +28 -0
- package/src/client/serialization/InstanceState.ts +14 -0
- package/src/client/submission/{SubmissionDefinition.ts → SubmissionMeta.ts} +1 -1
- package/src/client/unsupported/UnsupportedControlNode.ts +2 -6
- package/src/entrypoints/FormInstance.ts +55 -0
- package/src/entrypoints/FormResult/BaseFormResult.ts +40 -0
- package/src/entrypoints/FormResult/BaseInstantiableFormResult.ts +109 -0
- package/src/entrypoints/FormResult/FormFailureResult.ts +44 -0
- package/src/entrypoints/FormResult/FormSuccessResult.ts +25 -0
- package/src/entrypoints/FormResult/FormWarningResult.ts +25 -0
- package/src/entrypoints/createInstance.ts +23 -0
- package/src/entrypoints/editInstance.ts +24 -0
- package/src/entrypoints/index.ts +4 -0
- package/src/entrypoints/loadForm.ts +154 -0
- package/src/entrypoints/restoreInstance.ts +27 -0
- package/src/error/LoadFormFailureError.ts +114 -0
- package/src/error/MalformedInstanceDataError.ts +3 -0
- package/src/error/RankMissingValueError.ts +5 -0
- package/src/error/RankValueTypeError.ts +13 -0
- package/src/error/SelectValueTypeError.ts +22 -0
- package/src/error/TemplatedNodeAttributeSerializationError.ts +24 -0
- package/src/error/XFormsSpecViolationError.ts +1 -0
- package/src/index.ts +2 -56
- package/src/instance/Group.ts +17 -15
- package/src/instance/InputControl.ts +58 -12
- package/src/instance/ModelValue.ts +19 -11
- package/src/instance/Note.ts +40 -64
- package/src/instance/PrimaryInstance.ts +70 -31
- package/src/instance/RangeControl.ts +119 -0
- package/src/instance/RankControl.ts +208 -0
- package/src/instance/Root.ts +21 -31
- package/src/instance/SelectControl.ts +228 -0
- package/src/instance/Subtree.ts +17 -15
- package/src/instance/TriggerControl.ts +50 -80
- package/src/instance/abstract/DescendantNode.ts +13 -8
- package/src/instance/abstract/InstanceNode.ts +19 -7
- package/src/instance/abstract/ValueNode.ts +14 -15
- package/src/instance/children/DescendantNodeInitOptions.ts +35 -0
- package/src/instance/children/buildChildren.ts +206 -0
- package/src/instance/children/childrenInitOptions.ts +117 -0
- package/src/instance/children/normalizeChildInitOptions.ts +332 -0
- package/src/instance/hierarchy.ts +21 -16
- package/src/instance/input/InitialInstanceState.ts +108 -0
- package/src/instance/input/InstanceAttachmentMap.ts +142 -0
- package/src/instance/internal-api/InstanceConfig.ts +3 -10
- package/src/instance/internal-api/InstanceValueContext.ts +11 -1
- package/src/instance/internal-api/serialization/ClientReactiveSerializableInstance.ts +20 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableLeafNode.ts +43 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableParentNode.ts +26 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableTemplatedNode.ts +24 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableValueNode.ts +28 -0
- package/src/instance/repeat/BaseRepeatRange.ts +21 -24
- package/src/instance/repeat/RepeatInstance.ts +27 -19
- package/src/instance/repeat/RepeatRangeControlled.ts +90 -17
- package/src/instance/repeat/RepeatRangeUncontrolled.ts +10 -9
- package/src/instance/resource.ts +18 -2
- package/src/instance/unsupported/UploadControl.ts +116 -5
- package/src/integration/xpath/EngineXPathEvaluator.ts +2 -2
- package/src/integration/xpath/adapter/kind.ts +1 -28
- package/src/integration/xpath/adapter/names.ts +66 -17
- package/src/integration/xpath/adapter/traversal.ts +12 -11
- package/src/integration/xpath/static-dom/StaticAttribute.ts +16 -7
- package/src/integration/xpath/static-dom/StaticDocument.ts +17 -18
- package/src/integration/xpath/static-dom/StaticElement.ts +211 -52
- package/src/integration/xpath/static-dom/StaticNode.ts +1 -1
- package/src/integration/xpath/static-dom/StaticParentNode.ts +22 -0
- package/src/integration/xpath/static-dom/staticNodeName.ts +20 -0
- package/src/lib/client-reactivity/instance-state/createNodeRangeInstanceState.ts +17 -0
- package/src/lib/client-reactivity/instance-state/createParentNodeInstanceState.ts +22 -0
- package/src/lib/client-reactivity/instance-state/createPrimaryInstanceState.ts +12 -0
- package/src/lib/client-reactivity/instance-state/createRootInstanceState.ts +19 -0
- package/src/lib/client-reactivity/instance-state/createTemplatedNodeInstanceState.ts +31 -0
- package/src/lib/client-reactivity/instance-state/createValueNodeInstanceState.ts +21 -0
- package/src/lib/client-reactivity/instance-state/prepareInstancePayload.ts +173 -0
- package/src/lib/codecs/Geopoint/Geopoint.ts +150 -0
- package/src/lib/codecs/Geopoint/GeopointValueCodec.ts +20 -0
- package/src/lib/codecs/NoteCodec.ts +32 -0
- package/src/lib/codecs/RangeCodec.ts +65 -0
- package/src/lib/codecs/TempUnsupportedControlCodec.ts +32 -0
- package/src/lib/codecs/TriggerCodec.ts +64 -0
- package/src/lib/codecs/ValueArrayCodec.ts +42 -0
- package/src/lib/codecs/ValueCodec.ts +2 -2
- package/src/lib/codecs/getNoteCodec.ts +27 -0
- package/src/lib/codecs/getSelectCodec.ts +27 -0
- package/src/lib/codecs/getSharedValueCodec.ts +5 -3
- package/src/lib/codecs/items/BaseItemCodec.ts +20 -0
- package/src/lib/codecs/items/MultipleValueItemCodec.ts +28 -0
- package/src/lib/codecs/items/SingleValueItemCodec.ts +67 -0
- package/src/lib/dom/query.ts +1 -2
- package/src/lib/names/NamespaceDeclaration.ts +106 -0
- package/src/lib/names/NamespaceDeclarationMap.ts +228 -0
- package/src/lib/names/NamespaceURL.ts +44 -0
- package/src/lib/names/QualifiedName.ts +170 -0
- package/src/lib/names/UnprefixedXFormsName.ts +12 -0
- package/src/lib/number-parsers.ts +25 -0
- package/src/lib/reactivity/createInstanceValueState.ts +69 -43
- package/src/lib/reactivity/{createSelectItems.ts → createItemCollection.ts} +41 -36
- package/src/lib/xml-serialization.ts +76 -9
- package/src/parse/XFormDOM.ts +141 -21
- package/src/parse/XFormDefinition.ts +1 -4
- package/src/parse/body/BodyDefinition.ts +4 -4
- package/src/parse/body/appearance/rangeAppearanceParser.ts +11 -0
- package/src/parse/body/control/InputControlDefinition.ts +9 -0
- package/src/parse/body/control/{select/ItemDefinition.ts → ItemDefinition.ts} +8 -6
- package/src/parse/body/control/{select/ItemsetDefinition.ts → ItemsetDefinition.ts} +11 -9
- package/src/parse/body/control/RangeControlDefinition.ts +91 -6
- package/src/parse/body/control/RankControlDefinition.ts +25 -7
- package/src/parse/body/control/{select/SelectDefinition.ts → SelectControlDefinition.ts} +9 -9
- package/src/parse/expression/ItemsetNodesetExpression.ts +1 -1
- package/src/parse/expression/ItemsetValueExpression.ts +1 -1
- package/src/parse/model/BindDefinition.ts +4 -0
- package/src/parse/model/BindPreloadDefinition.ts +100 -0
- package/src/parse/model/DescendentNodeDefinition.ts +7 -25
- package/src/parse/model/ItextTranslationsDefinition.ts +79 -0
- package/src/parse/model/LeafNodeDefinition.ts +13 -8
- package/src/parse/model/ModelDefinition.ts +36 -3
- package/src/parse/model/NodeDefinition.ts +38 -85
- package/src/parse/model/NoteNodeDefinition.ts +12 -10
- package/src/parse/model/RangeNodeDefinition.ts +119 -0
- package/src/parse/model/RepeatDefinition.ts +382 -0
- package/src/parse/model/RootAttributeDefinition.ts +44 -0
- package/src/parse/model/RootAttributeMap.ts +49 -0
- package/src/parse/model/RootDefinition.ts +42 -43
- package/src/parse/model/SecondaryInstance/SecondaryInstancesDefinition.ts +23 -2
- package/src/parse/model/SecondaryInstance/assertSecondaryInstanceDefinition.ts +14 -0
- package/src/parse/model/SecondaryInstance/defineSecondaryInstance.ts +32 -0
- package/src/parse/model/SecondaryInstance/sources/BlankSecondaryInstanceSource.ts +3 -24
- package/src/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.ts +33 -86
- package/src/parse/model/SecondaryInstance/sources/GeoJSONExternalSecondaryInstance.ts +64 -136
- package/src/parse/model/SecondaryInstance/sources/InternalSecondaryInstanceSource.ts +9 -7
- package/src/parse/model/SecondaryInstance/sources/SecondaryInstanceSource.ts +1 -1
- package/src/parse/model/SecondaryInstance/sources/XMLExternalSecondaryInstanceSource.ts +7 -7
- package/src/parse/model/{FormSubmissionDefinition.ts → SubmissionDefinition.ts} +2 -2
- package/src/parse/model/SubtreeDefinition.ts +15 -16
- package/src/parse/model/nodeDefinitionMap.ts +34 -0
- package/src/parse/shared/parseInstanceXML.ts +79 -0
- package/src/parse/shared/parseStaticDocumentFromDOMSubtree.ts +46 -131
- package/src/parse/text/ItemLabelDefinition.ts +1 -1
- package/src/parse/text/ItemsetLabelDefinition.ts +2 -2
- package/src/parse/text/abstract/TextElementDefinition.ts +1 -1
- package/src/parse/xpath/semantic-analysis.ts +4 -3
- package/dist/client/EngineConfig.d.ts +0 -79
- package/dist/client/submission/SubmissionData.d.ts +0 -7
- package/dist/client/submission/SubmissionInstanceFile.d.ts +0 -6
- package/dist/client/submission/SubmissionOptions.d.ts +0 -23
- package/dist/client/submission/SubmissionResult.d.ts +0 -91
- package/dist/client/submission/SubmissionState.d.ts +0 -12
- package/dist/client/unsupported/RangeNode.d.ts +0 -9
- package/dist/client/unsupported/RankNode.d.ts +0 -9
- package/dist/instance/SelectField.d.ts +0 -58
- package/dist/instance/abstract/UnsupportedControl.d.ts +0 -53
- package/dist/instance/index.d.ts +0 -8
- package/dist/instance/internal-api/ValueContext.d.ts +0 -23
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableInstance.d.ts +0 -14
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableLeafNode.d.ts +0 -31
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableParentNode.d.ts +0 -18
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableValueNode.d.ts +0 -17
- package/dist/instance/unsupported/RangeControl.d.ts +0 -6
- package/dist/instance/unsupported/RankControl.d.ts +0 -6
- package/dist/integration/xpath/static-dom/StaticNamedNode.d.ts +0 -17
- package/dist/lib/client-reactivity/submission/createInstanceSubmissionState.d.ts +0 -3
- package/dist/lib/client-reactivity/submission/createLeafNodeSubmissionState.d.ts +0 -3
- package/dist/lib/client-reactivity/submission/createNodeRangeSubmissionState.d.ts +0 -4
- package/dist/lib/client-reactivity/submission/createParentNodeSubmissionState.d.ts +0 -4
- package/dist/lib/client-reactivity/submission/createValueNodeSubmissionState.d.ts +0 -3
- package/dist/lib/client-reactivity/submission/prepareSubmission.d.ts +0 -8
- package/dist/lib/reactivity/createSelectItems.d.ts +0 -16
- package/dist/lib/reactivity/createValueState.d.ts +0 -40
- package/dist/parse/body/control/select/ItemDefinition.d.ts +0 -13
- package/dist/parse/body/control/select/ItemsetDefinition.d.ts +0 -17
- package/dist/parse/body/control/select/ItemsetNodesetContext.d.ts +0 -9
- package/dist/parse/model/ItextTranslation/ItextTranslationDefinition.d.ts +0 -4
- package/dist/parse/model/ItextTranslation/ItextTranslationRootDefinition.d.ts +0 -8
- package/dist/parse/model/ItextTranslation/ItextTranslationsDefinition.d.ts +0 -8
- package/dist/parse/model/RepeatInstanceDefinition.d.ts +0 -14
- package/dist/parse/model/RepeatRangeDefinition.d.ts +0 -29
- package/dist/parse/model/RepeatTemplateDefinition.d.ts +0 -28
- package/dist/parse/model/SecondaryInstance/SecondaryInstanceDefinition.d.ts +0 -4
- package/dist/parse/model/SecondaryInstance/SecondaryInstanceRootDefinition.d.ts +0 -7
- package/src/client/EngineConfig.ts +0 -84
- package/src/client/submission/SubmissionData.ts +0 -12
- package/src/client/submission/SubmissionInstanceFile.ts +0 -9
- package/src/client/submission/SubmissionOptions.ts +0 -28
- package/src/client/submission/SubmissionResult.ts +0 -124
- package/src/client/submission/SubmissionState.ts +0 -14
- package/src/client/unsupported/RangeNode.ts +0 -14
- package/src/client/unsupported/RankNode.ts +0 -14
- package/src/instance/SelectField.ts +0 -263
- package/src/instance/abstract/UnsupportedControl.ts +0 -174
- package/src/instance/children.ts +0 -158
- package/src/instance/index.ts +0 -55
- package/src/instance/internal-api/ValueContext.ts +0 -28
- package/src/instance/internal-api/submission/ClientReactiveSubmittableInstance.ts +0 -20
- package/src/instance/internal-api/submission/ClientReactiveSubmittableLeafNode.ts +0 -42
- package/src/instance/internal-api/submission/ClientReactiveSubmittableParentNode.ts +0 -25
- package/src/instance/internal-api/submission/ClientReactiveSubmittableValueNode.ts +0 -23
- package/src/instance/unsupported/RangeControl.ts +0 -9
- package/src/instance/unsupported/RankControl.ts +0 -9
- package/src/integration/xpath/static-dom/StaticNamedNode.ts +0 -45
- package/src/lib/client-reactivity/submission/createInstanceSubmissionState.ts +0 -12
- package/src/lib/client-reactivity/submission/createLeafNodeSubmissionState.ts +0 -20
- package/src/lib/client-reactivity/submission/createNodeRangeSubmissionState.ts +0 -17
- package/src/lib/client-reactivity/submission/createParentNodeSubmissionState.ts +0 -22
- package/src/lib/client-reactivity/submission/createValueNodeSubmissionState.ts +0 -21
- package/src/lib/client-reactivity/submission/prepareSubmission.ts +0 -172
- package/src/lib/reactivity/createValueState.ts +0 -200
- package/src/parse/body/control/select/ItemsetNodesetContext.ts +0 -21
- package/src/parse/model/ItextTranslation/ItextTranslationDefinition.ts +0 -4
- package/src/parse/model/ItextTranslation/ItextTranslationRootDefinition.ts +0 -41
- package/src/parse/model/ItextTranslation/ItextTranslationsDefinition.ts +0 -31
- package/src/parse/model/RepeatInstanceDefinition.ts +0 -34
- package/src/parse/model/RepeatRangeDefinition.ts +0 -94
- package/src/parse/model/RepeatTemplateDefinition.ts +0 -145
- package/src/parse/model/SecondaryInstance/SecondaryInstanceDefinition.ts +0 -4
- package/src/parse/model/SecondaryInstance/SecondaryInstanceRootDefinition.ts +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormResource } from '../client/
|
|
1
|
+
import { FormResource } from '../client/form/FormResource.ts';
|
|
2
2
|
import { FetchResource, FetchResourceResponse } from '../client/resources.ts';
|
|
3
3
|
export type { FetchResource, FetchResourceResponse, FormResource };
|
|
4
4
|
export interface ResourceOptions {
|
|
@@ -8,3 +8,7 @@ declare const resourceXMLPrefix = "<";
|
|
|
8
8
|
type ResourceXMLPrefix = typeof resourceXMLPrefix;
|
|
9
9
|
type ResourceXML = `${ResourceXMLPrefix}${string}`;
|
|
10
10
|
export declare const retrieveSourceXMLResource: (resource: FormResource, options: ResourceOptions) => Promise<ResourceXML>;
|
|
11
|
+
interface RetrieveFormDefinitionOptions {
|
|
12
|
+
readonly fetchFormDefinition: FetchResource;
|
|
13
|
+
}
|
|
14
|
+
export declare const retrieveFormDefinition: (resource: FormResource, options: RetrieveFormDefinitionOptions) => Promise<ResourceXML>;
|
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
3
|
+
import { TextRange } from '../../client/TextRange.ts';
|
|
4
|
+
import { ValueType } from '../../client/ValueType.ts';
|
|
5
|
+
import { UploadNode, UploadNodeDefinition } from '../../client/unsupported/UploadNode.ts';
|
|
6
|
+
import { XFormsXPathElement } from '../../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
|
+
import { StaticLeafElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
8
|
+
import { TempUnsupportedInputValue, TempUnsupportedRuntimeValue } from '../../lib/codecs/TempUnsupportedControlCodec.ts';
|
|
9
|
+
import { CurrentState } from '../../lib/reactivity/node-state/createCurrentState.ts';
|
|
10
|
+
import { EngineState } from '../../lib/reactivity/node-state/createEngineState.ts';
|
|
11
|
+
import { SharedNodeState } from '../../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
12
|
+
import { UnknownAppearanceDefinition } from '../../parse/body/appearance/unknownAppearanceParser.ts';
|
|
13
|
+
import { ValueNode, ValueNodeStateSpec } from '../abstract/ValueNode.ts';
|
|
14
|
+
import { GeneralParentNode } from '../hierarchy.ts';
|
|
15
|
+
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
16
|
+
import { ValidationContext } from '../internal-api/ValidationContext.ts';
|
|
17
|
+
import { ClientReactiveSerializableValueNode } from '../internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
18
|
+
interface UploadControlStateSpec extends ValueNodeStateSpec<TempUnsupportedRuntimeValue> {
|
|
19
|
+
readonly label: Accessor<TextRange<'label'> | null>;
|
|
20
|
+
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
21
|
+
readonly valueOptions: null;
|
|
22
|
+
}
|
|
23
|
+
export declare class UploadControl extends ValueNode<ValueType, UploadNodeDefinition, TempUnsupportedRuntimeValue, TempUnsupportedInputValue> implements UploadNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
24
|
+
readonly [XPathNodeKindKey] = "element";
|
|
25
|
+
protected readonly state: SharedNodeState<UploadControlStateSpec>;
|
|
26
|
+
protected readonly engineState: EngineState<UploadControlStateSpec>;
|
|
4
27
|
readonly nodeType = "upload";
|
|
5
|
-
readonly
|
|
28
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
29
|
+
readonly nodeOptions: null;
|
|
30
|
+
readonly currentState: CurrentState<UploadControlStateSpec>;
|
|
31
|
+
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: UploadNodeDefinition);
|
|
32
|
+
setValue(_: never): never;
|
|
6
33
|
}
|
|
34
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { XFormsItextTranslationMap, XFormsSecondaryInstanceMap, XFormsXPathEvaluator } from '@getodk/xpath';
|
|
2
2
|
import { PrimaryInstance } from '../../instance/PrimaryInstance.ts';
|
|
3
|
-
import { ItextTranslationRootDefinition } from '../../parse/model/
|
|
4
|
-
import { SecondaryInstanceRootDefinition } from '../../parse/model/SecondaryInstance/
|
|
3
|
+
import { ItextTranslationRootDefinition } from '../../parse/model/ItextTranslationsDefinition.ts';
|
|
4
|
+
import { SecondaryInstanceRootDefinition } from '../../parse/model/SecondaryInstance/SecondaryInstancesDefinition.ts';
|
|
5
5
|
import { EngineXPathNode } from './adapter/kind.ts';
|
|
6
6
|
interface EngineXPathEvaluatorOptions {
|
|
7
7
|
readonly rootNode: PrimaryInstance;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { XPathNodeKind } from '@getodk/xpath';
|
|
2
|
-
import { AnyChildNode, AnyNode, AnyParentNode
|
|
3
|
-
import { ValueContext } from '../../../instance/internal-api/ValueContext.ts';
|
|
2
|
+
import { AnyChildNode, AnyNode, AnyParentNode } from '../../../instance/hierarchy.ts';
|
|
4
3
|
import { PrimaryInstance } from '../../../instance/PrimaryInstance.ts';
|
|
5
|
-
import { ItextTranslationDefinition } from '../../../parse/model/ItextTranslation/ItextTranslationDefinition.ts';
|
|
6
|
-
import { ItextTranslationRootDefinition } from '../../../parse/model/ItextTranslation/ItextTranslationRootDefinition.ts';
|
|
7
|
-
import { SecondaryInstanceDefinition } from '../../../parse/model/SecondaryInstance/SecondaryInstanceDefinition.ts';
|
|
8
|
-
import { SecondaryInstanceRootDefinition } from '../../../parse/model/SecondaryInstance/SecondaryInstanceRootDefinition.ts';
|
|
9
4
|
import { StaticAttribute } from '../static-dom/StaticAttribute.ts';
|
|
10
5
|
import { StaticDocument } from '../static-dom/StaticDocument.ts';
|
|
11
6
|
import { StaticElement } from '../static-dom/StaticElement.ts';
|
|
@@ -15,16 +10,15 @@ export type PrimaryInstanceXPathNode = Extract<AnyNode, XFormsXPathPrimaryInstan
|
|
|
15
10
|
export type PrimaryInstanceXPathElement = Extract<AnyChildNode, XFormsXPathElement>;
|
|
16
11
|
export type PrimaryInstanceXPathComment = Extract<AnyChildNode, XFormsXPathComment>;
|
|
17
12
|
export type PrimaryInstanceXPathChildNode = PrimaryInstanceXPathElement | PrimaryInstanceXPathComment;
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
20
|
-
export type EngineXPathElement = PrimaryInstanceXPathElement | ItextTranslationRootDefinition | SecondaryInstanceRootDefinition | StaticElement;
|
|
13
|
+
export type EngineXPathDocument = PrimaryInstance | StaticDocument;
|
|
14
|
+
export type EngineXPathElement = PrimaryInstanceXPathElement | StaticElement;
|
|
21
15
|
export type EngineXPathComment = PrimaryInstanceXPathComment;
|
|
22
16
|
export type EngineXPathAttribute = StaticAttribute;
|
|
23
17
|
export type EngineXPathText = StaticText;
|
|
24
18
|
export type XFormsXPathChildNode = EngineXPathElement | EngineXPathText | EngineXPathComment;
|
|
25
19
|
type XPathAdapterParentNode = XFormsXPathDocument | XFormsXPathElement;
|
|
26
20
|
type PrimaryInstanceXPathParentNode = Extract<AnyParentNode, XPathAdapterParentNode>;
|
|
27
|
-
export type EngineXPathParentNode = PrimaryInstanceXPathParentNode |
|
|
21
|
+
export type EngineXPathParentNode = PrimaryInstanceXPathParentNode | StaticDocument | StaticElement;
|
|
28
22
|
export type EngineXPathNode = EngineXPathDocument | EngineXPathElement | EngineXPathAttribute | EngineXPathText | EngineXPathComment;
|
|
29
23
|
export declare const isEngineXPathNode: (value: unknown) => value is EngineXPathNode;
|
|
30
24
|
export declare const getEngineXPathNodeKind: (node: EngineXPathNode) => XPathNodeKind;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { EngineXPathNode } from './kind.ts';
|
|
2
2
|
export declare const getEngineXPathNodeNamespaceURI: (node: EngineXPathNode) => string | null;
|
|
3
|
-
/**
|
|
4
|
-
* @todo currently, neither {@link InstanceNode} nor {@link StaticNode} account
|
|
5
|
-
* for prefixes in qualified names. This was already a general enough gap that
|
|
6
|
-
* it makes sense to defer to a broader solution as it becomes a priority
|
|
7
|
-
* (likely prompted by a bug report about unexpected behavior of the XPath
|
|
8
|
-
* `name` function).
|
|
9
|
-
*/
|
|
10
3
|
export declare const getEngineXPathNodeQualifiedName: (node: EngineXPathNode) => string;
|
|
11
4
|
export declare const getEngineXPathNodeLocalName: (node: EngineXPathNode) => string;
|
|
12
5
|
export declare const getEngineProcessingInstructionName: () => never;
|
|
13
|
-
|
|
14
|
-
* @todo @see {@link getNamespaceDeclarations}
|
|
15
|
-
*/
|
|
16
|
-
export declare const resolveEngineXPathNodeNamespaceURI: (_: EngineXPathNode, prefix: string | null) => "http://www.w3.org/1999/xhtml" | "http://www.w3.org/2005/xpath-functions" | "http://openrosa.org/javarosa" | "http://www.opendatakit.org/xforms" | "http://openrosa.org/xforms" | "http://www.w3.org/2002/xforms" | "http://enketo.org/xforms" | null;
|
|
6
|
+
export declare const resolveEngineXPathNodeNamespaceURI: (node: EngineXPathNode, prefix: string | null) => string | null;
|
|
@@ -2,16 +2,17 @@ import { EngineXPathAttribute, EngineXPathDocument, EngineXPathElement, EngineXP
|
|
|
2
2
|
export declare const getContainingEngineXPathDocument: (node: EngineXPathNode) => EngineXPathDocument;
|
|
3
3
|
export declare const getEngineXPathAttributes: (node: EngineXPathNode) => Iterable<EngineXPathAttribute>;
|
|
4
4
|
/**
|
|
5
|
-
* @todo
|
|
6
|
-
*
|
|
7
|
-
* itext `translation`, secondary `instance`). Expressions defined in such forms
|
|
8
|
-
* may also expect to use those namespace declarations. It would even seem
|
|
9
|
-
* likely! Why declare namespaces on a subtree if you don't intend to use them?
|
|
10
|
-
* We don't currently capture namespace declarations below `h:html` in the parse
|
|
11
|
-
* stage (which, if we intend to support the use case, is where we should
|
|
12
|
-
* start).
|
|
5
|
+
* @todo We've now laid most of the groundwork necessary to implement this
|
|
6
|
+
* properly. At time of writing it has still been deferred because:
|
|
13
7
|
*
|
|
14
|
-
*
|
|
8
|
+
* 1. The scope of changes enabling it is already a fairly large yak shave.
|
|
9
|
+
* 2. It is only used to support XPath LocationPath Steps whose AxisName is
|
|
10
|
+
* `namespace`. If we _ever_ support this, it would probably be for extremely
|
|
11
|
+
* niche use cases!
|
|
12
|
+
*
|
|
13
|
+
* @todo Since we've consciously deferred implementing this (twice now!), should
|
|
14
|
+
* it throw? It might be nice to be alerted if the assumptions in point 2 above
|
|
15
|
+
* are somehow wrong (or become wrong).
|
|
15
16
|
*/
|
|
16
17
|
export declare const getNamespaceDeclarations: () => Iterable<never>;
|
|
17
18
|
export declare const getParentNode: (node: EngineXPathNode) => EngineXPathParentNode | null;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { QualifiedName } from '../../../lib/names/QualifiedName.ts';
|
|
2
3
|
import { XFormsXPathAttribute } from '../adapter/XFormsXPathNode.ts';
|
|
4
|
+
import { StaticDocument } from './StaticDocument.ts';
|
|
3
5
|
import { StaticElement } from './StaticElement.ts';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
+
import { StaticNode } from './StaticNode.ts';
|
|
7
|
+
import { StaticNodeNameSource } from './staticNodeName.ts';
|
|
8
|
+
export interface StaticAttributeOptions {
|
|
9
|
+
readonly name: StaticNodeNameSource;
|
|
6
10
|
readonly value: string;
|
|
7
11
|
}
|
|
8
|
-
export declare class StaticAttribute extends
|
|
12
|
+
export declare class StaticAttribute extends StaticNode<'attribute'> implements XFormsXPathAttribute {
|
|
9
13
|
readonly parent: StaticElement;
|
|
10
14
|
readonly [XPathNodeKindKey] = "attribute";
|
|
11
15
|
readonly nodeType = "static-attribute";
|
|
16
|
+
readonly rootDocument: StaticDocument;
|
|
12
17
|
readonly root: StaticElement;
|
|
18
|
+
readonly qualifiedName: QualifiedName;
|
|
19
|
+
readonly nodeset: string;
|
|
13
20
|
readonly attributes: readonly [];
|
|
14
21
|
readonly children: null;
|
|
15
22
|
readonly value: string;
|
|
16
23
|
constructor(parent: StaticElement, options: StaticAttributeOptions);
|
|
17
24
|
getXPathValue(): string;
|
|
18
25
|
}
|
|
19
|
-
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
1
|
import { XFormsXPathDocument } from '../adapter/XFormsXPathNode.ts';
|
|
3
|
-
import { StaticElement } from './StaticElement.ts';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly
|
|
8
|
-
|
|
2
|
+
import { StaticElementOptions, StaticElement } from './StaticElement.ts';
|
|
3
|
+
import { StaticParentNode } from './StaticParentNode.ts';
|
|
4
|
+
interface StaticDocumentOptions {
|
|
5
|
+
readonly documentRoot: StaticElementOptions;
|
|
6
|
+
readonly nodesetPrefix?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class StaticDocument extends StaticParentNode<'document'> implements XFormsXPathDocument {
|
|
9
9
|
readonly rootDocument: StaticDocument;
|
|
10
|
-
readonly root:
|
|
11
|
-
readonly isXFormsNamespace: boolean;
|
|
10
|
+
readonly root: StaticElement;
|
|
12
11
|
readonly parent: null;
|
|
13
|
-
readonly
|
|
14
|
-
|
|
12
|
+
readonly nodeset: string;
|
|
13
|
+
readonly children: readonly [root: StaticElement];
|
|
14
|
+
readonly childElements: readonly [root: StaticElement];
|
|
15
|
+
constructor(options: StaticDocumentOptions);
|
|
15
16
|
getXPathValue(): string;
|
|
16
17
|
}
|
|
18
|
+
export {};
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QualifiedNameSource, QualifiedName } from '../../../lib/names/QualifiedName.ts';
|
|
2
2
|
import { XFormsXPathElement } from '../adapter/XFormsXPathNode.ts';
|
|
3
|
-
import { StaticAttribute } from './StaticAttribute.ts';
|
|
4
|
-
import {
|
|
5
|
-
import { StaticChildNode
|
|
6
|
-
|
|
7
|
-
export type
|
|
8
|
-
export interface StaticElementOptions
|
|
3
|
+
import { StaticAttributeOptions, StaticAttribute } from './StaticAttribute.ts';
|
|
4
|
+
import { StaticDocument } from './StaticDocument.ts';
|
|
5
|
+
import { StaticChildNode } from './StaticNode.ts';
|
|
6
|
+
import { StaticParentNode } from './StaticParentNode.ts';
|
|
7
|
+
export type StaticElementChildOption = StaticElementOptions | string;
|
|
8
|
+
export interface StaticElementOptions {
|
|
9
|
+
readonly name: QualifiedNameSource | string;
|
|
10
|
+
readonly attributes?: readonly StaticAttributeOptions[];
|
|
11
|
+
readonly children?: readonly StaticElementChildOption[];
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
readonly [XFORMS_LOCAL_NAME]?: string;
|
|
15
|
-
readonly [XFORMS_KNOWN_ATTRIBUTE]?: string;
|
|
16
|
-
readonly [XPathNodeKindKey] = "element";
|
|
17
|
-
readonly nodeType = "static-element";
|
|
13
|
+
export declare class StaticElement extends StaticParentNode<'element'> implements XFormsXPathElement {
|
|
14
|
+
readonly parent: StaticDocument | StaticElement;
|
|
15
|
+
private computedValue;
|
|
16
|
+
readonly rootDocument: StaticDocument;
|
|
18
17
|
readonly root: StaticElement;
|
|
18
|
+
readonly qualifiedName: QualifiedName;
|
|
19
|
+
readonly nodeset: string;
|
|
19
20
|
readonly attributes: readonly StaticAttribute[];
|
|
20
21
|
readonly children: readonly StaticChildNode[];
|
|
21
|
-
|
|
22
|
+
readonly childElements: readonly StaticElement[];
|
|
23
|
+
readonly value: string | null;
|
|
24
|
+
constructor(parent: StaticDocument | StaticElement, options: StaticElementOptions);
|
|
25
|
+
isLeafElement(): this is StaticLeafElement;
|
|
26
|
+
assertLeafElement(): asserts this is StaticLeafElement;
|
|
22
27
|
/**
|
|
23
28
|
* @todo Generalize this, incorporate into {@link EngineDOMAdapter}
|
|
24
29
|
* @todo Namespaced lookup
|
|
@@ -34,7 +39,9 @@ export declare class StaticElement<Parent extends StaticParentNode = StaticParen
|
|
|
34
39
|
* up. (This was put off because the types are already plenty complex as it
|
|
35
40
|
* is.)
|
|
36
41
|
*/
|
|
37
|
-
getAttributeValue
|
|
42
|
+
getAttributeValue(localName: string): string | null;
|
|
38
43
|
getXPathValue(): string;
|
|
39
44
|
}
|
|
40
|
-
export {
|
|
45
|
+
export interface StaticLeafElement extends StaticElement {
|
|
46
|
+
readonly value: string;
|
|
47
|
+
}
|
|
@@ -29,5 +29,5 @@ export declare abstract class StaticNode<Kind extends StaticNodeKind> implements
|
|
|
29
29
|
abstract getXPathValue(): string;
|
|
30
30
|
}
|
|
31
31
|
export type AnyStaticNode = StaticDocument | StaticElement | StaticAttribute | StaticText;
|
|
32
|
-
export type
|
|
32
|
+
export type StaticNodeParent = StaticDocument | StaticElement;
|
|
33
33
|
export type StaticChildNode = StaticElement | StaticText;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { StaticElement } from './StaticElement.ts';
|
|
3
|
+
import { StaticNode, StaticChildNode } from './StaticNode.ts';
|
|
4
|
+
type StaticParentNodeKind = 'document' | 'element';
|
|
5
|
+
type StaticParentNodeType<Kind extends StaticParentNodeKind> = `static-${Kind}`;
|
|
6
|
+
export declare abstract class StaticParentNode<Kind extends StaticParentNodeKind> extends StaticNode<Kind> {
|
|
7
|
+
abstract readonly children: readonly StaticChildNode[];
|
|
8
|
+
abstract readonly childElements: readonly StaticElement[];
|
|
9
|
+
readonly [XPathNodeKindKey]: Kind;
|
|
10
|
+
readonly nodeType: StaticParentNodeType<Kind>;
|
|
11
|
+
constructor(kind: Kind);
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InstanceState } from '../../../client/serialization/InstanceState.ts';
|
|
2
|
+
import { ClientReactiveSerializableParentNode } from '../../../instance/internal-api/serialization/ClientReactiveSerializableParentNode.ts';
|
|
3
|
+
import { RepeatInstance } from '../../../instance/repeat/RepeatInstance.ts';
|
|
4
|
+
export declare const createNodeRangeInstanceState: (node: ClientReactiveSerializableParentNode<RepeatInstance>) => InstanceState;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InstanceState } from '../../../client/serialization/InstanceState.ts';
|
|
2
|
+
import { GeneralChildNode } from '../../../instance/hierarchy.ts';
|
|
3
|
+
import { ClientReactiveSerializableParentNode } from '../../../instance/internal-api/serialization/ClientReactiveSerializableParentNode.ts';
|
|
4
|
+
export declare const createParentNodeInstanceState: (node: ClientReactiveSerializableParentNode<GeneralChildNode>) => InstanceState;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InstanceState } from '../../../client/serialization/InstanceState.ts';
|
|
2
|
+
import { ClientReactiveSerializableInstance } from '../../../instance/internal-api/serialization/ClientReactiveSerializableInstance.ts';
|
|
3
|
+
export declare const createPrimaryInstanceState: (node: ClientReactiveSerializableInstance) => InstanceState;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InstanceState } from '../../../client/serialization/InstanceState.ts';
|
|
2
|
+
import { ClientReactiveSerializableTemplatedNode } from '../../../instance/internal-api/serialization/ClientReactiveSerializableTemplatedNode.ts';
|
|
3
|
+
/**
|
|
4
|
+
* @see {@link TemplatedNodeAttributeSerializationError}
|
|
5
|
+
*/
|
|
6
|
+
export declare const createTemplatedNodeInstanceState: (node: ClientReactiveSerializableTemplatedNode) => InstanceState;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InstanceState } from '../../../client/serialization/InstanceState.ts';
|
|
2
|
+
import { ClientReactiveSerializableValueNode } from '../../../instance/internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
3
|
+
export declare const createValueNodeInstanceState: (node: ClientReactiveSerializableValueNode) => InstanceState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InstancePayload } from '../../../client/serialization/InstancePayload.ts';
|
|
2
|
+
import { InstancePayloadType } from '../../../client/serialization/InstancePayloadOptions.ts';
|
|
3
|
+
import { ClientReactiveSerializableInstance } from '../../../instance/internal-api/serialization/ClientReactiveSerializableInstance.ts';
|
|
4
|
+
export interface PrepareInstancePayloadOptions<PayloadType extends InstancePayloadType> {
|
|
5
|
+
readonly payloadType: PayloadType;
|
|
6
|
+
readonly maxSize: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const prepareInstancePayload: <PayloadType extends InstancePayloadType>(instanceRoot: ClientReactiveSerializableInstance, options: PrepareInstancePayloadOptions<PayloadType>) => InstancePayload<PayloadType>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This abstract class defines the minimal behavior for a default geopoint.
|
|
3
|
+
* It can be expanded later to support units (e.g., degrees or meters),
|
|
4
|
+
* which would also serve as documentation to clarify what each value represents.
|
|
5
|
+
*/
|
|
6
|
+
declare abstract class SemanticValue<Semantic extends string, Value extends number | null> {
|
|
7
|
+
readonly value: Value;
|
|
8
|
+
abstract readonly semantic: Semantic;
|
|
9
|
+
constructor(value: Value);
|
|
10
|
+
}
|
|
11
|
+
declare class Latitude extends SemanticValue<'latitude', number> {
|
|
12
|
+
readonly semantic = "latitude";
|
|
13
|
+
}
|
|
14
|
+
declare class Longitude extends SemanticValue<'longitude', number> {
|
|
15
|
+
readonly semantic = "longitude";
|
|
16
|
+
}
|
|
17
|
+
declare class Altitude<Value extends number | null = number> extends SemanticValue<'altitude', Value> {
|
|
18
|
+
readonly semantic = "altitude";
|
|
19
|
+
}
|
|
20
|
+
declare class Accuracy<Value extends number | null = number> extends SemanticValue<'accuracy', Value> {
|
|
21
|
+
readonly semantic = "accuracy";
|
|
22
|
+
}
|
|
23
|
+
export interface GeopointValue {
|
|
24
|
+
readonly latitude: number;
|
|
25
|
+
readonly longitude: number;
|
|
26
|
+
readonly altitude: number | null;
|
|
27
|
+
readonly accuracy: number | null;
|
|
28
|
+
}
|
|
29
|
+
export type GeopointRuntimeValue = GeopointValue | null;
|
|
30
|
+
export type GeopointInputValue = GeopointRuntimeValue | string;
|
|
31
|
+
type GeopointTuple = readonly [
|
|
32
|
+
latitude: Latitude,
|
|
33
|
+
longitude: Longitude,
|
|
34
|
+
altitude: Altitude<null> | Altitude<number>,
|
|
35
|
+
accuracy: Accuracy
|
|
36
|
+
] | readonly [latitude: Latitude, longitude: Longitude, altitude: Altitude] | readonly [latitude: Latitude, longitude: Longitude];
|
|
37
|
+
export declare class Geopoint {
|
|
38
|
+
private readonly internalValue;
|
|
39
|
+
constructor(coordinates: GeopointValue);
|
|
40
|
+
getTuple(): GeopointTuple;
|
|
41
|
+
getRuntimeValue(): GeopointRuntimeValue;
|
|
42
|
+
private isValidDegrees;
|
|
43
|
+
private isValidNumber;
|
|
44
|
+
private static isNullLocation;
|
|
45
|
+
static parseString(value: string): GeopointRuntimeValue;
|
|
46
|
+
static toCoordinatesString(value: GeopointInputValue): string;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValueType } from '../../client/ValueType.ts';
|
|
2
|
+
import { RuntimeInputValue, RuntimeValue, SharedValueCodec } from './getSharedValueCodec.ts';
|
|
3
|
+
import { ValueCodec } from './ValueCodec.ts';
|
|
4
|
+
export type NoteRuntimeValue<V extends ValueType> = RuntimeValue<V> | null;
|
|
5
|
+
export type NoteInputValue<V extends ValueType> = RuntimeInputValue<V> | RuntimeValue<V> | null;
|
|
6
|
+
export declare class NoteCodec<V extends ValueType> extends ValueCodec<V, NoteRuntimeValue<V>, NoteInputValue<V>> {
|
|
7
|
+
constructor(baseCodec: SharedValueCodec<V>);
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RangeNodeDefinition, RangeValueType } from '../../parse/model/RangeNodeDefinition.ts';
|
|
2
|
+
import { RuntimeInputValue, RuntimeValue, SharedValueCodec } from './getSharedValueCodec.ts';
|
|
3
|
+
import { ValueCodec } from './ValueCodec.ts';
|
|
4
|
+
export type RangeRuntimeValue<V extends RangeValueType> = RuntimeValue<V>;
|
|
5
|
+
export type RangeInputValue<V extends RangeValueType> = RuntimeInputValue<V>;
|
|
6
|
+
export declare class RangeCodec<V extends RangeValueType> extends ValueCodec<V, RangeRuntimeValue<V>, RangeInputValue<V>> {
|
|
7
|
+
constructor(baseCodec: SharedValueCodec<V>, definition: RangeNodeDefinition<V>);
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ValueType } from '../../client/ValueType.ts';
|
|
2
|
+
import { ValueCodec } from './ValueCodec.ts';
|
|
3
|
+
export type TempUnsupportedRuntimeValue = unknown;
|
|
4
|
+
export type TempUnsupportedInputValue = unknown;
|
|
5
|
+
export declare class TempUnsupportedControlCodec<V extends ValueType> extends ValueCodec<V, TempUnsupportedRuntimeValue, TempUnsupportedInputValue> {
|
|
6
|
+
constructor(valueType: V);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ValueCodec } from './ValueCodec.ts';
|
|
2
|
+
export type TriggerValueType = 'string';
|
|
3
|
+
export type TriggerRuntimeValue = boolean;
|
|
4
|
+
export type TriggerInputValue = boolean | '' | null;
|
|
5
|
+
export declare class TriggerCodec extends ValueCodec<TriggerValueType, TriggerRuntimeValue, TriggerInputValue> {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ValueType } from '../../client/ValueType.ts';
|
|
2
|
+
import { RuntimeValue, SharedValueCodec } from './getSharedValueCodec.ts';
|
|
3
|
+
import { CodecDecoder, CodecEncoder, ValueCodec } from './ValueCodec.ts';
|
|
4
|
+
export type SplitInstanceValues = (value: string) => readonly string[];
|
|
5
|
+
export type JoinInstnaceValues = (values: readonly string[]) => string;
|
|
6
|
+
export type RuntimeItemValue<V extends ValueType> = NonNullable<RuntimeValue<V>>;
|
|
7
|
+
export type RuntimeValues<V extends ValueType> = ReadonlyArray<RuntimeItemValue<V>>;
|
|
8
|
+
export declare abstract class ValueArrayCodec<V extends ValueType, Values extends RuntimeValues<V> = RuntimeValues<V>> extends ValueCodec<V, Values, Values> {
|
|
9
|
+
readonly decodeItemValue: CodecDecoder<RuntimeItemValue<V>>;
|
|
10
|
+
constructor(baseCodec: SharedValueCodec<V>, encodeValue: CodecEncoder<Values>, decodeValue: CodecDecoder<Values>);
|
|
11
|
+
}
|
|
@@ -2,8 +2,8 @@ import { Accessor } from 'solid-js';
|
|
|
2
2
|
import { ValueType } from '../../client/ValueType.ts';
|
|
3
3
|
import { DecodeInstanceValue } from '../../instance/internal-api/InstanceValueContext.ts';
|
|
4
4
|
import { SimpleAtomicState } from '../reactivity/types.ts';
|
|
5
|
-
type CodecEncoder<RuntimeInputValue> = (input: RuntimeInputValue) => string;
|
|
6
|
-
type CodecDecoder<RuntimeValue> = (value: string) => RuntimeValue;
|
|
5
|
+
export type CodecEncoder<RuntimeInputValue> = (input: RuntimeInputValue) => string;
|
|
6
|
+
export type CodecDecoder<RuntimeValue> = (value: string) => RuntimeValue;
|
|
7
7
|
type RuntimeValueAccessor<RuntimeValue> = Accessor<RuntimeValue>;
|
|
8
8
|
export type RuntimeValueSetter<RuntimeValue extends RuntimeInputValue, RuntimeInputValue = RuntimeValue> = (input: RuntimeInputValue) => RuntimeValue;
|
|
9
9
|
export type RuntimeValueState<RuntimeValue extends RuntimeInputValue, RuntimeInputValue = RuntimeValue> = readonly [
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SelectDefinition } from '../../client/SelectNode.ts';
|
|
2
|
+
import { MultipleValueItemCodec } from './items/MultipleValueItemCodec.ts';
|
|
3
|
+
import { SingleValueItemCodec } from './items/SingleValueItemCodec.ts';
|
|
4
|
+
export type SelectCodec = MultipleValueItemCodec | SingleValueItemCodec;
|
|
5
|
+
export declare const getSelectCodec: (definition: SelectDefinition<"string">) => SelectCodec;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ValueType } from '../../client/ValueType.ts';
|
|
2
2
|
import { DecimalInputValue, DecimalRuntimeValue } from './DecimalValueCodec.ts';
|
|
3
|
+
import { GeopointInputValue, GeopointRuntimeValue } from './Geopoint/Geopoint.ts';
|
|
3
4
|
import { IntInputValue, IntRuntimeValue } from './IntValueCodec.ts';
|
|
4
5
|
import { ValueCodec } from './ValueCodec.ts';
|
|
5
6
|
interface RuntimeValuesByType {
|
|
@@ -10,7 +11,7 @@ interface RuntimeValuesByType {
|
|
|
10
11
|
readonly date: string;
|
|
11
12
|
readonly time: string;
|
|
12
13
|
readonly dateTime: string;
|
|
13
|
-
readonly geopoint:
|
|
14
|
+
readonly geopoint: GeopointRuntimeValue;
|
|
14
15
|
readonly geotrace: string;
|
|
15
16
|
readonly geoshape: string;
|
|
16
17
|
readonly binary: string;
|
|
@@ -26,7 +27,7 @@ interface RuntimeInputValuesByType {
|
|
|
26
27
|
readonly date: string;
|
|
27
28
|
readonly time: string;
|
|
28
29
|
readonly dateTime: string;
|
|
29
|
-
readonly geopoint:
|
|
30
|
+
readonly geopoint: GeopointInputValue;
|
|
30
31
|
readonly geotrace: string;
|
|
31
32
|
readonly geoshape: string;
|
|
32
33
|
readonly binary: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValueType } from '../../../client/ValueType.ts';
|
|
2
|
+
import { SharedValueCodec } from '../getSharedValueCodec.ts';
|
|
3
|
+
import { ValueArrayCodec } from '../ValueArrayCodec.ts';
|
|
4
|
+
import { CodecDecoder, CodecEncoder } from '../ValueCodec.ts';
|
|
5
|
+
export type BaseItemValueType = 'string';
|
|
6
|
+
export type UnsupportedBaseItemValueType = Exclude<ValueType, BaseItemValueType>;
|
|
7
|
+
export declare abstract class BaseItemCodec<Values extends readonly string[] = readonly string[]> extends ValueArrayCodec<BaseItemValueType, Values> {
|
|
8
|
+
constructor(baseCodec: SharedValueCodec<'string'>, encodeValue: CodecEncoder<Values>, decodeValue: CodecDecoder<Values>);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SharedValueCodec } from '../getSharedValueCodec.ts';
|
|
2
|
+
import { BaseItemCodec } from './BaseItemCodec.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Value codec implementation for `<select>` and `<odk:rank>` controls.
|
|
5
|
+
*
|
|
6
|
+
* This generalizes the application of a {@link SharedValueCodec} implementation
|
|
7
|
+
* over individual select and rank values, where those values are serialized as a
|
|
8
|
+
* whitespace-separated list. All other encoding and decoding logic is deferred
|
|
9
|
+
* to the provided {@link baseCodec}, ensuring that select and rank value types are
|
|
10
|
+
* treated consistently with the same underlying data types for other controls.
|
|
11
|
+
*/
|
|
12
|
+
export declare class MultipleValueItemCodec extends BaseItemCodec<readonly string[]> {
|
|
13
|
+
constructor(baseCodec: SharedValueCodec<'string'>);
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SharedValueCodec } from '../getSharedValueCodec.ts';
|
|
2
|
+
import { BaseItemCodec } from './BaseItemCodec.ts';
|
|
3
|
+
export type SingleValueSelectRuntimeValues = readonly [] | readonly [string];
|
|
4
|
+
/**
|
|
5
|
+
* @see {@link encodeValueFactory}
|
|
6
|
+
*/
|
|
7
|
+
type SingleValueSelectCodecValues = SingleValueSelectRuntimeValues | readonly string[];
|
|
8
|
+
/**
|
|
9
|
+
* Value codec implementation for `<select1>` controls.
|
|
10
|
+
*
|
|
11
|
+
* Note: this implementation is a specialization of the same principles
|
|
12
|
+
* underlying {@link MultipleValueItemCodec}. It is implemented separately:
|
|
13
|
+
*
|
|
14
|
+
* 1. to address a semantic difference between `<select>` and `<select1>`
|
|
15
|
+
* values: the former are serialized as a space-separated list, but that does
|
|
16
|
+
* not apply to the latter;
|
|
17
|
+
*
|
|
18
|
+
* 2. as an optimization, as the more general implementation performs poorly on
|
|
19
|
+
* forms which we monitor for performance.
|
|
20
|
+
*/
|
|
21
|
+
export declare class SingleValueItemCodec extends BaseItemCodec<SingleValueSelectCodecValues> {
|
|
22
|
+
constructor(baseCodec: SharedValueCodec<'string'>);
|
|
23
|
+
}
|
|
24
|
+
export {};
|
package/dist/lib/dom/query.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { KnownAttributeLocalNamedElement, LocalNamedElement } from '../../../../common/types/dom.ts';
|
|
2
|
-
import { SelectElement } from '../../parse/body/control/select/SelectDefinition';
|
|
3
2
|
export interface HintElement extends LocalNamedElement<'hint'> {
|
|
4
3
|
}
|
|
5
4
|
export interface ItemElement extends LocalNamedElement<'item'> {
|
|
@@ -17,7 +16,7 @@ export interface RepeatElement extends KnownAttributeLocalNamedElement<'repeat',
|
|
|
17
16
|
export interface ValueElement extends LocalNamedElement<'value'> {
|
|
18
17
|
}
|
|
19
18
|
export declare const getHintElement: (parent: Element) => HintElement | null;
|
|
20
|
-
export declare const getItemElements: (parent:
|
|
19
|
+
export declare const getItemElements: (parent: Element) => readonly ItemElement[];
|
|
21
20
|
export declare const getItemsetElement: (parent: Element) => ItemsetElement | null;
|
|
22
21
|
export declare const getLabelElement: (parent: Element) => LabelElement | null;
|
|
23
22
|
export declare const getRepeatGroupLabelElement: (parent: Element) => RepeatGroupLabelElement | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { NamespaceURI } from './QualifiedName.ts';
|
|
2
|
+
interface NamespaceDeclarationXMLSerializationOptions {
|
|
3
|
+
readonly omitDefaultNamespace?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface NamespaceDeclarationOptions {
|
|
6
|
+
readonly declaredPrefix: string | null;
|
|
7
|
+
readonly declaredURI: NamespaceURI;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Provides a generalized representation of an XML namespace declaration, which
|
|
11
|
+
* can be used for:
|
|
12
|
+
*
|
|
13
|
+
* - Resolution of a declared namespace URI, by its declared prefix
|
|
14
|
+
* - Resolution of a declared namespace prefix associated with its namespace URI
|
|
15
|
+
* - Scoped resolution of same in an arbitrary DOM-like tree of nodes (or
|
|
16
|
+
* representations thereof)
|
|
17
|
+
* - Serialization of the namespace declaration as an XML representation, as
|
|
18
|
+
* part of broader XML serialization logic from an arbitrary DOM-like tree of
|
|
19
|
+
* nodes (or representations thereof)
|
|
20
|
+
*
|
|
21
|
+
* @see {@link NamespaceDeclarationMap} for details on scoped usage
|
|
22
|
+
*/
|
|
23
|
+
export declare class NamespaceDeclaration {
|
|
24
|
+
private readonly serializedXML;
|
|
25
|
+
/**
|
|
26
|
+
* A namespace is declared as either:
|
|
27
|
+
*
|
|
28
|
+
* - a "default" namespace (for which no prefix is declared, in which case
|
|
29
|
+
* this value will be `null`)
|
|
30
|
+
*
|
|
31
|
+
* - a namespace prefix (for which the prefix can be used to reference the
|
|
32
|
+
* declared namespace, in which case this value will be a `string`)
|
|
33
|
+
*/
|
|
34
|
+
readonly declaredPrefix: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* A namespace is declared for a {@link NamespaceURI}, i.e. either a
|
|
37
|
+
* {@link URL} or `null`, where `null` corresponds to the "null namespace"
|
|
38
|
+
* (i.e. `xmlns=""` or `xmlns:prefix=""`, in serialized XML).
|
|
39
|
+
*/
|
|
40
|
+
readonly declaredURI: NamespaceURI;
|
|
41
|
+
constructor(options: NamespaceDeclarationOptions);
|
|
42
|
+
declaresNamespaceURI(namespaceURI: NamespaceURI): boolean;
|
|
43
|
+
serializeNamespaceDeclarationXML(options?: NamespaceDeclarationXMLSerializationOptions): string;
|
|
44
|
+
}
|
|
45
|
+
export {};
|