@marktiderman/genesis-forms 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/dist/index.d.cts CHANGED
@@ -1,68 +1,11 @@
1
- import { a as FieldBlock, J as Json, C as ContentBlock, P as PageBreakBlock, O as OptionsSource, F as FormDefinition, H as HiddenInput, b as FormLayout, L as LogicRule, E as Ending, c as FormSettings, d as Condition, B as Block } from './types-BhYUbLJ-.cjs';
2
- export { e as FormEvent, f as Operand, g as Operator } from './types-BhYUbLJ-.cjs';
3
- import { F as FormEngine, a as FormState } from './engine-BDq0XJ21.cjs';
4
- export { C as CreateFormOptions, c as createForm, i as isFormEvent, b as isJson, r as replay } from './engine-BDq0XJ21.cjs';
5
- import { F as FieldValidator } from './validate-BsZ0YTQS.cjs';
6
- export { C as ChoiceOption, a as FieldTypeManifest, H as HostOptions, O as OTHER_MAX_LENGTH, R as REQUIRED_MESSAGE, S as StandardSchemaV1, c as choiceOptions, d as dateLimits, g as getFieldType, i as isEmptyValue, b as isIsoDate, e as isOtherValue, f as isSensitive, l as listFieldTypes, n as normalizeValue, h as numberLimits, o as optionsSource, j as otherOption, r as ratingDisplay, k as registerFieldType, s as scaleLabels, m as summarizeValue, v as validateField, w as withHostOptions } from './validate-BsZ0YTQS.cjs';
7
-
8
- /**
9
- * The `photo` field type: a respondent attaches up to a few photos, such as a
10
- * picture of broken equipment. The answer holds references the host's storage
11
- * handed back (`PhotoRef`), never the bytes: the renderer uploads through the
12
- * host (`onUpload` on genesis-forms-web's `Form`), so the engine and the
13
- * server stay storage-agnostic. A host's server should check that each
14
- * reference is a file it stored for this respondent before saving.
15
- *
16
- * Opt-in in a builder palette (`UPLOAD_FIELD_TYPES`), since a host must be
17
- * able to store the files.
18
- */
19
- declare const PHOTO_TYPE = "photo";
20
- /** Field types that need the host to store files; a builder offers them only when the host names them. */
21
- declare const UPLOAD_FIELD_TYPES: readonly ["photo"];
22
- /** One stored photo, as the host's upload returned it. */
23
- type PhotoRef = {
24
- /** The host's id for the stored file. */
25
- id: string;
26
- /** The file's name on the respondent's device. */
27
- name: string;
28
- /** Its MIME type, such as `image/jpeg`. */
29
- type: string;
30
- /** Bytes. */
31
- size: number;
32
- };
33
- type PhotoFormat = "jpeg" | "png" | "heic" | "webp";
34
- /** The MIME types each format covers. */
35
- declare const PHOTO_FORMATS: Record<PhotoFormat, readonly string[]>;
36
- declare const DEFAULT_PHOTO_FILES = 3;
37
- declare const MAX_PHOTO_FILES = 5;
38
- declare const DEFAULT_PHOTO_SIZE_MB = 10;
39
- declare const MAX_PHOTO_SIZE_MB = 25;
40
- /** The longest reference id and file name a photo answer may carry. */
41
- declare const MAX_PHOTO_ID_LENGTH = 200;
42
- declare const MAX_PHOTO_NAME_LENGTH = 255;
43
- declare const isPhotoFormat: (v: unknown) => v is PhotoFormat;
44
- interface PhotoLimits {
45
- maxFiles: number;
46
- maxSizeMb: number;
47
- maxBytes: number;
48
- formats: PhotoFormat[];
49
- /** Every MIME type the formats cover. */
50
- mimeTypes: string[];
51
- }
52
- /** A photo field's limits; a prop that is missing or out of range uses its default. */
53
- declare function photoLimits(field: FieldBlock): PhotoLimits;
54
- /** Whether `v` has a photo reference's shape (any type and size). */
55
- declare function isPhotoRef(v: unknown): v is PhotoRef;
56
- /** The well-formed references in a photo answer, as `{ id, name, type, size }` only. */
57
- declare function photoRefs(value: Json | undefined): PhotoRef[];
58
- /** "JPEG, PNG or WebP". */
59
- declare function photoFormatList(formats: readonly PhotoFormat[]): string;
60
- /** The message for a file of a type the field doesn't take. */
61
- declare const photoTypeMessage: (field: FieldBlock) => string;
62
- /** The message for a file over the field's size limit. */
63
- declare const photoSizeMessage: (field: FieldBlock) => string;
64
- /** The message for more photos than the field takes. */
65
- declare const photoCountMessage: (field: FieldBlock) => string;
1
+ import { a as FieldBlock, C as ContentBlock, P as PageBreakBlock, O as OptionsSource, F as FormDefinition, H as HiddenInput, b as FormLayout, L as LogicRule, E as Ending, c as FormSettings, J as Json, d as Condition, B as Block } from './types-oAckGR_Z.cjs';
2
+ export { e as FormEvent, f as Operand, g as Operator } from './types-oAckGR_Z.cjs';
3
+ import { P as PhotoFormat, a as PhotoRef } from './upload-protocol-Bw0CWRJc.cjs';
4
+ export { D as DEFAULT_PHOTO_FILES, b as DEFAULT_PHOTO_SIZE_MB, M as MAX_PHOTO_FILES, c as MAX_PHOTO_ID_LENGTH, d as MAX_PHOTO_NAME_LENGTH, e as MAX_PHOTO_SIZE_MB, f as MAX_UPLOAD_REQUEST_BYTES, g as PHOTO_FORMATS, h as PHOTO_TYPE, i as PhotoLimits, S as SignedUpload, U as UPLOAD_FIELD_TYPES, j as UploadGrant, k as UploadRefusal, l as UploadRequest, m as isPhotoFormat, n as isPhotoRef, p as photoCountMessage, o as photoFormatList, q as photoLimits, r as photoRefs, s as photoSizeMessage, t as photoTypeMessage } from './upload-protocol-Bw0CWRJc.cjs';
5
+ import { F as FormEngine, a as FormState } from './engine-C5tb3mkf.cjs';
6
+ export { C as CreateFormOptions, c as createForm, i as isFormEvent, b as isJson, r as replay } from './engine-C5tb3mkf.cjs';
7
+ import { F as FieldValidator } from './validate-BFpNJbjf.cjs';
8
+ export { A as AnswerSnapshot, C as CHOICE_FIELD_TYPES, a as ChoiceOption, b as FieldTypeManifest, H as HostOptions, L as LinkParams, M as MAX_PREFILL_PARAM_LENGTH, O as OPTION_LIMITS, c as OTHER_MAX_LENGTH, d as OptionSnapshot, P as PrefillSetting, e as PrefillState, R as REQUIRED_MESSAGE, f as RestoredAnswers, S as SEARCHABLE_OPTION_COUNT, g as StandardSchemaV1, h as answerSnapshots, i as answersFromSnapshots, j as answersOnPath, k as choiceOptions, l as clearFilteredAnswers, m as dateLimits, n as filteredChoiceError, o as getFieldType, p as hasOptionFilters, q as hiddenByPrefill, r as isEmptyValue, s as isHttpsUrl, t as isIsoDate, u as isOtherValue, v as isPrefillParam, w as isSearchable, x as isSensitive, y as listFieldTypes, z as normalizeValue, B as numberLimits, D as optionFilter, E as optionJson, G as optionMatches, I as optionsSource, J as otherOption, K as prefillFromLink, N as prefillSetting, Q as ratingDisplay, T as readOption, U as registerFieldType, V as respondentPath, W as scaleLabels, X as searchOptions, Y as summarizeValue, Z as validateField, _ as visibleOptions, $ as withHostOptions } from './validate-BFpNJbjf.cjs';
66
9
 
