[{"data":1,"prerenderedAt":1431},["ShallowReactive",2],{"content-\u002Fdocs\u002Frecipes\u002Fstorage-shape":3},{"id":4,"title":5,"body":6,"description":1424,"extension":1425,"meta":1426,"navigation":339,"path":1427,"seo":1428,"stem":1429,"__hash__":1430},"docs\u002Fdocs\u002Frecipes\u002Fstorage-shape.md","form.values — the storage shape",{"type":7,"value":8,"toc":1409},"minimark",[9,18,30,53,58,61,148,151,506,510,518,696,699,703,709,830,854,858,870,879,932,938,946,983,993,1002,1045,1062,1066,1069,1257,1276,1280,1283,1378,1405],[10,11,13,17],"h1",{"id":12},"formvalues-the-storage-shape",[14,15,16],"code",{},"form.values"," — the storage shape",[19,20,21,24,25,29],"p",{},[14,22,23],{},"form.values.\u003Cpath>"," answers one question: ",[26,27,28],"strong",{},"what does storage hold\nright now at this path?"," This page is the mental model that lets you\npredict the answer for any schema, at compile time and at runtime.",[19,31,32,33,36,37,40,41,44,45,48,49,52],{},"The short version: storage holds the ",[26,34,35],{},"resolved, concrete type"," at\nevery path. ",[14,38,39],{},".default()"," has fired. Preprocess has normalised. Blank\nrequired leaves have been filled with the type's falsy. The static\ntype agrees end-to-end — so direct reads (",[14,42,43],{},"form.values.flag",",\n",[14,46,47],{},"form.values.address.city.length",") just work without ",[14,50,51],{},"?."," chains,\ncasts, or schema re-parses.",[54,55,57],"h2",{"id":56},"the-three-shapes","The three shapes",[19,59,60],{},"A schema produces three different views of its data, each with a\ndistinct surface:",[62,63,64,80],"table",{},[65,66,67],"thead",{},[68,69,70,74,77],"tr",{},[71,72,73],"th",{},"Surface",[71,75,76],{},"Shape",[71,78,79],{},"What it answers",[81,82,83,106,127],"tbody",{},[68,84,85,94,99],{},[86,87,88,90,91],"td",{},[14,89,16],{}," \u002F ",[14,92,93],{},"form.fields",[86,95,96],{},[26,97,98],{},"read",[86,100,101,102,105],{},"What does storage hold now? (",[14,103,104],{},"ReadShape\u003CSchema>",")",[68,107,108,116,121],{},[86,109,110,90,113],{},[14,111,112],{},"setValue",[14,114,115],{},"defaultValues",[86,117,118],{},[26,119,120],{},"write",[86,122,123,124,105],{},"What may the consumer pass in? (",[14,125,126],{},"z.input\u003CSchema>",[68,128,129,137,142],{},[86,130,131,90,134],{},[14,132,133],{},"handleSubmit",[14,135,136],{},"form.process()",[86,138,139],{},[26,140,141],{},"submit",[86,143,144,145,105],{},"What does a successful parse yield? (",[14,146,147],{},"z.output\u003CSchema>",[19,149,150],{},"The same schema produces all three; the surface determines which one\nyou're holding.",[152,153,158],"pre",{"className":154,"code":155,"language":156,"meta":157,"style":157},"language-ts shiki shiki-themes github-light github-dark","const schema = z.object({\n  flag: z.boolean().default(true),\n  count: z.number().default(0),\n  trimmed: z.preprocess((v) => (typeof v === 'string' ? v.trim() : v), z.string()),\n  ratio: z.string().transform((v) => Number(v) \u002F 100),\n})\n\nconst form = useForm({ schema })\n\n\u002F\u002F Read — storage holds the concrete, resolved type\nform.values.flag \u002F\u002F boolean       ← .default(true) peeled\nform.values.count \u002F\u002F number        ← .default(0) peeled\nform.values.trimmed \u002F\u002F string        ← preprocess peeled to inner input\nform.values.ratio \u002F\u002F string        ← transform deferred to parse\n\n\u002F\u002F Write — `unknown` for preprocess slots, `undefined` allowed for defaulted\nform.setValue('flag', undefined) \u002F\u002F OK — default fills the gap\nform.setValue('trimmed', '  hi  ') \u002F\u002F OK — preprocess normalises at write\n\n\u002F\u002F Submit — transforms run, refinements fire\nform.handleSubmit((data) => {\n  data.ratio \u002F\u002F number ← .transform() produced this\n})\n","ts","",[14,159,160,187,211,231,293,328,334,341,357,362,369,378,387,396,405,410,416,440,462,467,473,492,501],{"__ignoreMap":157},[161,162,165,169,173,176,180,184],"span",{"class":163,"line":164},"line",1,[161,166,168],{"class":167},"szBVR","const",[161,170,172],{"class":171},"sj4cs"," schema",[161,174,175],{"class":167}," =",[161,177,179],{"class":178},"sVt8B"," z.",[161,181,183],{"class":182},"sScJk","object",[161,185,186],{"class":178},"({\n",[161,188,190,193,196,199,202,205,208],{"class":163,"line":189},2,[161,191,192],{"class":178},"  flag: z.",[161,194,195],{"class":182},"boolean",[161,197,198],{"class":178},"().",[161,200,201],{"class":182},"default",[161,203,204],{"class":178},"(",[161,206,207],{"class":171},"true",[161,209,210],{"class":178},"),\n",[161,212,214,217,220,222,224,226,229],{"class":163,"line":213},3,[161,215,216],{"class":178},"  count: z.",[161,218,219],{"class":182},"number",[161,221,198],{"class":178},[161,223,201],{"class":182},[161,225,204],{"class":178},[161,227,228],{"class":171},"0",[161,230,210],{"class":178},[161,232,234,237,240,243,247,250,253,256,259,262,265,269,272,275,278,281,284,287,290],{"class":163,"line":233},4,[161,235,236],{"class":178},"  trimmed: z.",[161,238,239],{"class":182},"preprocess",[161,241,242],{"class":178},"((",[161,244,246],{"class":245},"s4XuR","v",[161,248,249],{"class":178},") ",[161,251,252],{"class":167},"=>",[161,254,255],{"class":178}," (",[161,257,258],{"class":167},"typeof",[161,260,261],{"class":178}," v ",[161,263,264],{"class":167},"===",[161,266,268],{"class":267},"sZZnC"," 'string'",[161,270,271],{"class":167}," ?",[161,273,274],{"class":178}," v.",[161,276,277],{"class":182},"trim",[161,279,280],{"class":178},"() ",[161,282,283],{"class":167},":",[161,285,286],{"class":178}," v), z.",[161,288,289],{"class":182},"string",[161,291,292],{"class":178},"()),\n",[161,294,296,299,301,303,306,308,310,312,314,317,320,323,326],{"class":163,"line":295},5,[161,297,298],{"class":178},"  ratio: z.",[161,300,289],{"class":182},[161,302,198],{"class":178},[161,304,305],{"class":182},"transform",[161,307,242],{"class":178},[161,309,246],{"class":245},[161,311,249],{"class":178},[161,313,252],{"class":167},[161,315,316],{"class":182}," Number",[161,318,319],{"class":178},"(v) ",[161,321,322],{"class":167},"\u002F",[161,324,325],{"class":171}," 100",[161,327,210],{"class":178},[161,329,331],{"class":163,"line":330},6,[161,332,333],{"class":178},"})\n",[161,335,337],{"class":163,"line":336},7,[161,338,340],{"emptyLinePlaceholder":339},true,"\n",[161,342,344,346,349,351,354],{"class":163,"line":343},8,[161,345,168],{"class":167},[161,347,348],{"class":171}," form",[161,350,175],{"class":167},[161,352,353],{"class":182}," useForm",[161,355,356],{"class":178},"({ schema })\n",[161,358,360],{"class":163,"line":359},9,[161,361,340],{"emptyLinePlaceholder":339},[161,363,365],{"class":163,"line":364},10,[161,366,368],{"class":367},"sJ8bj","\u002F\u002F Read — storage holds the concrete, resolved type\n",[161,370,372,375],{"class":163,"line":371},11,[161,373,374],{"class":178},"form.values.flag ",[161,376,377],{"class":367},"\u002F\u002F boolean       ← .default(true) peeled\n",[161,379,381,384],{"class":163,"line":380},12,[161,382,383],{"class":178},"form.values.count ",[161,385,386],{"class":367},"\u002F\u002F number        ← .default(0) peeled\n",[161,388,390,393],{"class":163,"line":389},13,[161,391,392],{"class":178},"form.values.trimmed ",[161,394,395],{"class":367},"\u002F\u002F string        ← preprocess peeled to inner input\n",[161,397,399,402],{"class":163,"line":398},14,[161,400,401],{"class":178},"form.values.ratio ",[161,403,404],{"class":367},"\u002F\u002F string        ← transform deferred to parse\n",[161,406,408],{"class":163,"line":407},15,[161,409,340],{"emptyLinePlaceholder":339},[161,411,413],{"class":163,"line":412},16,[161,414,415],{"class":367},"\u002F\u002F Write — `unknown` for preprocess slots, `undefined` allowed for defaulted\n",[161,417,419,422,424,426,429,432,435,437],{"class":163,"line":418},17,[161,420,421],{"class":178},"form.",[161,423,112],{"class":182},[161,425,204],{"class":178},[161,427,428],{"class":267},"'flag'",[161,430,431],{"class":178},", ",[161,433,434],{"class":171},"undefined",[161,436,249],{"class":178},[161,438,439],{"class":367},"\u002F\u002F OK — default fills the gap\n",[161,441,443,445,447,449,452,454,457,459],{"class":163,"line":442},18,[161,444,421],{"class":178},[161,446,112],{"class":182},[161,448,204],{"class":178},[161,450,451],{"class":267},"'trimmed'",[161,453,431],{"class":178},[161,455,456],{"class":267},"'  hi  '",[161,458,249],{"class":178},[161,460,461],{"class":367},"\u002F\u002F OK — preprocess normalises at write\n",[161,463,465],{"class":163,"line":464},19,[161,466,340],{"emptyLinePlaceholder":339},[161,468,470],{"class":163,"line":469},20,[161,471,472],{"class":367},"\u002F\u002F Submit — transforms run, refinements fire\n",[161,474,476,478,480,482,485,487,489],{"class":163,"line":475},21,[161,477,421],{"class":178},[161,479,133],{"class":182},[161,481,242],{"class":178},[161,483,484],{"class":245},"data",[161,486,249],{"class":178},[161,488,252],{"class":167},[161,490,491],{"class":178}," {\n",[161,493,495,498],{"class":163,"line":494},22,[161,496,497],{"class":178},"  data.ratio ",[161,499,500],{"class":367},"\u002F\u002F number ← .transform() produced this\n",[161,502,504],{"class":163,"line":503},23,[161,505,333],{"class":178},[54,507,509],{"id":508},"per-wrapper-read-shape-policy","Per-wrapper read-shape policy",[19,511,512,514,515,517],{},[14,513,104],{}," (the type behind ",[14,516,16],{},") walks each field\nin the schema's shape and applies one of these rules:",[62,519,520,536],{},[65,521,522],{},[68,523,524,527,530,533],{},[71,525,526],{},"Wrapper",[71,528,529],{},"Field key",[71,531,532],{},"Field type at the key",[71,534,535],{},"Rationale",[81,537,538,561,579,593,614,634,648,666,681],{},[68,539,540,545,548,554],{},[86,541,542],{},[14,543,544],{},".default(x)",[86,546,547],{},"required",[86,549,550,551,105],{},"inner type (no ",[14,552,553],{},"| undefined",[86,555,556,557,560],{},"Storage always holds ",[14,558,559],{},"x"," or a write — never empty.",[68,562,563,568,570,573],{},[86,564,565],{},[14,566,567],{},".prefault(x)",[86,569,547],{},[86,571,572],{},"inner type",[86,574,575,576,578],{},"Same as ",[14,577,544],{},".",[68,580,581,586,588,590],{},[86,582,583],{},[14,584,585],{},".catch(x)",[86,587,547],{},[86,589,572],{},[86,591,592],{},"Catch wraps a fallback; storage holds a value.",[68,594,595,600,603,608],{},[86,596,597],{},[14,598,599],{},".optional()",[86,601,602],{},"optional",[86,604,605],{},[14,606,607],{},"inner | undefined",[86,609,610,611,613],{},"Genuinely optional — ",[14,612,434],{}," is the wrapper's marker.",[68,615,616,621,623,628],{},[86,617,618],{},[14,619,620],{},".nullable()",[86,622,547],{},[86,624,625],{},[14,626,627],{},"inner | null",[86,629,630,633],{},[14,631,632],{},"null"," is the wrapper's \"explicit empty\".",[68,635,636,641,643,645],{},[86,637,638],{},[14,639,640],{},".readonly()",[86,642,547],{},[86,644,572],{},[86,646,647],{},"Read-only is type-only; the read shape is its inner.",[68,649,650,655,657,663],{},[86,651,652],{},[14,653,654],{},"z.preprocess(fn, T)",[86,656,547],{},[86,658,659,660,105],{},"inner-T input shape (not ",[14,661,662],{},"unknown",[86,664,665],{},"Preprocess normalises at the write boundary; storage holds the post-preprocess inner-input value.",[68,667,668,673,675,678],{},[86,669,670],{},[14,671,672],{},".transform(fn)",[86,674,547],{},[86,676,677],{},"source input shape",[86,679,680],{},"Transforms run at parse, not read — storage holds the pre-transform value.",[68,682,683,686,688,693],{},[86,684,685],{},"(plain \u002F fallthrough)",[86,687,547],{},[86,689,690],{},[14,691,692],{},"z.input\u003CT>",[86,694,695],{},"Default for anything else.",[19,697,698],{},"Reads at every nested level get the same treatment recursively.",[54,700,702],{"id":701},"blank-path-synthesis","Blank-path synthesis",[19,704,705,706,708],{},"Required leaves that haven't been written to yet aren't ",[14,707,434],{}," —\nthe form library fills them with the type's falsy concrete at mount:",[62,710,711,723],{},[65,712,713],{},[68,714,715,718],{},[71,716,717],{},"Schema at path",[71,719,720,721],{},"Initial ",[14,722,23],{},[81,724,725,737,748,760,772,784,796,808,820],{},[68,726,727,732],{},[86,728,729],{},[14,730,731],{},"z.string()",[86,733,734],{},[14,735,736],{},"''",[68,738,739,744],{},[86,740,741],{},[14,742,743],{},"z.number()",[86,745,746],{},[14,747,228],{},[68,749,750,755],{},[86,751,752],{},[14,753,754],{},"z.boolean()",[86,756,757],{},[14,758,759],{},"false",[68,761,762,767],{},[86,763,764],{},[14,765,766],{},"z.bigint()",[86,768,769],{},[14,770,771],{},"0n",[68,773,774,779],{},[86,775,776],{},[14,777,778],{},"z.date()",[86,780,781],{},[14,782,783],{},"new Date(0)",[68,785,786,791],{},[86,787,788],{},[14,789,790],{},"z.array(...)",[86,792,793],{},[14,794,795],{},"[]",[68,797,798,803],{},[86,799,800],{},[14,801,802],{},"z.set(...)",[86,804,805],{},[14,806,807],{},"new Set()",[68,809,810,815],{},[86,811,812],{},[14,813,814],{},"z.record(...)",[86,816,817],{},[14,818,819],{},"{}",[68,821,822,827],{},[86,823,824],{},[14,825,826],{},"z.object({...})",[86,828,829],{},"recursive — every required property gets its own falsy",[19,831,832,833,836,837,842,843,846,847,90,849,90,851,853],{},"The runtime tracks which paths are still \"blank\" through the same\nfield-state bit ",[14,834,835],{},"field.blank"," covers — see the ",[838,839,841],"a",{"href":840},"\u002Fdocs\u002Frecipes\u002Fblank-inputs","blank inputs\nrecipe"," for the storage \u002F display\ndivergence story. Submit \u002F validate raise ",[14,844,845],{},"'No value supplied'"," for\nrequired blanks; user-typed ",[14,848,228],{},[14,850,736],{},[14,852,759],{}," are honoured.",[54,855,857],{"id":856},"three-edges-the-invariant-doesnt-promise-to-flatten","Three edges the invariant doesn't promise to flatten",[19,859,860,861,90,864,90,867,869],{},"These read as honest ",[14,862,863],{},"T | undefined",[14,865,866],{},"T | null",[14,868,863],{},"\nrespectively — they're documented edges, not bugs:",[871,872,874,876,877],"h3",{"id":873},"optional-no-default-t-undefined",[14,875,599],{}," (no default) — ",[14,878,863],{},[152,880,882],{"className":154,"code":881,"language":156,"meta":157,"style":157},"const schema = z.object({ bio: z.string().optional() })\nconst form = useForm({ schema })\n\nform.values.bio \u002F\u002F string | undefined\n",[14,883,884,908,920,924],{"__ignoreMap":157},[161,885,886,888,890,892,894,896,899,901,903,905],{"class":163,"line":164},[161,887,168],{"class":167},[161,889,172],{"class":171},[161,891,175],{"class":167},[161,893,179],{"class":178},[161,895,183],{"class":182},[161,897,898],{"class":178},"({ bio: z.",[161,900,289],{"class":182},[161,902,198],{"class":178},[161,904,602],{"class":182},[161,906,907],{"class":178},"() })\n",[161,909,910,912,914,916,918],{"class":163,"line":189},[161,911,168],{"class":167},[161,913,348],{"class":171},[161,915,175],{"class":167},[161,917,353],{"class":182},[161,919,356],{"class":178},[161,921,922],{"class":163,"line":213},[161,923,340],{"emptyLinePlaceholder":339},[161,925,926,929],{"class":163,"line":233},[161,927,928],{"class":178},"form.values.bio ",[161,930,931],{"class":367},"\u002F\u002F string | undefined\n",[19,933,934,935,937],{},"The wrapper's whole point is \"this slot may be absent.\" Storage\nrespects it — synthesis doesn't substitute an empty string. Reach\nfor ",[14,936,835],{}," if you need the storage \u002F display distinction.",[871,939,941,943,944],{"id":940},"nullable-t-null",[14,942,620],{}," — ",[14,945,866],{},[152,947,949],{"className":154,"code":948,"language":156,"meta":157,"style":157},"const schema = z.object({ ref: z.string().nullable() })\nform.values.ref \u002F\u002F string | null\n",[14,950,951,975],{"__ignoreMap":157},[161,952,953,955,957,959,961,963,966,968,970,973],{"class":163,"line":164},[161,954,168],{"class":167},[161,956,172],{"class":171},[161,958,175],{"class":167},[161,960,179],{"class":178},[161,962,183],{"class":182},[161,964,965],{"class":178},"({ ref: z.",[161,967,289],{"class":182},[161,969,198],{"class":178},[161,971,972],{"class":182},"nullable",[161,974,907],{"class":178},[161,976,977,980],{"class":163,"line":189},[161,978,979],{"class":178},"form.values.ref ",[161,981,982],{"class":367},"\u002F\u002F string | null\n",[19,984,985,987,988,990,991,578],{},[14,986,632],{}," is the wrapper's \"explicit empty\" signal — distinct from\n",[14,989,434],{}," and from ",[14,992,736],{},[871,994,996,997,943,1000],{"id":995},"array-element-past-length-t-undefined","Array element past ",[14,998,999],{},"length",[14,1001,863],{},[152,1003,1005],{"className":154,"code":1004,"language":156,"meta":157,"style":157},"const schema = z.object({ tags: z.array(z.string()) })\nform.values.tags[0] \u002F\u002F string | undefined\n",[14,1006,1007,1033],{"__ignoreMap":157},[161,1008,1009,1011,1013,1015,1017,1019,1022,1025,1028,1030],{"class":163,"line":164},[161,1010,168],{"class":167},[161,1012,172],{"class":171},[161,1014,175],{"class":167},[161,1016,179],{"class":178},[161,1018,183],{"class":182},[161,1020,1021],{"class":178},"({ tags: z.",[161,1023,1024],{"class":182},"array",[161,1026,1027],{"class":178},"(z.",[161,1029,289],{"class":182},[161,1031,1032],{"class":178},"()) })\n",[161,1034,1035,1038,1040,1043],{"class":163,"line":189},[161,1036,1037],{"class":178},"form.values.tags[",[161,1039,228],{"class":171},[161,1041,1042],{"class":178},"] ",[161,1044,931],{"class":367},[19,1046,1047,1048,1050,1051,1054,1055,1058,1059,1061],{},"The ",[14,1049,553],{}," taint comes from TypeScript's\n",[14,1052,1053],{},"noUncheckedIndexedAccess: true"," (which this repo and most strict\nconfigs set), not from the storage invariant. Iteration\n(",[14,1056,1057],{},"for (const tag of form.values.tags)",") keeps the strict ",[14,1060,289],{},"\nelement type — only direct numeric indexing is tainted.",[54,1063,1065],{"id":1064},"when-to-reach-for-which-surface","When to reach for which surface",[19,1067,1068],{},"A quick cheatsheet, mapped to the three shapes above:",[152,1070,1072],{"className":154,"code":1071,"language":156,"meta":157,"style":157},"const form = useForm({ schema })\n\n\u002F\u002F READ — anywhere you need the current value\nform.values.email \u002F\u002F primary path\nform.fields.email.value \u002F\u002F same value, plus per-field state\nform.toRef('email') \u002F\u002F ref-shaped interop for external composables\n\n\u002F\u002F WRITE — anywhere you set a value\nform.setValue('email', 'a@b.c') \u002F\u002F single path\nform.setValue({ email: 'a@b.c' }) \u002F\u002F whole-form merge\nform.clear('email') \u002F\u002F wipe to falsy-for-type\nform.reset() \u002F\u002F re-seed from declared defaults\n\n\u002F\u002F SUBMIT — once on form submission\nform.handleSubmit((data) => apiPost(data)) \u002F\u002F `data` is the post-transform output\nconst result = await form.process() \u002F\u002F imperative one-shot parse\n",[14,1073,1074,1086,1090,1095,1103,1111,1128,1132,1137,1157,1174,1190,1202,1206,1211,1234],{"__ignoreMap":157},[161,1075,1076,1078,1080,1082,1084],{"class":163,"line":164},[161,1077,168],{"class":167},[161,1079,348],{"class":171},[161,1081,175],{"class":167},[161,1083,353],{"class":182},[161,1085,356],{"class":178},[161,1087,1088],{"class":163,"line":189},[161,1089,340],{"emptyLinePlaceholder":339},[161,1091,1092],{"class":163,"line":213},[161,1093,1094],{"class":367},"\u002F\u002F READ — anywhere you need the current value\n",[161,1096,1097,1100],{"class":163,"line":233},[161,1098,1099],{"class":178},"form.values.email ",[161,1101,1102],{"class":367},"\u002F\u002F primary path\n",[161,1104,1105,1108],{"class":163,"line":295},[161,1106,1107],{"class":178},"form.fields.email.value ",[161,1109,1110],{"class":367},"\u002F\u002F same value, plus per-field state\n",[161,1112,1113,1115,1118,1120,1123,1125],{"class":163,"line":330},[161,1114,421],{"class":178},[161,1116,1117],{"class":182},"toRef",[161,1119,204],{"class":178},[161,1121,1122],{"class":267},"'email'",[161,1124,249],{"class":178},[161,1126,1127],{"class":367},"\u002F\u002F ref-shaped interop for external composables\n",[161,1129,1130],{"class":163,"line":336},[161,1131,340],{"emptyLinePlaceholder":339},[161,1133,1134],{"class":163,"line":343},[161,1135,1136],{"class":367},"\u002F\u002F WRITE — anywhere you set a value\n",[161,1138,1139,1141,1143,1145,1147,1149,1152,1154],{"class":163,"line":359},[161,1140,421],{"class":178},[161,1142,112],{"class":182},[161,1144,204],{"class":178},[161,1146,1122],{"class":267},[161,1148,431],{"class":178},[161,1150,1151],{"class":267},"'a@b.c'",[161,1153,249],{"class":178},[161,1155,1156],{"class":367},"\u002F\u002F single path\n",[161,1158,1159,1161,1163,1166,1168,1171],{"class":163,"line":364},[161,1160,421],{"class":178},[161,1162,112],{"class":182},[161,1164,1165],{"class":178},"({ email: ",[161,1167,1151],{"class":267},[161,1169,1170],{"class":178}," }) ",[161,1172,1173],{"class":367},"\u002F\u002F whole-form merge\n",[161,1175,1176,1178,1181,1183,1185,1187],{"class":163,"line":371},[161,1177,421],{"class":178},[161,1179,1180],{"class":182},"clear",[161,1182,204],{"class":178},[161,1184,1122],{"class":267},[161,1186,249],{"class":178},[161,1188,1189],{"class":367},"\u002F\u002F wipe to falsy-for-type\n",[161,1191,1192,1194,1197,1199],{"class":163,"line":380},[161,1193,421],{"class":178},[161,1195,1196],{"class":182},"reset",[161,1198,280],{"class":178},[161,1200,1201],{"class":367},"\u002F\u002F re-seed from declared defaults\n",[161,1203,1204],{"class":163,"line":389},[161,1205,340],{"emptyLinePlaceholder":339},[161,1207,1208],{"class":163,"line":398},[161,1209,1210],{"class":367},"\u002F\u002F SUBMIT — once on form submission\n",[161,1212,1213,1215,1217,1219,1221,1223,1225,1228,1231],{"class":163,"line":407},[161,1214,421],{"class":178},[161,1216,133],{"class":182},[161,1218,242],{"class":178},[161,1220,484],{"class":245},[161,1222,249],{"class":178},[161,1224,252],{"class":167},[161,1226,1227],{"class":182}," apiPost",[161,1229,1230],{"class":178},"(data)) ",[161,1232,1233],{"class":367},"\u002F\u002F `data` is the post-transform output\n",[161,1235,1236,1238,1241,1243,1246,1249,1252,1254],{"class":163,"line":412},[161,1237,168],{"class":167},[161,1239,1240],{"class":171}," result",[161,1242,175],{"class":167},[161,1244,1245],{"class":167}," await",[161,1247,1248],{"class":178}," form.",[161,1250,1251],{"class":182},"process",[161,1253,280],{"class":178},[161,1255,1256],{"class":367},"\u002F\u002F imperative one-shot parse\n",[19,1258,1259,1260,1263,1264,1266,1267,1269,1270,1272,1273,1275],{},"Each surface uses the shape that's correct for its purpose. The mental\ndiscipline is: ",[26,1261,1262],{},"don't reach across surfaces."," If you want post-\ntransform output, go through submit. If you want the raw user input,\ngo through ",[14,1265,16],{},". If you want to write, go through ",[14,1268,112],{},"\nor ",[14,1271,1180],{}," — the proxy at ",[14,1274,16],{}," is read-only on purpose.",[54,1277,1279],{"id":1278},"reset-vs-clear-the-orthogonality","Reset vs clear — the orthogonality",[19,1281,1282],{},"The two operations look adjacent but mean different things:",[152,1284,1286],{"className":154,"code":1285,"language":156,"meta":157,"style":157},"const schema = z.object({\n  notify: z.boolean().default(true),\n  count: z.number().default(5),\n})\nconst form = useForm({ schema })\n\nform.reset() \u002F\u002F notify → true,  count → 5  (declared defaults)\nform.clear() \u002F\u002F notify → false, count → 0  (falsy-for-type)\n",[14,1287,1288,1302,1319,1336,1340,1352,1356,1367],{"__ignoreMap":157},[161,1289,1290,1292,1294,1296,1298,1300],{"class":163,"line":164},[161,1291,168],{"class":167},[161,1293,172],{"class":171},[161,1295,175],{"class":167},[161,1297,179],{"class":178},[161,1299,183],{"class":182},[161,1301,186],{"class":178},[161,1303,1304,1307,1309,1311,1313,1315,1317],{"class":163,"line":189},[161,1305,1306],{"class":178},"  notify: z.",[161,1308,195],{"class":182},[161,1310,198],{"class":178},[161,1312,201],{"class":182},[161,1314,204],{"class":178},[161,1316,207],{"class":171},[161,1318,210],{"class":178},[161,1320,1321,1323,1325,1327,1329,1331,1334],{"class":163,"line":213},[161,1322,216],{"class":178},[161,1324,219],{"class":182},[161,1326,198],{"class":178},[161,1328,201],{"class":182},[161,1330,204],{"class":178},[161,1332,1333],{"class":171},"5",[161,1335,210],{"class":178},[161,1337,1338],{"class":163,"line":233},[161,1339,333],{"class":178},[161,1341,1342,1344,1346,1348,1350],{"class":163,"line":295},[161,1343,168],{"class":167},[161,1345,348],{"class":171},[161,1347,175],{"class":167},[161,1349,353],{"class":182},[161,1351,356],{"class":178},[161,1353,1354],{"class":163,"line":330},[161,1355,340],{"emptyLinePlaceholder":339},[161,1357,1358,1360,1362,1364],{"class":163,"line":336},[161,1359,421],{"class":178},[161,1361,1196],{"class":182},[161,1363,280],{"class":178},[161,1365,1366],{"class":367},"\u002F\u002F notify → true,  count → 5  (declared defaults)\n",[161,1368,1369,1371,1373,1375],{"class":163,"line":343},[161,1370,421],{"class":178},[161,1372,1180],{"class":182},[161,1374,280],{"class":178},[161,1376,1377],{"class":367},"\u002F\u002F notify → false, count → 0  (falsy-for-type)\n",[19,1379,1380,1382,1383,1385,1386,1388,1389,1392,1393,1396,1397,1400,1401,578],{},[14,1381,1196],{}," re-applies the schema's declared ",[14,1384,39],{}," values; ",[14,1387,1180],{},"\nignores them and writes the type's falsy concrete instead. Both\naccept a path argument (",[14,1390,1391],{},"reset(next?)"," reseeds the whole form;\n",[14,1394,1395],{},"resetField(path)"," reseeds one; ",[14,1398,1399],{},"clear(path?)"," wipes one or the whole\nform). The full surface lives in ",[838,1402,1404],{"href":1403},"\u002Fdocs\u002Fapi\u002Fuse-form-return#reset","the useForm return\nreference",[1406,1407,1408],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":157,"searchDepth":189,"depth":189,"links":1410},[1411,1412,1413,1414,1422,1423],{"id":56,"depth":189,"text":57},{"id":508,"depth":189,"text":509},{"id":701,"depth":189,"text":702},{"id":856,"depth":189,"text":857,"children":1415},[1416,1418,1420],{"id":873,"depth":213,"text":1417},".optional() (no default) — T | undefined",{"id":940,"depth":213,"text":1419},".nullable() — T | null",{"id":995,"depth":213,"text":1421},"Array element past length — T | undefined",{"id":1064,"depth":189,"text":1065},{"id":1278,"depth":189,"text":1279},"A single mental model for what form.values returns. Defaults are pre-resolved; preprocess is normalised; optional\u002Fnullable keep their wrappers; transforms only run at parse time.","md",{},"\u002Fdocs\u002Frecipes\u002Fstorage-shape",{"title":5,"description":1424},"docs\u002Frecipes\u002Fstorage-shape","GI0GhAdbN4M_jSGLl72DXpX8hEppa2NFocLFbDBc6jk",1778695668924]