@wildo-ai/zod-decorators 1.0.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 (94) hide show
  1. package/dist/esm/__mocks__/mime.d.ts +12 -0
  2. package/dist/esm/__mocks__/mime.d.ts.map +1 -0
  3. package/dist/esm/__mocks__/mime.js +75 -0
  4. package/dist/esm/__mocks__/mime.js.map +1 -0
  5. package/dist/esm/commons.d.ts +26 -0
  6. package/dist/esm/commons.d.ts.map +1 -0
  7. package/dist/esm/commons.js +41 -0
  8. package/dist/esm/commons.js.map +1 -0
  9. package/dist/esm/currencies.shared.schemas.d.ts +208 -0
  10. package/dist/esm/currencies.shared.schemas.d.ts.map +1 -0
  11. package/dist/esm/currencies.shared.schemas.js +228 -0
  12. package/dist/esm/currencies.shared.schemas.js.map +1 -0
  13. package/dist/esm/files/agent-file-formats.d.ts +99 -0
  14. package/dist/esm/files/agent-file-formats.d.ts.map +1 -0
  15. package/dist/esm/files/agent-file-formats.js +163 -0
  16. package/dist/esm/files/agent-file-formats.js.map +1 -0
  17. package/dist/esm/files/extension-nature-map.d.ts +12 -0
  18. package/dist/esm/files/extension-nature-map.d.ts.map +1 -0
  19. package/dist/esm/files/extension-nature-map.js +63 -0
  20. package/dist/esm/files/extension-nature-map.js.map +1 -0
  21. package/dist/esm/files/file-extensions.enum.d.ts +58 -0
  22. package/dist/esm/files/file-extensions.enum.d.ts.map +1 -0
  23. package/dist/esm/files/file-extensions.enum.js +65 -0
  24. package/dist/esm/files/file-extensions.enum.js.map +1 -0
  25. package/dist/esm/files/mime-registry.d.ts +72 -0
  26. package/dist/esm/files/mime-registry.d.ts.map +1 -0
  27. package/dist/esm/files/mime-registry.js +174 -0
  28. package/dist/esm/files/mime-registry.js.map +1 -0
  29. package/dist/esm/files/unified-registry.d.ts +112 -0
  30. package/dist/esm/files/unified-registry.d.ts.map +1 -0
  31. package/dist/esm/files/unified-registry.js +190 -0
  32. package/dist/esm/files/unified-registry.js.map +1 -0
  33. package/dist/esm/index.d.ts +29 -0
  34. package/dist/esm/index.d.ts.map +1 -0
  35. package/dist/esm/index.js +36 -0
  36. package/dist/esm/index.js.map +1 -0
  37. package/dist/esm/testing/decorated-test-schemas.d.ts +27 -0
  38. package/dist/esm/testing/decorated-test-schemas.d.ts.map +1 -0
  39. package/dist/esm/testing/decorated-test-schemas.js +26 -0
  40. package/dist/esm/testing/decorated-test-schemas.js.map +1 -0
  41. package/dist/esm/testing.d.ts +6 -0
  42. package/dist/esm/testing.d.ts.map +1 -0
  43. package/dist/esm/testing.js +6 -0
  44. package/dist/esm/testing.js.map +1 -0
  45. package/dist/esm/zod-bigdecimal.d.ts +193 -0
  46. package/dist/esm/zod-bigdecimal.d.ts.map +1 -0
  47. package/dist/esm/zod-bigdecimal.js +274 -0
  48. package/dist/esm/zod-bigdecimal.js.map +1 -0
  49. package/dist/esm/zod-code.d.ts +95 -0
  50. package/dist/esm/zod-code.d.ts.map +1 -0
  51. package/dist/esm/zod-code.js +160 -0
  52. package/dist/esm/zod-code.js.map +1 -0
  53. package/dist/esm/zod-color.d.ts +8 -0
  54. package/dist/esm/zod-color.d.ts.map +1 -0
  55. package/dist/esm/zod-color.js +88 -0
  56. package/dist/esm/zod-color.js.map +1 -0
  57. package/dist/esm/zod-decorators.types.d.ts +2207 -0
  58. package/dist/esm/zod-decorators.types.d.ts.map +1 -0
  59. package/dist/esm/zod-decorators.types.js +771 -0
  60. package/dist/esm/zod-decorators.types.js.map +1 -0
  61. package/dist/esm/zod-duration.d.ts +128 -0
  62. package/dist/esm/zod-duration.d.ts.map +1 -0
  63. package/dist/esm/zod-duration.js +174 -0
  64. package/dist/esm/zod-duration.js.map +1 -0
  65. package/dist/esm/zod-file.d.ts +219 -0
  66. package/dist/esm/zod-file.d.ts.map +1 -0
  67. package/dist/esm/zod-file.js +469 -0
  68. package/dist/esm/zod-file.js.map +1 -0
  69. package/dist/esm/zod-money.d.ts +223 -0
  70. package/dist/esm/zod-money.d.ts.map +1 -0
  71. package/dist/esm/zod-money.js +293 -0
  72. package/dist/esm/zod-money.js.map +1 -0
  73. package/dist/esm/zod-phone.d.ts +75 -0
  74. package/dist/esm/zod-phone.d.ts.map +1 -0
  75. package/dist/esm/zod-phone.js +116 -0
  76. package/dist/esm/zod-phone.js.map +1 -0
  77. package/dist/esm/zod-range.d.ts +87 -0
  78. package/dist/esm/zod-range.d.ts.map +1 -0
  79. package/dist/esm/zod-range.js +138 -0
  80. package/dist/esm/zod-range.js.map +1 -0
  81. package/dist/esm/zod-utils.shared.d.ts +783 -0
  82. package/dist/esm/zod-utils.shared.d.ts.map +1 -0
  83. package/dist/esm/zod-utils.shared.js +2647 -0
  84. package/dist/esm/zod-utils.shared.js.map +1 -0
  85. package/dist/esm/zod-versioned.d.ts +150 -0
  86. package/dist/esm/zod-versioned.d.ts.map +1 -0
  87. package/dist/esm/zod-versioned.js +172 -0
  88. package/dist/esm/zod-versioned.js.map +1 -0
  89. package/dist/esm/zod.module-override.d.ts +413 -0
  90. package/dist/esm/zod.module-override.d.ts.map +1 -0
  91. package/dist/esm/zod.module-override.js +1093 -0
  92. package/dist/esm/zod.module-override.js.map +1 -0
  93. package/dist/tsconfig.build.tsbuildinfo +1 -0
  94. package/package.json +63 -0
