@getodk/xforms-engine 0.7.0 → 0.8.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/dist/client/RootNode.d.ts +4 -4
- package/dist/client/UploadNode.d.ts +53 -0
- package/dist/client/attachments/InstanceAttachmentMeta.d.ts +8 -0
- package/dist/client/attachments/InstanceAttachmentsConfig.d.ts +8 -0
- package/dist/client/form/FormInstanceConfig.d.ts +2 -0
- package/dist/client/hierarchy.d.ts +4 -5
- package/dist/client/index.d.ts +5 -2
- package/dist/client/node-types.d.ts +2 -3
- package/dist/client/serialization/InstanceData.d.ts +7 -5
- package/dist/client/serialization/InstancePayloadOptions.d.ts +3 -2
- package/dist/error/UploadValueTypeError.d.ts +8 -0
- package/dist/index.js +6603 -5598
- package/dist/index.js.map +1 -1
- package/dist/instance/PrimaryInstance.d.ts +2 -3
- package/dist/instance/UploadControl.d.ts +58 -0
- package/dist/instance/attachments/InstanceAttachment.d.ts +42 -0
- package/dist/instance/attachments/InstanceAttachmentsState.d.ts +9 -0
- package/dist/instance/hierarchy.d.ts +6 -7
- package/dist/instance/internal-api/InstanceAttachmentContext.d.ts +19 -0
- package/dist/instance/internal-api/InstanceConfig.d.ts +2 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableInstance.d.ts +2 -0
- package/dist/lib/reactivity/createInstanceAttachment.d.ts +8 -0
- package/dist/lib/resource-helpers.d.ts +2 -0
- package/dist/parse/body/BodyDefinition.d.ts +2 -1
- package/dist/parse/body/control/UploadControlDefinition.d.ts +2 -0
- package/dist/parse/model/BindTypeDefinition.d.ts +2 -7
- package/dist/solid.js +6600 -5596
- package/dist/solid.js.map +1 -1
- package/package.json +15 -14
- package/src/client/RootNode.ts +8 -3
- package/src/client/UploadNode.ts +78 -0
- package/src/client/attachments/InstanceAttachmentMeta.ts +10 -0
- package/src/client/attachments/InstanceAttachmentsConfig.ts +13 -0
- package/src/client/form/FormInstanceConfig.ts +3 -0
- package/src/client/hierarchy.ts +5 -8
- package/src/client/index.ts +4 -2
- package/src/client/node-types.ts +2 -5
- package/src/client/serialization/InstanceData.ts +14 -6
- package/src/client/serialization/InstancePayloadOptions.ts +3 -2
- package/src/entrypoints/FormInstance.ts +3 -2
- package/src/error/UploadValueTypeError.ts +13 -0
- package/src/instance/PrimaryInstance.ts +4 -5
- package/src/instance/UploadControl.ts +184 -0
- package/src/instance/attachments/InstanceAttachment.ts +69 -0
- package/src/instance/attachments/InstanceAttachmentsState.ts +18 -0
- package/src/instance/children/buildChildren.ts +5 -8
- package/src/instance/hierarchy.ts +6 -9
- package/src/instance/input/InstanceAttachmentMap.ts +33 -21
- package/src/instance/internal-api/InstanceAttachmentContext.ts +20 -0
- package/src/instance/internal-api/InstanceConfig.ts +3 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableInstance.ts +2 -0
- package/src/lib/client-reactivity/instance-state/prepareInstancePayload.ts +72 -8
- package/src/lib/reactivity/createInstanceAttachment.ts +212 -0
- package/src/lib/resource-helpers.ts +33 -0
- package/src/parse/XFormDOM.ts +1 -3
- package/src/parse/body/BodyDefinition.ts +4 -0
- package/src/parse/body/control/UploadControlDefinition.ts +42 -0
- package/src/parse/model/BindDefinition.ts +1 -1
- package/src/parse/model/BindTypeDefinition.ts +68 -26
- package/src/parse/model/ModelBindMap.ts +0 -5
- package/src/parse/model/SecondaryInstance/sources/ExternalSecondaryInstanceResource.ts +1 -30
- package/dist/client/unsupported/UnsupportedControlNode.d.ts +0 -30
- package/dist/client/unsupported/UploadNode.d.ts +0 -9
- package/dist/instance/unsupported/UploadControl.d.ts +0 -34
- package/dist/lib/codecs/TempUnsupportedControlCodec.d.ts +0 -7
- package/src/client/unsupported/UnsupportedControlNode.ts +0 -36
- package/src/client/unsupported/UploadNode.ts +0 -14
- package/src/instance/unsupported/UploadControl.ts +0 -120
- package/src/lib/codecs/TempUnsupportedControlCodec.ts +0 -32
|
@@ -20,6 +20,7 @@ import { ModelDefinition } from '../parse/model/ModelDefinition.ts';
|
|
|
20
20
|
import { RootDefinition } from '../parse/model/RootDefinition.ts';
|
|
21
21
|
import { SecondaryInstancesDefinition } from '../parse/model/SecondaryInstance/SecondaryInstancesDefinition.ts';
|
|
22
22
|
import { InstanceNode } from './abstract/InstanceNode.ts';
|
|
23
|
+
import { InstanceAttachmentsState } from './attachments/InstanceAttachmentsState.ts';
|
|
23
24
|
import { InitialInstanceState } from './input/InitialInstanceState.ts';
|
|
24
25
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
25
26
|
import { InstanceConfig } from './internal-api/InstanceConfig.ts';
|
|
@@ -58,11 +59,9 @@ export interface PrimaryInstanceOptions<Mode extends FormInstanceInitializationM
|
|
|
58
59
|
readonly initialState: PrimaryInstanceInitialState<Mode>;
|
|
59
60
|
}
|
|
60
61
|
export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode = FormInstanceInitializationMode> extends InstanceNode<RootDefinition, PrimaryInstanceStateSpec, null, Root> implements PrimaryInstanceDocument, XFormsXPathDocument, TranslationContext, EvaluationContext, ClientReactiveSerializableInstance {
|
|
61
|
-
/**
|
|
62
|
-
* @todo this will be populated as we introduce other initialization modes!
|
|
63
|
-
*/
|
|
64
62
|
readonly initializationMode: FormInstanceInitializationMode;
|
|
65
63
|
readonly model: ModelDefinition;
|
|
64
|
+
readonly attachments: InstanceAttachmentsState;
|
|
66
65
|
protected readonly state: SharedNodeState<PrimaryInstanceStateSpec>;
|
|
67
66
|
protected readonly engineState: EngineState<PrimaryInstanceStateSpec>;
|
|
68
67
|
readonly instanceNode: StaticDocument;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
3
|
+
import { TextRange } from '../client/TextRange.ts';
|
|
4
|
+
import { UploadDefinition, UploadNode, UploadNodeOptions } from '../client/UploadNode.ts';
|
|
5
|
+
import { ValueType } from '../client/ValueType.ts';
|
|
6
|
+
import { InstanceAttachmentFileName, InstanceState } from '../client/index.ts';
|
|
7
|
+
import { AnyViolation, LeafNodeValidationState } from '../client/validation.ts';
|
|
8
|
+
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
9
|
+
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
10
|
+
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
11
|
+
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
12
|
+
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
13
|
+
import { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
14
|
+
import { UnknownAppearanceDefinition } from '../parse/body/appearance/unknownAppearanceParser.ts';
|
|
15
|
+
import { Root } from './Root.ts';
|
|
16
|
+
import { DescendantNodeStateSpec, DescendantNode } from './abstract/DescendantNode.ts';
|
|
17
|
+
import { InstanceAttachmentRuntimeValue } from './attachments/InstanceAttachment.ts';
|
|
18
|
+
import { GeneralParentNode } from './hierarchy.ts';
|
|
19
|
+
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
20
|
+
import { InstanceAttachmentContext } from './internal-api/InstanceAttachmentContext.ts';
|
|
21
|
+
import { DecodeInstanceValue, InstanceValueContext } from './internal-api/InstanceValueContext.ts';
|
|
22
|
+
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
23
|
+
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
24
|
+
export type AnyUploadDefinition = {
|
|
25
|
+
[V in ValueType]: UploadDefinition<V>;
|
|
26
|
+
}[ValueType];
|
|
27
|
+
interface UploadControlStateSpec extends DescendantNodeStateSpec<InstanceAttachmentRuntimeValue> {
|
|
28
|
+
readonly label: Accessor<TextRange<'label'> | null>;
|
|
29
|
+
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
30
|
+
readonly children: null;
|
|
31
|
+
readonly valueOptions: null;
|
|
32
|
+
readonly value: SimpleAtomicState<InstanceAttachmentRuntimeValue>;
|
|
33
|
+
readonly instanceValue: Accessor<InstanceAttachmentFileName>;
|
|
34
|
+
}
|
|
35
|
+
export declare class UploadControl extends DescendantNode<UploadDefinition<'binary'>, UploadControlStateSpec, GeneralParentNode, null> implements UploadNode, XFormsXPathElement, EvaluationContext, InstanceAttachmentContext, InstanceValueContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
36
|
+
readonly instanceNode: StaticLeafElement | null;
|
|
37
|
+
static from(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: UploadDefinition): UploadControl;
|
|
38
|
+
private readonly validation;
|
|
39
|
+
private readonly instanceAttachment;
|
|
40
|
+
readonly [XPathNodeKindKey] = "element";
|
|
41
|
+
readonly getXPathValue: () => InstanceAttachmentFileName;
|
|
42
|
+
protected readonly state: SharedNodeState<UploadControlStateSpec>;
|
|
43
|
+
protected readonly engineState: EngineState<UploadControlStateSpec>;
|
|
44
|
+
readonly decodeInstanceValue: DecodeInstanceValue;
|
|
45
|
+
readonly nodeType = "upload";
|
|
46
|
+
readonly valueType = "binary";
|
|
47
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
48
|
+
readonly nodeOptions: UploadNodeOptions;
|
|
49
|
+
readonly currentState: CurrentState<UploadControlStateSpec>;
|
|
50
|
+
get validationState(): LeafNodeValidationState;
|
|
51
|
+
readonly instanceState: InstanceState;
|
|
52
|
+
private constructor();
|
|
53
|
+
getViolation(): AnyViolation | null;
|
|
54
|
+
isBlank(): boolean;
|
|
55
|
+
getChildren(): readonly [];
|
|
56
|
+
setValue(value: InstanceAttachmentRuntimeValue): Root;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { SimpleAtomicState, SimpleAtomicStateSetter } from '../../lib/reactivity/types.ts';
|
|
3
|
+
import { InstanceAttachmentContext } from '../internal-api/InstanceAttachmentContext.ts';
|
|
4
|
+
import { DecodeInstanceValue } from '../internal-api/InstanceValueContext.ts';
|
|
5
|
+
export type InstanceAttachmentFileName = string;
|
|
6
|
+
export type InstanceAttachmentRuntimeValue = File | null;
|
|
7
|
+
export interface InstanceAttachmentOptions {
|
|
8
|
+
readonly getFileName: Accessor<InstanceAttachmentFileName | null>;
|
|
9
|
+
readonly getInstanceValue: Accessor<InstanceAttachmentFileName>;
|
|
10
|
+
readonly decodeInstanceValue: DecodeInstanceValue;
|
|
11
|
+
readonly getValue: Accessor<InstanceAttachmentRuntimeValue>;
|
|
12
|
+
readonly setValue: SimpleAtomicStateSetter<InstanceAttachmentRuntimeValue>;
|
|
13
|
+
readonly valueState: SimpleAtomicState<InstanceAttachmentRuntimeValue>;
|
|
14
|
+
}
|
|
15
|
+
export declare class InstanceAttachment {
|
|
16
|
+
/**
|
|
17
|
+
* 1. Creates {@link InstanceAttachment | attachment state} from
|
|
18
|
+
* {@link InstanceAttachmentOptions}
|
|
19
|
+
* 2. Registers that attachment state in an instance-global
|
|
20
|
+
* {@link InstanceAttachmentsState} entry
|
|
21
|
+
*
|
|
22
|
+
* This allows an instance to:
|
|
23
|
+
*
|
|
24
|
+
* - Produce distinct file names for each attachment
|
|
25
|
+
* - Track all attachments so they can be serialized in an
|
|
26
|
+
* {@link InstancePayload}
|
|
27
|
+
*/
|
|
28
|
+
static init(context: InstanceAttachmentContext, options: InstanceAttachmentOptions): InstanceAttachment;
|
|
29
|
+
/**
|
|
30
|
+
* This property isn't used at runtime. It causes TypeScript to treat
|
|
31
|
+
* {@link InstanceAttachment} as a nominal type, ensuring
|
|
32
|
+
* {@link InstanceAttachment.init} is called to instantiate it.
|
|
33
|
+
*/
|
|
34
|
+
protected readonly _: null;
|
|
35
|
+
readonly getFileName: Accessor<InstanceAttachmentFileName | null>;
|
|
36
|
+
readonly getInstanceValue: Accessor<InstanceAttachmentFileName>;
|
|
37
|
+
readonly decodeInstanceValue: DecodeInstanceValue;
|
|
38
|
+
readonly getValue: Accessor<InstanceAttachmentRuntimeValue>;
|
|
39
|
+
readonly setValue: SimpleAtomicStateSetter<InstanceAttachmentRuntimeValue>;
|
|
40
|
+
readonly valueState: SimpleAtomicState<InstanceAttachmentRuntimeValue>;
|
|
41
|
+
private constructor();
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StaticLeafElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
2
|
+
import { InstanceAttachmentMap } from '../input/InstanceAttachmentMap.ts';
|
|
3
|
+
import { InstanceAttachmentContext } from '../internal-api/InstanceAttachmentContext.ts';
|
|
4
|
+
import { InstanceAttachment, InstanceAttachmentRuntimeValue } from './InstanceAttachment.ts';
|
|
5
|
+
export declare class InstanceAttachmentsState extends Map<InstanceAttachmentContext, InstanceAttachment> {
|
|
6
|
+
private readonly sourceAttachments;
|
|
7
|
+
constructor(sourceAttachments?: InstanceAttachmentMap | null);
|
|
8
|
+
getInitialFileValue(instanceNode: StaticLeafElement | null): InstanceAttachmentRuntimeValue;
|
|
9
|
+
}
|
|
@@ -4,6 +4,7 @@ import { AnyModelValue } from './ModelValue.ts';
|
|
|
4
4
|
import { AnyNote } from './Note.ts';
|
|
5
5
|
import { PrimaryInstance } from './PrimaryInstance.ts';
|
|
6
6
|
import { AnyRangeControl } from './RangeControl.ts';
|
|
7
|
+
import { RankControl } from './RankControl.ts';
|
|
7
8
|
import { RepeatInstance } from './repeat/RepeatInstance.ts';
|
|
8
9
|
import { RepeatRangeControlled } from './repeat/RepeatRangeControlled.ts';
|
|
9
10
|
import { RepeatRangeUncontrolled } from './repeat/RepeatRangeUncontrolled.ts';
|
|
@@ -11,13 +12,11 @@ import { Root } from './Root.ts';
|
|
|
11
12
|
import { SelectControl } from './SelectControl.ts';
|
|
12
13
|
import { Subtree } from './Subtree.ts';
|
|
13
14
|
import { TriggerControl } from './TriggerControl.ts';
|
|
14
|
-
import {
|
|
15
|
-
import { UploadControl } from './unsupported/UploadControl.ts';
|
|
15
|
+
import { UploadControl } from './UploadControl.ts';
|
|
16
16
|
export type RepeatRange = RepeatRangeControlled | RepeatRangeUncontrolled;
|
|
17
|
-
export type
|
|
18
|
-
export type AnyNode = PrimaryInstance | Root | Group | Subtree | RepeatRange | RepeatInstance | AnyNote | AnyModelValue | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | AnyUnsupportedControl;
|
|
17
|
+
export type AnyNode = PrimaryInstance | Root | Group | Subtree | RepeatRange | RepeatInstance | AnyNote | AnyModelValue | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
19
18
|
export type AnyParentNode = PrimaryInstance | Root | Group | Subtree | RepeatRange | RepeatInstance;
|
|
20
19
|
export type GeneralParentNode = Root | Group | Subtree | RepeatInstance;
|
|
21
|
-
export type AnyChildNode = Root | Group | Subtree | RepeatRange | RepeatInstance | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl |
|
|
22
|
-
export type GeneralChildNode = Group | Subtree | RepeatRange | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl |
|
|
23
|
-
export type AnyValueNode = AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl |
|
|
20
|
+
export type AnyChildNode = Root | Group | Subtree | RepeatRange | RepeatInstance | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
21
|
+
export type GeneralChildNode = Group | Subtree | RepeatRange | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
22
|
+
export type AnyValueNode = AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { FormNodeID } from '../../client/identity.ts';
|
|
3
|
+
import { StaticLeafElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
4
|
+
import { ReactiveScope } from '../../lib/reactivity/scope.ts';
|
|
5
|
+
import { InstanceAttachmentsState } from '../attachments/InstanceAttachmentsState.ts';
|
|
6
|
+
import { InstanceConfig } from './InstanceConfig.ts';
|
|
7
|
+
interface InstanceAttachmentRootDocument {
|
|
8
|
+
readonly attachments: InstanceAttachmentsState;
|
|
9
|
+
}
|
|
10
|
+
export interface InstanceAttachmentContext {
|
|
11
|
+
readonly instanceConfig: InstanceConfig;
|
|
12
|
+
readonly scope: ReactiveScope;
|
|
13
|
+
readonly rootDocument: InstanceAttachmentRootDocument;
|
|
14
|
+
readonly nodeId: FormNodeID;
|
|
15
|
+
readonly instanceNode: StaticLeafElement | null;
|
|
16
|
+
readonly isRelevant: Accessor<boolean>;
|
|
17
|
+
readonly isAttached: Accessor<boolean>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { InstanceAttachmentFileNameFactory } from '../../client/attachments/InstanceAttachmentsConfig.ts';
|
|
1
2
|
import { OpaqueReactiveObjectFactory } from '../../client/OpaqueReactiveObjectFactory.ts';
|
|
2
3
|
export interface InstanceConfig {
|
|
3
4
|
/**
|
|
4
5
|
* @see {@link FormInstanceConfig.stateFactory}
|
|
5
6
|
*/
|
|
6
7
|
readonly clientStateFactory: OpaqueReactiveObjectFactory;
|
|
8
|
+
readonly computeAttachmentName: InstanceAttachmentFileNameFactory;
|
|
7
9
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SubmissionMeta } from '../../../client/submission/SubmissionMeta.ts';
|
|
2
2
|
import { AncestorNodeValidationState } from '../../../client/validation.ts';
|
|
3
|
+
import { InstanceAttachmentsState } from '../../attachments/InstanceAttachmentsState.ts';
|
|
3
4
|
import { Root } from '../../Root.ts';
|
|
4
5
|
import { ClientReactiveSerializableParentNode, ClientReactiveSerializableParentNodeDefinition } from './ClientReactiveSerializableParentNode.ts';
|
|
5
6
|
interface ClientReactiveSerializableInstanceDefinition extends ClientReactiveSerializableParentNodeDefinition {
|
|
@@ -9,6 +10,7 @@ export interface ClientReactiveSerializableInstance extends ClientReactiveSerial
|
|
|
9
10
|
readonly definition: ClientReactiveSerializableInstanceDefinition;
|
|
10
11
|
readonly root: Root;
|
|
11
12
|
readonly parent: null;
|
|
13
|
+
readonly attachments: InstanceAttachmentsState;
|
|
12
14
|
readonly validationState: AncestorNodeValidationState;
|
|
13
15
|
}
|
|
14
16
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InstanceAttachmentFileName, InstanceAttachment } from '../../instance/attachments/InstanceAttachment.ts';
|
|
2
|
+
import { InstanceAttachmentContext } from '../../instance/internal-api/InstanceAttachmentContext.ts';
|
|
3
|
+
export type InstanceAttachmentRuntimeValue = File | null;
|
|
4
|
+
export type InstanceAttachmentFormDataEntry = readonly [
|
|
5
|
+
key: InstanceAttachmentFileName,
|
|
6
|
+
value: NonNullable<InstanceAttachmentRuntimeValue>
|
|
7
|
+
];
|
|
8
|
+
export declare const createInstanceAttachment: (context: InstanceAttachmentContext) => InstanceAttachment;
|
|
@@ -69,7 +69,8 @@ export declare class BodyDefinition extends DependencyContext implements BodyEle
|
|
|
69
69
|
readonly reference: string;
|
|
70
70
|
constructor(form: XFormDefinition);
|
|
71
71
|
getBodyElement(reference: string): AnyBodyElementDefinition | null;
|
|
72
|
+
getBodyElementType(reference: BodyElementReference): AnyBodyElementType | null;
|
|
72
73
|
getChildElementDefinitions(form: XFormDefinition, parent: BodyElementParentContext, parentElement: Element, children?: readonly Element[]): readonly AnyBodyElementDefinition[];
|
|
73
|
-
toJSON(): Omit<this, "form" | "toJSON" | "isTranslated" | "getBodyElement" | "getChildElementDefinitions">;
|
|
74
|
+
toJSON(): Omit<this, "form" | "toJSON" | "isTranslated" | "getBodyElement" | "getBodyElementType" | "getChildElementDefinitions">;
|
|
74
75
|
}
|
|
75
76
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UploadNodeOptions } from '../../../client/UploadNode.ts';
|
|
1
2
|
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
3
|
import { UnknownAppearanceDefinition } from '../appearance/unknownAppearanceParser.ts';
|
|
3
4
|
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
@@ -6,6 +7,7 @@ export declare class UploadControlDefinition extends ControlDefinition<'upload'>
|
|
|
6
7
|
static isCompatible(localName: string): boolean;
|
|
7
8
|
readonly type = "upload";
|
|
8
9
|
readonly appearances: UnknownAppearanceDefinition;
|
|
10
|
+
readonly options: UploadNodeOptions;
|
|
9
11
|
constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element);
|
|
10
12
|
toJSON(): object;
|
|
11
13
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
1
2
|
import { BindElement } from './BindElement.ts';
|
|
2
|
-
/**
|
|
3
|
-
* As specified by {@link https://getodk.github.io/xforms-spec/#bind-attributes}
|
|
4
|
-
*/
|
|
5
|
-
export declare const DEFAULT_BIND_TYPE = "string";
|
|
6
|
-
export type DefaultBindType = typeof DEFAULT_BIND_TYPE;
|
|
7
3
|
/**
|
|
8
4
|
* As specified by {@link https://getodk.github.io/xforms-spec/#data-types}
|
|
9
5
|
*/
|
|
@@ -13,8 +9,7 @@ export type BindType = BindTypes[number];
|
|
|
13
9
|
export declare class BindTypeDefinition<T extends BindType = BindType> {
|
|
14
10
|
readonly source: string | null;
|
|
15
11
|
readonly resolved: T;
|
|
16
|
-
static from<T extends BindType>(bindElement: BindElement): BindTypeDefinition<T>;
|
|
17
|
-
private constructor();
|
|
12
|
+
static from<T extends BindType>(form: XFormDefinition, nodeset: string, bindElement: BindElement): BindTypeDefinition<T>;
|
|
18
13
|
private constructor();
|
|
19
14
|
}
|
|
20
15
|
export {};
|