attaform 0.30.1 → 0.31.1

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 (55) hide show
  1. package/dist/abstract.d.mts +5 -5
  2. package/dist/abstract.mjs +4 -4
  3. package/dist/dev/abstract.mjs +4 -4
  4. package/dist/dev/chunks/devtools.mjs +3 -3
  5. package/dist/dev/directive.mjs +1 -1
  6. package/dist/dev/history.mjs +15 -2
  7. package/dist/dev/index.mjs +5 -5
  8. package/dist/dev/runtime/plugins/attaform.mjs +1 -1
  9. package/dist/dev/shared/{attaform-dev.zlvDr0WB.mjs → attaform-dev.04aupFBW.mjs} +3 -2
  10. package/dist/dev/shared/{attaform-dev.DxHdkkPG.mjs → attaform-dev.3uTCYwy8.mjs} +770 -254
  11. package/dist/dev/shared/{attaform-dev.BJK1kqHY.mjs → attaform-dev.BpVGFSFa.mjs} +88 -115
  12. package/dist/dev/shared/{attaform-dev.Chm4D6SJ.mjs → attaform-dev.Bu6wgrA5.mjs} +3 -3
  13. package/dist/dev/shared/{attaform-dev.BMQ3GcgD.mjs → attaform-dev.Cbx0AiQF.mjs} +476 -337
  14. package/dist/dev/shared/attaform-dev.CwYTWyPX.mjs +120 -0
  15. package/dist/dev/shared/{attaform-dev.DuEE4GU1.mjs → attaform-dev.D7lKyM_7.mjs} +4 -4
  16. package/dist/dev/shared/{attaform-dev.CT7MDjPy.mjs → attaform-dev.OceE0X3v.mjs} +154 -229
  17. package/dist/{shared/attaform.DRsANMok.mjs → dev/shared/attaform-dev.PTGM9KE1.mjs} +16 -15
  18. package/dist/{shared/attaform.8mfKZCwH.mjs → dev/shared/attaform-dev.n6n00owJ.mjs} +49 -128
  19. package/dist/dev/zod-v3.mjs +6 -6
  20. package/dist/dev/zod-v4.mjs +6 -6
  21. package/dist/dev/zod.mjs +5 -5
  22. package/dist/directive.d.mts +2 -2
  23. package/dist/directive.mjs +1 -1
  24. package/dist/history.d.mts +1 -1
  25. package/dist/history.mjs +15 -2
  26. package/dist/index.d.mts +16 -55
  27. package/dist/index.mjs +5 -5
  28. package/dist/runtime/components/AttaformDevtoolsPanel.vue +3 -3
  29. package/dist/runtime/plugins/attaform.mjs +1 -1
  30. package/dist/shared/{attaform.CO918TdU.mjs → attaform.B5b-HmhH.mjs} +88 -115
  31. package/dist/shared/{attaform.2FslhB9R.d.mts → attaform.B9PYKlhB.d.mts} +43 -19
  32. package/dist/shared/{attaform.D_f1WgYf.mjs → attaform.BPMOl562.mjs} +458 -319
  33. package/dist/{dev/shared/attaform-dev.CZz4GYZ6.mjs → shared/attaform.BPSqtU7a.mjs} +44 -156
  34. package/dist/shared/{attaform.CdZIEf7_.mjs → attaform.BhtAZysa.mjs} +3 -2
  35. package/dist/shared/{attaform.BcQwgWaq.d.mts → attaform.CYlF4P6X.d.mts} +58 -17
  36. package/dist/shared/{attaform.WiGdIqgx.mjs → attaform.CdA9bfRv.mjs} +3 -3
  37. package/dist/shared/{attaform.BIWicztt.mjs → attaform.DAf4ehIe.mjs} +765 -251
  38. package/dist/shared/{attaform.ZYn2ahzJ.mjs → attaform.DBCbxlyk.mjs} +59 -1
  39. package/dist/shared/{attaform.L0kUn3vL.d.mts → attaform.DZOynI6c.d.mts} +1 -1
  40. package/dist/shared/{attaform.B2iebkPA.mjs → attaform.KEfNRDot.mjs} +4 -4
  41. package/dist/shared/attaform._1Zp3mDG.mjs +96 -0
  42. package/dist/shared/{attaform.Br8EBn5B.d.mts → attaform.i13OEHJF.d.mts} +195 -38
  43. package/dist/{dev/shared/attaform-dev.BUIFcTYf.mjs → shared/attaform.j9xI_ObC.mjs} +16 -15
  44. package/dist/shared/{attaform.D_pt1gOj.mjs → attaform.u6jfHoed.mjs} +154 -229
  45. package/dist/transforms.mjs +1 -1
  46. package/dist/vite.mjs +1 -1
  47. package/dist/zod-v3.d.mts +4 -4
  48. package/dist/zod-v3.mjs +6 -6
  49. package/dist/zod-v4.d.mts +22 -16
  50. package/dist/zod-v4.mjs +6 -6
  51. package/dist/zod.d.mts +4 -4
  52. package/dist/zod.mjs +5 -5
  53. package/package.json +2 -1
  54. package/skills/attaform/SKILL.md +2 -1
  55. package/skills/attaform/references/custom-components.md +4 -0