@@ -0,0 +1,2207 @@
1
+ import type { ComponentType } from 'react';
2
+ import { ViewportBreakpoint } from './commons.js';
3
+ import { AvailableCurrency, CurrencyAllowed } from './currencies.shared.schemas.js';
4
+ import { z } from 'zod';
5
+ import { DecoratedPrimitiveZodType } from './zod.module-override.js';
6
+ import { ZodBrandedColorInstance } from './zod-color.js';
7
+ export declare const SCHEMA_METADATA: symbol;
8
+ export declare enum FieldSchemaType {
9
+ STRING = "string",// String schemas (z.string)
10
+ NUMBER = "number",// Number schemas (z.number, z.int)
11
+ BIGINT = "bigint",// BigInt schemas (z.bigint)
12
+ BOOLEAN = "boolean",// Boolean schemas (z.boolean)
13
+ ENUM = "enum",// Enum schemas (z.enum, z.enum)
14
+ DATE = "date",// Date schemas (z.date)
15
+ OBJECT = "object",// Object schemas (z.object) - NOT range schemas
16
+ ARRAY = "array",// Array schemas (z.array)
17
+ SET = "set",// Set schemas (z.set) - stored as array
18
+ TUPLE = "tuple",// Tuple schemas (z.tuple)
19
+ RECORD = "record",// Record schemas (z.record)
20
+ MAP = "map",// Map schemas (z.map)
21
+ TIME = "time",// Time schemas (z.time)
22
+ DATETIME = "datetime",// Datetime schemas (z.datetime)
23
+ RANGE_NUMBER = "range_number",// Range number schemas created by z_range('number')
24
+ RANGE_DATE = "range_date",// Range date schemas created by z_range('date')
25
+ RANGE_DATETIME = "range_datetime",// Range datetime schemas created by z_range('datetime')
26
+ RANGE_TIME = "range_time",// Range time schemas created by z_range('time')
27
+ RANGE_BIGDECIMAL = "range_bigdecimal",// Range bigdecimal schemas created by z_range('bigdecimal')
28
+ RANGE_MONEY = "range_money",// Range money schemas created by z_range('money')
29
+ MONEY = "money",// Money schemas created by z_money() - detected by SCHEMA_METADATA.moneyConfig
30
+ BIGDECIMAL = "bigdecimal",// BigDecimal schemas created by z_bigdecimal() - detected by SCHEMA_METADATA.bigDecimalConfig
31
+ CODE = "code",// Code schemas created by z_code() - detected by SCHEMA_METADATA.codeConfig
32
+ FILE = "file",// File schemas created by z_file() - detected by SCHEMA_METADATA.fileConfig
33
+ DURATION = "duration",// Duration schemas created by z_duration() - detected by SCHEMA_METADATA.durationConfig
34
+ PHONE = "phone",// Phone schemas created by z_phone() - detected by SCHEMA_METADATA.phoneConfig
35
+ VERSIONED_FOREIGN_KEY = "versioned_foreign_key",// Versioned foreign key schemas created by z_foreignKeyVersioned() - detected by SCHEMA_METADATA.versionedForeignKeyConfig
36
+ VERSIONED_OBJECT = "versioned_object",// Versioned object schemas created by versioned() - detected by SCHEMA_METADATA.versionedConfig
37
+ UNKNOWN = "unknown"
38
+ }
39
+ export declare enum FormFieldComponent {
40
+ INPUT = "input",// Standard text input
41
+ TEXTAREA = "textarea",// Multi-line text area
42
+ SELECT = "select",// Dropdown select
43
+ RADIO_GROUP = "radio-group",// Radio button group
44
+ CHECKBOX = "checkbox",// Single checkbox
45
+ CHECKBOX_GROUP = "checkbox-group",// Checkbox group for multi-select (arrays of enums)
46
+ SWITCH = "switch",// Toggle switch
47
+ SLIDER = "slider",// Single value slider
48
+ DATE = "date",// Date picker (single date)
49
+ TIME = "time",// Time picker (single time)
50
+ DATETIME = "datetime",// DateTime picker (date + time)
51
+ RANGE_SLIDER = "range-slider",// Number range slider (two thumbs for min/max)
52
+ DATE_RANGE = "date-range",// Date range picker (from/to dates)
53
+ DATETIME_RANGE = "datetime-range",// DateTime range picker (from/to datetime)
54
+ TIME_RANGE = "time-range",// Time range picker (from/to time)
55
+ BIGDECIMAL_RANGE = "bigdecimal-range",// BigDecimal range input (from/to bigdecimal)
56
+ MONEY_RANGE = "money-range",// Money range input (from/to money)
57
+ DURATION = "duration",// Duration input (value + unit selector)
58
+ PHONE = "phone"
59
+ }
60
+ /**
61
+ * Chrome layout mode for display context (detail/read-only views).
62
+ * Controls how the field wrapper (label, value, description) is arranged.
63
+ */
64
+ export declare const DisplayChromeMode: {
65
+ /** Label above, value below, description below value (default). */
66
+ readonly STACKED: "stacked";
67
+ /** Label and value on the same line. */
68
+ readonly INLINE: "inline";
69
+ /** No label/description, just value (dense mode). */
70
+ readonly COMPACT: "compact";
71
+ /** No chrome at all — bare value output. */
72
+ readonly HIDDEN: "hidden";
73
+ };
74
+ export type DisplayChromeMode = typeof DisplayChromeMode[keyof typeof DisplayChromeMode];
75
+ /**
76
+ * Chrome layout mode for edit context (forms).
77
+ * Superset of DisplayChromeMode with form-specific modes (SETTINGS_ROW, RELAXED).
78
+ *
79
+ * Also exported as `FormFieldChromeMode` for backward compatibility.
80
+ */
81
+ export declare const EditChromeMode: {
82
+ /** Label above, control below, description + error below control (default). */
83
+ readonly STACKED: "stacked";
84
+ /** Label + description left, control + error right (settings page style). */
85
+ readonly SETTINGS_ROW: "settings_row";
86
+ /** Control left, label + description right (switch/checkbox style). */
87
+ readonly INLINE: "inline";
88
+ /** Generous spacing, heading-size label (onboarding, OTP, wizard). */
89
+ readonly RELAXED: "relaxed";
90
+ /** No label/description, just control + error (dense mode). */
91
+ readonly COMPACT: "compact";
92
+ /** No chrome at all — bare control output. */
93
+ readonly HIDDEN: "hidden";
94
+ };
95
+ export type EditChromeMode = typeof EditChromeMode[keyof typeof EditChromeMode];
96
+ /** @deprecated Use `EditChromeMode` directly. Kept as alias for backward compatibility. */
97
+ export declare const FormFieldChromeMode: {
98
+ /** Label above, control below, description + error below control (default). */
99
+ readonly STACKED: "stacked";
100
+ /** Label + description left, control + error right (settings page style). */
101
+ readonly SETTINGS_ROW: "settings_row";
102
+ /** Control left, label + description right (switch/checkbox style). */
103
+ readonly INLINE: "inline";
104
+ /** Generous spacing, heading-size label (onboarding, OTP, wizard). */
105
+ readonly RELAXED: "relaxed";
106
+ /** No label/description, just control + error (dense mode). */
107
+ readonly COMPACT: "compact";
108
+ /** No chrome at all — bare control output. */
109
+ readonly HIDDEN: "hidden";
110
+ };
111
+ /** @deprecated Use `EditChromeMode` directly. */
112
+ export type FormFieldChromeMode = EditChromeMode;
113
+ /**
114
+ * Responsive chrome mode — either a single mode or per-breakpoint mapping.
115
+ * When a breakpoint mapping is provided, FormFieldChrome resolves the effective
116
+ * mode at runtime using useUI().
117
+ */
118
+ export type ResponsiveChromeMode = EditChromeMode | Partial<Record<ViewportBreakpoint, EditChromeMode>>;
119
+ /**
120
+ * Responsive-aware value: either a single value or per-breakpoint overrides.
121
+ * Used for chromeMode, forceHide, and other properties that may vary by viewport.
122
+ */
123
+ export type ResponsiveAware<T> = T | Partial<Record<ViewportBreakpoint, T>>;
124
+ export type FormFieldSchemaTypeComponents = {
125
+ [K in FieldSchemaType]: K extends FieldSchemaType.STRING ? FormFieldComponent.INPUT | FormFieldComponent.TEXTAREA | FormFieldComponent.SELECT | FormFieldComponent.RADIO_GROUP | FormFieldComponent.DATE | FormFieldComponent.TIME | FormFieldComponent.DATETIME : K extends FieldSchemaType.NUMBER ? FormFieldComponent.INPUT | FormFieldComponent.SLIDER | FormFieldComponent.SELECT | FormFieldComponent.RADIO_GROUP : K extends FieldSchemaType.BIGINT ? FormFieldComponent.INPUT : K extends FieldSchemaType.BOOLEAN ? FormFieldComponent.SWITCH | FormFieldComponent.CHECKBOX | FormFieldComponent.SELECT | FormFieldComponent.RADIO_GROUP : K extends FieldSchemaType.ENUM ? FormFieldComponent.SELECT | FormFieldComponent.RADIO_GROUP : K extends FieldSchemaType.DATE ? FormFieldComponent.DATE | FormFieldComponent.DATETIME | FormFieldComponent.INPUT : K extends FieldSchemaType.TIME ? FormFieldComponent.TIME | FormFieldComponent.INPUT : K extends FieldSchemaType.DATETIME ? FormFieldComponent.DATETIME | FormFieldComponent.INPUT : K extends FieldSchemaType.RANGE_NUMBER ? FormFieldComponent.RANGE_SLIDER : K extends FieldSchemaType.RANGE_DATE ? FormFieldComponent.DATE_RANGE : K extends FieldSchemaType.RANGE_DATETIME ? FormFieldComponent.DATETIME_RANGE : K extends FieldSchemaType.RANGE_TIME ? FormFieldComponent.TIME_RANGE : K extends FieldSchemaType.RANGE_BIGDECIMAL ? FormFieldComponent.BIGDECIMAL_RANGE : K extends FieldSchemaType.RANGE_MONEY ? FormFieldComponent.MONEY_RANGE : K extends FieldSchemaType.MONEY ? FormFieldComponent.INPUT : K extends FieldSchemaType.DURATION ? FormFieldComponent.DURATION : K extends FieldSchemaType.PHONE ? FormFieldComponent.PHONE : K extends FieldSchemaType.BIGDECIMAL ? FormFieldComponent.INPUT : K extends FieldSchemaType.CODE ? FormFieldComponent.TEXTAREA : K extends FieldSchemaType.FILE ? FormFieldComponent.INPUT : K extends FieldSchemaType.ARRAY ? FormFieldComponent.CHECKBOX_GROUP | FormFieldComponent.SELECT : K extends FieldSchemaType.SET ? FormFieldComponent.INPUT | FormFieldComponent.CHECKBOX_GROUP | FormFieldComponent.SELECT : K extends FieldSchemaType.TUPLE ? FormFieldComponent.INPUT : K extends FieldSchemaType.UNKNOWN ? FormFieldComponent.INPUT : never;
126
+ };
127
+ export type FormComponentForSchemaType<T extends FieldSchemaType> = FormFieldSchemaTypeComponents[T];
128
+ export type FormFieldSchemaTypeDefaultComponent = {
129
+ [K in FieldSchemaType]: K extends FieldSchemaType.STRING ? FormFieldComponent.INPUT : K extends FieldSchemaType.NUMBER ? FormFieldComponent.INPUT : K extends FieldSchemaType.BIGINT ? FormFieldComponent.INPUT : K extends FieldSchemaType.BOOLEAN ? FormFieldComponent.SWITCH : K extends FieldSchemaType.ENUM ? FormFieldComponent.SELECT : K extends FieldSchemaType.DATE ? FormFieldComponent.DATE : K extends FieldSchemaType.TIME ? FormFieldComponent.TIME : K extends FieldSchemaType.DATETIME ? FormFieldComponent.DATETIME : K extends FieldSchemaType.RANGE_NUMBER ? FormFieldComponent.RANGE_SLIDER : K extends FieldSchemaType.RANGE_DATE ? FormFieldComponent.DATE_RANGE : K extends FieldSchemaType.RANGE_DATETIME ? FormFieldComponent.DATETIME_RANGE : K extends FieldSchemaType.RANGE_TIME ? FormFieldComponent.TIME_RANGE : K extends FieldSchemaType.RANGE_BIGDECIMAL ? FormFieldComponent.BIGDECIMAL_RANGE : K extends FieldSchemaType.RANGE_MONEY ? FormFieldComponent.MONEY_RANGE : K extends FieldSchemaType.MONEY ? FormFieldComponent.INPUT : K extends FieldSchemaType.DURATION ? FormFieldComponent.DURATION : K extends FieldSchemaType.PHONE ? FormFieldComponent.PHONE : K extends FieldSchemaType.BIGDECIMAL ? FormFieldComponent.INPUT : K extends FieldSchemaType.CODE ? FormFieldComponent.TEXTAREA : K extends FieldSchemaType.FILE ? FormFieldComponent.INPUT : FormFieldComponent.INPUT;
130
+ };
131
+ export type DefaultFormComponentForSchemaType<T extends FieldSchemaType> = FormFieldSchemaTypeDefaultComponent[T];
132
+ export type DecoratorConfig<T extends ZodDecorator> = {
133
+ ref: T;
134
+ params: ZodDecorator_ParamsType[T];
135
+ };
136
+ export type DecoratorInput<T extends ZodDecorator = ZodDecorator> = T | DecoratorConfig<T>;
137
+ export declare enum DisplayFieldComponent {
138
+ SIMPLE_TEXT = "simple-text",
139
+ STRING = "string",
140
+ NUMBER = "number",
141
+ BOOLEAN = "boolean",
142
+ ENUM = "enum",
143
+ DATE = "date",
144
+ TIME = "time",
145
+ DATETIME = "datetime",
146
+ CODE = "code",
147
+ FILE = "file",
148
+ MONEY = "money",
149
+ BIGDECIMAL = "bigdecimal",
150
+ DURATION = "duration",
151
+ PHONE = "phone",
152
+ RANGE_NUMBER = "range-number",
153
+ RANGE_DATE = "range-date",
154
+ RANGE_TIME = "range-time",
155
+ RANGE_DATETIME = "range-datetime",
156
+ RANGE_BIGDECIMAL = "range-bigdecimal",
157
+ RANGE_MONEY = "range-money"
158
+ }
159
+ export type DisplayFieldSchemaTypeComponents = {
160
+ [K in FieldSchemaType]: K extends FieldSchemaType.STRING ? DisplayFieldComponent.STRING | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.NUMBER ? DisplayFieldComponent.NUMBER | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.BIGINT ? DisplayFieldComponent.NUMBER | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.BOOLEAN ? DisplayFieldComponent.BOOLEAN | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.ENUM ? DisplayFieldComponent.ENUM | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.DATE ? DisplayFieldComponent.DATE | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.TIME ? DisplayFieldComponent.TIME | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.DATETIME ? DisplayFieldComponent.DATETIME | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.OBJECT ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.ARRAY ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RECORD ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.MAP ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RANGE_NUMBER ? DisplayFieldComponent.RANGE_NUMBER | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RANGE_DATE ? DisplayFieldComponent.RANGE_DATE | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RANGE_TIME ? DisplayFieldComponent.RANGE_TIME | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RANGE_DATETIME ? DisplayFieldComponent.RANGE_DATETIME | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RANGE_BIGDECIMAL ? DisplayFieldComponent.RANGE_BIGDECIMAL | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RANGE_MONEY ? DisplayFieldComponent.RANGE_MONEY | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.MONEY ? DisplayFieldComponent.MONEY | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.DURATION ? DisplayFieldComponent.DURATION | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.PHONE ? DisplayFieldComponent.PHONE | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.BIGDECIMAL ? DisplayFieldComponent.BIGDECIMAL | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.CODE ? DisplayFieldComponent.CODE | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.FILE ? DisplayFieldComponent.FILE | DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.SET ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.TUPLE ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.VERSIONED_FOREIGN_KEY ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.VERSIONED_OBJECT ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.UNKNOWN ? DisplayFieldComponent.SIMPLE_TEXT : never;
161
+ };
162
+ export type DisplayComponentForSchemaType<T extends FieldSchemaType> = DisplayFieldSchemaTypeComponents[T];
163
+ export type DisplayFieldSchemaTypeDefaultComponent = {
164
+ [K in FieldSchemaType]: K extends FieldSchemaType.STRING ? DisplayFieldComponent.STRING : K extends FieldSchemaType.NUMBER ? DisplayFieldComponent.NUMBER : K extends FieldSchemaType.BIGINT ? DisplayFieldComponent.NUMBER : K extends FieldSchemaType.BOOLEAN ? DisplayFieldComponent.BOOLEAN : K extends FieldSchemaType.ENUM ? DisplayFieldComponent.ENUM : K extends FieldSchemaType.DATE ? DisplayFieldComponent.DATE : K extends FieldSchemaType.TIME ? DisplayFieldComponent.TIME : K extends FieldSchemaType.DATETIME ? DisplayFieldComponent.DATETIME : K extends FieldSchemaType.OBJECT ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.ARRAY ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RECORD ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.MAP ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.RANGE_NUMBER ? DisplayFieldComponent.RANGE_NUMBER : K extends FieldSchemaType.RANGE_DATE ? DisplayFieldComponent.RANGE_DATE : K extends FieldSchemaType.RANGE_TIME ? DisplayFieldComponent.RANGE_TIME : K extends FieldSchemaType.RANGE_DATETIME ? DisplayFieldComponent.RANGE_DATETIME : K extends FieldSchemaType.RANGE_BIGDECIMAL ? DisplayFieldComponent.RANGE_BIGDECIMAL : K extends FieldSchemaType.RANGE_MONEY ? DisplayFieldComponent.RANGE_MONEY : K extends FieldSchemaType.MONEY ? DisplayFieldComponent.MONEY : K extends FieldSchemaType.DURATION ? DisplayFieldComponent.DURATION : K extends FieldSchemaType.PHONE ? DisplayFieldComponent.PHONE : K extends FieldSchemaType.BIGDECIMAL ? DisplayFieldComponent.BIGDECIMAL : K extends FieldSchemaType.CODE ? DisplayFieldComponent.CODE : K extends FieldSchemaType.FILE ? DisplayFieldComponent.FILE : K extends FieldSchemaType.SET ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.TUPLE ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.VERSIONED_FOREIGN_KEY ? DisplayFieldComponent.SIMPLE_TEXT : K extends FieldSchemaType.VERSIONED_OBJECT ? DisplayFieldComponent.SIMPLE_TEXT : DisplayFieldComponent.SIMPLE_TEXT;
165
+ };
166
+ export type DefaultDisplayComponentForSchemaType<T extends FieldSchemaType> = DisplayFieldSchemaTypeDefaultComponent[T];
167
+ /**
168
+ * How a section is rendered — both per-section appearance and container grouping.
169
+ *
170
+ * **Solo modes** (render in place, no grouping):
171
+ * - DEFAULT: Standard section with border and padding
172
+ * - CARD: Wrapped in a card container with shadow
173
+ * - GHOST: Minimal container without visual styling
174
+ * - COLLAPSIBLE: Expandable/collapsible section with trigger
175
+ *
176
+ * **Container modes** (sections sharing the same mode are grouped together,
177
+ * rendered at the position of the first occurrence):
178
+ *
179
+ * @category Layout-based (all sections visible simultaneously)
180
+ * - INLINE: Stacked vertically
181
+ * - GRID: CSS Grid layout with configurable columns
182
+ * - COLUMNS: Multi-column layout (newspaper style)
183
+ *
184
+ * @category Navigation-based (one section visible at a time)
185
+ * - TABS: Horizontal tabs navigation
186
+ * - VERTICAL_TABS: Vertical tabs (side navigation)
187
+ * - PILLS: Pill/segment navigation (compact)
188
+ *
189
+ * @category Expandable (toggle section visibility)
190
+ * - ACCORDION: Each section independently collapsible
191
+ * - EXPANDABLE: "Show more" button reveals additional sections
192
+ *
193
+ * @category Guided (sequential, with indicators)
194
+ * - STEPPER: Step-by-step with step indicators
195
+ * - TIMELINE: Chronological progression (vertical timeline)
196
+ *
197
+ * NOTE: Wizard is NOT included — it's a higher-level layout pattern
198
+ * that contains sections, not a section rendering mode.
199
+ */
200
+ export declare enum SectionMode {
201
+ DEFAULT = "default",
202
+ CARD = "card",
203
+ GHOST = "ghost",
204
+ COLLAPSIBLE = "collapsible",
205
+ INLINE = "inline",
206
+ GRID = "grid",
207
+ COLUMNS = "columns",
208
+ TABS = "tabs",
209
+ VERTICAL_TABS = "vertical_tabs",
210
+ PILLS = "pills",
211
+ ACCORDION = "accordion",
212
+ EXPANDABLE = "expandable",
213
+ STEPPER = "stepper",
214
+ TIMELINE = "timeline"
215
+ }
216
+ /** Solo modes — render in place, no grouping. Valid on `<Section appearance>`. */
217
+ export type SoloSectionMode = SectionMode.DEFAULT | SectionMode.CARD | SectionMode.GHOST | SectionMode.COLLAPSIBLE;
218
+ /** Container modes — sections sharing the same mode are grouped into one container. */
219
+ export type ContainerSectionMode = Exclude<SectionMode, SoloSectionMode>;
220
+ /**
221
+ * OverlayContainerMode - How overlay containers are rendered.
222
+ * Controls the presentation style of standalone dismissable containers.
223
+ *
224
+ * @category Centered overlays (modal)
225
+ * - DIALOG: Standard centered modal
226
+ * - ALERT: Confirmation dialog with action buttons
227
+ * - COMMAND: Command palette (search-focused)
228
+ * - LIGHTBOX: Full-screen media viewer with navigation
229
+ *
230
+ * @category Side panels (modal)
231
+ * - SHEET: Side panel (direction via `side` prop)
232
+ *
233
+ * @category Mobile-optimized (modal)
234
+ * - DRAWER: Swipeable drawer with snap points
235
+ * - ACTION_SHEET: iOS-style action list (bottom)
236
+ *
237
+ * @category Non-blocking
238
+ * - POPOVER: Anchored contextual overlay
239
+ * - TOAST: Auto-dismiss notification
240
+ */
241
+ export declare enum OverlayContainerMode {
242
+ DIALOG = "dialog",
243
+ ALERT = "alert",
244
+ COMMAND = "command",
245
+ LIGHTBOX = "lightbox",
246
+ SHEET = "sheet",
247
+ DRAWER = "drawer",
248
+ ACTION_SHEET = "action_sheet",
249
+ POPOVER = "popover",
250
+ TOAST = "toast"
251
+ }
252
+ /**
253
+ * Layout orientation / display direction (horizontal | vertical)
254
+ */
255
+ export declare enum DisplayDirection {
256
+ HORIZONTAL = "horizontal",
257
+ VERTICAL = "vertical"
258
+ }
259
+ /**
260
+ * Horizontal alignment for UI elements (popovers, menus, action bars, etc.)
261
+ */
262
+ export declare enum HorizontalAlign {
263
+ START = "start",
264
+ CENTER = "center",
265
+ END = "end"
266
+ }
267
+ /**
268
+ * Labelling values for boolean fields
269
+ */
270
+ export declare const BooleanLabellingValue: {
271
+ readonly YES_NO: "yes/no";
272
+ readonly TRUE_FALSE: "true/false";
273
+ readonly ON_OFF: "on/off";
274
+ readonly ENABLED_DISABLED: "enabled/disabled";
275
+ readonly ACTIVE_INACTIVE: "active/inactive";
276
+ };
277
+ export type BooleanLabellingValue = typeof BooleanLabellingValue[keyof typeof BooleanLabellingValue];
278
+ /**
279
+ * Display mode for boolean fields
280
+ */
281
+ export declare const BooleanDisplayMode: {
282
+ readonly RAW: "raw";
283
+ readonly CHECKMARK: "checkmark";
284
+ readonly EDIT_LIKE: "edit_like";
285
+ };
286
+ export type BooleanDisplayMode = typeof BooleanDisplayMode[keyof typeof BooleanDisplayMode];
287
+ /**
288
+ * Edit mode for boolean fields
289
+ */
290
+ export declare const BooleanEditMode: {
291
+ readonly TOGGLE: "toggle";
292
+ readonly SWITCH: "switch";
293
+ readonly CHECKBOX: "checkbox";
294
+ readonly RADIO: "radio";
295
+ };
296
+ export type BooleanEditMode = typeof BooleanEditMode[keyof typeof BooleanEditMode];
297
+ /**
298
+ * String display modes for rendering string values
299
+ */
300
+ export declare const StringDisplayMode: {
301
+ readonly TEXT: "text";
302
+ readonly TRUNCATE: "truncate";
303
+ readonly MULTILINE: "multiline";
304
+ readonly COLOR: "color";
305
+ readonly LINK: "link";
306
+ readonly EMAIL: "email";
307
+ readonly BADGE: "badge";
308
+ readonly COPY: "copy";
309
+ readonly SECRET: "secret";
310
+ };
311
+ export type StringDisplayMode = typeof StringDisplayMode[keyof typeof StringDisplayMode];
312
+ /**
313
+ * String edit modes for form components
314
+ */
315
+ export declare const StringEditMode: {
316
+ readonly INPUT: "input";
317
+ readonly TEXTAREA: "textarea";
318
+ readonly COLOR: "color";
319
+ readonly PASSWORD: "password";
320
+ readonly OTP: "otp";
321
+ };
322
+ export type StringEditMode = typeof StringEditMode[keyof typeof StringEditMode];
323
+ /**
324
+ * Number display modes for rendering number values
325
+ */
326
+ export declare const NumberDisplayMode: {
327
+ readonly RAW: "raw";
328
+ readonly FORMATTED: "formatted";
329
+ readonly PERCENTAGE: "percentage";
330
+ readonly COMPACT: "compact";
331
+ readonly ORDINAL: "ordinal";
332
+ readonly BYTES: "bytes";
333
+ };
334
+ export type NumberDisplayMode = typeof NumberDisplayMode[keyof typeof NumberDisplayMode];
335
+ /**
336
+ * Number edit modes for form components
337
+ */
338
+ export declare const NumberEditMode: {
339
+ readonly INPUT: "input";
340
+ readonly SLIDER: "slider";
341
+ readonly STEPPER: "stepper";
342
+ };
343
+ export type NumberEditMode = typeof NumberEditMode[keyof typeof NumberEditMode];
344
+ /**
345
+ * Scale modes for percentage display.
346
+ * - NORMALIZED: value is 0–1, Intl.NumberFormat's style:'percent' handles ×100
347
+ * - PERCENT: value is already 0–100, must be divided by 100 before passing to Intl
348
+ */
349
+ export declare const PercentageScale: {
350
+ readonly NORMALIZED: "normalized";
351
+ readonly PERCENT: "percent";
352
+ };
353
+ export type PercentageScale = typeof PercentageScale[keyof typeof PercentageScale];
354
+ /**
355
+ * Display mode for BigDecimal fields.
356
+ * Subset of NumberDisplayMode — COMPACT/ORDINAL/BYTES excluded for arbitrary precision numbers.
357
+ */
358
+ export declare const BigDecimalDisplayMode: {
359
+ readonly RAW: "raw";
360
+ readonly FORMATTED: "formatted";
361
+ readonly PERCENTAGE: "percentage";
362
+ };
363
+ export type BigDecimalDisplayMode = typeof BigDecimalDisplayMode[keyof typeof BigDecimalDisplayMode];
364
+ /**
365
+ * Edit mode for BigDecimal fields.
366
+ * Only INPUT — SLIDER/STEPPER are not applicable for arbitrary precision numbers.
367
+ */
368
+ export declare const BigDecimalEditMode: {
369
+ readonly INPUT: "input";
370
+ };
371
+ export type BigDecimalEditMode = typeof BigDecimalEditMode[keyof typeof BigDecimalEditMode];
372
+ /**
373
+ * Enum display modes for rendering enum values
374
+ */
375
+ export declare const EnumDisplayMode: {
376
+ readonly TEXT: "text";
377
+ readonly BADGE: "badge";
378
+ readonly ICON: "icon";
379
+ readonly CARD: "card";
380
+ };
381
+ export type EnumDisplayMode = typeof EnumDisplayMode[keyof typeof EnumDisplayMode];
382
+ /**
383
+ * Enum edit modes for form components
384
+ */
385
+ export declare const EnumEditMode: {
386
+ readonly SELECT: "select";
387
+ readonly RADIO: "radio";
388
+ readonly RADIO_ICON_ONLY: "radio_icon_only";
389
+ readonly TOGGLE: "toggle";
390
+ readonly TOGGLE_ICON_ONLY: "toggle_icon_only";
391
+ readonly CARD: "card";
392
+ readonly CARD_ICON_ONLY: "card_icon_only";
393
+ readonly COMBOBOX: "combobox";
394
+ };
395
+ export type EnumEditMode = typeof EnumEditMode[keyof typeof EnumEditMode];
396
+ /**
397
+ * Layout direction for form layouts
398
+ */
399
+ export declare const LayoutDirection: {
400
+ readonly HORIZONTAL: "horizontal";
401
+ readonly VERTICAL: "vertical";
402
+ };
403
+ export type LayoutDirection = typeof LayoutDirection[keyof typeof LayoutDirection];
404
+ /**
405
+ * Semantic badge variants for enum display.
406
+ * These map 1:1 to the Badge component's `variant` prop in presets-components.
407
+ */
408
+ export declare const BadgeSemanticVariant: {
409
+ readonly DEFAULT: "default";
410
+ readonly SECONDARY: "secondary";
411
+ readonly OUTLINE: "outline";
412
+ readonly INFO: "info";
413
+ readonly SUCCESS: "success";
414
+ readonly WARNING: "warning";
415
+ readonly DESTRUCTIVE: "destructive";
416
+ };
417
+ export type BadgeSemanticVariant = typeof BadgeSemanticVariant[keyof typeof BadgeSemanticVariant];
418
+ /**
419
+ * An icon reference — either a React component (Lucide, custom SVG) or
420
+ * a string key (StandardIconReference) resolved via the icon registry.
421
+ *
422
+ * When `string`: resolved at render time through `renderIcon(key, opts)`.
423
+ * When `ComponentType`: rendered directly via `React.createElement(icon, props)`.
424
+ */
425
+ export type IconLike = ComponentType<{
426
+ size?: number;
427
+ color?: string;
428
+ className?: string;
429
+ strokeWidth?: number;
430
+ }> | string;
431
+ /**
432
+ * Per-value display configuration for enum fields.
433
+ * Groups all visual properties for a single enum value in one place.
434
+ */
435
+ export interface EnumValueDisplayConfig {
436
+ /** Badge variant / color for this enum value */
437
+ color?: BadgeSemanticVariant;
438
+ /** Icon for this enum value — React component or StandardIconReference string */
439
+ icon?: IconLike;
440
+ }
441
+ /**
442
+ * Updater function accepted by any decorator with object params.
443
+ *
444
+ * Receives the current metadata value (or `undefined` if no prior decorator
445
+ * or if the prior value is the `true` boolean shorthand). Returns the new value.
446
+ *
447
+ * For `{primitive}UI` decorators, the updater bypasses the
448
+ * normal merge behavior — the returned value replaces entirely.
449
+ *
450
+ * @example
451
+ * ```ts
452
+ * schema.enumUI((current) => ({
453
+ * ...current,
454
+ * defaultColor: 'secondary',
455
+ * values: { ...current?.values, active: { color: 'success' } },
456
+ * }));
457
+ *
458
+ * schema.formComponent((current) => ({
459
+ * ...current,
460
+ * component: 'custom-input',
461
+ * hideLabel: true,
462
+ * }));
463
+ * ```
464
+ */
465
+ export type DecoratorUpdater<T> = (current: T | undefined) => T;
466
+ /**
467
+ * Foreign key display mode options
468
+ * - ID: Show raw FK ID value
469
+ * - LABEL: Show resolved label via getFrontendResourceLabel
470
+ * - SUMMARY: Show the referenced resource's summary view (compact card) (default)
471
+ *
472
+ * Note: "summary" here is about *FK rendering*, not API data shape (see DataMode.SUMMARY)
473
+ * or operation bar density (see ResourceOperationDisplayMode.SUMMARY).
474
+ */
475
+ export declare const ForeignKeyDisplayMode: {
476
+ readonly ID: "id";
477
+ readonly LABEL: "label";
478
+ readonly SUMMARY: "summary";
479
+ };
480
+ export type ForeignKeyDisplayMode = typeof ForeignKeyDisplayMode[keyof typeof ForeignKeyDisplayMode];
481
+ /**
482
+ * Polymorphic FK variant definition.
483
+ * Specifies which parent resource variants a polymorphic FK targets.
484
+ * Used by the polymorphic factory to derive the correct FK field name per variant.
485
+ */
486
+ export interface PolymorphicFkVariant {
487
+ /** The parent resource type (e.g., 'organizations') */
488
+ parentResourceType: string;
489
+ /** The parent's field identifier (e.g., 'organizationId') */
490
+ parentFieldIdentifier: string;
491
+ }
492
+ /**
493
+ * Structural FK params — backend/factory-relevant subset.
494
+ * Stays on `IS_FOREIGN_KEY`. UI-specific params (mode, linkable,
495
+ * displayPresetOverride) live on `ForeignKeyUIParams` via `.foreignKeyUI()`.
496
+ */
497
+ export interface ForeignKeyStructuralParams {
498
+ polymorphicVariants?: PolymorphicFkVariant[];
499
+ }
500
+ /**
501
+ * Supported types for range schemas.
502
+ */
503
+ export declare enum RangeType {
504
+ NUMBER = "number",
505
+ DATE = "date",
506
+ DATETIME = "datetime",
507
+ TIME = "time",
508
+ BIGDECIMAL = "bigdecimal",
509
+ MONEY = "money"
510
+ }
511
+ /**
512
+ * Type mapping for range schema outputs.
513
+ * Maps RangeType to the resulting schema's inferred TypeScript type.
514
+ */
515
+ /**
516
+ * Type mapping for range schema outputs.
517
+ * Maps RangeType to the resulting schema's inferred TypeScript type.
518
+ * Note: Money and BigDecimal have their actual types, but for range purposes,
519
+ * the actual Zod schemas (MoneyValueSchema, BigDecimalValueSchema) define the real structure.
520
+ */
521
+ export type RangeTypeMapping = {
522
+ [RangeType.NUMBER]: number;
523
+ [RangeType.DATE]: Date;
524
+ [RangeType.DATETIME]: string;
525
+ [RangeType.TIME]: string;
526
+ [RangeType.BIGDECIMAL]: string;
527
+ [RangeType.MONEY]: {
528
+ amount: bigint;
529
+ currency: string;
530
+ decimals: number;
531
+ };
532
+ };
533
+ /**
534
+ * Min/max constraint value types based on range type.
535
+ */
536
+ export type RangeConstraintValue = number | Date | string;
537
+ export interface RangeSchemaMetadata {
538
+ /** Marker for detecting range schemas */
539
+ isRange: true;
540
+ /** The type of values in the range */
541
+ type: RangeType;
542
+ /** Whether the 'from' field is optional (default: true) */
543
+ fromOptional: boolean;
544
+ /** Whether the 'to' field is optional (default: true) */
545
+ toOptional: boolean;
546
+ /** Minimum allowed value (for UI hints and validation) */
547
+ min?: RangeConstraintValue;
548
+ /** Maximum allowed value (for UI hints and validation) */
549
+ max?: RangeConstraintValue;
550
+ }
551
+ /**
552
+ * Options for creating a range schema.
553
+ */
554
+ export interface RangeSchemaOptions {
555
+ /** Whether the 'from' field is optional (default: true) */
556
+ fromOptional?: boolean;
557
+ /** Whether the 'to' field is optional (default: true) */
558
+ toOptional?: boolean;
559
+ /** Minimum allowed value (stored in metadata for UI hints) */
560
+ min?: RangeConstraintValue;
561
+ /** Maximum allowed value (stored in metadata for UI hints) */
562
+ max?: RangeConstraintValue;
563
+ }
564
+ export declare enum RangeSchemaType {
565
+ NUMBER = "number",// Number schemas (z.number, z.int)
566
+ DATE = "date",// Date schemas (z.date)
567
+ DATETIME = "datetime",// Datetime schemas (z.datetime)
568
+ TIME = "time",// Time schemas (z.time)
569
+ BIGDECIMAL = "bigdecimal",// BigDecimal schemas (z_bigdecimal)
570
+ MONEY = "money"
571
+ }
572
+ export declare const RangeTypeToComponent: Record<RangeSchemaType, FormFieldComponent>;
573
+ export declare function getDefaultRangeComponent(rangeType: RangeSchemaType | string): FormFieldComponent;
574
+ /**
575
+ * Inferred type for a range schema based on options.
576
+ */
577
+ export type RangeSchemaInferredType<T extends RangeType, FromOptional extends boolean = true, ToOptional extends boolean = true> = {
578
+ from: FromOptional extends true ? RangeTypeMapping[T] | undefined : RangeTypeMapping[T];
579
+ to: ToOptional extends true ? RangeTypeMapping[T] | undefined : RangeTypeMapping[T];
580
+ };
581
+ /**
582
+ * Metadata stored on money schemas for detection and configuration.
583
+ * Money schemas represent financial amounts with bigint storage to avoid precision issues.
584
+ * Structure: { amount: bigint, currency: string, decimals: number (int) }
585
+ */
586
+ export interface MoneySchemaMetadata {
587
+ /** Marker for detecting money schemas */
588
+ isMoney: true;
589
+ /**
590
+ * Currency category filter. Replaces old `showCrypto` / `majorOnly` / `fiatOnly` booleans.
591
+ * E.g. `[CurrencyAllowed.FIAT]` = fiat only, `[CurrencyAllowed.FIAT_MAJOR]` = major fiat only.
592
+ * When undefined or empty, all currencies are available.
593
+ */
594
+ currenciesAllowed?: CurrencyAllowed[];
595
+ /** Whether to show only app-enabled currencies (default: true). Renamed from `enabledOnly`. */
596
+ appEnabledOnly?: boolean;
597
+ /** Whether to allow currency change (default: true) */
598
+ allowCurrencyChange?: boolean;
599
+ /** Minimum amount in smallest unit as bigint (e.g., 0n for non-negative) */
600
+ minAmount?: bigint;
601
+ /** Maximum amount in smallest unit as bigint */
602
+ maxAmount?: bigint;
603
+ }
604
+ /**
605
+ * Options for creating a money schema.
606
+ */
607
+ export interface MoneySchemaOptions {
608
+ /**
609
+ * Currency category filter. Replaces old `showCrypto` / `majorOnly` / `fiatOnly` booleans.
610
+ * E.g. `[CurrencyAllowed.FIAT]` = fiat only, `[CurrencyAllowed.FIAT_MAJOR]` = major fiat only.
611
+ * When undefined or empty, all currencies are available.
612
+ */
613
+ currenciesAllowed?: CurrencyAllowed[];
614
+ /** Whether to show only app-enabled currencies (default: true). Renamed from `enabledOnly`. */
615
+ appEnabledOnly?: boolean;
616
+ /** Whether to allow currency change (default: true) */
617
+ allowCurrencyChange?: boolean;
618
+ /** Minimum amount in smallest unit as bigint (e.g., 0n for non-negative) */
619
+ minAmount?: bigint;
620
+ /** Maximum amount in smallest unit as bigint */
621
+ maxAmount?: bigint;
622
+ }
623
+ /**
624
+ * Metadata stored on bigdecimal schemas for detection and configuration.
625
+ * BigDecimal schemas represent precise decimal numbers stored as strings.
626
+ * Uses big.js for precise arithmetic operations.
627
+ */
628
+ export interface BigDecimalSchemaMetadata {
629
+ /** Marker for detecting bigdecimal schemas */
630
+ isBigDecimal: true;
631
+ /** Maximum number of decimal places allowed */
632
+ precision?: number;
633
+ /** Minimum value (as string for precision) */
634
+ min?: string;
635
+ /** Maximum value (as string for precision) */
636
+ max?: string;
637
+ }
638
+ /**
639
+ * Options for creating a bigdecimal schema.
640
+ */
641
+ export interface BigDecimalSchemaOptions {
642
+ /** Maximum number of decimal places allowed */
643
+ precision?: number;
644
+ /** Minimum value (as string for precision) */
645
+ min?: string;
646
+ /** Maximum value (as string for precision) */
647
+ max?: string;
648
+ }
649
+ /**
650
+ * Duration units enum.
651
+ * Uses string values for JSON serialization and API compatibility.
652
+ * Aligns with common patterns (e.g., expiresIn: { value, unit }).
653
+ */
654
+ export declare enum DurationUnit {
655
+ MILLISECONDS = "milliseconds",
656
+ SECONDS = "seconds",
657
+ MINUTES = "minutes",
658
+ HOURS = "hours",
659
+ DAYS = "days",
660
+ WEEKS = "weeks",
661
+ MONTHS = "months",
662
+ YEARS = "years",
663
+ CENTURIES = "centuries"
664
+ }
665
+ /**
666
+ * Token expiry duration — minutes, hours, or days only.
667
+ * Structurally compatible with DurationValue. Use ExpiresInDurationSchema for validation.
668
+ */
669
+ export type ExpiresInDuration = {
670
+ value: number;
671
+ unit: DurationUnit.MINUTES | DurationUnit.HOURS | DurationUnit.DAYS;
672
+ };
673
+ /**
674
+ * Metadata stored on duration schemas for detection and configuration.
675
+ * Duration schemas represent time spans with { value: number, unit: DurationUnit }.
676
+ */
677
+ export interface DurationSchemaMetadata {
678
+ /** Marker for detecting duration schemas */
679
+ isDuration: true;
680
+ /** Allowed units (if empty/undefined, all units are allowed) */
681
+ allowedUnits?: DurationUnit[];
682
+ /** Minimum value (for the numeric part) */
683
+ minValue?: number;
684
+ /** Maximum value (for the numeric part) */
685
+ maxValue?: number;
686
+ }
687
+ /** ISO 3166-1 alpha-2 country code (e.g., 'US', 'FR') */
688
+ export type PhoneCountryCode = string;
689
+ /**
690
+ * Metadata stored on phone schemas for detection and configuration.
691
+ * Phone schemas store E.164 strings.
692
+ */
693
+ export interface PhoneSchemaMetadata {
694
+ /** Marker for detecting phone schemas */
695
+ isPhone: true;
696
+ /** Default country when parsing numbers without country code */
697
+ defaultCountry?: PhoneCountryCode;
698
+ }
699
+ /**
700
+ * Options for creating a phone schema via z_phone().
701
+ */
702
+ export interface PhoneSchemaOptions {
703
+ /** Default country when parsing numbers without country code */
704
+ defaultCountry?: PhoneCountryCode;
705
+ }
706
+ /**
707
+ * Supported code/programming languages for code schemas.
708
+ */
709
+ export type CodeLanguage = 'javascript' | 'typescript' | 'python' | 'java' | 'csharp' | 'cpp' | 'c' | 'go' | 'rust' | 'ruby' | 'php' | 'swift' | 'kotlin' | 'scala' | 'html' | 'css' | 'scss' | 'less' | 'json' | 'yaml' | 'xml' | 'markdown' | 'sql' | 'graphql' | 'bash' | 'shell' | 'powershell' | 'dockerfile' | 'nginx' | 'apache' | 'plaintext' | string;
710
+ /**
711
+ * Metadata stored on code schemas for detection and configuration.
712
+ * Code schemas represent code snippets with language information.
713
+ * Structure: { content: string, language: string }
714
+ */
715
+ export interface CodeSchemaMetadata {
716
+ /** Marker for detecting code schemas */
717
+ isCode: true;
718
+ /** Allowed languages (if empty, all languages are allowed) */
719
+ allowedLanguages?: CodeLanguage[];
720
+ /** Maximum content length in characters */
721
+ maxLength?: number;
722
+ /** Minimum content length in characters */
723
+ minLength?: number;
724
+ }
725
+ /**
726
+ * Options for creating a code schema.
727
+ */
728
+ export interface CodeSchemaOptions {
729
+ /** Allowed languages (if empty, all languages are allowed) */
730
+ allowedLanguages?: CodeLanguage[];
731
+ /** Maximum content length in characters */
732
+ maxLength?: number;
733
+ /** Minimum content length in characters */
734
+ minLength?: number;
735
+ }
736
+ /**
737
+ * Common MIME type groups for file uploads.
738
+ */
739
+ export declare const FileMimeTypeGroups: {
740
+ /** Image files: JPEG, PNG, GIF, WebP, SVG, etc. */
741
+ readonly Images: readonly ["image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml", "image/bmp", "image/tiff", "image/x-icon", "image/heic", "image/heif"];
742
+ /** Video files: MP4, WebM, AVI, MOV, etc. */
743
+ readonly Video: readonly ["video/mp4", "video/webm", "video/ogg", "video/avi", "video/quicktime", "video/x-msvideo", "video/x-ms-wmv", "video/mpeg", "video/3gpp"];
744
+ /** Audio files: MP3, WAV, OGG, etc. */
745
+ readonly Audio: readonly ["audio/mpeg", "audio/wav", "audio/ogg", "audio/webm", "audio/aac", "audio/flac", "audio/x-m4a", "audio/mp4"];
746
+ /** PDF documents */
747
+ readonly PDF: readonly ["application/pdf"];
748
+ /** Office documents: Word, Excel, PowerPoint, etc. */
749
+ readonly Office: readonly ["application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.oasis.opendocument.text", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.presentation"];
750
+ /** All documents: PDF + Office */
751
+ readonly Documents: readonly ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.oasis.opendocument.text", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.presentation"];
752
+ /** Archives: ZIP, RAR, 7z, etc. */
753
+ readonly Archives: readonly ["application/zip", "application/x-zip-compressed", "application/x-rar-compressed", "application/x-7z-compressed", "application/gzip", "application/x-tar"];
754
+ };
755
+ export type FileMimeTypeGroup = keyof typeof FileMimeTypeGroups;
756
+ /**
757
+ * File nature classification for constraint validation and UI display.
758
+ */
759
+ export declare enum FileNature {
760
+ IMAGE = "image",
761
+ VIDEO = "video",
762
+ AUDIO = "audio",
763
+ PDF = "pdf",
764
+ OFFICE = "office",
765
+ ARCHIVE = "archive",
766
+ ALL = "all"
767
+ }
768
+ /**
769
+ * Rendering-level file nature categories.
770
+ *
771
+ * Maps the granular `FileNature` schema enum into coarser display categories
772
+ * used by frontend components to select the appropriate renderer:
773
+ * - `FileNature.PDF` + `FileNature.OFFICE` → `FileDisplayNature.DOCUMENT`
774
+ * - `FileNature.ARCHIVE` + `FileNature.ALL` + unknown → `FileDisplayNature.GENERIC`
775
+ *
776
+ * Use `resolveFileDisplayNature()` from `zod-file.ts` to resolve from
777
+ * schema metadata and/or MIME type.
778
+ */
779
+ export declare enum FileDisplayNature {
780
+ IMAGE = "image",
781
+ VIDEO = "video",
782
+ AUDIO = "audio",
783
+ DOCUMENT = "document",
784
+ GENERIC = "generic"
785
+ }
786
+ /**
787
+ * Storage providers accepted for file uploads.
788
+ */
789
+ export declare enum FileStorageAccepted {
790
+ WILDO_MANAGED = "wildo_managed",
791
+ LOCAL_DIRECTORY = "local_directory",
792
+ ONEDRIVE = "onedrive",
793
+ GOOGLE_DRIVE = "google_drive",
794
+ DROPBOX = "dropbox"
795
+ }
796
+ /**
797
+ * Context object passed to `FilePathBinding` resolver functions.
798
+ *
799
+ * `relatedObject` may be undefined for standalone uploads (no parent resource).
800
+ * `fileMetadata` and `applicationId` are always provided by the runtime.
801
+ */
802
+ export interface FilePathBindingContext {
803
+ /** The parent resource instance (undefined for standalone uploads) */
804
+ relatedObject?: Record<string, unknown>;
805
+ /** The z_file() field's schema metadata */
806
+ fileMetadata: FileSchemaMetadata;
807
+ /** Application identifier from the execution context */
808
+ applicationId: string;
809
+ }
810
+ /**
811
+ * Policy for `z_file({ multiple: true })` fields.
812
+ *
813
+ * Controls the intermediary subfolder name and individual file naming
814
+ * when several files live under the same instance folder.
815
+ */
816
+ export interface FileMultipleFilePolicy {
817
+ /**
818
+ * Subfolder name under the resolved folder path.
819
+ * Defaults to the field name when omitted.
820
+ * @example 'personnas'
821
+ */
822
+ subfolder?: string;
823
+ /**
824
+ * Determines the individual file name for each upload.
825
+ *
826
+ * - `string` — template with placeholders:
827
+ * `{field}`, `{ts}`, `{uuid}`, `{ext}`, `{original}`
828
+ * - `function` — full control, receives context + file-level info
829
+ *
830
+ * @default '{field}_{ts}_{uuid}.{ext}'
831
+ */
832
+ fileNameTemplate?: string | ((context: FilePathBindingContext, fileInfo: {
833
+ fileId: string;
834
+ fieldName: string;
835
+ originalFileName?: string;
836
+ }) => string);
837
+ }
838
+ /**
839
+ * File path binding configuration authored on `z_file()`.
840
+ *
841
+ * Declares how files for a given field are located in path-based
842
+ * storage backends. The binding is backend-agnostic: it affects the
843
+ * S3 key prefix for managed storage and the filesystem path for
844
+ * local-directory storage alike.
845
+ *
846
+ * ## Path composition
847
+ *
848
+ * ```
849
+ * <provider root>/
850
+ * [applicationId/] ← only if includeApplicationId is true
851
+ * [folderPath(ctx)/] ← dynamic folder path
852
+ * <fileName(ctx) | fileId> ← explicit name or UUID fallback
853
+ * ```
854
+ *
855
+ * When nothing is configured, the fallback is the legacy `{fileId}` key
856
+ * for full backward compatibility.
857
+ *
858
+ * @example
859
+ * ```typescript
860
+ * z_file({
861
+ * filePathBinding: {
862
+ * folderPath: (ctx) => `specs/icps/${ctx.relatedObject?.name}`,
863
+ * fileName: 'personna.md',
864
+ * },
865
+ * })
866
+ * ```
867
+ *
868
+ * @example
869
+ * ```typescript
870
+ * z_file({
871
+ * multiple: true,
872
+ * filePathBinding: {
873
+ * folderPath: (ctx) => `specs/icps/${ctx.relatedObject?.name}`,
874
+ * multipleFilePolicy: {
875
+ * subfolder: 'personnas',
876
+ * fileNameTemplate: '{field}_{ts}_{uuid}.{ext}',
877
+ * },
878
+ * },
879
+ * })
880
+ * ```
881
+ */
882
+ export interface FilePathBinding {
883
+ /**
884
+ * Determines the folder path relative to the provider's root.
885
+ *
886
+ * - `string` — static path, forward-slash separated.
887
+ * - `function` — receives the binding context and returns the path.
888
+ * The function has access to the related resource object, file metadata,
889
+ * and the applicationId.
890
+ *
891
+ * Forward-slash separated, no leading or trailing slash.
892
+ * @example 'specs/icps'
893
+ * @example (ctx) => `specs/icps/${slugify(ctx.relatedObject?.name)}`
894
+ */
895
+ folderPath?: string | ((context: FilePathBindingContext) => string);
896
+ /**
897
+ * File name for single `z_file()` fields (non-multiple).
898
+ * When omitted, falls back to the fileId (UUID-based, legacy behavior).
899
+ *
900
+ * - `string` — static name; can include `{ext}` placeholder.
901
+ * - `function` — receives binding context and returns the file name.
902
+ *
903
+ * @example 'personna.md'
904
+ * @example 'avatar.{ext}'
905
+ * @example (ctx) => `${ctx.relatedObject?.slug}.md`
906
+ */
907
+ fileName?: string | ((context: FilePathBindingContext) => string);
908
+ /**
909
+ * Naming policy for `z_file({ multiple: true })` fields.
910
+ * Controls the intermediary subfolder and individual file naming.
911
+ */
912
+ multipleFilePolicy?: FileMultipleFilePolicy;
913
+ /**
914
+ * Whether to include the applicationId as a path segment.
915
+ *
916
+ * Each provider has its own default:
917
+ * - `wildo_managed` (S3) → `true` (always, for bucket isolation)
918
+ * - `local_directory` → `false` (volume is typically per-app)
919
+ *
920
+ * Set explicitly to override the provider default.
921
+ */
922
+ includeApplicationId?: boolean;
923
+ }
924
+ export declare enum FileUploaderEntityType {
925
+ USER = "user",
926
+ ANONYMOUS_USER = "anonymous_user",
927
+ ORGANIZATION_API_KEY = "organization_api_key",
928
+ APPLICATION_API_KEY = "application_api_key"
929
+ }
930
+ export type FileUploaderOwnership = {
931
+ uploadedBy: string;
932
+ uploadedByEntityType: FileUploaderEntityType;
933
+ } | {
934
+ uploadedBy?: undefined;
935
+ uploadedByEntityType?: undefined;
936
+ };
937
+ /**
938
+ * Image format options for file validation.
939
+ */
940
+ export declare const ImageFormat: {
941
+ readonly JPEG: "jpeg";
942
+ readonly PNG: "png";
943
+ readonly GIF: "gif";
944
+ readonly WEBP: "webp";
945
+ readonly SVG: "svg";
946
+ };
947
+ export type ImageFormat = typeof ImageFormat[keyof typeof ImageFormat];
948
+ /**
949
+ * Video format options for file validation.
950
+ */
951
+ export declare const VideoFormat: {
952
+ readonly MP4: "mp4";
953
+ readonly WEBM: "webm";
954
+ readonly MOV: "mov";
955
+ };
956
+ export type VideoFormat = typeof VideoFormat[keyof typeof VideoFormat];
957
+ /**
958
+ * Audio format options for file validation.
959
+ */
960
+ export declare const AudioFormat: {
961
+ readonly MP3: "mp3";
962
+ readonly WAV: "wav";
963
+ readonly OGG: "ogg";
964
+ readonly AAC: "aac";
965
+ };
966
+ export type AudioFormat = typeof AudioFormat[keyof typeof AudioFormat];
967
+ /**
968
+ * Image-specific constraints for file validation.
969
+ */
970
+ export interface FileNatureConstraints_Image {
971
+ minWidth?: number;
972
+ maxWidth?: number;
973
+ minHeight?: number;
974
+ maxHeight?: number;
975
+ aspectRatio?: {
976
+ width: number;
977
+ height: number;
978
+ };
979
+ allowedFormats?: ImageFormat[];
980
+ generateThumbnails?: boolean | {
981
+ sizes: {
982
+ width: number;
983
+ height: number;
984
+ }[];
985
+ };
986
+ }
987
+ /**
988
+ * Video-specific constraints for file validation.
989
+ */
990
+ export interface FileNatureConstraints_Video {
991
+ maxDuration?: number;
992
+ minDuration?: number;
993
+ allowedFormats?: VideoFormat[];
994
+ generateThumbnail?: boolean;
995
+ }
996
+ /**
997
+ * Audio-specific constraints for file validation.
998
+ */
999
+ export interface FileNatureConstraints_Audio {
1000
+ maxDuration?: number;
1001
+ minDuration?: number;
1002
+ allowedFormats?: AudioFormat[];
1003
+ }
1004
+ /**
1005
+ * Document-specific constraints for file validation.
1006
+ */
1007
+ export interface FileNatureConstraints_Document {
1008
+ maxPages?: number;
1009
+ minPages?: number;
1010
+ }
1011
+ /**
1012
+ * RAG chunking strategy options for file content indexing.
1013
+ */
1014
+ export declare const RAGChunkingStrategy: {
1015
+ readonly FIXED_SIZE: "fixed_size";
1016
+ readonly RECURSIVE: "recursive";
1017
+ readonly SEMANTIC: "semantic";
1018
+ readonly MARKDOWN: "markdown";
1019
+ };
1020
+ export type RAGChunkingStrategy = typeof RAGChunkingStrategy[keyof typeof RAGChunkingStrategy];
1021
+ /**
1022
+ * RAG configuration for file content indexing.
1023
+ */
1024
+ export interface FileRAGConfiguration {
1025
+ enabled: boolean;
1026
+ extractText?: boolean;
1027
+ chunkingStrategy?: RAGChunkingStrategy;
1028
+ chunkSize?: number;
1029
+ chunkOverlap?: number;
1030
+ }
1031
+ /**
1032
+ * File metadata returned by the getMetadata endpoint.
1033
+ * This describes the uploaded file's properties.
1034
+ */
1035
+ export type FileMetadata = {
1036
+ /** Unique file identifier */
1037
+ fileId: string;
1038
+ /** Original filename */
1039
+ filename: string;
1040
+ /** File size in bytes */
1041
+ size: number;
1042
+ /** MIME type */
1043
+ mimeType: string;
1044
+ /** File extension (without dot) */
1045
+ extension?: string;
1046
+ /** File checksum/hash for integrity */
1047
+ checksum?: string;
1048
+ /** URL to access/download the file */
1049
+ url?: string;
1050
+ /** URL to thumbnail (for images/videos) */
1051
+ thumbnailUrl?: string;
1052
+ /** Display nature category (image, video, audio, document, generic) */
1053
+ nature?: FileDisplayNature;
1054
+ /** Image width in pixels (for images) */
1055
+ width?: number;
1056
+ /** Image height in pixels (for images) */
1057
+ height?: number;
1058
+ /** Duration in seconds (for video/audio) */
1059
+ duration?: number;
1060
+ /** Page count (for documents) */
1061
+ pageCount?: number;
1062
+ /** Upload timestamp */
1063
+ uploadedAt: Date;
1064
+ } & FileUploaderOwnership;
1065
+ /**
1066
+ * File behavior when parent resource is deleted.
1067
+ * - CASCADE: Mark the file deleted as part of parent removal; physical storage cleanup is deferred to the cleanup batch
1068
+ * - SOFT_DELETE: Same current runtime behavior as CASCADE, but keeps an explicit semantic marker for consumers that want to model softer intent
1069
+ * - ORPHAN: Keep file, remove association with parent
1070
+ */
1071
+ export declare const FileOnParentDelete: {
1072
+ readonly CASCADE: "cascade";
1073
+ readonly SOFT_DELETE: "soft-delete";
1074
+ readonly ORPHAN: "orphan";
1075
+ };
1076
+ export type FileOnParentDelete = typeof FileOnParentDelete[keyof typeof FileOnParentDelete];
1077
+ /**
1078
+ * Metadata stored on file schemas for detection and configuration.
1079
+ * File schemas represent file references with upload capabilities.
1080
+ * Structure (single): { fileId: string, updatedAt: Date }
1081
+ * Structure (multiple): { fileIds: string[], updatedAt: Date }
1082
+ */
1083
+ export interface FileSchemaMetadata {
1084
+ /** Marker for detecting file schemas */
1085
+ isFile: true;
1086
+ /** Whether existing files can be replaced/overridden (default: true) */
1087
+ overridable?: boolean;
1088
+ /** Allowed MIME types (if empty, all types are allowed) */
1089
+ allowedMimeTypes?: string[];
1090
+ /** Maximum file size in bytes */
1091
+ maxSize?: number;
1092
+ /** Minimum file size in bytes */
1093
+ minSize?: number;
1094
+ /** Whether multiple files can be uploaded (default: false) */
1095
+ multiple?: boolean;
1096
+ /** Maximum number of files (when multiple is true) */
1097
+ maxFiles?: number;
1098
+ /** File nature classification */
1099
+ nature?: FileNature;
1100
+ /** Storage providers accepted for file uploads */
1101
+ storageAccepted?: FileStorageAccepted[];
1102
+ /** File path binding for structured storage organization */
1103
+ filePathBinding?: FilePathBinding;
1104
+ /** Image-specific constraints */
1105
+ imageConstraints?: FileNatureConstraints_Image;
1106
+ /** Video-specific constraints */
1107
+ videoConstraints?: FileNatureConstraints_Video;
1108
+ /** Audio-specific constraints */
1109
+ audioConstraints?: FileNatureConstraints_Audio;
1110
+ /** Document-specific constraints */
1111
+ documentConstraints?: FileNatureConstraints_Document;
1112
+ /** RAG configuration */
1113
+ rag?: FileRAGConfiguration;
1114
+ /**
1115
+ * Antivirus scan policy for this file field.
1116
+ * - 'required': always scan after upload, regardless of global config
1117
+ * - 'skip': never scan this field, even if global scanning is enabled
1118
+ * - undefined: inherit from `appConfig.files.scanning.enabled`
1119
+ */
1120
+ scanPolicy?: 'required' | 'skip';
1121
+ /** Behavior when parent resource is deleted (default: CASCADE) */
1122
+ onParentDelete?: FileOnParentDelete;
1123
+ /**
1124
+ * Whether this file field supports public sharing via consumable tokens.
1125
+ * When true, the `POST /files/:fileId/share` endpoint will generate a
1126
+ * `FILE_PUBLIC_ACCESS` consumable token for this file.
1127
+ * @default false
1128
+ */
1129
+ sharable?: boolean;
1130
+ /**
1131
+ * Default sharing configuration when `sharable` is true.
1132
+ * Controls token duration and max uses for shared links.
1133
+ */
1134
+ sharableDefaults?: {
1135
+ /** Default expiration for share tokens */
1136
+ expiresIn?: ExpiresInDuration;
1137
+ /** Default max uses for share tokens (BOUNDED_REUSE) */
1138
+ maxUses?: number;
1139
+ /** Default consumption mode. Defaults to BOUNDED_REUSE if not specified. */
1140
+ consumptionMode?: 'SINGLE_USE' | 'BOUNDED_REUSE';
1141
+ };
1142
+ }
1143
+ /**
1144
+ * Options for creating a file schema.
1145
+ */
1146
+ export interface FileSchemaOptions {
1147
+ /** Whether existing files can be replaced/overridden (default: true) */
1148
+ overridable?: boolean;
1149
+ /** Allowed MIME types - can be array of MIME types or group names */
1150
+ allowedMimeTypes?: string[] | FileMimeTypeGroup | FileMimeTypeGroup[];
1151
+ /** Maximum file size in bytes */
1152
+ maxSize?: number;
1153
+ /** Minimum file size in bytes */
1154
+ minSize?: number;
1155
+ /** Whether multiple files can be uploaded (default: false) */
1156
+ multiple?: boolean;
1157
+ /** Maximum number of files (when multiple is true) */
1158
+ maxFiles?: number;
1159
+ /** File nature classification */
1160
+ nature?: FileNature;
1161
+ /** Storage providers accepted for file uploads */
1162
+ storageAccepted?: FileStorageAccepted[];
1163
+ /** File path binding for structured storage organization */
1164
+ filePathBinding?: FilePathBinding;
1165
+ /** Image-specific constraints */
1166
+ imageConstraints?: FileNatureConstraints_Image;
1167
+ /** Video-specific constraints */
1168
+ videoConstraints?: FileNatureConstraints_Video;
1169
+ /** Audio-specific constraints */
1170
+ audioConstraints?: FileNatureConstraints_Audio;
1171
+ /** Document-specific constraints */
1172
+ documentConstraints?: FileNatureConstraints_Document;
1173
+ /** RAG configuration */
1174
+ rag?: FileRAGConfiguration;
1175
+ /**
1176
+ * Antivirus scan policy for this file field.
1177
+ * - 'required': always scan after upload, regardless of global config
1178
+ * - 'skip': never scan this field, even if global scanning is enabled
1179
+ * - undefined: inherit from `appConfig.files.scanning.enabled`
1180
+ */
1181
+ scanPolicy?: 'required' | 'skip';
1182
+ /** Behavior when parent resource is deleted (default: CASCADE) */
1183
+ onParentDelete?: FileOnParentDelete;
1184
+ /**
1185
+ * Whether this file field supports public sharing via consumable tokens.
1186
+ * When true, the `POST /files/:fileId/share` endpoint will generate a
1187
+ * `FILE_PUBLIC_ACCESS` consumable token for this file.
1188
+ * @default false
1189
+ */
1190
+ sharable?: boolean;
1191
+ /**
1192
+ * Default sharing configuration when `sharable` is true.
1193
+ * Controls token duration and max uses for shared links.
1194
+ */
1195
+ sharableDefaults?: {
1196
+ /** Default expiration for share tokens */
1197
+ expiresIn?: ExpiresInDuration;
1198
+ /** Default max uses for share tokens (BOUNDED_REUSE) */
1199
+ maxUses?: number;
1200
+ /** Default consumption mode. Defaults to BOUNDED_REUSE if not specified. */
1201
+ consumptionMode?: 'SINGLE_USE' | 'BOUNDED_REUSE';
1202
+ };
1203
+ }
1204
+ /**
1205
+ * File field endpoint URLs for file operations.
1206
+ * These are passed to the form field component.
1207
+ */
1208
+ export interface FileFieldEndpoints {
1209
+ /** URL to get file metadata */
1210
+ getMetadata: string;
1211
+ /** URL to upload a new file. Omitted when the field is intentionally read-only or fail-closed. */
1212
+ upload?: string;
1213
+ /** URL to override/replace an existing file (optional, uses upload if not provided) */
1214
+ override?: string;
1215
+ /** URL to delete a file (optional) */
1216
+ delete?: string;
1217
+ }
1218
+ /**
1219
+ * Metadata stored on versioned schemas for detection and configuration.
1220
+ * Versioned schemas automatically track version history.
1221
+ */
1222
+ export interface VersionedSchemaMetadata {
1223
+ /** Marker for detecting versioned schemas */
1224
+ isVersioned: true;
1225
+ /** Initial version number for new records (default: 1) */
1226
+ initialVersion?: number;
1227
+ }
1228
+ /**
1229
+ * Metadata stored on versioned foreign key schemas for detection and configuration.
1230
+ * Versioned foreign keys reference versioned resources.
1231
+ */
1232
+ export interface VersionedForeignKeySchemaMetadata {
1233
+ /** Marker for detecting versioned foreign key schemas */
1234
+ isVersionedForeignKey: true;
1235
+ /** The name of the target resource this foreign key references */
1236
+ targetResource?: string;
1237
+ }
1238
+ export interface HiddenFieldParams {
1239
+ display?: boolean;
1240
+ edit?: boolean;
1241
+ operations?: string[];
1242
+ }
1243
+ export interface NotEditableFieldParams {
1244
+ operations?: string[];
1245
+ }
1246
+ /**
1247
+ * Inline edit mode options
1248
+ */
1249
+ export declare const InlineEditMode: {
1250
+ readonly DIRECT: "direct";
1251
+ readonly BUTTON: "button";
1252
+ };
1253
+ export type InlineEditMode = typeof InlineEditMode[keyof typeof InlineEditMode];
1254
+ /**
1255
+ * P10: When to trigger save in inline editing mode
1256
+ */
1257
+ export declare const InlineEditSaveOn: {
1258
+ /** Save on blur (when user clicks away) */
1259
+ readonly BLUR: "blur";
1260
+ /** Save only on explicit button click */
1261
+ readonly EXPLICIT: "explicit";
1262
+ };
1263
+ export type InlineEditSaveOn = typeof InlineEditSaveOn[keyof typeof InlineEditSaveOn];
1264
+ /**
1265
+ * Parameters for the isBackendOnly decorator.
1266
+ * Marks fields that should only exist on the backend and be stripped from API responses.
1267
+ */
1268
+ export interface BackendOnlyFieldParams {
1269
+ /**
1270
+ * If true, the field will be included in the response for CREATE operations only,
1271
+ * then stripped from all subsequent READ operations.
1272
+ * Useful for secrets, API keys, etc. that should only be returned once.
1273
+ */
1274
+ isReturnedAtCreation?: boolean;
1275
+ /**
1276
+ * If true, access to this field will be logged for audit purposes.
1277
+ * Useful for sensitive data that needs audit trail.
1278
+ */
1279
+ auditAccess?: boolean;
1280
+ }
1281
+ /**
1282
+ * Parameters passed to virtual field calculation functions.
1283
+ * The `utils` is typed as `any` in shared-lib but will be properly typed at runtime in backend-lib.
1284
+ */
1285
+ export interface VirtualFieldCalculationParams<TObject = any, TContext = any, TUserContext = any> {
1286
+ /** The current resource object */
1287
+ currentObject: TObject;
1288
+ /** The resource context (parent/child relationships) - only if needsObjectContext is true */
1289
+ objectContext?: TContext;
1290
+ /** The user context - only if needsUserContext is true */
1291
+ userContext?: TUserContext;
1292
+ /** The execution context containing user, organization, etc. */
1293
+ executionContext: any;
1294
+ /**
1295
+ * Utility services for calculations.
1296
+ * Typed as `any` in shared-lib, but at runtime provides:
1297
+ * - repositories: RepositoryRegistry
1298
+ * - logger: LoggerService
1299
+ * - errorBuilder: ErrorBuilderBackendService
1300
+ * - dateService: DateService
1301
+ * - getService: <T>(symbol: symbol) => T
1302
+ */
1303
+ utils: any;
1304
+ }
1305
+ /**
1306
+ * Parameters for the isVirtual decorator.
1307
+ * Virtual fields are computed at runtime and not stored in the database.
1308
+ */
1309
+ export interface VirtualFieldParams<TObject = any, TResult = any> {
1310
+ /**
1311
+ * The calculation function that computes this virtual field's value.
1312
+ * Called at runtime by VirtualFieldsBackendService with injected utilities.
1313
+ */
1314
+ calculate: (params: VirtualFieldCalculationParams<TObject>) => TResult | Promise<TResult>;
1315
+ /**
1316
+ * If true, the objectContext (parent/child relationships) will be passed to calculate().
1317
+ * Setting this to true has a performance cost as it requires fetching related resources.
1318
+ */
1319
+ needsObjectContext?: boolean;
1320
+ /**
1321
+ * If true, the userContext will be passed to calculate().
1322
+ * Setting this to true requires additional context resolution.
1323
+ */
1324
+ needsUserContext?: boolean;
1325
+ /**
1326
+ * Optional list of field names this virtual field depends on.
1327
+ * Used for documentation and potential future optimizations.
1328
+ */
1329
+ dependencies?: string[];
1330
+ }
1331
+ /**
1332
+ * Parameters for the isDiscriminator decorator.
1333
+ * Marks a field as the discriminator for a discriminated union schema.
1334
+ */
1335
+ export interface DiscriminatorFieldParams {
1336
+ /**
1337
+ * Values for which the base schema is used (no extended variant).
1338
+ * If not provided, auto-detected from enum values not covered by variants.
1339
+ */
1340
+ baseValues?: string[];
1341
+ }
1342
+ /**
1343
+ * Scope for unique constraint enforcement.
1344
+ * - 'global': Unique across the entire collection (default)
1345
+ * - 'organization': Unique within an organization (compound index with organizationId)
1346
+ * - 'user': Unique per user (compound index with createdByUserId)
1347
+ */
1348
+ export declare const UniqueScope: {
1349
+ readonly GLOBAL: "global";
1350
+ readonly ORGANIZATION: "organization";
1351
+ readonly USER: "user";
1352
+ };
1353
+ export type UniqueScope = typeof UniqueScope[keyof typeof UniqueScope];
1354
+ /**
1355
+ * Parameters for the isUnique decorator.
1356
+ * Marks a field as unique in the database with unique index.
1357
+ * MongoDB will enforce uniqueness and throw E11000 duplicate key error on violations.
1358
+ */
1359
+ export interface UniqueFieldParams {
1360
+ /**
1361
+ * Scope for uniqueness constraint.
1362
+ * - 'global': Unique across the entire collection (default)
1363
+ * - 'organization': Unique per organization (compound index with organizationId)
1364
+ * - 'user': Unique per user (compound index with createdByUserId)
1365
+ */
1366
+ scope?: UniqueScope;
1367
+ /**
1368
+ * Create a compound unique index with another field in the same schema.
1369
+ * The referenced field name is resolved against the actual schema fields,
1370
+ * handling polymorphic field renames automatically.
1371
+ *
1372
+ * @example poolKey: z.string().isUnique({ compoundWith: 'billingAccountId' })
1373
+ * // Creates compound unique index: { billingAccountId: 1, poolKey: 1 }
1374
+ * // For polymorphic variants, resolves e.g. to: { organizationBillingAccountId: 1, poolKey: 1 }
1375
+ */
1376
+ compoundWith?: string;
1377
+ /**
1378
+ * Whether to allow null values without triggering uniqueness.
1379
+ * MongoDB unique indexes exclude null by default when sparse is true.
1380
+ * @default true
1381
+ */
1382
+ sparse?: boolean;
1383
+ /**
1384
+ * Custom error message to show when uniqueness is violated.
1385
+ * Supports placeholder {fieldName} which is replaced with the actual field name.
1386
+ * @example "This {fieldName} is already taken"
1387
+ */
1388
+ errorMessage?: string;
1389
+ }
1390
+ /**
1391
+ * Parameters for the ttl decorator.
1392
+ * Marks a Date field for TTL (Time To Live) expiration in MongoDB.
1393
+ * MongoDB will automatically delete documents when the TTL expires.
1394
+ *
1395
+ * @example
1396
+ * createdAt: z.date().ttl({ expireAfterSeconds: 3600 }) // Expire 1 hour after createdAt
1397
+ *
1398
+ * @example
1399
+ * expiresAt: z.date().ttl({ expireAfterSeconds: 0 }) // Expire at the exact date value
1400
+ */
1401
+ export interface TtlFieldParams {
1402
+ /**
1403
+ * Number of seconds after the field's date value when the document should be deleted.
1404
+ * - 0: Document expires at the exact date/time stored in the field
1405
+ * - N > 0: Document expires N seconds after the date/time stored in the field
1406
+ *
1407
+ * @example
1408
+ * // Expire documents 24 hours after createdAt
1409
+ * createdAt: z.date().ttl({ expireAfterSeconds: 86400 })
1410
+ *
1411
+ * @example
1412
+ * // Expire documents at the exact expiresAt date
1413
+ * expiresAt: z.date().ttl({ expireAfterSeconds: 0 })
1414
+ */
1415
+ expireAfterSeconds: number;
1416
+ }
1417
+ /**
1418
+ * Parameters for the isOtp decorator.
1419
+ * Configures the OTP (One-Time Password) input field behavior.
1420
+ */
1421
+ export interface OtpFieldParams {
1422
+ /**
1423
+ * Maximum length of the OTP code.
1424
+ * Determines how many input slots are rendered.
1425
+ *
1426
+ * @default 6
1427
+ *
1428
+ * @example
1429
+ * // 6-digit OTP code
1430
+ * otpCode: z.string().isOtp()
1431
+ *
1432
+ * @example
1433
+ * // 4-digit PIN
1434
+ * pin: z.string().isOtp({ maxLength: 4 })
1435
+ */
1436
+ maxLength?: number;
1437
+ }
1438
+ /**
1439
+ * Parameters for the isSummaryField decorator.
1440
+ * Controls how summary fields are handled, particularly for foreign key population.
1441
+ */
1442
+ export interface SummaryFieldParams {
1443
+ /**
1444
+ * Whether to populate this foreign key field with the related resource's summary data.
1445
+ * Only applicable when the field also has isForeignKey() decorator.
1446
+ *
1447
+ * When true:
1448
+ * - The related resource will be fetched using the resourceIdentifier naming convention
1449
+ * - Only the related resource's isSummaryField fields will be included
1450
+ * - The populated data is optional (null if the related resource doesn't exist)
1451
+ *
1452
+ * @default false
1453
+ *
1454
+ * @example
1455
+ * // Field definition:
1456
+ * userId: z.string().isForeignKey().isSummaryField({ populate: true })
1457
+ *
1458
+ * // LIST/SEARCH response will include:
1459
+ * {
1460
+ * _id: "123",
1461
+ * userId: "user-456",
1462
+ * user: { _id: "user-456", email: "...", displayName: "..." } // populated summary
1463
+ * }
1464
+ */
1465
+ populate?: boolean;
1466
+ }
1467
+ /**
1468
+ * Validation mode for form fields.
1469
+ * Configures when field validation is triggered.
1470
+ * - ON_CHANGE: Validate on every change (with debounce for text fields)
1471
+ * - ON_BLUR: Validate when field loses focus (default for text fields)
1472
+ * - ON_TOUCHED: Validate on blur initially, then on every change once touched
1473
+ * - ON_SUBMIT: Validate only on form submission
1474
+ */
1475
+ export declare enum ValidationMode {
1476
+ ON_CHANGE = "onChange",
1477
+ ON_BLUR = "onBlur",
1478
+ ON_TOUCHED = "onTouched",
1479
+ ON_SUBMIT = "onSubmit"
1480
+ }
1481
+ /**
1482
+ * Trigger mechanism for autosave.
1483
+ * - DEBOUNCE: Save after a delay following the last change
1484
+ * - BLUR: Save when field loses focus
1485
+ * - NONE: Disable autosave for this field
1486
+ */
1487
+ export declare enum AutosaveTrigger {
1488
+ DEBOUNCE = "debounce",
1489
+ BLUR = "blur",
1490
+ NONE = "none"
1491
+ }
1492
+ export interface AutosaveFieldParams {
1493
+ /**
1494
+ * Whether autosave is enabled for this field.
1495
+ * @default true
1496
+ */
1497
+ enabled?: boolean;
1498
+ /**
1499
+ * Trigger mechanism for autosave.
1500
+ * - AutosaveTrigger.DEBOUNCE: Save after a delay following the last change
1501
+ * - AutosaveTrigger.BLUR: Save when field loses focus
1502
+ * - AutosaveTrigger.NONE: Disable autosave for this field
1503
+ * @default AutosaveTrigger.DEBOUNCE
1504
+ */
1505
+ trigger?: AutosaveTrigger;
1506
+ /**
1507
+ * Debounce delay in milliseconds (only for DEBOUNCE trigger).
1508
+ * @default 500
1509
+ */
1510
+ debounceMs?: number;
1511
+ }
1512
+ /**
1513
+ * FIX-P5-H1: Operator for showWhen condition comparison.
1514
+ * - EQUALS: Field value equals the specified value
1515
+ * - NOT_EQUALS: Field value does not equal the specified value
1516
+ * - IN: Field value is in the specified array
1517
+ * - NOT_IN: Field value is not in the specified array
1518
+ * - EXISTS: Field value exists (is defined and not null)
1519
+ * - NOT_EXISTS: Field value does not exist (undefined or null)
1520
+ */
1521
+ export declare enum ShowWhenOperator {
1522
+ EQUALS = "equals",
1523
+ NOT_EQUALS = "notEquals",
1524
+ IN = "in",
1525
+ NOT_IN = "notIn",
1526
+ EXISTS = "exists",
1527
+ NOT_EXISTS = "notExists"
1528
+ }
1529
+ /**
1530
+ * FIX-P5-H1: A single condition for showWhen decorator.
1531
+ * The field is visible when this condition is satisfied.
1532
+ */
1533
+ export interface ShowWhenCondition {
1534
+ /** Field name to watch for changes */
1535
+ field: string;
1536
+ /**
1537
+ * Value(s) that satisfy the condition.
1538
+ * For EQUALS/NOT_EQUALS: single value or array
1539
+ * For IN/NOT_IN: array of values
1540
+ * For EXISTS/NOT_EXISTS: ignored
1541
+ */
1542
+ value?: unknown | unknown[];
1543
+ /**
1544
+ * Comparison operator.
1545
+ * @default ShowWhenOperator.EQUALS
1546
+ */
1547
+ operator?: ShowWhenOperator;
1548
+ }
1549
+ /**
1550
+ * FIX-P5-H1: Parameters for the showWhen decorator.
1551
+ * Configures conditional visibility for form fields.
1552
+ *
1553
+ * @example
1554
+ * ```ts
1555
+ * // Show when 'type' field equals 'advanced'
1556
+ * advancedOption: z.string().showWhen({
1557
+ * conditions: { field: 'type', value: 'advanced' }
1558
+ * })
1559
+ *
1560
+ * // Show when 'type' is one of multiple values
1561
+ * featureOption: z.string().showWhen({
1562
+ * conditions: { field: 'type', value: ['pro', 'enterprise'], operator: 'in' }
1563
+ * })
1564
+ *
1565
+ * // Show when both conditions are met
1566
+ * premiumFeature: z.string().showWhen({
1567
+ * conditions: [
1568
+ * { field: 'type', value: 'enterprise' },
1569
+ * { field: 'hasPremium', value: true }
1570
+ * ],
1571
+ * combineWith: 'and'
1572
+ * })
1573
+ * ```
1574
+ */
1575
+ export interface ShowWhenParams {
1576
+ /**
1577
+ * Condition(s) that control visibility.
1578
+ * Can be a single condition or array of conditions.
1579
+ */
1580
+ conditions: ShowWhenCondition | ShowWhenCondition[];
1581
+ /**
1582
+ * How to combine multiple conditions.
1583
+ * - 'and': All conditions must be true (default)
1584
+ * - 'or': Any condition must be true
1585
+ * @default 'and'
1586
+ */
1587
+ combineWith?: 'and' | 'or';
1588
+ }
1589
+ /**
1590
+ * Parameters for the isDraftable decorator.
1591
+ * Configures draft mode behavior at the schema level.
1592
+ */
1593
+ export interface DraftableConfigParams {
1594
+ /**
1595
+ * Field name that indicates draft status (discriminator).
1596
+ * @example 'status'
1597
+ */
1598
+ discriminator: string;
1599
+ /**
1600
+ * Value of the discriminator field that indicates draft mode.
1601
+ * @example 'DRAFT'
1602
+ */
1603
+ draftValue: string;
1604
+ /**
1605
+ * Value of the discriminator field that indicates published status.
1606
+ * If not provided, publishing will remove the discriminator field.
1607
+ * @example 'PUBLISHED'
1608
+ */
1609
+ publishedValue?: string;
1610
+ /**
1611
+ * Whether to require confirmation dialog before publishing.
1612
+ * @default false
1613
+ */
1614
+ requireConfirmationToPublish?: boolean;
1615
+ }
1616
+ /**
1617
+ * Force-hide specific chrome sub-elements in display context.
1618
+ * Display has no `error` sub-element to hide.
1619
+ */
1620
+ export interface ForceHideDisplayConfig {
1621
+ label?: boolean;
1622
+ description?: boolean;
1623
+ }
1624
+ /**
1625
+ * Force-hide specific chrome sub-elements in edit context.
1626
+ * Extends display with `error` (form-specific).
1627
+ */
1628
+ export interface ForceHideConfig extends ForceHideDisplayConfig {
1629
+ error?: boolean;
1630
+ }
1631
+ /**
1632
+ * Custom labelling for boolean true/false values when enum presets
1633
+ * (BooleanLabellingValue) are insufficient.
1634
+ */
1635
+ export interface BooleanLabellingCustomParams {
1636
+ mode: 'custom';
1637
+ trueValue: string;
1638
+ falseValue: string;
1639
+ }
1640
+ /**
1641
+ * Display-context base params.
1642
+ * Controls chrome, inline editing, and tooltip behavior when a field is rendered in a read-only view.
1643
+ */
1644
+ export interface PrimitiveUIBaseDisplayParams {
1645
+ /** Override the display widget for this field (cross-cutting). Type-specific `displayMode` takes precedence. */
1646
+ component?: DisplayFieldComponent;
1647
+ /** Chrome layout mode for the field wrapper in display context. */
1648
+ chromeMode?: ResponsiveAware<DisplayChromeMode>;
1649
+ /** Force-hide specific chrome sub-elements in display context. Plain object = all breakpoints. */
1650
+ forceHide?: ResponsiveAware<ForceHideDisplayConfig>;
1651
+ /** Whether to show a tooltip icon in display chrome. Text comes from i18n. */
1652
+ tooltip?: boolean;
1653
+ /**
1654
+ * Opt-in for description text below the field value in display mode.
1655
+ * When true, the companion generates an i18n key for the description.
1656
+ * Absorbed from the deleted `.displayField({ showDescription })` decorator.
1657
+ */
1658
+ showDescription?: boolean;
1659
+ /**
1660
+ * Inline editing configuration. When set, the display value becomes editable in-place.
1661
+ */
1662
+ inlineEditable?: boolean | {
1663
+ mode?: InlineEditMode;
1664
+ saveOn?: InlineEditSaveOn;
1665
+ showSaveButton?: boolean;
1666
+ showCancelButton?: boolean;
1667
+ };
1668
+ }
1669
+ /**
1670
+ * Edit-context base params.
1671
+ * Controls chrome, validation, autosave, and focus behavior when a field is rendered in a form.
1672
+ */
1673
+ export interface PrimitiveUIBaseEditParams {
1674
+ /** Override the form widget for this field (cross-cutting). Type-specific `editMode` takes precedence. */
1675
+ component?: FormFieldComponent;
1676
+ /** Chrome layout mode for the field wrapper in edit context. */
1677
+ chromeMode?: ResponsiveAware<EditChromeMode>;
1678
+ /** Force-hide specific chrome sub-elements in edit context. Plain object = all breakpoints. */
1679
+ forceHide?: ResponsiveAware<ForceHideConfig>;
1680
+ /** Whether to show a tooltip icon in form chrome. Text comes from i18n. */
1681
+ tooltip?: boolean;
1682
+ /** Auto-focus this field when the form mounts. */
1683
+ autoFocus?: boolean;
1684
+ /**
1685
+ * Opt-in for description/helper text below the form input in edit mode.
1686
+ * When true, the companion generates an i18n key for the description.
1687
+ * Absorbed from the deleted `.displayField({ showDescription })` decorator.
1688
+ */
1689
+ showDescription?: boolean;
1690
+ /** When to trigger validation. Falls back to resource-level defaultValidationMode. */
1691
+ validationMode?: ValidationMode;
1692
+ /** Autosave config for this field. Falls back to resource-level defaultAutosave. */
1693
+ autosave?: AutosaveFieldParams | true;
1694
+ }
1695
+ /**
1696
+ * Top-level base for all {primitive}UI decorators.
1697
+ * Splits configuration by UI context: display (detail views), summaryOverride (cards/lists), edit (forms).
1698
+ */
1699
+ export interface PrimitiveUIBaseParams {
1700
+ /** Config for Display context (detail/read-only views). Primary display config. */
1701
+ display?: PrimitiveUIBaseDisplayParams;
1702
+ /** Config for DisplaySummary context (cards, list items, FK references). Overrides display defaults when rendering in summary. */
1703
+ summaryOverride?: PrimitiveUIBaseDisplayParams;
1704
+ /** Config for Edition context (forms). */
1705
+ edit?: PrimitiveUIBaseEditParams;
1706
+ }
1707
+ export interface BooleanUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1708
+ /** Display renderer. RAW = plain text, CHECKMARK = checkmark/cross, EDIT_LIKE = shows the edit control read-only. */
1709
+ displayMode?: BooleanDisplayMode;
1710
+ }
1711
+ export interface BooleanUIEditParams extends PrimitiveUIBaseEditParams {
1712
+ /** Edit control. TOGGLE = pill, SWITCH = iOS-style, CHECKBOX = classic, RADIO = two options. */
1713
+ editMode?: BooleanEditMode;
1714
+ }
1715
+ export interface BooleanUIParams {
1716
+ /**
1717
+ * Labels for true/false values (cross-context — applies to display and edit).
1718
+ * Use BooleanLabellingValue enum presets or BooleanLabellingCustomParams for literal labels.
1719
+ */
1720
+ labellingValue?: BooleanLabellingValue | BooleanLabellingCustomParams;
1721
+ display?: BooleanUIDisplayParams;
1722
+ summaryOverride?: BooleanUIDisplayParams;
1723
+ edit?: BooleanUIEditParams;
1724
+ }
1725
+ export interface StringUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1726
+ /** Display renderer. TEXT | TRUNCATE | MULTILINE | COLOR | LINK | EMAIL | BADGE | COPY | SECRET. */
1727
+ displayMode?: StringDisplayMode;
1728
+ /** Max characters before truncation (TRUNCATE displayMode only). */
1729
+ truncateLength?: number;
1730
+ }
1731
+ export interface StringUIEditParams extends PrimitiveUIBaseEditParams {
1732
+ /** Edit control. INPUT | TEXTAREA | COLOR | PASSWORD | OTP. */
1733
+ editMode?: StringEditMode;
1734
+ /** Number of rows for TEXTAREA editMode. */
1735
+ textareaRows?: number;
1736
+ }
1737
+ export interface StringUIParams {
1738
+ display?: StringUIDisplayParams;
1739
+ summaryOverride?: StringUIDisplayParams;
1740
+ edit?: StringUIEditParams;
1741
+ }
1742
+ export interface NumberUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1743
+ /** Display renderer. RAW | FORMATTED | PERCENTAGE | COMPACT | ORDINAL | BYTES. */
1744
+ displayMode?: NumberDisplayMode;
1745
+ }
1746
+ export interface NumberUIEditParams extends PrimitiveUIBaseEditParams {
1747
+ /** Edit control. INPUT | SLIDER | STEPPER. */
1748
+ editMode?: NumberEditMode;
1749
+ }
1750
+ export interface NumberUIParams {
1751
+ /** Number of decimal places (cross-context). */
1752
+ decimalPlaces?: number;
1753
+ /** Whether to show trailing zeros (e.g., 1.00 vs 1). */
1754
+ trailingZeros?: boolean;
1755
+ /** Prefix string displayed before the value (e.g., "$", "€"). */
1756
+ prefix?: string;
1757
+ /** Suffix string displayed after the value (e.g., "kg", "%", "px"). */
1758
+ suffix?: string;
1759
+ /** How to interpret percentage values: NORMALIZED (0–1) or PERCENT (0–100). */
1760
+ percentageScale?: PercentageScale;
1761
+ display?: NumberUIDisplayParams;
1762
+ summaryOverride?: NumberUIDisplayParams;
1763
+ edit?: NumberUIEditParams;
1764
+ }
1765
+ export interface EnumUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1766
+ /** Display renderer. TEXT | BADGE | ICON | CARD. */
1767
+ displayMode?: EnumDisplayMode;
1768
+ }
1769
+ export interface EnumUIEditParams extends PrimitiveUIBaseEditParams {
1770
+ /** Edit control. SELECT | RADIO | RADIO_ICON_ONLY | TOGGLE | TOGGLE_ICON_ONLY | CARD | CARD_ICON_ONLY | COMBOBOX. */
1771
+ editMode?: EnumEditMode;
1772
+ /** Direction of radio/toggle/checkbox group. Renamed from `layout`. */
1773
+ editDirection?: LayoutDirection;
1774
+ /** Number of grid columns for radio/toggle/card groups. Renamed from `columns`. */
1775
+ editColumnsCount?: number;
1776
+ }
1777
+ export interface EnumUIParams {
1778
+ /** Per-value display config (cross-context — colors and icons used in both display badges and edit controls). */
1779
+ values?: Record<string, EnumValueDisplayConfig>;
1780
+ /** Default badge color when no per-value override (cross-context). */
1781
+ defaultColor?: BadgeSemanticVariant;
1782
+ /** Default icon when no per-value override (cross-context). */
1783
+ defaultIcon?: IconLike;
1784
+ display?: EnumUIDisplayParams;
1785
+ summaryOverride?: EnumUIDisplayParams;
1786
+ edit?: EnumUIEditParams;
1787
+ }
1788
+ export type DateUIDisplayParams = PrimitiveUIBaseDisplayParams;
1789
+ export type DateUIEditParams = PrimitiveUIBaseEditParams;
1790
+ export interface DateUIParams {
1791
+ display?: DateUIDisplayParams;
1792
+ summaryOverride?: DateUIDisplayParams;
1793
+ edit?: DateUIEditParams;
1794
+ }
1795
+ export type DateTimeUIDisplayParams = PrimitiveUIBaseDisplayParams;
1796
+ export type DateTimeUIEditParams = PrimitiveUIBaseEditParams;
1797
+ export interface DateTimeUIParams {
1798
+ display?: DateTimeUIDisplayParams;
1799
+ summaryOverride?: DateTimeUIDisplayParams;
1800
+ edit?: DateTimeUIEditParams;
1801
+ }
1802
+ export type TimeUIDisplayParams = PrimitiveUIBaseDisplayParams;
1803
+ export type TimeUIEditParams = PrimitiveUIBaseEditParams;
1804
+ export interface TimeUIParams {
1805
+ display?: TimeUIDisplayParams;
1806
+ summaryOverride?: TimeUIDisplayParams;
1807
+ edit?: TimeUIEditParams;
1808
+ }
1809
+ export type MoneyUIDisplayParams = PrimitiveUIBaseDisplayParams;
1810
+ export interface MoneyUIEditParams extends PrimitiveUIBaseEditParams {
1811
+ /** Initial/default currency shown in the picker. Moved from z_money(). ISO 4217. */
1812
+ defaultCurrency?: AvailableCurrency;
1813
+ }
1814
+ export interface MoneyUIParams {
1815
+ display?: MoneyUIDisplayParams;
1816
+ summaryOverride?: MoneyUIDisplayParams;
1817
+ edit?: MoneyUIEditParams;
1818
+ }
1819
+ export interface CodeUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1820
+ /** Show line numbers in display context. */
1821
+ showLineNumbers?: boolean;
1822
+ }
1823
+ export interface CodeUIEditParams extends PrimitiveUIBaseEditParams {
1824
+ /** Show line numbers in editor. */
1825
+ showLineNumbers?: boolean;
1826
+ }
1827
+ export interface CodeUIParams {
1828
+ /** Enable syntax highlighting (cross-context). */
1829
+ syntaxHighlighting?: boolean;
1830
+ /** Default language for the code editor/display (cross-context). Must be in allowedLanguages (from z_code()). */
1831
+ defaultLanguage?: CodeLanguage;
1832
+ display?: CodeUIDisplayParams;
1833
+ summaryOverride?: CodeUIDisplayParams;
1834
+ edit?: CodeUIEditParams;
1835
+ }
1836
+ export type FileUIDisplayParams = PrimitiveUIBaseDisplayParams;
1837
+ export type FileUIEditParams = PrimitiveUIBaseEditParams;
1838
+ export interface FileUIParams {
1839
+ display?: FileUIDisplayParams;
1840
+ summaryOverride?: FileUIDisplayParams;
1841
+ edit?: FileUIEditParams;
1842
+ }
1843
+ export type DurationUIDisplayParams = PrimitiveUIBaseDisplayParams;
1844
+ export interface DurationUIEditParams extends PrimitiveUIBaseEditParams {
1845
+ /** Default unit shown in the picker. Must be in allowedUnits (from z_duration()). */
1846
+ defaultUnit?: DurationUnit;
1847
+ }
1848
+ export interface DurationUIParams {
1849
+ display?: DurationUIDisplayParams;
1850
+ summaryOverride?: DurationUIDisplayParams;
1851
+ edit?: DurationUIEditParams;
1852
+ }
1853
+ export type PhoneUIDisplayParams = PrimitiveUIBaseDisplayParams;
1854
+ export type PhoneUIEditParams = PrimitiveUIBaseEditParams;
1855
+ export interface PhoneUIParams {
1856
+ /**
1857
+ * Overrides factory defaultCountry for UI rendering (cross-context).
1858
+ * ISO 3166-1 alpha-2 code. Typed as string at this layer; consumers should use AvailableCountry
1859
+ * from presets-components-models for type safety.
1860
+ */
1861
+ displayCountry?: string;
1862
+ display?: PhoneUIDisplayParams;
1863
+ summaryOverride?: PhoneUIDisplayParams;
1864
+ edit?: PhoneUIEditParams;
1865
+ }
1866
+ export interface BigDecimalUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1867
+ /** Display renderer. RAW | FORMATTED | PERCENTAGE. */
1868
+ displayMode?: BigDecimalDisplayMode;
1869
+ }
1870
+ export interface BigDecimalUIEditParams extends PrimitiveUIBaseEditParams {
1871
+ /** Edit control. Only INPUT for arbitrary precision. */
1872
+ editMode?: BigDecimalEditMode;
1873
+ /** Default value shown in the editor before user interaction. Moved from bigDecimalConfig. */
1874
+ defaultValue?: string;
1875
+ }
1876
+ export interface BigDecimalUIParams {
1877
+ /** Number of decimal places (cross-context). */
1878
+ decimalPlaces?: number;
1879
+ /** Whether to show trailing zeros (e.g., 1.00 vs 1). */
1880
+ trailingZeros?: boolean;
1881
+ /** Prefix string displayed before the value (e.g., "$", "€"). */
1882
+ prefix?: string;
1883
+ /** Suffix string displayed after the value (e.g., "kg", "%", "px"). */
1884
+ suffix?: string;
1885
+ /** How to interpret percentage values: NORMALIZED (0–1) or PERCENT (0–100). */
1886
+ percentageScale?: PercentageScale;
1887
+ display?: BigDecimalUIDisplayParams;
1888
+ summaryOverride?: BigDecimalUIDisplayParams;
1889
+ edit?: BigDecimalUIEditParams;
1890
+ }
1891
+ export interface ForeignKeyUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1892
+ /** How to render the FK reference. ID | LABEL | SUMMARY. */
1893
+ mode?: ForeignKeyDisplayMode;
1894
+ /** Whether the displayed FK value is a clickable link to the referenced resource. */
1895
+ linkable?: boolean;
1896
+ /** Override the preset used to display the referenced resource summary. */
1897
+ displayPresetOverride?: string;
1898
+ }
1899
+ export type ForeignKeyUIEditParams = PrimitiveUIBaseEditParams;
1900
+ export interface ForeignKeyUIParams {
1901
+ display?: ForeignKeyUIDisplayParams;
1902
+ summaryOverride?: ForeignKeyUIDisplayParams;
1903
+ edit?: ForeignKeyUIEditParams;
1904
+ }
1905
+ export interface ArrayUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1906
+ /** Direction for rendering items in display context. */
1907
+ displayMode?: DisplayDirection;
1908
+ /** Max items shown in display (rest truncated). */
1909
+ maxItems?: number;
1910
+ }
1911
+ export interface ArrayUIEditParams extends PrimitiveUIBaseEditParams {
1912
+ /** Allow reordering via drag-and-drop in edit context. Set via `.isSortable()` convenience or directly. */
1913
+ isSortable?: boolean;
1914
+ /** Enable drag-and-drop reordering (default true when isSortable). */
1915
+ dnd?: boolean;
1916
+ /** Show up/down manual move buttons. */
1917
+ upDownIcons?: boolean;
1918
+ }
1919
+ export interface ArrayUIParams {
1920
+ display?: ArrayUIDisplayParams;
1921
+ summaryOverride?: ArrayUIDisplayParams;
1922
+ edit?: ArrayUIEditParams;
1923
+ }
1924
+ export interface ObjectUIDisplayParams extends PrimitiveUIBaseDisplayParams {
1925
+ /** Direction for rendering properties in display context. */
1926
+ displayMode?: DisplayDirection;
1927
+ /** Max properties shown in display (rest truncated). */
1928
+ maxItems?: number;
1929
+ }
1930
+ export type ObjectUIEditParams = PrimitiveUIBaseEditParams;
1931
+ export interface ObjectUIParams {
1932
+ display?: ObjectUIDisplayParams;
1933
+ summaryOverride?: ObjectUIDisplayParams;
1934
+ edit?: ObjectUIEditParams;
1935
+ }
1936
+ export declare enum ZodDecorator {
1937
+ IS_DB_INDEXED = "isDBIndexed",
1938
+ IS_FOREIGN_KEY = "isForeignKey",
1939
+ IS_HIDDEN = "isHidden",
1940
+ IS_NOT_EDITABLE = "isNotEditable",
1941
+ IS_SUMMARY_FIELD = "isSummaryField",
1942
+ IS_BACKEND_ONLY = "isBackendOnly",
1943
+ IS_VIRTUAL = "isVirtual",
1944
+ IS_DISCRIMINATOR = "isDiscriminator",
1945
+ EXCLUDE_FROM_CREATE = "excludeFromCreate",
1946
+ EXCLUDE_FROM_UPDATE = "excludeFromUpdate",
1947
+ IS_UNIQUE = "isUnique",
1948
+ IS_PRIMARY_KEY = "isPrimaryKey",
1949
+ TTL = "ttl",
1950
+ IS_PASSWORD = "isPassword",
1951
+ IS_OTP = "isOtp",
1952
+ IS_COLOR = "isColor",
1953
+ IS_DRAFT_RELAXED = "isDraftRelaxed",
1954
+ SHOW_WHEN = "showWhen",
1955
+ SYSTEM_ENUM = "systemEnum",
1956
+ IS_EPHEMERAL = "isEphemeral",
1957
+ IS_CRDT = "isCRDT",
1958
+ BOOLEAN_UI = "booleanUI",
1959
+ STRING_UI = "stringUI",
1960
+ NUMBER_UI = "numberUI",
1961
+ ENUM_UI = "enumUI",
1962
+ DATE_UI = "dateUI",
1963
+ DATETIME_UI = "dateTimeUI",
1964
+ TIME_UI = "timeUI",
1965
+ MONEY_UI = "moneyUI",
1966
+ CODE_UI = "codeUI",
1967
+ FILE_UI = "fileUI",
1968
+ DURATION_UI = "durationUI",
1969
+ PHONE_UI = "phoneUI",
1970
+ BIGDECIMAL_UI = "bigDecimalUI",
1971
+ FOREIGN_KEY_UI = "foreignKeyUI",
1972
+ ARRAY_UI = "arrayUI",
1973
+ OBJECT_UI = "objectUI"
1974
+ }
1975
+ export type ZodDecorator_ParamsType = {
1976
+ [ZodDecorator.IS_DB_INDEXED]: undefined;
1977
+ [ZodDecorator.IS_FOREIGN_KEY]: ForeignKeyStructuralParams | DecoratorUpdater<ForeignKeyStructuralParams> | undefined;
1978
+ [ZodDecorator.IS_HIDDEN]: HiddenFieldParams | DecoratorUpdater<HiddenFieldParams> | undefined;
1979
+ [ZodDecorator.IS_NOT_EDITABLE]: NotEditableFieldParams | DecoratorUpdater<NotEditableFieldParams> | undefined;
1980
+ [ZodDecorator.IS_SUMMARY_FIELD]: SummaryFieldParams | DecoratorUpdater<SummaryFieldParams> | undefined;
1981
+ [ZodDecorator.IS_BACKEND_ONLY]: BackendOnlyFieldParams | DecoratorUpdater<BackendOnlyFieldParams> | undefined;
1982
+ [ZodDecorator.IS_VIRTUAL]: VirtualFieldParams | DecoratorUpdater<VirtualFieldParams>;
1983
+ [ZodDecorator.IS_DISCRIMINATOR]: DiscriminatorFieldParams | DecoratorUpdater<DiscriminatorFieldParams> | undefined;
1984
+ [ZodDecorator.EXCLUDE_FROM_CREATE]: undefined;
1985
+ [ZodDecorator.EXCLUDE_FROM_UPDATE]: undefined;
1986
+ [ZodDecorator.IS_UNIQUE]: UniqueFieldParams | DecoratorUpdater<UniqueFieldParams> | undefined;
1987
+ [ZodDecorator.IS_PRIMARY_KEY]: undefined;
1988
+ [ZodDecorator.TTL]: TtlFieldParams | DecoratorUpdater<TtlFieldParams>;
1989
+ [ZodDecorator.IS_PASSWORD]: undefined;
1990
+ [ZodDecorator.IS_OTP]: OtpFieldParams | DecoratorUpdater<OtpFieldParams> | undefined;
1991
+ [ZodDecorator.IS_COLOR]: undefined;
1992
+ [ZodDecorator.IS_DRAFT_RELAXED]: undefined;
1993
+ [ZodDecorator.SHOW_WHEN]: ShowWhenParams | DecoratorUpdater<ShowWhenParams>;
1994
+ [ZodDecorator.SYSTEM_ENUM]: string;
1995
+ [ZodDecorator.IS_EPHEMERAL]: undefined;
1996
+ [ZodDecorator.IS_CRDT]: undefined;
1997
+ [ZodDecorator.BOOLEAN_UI]: BooleanUIParams | DecoratorUpdater<BooleanUIParams> | undefined;
1998
+ [ZodDecorator.STRING_UI]: StringUIParams | DecoratorUpdater<StringUIParams> | undefined;
1999
+ [ZodDecorator.NUMBER_UI]: NumberUIParams | DecoratorUpdater<NumberUIParams> | undefined;
2000
+ [ZodDecorator.ENUM_UI]: EnumUIParams | DecoratorUpdater<EnumUIParams> | undefined;
2001
+ [ZodDecorator.DATE_UI]: DateUIParams | DecoratorUpdater<DateUIParams> | undefined;
2002
+ [ZodDecorator.DATETIME_UI]: DateTimeUIParams | DecoratorUpdater<DateTimeUIParams> | undefined;
2003
+ [ZodDecorator.TIME_UI]: TimeUIParams | DecoratorUpdater<TimeUIParams> | undefined;
2004
+ [ZodDecorator.MONEY_UI]: MoneyUIParams | DecoratorUpdater<MoneyUIParams> | undefined;
2005
+ [ZodDecorator.CODE_UI]: CodeUIParams | DecoratorUpdater<CodeUIParams> | undefined;
2006
+ [ZodDecorator.FILE_UI]: FileUIParams | DecoratorUpdater<FileUIParams> | undefined;
2007
+ [ZodDecorator.DURATION_UI]: DurationUIParams | DecoratorUpdater<DurationUIParams> | undefined;
2008
+ [ZodDecorator.PHONE_UI]: PhoneUIParams | DecoratorUpdater<PhoneUIParams> | undefined;
2009
+ [ZodDecorator.BIGDECIMAL_UI]: BigDecimalUIParams | DecoratorUpdater<BigDecimalUIParams> | undefined;
2010
+ [ZodDecorator.FOREIGN_KEY_UI]: ForeignKeyUIParams | DecoratorUpdater<ForeignKeyUIParams> | undefined;
2011
+ [ZodDecorator.ARRAY_UI]: ArrayUIParams | DecoratorUpdater<ArrayUIParams> | undefined;
2012
+ [ZodDecorator.OBJECT_UI]: ObjectUIParams | DecoratorUpdater<ObjectUIParams> | undefined;
2013
+ };
2014
+ export type ZodDecorator_Types = {
2015
+ [ZodDecorator.IS_DB_INDEXED]: boolean;
2016
+ [ZodDecorator.IS_FOREIGN_KEY]: ForeignKeyStructuralParams | true;
2017
+ [ZodDecorator.IS_HIDDEN]: HiddenFieldParams | true;
2018
+ [ZodDecorator.IS_NOT_EDITABLE]: NotEditableFieldParams | true;
2019
+ [ZodDecorator.IS_SUMMARY_FIELD]: SummaryFieldParams | true;
2020
+ [ZodDecorator.IS_BACKEND_ONLY]: BackendOnlyFieldParams | true;
2021
+ [ZodDecorator.IS_VIRTUAL]: VirtualFieldParams;
2022
+ [ZodDecorator.IS_DISCRIMINATOR]: DiscriminatorFieldParams | true;
2023
+ [ZodDecorator.EXCLUDE_FROM_CREATE]: true;
2024
+ [ZodDecorator.EXCLUDE_FROM_UPDATE]: true;
2025
+ [ZodDecorator.IS_UNIQUE]: UniqueFieldParams | true;
2026
+ [ZodDecorator.IS_PRIMARY_KEY]: true;
2027
+ [ZodDecorator.TTL]: TtlFieldParams;
2028
+ [ZodDecorator.IS_PASSWORD]: true;
2029
+ [ZodDecorator.IS_OTP]: OtpFieldParams | true;
2030
+ [ZodDecorator.IS_COLOR]: true;
2031
+ [ZodDecorator.IS_DRAFT_RELAXED]: true;
2032
+ [ZodDecorator.SHOW_WHEN]: ShowWhenParams;
2033
+ [ZodDecorator.SYSTEM_ENUM]: string;
2034
+ [ZodDecorator.IS_EPHEMERAL]: true;
2035
+ [ZodDecorator.IS_CRDT]: true;
2036
+ [ZodDecorator.BOOLEAN_UI]: BooleanUIParams;
2037
+ [ZodDecorator.STRING_UI]: StringUIParams;
2038
+ [ZodDecorator.NUMBER_UI]: NumberUIParams;
2039
+ [ZodDecorator.ENUM_UI]: EnumUIParams;
2040
+ [ZodDecorator.DATE_UI]: DateUIParams;
2041
+ [ZodDecorator.DATETIME_UI]: DateTimeUIParams;
2042
+ [ZodDecorator.TIME_UI]: TimeUIParams;
2043
+ [ZodDecorator.MONEY_UI]: MoneyUIParams;
2044
+ [ZodDecorator.CODE_UI]: CodeUIParams;
2045
+ [ZodDecorator.FILE_UI]: FileUIParams;
2046
+ [ZodDecorator.DURATION_UI]: DurationUIParams;
2047
+ [ZodDecorator.PHONE_UI]: PhoneUIParams;
2048
+ [ZodDecorator.BIGDECIMAL_UI]: BigDecimalUIParams;
2049
+ [ZodDecorator.FOREIGN_KEY_UI]: ForeignKeyUIParams;
2050
+ [ZodDecorator.ARRAY_UI]: ArrayUIParams;
2051
+ [ZodDecorator.OBJECT_UI]: ObjectUIParams;
2052
+ };
2053
+ export interface CustomFieldMetadata {
2054
+ [ZodDecorator.IS_DB_INDEXED]?: ZodDecorator_Types[ZodDecorator.IS_DB_INDEXED];
2055
+ [ZodDecorator.IS_FOREIGN_KEY]?: ZodDecorator_Types[ZodDecorator.IS_FOREIGN_KEY];
2056
+ [ZodDecorator.IS_HIDDEN]?: ZodDecorator_Types[ZodDecorator.IS_HIDDEN];
2057
+ [ZodDecorator.IS_NOT_EDITABLE]?: ZodDecorator_Types[ZodDecorator.IS_NOT_EDITABLE];
2058
+ [ZodDecorator.IS_SUMMARY_FIELD]?: ZodDecorator_Types[ZodDecorator.IS_SUMMARY_FIELD];
2059
+ [ZodDecorator.IS_BACKEND_ONLY]?: ZodDecorator_Types[ZodDecorator.IS_BACKEND_ONLY];
2060
+ [ZodDecorator.IS_VIRTUAL]?: ZodDecorator_Types[ZodDecorator.IS_VIRTUAL];
2061
+ [ZodDecorator.IS_DISCRIMINATOR]?: ZodDecorator_Types[ZodDecorator.IS_DISCRIMINATOR];
2062
+ [ZodDecorator.EXCLUDE_FROM_CREATE]?: ZodDecorator_Types[ZodDecorator.EXCLUDE_FROM_CREATE];
2063
+ [ZodDecorator.EXCLUDE_FROM_UPDATE]?: ZodDecorator_Types[ZodDecorator.EXCLUDE_FROM_UPDATE];
2064
+ [ZodDecorator.IS_UNIQUE]?: ZodDecorator_Types[ZodDecorator.IS_UNIQUE];
2065
+ [ZodDecorator.IS_PRIMARY_KEY]?: ZodDecorator_Types[ZodDecorator.IS_PRIMARY_KEY];
2066
+ [ZodDecorator.TTL]?: ZodDecorator_Types[ZodDecorator.TTL];
2067
+ [ZodDecorator.IS_PASSWORD]?: ZodDecorator_Types[ZodDecorator.IS_PASSWORD];
2068
+ [ZodDecorator.IS_OTP]?: ZodDecorator_Types[ZodDecorator.IS_OTP];
2069
+ [ZodDecorator.IS_COLOR]?: ZodDecorator_Types[ZodDecorator.IS_COLOR];
2070
+ [ZodDecorator.IS_DRAFT_RELAXED]?: ZodDecorator_Types[ZodDecorator.IS_DRAFT_RELAXED];
2071
+ [ZodDecorator.SHOW_WHEN]?: ZodDecorator_Types[ZodDecorator.SHOW_WHEN];
2072
+ [ZodDecorator.SYSTEM_ENUM]?: ZodDecorator_Types[ZodDecorator.SYSTEM_ENUM];
2073
+ [ZodDecorator.IS_EPHEMERAL]?: ZodDecorator_Types[ZodDecorator.IS_EPHEMERAL];
2074
+ [ZodDecorator.IS_CRDT]?: ZodDecorator_Types[ZodDecorator.IS_CRDT];
2075
+ [ZodDecorator.BOOLEAN_UI]?: ZodDecorator_Types[ZodDecorator.BOOLEAN_UI];
2076
+ [ZodDecorator.STRING_UI]?: ZodDecorator_Types[ZodDecorator.STRING_UI];
2077
+ [ZodDecorator.NUMBER_UI]?: ZodDecorator_Types[ZodDecorator.NUMBER_UI];
2078
+ [ZodDecorator.ENUM_UI]?: ZodDecorator_Types[ZodDecorator.ENUM_UI];
2079
+ [ZodDecorator.DATE_UI]?: ZodDecorator_Types[ZodDecorator.DATE_UI];
2080
+ [ZodDecorator.DATETIME_UI]?: ZodDecorator_Types[ZodDecorator.DATETIME_UI];
2081
+ [ZodDecorator.TIME_UI]?: ZodDecorator_Types[ZodDecorator.TIME_UI];
2082
+ [ZodDecorator.MONEY_UI]?: ZodDecorator_Types[ZodDecorator.MONEY_UI];
2083
+ [ZodDecorator.CODE_UI]?: ZodDecorator_Types[ZodDecorator.CODE_UI];
2084
+ [ZodDecorator.FILE_UI]?: ZodDecorator_Types[ZodDecorator.FILE_UI];
2085
+ [ZodDecorator.DURATION_UI]?: ZodDecorator_Types[ZodDecorator.DURATION_UI];
2086
+ [ZodDecorator.PHONE_UI]?: ZodDecorator_Types[ZodDecorator.PHONE_UI];
2087
+ [ZodDecorator.BIGDECIMAL_UI]?: ZodDecorator_Types[ZodDecorator.BIGDECIMAL_UI];
2088
+ [ZodDecorator.FOREIGN_KEY_UI]?: ZodDecorator_Types[ZodDecorator.FOREIGN_KEY_UI];
2089
+ [ZodDecorator.ARRAY_UI]?: ZodDecorator_Types[ZodDecorator.ARRAY_UI];
2090
+ [ZodDecorator.OBJECT_UI]?: ZodDecorator_Types[ZodDecorator.OBJECT_UI];
2091
+ /** Range schema type (only present for range schemas) */
2092
+ rangeType?: RangeType;
2093
+ /** Full range schema configuration (only present for range schemas) */
2094
+ rangeConfig?: RangeSchemaMetadata;
2095
+ /** Currency schema configuration (only present for currency schemas) */
2096
+ moneyConfig?: MoneySchemaMetadata;
2097
+ /** BigDecimal schema configuration (only present for bigdecimal schemas) */
2098
+ bigDecimalConfig?: BigDecimalSchemaMetadata;
2099
+ /** Duration schema configuration (only present for duration schemas) */
2100
+ durationConfig?: DurationSchemaMetadata;
2101
+ /** Phone schema configuration (only present for phone schemas) */
2102
+ phoneConfig?: PhoneSchemaMetadata;
2103
+ /** Code schema configuration (only present for code schemas) */
2104
+ codeConfig?: CodeSchemaMetadata;
2105
+ /** File schema configuration (only present for file schemas) */
2106
+ fileConfig?: FileSchemaMetadata;
2107
+ /** Versioned schema configuration (only present for versioned schemas) */
2108
+ versionedConfig?: VersionedSchemaMetadata;
2109
+ /** Versioned foreign key configuration (only present for versioned foreign key schemas) */
2110
+ versionedForeignKeyConfig?: VersionedForeignKeySchemaMetadata;
2111
+ }
2112
+ type ZodenumInstance = ReturnType<typeof z.enum>;
2113
+ export type PrimitiveZodType = z.ZodString | z.ZodNumber | z.ZodBoolean | z.ZodDate | z.ZodEnum<any> | ZodenumInstance | ZodBrandedColorInstance | DecoratedPrimitiveZodType<z.ZodString> | DecoratedPrimitiveZodType<z.ZodNumber> | DecoratedPrimitiveZodType<z.ZodBoolean> | DecoratedPrimitiveZodType<z.ZodDate> | DecoratedPrimitiveZodType<z.ZodEnum<any>> | DecoratedPrimitiveZodType<ZodenumInstance>;
2114
+ export type SerializableZodSchema = {
2115
+ type: 'string';
2116
+ optional?: boolean;
2117
+ nullable?: boolean;
2118
+ description?: string;
2119
+ metadata?: CustomFieldMetadata;
2120
+ } | {
2121
+ type: 'number';
2122
+ optional?: boolean;
2123
+ nullable?: boolean;
2124
+ metadata?: CustomFieldMetadata;
2125
+ } | {
2126
+ type: 'bigint';
2127
+ optional?: boolean;
2128
+ nullable?: boolean;
2129
+ metadata?: CustomFieldMetadata;
2130
+ } | {
2131
+ type: 'boolean';
2132
+ optional?: boolean;
2133
+ nullable?: boolean;
2134
+ metadata?: CustomFieldMetadata;
2135
+ } | {
2136
+ type: 'date';
2137
+ optional?: boolean;
2138
+ nullable?: boolean;
2139
+ metadata?: CustomFieldMetadata;
2140
+ } | {
2141
+ type: 'unknown' | 'any';
2142
+ optional?: boolean;
2143
+ nullable?: boolean;
2144
+ metadata?: CustomFieldMetadata;
2145
+ } | {
2146
+ type: 'literal';
2147
+ value: unknown;
2148
+ optional?: boolean;
2149
+ nullable?: boolean;
2150
+ metadata?: CustomFieldMetadata;
2151
+ } | {
2152
+ type: 'enum';
2153
+ values: string[];
2154
+ optional?: boolean;
2155
+ nullable?: boolean;
2156
+ metadata?: CustomFieldMetadata;
2157
+ } | {
2158
+ type: 'enum';
2159
+ values: string[];
2160
+ optional?: boolean;
2161
+ nullable?: boolean;
2162
+ metadata?: CustomFieldMetadata;
2163
+ } | {
2164
+ type: 'array';
2165
+ element: SerializableZodSchema;
2166
+ optional?: boolean;
2167
+ nullable?: boolean;
2168
+ metadata?: CustomFieldMetadata;
2169
+ } | {
2170
+ type: 'set';
2171
+ element: SerializableZodSchema;
2172
+ optional?: boolean;
2173
+ nullable?: boolean;
2174
+ metadata?: CustomFieldMetadata;
2175
+ } | {
2176
+ type: 'tuple';
2177
+ items: SerializableZodSchema[];
2178
+ optional?: boolean;
2179
+ nullable?: boolean;
2180
+ metadata?: CustomFieldMetadata;
2181
+ } | {
2182
+ type: 'record';
2183
+ key: SerializableZodSchema;
2184
+ value: SerializableZodSchema;
2185
+ optional?: boolean;
2186
+ nullable?: boolean;
2187
+ metadata?: CustomFieldMetadata;
2188
+ } | {
2189
+ type: 'union';
2190
+ options: SerializableZodSchema[];
2191
+ optional?: boolean;
2192
+ nullable?: boolean;
2193
+ metadata?: CustomFieldMetadata;
2194
+ } | {
2195
+ type: 'object';
2196
+ properties: Record<string, SerializableZodSchema>;
2197
+ optional?: boolean;
2198
+ nullable?: boolean;
2199
+ metadata?: CustomFieldMetadata;
2200
+ } | {
2201
+ type: 'lazy';
2202
+ optional?: boolean;
2203
+ nullable?: boolean;
2204
+ metadata?: CustomFieldMetadata;
2205
+ };
2206
+ export {};
2207
+ //# sourceMappingURL=zod-decorators.types.d.ts.map