@atscript/vue-form 0.1.58

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 (190) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -0
  3. package/dist/as-action-71f9E_bL.cjs +208 -0
  4. package/dist/as-action-DU17rykn.mjs +203 -0
  5. package/dist/as-action.cjs +2 -0
  6. package/dist/as-action.d.cts +2 -0
  7. package/dist/as-action.d.mts +2 -0
  8. package/dist/as-action.mjs +2 -0
  9. package/dist/as-action.vue-BdbAOZCL.d.cts +13 -0
  10. package/dist/as-action.vue-CmY3eil1.d.mts +13 -0
  11. package/dist/as-adornment-shell-9UmdNIPR.cjs +97 -0
  12. package/dist/as-adornment-shell-knFiB7Ct.mjs +92 -0
  13. package/dist/as-array-Bn27x9cq.cjs +466 -0
  14. package/dist/as-array-DwarTaKP.mjs +455 -0
  15. package/dist/as-array-clear-btn-DAGervXL.cjs +48 -0
  16. package/dist/as-array-clear-btn-DIhzCKC9.mjs +43 -0
  17. package/dist/as-array.cjs +11 -0
  18. package/dist/as-array.d.cts +2 -0
  19. package/dist/as-array.d.mts +2 -0
  20. package/dist/as-array.mjs +11 -0
  21. package/dist/as-array.vue-C5r_ycIa.d.mts +9 -0
  22. package/dist/as-array.vue-CeBZRVm7.d.cts +9 -0
  23. package/dist/as-checkbox-B_9mwla6.mjs +285 -0
  24. package/dist/as-checkbox-DXGTVHPE.cjs +296 -0
  25. package/dist/as-checkbox.cjs +6 -0
  26. package/dist/as-checkbox.d.cts +2 -0
  27. package/dist/as-checkbox.d.mts +2 -0
  28. package/dist/as-checkbox.mjs +6 -0
  29. package/dist/as-checkbox.vue-BL53Xjmi.d.mts +9 -0
  30. package/dist/as-checkbox.vue-Da1KVG5J.d.cts +9 -0
  31. package/dist/as-collapsible-CqxeJut7.cjs +148 -0
  32. package/dist/as-collapsible-DtNCofNT.mjs +143 -0
  33. package/dist/as-date-C7tFQDkh.mjs +253 -0
  34. package/dist/as-date-k3MW3dmA.cjs +258 -0
  35. package/dist/as-date.cjs +8 -0
  36. package/dist/as-date.d.cts +2 -0
  37. package/dist/as-date.d.mts +2 -0
  38. package/dist/as-date.mjs +8 -0
  39. package/dist/as-date.vue-C5JaS3Sd.d.mts +9 -0
  40. package/dist/as-date.vue-e2ewS_V4.d.cts +9 -0
  41. package/dist/as-datetime-C030mzI5.cjs +258 -0
  42. package/dist/as-datetime-elcOoDT5.mjs +253 -0
  43. package/dist/as-datetime.cjs +8 -0
  44. package/dist/as-datetime.d.cts +2 -0
  45. package/dist/as-datetime.d.mts +2 -0
  46. package/dist/as-datetime.mjs +8 -0
  47. package/dist/as-datetime.vue-ClsSnJSV.d.mts +9 -0
  48. package/dist/as-datetime.vue-vfHFsby6.d.cts +9 -0
  49. package/dist/as-decimal-BJIGgPXU.cjs +711 -0
  50. package/dist/as-decimal-DtXjFPhe.mjs +694 -0
  51. package/dist/as-decimal.cjs +7 -0
  52. package/dist/as-decimal.d.cts +2 -0
  53. package/dist/as-decimal.d.mts +2 -0
  54. package/dist/as-decimal.mjs +7 -0
  55. package/dist/as-decimal.vue-B1pEKdjM.d.cts +25 -0
  56. package/dist/as-decimal.vue-CSCtYRRa.d.mts +25 -0
  57. package/dist/as-field-CXVjrEPQ.mjs +481 -0
  58. package/dist/as-field-shell-B2iTn-iM.cjs +346 -0
  59. package/dist/as-field-shell-Pdy3sAvr.mjs +341 -0
  60. package/dist/as-field-shell.cjs +5 -0
  61. package/dist/as-field-shell.d.cts +2 -0
  62. package/dist/as-field-shell.d.mts +2 -0
  63. package/dist/as-field-shell.mjs +5 -0
  64. package/dist/as-field-shell.vue-Ddnp8KxY.d.mts +37 -0
  65. package/dist/as-field-shell.vue-Dmt05vGD.d.cts +37 -0
  66. package/dist/as-field-wLYoaZnT.cjs +498 -0
  67. package/dist/as-field.cjs +4 -0
  68. package/dist/as-field.d.cts +25 -0
  69. package/dist/as-field.d.mts +26 -0
  70. package/dist/as-field.mjs +4 -0
  71. package/dist/as-form-CWwgyvfw.mjs +425 -0
  72. package/dist/as-form-DAIkyt7H.cjs +448 -0
  73. package/dist/as-form.cjs +7 -0
  74. package/dist/as-form.d.cts +2 -0
  75. package/dist/as-form.d.mts +2 -0
  76. package/dist/as-form.mjs +7 -0
  77. package/dist/as-form.vue-B4Bn0pbC.d.cts +158 -0
  78. package/dist/as-form.vue-DRrb_yoj.d.mts +158 -0
  79. package/dist/as-input-CpbV2k3s.cjs +231 -0
  80. package/dist/as-input-DIa8BzLv.mjs +226 -0
  81. package/dist/as-input-control-BzELjheN.mjs +266 -0
  82. package/dist/as-input-control-C5-DelZT.cjs +271 -0
  83. package/dist/as-input.cjs +8 -0
  84. package/dist/as-input.d.cts +2 -0
  85. package/dist/as-input.d.mts +2 -0
  86. package/dist/as-input.mjs +8 -0
  87. package/dist/as-input.vue-11ldp9uT.d.cts +17 -0
  88. package/dist/as-input.vue-fUhcvfv2.d.mts +17 -0
  89. package/dist/as-iterator-BYMNe6UJ.cjs +61 -0
  90. package/dist/as-iterator-CT5y1jyn.mjs +56 -0
  91. package/dist/as-iterator.cjs +5 -0
  92. package/dist/as-iterator.d.cts +14 -0
  93. package/dist/as-iterator.d.mts +15 -0
  94. package/dist/as-iterator.mjs +5 -0
  95. package/dist/as-number-BA55JIq1.cjs +387 -0
  96. package/dist/as-number-JPEwPK8Q.mjs +376 -0
  97. package/dist/as-number.cjs +8 -0
  98. package/dist/as-number.d.cts +2 -0
  99. package/dist/as-number.d.mts +2 -0
  100. package/dist/as-number.mjs +8 -0
  101. package/dist/as-number.vue-Bk-W7Vwv.d.mts +26 -0
  102. package/dist/as-number.vue-C2Aih98s.d.cts +26 -0
  103. package/dist/as-object-CT6lNEqt.mjs +300 -0
  104. package/dist/as-object-qUL7l8V1.cjs +305 -0
  105. package/dist/as-object.cjs +11 -0
  106. package/dist/as-object.d.cts +2 -0
  107. package/dist/as-object.d.mts +2 -0
  108. package/dist/as-object.mjs +11 -0
  109. package/dist/as-object.vue-CKwMyM_F.d.cts +13 -0
  110. package/dist/as-object.vue-Cg52b61-.d.mts +13 -0
  111. package/dist/as-paragraph-BGO-j4US.cjs +203 -0
  112. package/dist/as-paragraph-jIG_dg7_.mjs +198 -0
  113. package/dist/as-paragraph.cjs +2 -0
  114. package/dist/as-paragraph.d.cts +2 -0
  115. package/dist/as-paragraph.d.mts +2 -0
  116. package/dist/as-paragraph.mjs +2 -0
  117. package/dist/as-paragraph.vue-BDt0pBG-.d.cts +9 -0
  118. package/dist/as-paragraph.vue-C3FgTEt5.d.mts +9 -0
  119. package/dist/as-radio-B1N-gmoI.mjs +242 -0
  120. package/dist/as-radio-U3OK7bTg.cjs +247 -0
  121. package/dist/as-radio.cjs +6 -0
  122. package/dist/as-radio.d.cts +2 -0
  123. package/dist/as-radio.d.mts +2 -0
  124. package/dist/as-radio.mjs +6 -0
  125. package/dist/as-radio.vue-D_fweoN1.d.mts +9 -0
  126. package/dist/as-radio.vue-ZC4kLBnT.d.cts +9 -0
  127. package/dist/as-ref-CIifSSCQ.mjs +337 -0
  128. package/dist/as-ref-SImaIrwK.cjs +342 -0
  129. package/dist/as-ref.cjs +7 -0
  130. package/dist/as-ref.d.cts +2 -0
  131. package/dist/as-ref.d.mts +2 -0
  132. package/dist/as-ref.mjs +7 -0
  133. package/dist/as-ref.vue-BNeQeQpO.d.cts +9 -0
  134. package/dist/as-ref.vue-Cr5jeNDn.d.mts +9 -0
  135. package/dist/as-select-BB3uxACS.cjs +246 -0
  136. package/dist/as-select-UBGCVhku.mjs +241 -0
  137. package/dist/as-select.cjs +6 -0
  138. package/dist/as-select.d.cts +2 -0
  139. package/dist/as-select.d.mts +2 -0
  140. package/dist/as-select.mjs +6 -0
  141. package/dist/as-select.vue-Dd7huPq2.d.cts +9 -0
  142. package/dist/as-select.vue-RYpbZbKt.d.mts +9 -0
  143. package/dist/as-time-C24rvslH.cjs +258 -0
  144. package/dist/as-time-CQsxUs8P.mjs +253 -0
  145. package/dist/as-time.cjs +8 -0
  146. package/dist/as-time.d.cts +2 -0
  147. package/dist/as-time.d.mts +2 -0
  148. package/dist/as-time.mjs +8 -0
  149. package/dist/as-time.vue-huLx2B4l.d.mts +9 -0
  150. package/dist/as-time.vue-nMEHLXke.d.cts +9 -0
  151. package/dist/as-tuple-BU--cuuI.cjs +351 -0
  152. package/dist/as-tuple-DkI9swlW.mjs +340 -0
  153. package/dist/as-tuple.cjs +11 -0
  154. package/dist/as-tuple.d.cts +2 -0
  155. package/dist/as-tuple.d.mts +2 -0
  156. package/dist/as-tuple.mjs +11 -0
  157. package/dist/as-tuple.vue-CQhzOJsn.d.mts +9 -0
  158. package/dist/as-tuple.vue-DyskCkf-.d.cts +9 -0
  159. package/dist/as-union-BGvdxr3G.mjs +351 -0
  160. package/dist/as-union-C0btoJn3.cjs +368 -0
  161. package/dist/as-union.cjs +6 -0
  162. package/dist/as-union.d.cts +2 -0
  163. package/dist/as-union.d.mts +2 -0
  164. package/dist/as-union.mjs +6 -0
  165. package/dist/as-union.vue-BjlDPZn0.d.mts +9 -0
  166. package/dist/as-union.vue-CqjU3O10.d.cts +9 -0
  167. package/dist/as-variant-picker-BVs0AvjK.mjs +96 -0
  168. package/dist/as-variant-picker-DObQZHmm.cjs +107 -0
  169. package/dist/index.cjs +173 -0
  170. package/dist/index.d.cts +966 -0
  171. package/dist/index.d.mts +966 -0
  172. package/dist/index.mjs +105 -0
  173. package/dist/types-C4HRSxgV.d.cts +233 -0
  174. package/dist/types-Czm-Gtud.d.mts +233 -0
  175. package/dist/use-as-date-B7CtcRQd.cjs +329 -0
  176. package/dist/use-as-date-C39i9mzE.mjs +318 -0
  177. package/dist/use-as-dropdown-BMnEm6jF.mjs +82 -0
  178. package/dist/use-as-dropdown-C-Qy7Vt0.cjs +105 -0
  179. package/dist/use-as-locale-BrFdAgnU.mjs +23 -0
  180. package/dist/use-as-locale-C4z5stwD.cjs +34 -0
  181. package/dist/use-as-nested-sections-store-jdMRxjBE.cjs +80 -0
  182. package/dist/use-as-nested-sections-store-lhi0z5z1.mjs +63 -0
  183. package/dist/use-as-optional-add-flow-CuXEir_i.mjs +43 -0
  184. package/dist/use-as-optional-add-flow-STOaQWo9.cjs +48 -0
  185. package/dist/use-as-value-help-CBykDEjZ.mjs +89 -0
  186. package/dist/use-as-value-help-uANI3zWa.cjs +100 -0
  187. package/dist/use-form-context-Dwr8Ai1v.cjs +207 -0
  188. package/dist/use-form-context-bAj7UoSe.mjs +106 -0
  189. package/package.json +180 -0
  190. package/styles.d.ts +2 -0