@@ -1,7 +1,7 @@
1
- import { j as humanize, c as useAbstractForm } from './attaform.BIWicztt.mjs';
2
- import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform.CdZIEf7_.mjs';
3
- import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, e as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform.DRsANMok.mjs';
4
- import { c as callConsumerFn } from './attaform.8mfKZCwH.mjs';
1
+ import { j as humanize, c as useAbstractForm } from './attaform.DAf4ehIe.mjs';
2
+ import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform.BhtAZysa.mjs';
3
+ import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, e as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform.j9xI_ObC.mjs';
4
+ import { d as callConsumerFn } from './attaform._1Zp3mDG.mjs';
5
5
 
6
6
  function readDef(schema) {
7
7
  if (schema === null || typeof schema !== "object") return void 0;
@@ -119,9 +119,7 @@ function isCoercePrimitive(schema) {
119
119
  return readDef(schema)?.coerce === true;
120
120
  }
121
121
  function isPreprocessNode(schema) {
122
- if (kindOf(schema) !== "pipe") return false;
123
- const pipeIn = unwrapPipeIn(schema);
124
- return pipeIn !== void 0 && kindOf(pipeIn) === "transform";
122
+ return kindOf(schema) === "pipe" && kindOf(readDef(schema)?.in) === "transform";
125
123
  }
126
124
  function unwrapPipeOut(schema) {
127
125
  const def = readDef(schema);
@@ -181,6 +179,9 @@ function getDiscriminatedOptions(schema) {
181
179
  return Array.isArray(options) ? options : [];
182
180
  }
183
181
  function assertZodVersion(schema) {
182
+ assertZodV4Node(schema);
183
+ }
184
+ function assertZodV4Node(schema) {
184
185
  const def = readDef(schema);
185
186
  if (def?.type === void 0) {
186
187
  throw new Error(
@@ -200,60 +201,6 @@ const DESCEND_SINGLE = [
200
201
  ];
201
202
  const DESCEND_RECORD = ["shape", "entries"];
202
203
  const DESCEND_LIST = ["options", "items"];
203
- function walkSchemaTree(schema, visit, seen) {
204
- const visited = seen ?? /* @__PURE__ */ new WeakSet();
205
- const candidate = schema;
206
- if (typeof candidate !== "object" || candidate === null) return false;
207
- if (visited.has(candidate)) return false;
208
- visited.add(candidate);
209
- if (visit(schema)) return true;
210
- const def = readDef(schema);
211
- if (def === void 0) return false;
212
- const slots = def;
213
- for (const key of DESCEND_SINGLE) {
214
- const child = slots[key];
215
- if (child !== void 0 && walkSchemaTree(child, visit, visited)) return true;
216
- }
217
- for (const key of DESCEND_RECORD) {
218
- const record = slots[key];
219
- if (record !== void 0) {
220
- for (const sub of Object.values(record)) {
221
- if (walkSchemaTree(sub, visit, visited)) return true;
222
- }
223
- }
224
- }
225
- for (const key of DESCEND_LIST) {
226
- const list = slots[key];
227
- if (list !== void 0) {
228
- for (const sub of list) {
229
- if (walkSchemaTree(sub, visit, visited)) return true;
230
- }
231
- }
232
- }
233
- if (typeof def.getter === "function") {
234
- try {
235
- const inner = def.getter();
236
- if (walkSchemaTree(inner, visit, visited)) return true;
237
- } catch {
238
- }
239
- }
240
- return false;
241
- }
242
- function containsDiscriminatedUnion(schema, seen) {
243
- return walkSchemaTree(schema, (node) => kindOf(node) === "discriminated-union", seen);
244
- }
245
- function containsAsyncRefine(schema, seen) {
246
- return walkSchemaTree(
247
- schema,
248
- (node) => {
249
- for (const check of getChecks(node)) {
250
- if (isAsyncCheck(check)) return true;
251
- }
252
- return false;
253
- },
254
- seen
255
- );
256
- }
257
204
  const CONTAINER_SLOTS = [
258
205
  "shape",
259
206
  "entries",
@@ -265,31 +212,60 @@ const CONTAINER_SLOTS = [
265
212
  "left",
266
213
  "right"
267
214
  ];
268
- function hasContainerOrRootRefine(schema, seen) {
269
- return walkSchemaTree(
270
- schema,
271
- (node) => {
272
- const def = readDef(node);
273
- if (def === void 0) return false;
274
- const slots = def;
275
- if (!CONTAINER_SLOTS.some((key) => slots[key] !== void 0)) return false;
276
- return getChecks(node).length > 0;
277
- },
278
- seen
279
- );
215
+ const capabilityMemo = /* @__PURE__ */ new WeakMap();
216
+ function capabilitiesOf(schema) {
217
+ let capabilities = capabilityMemo.get(schema);
218
+ if (capabilities === void 0) {
219
+ capabilities = scanCapabilities(schema);
220
+ const key = schema;
221
+ if (typeof key === "object" && key !== null) capabilityMemo.set(key, capabilities);
222
+ }
223
+ return capabilities;
224
+ }
225
+ function scanCapabilities(schema) {
226
+ const capabilities = {
227
+ asyncRefine: false,
228
+ asyncTransform: false,
229
+ discriminatedUnion: false,
230
+ containerOrRootRefine: false,
231
+ preprocessOrCoerce: false
232
+ };
233
+ walkCapabilities(schema, capabilities, /* @__PURE__ */ new WeakSet());
234
+ return capabilities;
235
+ }
236
+ function walkCapabilities(node, capabilities, visited) {
237
+ if (typeof node !== "object" || node === null || visited.has(node)) return;
238
+ visited.add(node);
239
+ const def = readDef(node);
240
+ if (def === void 0) return;
241
+ const checks = getChecks(node);
242
+ if (checks.some(isAsyncCheck)) capabilities.asyncRefine = true;
243
+ if (checks.some(isVerdictCheck) && CONTAINER_SLOTS.some((key) => def[key] !== void 0)) {
244
+ capabilities.containerOrRootRefine = true;
245
+ }
246
+ if (typeof def.transform === "function" && def.transform.constructor.name === "AsyncFunction") {
247
+ capabilities.asyncTransform = true;
248
+ }
249
+ if (kindOf(node) === "discriminated-union") capabilities.discriminatedUnion = true;
250
+ if (isCoercePrimitive(node) || isPreprocessNode(node)) capabilities.preprocessOrCoerce = true;
251
+ for (const key of DESCEND_SINGLE) walkCapabilities(def[key], capabilities, visited);
252
+ for (const key of DESCEND_RECORD) {
253
+ for (const sub of Object.values(def[key] ?? {})) walkCapabilities(sub, capabilities, visited);
254
+ }
255
+ for (const key of DESCEND_LIST) {
256
+ for (const sub of def[key] ?? []) walkCapabilities(sub, capabilities, visited);
257
+ }
258
+ if (typeof def.getter === "function") {
259
+ try {
260
+ walkCapabilities(def.getter(), capabilities, visited);
261
+ } catch {
262
+ }
263
+ }
280
264
  }
281
- function containsAsyncTransform(schema, seen) {
282
- return walkSchemaTree(
283
- schema,
284
- (node) => {
285
- const def = readDef(node);
286
- if (def === void 0) return false;
287
- const fn = def.transform;
288
- if (typeof fn !== "function") return false;
289
- return fn.constructor.name === "AsyncFunction";
290
- },
291
- seen
292
- );
265
+ function isVerdictCheck(check) {
266
+ if (typeof check !== "object" || check === null) return true;
267
+ const kind = check._zod?.def?.check;
268
+ return kind !== "describe" && kind !== "meta";
293
269
  }
294
270
  function isAsyncCheck(check) {
295
271
  if (typeof check !== "object" || check === null) return false;
@@ -347,17 +323,14 @@ function zodIssuesToValidationErrors(issues) {
347
323
 
348
324
  const V4_INTROSPECTOR = {
349
325
  kindOf: (schema) => kindOf(schema),
350
- getObjectShape: (schema) => getObjectShape(schema),
326
+ getObjectShape,
351
327
  getTupleItems,
352
- getDiscriminatedOptions: (schema) => getDiscriminatedOptions(schema),
328
+ getDiscriminatedOptions,
353
329
  getDiscriminator,
354
330
  getLiteralValues,
355
331
  isPreprocessNode,
356
332
  isCoercePrimitive,
357
- containsAsyncRefine,
358
- containsAsyncTransform,
359
- containsDiscriminatedUnion,
360
- hasContainerOrRootRefine,
333
+ capabilitiesOf,
361
334
  // Walker accessors (D2 / D3 / D5).
362
335
  getArrayElement: (schema) => {
363
336
  if (kindOf(schema) !== "array") return void 0;
@@ -384,7 +357,7 @@ const V4_INTROSPECTOR = {
384
357
  };
385
358
 
386
359
  function slimPrimitivesOf(schema, maxRecursionDepth) {
387
- return new Set(slimPrimitivesWalk(schema, V4_INTROSPECTOR, maxRecursionDepth));
360
+ return slimPrimitivesWalk(schema, V4_INTROSPECTOR, maxRecursionDepth);
388
361
  }
389
362
 
390
363
  function deriveDefault(schema, useDefault, maxRecursionDepth) {
@@ -516,7 +489,7 @@ function isLeafRequired(schema, depth = 0) {
516
489
  return true;
517
490
  }
518
491
  function zodV4Adapter(rootSchema) {
519
- assertZodVersion(rootSchema);
492
+ assertZodV4Node(rootSchema);
520
493
  assertKeyedRoot(rootSchema);
521
494
  return (_formKey, options) => sharedV4Schemas(
522
495
  rootSchema,
@@ -540,6 +513,7 @@ function buildV4Services() {
540
513
  slimPrimitivesOf: (schema, maxRecursionDepth) => slimPrimitivesOf(schema, maxRecursionDepth),
541
514
  deriveDefault: (schema, useDefault, maxRecursionDepth) => deriveDefault(schema, useDefault, maxRecursionDepth),
542
515
  runGetDefaults: (schema, config, maxRecursionDepth) => runGetDefaultsV4(schema, config, maxRecursionDepth),
516
+ validateSync: (schema, data) => validateSyncV4(schema, data),
543
517
  unwrapStructuralWrappers: (schema) => unwrapStructuralWrappers(schema),
544
518
  unwrapToDiscriminatedUnion: (schema) => unwrapToDiscriminatedUnion(schema),
545
519
  peelAllWrappers: (schema) => peelAllWrappers(schema),
@@ -558,37 +532,35 @@ function buildV4Services() {
558
532
  };
559
533
  }
560
534
  function runGetDefaultsV4(rootSchema, config, maxRecursionDepth) {
561
- const { data } = getDefaultValuesFromZodSchema({
535
+ return getDefaultValuesFromZodSchema({
562
536
  schema: rootSchema,
563
537
  useDefaultSchemaValues: config.useDefaultSchemaValues,
564
538
  constraints: config.constraints,
565
539
  maxRecursionDepth
566
- });
567
- if (containsAsyncTransform(rootSchema) || containsAsyncRefine(rootSchema)) {
568
- return { data, errors: void 0, success: true };
569
- }
540
+ }).data;
541
+ }
542
+ const verdictRan = /* @__PURE__ */ new WeakMap();
543
+ function validateSyncV4(rootSchema, data) {
544
+ const { asyncRefine, asyncTransform } = capabilitiesOf(rootSchema);
545
+ if (asyncRefine || asyncTransform) return [];
570
546
  try {
571
- const parseResult = rootSchema.safeParse(data);
572
- if (parseResult.success) {
573
- return { data, errors: void 0, success: true };
574
- }
575
- return {
576
- data,
577
- errors: zodIssuesToValidationErrors(parseResult.error.issues),
578
- success: false
579
- };
547
+ const jitless = !verdictRan.has(rootSchema);
548
+ if (jitless) verdictRan.set(rootSchema, true);
549
+ const parseResult = rootSchema.safeParse(data, { jitless });
550
+ return parseResult.success ? [] : zodIssuesToValidationErrors(parseResult.error.issues);
580
551
  } catch {
581
- return { data, errors: void 0, success: true };
552
+ return [];
582
553
  }
583
554
  }
584
555
  function buildSubSchemaStubV4(schema, maxRecursionDepth) {
585
556
  return {
586
- needsAsyncValidation: () => containsAsyncRefine(schema),
587
- getDefaultValues: () => ({
588
- data: deriveDefault(schema, true, maxRecursionDepth),
589
- errors: void 0,
590
- success: true
591
- }),
557
+ // Async work of either kind, as the root's `needsAsyncValidation`
558
+ // counts it: the field's `valid` waits for the first async pass.
559
+ needsAsyncValidation: () => {
560
+ const { asyncRefine, asyncTransform } = scanCapabilities(schema);
561
+ return asyncRefine || asyncTransform;
562
+ },
563
+ getDefaultValues: () => deriveDefault(schema, true, maxRecursionDepth),
592
564
  getSchemasAtPath: () => [],
593
565
  validateAtPath: async (data) => {
594
566
  const result = await schema.safeParseAsync(data);
@@ -638,7 +610,8 @@ function resolveFieldMetaAtPath(rootSchema, path, maxRecursionDepth) {
638
610
  };
639
611
  }
640
612
  function readDescription(schema) {
641
- const candidate = schema.description;
613
+ const scope = globalThis;
614
+ const candidate = scope.__zod_globalRegistry?.get(schema)?.description ?? schema.description;
642
615
  return typeof candidate === "string" ? candidate : void 0;
643
616
  }
644
617
 
@@ -1,6 +1,23 @@
1
1
  import { z } from 'zod';
2
- import { G as GenericForm, l as FlatPath, s as NestedType, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, aq as AcceptableDefaults, ac as ValidateOnConfig, a as UseFormReturnType } from './attaform.Br8EBn5B.mjs';
2
+ import { G as GenericForm, l as FlatPath, s as NestedType, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, ap as AcceptableDefaults, ab as ValidateOnConfig, a as UseFormReturnType } from './attaform.i13OEHJF.mjs';
3
3
 
4
+ /**
5
+ * A Zod v4 schema whose core definition matches `Def`, named by the
6
+ * `_zod` internals that classic `zod` and `zod/mini` schemas both carry.
7
+ */
8
+ type ZodV4SchemaOf<Def> = {
9
+ _zod: {
10
+ def: Def;
11
+ };
12
+ };
13
+ /**
14
+ * Any Zod v4 schema, from `zod` or `zod/mini`. The public signatures that
15
+ * take a v4 schema below the root (`PathInput`, `PathOutput`, `withMeta`)
16
+ * constrain on it, for the reasons `SupportedRootSchema` gives.
17
+ */
18
+ type ZodV4Schema = ZodV4SchemaOf<{
19
+ type: string;
20
+ }>;
4
21
  /**
5
22
  * The Zod v4 schema roots `useForm` accepts. A fixed-shape
6
23
  * `z.object({ … })` is the common case; `z.record(K, V)` admits a
@@ -16,22 +33,29 @@ import { G as GenericForm, l as FlatPath, s as NestedType, F as FormKey, U as Us
16
33
  * `z.map` / `z.set`) are not form roots; wrap them under a key. The
17
34
  * adapter's runtime construction rejects them with a legible error.
18
35
  *
19
- * `z.ZodObject` MUST keep its `z.ZodRawShape` argument, and the
20
- * discriminated-union arm MUST stay fully applied. The unified entry's
21
- * v4 overload constrains on `SupportedRootSchema & ZodV4Internals` to
22
- * keep v3 schemas out (see `../unified/types-zod-major.ts`). In a
23
- * single-major (v3-only) consumer install, the published `.d.mts`
24
- * resolves this `z` to v3, where a bare or under-applied Zod class is
25
- * missing its required arguments and degrades to an `any`-like error
26
- * type; `any` then absorbs the union and `any & ZodV4Internals`
27
- * collapses back to `any`, so the marker stops excluding v3 schemas and
28
- * the read slot poisons to `never`. `z.ZodRecord` carries defaults for
29
- * both arguments, so it stays concrete in either major.
30
- * `z.ZodDiscriminatedUnion` does NOT (v3 requires both arguments, and
31
- * its parameter order is the reverse of v4's), so the arm is written
32
- * fully applied; the v3-only bundled-types fixture guards it.
36
+ * Each arm is structural on `_zod.def.type`, Zod's core internals, so a
37
+ * `zod/mini` root binds exactly as its classic twin does, and the form
38
+ * types project through `z.input` / `z.output`, which are core's too. A
39
+ * plain union's `def` has no `discriminator`, which keeps it out of the
40
+ * third arm.
41
+ *
42
+ * The alias names nothing from `zod`, and the unified `attaform/zod`
43
+ * entry depends on that. Its published `.d.mts` resolves `zod` against
44
+ * the one major a consumer installed, and in a v3-only install a classic
45
+ * class reference such as `z.ZodObject` degrades to an `any`-like error
46
+ * type, which a v3 schema satisfies: the v4 overload would capture it and
47
+ * collapse its read slot to `never`. No v3 schema carries `_zod`, so this
48
+ * constraint sends every v3 schema to the v3 overload however `zod`
49
+ * resolves. The v3-only bundled-types fixture guards it.
33
50
  */
34
- type SupportedRootSchema = z.ZodObject<z.ZodRawShape> | z.ZodRecord | z.ZodDiscriminatedUnion<readonly z.ZodObject<z.ZodRawShape>[], string>;
51
+ type SupportedRootSchema = ZodV4SchemaOf<{
52
+ type: 'object';
53
+ }> | ZodV4SchemaOf<{
54
+ type: 'record';
55
+ }> | ZodV4SchemaOf<{
56
+ type: 'union';
57
+ discriminator: string;
58
+ }>;
35
59
 
36
60
  /**
37
61
  * The shape `form.values.<key>` returns at runtime. Four cases per leaf:
@@ -164,7 +188,7 @@ type StorageLeaf<L> = InputIsUnknown<L> extends true ? unknown : L extends {
164
188
  * type FlagWriteIn = PathInput<typeof schema, 'flag'> // string
165
189
  * ```
166
190
  */
167
- type PathInput<Schema extends z.ZodType, Path extends string> = z.input<Schema> extends GenericForm ? Path extends FlatPath<z.input<Schema>> ? NestedType<z.input<Schema>, Path> : never : never;
191
+ type PathInput<Schema extends ZodV4Schema, Path extends string> = z.input<Schema> extends GenericForm ? Path extends FlatPath<z.input<Schema>> ? NestedType<z.input<Schema>, Path> : never : never;
168
192
  /**
169
193
  * What `Path` holds after the full parse pipeline: the schema's
170
194
  * `z.output<Schema>` shape there. It matches `form.parse()`'s `data` and
@@ -177,7 +201,7 @@ type PathInput<Schema extends z.ZodType, Path extends string> = z.input<Schema>
177
201
  * type FlagParsedOut = PathOutput<typeof schema, 'flag'> // boolean
178
202
  * ```
179
203
  */
180
- type PathOutput<Schema extends z.ZodType, Path extends string> = z.output<Schema> extends GenericForm ? Path extends FlatPath<z.output<Schema>> ? NestedType<z.output<Schema>, Path> : never : never;
204
+ type PathOutput<Schema extends ZodV4Schema, Path extends string> = z.output<Schema> extends GenericForm ? Path extends FlatPath<z.output<Schema>> ? NestedType<z.output<Schema>, Path> : never : never;
181
205
  /**
182
206
  * Factor the three identical-shape conditionals out of `useForm`'s public
183
207
  * signature, so the bundled `.d.ts` carries one alias per shape instead
@@ -217,4 +241,4 @@ declare function useForm<Schema extends SupportedRootSchema, K extends FormKey =
217
241
  } & ValidateOnConfig): UseFormReturnType<FormOf<Schema>, OutOf<Schema>, ReadOf<Schema>, K>;
218
242
 
219
243
  export { useForm as u };
220
- export type { PathInput as P, SupportedRootSchema as S, PathOutput as a, StorageShape as b };
244
+ export type { PathInput as P, SupportedRootSchema as S, ZodV4Schema as Z, PathOutput as a, StorageShape as b };