67
10
  /** A field block that remembers its key and value type, for answer inference. */
68
11
  type FieldSpec<K extends string = string, V = unknown> = FieldBlock & {
@@ -87,6 +30,9 @@ interface ChoiceFieldOptions<O extends string> extends FieldOptions {
87
30
  options?: readonly {
88
31
  value: O;
89
32
  label?: string;
33
+ description?: string;
34
+ image?: string;
35
+ attributes?: Record<string, string | string[]>;
90
36
  }[] | undefined;
91
37
  /**
92
38
  * Options the app showing the form supplies, by key (`OptionsSource`), such
@@ -101,6 +47,17 @@ interface ChoiceFieldOptions<O extends string> extends FieldOptions {
101
47
  other?: boolean | {
102
48
  label?: string;
103
49
  } | undefined;
50
+ /**
51
+ * Preselect from the link the form was opened from: `{ param: "location" }` takes
52
+ * `?location=…` when it is one of the options; `hideWhenPrefilled` then skips the question.
53
+ * See `prefillFromLink`.
54
+ */
55
+ prefill?: {
56
+ param: string;
57
+ hideWhenPrefilled?: boolean;
58
+ } | undefined;
59
+ /** A search box over the options: true or false, or by default when there are more than 10 (`isSearchable`). */
60
+ searchable?: boolean | undefined;
104
61
  }
105
62
  interface HiddenOptions {
106
63
  source?: HiddenInput["source"] | undefined;
@@ -721,4 +678,12 @@ declare function explain(source: FormEngine | ExplainInput, blockId: string, opt
721
678
  /** A condition as a plain-English clause: `contact_me is not Yes`. */
722
679
  declare function describeCondition(condition: Condition, def: FormDefinition, fields?: Map<string, FieldBlock>): string;
723
680
 
724
- export { type AnswersOf, Block, CALCULATED_TYPE, COMPUTED_FIELD_TYPES, type CalculatedFormat, type CalculatedProps, type ChoiceFieldOptions, type CoerceHiddenOptions, type CoercedHidden, Condition, ContentBlock, DEFAULT_PHOTO_FILES, DEFAULT_PHOTO_SIZE_MB, Ending, type ExplainInput, type ExplainOptions, type Explanation, FORMULA_FUNCTIONS, FieldBlock, type FieldOptions, type FieldSpec, type FieldValidation, FieldValidator, type Form, FormDefinition, FormEngine, type FormInput, type FormIssue, FormLayout, type FormProgress, FormSettings, FormState, type FormulaFunction, type FormulaNode, type FormulaParseResult, type FormulaReader, type FormulaRef, type FormulaValue, HIGHLIGHT_NOTE_MESSAGE, HiddenInput, type Highlight, Json, type JumpTrace, type KeyResolver, LogicRule, MAX_CALCULATED_DECIMALS, MAX_FORMULA_ITEMS, MAX_FORMULA_LENGTH, MAX_FORM_FORMULA_LENGTH, MAX_HIDDEN_STRING_LENGTH, MAX_HIGHLIGHT_NOTE_LENGTH, MAX_HIGHLIGHT_QUOTE_LENGTH, MAX_PHOTO_FILES, MAX_PHOTO_ID_LENGTH, MAX_PHOTO_NAME_LENGTH, MAX_PHOTO_SIZE_MB, MAX_SETTLE_ITEMS, MAX_TABLE_CELL_LENGTH, MAX_TABLE_COLUMNS, MAX_TIMESTAMP_SECONDS, type MediaNote, OptionsSource, PHOTO_FORMATS, PHOTO_TYPE, PageBreakBlock, type ParseResult, type PathResult, type PhotoFormat, type PhotoLimits, type PhotoRef, type RuleSpec, type RuleTrace, STRUCTURED_FIELD_TYPES, type TableColumn, UPLOAD_FIELD_TYPES, calculatedProps, calculatedValue, canonicalJson, coerceHidden, coerceHiddenValue, computePath, defineForm, describeCondition, evaluate, evaluateFormula, explain, f, fingerprint, formProgress, formatCalculated, formatTimestamp, formulaInput, formulaNumber, formulaRefs, furthestReached, isPhotoFormat, isPhotoRef, listLimits, parseForm, parseFormula, parseTimestamp, photoCountMessage, photoFormatList, photoLimits, photoRefs, photoSizeMessage, photoTypeMessage, recall, renameFormulaKey, ruleVisible, steps, tableColumns, tableLimits, when };
681
+ /**
682
+ * Answers given to one version of a form, as answers to another (by field id), matched
683
+ * by field key: what an edit link prefills when the form has a newer version. Answers
684
+ * to fields the other version doesn't have are dropped; `extra` (by key) fills fields
685
+ * the stored answers leave out, such as contact details kept apart.
686
+ */
687
+ declare function carryAnswers(from: FormDefinition, to: FormDefinition, answers: Record<string, Json>, extra?: Record<string, Json | null | undefined>): Record<string, Json>;
688
+
689
+ export { type AnswersOf, Block, CALCULATED_TYPE, COMPUTED_FIELD_TYPES, type CalculatedFormat, type CalculatedProps, type ChoiceFieldOptions, type CoerceHiddenOptions, type CoercedHidden, Condition, ContentBlock, Ending, type ExplainInput, type ExplainOptions, type Explanation, FORMULA_FUNCTIONS, FieldBlock, type FieldOptions, type FieldSpec, type FieldValidation, FieldValidator, type Form, FormDefinition, FormEngine, type FormInput, type FormIssue, FormLayout, type FormProgress, FormSettings, FormState, type FormulaFunction, type FormulaNode, type FormulaParseResult, type FormulaReader, type FormulaRef, type FormulaValue, HIGHLIGHT_NOTE_MESSAGE, HiddenInput, type Highlight, Json, type JumpTrace, type KeyResolver, LogicRule, MAX_CALCULATED_DECIMALS, MAX_FORMULA_ITEMS, MAX_FORMULA_LENGTH, MAX_FORM_FORMULA_LENGTH, MAX_HIDDEN_STRING_LENGTH, MAX_HIGHLIGHT_NOTE_LENGTH, MAX_HIGHLIGHT_QUOTE_LENGTH, MAX_SETTLE_ITEMS, MAX_TABLE_CELL_LENGTH, MAX_TABLE_COLUMNS, MAX_TIMESTAMP_SECONDS, type MediaNote, OptionsSource, PageBreakBlock, type ParseResult, type PathResult, PhotoFormat, PhotoRef, type RuleSpec, type RuleTrace, STRUCTURED_FIELD_TYPES, type TableColumn, calculatedProps, calculatedValue, canonicalJson, carryAnswers, coerceHidden, coerceHiddenValue, computePath, defineForm, describeCondition, evaluate, evaluateFormula, explain, f, fingerprint, formProgress, formatCalculated, formatTimestamp, formulaInput, formulaNumber, formulaRefs, furthestReached, listLimits, parseForm, parseFormula, parseTimestamp, recall, renameFormulaKey, ruleVisible, steps, tableColumns, tableLimits, when };
package/dist/index.d.ts CHANGED
@@ -1,68 +1,11 @@
1
- import { a as FieldBlock, J as Json, C as ContentBlock, P as PageBreakBlock, O as OptionsSource, F as FormDefinition, H as HiddenInput, b as FormLayout, L as LogicRule, E as Ending, c as FormSettings, d as Condition, B as Block } from './types-BhYUbLJ-.js';
2
- export { e as FormEvent, f as Operand, g as Operator } from './types-BhYUbLJ-.js';
3
- import { F as FormEngine, a as FormState } from './engine-Qzp6bX6O.js';
4
- export { C as CreateFormOptions, c as createForm, i as isFormEvent, b as isJson, r as replay } from './engine-Qzp6bX6O.js';
5
- import { F as FieldValidator } from './validate-Bs1lyoOl.js';
6
- export { C as ChoiceOption, a as FieldTypeManifest, H as HostOptions, O as OTHER_MAX_LENGTH, R as REQUIRED_MESSAGE, S as StandardSchemaV1, c as choiceOptions, d as dateLimits, g as getFieldType, i as isEmptyValue, b as isIsoDate, e as isOtherValue, f as isSensitive, l as listFieldTypes, n as normalizeValue, h as numberLimits, o as optionsSource, j as otherOption, r as ratingDisplay, k as registerFieldType, s as scaleLabels, m as summarizeValue, v as validateField, w as withHostOptions } from './validate-Bs1lyoOl.js';
7
-
8
- /**
9
- * The `photo` field type: a respondent attaches up to a few photos, such as a
10
- * picture of broken equipment. The answer holds references the host's storage
11
- * handed back (`PhotoRef`), never the bytes: the renderer uploads through the
12
- * host (`onUpload` on genesis-forms-web's `Form`), so the engine and the
13
- * server stay storage-agnostic. A host's server should check that each
14
- * reference is a file it stored for this respondent before saving.
15
- *
16
- * Opt-in in a builder palette (`UPLOAD_FIELD_TYPES`), since a host must be
17
- * able to store the files.
18
- */
19
- declare const PHOTO_TYPE = "photo";
20
- /** Field types that need the host to store files; a builder offers them only when the host names them. */
21
- declare const UPLOAD_FIELD_TYPES: readonly ["photo"];
22
- /** One stored photo, as the host's upload returned it. */
23
- type PhotoRef = {
24
- /** The host's id for the stored file. */
25
- id: string;
26
- /** The file's name on the respondent's device. */
27
- name: string;
28
- /** Its MIME type, such as `image/jpeg`. */
29
- type: string;
30
- /** Bytes. */
31
- size: number;
32
- };
33
- type PhotoFormat = "jpeg" | "png" | "heic" | "webp";
34
- /** The MIME types each format covers. */
35
- declare const PHOTO_FORMATS: Record<PhotoFormat, readonly string[]>;
36
- declare const DEFAULT_PHOTO_FILES = 3;
37
- declare const MAX_PHOTO_FILES = 5;
38
- declare const DEFAULT_PHOTO_SIZE_MB = 10;
39
- declare const MAX_PHOTO_SIZE_MB = 25;
40
- /** The longest reference id and file name a photo answer may carry. */
41
- declare const MAX_PHOTO_ID_LENGTH = 200;
42
- declare const MAX_PHOTO_NAME_LENGTH = 255;
43
- declare const isPhotoFormat: (v: unknown) => v is PhotoFormat;
44
- interface PhotoLimits {
45
- maxFiles: number;
46
- maxSizeMb: number;
47
- maxBytes: number;
48
- formats: PhotoFormat[];
49
- /** Every MIME type the formats cover. */
50
- mimeTypes: string[];
51
- }
52
- /** A photo field's limits; a prop that is missing or out of range uses its default. */
53
- declare function photoLimits(field: FieldBlock): PhotoLimits;
54
- /** Whether `v` has a photo reference's shape (any type and size). */
55
- declare function isPhotoRef(v: unknown): v is PhotoRef;
56
- /** The well-formed references in a photo answer, as `{ id, name, type, size }` only. */
57
- declare function photoRefs(value: Json | undefined): PhotoRef[];
58
- /** "JPEG, PNG or WebP". */
59
- declare function photoFormatList(formats: readonly PhotoFormat[]): string;
60
- /** The message for a file of a type the field doesn't take. */
61
- declare const photoTypeMessage: (field: FieldBlock) => string;
62
- /** The message for a file over the field's size limit. */
63
- declare const photoSizeMessage: (field: FieldBlock) => string;
64
- /** The message for more photos than the field takes. */
65
- declare const photoCountMessage: (field: FieldBlock) => string;
1
+ import { a as FieldBlock, C as ContentBlock, P as PageBreakBlock, O as OptionsSource, F as FormDefinition, H as HiddenInput, b as FormLayout, L as LogicRule, E as Ending, c as FormSettings, J as Json, d as Condition, B as Block } from './types-oAckGR_Z.js';
2
+ export { e as FormEvent, f as Operand, g as Operator } from './types-oAckGR_Z.js';
3
+ import { P as PhotoFormat, a as PhotoRef } from './upload-protocol-PX0jroTV.js';
4
+ export { D as DEFAULT_PHOTO_FILES, b as DEFAULT_PHOTO_SIZE_MB, M as MAX_PHOTO_FILES, c as MAX_PHOTO_ID_LENGTH, d as MAX_PHOTO_NAME_LENGTH, e as MAX_PHOTO_SIZE_MB, f as MAX_UPLOAD_REQUEST_BYTES, g as PHOTO_FORMATS, h as PHOTO_TYPE, i as PhotoLimits, S as SignedUpload, U as UPLOAD_FIELD_TYPES, j as UploadGrant, k as UploadRefusal, l as UploadRequest, m as isPhotoFormat, n as isPhotoRef, p as photoCountMessage, o as photoFormatList, q as photoLimits, r as photoRefs, s as photoSizeMessage, t as photoTypeMessage } from './upload-protocol-PX0jroTV.js';
5
+ import { F as FormEngine, a as FormState } from './engine-DcNQ-6oJ.js';
6
+ export { C as CreateFormOptions, c as createForm, i as isFormEvent, b as isJson, r as replay } from './engine-DcNQ-6oJ.js';
7
+ import { F as FieldValidator } from './validate-qwkdcr3H.js';
8
+ export { A as AnswerSnapshot, C as CHOICE_FIELD_TYPES, a as ChoiceOption, b as FieldTypeManifest, H as HostOptions, L as LinkParams, M as MAX_PREFILL_PARAM_LENGTH, O as OPTION_LIMITS, c as OTHER_MAX_LENGTH, d as OptionSnapshot, P as PrefillSetting, e as PrefillState, R as REQUIRED_MESSAGE, f as RestoredAnswers, S as SEARCHABLE_OPTION_COUNT, g as StandardSchemaV1, h as answerSnapshots, i as answersFromSnapshots, j as answersOnPath, k as choiceOptions, l as clearFilteredAnswers, m as dateLimits, n as filteredChoiceError, o as getFieldType, p as hasOptionFilters, q as hiddenByPrefill, r as isEmptyValue, s as isHttpsUrl, t as isIsoDate, u as isOtherValue, v as isPrefillParam, w as isSearchable, x as isSensitive, y as listFieldTypes, z as normalizeValue, B as numberLimits, D as optionFilter, E as optionJson, G as optionMatches, I as optionsSource, J as otherOption, K as prefillFromLink, N as prefillSetting, Q as ratingDisplay, T as readOption, U as registerFieldType, V as respondentPath, W as scaleLabels, X as searchOptions, Y as summarizeValue, Z as validateField, _ as visibleOptions, $ as withHostOptions } from './validate-qwkdcr3H.js';
66
9
 
67
10
  /** A field block that remembers its key and value type, for answer inference. */
68
11
  type FieldSpec<K extends string = string, V = unknown> = FieldBlock & {
@@ -87,6 +30,9 @@ interface ChoiceFieldOptions<O extends string> extends FieldOptions {
87
30
  options?: readonly {
88
31
  value: O;
89
32
  label?: string;
33
+ description?: string;
34
+ image?: string;
35
+ attributes?: Record<string, string | string[]>;
90
36
  }[] | undefined;
91
37
  /**
92
38
  * Options the app showing the form supplies, by key (`OptionsSource`), such
@@ -101,6 +47,17 @@ interface ChoiceFieldOptions<O extends string> extends FieldOptions {
101
47
  other?: boolean | {
102
48
  label?: string;
103
49
  } | undefined;
50
+ /**
51
+ * Preselect from the link the form was opened from: `{ param: "location" }` takes
52
+ * `?location=…` when it is one of the options; `hideWhenPrefilled` then skips the question.
53
+ * See `prefillFromLink`.
54
+ */
55
+ prefill?: {
56
+ param: string;
57
+ hideWhenPrefilled?: boolean;
58
+ } | undefined;
59
+ /** A search box over the options: true or false, or by default when there are more than 10 (`isSearchable`). */
60
+ searchable?: boolean | undefined;
104
61
  }
105
62
  interface HiddenOptions {
106
63
  source?: HiddenInput["source"] | undefined;
@@ -721,4 +678,12 @@ declare function explain(source: FormEngine | ExplainInput, blockId: string, opt
721
678
  /** A condition as a plain-English clause: `contact_me is not Yes`. */
722
679
  declare function describeCondition(condition: Condition, def: FormDefinition, fields?: Map<string, FieldBlock>): string;
723
680
 
724
- export { type AnswersOf, Block, CALCULATED_TYPE, COMPUTED_FIELD_TYPES, type CalculatedFormat, type CalculatedProps, type ChoiceFieldOptions, type CoerceHiddenOptions, type CoercedHidden, Condition, ContentBlock, DEFAULT_PHOTO_FILES, DEFAULT_PHOTO_SIZE_MB, Ending, type ExplainInput, type ExplainOptions, type Explanation, FORMULA_FUNCTIONS, FieldBlock, type FieldOptions, type FieldSpec, type FieldValidation, FieldValidator, type Form, FormDefinition, FormEngine, type FormInput, type FormIssue, FormLayout, type FormProgress, FormSettings, FormState, type FormulaFunction, type FormulaNode, type FormulaParseResult, type FormulaReader, type FormulaRef, type FormulaValue, HIGHLIGHT_NOTE_MESSAGE, HiddenInput, type Highlight, Json, type JumpTrace, type KeyResolver, LogicRule, MAX_CALCULATED_DECIMALS, MAX_FORMULA_ITEMS, MAX_FORMULA_LENGTH, MAX_FORM_FORMULA_LENGTH, MAX_HIDDEN_STRING_LENGTH, MAX_HIGHLIGHT_NOTE_LENGTH, MAX_HIGHLIGHT_QUOTE_LENGTH, MAX_PHOTO_FILES, MAX_PHOTO_ID_LENGTH, MAX_PHOTO_NAME_LENGTH, MAX_PHOTO_SIZE_MB, MAX_SETTLE_ITEMS, MAX_TABLE_CELL_LENGTH, MAX_TABLE_COLUMNS, MAX_TIMESTAMP_SECONDS, type MediaNote, OptionsSource, PHOTO_FORMATS, PHOTO_TYPE, PageBreakBlock, type ParseResult, type PathResult, type PhotoFormat, type PhotoLimits, type PhotoRef, type RuleSpec, type RuleTrace, STRUCTURED_FIELD_TYPES, type TableColumn, UPLOAD_FIELD_TYPES, calculatedProps, calculatedValue, canonicalJson, coerceHidden, coerceHiddenValue, computePath, defineForm, describeCondition, evaluate, evaluateFormula, explain, f, fingerprint, formProgress, formatCalculated, formatTimestamp, formulaInput, formulaNumber, formulaRefs, furthestReached, isPhotoFormat, isPhotoRef, listLimits, parseForm, parseFormula, parseTimestamp, photoCountMessage, photoFormatList, photoLimits, photoRefs, photoSizeMessage, photoTypeMessage, recall, renameFormulaKey, ruleVisible, steps, tableColumns, tableLimits, when };
681
+ /**
682
+ * Answers given to one version of a form, as answers to another (by field id), matched
683
+ * by field key: what an edit link prefills when the form has a newer version. Answers
684
+ * to fields the other version doesn't have are dropped; `extra` (by key) fills fields
685
+ * the stored answers leave out, such as contact details kept apart.
686
+ */
687
+ declare function carryAnswers(from: FormDefinition, to: FormDefinition, answers: Record<string, Json>, extra?: Record<string, Json | null | undefined>): Record<string, Json>;
688
+
689
+ export { type AnswersOf, Block, CALCULATED_TYPE, COMPUTED_FIELD_TYPES, type CalculatedFormat, type CalculatedProps, type ChoiceFieldOptions, type CoerceHiddenOptions, type CoercedHidden, Condition, ContentBlock, Ending, type ExplainInput, type ExplainOptions, type Explanation, FORMULA_FUNCTIONS, FieldBlock, type FieldOptions, type FieldSpec, type FieldValidation, FieldValidator, type Form, FormDefinition, FormEngine, type FormInput, type FormIssue, FormLayout, type FormProgress, FormSettings, FormState, type FormulaFunction, type FormulaNode, type FormulaParseResult, type FormulaReader, type FormulaRef, type FormulaValue, HIGHLIGHT_NOTE_MESSAGE, HiddenInput, type Highlight, Json, type JumpTrace, type KeyResolver, LogicRule, MAX_CALCULATED_DECIMALS, MAX_FORMULA_ITEMS, MAX_FORMULA_LENGTH, MAX_FORM_FORMULA_LENGTH, MAX_HIDDEN_STRING_LENGTH, MAX_HIGHLIGHT_NOTE_LENGTH, MAX_HIGHLIGHT_QUOTE_LENGTH, MAX_SETTLE_ITEMS, MAX_TABLE_CELL_LENGTH, MAX_TABLE_COLUMNS, MAX_TIMESTAMP_SECONDS, type MediaNote, OptionsSource, PageBreakBlock, type ParseResult, type PathResult, PhotoFormat, PhotoRef, type RuleSpec, type RuleTrace, STRUCTURED_FIELD_TYPES, type TableColumn, calculatedProps, calculatedValue, canonicalJson, carryAnswers, coerceHidden, coerceHiddenValue, computePath, defineForm, describeCondition, evaluate, evaluateFormula, explain, f, fingerprint, formProgress, formatCalculated, formatTimestamp, formulaInput, formulaNumber, formulaRefs, furthestReached, listLimits, parseForm, parseFormula, parseTimestamp, recall, renameFormulaKey, ruleVisible, steps, tableColumns, tableLimits, when };