@bach.software/vue-dynamic-form 0.2.0 → 0.4.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.
Files changed (63) hide show
  1. package/README.md +163 -163
  2. package/dist/examples.cjs.js +5 -5
  3. package/dist/examples.cjs.js.map +1 -1
  4. package/dist/examples.es.js +356 -270
  5. package/dist/examples.es.js.map +1 -1
  6. package/dist/src/components/DynamicForm.vue.d.ts +3 -0
  7. package/dist/src/components/DynamicFormItem.vue.d.ts +6 -1
  8. package/dist/src/components/DynamicFormItemArray.vue.d.ts +5 -1
  9. package/dist/src/components/DynamicFormItemChoice.vue.d.ts +5 -1
  10. package/dist/src/components/DynamicFormTemplate.vue.d.ts +34 -36
  11. package/dist/src/core/__tests__/validation.test.d.ts +1 -0
  12. package/dist/src/core/defineMetadata.d.ts +22 -10
  13. package/dist/src/core/useDynamicForm.d.ts +10 -0
  14. package/dist/src/core/useFieldArrayExtended.d.ts +2 -1
  15. package/dist/src/core/useValidatePartialForm.d.ts +12 -0
  16. package/dist/src/core/validation.d.ts +1 -0
  17. package/dist/src/examples/TestForm.vue.d.ts +5 -2
  18. package/dist/src/examples/TestFormTemplate.vue.d.ts +33 -27
  19. package/dist/src/examples/{TestFormTemplate.testcases.d.ts → __tests__/TestFormTemplate.testcases.d.ts} +8 -3
  20. package/dist/src/examples/index.d.ts +1 -1
  21. package/dist/src/index.d.ts +2 -2
  22. package/dist/src/types/DynamicFormItemProps.d.ts +1 -4
  23. package/dist/src/types/DynamicFormSettings.d.ts +3 -3
  24. package/dist/src/types/FieldMetadata.d.ts +24 -2
  25. package/dist/src/types/GetDynamicFormSettingsType.d.ts +3 -0
  26. package/dist/src/types/InternalFieldMetadata.d.ts +7 -1
  27. package/dist/src/types/MetadataConfiguration.d.ts +2 -0
  28. package/dist/src/utils/__tests__/createValidation.test.d.ts +1 -0
  29. package/dist/src/utils/__tests__/mapEachMetadataItem.test.d.ts +17 -0
  30. package/dist/src/utils/hashField.d.ts +7 -0
  31. package/dist/src/utils/mapEachMetadataItem.d.ts +10 -0
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/dist/useDynamicForm-B3VHKage.js +735 -0
  34. package/dist/useDynamicForm-B3VHKage.js.map +1 -0
  35. package/dist/useDynamicForm-CIS8GwHy.cjs +6 -0
  36. package/dist/useDynamicForm-CIS8GwHy.cjs.map +1 -0
  37. package/dist/vue-dynamic-form.cjs.js +1 -1
  38. package/dist/vue-dynamic-form.es.js +9 -11
  39. package/package.json +1 -1
  40. package/dist/src/core/validation.test.d.ts +0 -1
  41. package/dist/src/types/KeyValue.d.ts +0 -3
  42. package/dist/src/utils/createValidation.test.d.ts +0 -1
  43. package/dist/useDynamicForm-3E1RNkVq.cjs +0 -6
  44. package/dist/useDynamicForm-3E1RNkVq.cjs.map +0 -1
  45. package/dist/useDynamicForm-B6YN35Qb.js +0 -684
  46. package/dist/useDynamicForm-B6YN35Qb.js.map +0 -1
  47. /package/dist/src/components/{DynamicForm.test.d.ts → __tests__/DynamicForm.test.d.ts} +0 -0
  48. /package/dist/src/components/{DynamicFormItem.analytics.test.d.ts → __tests__/DynamicFormItem.analytics.test.d.ts} +0 -0
  49. /package/dist/src/components/{DynamicFormItem.logic.test.d.ts → __tests__/DynamicFormItem.logic.test.d.ts} +0 -0
  50. /package/dist/src/components/{DynamicFormItem.test-helpers.d.ts → __tests__/DynamicFormItem.test-helpers.d.ts} +0 -0
  51. /package/dist/src/components/{DynamicFormItem.validation.test.d.ts → __tests__/DynamicFormItem.validation.test.d.ts} +0 -0
  52. /package/dist/src/components/{DynamicFormItemArray.logic.test.d.ts → __tests__/DynamicFormItemArray.logic.test.d.ts} +0 -0
  53. /package/dist/src/components/{DynamicFormItemArray.validation.test.d.ts → __tests__/DynamicFormItemArray.validation.test.d.ts} +0 -0
  54. /package/dist/src/components/{DynamicFormItemChoice.logic.test.d.ts → __tests__/DynamicFormItemChoice.logic.test.d.ts} +0 -0
  55. /package/dist/src/components/{DynamicFormItemChoice.validation.test.d.ts → __tests__/DynamicFormItemChoice.validation.test.d.ts} +0 -0
  56. /package/dist/src/{examples/DynamicForm.test.d.ts → core/__tests__/useValidatePartialForm.test.d.ts} +0 -0
  57. /package/dist/src/{test-setup.d.ts → tests/test-setup.d.ts} +0 -0
  58. /package/dist/src/utils/{checkTreeHasValue.test.d.ts → __tests__/checkTreeHasValue.test.d.ts} +0 -0
  59. /package/dist/src/utils/{normalizePath.test.d.ts → __tests__/normalizePath.test.d.ts} +0 -0
  60. /package/dist/src/utils/{overridePath.test.d.ts → __tests__/overridePath.test.d.ts} +0 -0
  61. /package/dist/src/utils/{resolveMessage.test.d.ts → __tests__/resolveMessage.test.d.ts} +0 -0
  62. /package/dist/src/utils/{setInPath.test.d.ts → __tests__/setInPath.test.d.ts} +0 -0
  63. /package/dist/src/utils/{splitValidationFunctions.test.d.ts → __tests__/splitValidationFunctions.test.d.ts} +0 -0
@@ -1,20 +1,9 @@
1
+ import type { GetDynamicFormSettingsType } from '../types/GetDynamicFormSettingsType';
1
2
  import type { GetMetadataType } from '../types/GetMetadataType';
2
3
  export type Metadata = GetMetadataType<typeof metadata>;
3
- export interface Props {
4
- /**
5
- * Free to decide what attributes you want to pass internally between your templates.
6
- * You can add any attribute to a <slot /> and then it will be accessible in props.slotProps.
7
- */
8
- slotProps?: {
9
- hideLabel?: boolean;
10
- /** Example on how to keep track of the levels */
11
- level?: number;
12
- /** Helps identifying that we're below a choice field, so if we're rendering an array we can adjust our layout */
13
- belowChoiceField?: boolean;
14
- };
15
- }
4
+ export type DynamicFormSettings = GetDynamicFormSettingsType<typeof metadata>;
16
5
  declare const metadata: {
17
- fieldTypes: readonly ("default" | "checkbox" | "select" | "text" | "textBoundByVModel" | "selectBoundByVModel" | "checkboxBoundByVModel" | "heading")[];
6
+ fieldTypes: readonly ("default" | "checkbox" | "select" | "text" | "textBoundByVModel" | "selectBoundByVModel" | "checkboxBoundByVModel" | "heading" | "group")[];
18
7
  extendedProperties: {
19
8
  description?: string;
20
9
  options?: {
@@ -23,6 +12,18 @@ declare const metadata: {
23
12
  }[];
24
13
  fullWidth?: boolean;
25
14
  disabled?: boolean;
15
+ hidden?: boolean;
16
+ };
17
+ slotProperties: {
18
+ hideLabel?: boolean;
19
+ /** Example on how to keep track of the levels */
20
+ level?: number;
21
+ /** Helps identifying that we're below a choice field, so if we're rendering an array we can adjust our layout */
22
+ belowChoiceField?: boolean;
23
+ hidden?: boolean;
24
+ };
25
+ extendedSettingsProperties: {
26
+ showOptionalInsteadOfRequired?: boolean;
26
27
  };
27
28
  valueTypes: {
28
29
  text: string;
@@ -32,40 +33,45 @@ declare const metadata: {
32
33
  checkbox: boolean;
33
34
  checkboxBoundByVModel: boolean;
34
35
  heading: never;
36
+ group: never;
35
37
  } & {
36
38
  default: string;
37
39
  };
38
40
  };
39
41
  declare var __VLS_21: {
40
42
  level: number;
41
- }, __VLS_24: {
43
+ }, __VLS_24: {}, __VLS_27: {
42
44
  level: number;
43
45
  belowChoiceField: boolean;
44
- }, __VLS_34: {
45
- level: number;
46
- }, __VLS_36: {}, __VLS_45: {
46
+ }, __VLS_37: {
47
47
  hideLabel: boolean;
48
- }, __VLS_62: {
48
+ }, __VLS_40: {}, __VLS_49: {}, __VLS_59: {
49
+ level: number;
50
+ }, __VLS_61: {}, __VLS_78: {
49
51
  level: number;
50
- }, __VLS_64: {}, __VLS_73: {};
52
+ }, __VLS_80: {};
51
53
  type __VLS_Slots = {} & {
52
54
  default?: (props: typeof __VLS_21) => any;
53
55
  } & {
54
56
  default?: (props: typeof __VLS_24) => any;
55
57
  } & {
56
- default?: (props: typeof __VLS_34) => any;
58
+ default?: (props: typeof __VLS_27) => any;
59
+ } & {
60
+ default?: (props: typeof __VLS_37) => any;
61
+ } & {
62
+ default?: (props: typeof __VLS_40) => any;
57
63
  } & {
58
- default?: (props: typeof __VLS_36) => any;
64
+ attributes?: (props: typeof __VLS_49) => any;
59
65
  } & {
60
- default?: (props: typeof __VLS_45) => any;
66
+ default?: (props: typeof __VLS_59) => any;
61
67
  } & {
62
- default?: (props: typeof __VLS_62) => any;
68
+ default?: (props: typeof __VLS_61) => any;
63
69
  } & {
64
- default?: (props: typeof __VLS_64) => any;
70
+ default?: (props: typeof __VLS_78) => any;
65
71
  } & {
66
- attributes?: (props: typeof __VLS_73) => any;
72
+ attributes?: (props: typeof __VLS_80) => any;
67
73
  };
68
- declare const __VLS_component: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
74
+ declare const __VLS_component: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
69
75
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
70
76
  export default _default;
71
77
  type __VLS_WithSlots<T, S> = T & {
@@ -1,8 +1,13 @@
1
- import type { Metadata } from './TestFormTemplate.vue';
2
- import type { DynamicFormSettings } from '../types/DynamicFormSettings';
1
+ import type { GenericObject } from 'vee-validate';
2
+ import type { DynamicFormSettings, Metadata } from '../../examples/TestFormTemplate.vue';
3
3
  export declare const defaultTestCase: import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
4
4
  export declare const arrayTestCase: import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
5
5
  export declare const groupTestCase: import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
6
6
  export declare const choiceTestCase: import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
7
+ export declare const childFieldsTestCase: import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
7
8
  export declare const individualTestCase: import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
8
- export declare function createTestCase(metadata: Metadata[], settings?: DynamicFormSettings): import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
9
+ export declare function createTestCase(metadata: Metadata[], settings?: DynamicFormSettings, testCaseConfig?: {
10
+ initialEdit?: boolean;
11
+ hideFieldsWithoutValue?: boolean;
12
+ initialValues?: GenericObject;
13
+ }): import("vue").Raw<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
@@ -1,3 +1,3 @@
1
- export * from './TestFormTemplate.testcases';
1
+ export * from './__tests__/TestFormTemplate.testcases';
2
2
  export { default as TestFormTemplate } from './TestFormTemplate.vue';
3
3
  export { type Metadata } from './TestFormTemplate.vue';
@@ -5,11 +5,11 @@ export { default as DynamicFormItemChoice } from './components/DynamicFormItemCh
5
5
  export { default as DynamicFormTemplate } from './components/DynamicFormTemplate.vue';
6
6
  export * from './core/defineMetadata';
7
7
  export * from './core/useDynamicForm';
8
- export * from './core/useFieldArrayExtended';
9
- export * from './core/validation';
8
+ export * from './core/useValidatePartialForm';
10
9
  export * from './types/DynamicFormItemProps';
11
10
  export * from './types/DynamicFormSettings';
12
11
  export * from './types/FieldMetadata';
12
+ export * from './types/GetDynamicFormSettingsType';
13
13
  export * from './types/GetMetadataType';
14
14
  export * from './types/MetadataConfiguration';
15
15
  export * from './types/RequireOnly';
@@ -3,11 +3,8 @@ import type { FieldMetadata } from '../types/FieldMetadata';
3
3
  import type { InternalFieldMetadata } from '../types/InternalFieldMetadata';
4
4
  export interface DynamicFormItemProps<InternalMetadata extends InternalFieldMetadata<FieldMetadata>> {
5
5
  template: DefineComponent<object, object, {
6
- input?: ((props: object) => any) | undefined;
7
- children?: ((props: object) => any) | undefined;
6
+ default?: ((props: object) => any) | undefined;
8
7
  attributes?: ((props: object) => any) | undefined;
9
- choice?: ((props: object) => any) | undefined;
10
- array?: ((props: object) => any) | undefined;
11
8
  }>;
12
9
  fieldMetadata: InternalMetadata;
13
10
  /**
@@ -1,6 +1,6 @@
1
1
  import type { ValidationMessage } from '../types/ValidationMessage';
2
2
  export declare const dynamicFormSettingsKey: unique symbol;
3
- export interface DynamicFormSettings {
3
+ export type DynamicFormSettings<ExtendedProperties extends object = object> = {
4
4
  /**
5
5
  * Enables diagnostic data output via concealed DOM elements for reactivity testing
6
6
  */
@@ -33,7 +33,7 @@ export interface DynamicFormSettings {
33
33
  /**
34
34
  * When true, validates fields on every value change when the field has an error.
35
35
  *
36
- * Defaults to false.
36
+ * Defaults to true (applied by DynamicForm).
37
37
  */
38
38
  validateWhenInError?: boolean;
39
39
  /**
@@ -86,4 +86,4 @@ export interface DynamicFormSettings {
86
86
  /** XSD: totalDigits. Available placeholders: `{field}`, `{0}` or `{digits}` (max total digits) */
87
87
  totalDigits?: ValidationMessage;
88
88
  };
89
- }
89
+ } & ExtendedProperties;
@@ -15,6 +15,19 @@ export type FieldMetadata<ExtendedFieldTypes extends string = string, ExtendedPr
15
15
  * The maximal occurrence of a value.
16
16
  */
17
17
  maxOccurs?: number;
18
+ /**
19
+ * Controls whether the array automatically pre-fills empty placeholder items up to `minOccurs`
20
+ * when the form is first rendered and the array is still empty.
21
+ *
22
+ * Defaults to `true` — omitting this property has the same effect as setting it to `true`.
23
+ * Set it explicitly to `false` to suppress auto-filling, which is useful when you want the
24
+ * user to explicitly add the first item themselves even though `minOccurs` is 1 or higher.
25
+ *
26
+ * @example
27
+ * // Will NOT auto-add an initial item, even though minOccurs is 1:
28
+ * { name: 'emails', type: 'text', maxOccurs: 5, minOccurs: 1, autoAddMinOccurs: false }
29
+ */
30
+ autoAddMinOccurs?: boolean;
18
31
  /**
19
32
  * Simple restrictions to the data, these are available in XSD and can be applied easily.
20
33
  * For more advance validation use the validation property.
@@ -158,14 +171,23 @@ export type FieldMetadata<ExtendedFieldTypes extends string = string, ExtendedPr
158
171
  * is re-computed every time the value changes. If you don't use it, a change in value will not re-trigger the reactivity of the computed.
159
172
  * @returns A transformed FieldMetadata
160
173
  */
161
- computedProps?: ((thisField: ComputedPropsType<FieldMetadata<ExtendedFieldTypes, ExtendedProperties>>, fieldValue: Ref<unknown>) => void)[];
174
+ computedProps?: ((thisField: ComputedPropsFieldType<ExtendedFieldTypes, ExtendedProperties>, fieldValue: Ref<unknown>, childFields: Ref<ReadOnlyFieldType<ExtendedFieldTypes, ExtendedProperties>[]>) => void)[];
162
175
  /**
163
176
  * Normally the computedProps are not re-calculate if a child value changes. If you need this functionality, you can enable this by
164
177
  * setting this property to true.
165
178
  */
166
179
  computeOnChildValueChange?: boolean;
167
180
  } & ExtendedProperties;
168
- export type ComputedPropsType<T> = Omit<T, 'name' | 'path' | 'children' | 'choice' | 'attributes' | 'fieldOptions' | 'computedProps' | 'maxOccurs'> & Readonly<{
181
+ export type ComputedPropsFieldType<ExtendedFieldTypes extends string = string, ExtendedProperties extends object = object> = Omit<FieldMetadata<ExtendedFieldTypes, ExtendedProperties>, 'name' | 'path' | 'parent' | 'children' | 'choice' | 'attributes' | 'fieldOptions' | 'computedProps' | 'maxOccurs' | 'isComplexType' | 'computeOnChildValueChange'> & Readonly<{
182
+ name: string;
183
+ path: string;
184
+ parent: FieldMetadata<ExtendedFieldTypes, ExtendedProperties>;
185
+ }>;
186
+ export type ReadOnlyFieldType<ExtendedFieldTypes extends string = string, ExtendedProperties extends object = object> = Readonly<Omit<FieldMetadata<ExtendedFieldTypes, ExtendedProperties>, 'name' | 'path' | 'children' | 'choice'> & {
169
187
  name: string;
170
188
  path: string;
189
+ children: ReadOnlyFieldType<ExtendedFieldTypes, ExtendedProperties>[];
190
+ choice: ReadOnlyFieldType<ExtendedFieldTypes, ExtendedProperties>[];
171
191
  }>;
192
+ export type ComputedPropsFieldOf<T extends FieldMetadata<any, any>> = T extends FieldMetadata<infer FT, infer EP> ? ComputedPropsFieldType<FT, EP> : never;
193
+ export type ReadOnlyFieldOf<T extends FieldMetadata<any, any>> = T extends FieldMetadata<infer FT, infer EP> ? ReadOnlyFieldType<FT, EP> : never;
@@ -0,0 +1,3 @@
1
+ import type { DynamicFormSettings } from './DynamicFormSettings';
2
+ import type { MetadataConfiguration } from '../types/MetadataConfiguration';
3
+ export type GetDynamicFormSettingsType<T extends MetadataConfiguration> = DynamicFormSettings<T['extendedSettingsProperties']>;
@@ -1,3 +1,9 @@
1
1
  import type { FieldMetadata } from '../types/FieldMetadata.js';
2
2
  import type { RequireOnly } from '../types/RequireOnly.js';
3
- export type InternalFieldMetadata<Metadata extends FieldMetadata> = RequireOnly<Metadata, 'name' | 'type' | 'minOccurs' | 'maxOccurs'>;
3
+ export type InternalFieldMetadata<Metadata extends FieldMetadata> = RequireOnly<Metadata, 'name' | 'type' | 'minOccurs' | 'maxOccurs'> & {
4
+ /**
5
+ * Internal hash computed by the system to track meaningful changes to the computed field.
6
+ * Do not set this manually — it is overwritten after every computedProps run.
7
+ */
8
+ _hash?: string;
9
+ };
@@ -1,5 +1,7 @@
1
1
  export interface MetadataConfiguration {
2
2
  fieldTypes: readonly string[];
3
3
  extendedProperties: object;
4
+ slotProperties: object;
5
+ extendedSettingsProperties: object;
4
6
  valueTypes: Record<string, any>;
5
7
  }
@@ -0,0 +1 @@
1
+ import '../../core/validation';
@@ -0,0 +1,17 @@
1
+ import type { GetMetadataType } from '../../types/GetMetadataType';
2
+ export type TestMetadata = GetMetadataType<typeof _metadata>;
3
+ declare const _metadata: {
4
+ fieldTypes: readonly ("default" | "text")[];
5
+ extendedProperties: {
6
+ visited?: boolean;
7
+ visitOrder?: number;
8
+ };
9
+ slotProperties: object;
10
+ extendedSettingsProperties: object;
11
+ valueTypes: {
12
+ text: string;
13
+ } & {
14
+ default: string;
15
+ };
16
+ };
17
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { FieldMetadata } from '../types/FieldMetadata';
2
+ /**
3
+ * Creates a deterministic hash of all mutable field properties (those that computedProps can change).
4
+ * Excludes structural/immutable properties: name, path, children, choice, attributes,
5
+ * fieldOptions, computedProps, maxOccurs, parent, and _hash itself.
6
+ */
7
+ export declare function hashField(field: FieldMetadata): string;
@@ -0,0 +1,10 @@
1
+ import type { FieldMetadata } from '../types/FieldMetadata';
2
+ /**
3
+ * Recursively walks a `FieldMetadata` tree (visiting `children` and `choice`) and applies
4
+ * `callbackFunc` to every node, returning the transformed tree.
5
+ *
6
+ * The callback receives a shallow clone of each node, so mutations inside the callback do not
7
+ * affect the original metadata. `children` and `choice` on the returned node are replaced with
8
+ * the recursively-mapped results after the callback runs.
9
+ */
10
+ export declare function mapEachMetadataItem<ExtendedFieldTypes extends string = string, ExtendedProperties extends object = object>(metadata: FieldMetadata<ExtendedFieldTypes, ExtendedProperties>, callbackFunc: (item: FieldMetadata<ExtendedFieldTypes, ExtendedProperties>) => FieldMetadata<ExtendedFieldTypes, ExtendedProperties>): FieldMetadata<ExtendedFieldTypes, ExtendedProperties>;