@@ -0,0 +1,966 @@
1
+ import _default$6 from "./as-field.mjs";
2
+ import { a as TFormRule, i as TFormFieldRegistration, n as _default$8, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-DRrb_yoj.mjs";
3
+ import { a as TAsTypeComponents, i as TAsComponentProps, n as TAsChangeType, o as TAsUnionContext, r as TAsComponentEmits, t as TAsBaseComponentProps } from "./types-Czm-Gtud.mjs";
4
+ import _default$10 from "./as-iterator.mjs";
5
+ import { t as _default } from "./as-action.vue-CmY3eil1.mjs";
6
+ import { t as _default$1 } from "./as-array.vue-C5r_ycIa.mjs";
7
+ import { t as _default$2 } from "./as-checkbox.vue-BL53Xjmi.mjs";
8
+ import { t as _default$3 } from "./as-date.vue-C5JaS3Sd.mjs";
9
+ import { t as _default$4 } from "./as-datetime.vue-ClsSnJSV.mjs";
10
+ import { t as _default$5 } from "./as-decimal.vue-CSCtYRRa.mjs";
11
+ import { t as _default$7 } from "./as-field-shell.vue-Ddnp8KxY.mjs";
12
+ import { t as _default$9 } from "./as-input.vue-fUhcvfv2.mjs";
13
+ import { t as _default$11 } from "./as-number.vue-Bk-W7Vwv.mjs";
14
+ import { t as _default$12 } from "./as-object.vue-Cg52b61-.mjs";
15
+ import { t as _default$13 } from "./as-paragraph.vue-C3FgTEt5.mjs";
16
+ import { t as _default$14 } from "./as-radio.vue-D_fweoN1.mjs";
17
+ import { t as _default$15 } from "./as-ref.vue-Cr5jeNDn.mjs";
18
+ import { t as _default$16 } from "./as-select.vue-RYpbZbKt.mjs";
19
+ import { t as _default$17 } from "./as-time.vue-huLx2B4l.mjs";
20
+ import { t as _default$18 } from "./as-tuple.vue-CQhzOJsn.mjs";
21
+ import { t as _default$19 } from "./as-union.vue-BjlDPZn0.mjs";
22
+ import * as vue from "vue";
23
+ import { Component, ComputedRef, MaybeRef, Ref, ShallowRef, WritableComputedRef } from "vue";
24
+ import * as _atscript_ui0 from "@atscript/ui";
25
+ import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormFieldDef, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, ValueHelpInfo, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
26
+ //#region ../../node_modules/.pnpm/@atscript+typescript@0.1.54_@atscript+core@0.1.54_@emnapi+core@1.9.2_@emnapi+runtime@1._3fc5d9e55a098ea8857b831f6196090c/node_modules/@atscript/typescript/dist/utils.d.ts
27
+ interface TError {
28
+ path: string;
29
+ message: string;
30
+ details?: TError[];
31
+ }
32
+ /**
33
+ * A plugin function that can intercept validation.
34
+ *
35
+ * Return `true` to accept the value, `false` to reject it,
36
+ * or `undefined` to fall through to the default validation.
37
+ */
38
+ type TValidatorPlugin = (ctx: TValidatorPluginContext, def: TAtscriptAnnotatedType, value: any) => boolean | undefined;
39
+ /** Options for configuring {@link Validator} behavior. */
40
+ interface TValidatorOptions {
41
+ partial: boolean | 'deep' | ((type: TAtscriptAnnotatedType<TAtscriptTypeObject>, path: string) => boolean);
42
+ replace?: (type: TAtscriptAnnotatedType, path: string) => TAtscriptAnnotatedType;
43
+ plugins: TValidatorPlugin[];
44
+ unknownProps: 'strip' | 'ignore' | 'error';
45
+ errorLimit: number;
46
+ skipList?: Set<string>;
47
+ }
48
+ /** Context exposed to {@link TValidatorPlugin} functions. */
49
+ interface TValidatorPluginContext {
50
+ opts: Validator<any>['opts'];
51
+ validateAnnotatedType: Validator<any>['validateAnnotatedType'];
52
+ error: Validator<any>['error'];
53
+ path: Validator<any>['path'];
54
+ context: unknown;
55
+ }
56
+ /**
57
+ * Validates values against an {@link TAtscriptAnnotatedType} definition.
58
+ *
59
+ * `DataType` is automatically inferred from the type definition's phantom generic,
60
+ * enabling the {@link validate} method to act as a type guard.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * // From a generated interface class:
65
+ * const validator = new Validator(MyInterface)
66
+ * if (validator.validate(data, true)) {
67
+ * data // narrowed to MyInterface
68
+ * }
69
+ *
70
+ * // Or use the built-in factory:
71
+ * MyInterface.validator().validate(data)
72
+ * ```
73
+ *
74
+ * @typeParam T - The annotated type definition.
75
+ * @typeParam DataType - The TypeScript type that `validate` narrows to (auto-inferred).
76
+ */
77
+ declare class Validator<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedType, DataType = TAtscriptDataType<T>> {
78
+ protected readonly def: T;
79
+ protected opts: TValidatorOptions;
80
+ protected hasPlugins: boolean;
81
+ protected hasReplace: boolean;
82
+ private replaceCache?;
83
+ constructor(def: T, opts?: Partial<TValidatorOptions>);
84
+ /** Validation errors collected during the last {@link validate} call. */
85
+ errors: TError[];
86
+ protected stackErrors: Array<TError[] | null>;
87
+ protected pathSegments: string[];
88
+ protected depth: number;
89
+ protected limitExceeded: boolean;
90
+ protected context: unknown;
91
+ protected buildPath(): string;
92
+ protected push(name: string): void;
93
+ protected pop(saveErrors: boolean): TError[] | null | undefined;
94
+ protected clear(): void;
95
+ protected error(message: string, path?: string, details?: TError[]): void;
96
+ protected throw(): void;
97
+ /**
98
+ * Validates a value against the type definition.
99
+ *
100
+ * Acts as a TypeScript type guard — when it returns `true`, the value
101
+ * is narrowed to `DataType`.
102
+ *
103
+ * @param value - The value to validate.
104
+ * @param safe - If `true`, returns `false` on failure instead of throwing.
105
+ * @returns `true` if the value matches the type definition.
106
+ * @throws {ValidatorError} When validation fails and `safe` is not `true`.
107
+ */
108
+ validate<TT = DataType>(value: any, safe?: boolean, context?: unknown): value is TT;
109
+ protected validateSafe(def: TAtscriptAnnotatedType, value: any): boolean;
110
+ protected get path(): string;
111
+ protected validateAnnotatedType(def: TAtscriptAnnotatedType, value: any): boolean;
112
+ protected validateUnion(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
113
+ protected validateIntersection(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
114
+ protected validateTuple(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
115
+ protected validateArray(def: TAtscriptAnnotatedType<TAtscriptTypeArray>, value: any): boolean;
116
+ protected validateObject(def: TAtscriptAnnotatedType<TAtscriptTypeObject>, value: any): boolean;
117
+ protected validatePrimitive(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: any): boolean;
118
+ protected validateString(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: string): boolean;
119
+ protected validateNumber(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: number): boolean;
120
+ protected validateBoolean(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: boolean): boolean;
121
+ }
122
+ /** Error thrown by {@link Validator.validate} when validation fails. Contains structured error details. */
123
+ /** Type definition for union, intersection, or tuple types. */
124
+ interface TAtscriptTypeComplex<DataType = unknown> {
125
+ kind: 'union' | 'intersection' | 'tuple';
126
+ items: TAtscriptAnnotatedType[];
127
+ tags: Set<AtscriptPrimitiveTags>;
128
+ /** @internal phantom — carries the DataType at the type level, never set at runtime */
129
+ __dataType?: DataType;
130
+ }
131
+ /** Type definition for array types. */
132
+ interface TAtscriptTypeArray<DataType = unknown[]> {
133
+ kind: 'array';
134
+ of: TAtscriptAnnotatedType;
135
+ tags: Set<AtscriptPrimitiveTags>;
136
+ /** @internal phantom — carries the DataType at the type level, never set at runtime */
137
+ __dataType?: DataType;
138
+ }
139
+ /** Type definition for object types with named and pattern-matched properties. */
140
+ interface TAtscriptTypeObject<K extends string = string, DataType = Record<K, unknown>> {
141
+ kind: 'object';
142
+ props: Map<K, TAtscriptAnnotatedType>;
143
+ propsPatterns: Array<{
144
+ pattern: RegExp;
145
+ def: TAtscriptAnnotatedType;
146
+ }>;
147
+ tags: Set<AtscriptPrimitiveTags>;
148
+ /** @internal phantom — carries the DataType at the type level, never set at runtime */
149
+ __dataType?: DataType;
150
+ }
151
+ /** Type definition for primitive/literal types (string, number, boolean, null, etc.). */
152
+ interface TAtscriptTypeFinal<DataType = unknown> {
153
+ kind: '';
154
+ /**
155
+ * design type
156
+ */
157
+ designType: 'string' | 'number' | 'boolean' | 'undefined' | 'null' | 'object' | 'any' | 'never' | 'phantom' | 'decimal';
158
+ /**
159
+ * value for literals
160
+ */
161
+ value?: string | number | boolean;
162
+ tags: Set<AtscriptPrimitiveTags>;
163
+ /** @internal phantom — carries the DataType at the type level, never set at runtime */
164
+ __dataType?: DataType;
165
+ }
166
+ /**
167
+ * Extract DataType from a type def's phantom generic
168
+ */
169
+ type InferDataType<T> = T extends {
170
+ __dataType?: infer D;
171
+ } ? D : unknown;
172
+ /**
173
+ * Extract the DataType from a {@link TAtscriptAnnotatedType}.
174
+ *
175
+ * Resolves the phantom `__dataType` carried by the type definition.
176
+ * When `__dataType` is `unknown` (unset), falls back to the constructor
177
+ * instance type if `T` is also a class (i.e. a generated interface).
178
+ *
179
+ * @example
180
+ * ```ts
181
+ * import type { TAtscriptDataType } from '@atscript/typescript/utils'
182
+ * import MyInterface from './my-interface.as'
183
+ *
184
+ * type Data = TAtscriptDataType<typeof MyInterface>
185
+ * ```
186
+ */
187
+ type TAtscriptDataType<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedType> = T extends {
188
+ type: {
189
+ __dataType?: infer D;
190
+ };
191
+ } ? unknown extends D ? T extends (new (...args: any[]) => infer I) ? I : unknown : D : unknown;
192
+ /** Union of all possible type definition shapes. */
193
+ type TAtscriptTypeDef<DataType = unknown> = TAtscriptTypeComplex<DataType> | TAtscriptTypeFinal<DataType> | TAtscriptTypeArray<DataType> | TAtscriptTypeObject<string, DataType>;
194
+ /**
195
+ * Core annotated type — wraps a type definition with metadata and a validator factory.
196
+ *
197
+ * Generated `.as` files produce classes/namespaces that conform to this interface.
198
+ * The `DataType` phantom generic carries the TypeScript data shape for type-safe validation.
199
+ *
200
+ * @typeParam T - The underlying type definition (e.g. {@link TAtscriptTypeObject}).
201
+ * @typeParam DataType - The TypeScript type the validated data narrows to (auto-inferred from `T`).
202
+ */
203
+ interface TAtscriptAnnotatedType<T extends TAtscriptTypeDef = TAtscriptTypeDef, DataType = InferDataType<T>> {
204
+ __is_atscript_annotated_type: true;
205
+ type: T;
206
+ validator(opts?: Partial<TValidatorOptions>): Validator<this, DataType>;
207
+ metadata: TMetadataMap<AtscriptMetadata>;
208
+ optional?: boolean;
209
+ id?: string;
210
+ ref?: {
211
+ type: () => TAtscriptAnnotatedType;
212
+ field: string;
213
+ };
214
+ }
215
+ /** An annotated type that is also a class constructor (i.e. a generated interface class). */
216
+ /**
217
+ * Atscript Metadata Map with typed setters/getters
218
+ */
219
+ interface TMetadataMap<O extends object> extends Map<keyof O, O[keyof O]> {
220
+ get<K extends keyof O>(key: K): O[K] | undefined;
221
+ get(key: string): unknown;
222
+ set<K extends keyof O>(key: K, value: O[K]): this;
223
+ has<K extends keyof O>(key: K): boolean;
224
+ has(key: string): boolean;
225
+ }
226
+ /** Fluent builder handle returned by {@link defineAnnotatedType}. */
227
+ //#endregion
228
+ //#region src/composables/create-as-form-def.d.ts
229
+ /**
230
+ * Creates a reactive form definition and data object from an ATScript annotated type.
231
+ *
232
+ * @param type - An ATScript annotated type (imported from a `.as` file).
233
+ * @param context - Optional context object forwarded to `ui.fn.value` resolvers during data creation.
234
+ * Only effective when `@atscript/ui-fns` is installed (dynamic resolver).
235
+ * @returns `{ def, formData }` — the FormDef and a Vue reactive data object with defaults applied
236
+ */
237
+ declare function createAsFormDef<T extends TAtscriptAnnotatedType>(type: T, context?: Record<string, unknown>): {
238
+ def: _atscript_ui0.FormDef;
239
+ formData: {
240
+ value: vue.UnwrapRef<TAtscriptDataType<T>>;
241
+ };
242
+ };
243
+ //#endregion
244
+ //#region src/composables/create-default-types.d.ts
245
+ /**
246
+ * Returns a fresh type-to-component map pre-filled with all built-in defaults.
247
+ *
248
+ * Spread or assign additional entries to extend with custom field types:
249
+ * ```ts
250
+ * const types = { ...createDefaultTypes(), rating: MyRatingComponent }
251
+ * ```
252
+ */
253
+ declare function createDefaultTypes(): TAsTypeComponents;
254
+ //#endregion
255
+ //#region src/composables/use-as-field.d.ts
256
+ interface UseAsFieldOptions<TValue = any, TFormData = any, TContext = any> {
257
+ getValue: () => TValue;
258
+ setValue: (v: TValue) => void;
259
+ rules?: TFormRule<TValue, TFormData, TContext>[];
260
+ path: () => string;
261
+ /** Value to set on reset. Defaults to `''`. Use `[]` for arrays, `{}` for objects. */
262
+ resetValue?: TValue;
263
+ }
264
+ interface UseAsFieldReturn<TValue = any> {
265
+ model: WritableComputedRef<TValue>;
266
+ error: ComputedRef<string | undefined>;
267
+ onBlur: () => void;
268
+ }
269
+ declare function useAsField<TValue = any, TFormData = any, TContext = any>(opts: UseAsFieldOptions<TValue, TFormData, TContext>): UseAsFieldReturn<TValue>;
270
+ //#endregion
271
+ //#region src/composables/use-as-state.d.ts
272
+ /** Custom form-level validator. Returns `Record<path, message>` (empty = passed). */
273
+ type TFormSubmitValidator = () => Record<string, string>;
274
+ interface UseAsStateReturn {
275
+ formState: TFormState;
276
+ clearErrors: () => void;
277
+ reset: () => Promise<void>;
278
+ submit: () => true | {
279
+ path: string;
280
+ message: string;
281
+ }[];
282
+ setErrors: (errors: Record<string, string>) => void;
283
+ }
284
+ declare function useAsState<TFormData, TContext>(opts: {
285
+ formData: MaybeRef<TFormData>;
286
+ formContext?: MaybeRef<TContext>;
287
+ firstValidation?: MaybeRef<TFormState["firstValidation"] | undefined>; /** When provided, replaces per-field iteration on submit. */
288
+ submitValidator?: TFormSubmitValidator;
289
+ }): UseAsStateReturn;
290
+ //#endregion
291
+ //#region src/composables/use-as-form.d.ts
292
+ /**
293
+ * Options for {@link useAsForm}. Each reactive prop is supplied as a
294
+ * **getter** so the composable can subscribe to its changes without owning
295
+ * a `Ref`. Pass component-level `defineProps` accessors verbatim:
296
+ *
297
+ * ```ts
298
+ * useAsForm({
299
+ * def: () => props.def,
300
+ * formData: () => props.formData,
301
+ * types: () => props.types,
302
+ * // ...
303
+ * emits: { submit: (data) => emit("submit", data), ... },
304
+ * })
305
+ * ```
306
+ *
307
+ * Generic `TFormData` / `TFormContext` mirror the `<AsForm>` component
308
+ * generics. They flow through to emitted callbacks; if you build a custom
309
+ * form root with a known data shape, pin them at the call site.
310
+ */
311
+ interface UseAsFormOptions<TFormData = unknown, TFormContext = unknown> {
312
+ /** Form definition produced by `createAsFormDef(type)`. Reactive. */
313
+ def: () => FormDef;
314
+ /**
315
+ * Externally-managed form data container `{ value: domainData }`. When
316
+ * unset, the composable creates an internal one initialized to `{}`.
317
+ */
318
+ formData?: () => TFormData | undefined;
319
+ /** Reactive form context — exposed to validators, scope, slots, and emits. */
320
+ formContext?: () => TFormContext | undefined;
321
+ /** First-validation strategy. Defaults to `"on-change"`. */
322
+ firstValidation?: () => TFormState["firstValidation"] | undefined;
323
+ /** Custom field components keyed by field name (matches `Props.components`). */
324
+ components?: () => Record<string, Component<TAsComponentProps>> | undefined;
325
+ /** Type-to-component map keyed by field type (matches `Props.types`). */
326
+ types: () => TAsTypeComponents;
327
+ /** Server-supplied errors keyed by absolute dotted path (`__form` for form-level). */
328
+ errors?: () => Record<string, string | undefined> | undefined;
329
+ /** Per-form value-help client factory. Falls back to the app-wide default when unset. */
330
+ clientFactory?: () => ClientFactory$1 | undefined;
331
+ /** Suppress the root field's title (use when the chrome already shows the form's label). */
332
+ hideRootTitle?: () => boolean | undefined;
333
+ /**
334
+ * Outbound callbacks. Customer form roots typically wire these to
335
+ * `defineEmits`; advanced uses can pass plain functions.
336
+ */
337
+ emits?: {
338
+ submit?: (data: TFormData) => void;
339
+ error?: (errors: {
340
+ path: string;
341
+ message: string;
342
+ }[]) => void;
343
+ action?: (name: string, data: TFormData) => void;
344
+ unsupportedAction?: (name: string, data: TFormData) => void;
345
+ change?: (type: TAsChangeType, path: string, value: unknown, formData: TFormData) => void;
346
+ };
347
+ }
348
+ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
349
+ /** Reactive form-data container `{ value: domainData }`. */
350
+ data: ComputedRef<TFormData>;
351
+ /** Effective external errors (post-dismissal), excluding `__form`. */
352
+ errors: ComputedRef<Record<string, string | undefined> | undefined>;
353
+ /** Form-level error message (post banner-dismissal). */
354
+ formError: ComputedRef<string | undefined>;
355
+ /** Errors discovered by the local validator on the most-recent submit. */
356
+ internalErrors: Ref<Record<string, string>>;
357
+ /** Reset internal validator + dismissal state and re-run field defaults. */
358
+ reset: () => Promise<void>;
359
+ /** Imperatively clear errors (matches `useAsState().clearErrors`). */
360
+ clearErrors: () => void;
361
+ /** Imperatively set external-error messages by path. */
362
+ setErrors: (errors: Record<string, string>) => void;
363
+ /** Trigger submit. Emits `submit` on success and `error` on validation failure. */
364
+ onSubmit: () => void;
365
+ /** Resolved submit-button text (`@ui.form.submit.text` / fn variant). */
366
+ submitText: ComputedRef<string>;
367
+ /** Resolved submit-button disabled state (`@ui.form.fn.submitDisabled`). */
368
+ submitDisabled: ComputedRef<boolean>;
369
+ /** Dispatch an action — invoked by `<AsAction>`. */
370
+ invokeAction: (name: string) => void;
371
+ /** Dismiss a single external leaf error. */
372
+ dismissError: (path: string) => void;
373
+ /** Dismiss the form-level banner. */
374
+ dismissFormError: () => void;
375
+ /** Form-context getter (mirrors `options.formContext()`). */
376
+ formContext: ComputedRef<TFormContext | undefined>;
377
+ /** Internal change-dispatcher used by `<AsField>` and structured components. */
378
+ handleChange: (type: TAsChangeType, path: string, value: unknown) => void;
379
+ }
380
+ /**
381
+ * Composable backing `<AsForm>`. Owns the entire form state machine —
382
+ * data container, internal validator, external-error dismissal, action
383
+ * routing, change merging, descendant counts, auto-open, and all
384
+ * provide/inject wiring. Customers building a custom form root can
385
+ * call this directly and render their own `<form>` template.
386
+ *
387
+ * MUST be called from a component's `<script setup>` (it issues
388
+ * `provide()` calls that need an active component instance).
389
+ */
390
+ declare function useAsForm<TFormData = unknown, TFormContext = unknown>(options: UseAsFormOptions<TFormData, TFormContext>): UseAsFormReturn<TFormData, TFormContext>;
391
+ //#endregion
392
+ //#region src/composables/use-as-external-errors.d.ts
393
+ /**
394
+ * Source of externally-supplied (server) errors. Reading this getter
395
+ * inside a Vue reactive scope subscribes the composable to identity
396
+ * changes — when the source returns a *different* object reference
397
+ * (typically a fresh server response), all locally-applied dismissals
398
+ * reset automatically.
399
+ */
400
+ interface UseAsExternalErrorsOptions {
401
+ source: () => Record<string, string | undefined> | undefined;
402
+ }
403
+ interface UseAsExternalErrorsReturn {
404
+ /**
405
+ * Errors map after leaf-path dismissals applied. The `__form` key is
406
+ * always omitted — render form-level errors via `formError`. Returns
407
+ * `undefined` when the source itself is `undefined` (no errors at all),
408
+ * so consumers can preserve the original "errors prop unset" semantics.
409
+ */
410
+ effective: ComputedRef<Record<string, string | undefined> | undefined>;
411
+ /** Top-level `__form` error (post banner-dismissal). `undefined` while dismissed or absent. */
412
+ formError: ComputedRef<string | undefined>;
413
+ /** Whether the form-level banner is currently dismissed. */
414
+ isFormDismissed: ComputedRef<boolean>;
415
+ /** Mark a leaf-field path as dismissed locally. Idempotent. */
416
+ dismissAt: (path: string) => void;
417
+ /** Dismiss the form-level banner. */
418
+ dismissForm: () => void;
419
+ /** Reset all dismissals (rarely needed; identity-change does this for you). */
420
+ reset: () => void;
421
+ }
422
+ /**
423
+ * Local dismissal state for externally-supplied errors.
424
+ *
425
+ * - `dismissAt(path)` hides a leaf error until either the user un-dismisses
426
+ * it or a *fresh* errors object arrives (new identity).
427
+ * - `dismissForm()` hides the `__form` banner. Same identity-reset rule, but
428
+ * never cleared by leaf calls.
429
+ * - In-place mutation of the source object does NOT reset dismissals; only
430
+ * identity changes do. A fresh response (`errors.value = { ... }`) re-arms
431
+ * everything, while in-place tweaks (rare) deliberately preserve them.
432
+ *
433
+ * The composable is pure — it does NOT call `provide()`. The owning form
434
+ * composable wires `dismissAt` into the form's inject contract.
435
+ */
436
+ declare function useAsExternalErrors(options: UseAsExternalErrorsOptions): UseAsExternalErrorsReturn;
437
+ //#endregion
438
+ //#region src/composables/use-as-array.d.ts
439
+ interface UseAsArrayReturn {
440
+ arrayValue: ComputedRef<unknown[]>;
441
+ itemKeys: string[];
442
+ isUnion: boolean;
443
+ unionVariants: FormUnionVariant[];
444
+ isOptional: boolean;
445
+ isEmpty: ComputedRef<boolean>;
446
+ getItemField: (index: number, name?: string) => FormFieldDef;
447
+ addItem: (variantIndex?: number) => void;
448
+ removeItem: (index: number) => void;
449
+ clear: () => void;
450
+ canAdd: ComputedRef<boolean>;
451
+ canRemove: ComputedRef<boolean>;
452
+ }
453
+ /**
454
+ * Composable for managing array field state.
455
+ *
456
+ * Manages stable keys, add/remove with constraints, and item field resolution.
457
+ * Union item types are handled transparently — AsUnion manages variant state locally.
458
+ * Used by the default `AsArray` component and available for custom array components.
459
+ */
460
+ declare function useAsArray(field: FormArrayFieldDef, disabled?: ComputedRef<boolean>): UseAsArrayReturn;
461
+ //#endregion
462
+ //#region src/composables/use-as-tuple.d.ts
463
+ interface UseAsTupleReturn {
464
+ itemFields: FormFieldDef[];
465
+ positionLabeled: boolean[];
466
+ isOptional: boolean;
467
+ isEmpty: ComputedRef<boolean>;
468
+ clear: () => void;
469
+ fillMissing: () => void;
470
+ }
471
+ /** Composable for managing tuple field state. Fixed-length, position-typed; auto-fills missing positions on mount unless optional. */
472
+ declare function useAsTuple(field: FormTupleFieldDef): UseAsTupleReturn;
473
+ //#endregion
474
+ //#region src/composables/use-as-union.d.ts
475
+ interface UseAsUnionReturn {
476
+ unionField: ComputedRef<FormUnionFieldDef | undefined>;
477
+ hasMultipleVariants: ComputedRef<boolean>;
478
+ localUnionIndex: Ref<number>;
479
+ innerField: ComputedRef<FormFieldDef | undefined>;
480
+ changeVariant: (newIndex: number) => void;
481
+ optionalEnabled: ComputedRef<boolean>;
482
+ }
483
+ /** Composable for union field state. Switching variants stashes per-index data so toggling back restores user's work instead of fresh defaults. */
484
+ declare function useAsUnion(props: TAsComponentProps): UseAsUnionReturn;
485
+ //#endregion
486
+ //#region src/composables/use-form-context.d.ts
487
+ /**
488
+ * Consume and clear the union context injection.
489
+ *
490
+ * Structured components (object, tuple, array, field-shell) call this to
491
+ * read the union context provided by `AsUnion` and immediately clear it
492
+ * so nested children don't inherit it.
493
+ */
494
+ declare function useAsUnionVariant(): TAsUnionContext | undefined;
495
+ /** Split a label into base + optional `#N` suffix for two-part rendering. */
496
+ declare function formatIndexedLabelParts(label: string | undefined, arrayIndex: number | undefined): {
497
+ base: string;
498
+ suffix?: string;
499
+ } | undefined;
500
+ //#endregion
501
+ //#region src/composables/use-as-value-help.d.ts
502
+ interface UseAsValueHelpOptions {
503
+ info: ValueHelpInfo;
504
+ model: {
505
+ value: unknown;
506
+ };
507
+ onBlur: () => void;
508
+ }
509
+ type UseAsValueHelpStatus = "loading" | "ready" | "error";
510
+ interface UseAsValueHelpReturn {
511
+ resolved: ShallowRef<ResolvedValueHelp | null>;
512
+ status: Ref<UseAsValueHelpStatus>;
513
+ searchText: Ref<string>;
514
+ results: ShallowRef<Record<string, unknown>[]>;
515
+ searching: Ref<boolean>;
516
+ labelIsFkValue: ComputedRef<boolean>;
517
+ kickoff: () => Promise<void>;
518
+ selectItem: (item: Record<string, unknown>) => void;
519
+ clear: () => void;
520
+ }
521
+ declare function useAsValueHelp(options: UseAsValueHelpOptions): UseAsValueHelpReturn;
522
+ //#endregion
523
+ //#region src/composables/use-as-dropdown.d.ts
524
+ declare function useAsDropdown(containerRef: Ref<HTMLElement | null>): {
525
+ isOpen: Ref<boolean, boolean>;
526
+ toggle: () => void;
527
+ close: () => void;
528
+ select: (callback: () => void) => void;
529
+ };
530
+ //#endregion
531
+ //#region src/composables/use-as-nested-sections-store.d.ts
532
+ /**
533
+ * Reactive open/closed registry for collapsible object sections rendered
534
+ * by `AsObject`. Provided once per `<AsForm>` so the entire form shares a
535
+ * single store; consumers (page chrome, devtools, dialogs) can `inject`
536
+ * the store via `useAsNestedSectionsStore()` to drive Expand-all /
537
+ * Collapse-all UI without prop drilling.
538
+ *
539
+ * **Default state is closed.** IDs only enter `open` when explicitly
540
+ * expanded (user click, native `<details>` toggle, programmatic
541
+ * `setOpen` / `expandAll`). The native `<details>` toggle event syncs
542
+ * back via `setOpen(id, open)` (idempotent, so browser find-in-page
543
+ * auto-opens don't fight the store).
544
+ */
545
+ interface AsNestedSectionsStore {
546
+ open: Ref<Set<string>>;
547
+ register: (id: string) => void;
548
+ unregister: (id: string) => void;
549
+ toggle: (id: string) => void;
550
+ setOpen: (id: string, open: boolean) => void;
551
+ isOpen: (id: string) => boolean;
552
+ expandAll: () => void;
553
+ collapseAll: () => void;
554
+ allOpen: () => boolean;
555
+ }
556
+ /**
557
+ * Create and provide a `AsNestedSectionsStore` to the current Vue subtree.
558
+ * Called automatically by `<AsForm>`, but exposed for cases where you
559
+ * want to scope a separate store (e.g. multiple independent forms in one
560
+ * page that should keep their open/closed state independent, or to drive
561
+ * page-level Expand-all / Collapse-all UI from above the form).
562
+ */
563
+ declare function provideAsNestedSectionsStore(): AsNestedSectionsStore;
564
+ /**
565
+ * Inject the nested-sections store provided by an ancestor `<AsForm>`
566
+ * (or by an explicit `provideAsNestedSectionsStore()` call). Returns
567
+ * `undefined` if no store is in scope.
568
+ */
569
+ declare function useAsNestedSectionsStore(): AsNestedSectionsStore | undefined;
570
+ //#endregion
571
+ //#region src/composables/focus-after-toggle.d.ts
572
+ /** Run an action, then focus the first focusable input descendant of `scope`. */
573
+ declare function focusFirstAfter(action: () => void, scope: () => HTMLElement | null | undefined, ticks?: number): Promise<void>;
574
+ /**
575
+ * Run an action, then focus the first focusable input that wasn't present
576
+ * before the action. Used by array Add buttons so the user lands on the
577
+ * just-added row's first input regardless of how many items already exist.
578
+ * Falls back to first focusable when nothing existed before (the typical
579
+ * "enable optional + add first item" flow).
580
+ */
581
+ declare function focusNewFocusableAfter(action: () => void, scope: () => HTMLElement | null | undefined, ticks?: number): Promise<void>;
582
+ /** Sugar over `focusFirstAfter` scoped to a template ref. */
583
+ declare function useAsFocusFirstAfter(onToggleOptional?: (enabled: boolean) => void): {
584
+ rootRef: Ref<HTMLElement | null>;
585
+ runAndFocus: (action: () => void, ticks?: number) => void;
586
+ runAndFocusNew: (action: () => void, ticks?: number) => void;
587
+ enableOptional: () => void;
588
+ };
589
+ //#endregion
590
+ //#region src/composables/use-as-optional-add-flow.d.ts
591
+ /**
592
+ * Options for `useAsOptionalAddFlow`.
593
+ *
594
+ * The composable consolidates the "toggle optional → register with the
595
+ * nested-sections store → focus first new field" choreography that
596
+ * structured-field defaults (AsObject, AsArray, AsTuple, AsUnion) repeat
597
+ * every time the user clicks an empty-state Add affordance, an Add Item
598
+ * button, or a variant picker.
599
+ */
600
+ interface UseAsOptionalAddFlowOptions {
601
+ /**
602
+ * Absolute dotted path to the field — used as the nested-sections-store
603
+ * key. Read via a getter so the composable always reads the latest value
604
+ * (the path can change when the field is rendered inside a union and the
605
+ * variant switches).
606
+ */
607
+ path: () => string | undefined;
608
+ }
609
+ interface UseAsOptionalAddFlowReturn {
610
+ /**
611
+ * Wrap a user-supplied action so that running it also expands the
612
+ * containing section in the nested-sections store. Pass the wrapped
613
+ * action to `AsCollapsible#runAndFocusNew` (which owns its own focus
614
+ * scope) so the focus query lands on the freshly mounted subtree.
615
+ *
616
+ * The wrapper is a no-op for the store-register step when no store is
617
+ * provided in scope (e.g. a custom default mounted standalone) — focus
618
+ * still happens via the host's `runAndFocusNew`.
619
+ */
620
+ composeAction: (action: () => void) => () => void;
621
+ /**
622
+ * Sugar for the case where the call site does not have an
623
+ * `AsCollapsible` to delegate focus to (e.g. AsUnion's empty-state
624
+ * picker, which mounts its own `<div>`). Wraps the action with
625
+ * store-open registration, then runs it inside `focusNewFocusableAfter`.
626
+ *
627
+ * Returns the same Promise `focusNewFocusableAfter` returns so callers
628
+ * can `await` if they need to.
629
+ */
630
+ runAndFocusNew: (scope: () => HTMLElement | null | undefined, action: () => void, ticks?: number) => Promise<void>;
631
+ }
632
+ /**
633
+ * Choreography composable for "enable-optional + add + focus-first-new"
634
+ * flows. The four built-in structured-field defaults consume it; custom
635
+ * implementations of object/array/tuple/union components can use it too
636
+ * to get the same UX (smooth focus handoff after an empty-state click)
637
+ * without re-implementing the choreography.
638
+ *
639
+ * Pairs with:
640
+ * - {@link useAsFocusFirstAfter} — focus mechanics (used by AsCollapsible)
641
+ * - {@link useAsNestedSectionsStore} — open/closed state registry
642
+ *
643
+ * Typical use, inside an `as-object.vue` swap component:
644
+ * ```ts
645
+ * const { composeAction } = useAsOptionalAddFlow({ path: () => props.path });
646
+ * function handleAddData() {
647
+ * collapsibleRef.value?.runAndFocusNew(
648
+ * composeAction(() => props.onToggleOptional?.(true)),
649
+ * 2,
650
+ * );
651
+ * }
652
+ * ```
653
+ */
654
+ declare function useAsOptionalAddFlow(options: UseAsOptionalAddFlowOptions): UseAsOptionalAddFlowReturn;
655
+ //#endregion
656
+ //#region src/composables/use-as-tri-state-checkbox.d.ts
657
+ /**
658
+ * Options for `useAsTriStateCheckbox`.
659
+ *
660
+ * Consolidates the "checked / unchecked / indeterminate" mechanics for
661
+ * boolean fields whose model can be `undefined` (optional booleans, or
662
+ * checkboxes that round-trip from a SQL NULL). HTML5's `indeterminate`
663
+ * is a property on the DOM element — not a reflectable attribute — so
664
+ * the composable wires it via a `watchEffect`.
665
+ */
666
+ interface UseAsTriStateCheckboxOptions {
667
+ /**
668
+ * Reactive getter for the current model value. `undefined` renders the
669
+ * indeterminate look; `true` / `false` render checked / unchecked.
670
+ */
671
+ modelValue: () => boolean | undefined;
672
+ /**
673
+ * Called when the user toggles the checkbox. Receives the new value as
674
+ * read off the input's `checked` property after the click.
675
+ */
676
+ onCommit: (value: boolean) => void;
677
+ }
678
+ interface UseAsTriStateCheckboxReturn {
679
+ /**
680
+ * Bind to `<input type="checkbox" :checked>`. Equivalent to
681
+ * `modelValue() === true`.
682
+ */
683
+ checked: ComputedRef<boolean>;
684
+ /**
685
+ * `true` when the model is `undefined` — render the indeterminate
686
+ * look (the composable also wires the DOM property via `watchEffect`).
687
+ */
688
+ indeterminate: ComputedRef<boolean>;
689
+ /**
690
+ * Template ref for the `<input>` element. The composable observes it
691
+ * and writes the `indeterminate` property whenever the model becomes
692
+ * `undefined`.
693
+ */
694
+ inputRef: Ref<HTMLInputElement | null>;
695
+ /** Bind to `@change`. Reads `e.target.checked` and forwards to `onCommit`. */
696
+ onChange: (e: Event) => void;
697
+ }
698
+ /**
699
+ * Tri-state checkbox helper. The visible state is derived from the
700
+ * model: `true` checked, `false` unchecked, `undefined` indeterminate.
701
+ * Clicking commits a boolean — never `undefined` — because browsers do
702
+ * not emit a "tri-state click". The "back to undefined" path stays a
703
+ * separate optional-clear affordance owned by the host component.
704
+ *
705
+ * Use this composable in a custom checkbox swap component to inherit the
706
+ * same a11y / DOM-sync behaviour as the built-in `AsCheckbox` without
707
+ * re-implementing the `watchEffect` plumbing or remembering that
708
+ * `indeterminate` is a property, not an attribute.
709
+ */
710
+ declare function useAsTriStateCheckbox(options: UseAsTriStateCheckboxOptions): UseAsTriStateCheckboxReturn;
711
+ //#endregion
712
+ //#region src/composables/use-as-locale.d.ts
713
+ declare function provideAsLocale(getter: () => string | undefined): void;
714
+ interface UseAsLocaleReturn {
715
+ /** Resolved locale; `undefined` when no provider is present (runtime locale). */
716
+ locale: ComputedRef<string | undefined>;
717
+ }
718
+ declare function useAsLocale(): UseAsLocaleReturn;
719
+ //#endregion
720
+ //#region src/composables/use-as-decimal.d.ts
721
+ interface UseAsDecimalOptions {
722
+ /** Read the current value. Storage shape is preserved on commit. */
723
+ modelValue: () => string | number | null | undefined;
724
+ /**
725
+ * Effective display + edit scale. Composables truncate user-typed values
726
+ * to this so a paste of "10.99" into a JPY field doesn't propagate the
727
+ * lost ".99". Resolution lives at AsField — see TAsComponentProps.scale.
728
+ */
729
+ scale?: () => number | undefined;
730
+ /**
731
+ * Storage cap (DB column scale). Outgoing strings are padded to this
732
+ * regardless of `scale` — display can be tighter than storage. When
733
+ * absent, falls back to `scale`.
734
+ */
735
+ storageScale?: () => number | undefined;
736
+ /** Locale override; defaults to `useAsLocale()` then runtime locale. */
737
+ locale?: () => string | undefined;
738
+ /** Commit handler — receives the new value in the same shape as `modelValue()`. */
739
+ onCommit: (value: string | number | null) => void;
740
+ }
741
+ interface UseAsDecimalReturn {
742
+ /** Effective display + edit scale. Defaults to 2 when neither scale nor storageScale provided. */
743
+ scale: ComputedRef<number>;
744
+ /** Storage cap (always populated; falls back to effective scale, then 2). */
745
+ storageScale: ComputedRef<number>;
746
+ decimalSeparator: ComputedRef<string>;
747
+ thousandsSeparator: ComputedRef<string>;
748
+ /** Single-input renderers: locale-formatted decimal "1,234.50" / "1 234,50". */
749
+ displayValue: ComputedRef<string>;
750
+ /** Canonical decimal "1234.50": no thousands, "." separator, padded to effective scale. */
751
+ rawValue: ComputedRef<string>;
752
+ /** Split renderers: integer is grouped per locale for display. */
753
+ parts: ComputedRef<{
754
+ sign: "" | "-";
755
+ integer: string;
756
+ decimal: string;
757
+ }>;
758
+ /** Renderer received a complete typed value (single-input swap). */
759
+ setFromInput: (raw: string) => void;
760
+ /** Renderer captured the two halves separately (default two-input SFC). */
761
+ setFromParts: (sign: "" | "-", integer: string, decimal: string) => void;
762
+ }
763
+ /**
764
+ * Reactive composable for decimal-typed inputs (the `AsDecimal` SFC and
765
+ * customer swaps built against `TAsComponentProps`).
766
+ *
767
+ * Currency-agnostic: the SFC owns prefix/suffix render concerns and
768
+ * resolves the effective scale via the `scale` prop set by AsField. This
769
+ * composable just operates on the model with the scale given to it.
770
+ *
771
+ * Storage shape is preserved on commit — string `modelValue` commits a
772
+ * string padded to `storageScale`; number `modelValue` commits a number.
773
+ * A change to the effective `scale` getter that shrinks it below the
774
+ * model's actual precision triggers a re-round + re-commit (the same
775
+ * "currency-change" behaviour as before).
776
+ */
777
+ declare function useAsDecimal(opts: UseAsDecimalOptions): UseAsDecimalReturn;
778
+ //#endregion
779
+ //#region src/composables/use-as-number.d.ts
780
+ interface UseAsNumberOptions {
781
+ /** Read the current value. May be a string when authored externally; commit is always a `number` or `null`. */
782
+ modelValue: () => string | number | null | undefined;
783
+ /** Locale override; defaults to `useAsLocale()` then runtime locale. */
784
+ locale?: () => string | undefined;
785
+ /** Commit handler — receives a parsed `number`, or `null` for empty input. */
786
+ onCommit: (value: number | null) => void;
787
+ }
788
+ interface UseAsNumberReturn {
789
+ decimalSeparator: ComputedRef<string>;
790
+ /**
791
+ * Single-input renderers: raw model value with the locale decimal
792
+ * separator swap. No Intl grouping, no padding, no truncation — numbers
793
+ * aren't precision-critical the way decimals are.
794
+ */
795
+ displayValue: ComputedRef<string>;
796
+ /** Canonical decimal ("." separator). Verbatim from the model — no scale enforcement. */
797
+ rawValue: ComputedRef<string>;
798
+ /** Renderer received a complete typed value. */
799
+ setFromInput: (raw: string) => void;
800
+ }
801
+ /**
802
+ * Reactive composable that powers the default `AsNumber` SFC. Single-
803
+ * input shape — currency-agnostic, scale-agnostic, just a plain number
804
+ * with optional prefix/suffix chrome owned by the SFC.
805
+ *
806
+ * Commit shape is always a `number` (or `null` for empty input).
807
+ * atscript `number` fields are primitive `number` in the model — there
808
+ * is no precision-preservation reason to ship a string the way decimals
809
+ * do. The SFC owns prefix/suffix render concerns; this composable only
810
+ * knows about the value.
811
+ */
812
+ declare function useAsNumber(opts: UseAsNumberOptions): UseAsNumberReturn;
813
+ //#endregion
814
+ //#region src/composables/use-as-dual-input.d.ts
815
+ /**
816
+ * Keyboard plumbing for the bank-UX two-input pattern (integer + decimal
817
+ * halves joined by a separator pill). Extracted from the original
818
+ * AsAmount SFC so AsDecimal and any customer two-input renderer can
819
+ * share the same arrow-bridge / digit-overwrite / paste-split behaviour.
820
+ *
821
+ * This composable is render-agnostic — the SFC owns the layout, the
822
+ * shell chrome and the value model wiring. The composable just exposes
823
+ * the input refs, edit-state, focus handlers and event handlers wired
824
+ * to a `setFromParts` / `setFromInput` callback pair.
825
+ */
826
+ interface UseAsDualInputOptions {
827
+ /** Effective scale (max digits in the decimal half). 0 → no decimal half. */
828
+ scale: () => number;
829
+ /** Locale-aware decimal separator (used for bridge-key detection). */
830
+ decimalSeparator: () => string;
831
+ /** Read the current parts. The composable owns NO model state. */
832
+ parts: () => {
833
+ sign: "" | "-";
834
+ integer: string;
835
+ decimal: string;
836
+ };
837
+ /** Read the canonical "X.YZ" string — used by paste/bridge to know current state. */
838
+ rawValue: () => string;
839
+ /** Commit a fresh split. Pure callback into the parent's state machine. */
840
+ setFromParts: (sign: "" | "-", integer: string, decimal: string) => void;
841
+ /** Commit a raw typed string (for paste). */
842
+ setFromInput: (raw: string) => void;
843
+ /** Called from `onBlurAll` after focus leaves both inputs. */
844
+ onBlur?: () => void;
845
+ }
846
+ interface UseAsDualInputReturn {
847
+ integerInput: Ref<HTMLInputElement | null>;
848
+ decimalInput: Ref<HTMLInputElement | null>;
849
+ /** Display string for the integer half — un-grouped while focused, grouped on blur. */
850
+ integerDisplay: ComputedRef<string>;
851
+ /** Display string for the decimal half — owns the suppression rules. */
852
+ decimalDisplay: ComputedRef<string>;
853
+ /** True while either input has focus. */
854
+ focusActive: Ref<boolean>;
855
+ onIntegerFocus: (e?: FocusEvent) => void;
856
+ onDecimalFocus: (e?: FocusEvent) => void;
857
+ onBlurAll: (e: FocusEvent) => void;
858
+ onIntegerInput: (e: Event) => void;
859
+ onIntegerKeydown: (e: KeyboardEvent) => void;
860
+ onIntegerPaste: (e: ClipboardEvent) => void;
861
+ onDecimalInput: (e: Event) => void;
862
+ onDecimalKeydown: (e: KeyboardEvent) => void;
863
+ onDecimalPaste: (e: ClipboardEvent) => void;
864
+ }
865
+ declare function useAsDualInput(opts: UseAsDualInputOptions): UseAsDualInputReturn;
866
+ //#endregion
867
+ //#region src/composables/use-as-date.d.ts
868
+ /**
869
+ * Storage convention — atscript marks date-bearing fields with the
870
+ * `number.timestamp` primitive (epoch-ms numbers). The default form
871
+ * components mirror the cell-side rule: accept `Date | number | string`
872
+ * for read, commit back as `number` (epoch-ms) when storage is numeric,
873
+ * else commit the raw ISO string.
874
+ *
875
+ * `<input type="date">` uses `YYYY-MM-DD`,
876
+ * `<input type="datetime-local">` uses `YYYY-MM-DDTHH:mm`,
877
+ * `<input type="time">` uses `HH:mm`. The HTML5 spec treats these as
878
+ * locale-agnostic strings — we must produce them deterministically.
879
+ */
880
+ type ModelValue = number | string | Date | null | undefined;
881
+ interface UseAsDateOptions {
882
+ modelValue: () => ModelValue;
883
+ /** Variant: `'date'` (default), `'datetime'`, `'time'`. Drives both parse and serialize. */
884
+ kind: "date" | "datetime" | "time";
885
+ /** Commit the parsed value. Numeric epoch-ms when the previous value was numeric, ISO string otherwise. `null` clears. */
886
+ onCommit: (value: number | string | null) => void;
887
+ }
888
+ interface UseAsDateReturn {
889
+ /** HTML5 input type — `'date' | 'datetime-local' | 'time'`. */
890
+ inputType: "date" | "datetime-local" | "time";
891
+ /** Bind to `<input :value>`. Empty string when no model. */
892
+ displayValue: ComputedRef<string>;
893
+ /** Bind to `@change` / `@input`. Parses the HTML5 string into the storage type. */
894
+ setFromInput: (raw: string) => void;
895
+ }
896
+ /**
897
+ * Composable backing `AsDate` / `AsDatetime` / `AsTime`. Pick the variant
898
+ * via `kind`. Conversion direction:
899
+ *
900
+ * - `'date'`: epoch-ms ↔ `YYYY-MM-DD` (local TZ).
901
+ * Empty input commits `null`. If previous value was a `string`,
902
+ * commits a string (`YYYY-MM-DD`); otherwise commits epoch-ms (UTC
903
+ * midnight on the picked date in local TZ — same as `new Date(str)`).
904
+ * - `'datetime'`: epoch-ms ↔ `YYYY-MM-DDTHH:mm` (local TZ).
905
+ * - `'time'`: prev-string ↔ `HH:mm`. Numeric storage isn't meaningful
906
+ * for naked time-of-day, so we commit a string.
907
+ */
908
+ declare function useAsDate(opts: UseAsDateOptions): UseAsDateReturn;
909
+ //#endregion
910
+ //#region src/composables/use-as-path.d.ts
911
+ interface UseAsPathReturn {
912
+ path: ComputedRef<string>;
913
+ }
914
+ /**
915
+ * Reactive read-only access to the absolute dotted path prefix at the
916
+ * current point in the `<AsForm>` tree. Returns `''` when called outside
917
+ * a form.
918
+ */
919
+ declare function useAsPath(): UseAsPathReturn;
920
+ //#endregion
921
+ //#region src/composables/use-as-type-map.d.ts
922
+ interface UseAsTypeMapReturn {
923
+ types: ComputedRef<Record<string, Component>>;
924
+ }
925
+ /**
926
+ * Reactive read-only access to the type-to-component map provided by the
927
+ * nearest `<AsForm>`. Returns an empty map when called outside a form so
928
+ * call sites do not need a null-check.
929
+ */
930
+ declare function useAsTypeMap(): UseAsTypeMapReturn;
931
+ //#endregion
932
+ //#region src/composables/use-as-data.d.ts
933
+ interface UseAsDataReturn {
934
+ /** Domain data (the unwrapped inner value of the form's `{ value }` container). */
935
+ rootData: ComputedRef<unknown>;
936
+ /** Read the value at an absolute dotted path inside the form. */
937
+ getValueAt: (path: string) => ComputedRef<unknown>;
938
+ /** Read a sibling field's value relative to the current `useAsPath()` prefix. */
939
+ siblingValue: <T = unknown>(name: string) => ComputedRef<T | undefined>;
940
+ }
941
+ /**
942
+ * Reactive read-only access to form data at any point in the
943
+ * `<AsForm>` tree. Outside a form, all readers return `undefined`.
944
+ *
945
+ * Call sites get a `ComputedRef` so they can compose it directly with
946
+ * other reactive primitives without an extra `computed()` wrapper.
947
+ */
948
+ declare function useAsData(): UseAsDataReturn;
949
+ //#endregion
950
+ //#region src/composables/use-as-error-dismiss.d.ts
951
+ /**
952
+ * Imperative dismissal of an external (server-supplied) error at a given
953
+ * absolute path. Calling this is equivalent to the user editing that
954
+ * field — useful for custom field components that commit a value through
955
+ * a side-channel (e.g. a date picker dialog) and want to hide the
956
+ * server's error before the next round-trip.
957
+ */
958
+ type AsErrorDismiss = (path: string) => void;
959
+ /**
960
+ * Returns the `dismissExternalAt` callback provided by the nearest
961
+ * ancestor `<AsForm>`. Outside a form the result is a no-op so calling
962
+ * it from a leaf component does not throw.
963
+ */
964
+ declare function useAsErrorDismiss(): AsErrorDismiss;
965
+ //#endregion
966
+ export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsDate, _default$4 as AsDatetime, _default$5 as AsDecimal, type AsErrorDismiss, _default$6 as AsField, _default$7 as AsFieldShell, _default$8 as AsForm, _default$9 as AsInput, _default$10 as AsIterator, type AsNestedSectionsStore, _default$11 as AsNumber, _default$12 as AsObject, _default$13 as AsParagraph, _default$14 as AsRadio, _default$15 as AsRef, _default$16 as AsSelect, _default$17 as AsTime, _default$18 as AsTuple, _default$19 as AsUnion, type ClientFactory, type TAsBaseComponentProps, type TAsChangeType, type TAsComponentEmits, type TAsComponentProps, type TAsTypeComponents, type TAsUnionContext, type TFormFieldCallbacks, type TFormFieldRegistration, type TFormRule, type TFormState, type TFormSubmitValidator, type UseAsArrayReturn, type UseAsDataReturn, type UseAsDateOptions, type UseAsDateReturn, type UseAsDecimalOptions, type UseAsDecimalReturn, type UseAsDualInputOptions, type UseAsDualInputReturn, type UseAsExternalErrorsOptions, type UseAsExternalErrorsReturn, type UseAsFieldOptions, type UseAsFieldReturn, type UseAsFormOptions, type UseAsFormReturn, type UseAsLocaleReturn, type UseAsNumberOptions, type UseAsNumberReturn, type UseAsOptionalAddFlowOptions, type UseAsOptionalAddFlowReturn, type UseAsPathReturn, type UseAsStateReturn, type UseAsTriStateCheckboxOptions, type UseAsTriStateCheckboxReturn, type UseAsTupleReturn, type UseAsTypeMapReturn, type UseAsUnionReturn, type UseAsValueHelpOptions, type UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, provideAsLocale, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFocusFirstAfter, useAsForm, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp };