@getodk/xforms-engine 0.8.0 → 0.9.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.
@@ -1,6 +1,6 @@
1
1
  import { EngineXPathAttribute, EngineXPathDocument, EngineXPathElement, EngineXPathNode, EngineXPathParentNode, XFormsXPathChildNode } from './kind.ts';
2
2
  export declare const getContainingEngineXPathDocument: (node: EngineXPathNode) => EngineXPathDocument;
3
- export declare const getEngineXPathAttributes: (node: EngineXPathNode) => Iterable<EngineXPathAttribute>;
3
+ export declare const getEngineXPathAttributes: (node: EngineXPathNode) => readonly EngineXPathAttribute[];
4
4
  /**
5
5
  * @todo We've now laid most of the groundwork necessary to implement this
6
6
  * properly. At time of writing it has still been deferred because:
@@ -14,7 +14,7 @@ export declare const getEngineXPathAttributes: (node: EngineXPathNode) => Iterab
14
14
  * it throw? It might be nice to be alerted if the assumptions in point 2 above
15
15
  * are somehow wrong (or become wrong).
16
16
  */
17
- export declare const getNamespaceDeclarations: () => Iterable<never>;
17
+ export declare const getNamespaceDeclarations: () => readonly [];
18
18
  export declare const getParentNode: (node: EngineXPathNode) => EngineXPathParentNode | null;
19
19
  export declare const getChildNodes: (node: EngineXPathNode) => readonly XFormsXPathChildNode[];
20
20
  export declare const getChildElements: (node: EngineXPathNode) => readonly EngineXPathElement[];
@@ -0,0 +1,7 @@
1
+ import { Temporal } from 'temporal-polyfill';
2
+ import { ValueCodec } from './ValueCodec.ts';
3
+ export type DatetimeRuntimeValue = Temporal.PlainDate | null;
4
+ export type DatetimeInputValue = Date | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime | string | null;
5
+ export declare class DateValueCodec extends ValueCodec<'date', DatetimeRuntimeValue, DatetimeInputValue> {
6
+ constructor();
7
+ }
@@ -1,4 +1,5 @@
1
1
  import { ValueType } from '../../client/ValueType.ts';
2
+ import { DatetimeInputValue, DatetimeRuntimeValue } from './DateValueCodec.ts';
2
3
  import { DecimalInputValue, DecimalRuntimeValue } from './DecimalValueCodec.ts';
3
4
  import { GeopointInputValue, GeopointRuntimeValue } from './Geopoint/Geopoint.ts';
4
5
  import { IntInputValue, IntRuntimeValue } from './IntValueCodec.ts';
@@ -8,7 +9,7 @@ interface RuntimeValuesByType {
8
9
  readonly int: IntRuntimeValue;
9
10
  readonly decimal: DecimalRuntimeValue;
10
11
  readonly boolean: string;
11
- readonly date: string;
12
+ readonly date: DatetimeRuntimeValue;
12
13
  readonly time: string;
13
14
  readonly dateTime: string;
14
15
  readonly geopoint: GeopointRuntimeValue;
@@ -24,7 +25,7 @@ interface RuntimeInputValuesByType {
24
25
  readonly int: IntInputValue;
25
26
  readonly decimal: DecimalInputValue;
26
27
  readonly boolean: string;
27
- readonly date: string;
28
+ readonly date: DatetimeInputValue;
28
29
  readonly time: string;
29
30
  readonly dateTime: string;
30
31
  readonly geopoint: GeopointInputValue;
@@ -11,7 +11,7 @@ import { ItemsetLabelDefinition } from '../ItemsetLabelDefinition.ts';
11
11
  import { LabelDefinition, LabelOwner } from '../LabelDefinition.ts';
12
12
  import { TextSourceNode, TextRangeDefinition } from './TextRangeDefinition.ts';
13
13
  export type RefAttributeChunk = TextReferenceExpression | TextTranslationExpression;
14
- type TextElementChildChunk = TextOutputExpression | TextLiteralExpression;
14
+ type TextElementChildChunk = TextLiteralExpression | TextOutputExpression;
15
15
  type TextElementChunks = readonly [RefAttributeChunk] | readonly TextElementChildChunk[];
16
16
  type TextElementOwner = ItemDefinition | LabelOwner;
17
17
  export declare abstract class TextElementDefinition<Role extends ElementTextRole> extends TextRangeDefinition<Role> {