[{"data":1,"prerenderedAt":1985},["ShallowReactive",2],{"content-\u002Fdocs\u002Fschemas\u002Fabstract-schema":3},{"id":4,"title":5,"body":6,"description":1966,"extension":1967,"meta":1968,"metaRows":1969,"navigation":121,"path":1980,"seo":1981,"source":1982,"stem":1983,"__hash__":1984},"docs\u002Fdocs\u002Fschemas\u002Fabstract-schema.md","AbstractSchema",{"type":7,"value":8,"toc":1936},"minimark",[9,13,24,27,38,43,490,493,497,504,507,521,532,536,542,567,573,580,618,626,630,636,654,657,663,686,692,714,720,737,743,767,773,783,787,793,812,819,823,834,850,858,867,871,874,894,1811,1817,1870,1874,1894,1898,1932],[10,11,5],"h1",{"id":12},"abstractschema",[14,15,16],"blockquote",{},[17,18,19,20,23],"p",{},"Attaform is schema-agnostic at the core. Wire any schema library (Valibot, ArkType, Effect-Schema, a hand-rolled validator) into the runtime by implementing the ",[21,22,5],"code",{}," contract.",[25,26],"docs-meta-table",{},[17,28,29,30,33,34,37],{},"This page is the contract reference. The Zod adapters under ",[21,31,32],{},"attaform\u002Fzod"," and ",[21,35,36],{},"attaform\u002Fzod-v3"," are reference implementations; read their source when you need a concrete example of any of the methods below.",[39,40,42],"h2",{"id":41},"the-contract","The contract",[44,45,50],"pre",{"className":46,"code":47,"language":48,"meta":49,"style":49},"language-ts shiki shiki-themes github-light github-dark","type AbstractSchema\u003CForm, GetValueFormType = Form> = {\n  \u002F\u002F Identity\n  fingerprint(): string\n\n  \u002F\u002F Defaults\n  getDefaultValues(config): DefaultValuesResponse\u003CForm>\n  getDefaultAtPath(path: Path): unknown\n\n  \u002F\u002F Shape introspection\n  arrayShapeAtPath(path: Path): number | null | undefined\n  isLeafAtPath(path: Path): boolean\n  isRequiredAtPath(path: Path): boolean\n  getSchemasAtPath(path: Path): AbstractSchema\u003Cunknown, GetValueFormType>[]\n  getSlimPrimitiveTypesAtPath(path: Path): Set\u003CSlimPrimitiveKind>\n  getUnionDiscriminatorAtPath(path: Path): UnionDiscriminatorContext | undefined\n\n  \u002F\u002F Validation\n  validateAtPath(\n    data: unknown,\n    path: Path | undefined,\n    options?: ValidateOptions\n  ): MaybePromise\u003CValidationResponse\u003CForm>>\n\n  \u002F\u002F Optional hooks\n  getFieldMetaAtPath?(path: Path): ResolvedFieldMeta\n  needsAsyncValidation?(): boolean\n}\n","ts","",[21,51,52,93,100,116,123,129,157,180,185,191,223,244,264,296,324,349,354,360,369,383,400,412,435,440,446,470,484],{"__ignoreMap":49},[53,54,57,61,65,69,72,75,78,81,84,87,90],"span",{"class":55,"line":56},"line",1,[53,58,60],{"class":59},"szBVR","type",[53,62,64],{"class":63},"sScJk"," AbstractSchema",[53,66,68],{"class":67},"sVt8B","\u003C",[53,70,71],{"class":63},"Form",[53,73,74],{"class":67},", ",[53,76,77],{"class":63},"GetValueFormType",[53,79,80],{"class":59}," =",[53,82,83],{"class":63}," Form",[53,85,86],{"class":67},"> ",[53,88,89],{"class":59},"=",[53,91,92],{"class":67}," {\n",[53,94,96],{"class":55,"line":95},2,[53,97,99],{"class":98},"sJ8bj","  \u002F\u002F Identity\n",[53,101,103,106,109,112],{"class":55,"line":102},3,[53,104,105],{"class":63},"  fingerprint",[53,107,108],{"class":67},"()",[53,110,111],{"class":59},":",[53,113,115],{"class":114},"sj4cs"," string\n",[53,117,119],{"class":55,"line":118},4,[53,120,122],{"emptyLinePlaceholder":121},true,"\n",[53,124,126],{"class":55,"line":125},5,[53,127,128],{"class":98},"  \u002F\u002F Defaults\n",[53,130,132,135,138,142,145,147,150,152,154],{"class":55,"line":131},6,[53,133,134],{"class":63},"  getDefaultValues",[53,136,137],{"class":67},"(",[53,139,141],{"class":140},"s4XuR","config",[53,143,144],{"class":67},")",[53,146,111],{"class":59},[53,148,149],{"class":63}," DefaultValuesResponse",[53,151,68],{"class":67},[53,153,71],{"class":63},[53,155,156],{"class":67},">\n",[53,158,160,163,165,168,170,173,175,177],{"class":55,"line":159},7,[53,161,162],{"class":63},"  getDefaultAtPath",[53,164,137],{"class":67},[53,166,167],{"class":140},"path",[53,169,111],{"class":59},[53,171,172],{"class":63}," Path",[53,174,144],{"class":67},[53,176,111],{"class":59},[53,178,179],{"class":114}," unknown\n",[53,181,183],{"class":55,"line":182},8,[53,184,122],{"emptyLinePlaceholder":121},[53,186,188],{"class":55,"line":187},9,[53,189,190],{"class":98},"  \u002F\u002F Shape introspection\n",[53,192,194,197,199,201,203,205,207,209,212,215,218,220],{"class":55,"line":193},10,[53,195,196],{"class":63},"  arrayShapeAtPath",[53,198,137],{"class":67},[53,200,167],{"class":140},[53,202,111],{"class":59},[53,204,172],{"class":63},[53,206,144],{"class":67},[53,208,111],{"class":59},[53,210,211],{"class":114}," number",[53,213,214],{"class":59}," |",[53,216,217],{"class":114}," null",[53,219,214],{"class":59},[53,221,222],{"class":114}," undefined\n",[53,224,226,229,231,233,235,237,239,241],{"class":55,"line":225},11,[53,227,228],{"class":63},"  isLeafAtPath",[53,230,137],{"class":67},[53,232,167],{"class":140},[53,234,111],{"class":59},[53,236,172],{"class":63},[53,238,144],{"class":67},[53,240,111],{"class":59},[53,242,243],{"class":114}," boolean\n",[53,245,247,250,252,254,256,258,260,262],{"class":55,"line":246},12,[53,248,249],{"class":63},"  isRequiredAtPath",[53,251,137],{"class":67},[53,253,167],{"class":140},[53,255,111],{"class":59},[53,257,172],{"class":63},[53,259,144],{"class":67},[53,261,111],{"class":59},[53,263,243],{"class":114},[53,265,267,270,272,274,276,278,280,282,284,286,289,291,293],{"class":55,"line":266},13,[53,268,269],{"class":63},"  getSchemasAtPath",[53,271,137],{"class":67},[53,273,167],{"class":140},[53,275,111],{"class":59},[53,277,172],{"class":63},[53,279,144],{"class":67},[53,281,111],{"class":59},[53,283,64],{"class":63},[53,285,68],{"class":67},[53,287,288],{"class":114},"unknown",[53,290,74],{"class":67},[53,292,77],{"class":63},[53,294,295],{"class":67},">[]\n",[53,297,299,302,304,306,308,310,312,314,317,319,322],{"class":55,"line":298},14,[53,300,301],{"class":63},"  getSlimPrimitiveTypesAtPath",[53,303,137],{"class":67},[53,305,167],{"class":140},[53,307,111],{"class":59},[53,309,172],{"class":63},[53,311,144],{"class":67},[53,313,111],{"class":59},[53,315,316],{"class":63}," Set",[53,318,68],{"class":67},[53,320,321],{"class":63},"SlimPrimitiveKind",[53,323,156],{"class":67},[53,325,327,330,332,334,336,338,340,342,345,347],{"class":55,"line":326},15,[53,328,329],{"class":63},"  getUnionDiscriminatorAtPath",[53,331,137],{"class":67},[53,333,167],{"class":140},[53,335,111],{"class":59},[53,337,172],{"class":63},[53,339,144],{"class":67},[53,341,111],{"class":59},[53,343,344],{"class":63}," UnionDiscriminatorContext",[53,346,214],{"class":59},[53,348,222],{"class":114},[53,350,352],{"class":55,"line":351},16,[53,353,122],{"emptyLinePlaceholder":121},[53,355,357],{"class":55,"line":356},17,[53,358,359],{"class":98},"  \u002F\u002F Validation\n",[53,361,363,366],{"class":55,"line":362},18,[53,364,365],{"class":63},"  validateAtPath",[53,367,368],{"class":67},"(\n",[53,370,372,375,377,380],{"class":55,"line":371},19,[53,373,374],{"class":140},"    data",[53,376,111],{"class":59},[53,378,379],{"class":114}," unknown",[53,381,382],{"class":67},",\n",[53,384,386,389,391,393,395,398],{"class":55,"line":385},20,[53,387,388],{"class":140},"    path",[53,390,111],{"class":59},[53,392,172],{"class":63},[53,394,214],{"class":59},[53,396,397],{"class":114}," undefined",[53,399,382],{"class":67},[53,401,403,406,409],{"class":55,"line":402},21,[53,404,405],{"class":140},"    options",[53,407,408],{"class":59},"?:",[53,410,411],{"class":63}," ValidateOptions\n",[53,413,415,418,420,423,425,428,430,432],{"class":55,"line":414},22,[53,416,417],{"class":67},"  )",[53,419,111],{"class":59},[53,421,422],{"class":63}," MaybePromise",[53,424,68],{"class":67},[53,426,427],{"class":63},"ValidationResponse",[53,429,68],{"class":67},[53,431,71],{"class":63},[53,433,434],{"class":67},">>\n",[53,436,438],{"class":55,"line":437},23,[53,439,122],{"emptyLinePlaceholder":121},[53,441,443],{"class":55,"line":442},24,[53,444,445],{"class":98},"  \u002F\u002F Optional hooks\n",[53,447,449,452,455,457,459,461,463,465,467],{"class":55,"line":448},25,[53,450,451],{"class":63},"  getFieldMetaAtPath",[53,453,454],{"class":59},"?",[53,456,137],{"class":67},[53,458,167],{"class":140},[53,460,111],{"class":59},[53,462,172],{"class":63},[53,464,144],{"class":67},[53,466,111],{"class":59},[53,468,469],{"class":63}," ResolvedFieldMeta\n",[53,471,473,476,478,480,482],{"class":55,"line":472},26,[53,474,475],{"class":63},"  needsAsyncValidation",[53,477,454],{"class":59},[53,479,108],{"class":67},[53,481,111],{"class":59},[53,483,243],{"class":114},[53,485,487],{"class":55,"line":486},27,[53,488,489],{"class":67},"}\n",[17,491,492],{},"Twelve required methods. Two optional hooks. The runtime fills in sensible fallbacks for the optional hooks, so omit them when your library doesn't model the feature.",[39,494,496],{"id":495},"identity","Identity",[498,499,501],"h3",{"id":500},"fingerprint",[21,502,503],{},"fingerprint()",[17,505,506],{},"Structural signature of the schema. Two schemas with the same shape return the same string; different shapes return different strings. Used to:",[508,509,510,518],"ul",{},[511,512,513,514,517],"li",{},"Catch shared-key mismatches in dev (two ",[21,515,516],{},"useForm({ key: 'x' })"," calls with different schemas warn).",[511,519,520],{},"Key persisted drafts so schema changes auto-invalidate stale drafts.",[17,522,523,524,527,528,531],{},"Must NOT throw. If it does, Attaform catches the exception, logs it via ",[21,525,526],{},"console.error"," in dev, and skips the shared-key mismatch check for that call. An opaque stable string (",[21,529,530],{},"'custom-adapter:v1'",") is a valid fallback; opaque fingerprints disable schema-change auto-invalidation for persisted drafts (the key never changes), so prefer a real structural hash if your library exposes the metadata.",[39,533,535],{"id":534},"defaults","Defaults",[498,537,539],{"id":538},"getdefaultvaluesconfig-defaultvaluesresponseform",[21,540,541],{},"getDefaultValues(config): DefaultValuesResponse\u003CForm>",[17,543,544,545,548,549,552,553,555,556,74,559,562,563,566],{},"Returns ",[21,546,547],{},"{ data, errors, success, formKey }",". Called at form creation and on ",[21,550,551],{},"reset()",". The ",[21,554,141],{}," argument carries ",[21,557,558],{},"useDefaultSchemaValues",[21,560,561],{},"constraints",", and ",[21,564,565],{},"strict"," flags.",[498,568,570],{"id":569},"getdefaultatpathpath-path-unknown",[21,571,572],{},"getDefaultAtPath(path: Path): unknown",[17,574,575,576,579],{},"Returns the schema-prescribed default at a structured path. The runtime calls this on every ",[21,577,578],{},"setValue"," to fill structural gaps:",[508,581,582,585,588,591,594,597,608],{},[511,583,584],{},"Empty path → whole-form default.",[511,586,587],{},"Object property → property's default.",[511,589,590],{},"Array index → element default.",[511,592,593],{},"Tuple position → position's default.",[511,595,596],{},"Optional \u002F nullable around a structural inner → inner default.",[511,598,599,600,603,604,607],{},"Optional \u002F nullable around a primitive → ",[21,601,602],{},"undefined"," \u002F ",[21,605,606],{},"null"," (preserve the wrapper's semantic).",[511,609,610,613,614,617],{},[21,611,612],{},".default(x)"," wrapper → ",[21,615,616],{},"x",".",[17,619,620,621,623,624,617],{},"Return ",[21,622,602],{}," for paths that don't exist in the schema. Must NOT throw; the runtime skips filling on ",[21,625,602],{},[39,627,629],{"id":628},"shape-introspection","Shape introspection",[498,631,633],{"id":632},"arrayshapeatpathpath-path-number-null-undefined",[21,634,635],{},"arrayShapeAtPath(path: Path): number | null | undefined",[508,637,638,644,649],{},[511,639,640,643],{},[21,641,642],{},"number",": tuple's fixed length.",[511,645,646,648],{},[21,647,606],{},": unbounded array.",[511,650,651,653],{},[21,652,602],{},": non-array path.",[17,655,656],{},"The runtime caches the answer to skip per-write probe loops on array writes.",[498,658,660],{"id":659},"isleafatpathpath-path-boolean",[21,661,662],{},"isLeafAtPath(path: Path): boolean",[17,664,665,668,669,672,673,74,676,74,679,74,682,685],{},[21,666,667],{},"true"," for primitive paths, ",[21,670,671],{},"false"," for object \u002F array \u002F map \u002F set containers. Drives the proxy's descend-vs-terminate decision; reserved leaf-prop names (",[21,674,675],{},"dirty",[21,677,678],{},"errors",[21,680,681],{},"valid",[21,683,684],{},"label",", …) inject only at the FieldState terminal.",[498,687,689],{"id":688},"isrequiredatpathpath-path-boolean",[21,690,691],{},"isRequiredAtPath(path: Path): boolean",[17,693,694,696,697,603,700,603,703,603,706,709,710,713],{},[21,695,667],{}," when the leaf is required (no ",[21,698,699],{},".optional()",[21,701,702],{},".nullable()",[21,704,705],{},".default()",[21,707,708],{},".catch()"," wrapper around it). Used by the blank validation augmentation to raise ",[21,711,712],{},"'No value supplied'"," for unfilled required fields.",[498,715,717],{"id":716},"getschemasatpathpath-path-abstractschema",[21,718,719],{},"getSchemasAtPath(path: Path): AbstractSchema[]",[17,721,722,723,725,726,728,729,732,733,736],{},"List of candidate sub-schemas at ",[21,724,167],{},". Multiple results are expected for discriminated-union branches. ",[21,727,167],{}," is a canonical ",[21,730,731],{},"Segment[]",". Return ",[21,734,735],{},"[]"," if your library doesn't model union-style multi-candidates.",[498,738,740],{"id":739},"getslimprimitivetypesatpathpath-path-setslimprimitivekind",[21,741,742],{},"getSlimPrimitiveTypesAtPath(path: Path): Set\u003CSlimPrimitiveKind>",[17,744,745,746,749,750,74,753,74,756,74,759,762,763,766],{},"Set of primitive ",[21,747,748],{},"typeof","-style kinds the path's leaf accepts at write time (",[21,751,752],{},"'string'",[21,754,755],{},"'number'",[21,757,758],{},"'boolean'",[21,760,761],{},"'bigint'",", …). Drives the slim-primitive write gate. Return a permissive fallback (",[21,764,765],{},"new Set(['string', 'number', 'boolean', 'bigint', 'symbol', 'date', 'undefined', 'null'])",") for paths the schema doesn't declare; over-rejecting writes breaks dynamic \u002F SSR rehydration.",[498,768,770],{"id":769},"getuniondiscriminatoratpathpath-path-uniondiscriminatorcontext-undefined",[21,771,772],{},"getUnionDiscriminatorAtPath(path: Path): UnionDiscriminatorContext | undefined",[17,774,775,776,779,780,782],{},"For discriminated-union containers, return ",[21,777,778],{},"{ discriminatorKey, getVariantDefault }",". Used by the variant-reshape pipeline so a discriminator-key write swaps the active branch without leaking old keys. Return ",[21,781,602],{}," if your library doesn't model DUs.",[39,784,786],{"id":785},"validation","Validation",[498,788,790],{"id":789},"validateatpathdata-path-options-maybepromisevalidationresponse",[21,791,792],{},"validateAtPath(data, path?, options?): MaybePromise\u003CValidationResponse>",[17,794,544,795,798,799,801,802,804,805,807,808,811],{},[21,796,797],{},"MaybePromise\u003CValidationResponse>",". ",[21,800,167],{}," is a ",[21,803,731],{}," or ",[21,806,602],{}," (whole-form validation). Honor ",[21,809,810],{},"options.sync"," when the schema is sync-capable; the runtime uses it to batch error writes inside DU variant reshape.",[17,813,814,815,818],{},"Must NOT throw. Return ",[21,816,817],{},"{ success: false, errors }"," for validation failures.",[39,820,822],{"id":821},"optional-hooks","Optional hooks",[498,824,826,829,830],{"id":825},"getfieldmetaatpathpath-path-resolvedfieldmeta-optional",[21,827,828],{},"getFieldMetaAtPath(path: Path): ResolvedFieldMeta"," ",[831,832,833],"em",{},"(optional)",[17,835,836,837,603,840,603,843,603,846,849],{},"Resolves schema-attached metadata (label, description, placeholder, full payload). Drives ",[21,838,839],{},"form.fields(p).label",[21,841,842],{},".description",[21,844,845],{},".placeholder",[21,847,848],{},".meta",". Omit if your library doesn't model metadata yet, and consumers see humanized fallbacks.",[498,851,853,829,856],{"id":852},"needsasyncvalidation-boolean-optional",[21,854,855],{},"needsAsyncValidation(): boolean",[831,857,833],{},[17,859,620,860,862,863,866],{},[21,861,667],{}," if ",[21,864,865],{},"validateAtPath"," may need a Promise to surface every error this schema can produce. The runtime uses this to decide whether to schedule a one-shot construction-time async pass.",[39,868,870],{"id":869},"a-minimal-valibot-ish-adapter","A minimal Valibot-ish adapter",[17,872,873],{},"Assume your library exposes:",[508,875,876,882],{},[511,877,878,881],{},[21,879,880],{},"schema.defaultValues()"," returning the schema's typed defaults.",[511,883,884,887,888,804,891,617],{},[21,885,886],{},"schema.parse(data)"," returning ",[21,889,890],{},"{ success: true, data }",[21,892,893],{},"{ success: false, issues: { path: string[]; message: string }[] }",[44,895,897],{"className":46,"code":896,"language":48,"meta":49,"style":49},"import type {\n  AbstractSchema,\n  DefaultValuesResponse,\n  SlimPrimitiveKind,\n  ValidationError,\n  ValidationResponse,\n} from 'attaform'\nimport type { GenericForm } from 'attaform'\n\nconst PERMISSIVE: ReadonlySet\u003CSlimPrimitiveKind> = new Set\u003CSlimPrimitiveKind>([\n  'string',\n  'number',\n  'boolean',\n  'bigint',\n  'symbol',\n  'date',\n  'undefined',\n  'null',\n])\n\nexport function myLibAdapter\u003CF extends GenericForm>(schema: MyLibSchema\u003CF>): AbstractSchema\u003CF, F> {\n  return {\n    fingerprint() {\n      return schema.signature?.() ?? 'my-lib:v1'\n    },\n\n    getDefaultValues({ constraints }): DefaultValuesResponse\u003CF> {\n      const defaults = schema.defaultValues()\n      const merged = mergeDeepPartial(defaults, constraints)\n      return { data: merged, errors: undefined, success: true, formKey: '' }\n    },\n\n    getDefaultAtPath(path) {\n      return walkSchemaToDefault(schema, path)\n    },\n\n    arrayShapeAtPath(path) {\n      return walkSchemaToArrayShape(schema, path)\n    },\n\n    isLeafAtPath(path) {\n      const kinds = walkSchemaToSlimPrimitives(schema, path)\n      if (kinds === undefined) return false\n      return ![...kinds].some((k) => k === 'object' || k === 'array' || k === 'map' || k === 'set')\n    },\n\n    isRequiredAtPath(path) {\n      const leaf = walkSchemaToLeaf(schema, path)\n      return leaf?.isRequired ?? false\n    },\n\n    getSchemasAtPath() {\n      return []\n    },\n\n    getSlimPrimitiveTypesAtPath(path) {\n      return walkSchemaToSlimPrimitives(schema, path) ?? PERMISSIVE\n    },\n\n    getUnionDiscriminatorAtPath() {\n      return undefined\n    },\n\n    validateAtPath(data, path) {\n      const result = path !== undefined ? schema.parseAtPath(data, path) : schema.parse(data)\n\n      if (result.success) {\n        return { success: true, data: result.data, errors: [], formKey: '' }\n      }\n\n      const errors: ValidationError[] = result.issues.map((issue) => ({\n        path: issue.path,\n        message: issue.message,\n        code: `my-lib:${issue.code ?? 'unknown'}`,\n        formKey: '',\n      }))\n\n      return { success: false, errors, data: undefined, formKey: '' }\n    },\n  }\n}\n",[21,898,899,909,914,919,924,929,934,946,959,963,996,1003,1010,1017,1024,1031,1038,1045,1052,1057,1061,1116,1123,1131,1151,1156,1160,1183,1202,1218,1242,1247,1252,1265,1276,1281,1286,1298,1308,1313,1318,1330,1345,1368,1438,1443,1448,1460,1475,1487,1492,1497,1505,1513,1518,1523,1535,1550,1555,1560,1568,1575,1580,1585,1602,1641,1646,1654,1672,1678,1683,1719,1725,1731,1754,1764,1770,1775,1795,1800,1806],{"__ignoreMap":49},[53,900,901,904,907],{"class":55,"line":56},[53,902,903],{"class":59},"import",[53,905,906],{"class":59}," type",[53,908,92],{"class":67},[53,910,911],{"class":55,"line":95},[53,912,913],{"class":67},"  AbstractSchema,\n",[53,915,916],{"class":55,"line":102},[53,917,918],{"class":67},"  DefaultValuesResponse,\n",[53,920,921],{"class":55,"line":118},[53,922,923],{"class":67},"  SlimPrimitiveKind,\n",[53,925,926],{"class":55,"line":125},[53,927,928],{"class":67},"  ValidationError,\n",[53,930,931],{"class":55,"line":131},[53,932,933],{"class":67},"  ValidationResponse,\n",[53,935,936,939,942],{"class":55,"line":159},[53,937,938],{"class":67},"} ",[53,940,941],{"class":59},"from",[53,943,945],{"class":944},"sZZnC"," 'attaform'\n",[53,947,948,950,952,955,957],{"class":55,"line":182},[53,949,903],{"class":59},[53,951,906],{"class":59},[53,953,954],{"class":67}," { GenericForm } ",[53,956,941],{"class":59},[53,958,945],{"class":944},[53,960,961],{"class":55,"line":187},[53,962,122],{"emptyLinePlaceholder":121},[53,964,965,968,971,973,976,978,980,982,984,987,989,991,993],{"class":55,"line":193},[53,966,967],{"class":59},"const",[53,969,970],{"class":114}," PERMISSIVE",[53,972,111],{"class":59},[53,974,975],{"class":63}," ReadonlySet",[53,977,68],{"class":67},[53,979,321],{"class":63},[53,981,86],{"class":67},[53,983,89],{"class":59},[53,985,986],{"class":59}," new",[53,988,316],{"class":63},[53,990,68],{"class":67},[53,992,321],{"class":63},[53,994,995],{"class":67},">([\n",[53,997,998,1001],{"class":55,"line":225},[53,999,1000],{"class":944},"  'string'",[53,1002,382],{"class":67},[53,1004,1005,1008],{"class":55,"line":246},[53,1006,1007],{"class":944},"  'number'",[53,1009,382],{"class":67},[53,1011,1012,1015],{"class":55,"line":266},[53,1013,1014],{"class":944},"  'boolean'",[53,1016,382],{"class":67},[53,1018,1019,1022],{"class":55,"line":298},[53,1020,1021],{"class":944},"  'bigint'",[53,1023,382],{"class":67},[53,1025,1026,1029],{"class":55,"line":326},[53,1027,1028],{"class":944},"  'symbol'",[53,1030,382],{"class":67},[53,1032,1033,1036],{"class":55,"line":351},[53,1034,1035],{"class":944},"  'date'",[53,1037,382],{"class":67},[53,1039,1040,1043],{"class":55,"line":356},[53,1041,1042],{"class":944},"  'undefined'",[53,1044,382],{"class":67},[53,1046,1047,1050],{"class":55,"line":362},[53,1048,1049],{"class":944},"  'null'",[53,1051,382],{"class":67},[53,1053,1054],{"class":55,"line":371},[53,1055,1056],{"class":67},"])\n",[53,1058,1059],{"class":55,"line":385},[53,1060,122],{"emptyLinePlaceholder":121},[53,1062,1063,1066,1069,1072,1074,1077,1080,1083,1086,1089,1091,1094,1096,1098,1101,1103,1105,1107,1109,1111,1113],{"class":55,"line":402},[53,1064,1065],{"class":59},"export",[53,1067,1068],{"class":59}," function",[53,1070,1071],{"class":63}," myLibAdapter",[53,1073,68],{"class":67},[53,1075,1076],{"class":63},"F",[53,1078,1079],{"class":59}," extends",[53,1081,1082],{"class":63}," GenericForm",[53,1084,1085],{"class":67},">(",[53,1087,1088],{"class":140},"schema",[53,1090,111],{"class":59},[53,1092,1093],{"class":63}," MyLibSchema",[53,1095,68],{"class":67},[53,1097,1076],{"class":63},[53,1099,1100],{"class":67},">)",[53,1102,111],{"class":59},[53,1104,64],{"class":63},[53,1106,68],{"class":67},[53,1108,1076],{"class":63},[53,1110,74],{"class":67},[53,1112,1076],{"class":63},[53,1114,1115],{"class":67},"> {\n",[53,1117,1118,1121],{"class":55,"line":414},[53,1119,1120],{"class":59},"  return",[53,1122,92],{"class":67},[53,1124,1125,1128],{"class":55,"line":437},[53,1126,1127],{"class":63},"    fingerprint",[53,1129,1130],{"class":67},"() {\n",[53,1132,1133,1136,1139,1142,1145,1148],{"class":55,"line":442},[53,1134,1135],{"class":59},"      return",[53,1137,1138],{"class":67}," schema.",[53,1140,1141],{"class":63},"signature",[53,1143,1144],{"class":67},"?.() ",[53,1146,1147],{"class":59},"??",[53,1149,1150],{"class":944}," 'my-lib:v1'\n",[53,1152,1153],{"class":55,"line":448},[53,1154,1155],{"class":67},"    },\n",[53,1157,1158],{"class":55,"line":472},[53,1159,122],{"emptyLinePlaceholder":121},[53,1161,1162,1165,1168,1170,1173,1175,1177,1179,1181],{"class":55,"line":486},[53,1163,1164],{"class":63},"    getDefaultValues",[53,1166,1167],{"class":67},"({ ",[53,1169,561],{"class":140},[53,1171,1172],{"class":67}," })",[53,1174,111],{"class":59},[53,1176,149],{"class":63},[53,1178,68],{"class":67},[53,1180,1076],{"class":63},[53,1182,1115],{"class":67},[53,1184,1186,1189,1192,1194,1196,1199],{"class":55,"line":1185},28,[53,1187,1188],{"class":59},"      const",[53,1190,1191],{"class":114}," defaults",[53,1193,80],{"class":59},[53,1195,1138],{"class":67},[53,1197,1198],{"class":63},"defaultValues",[53,1200,1201],{"class":67},"()\n",[53,1203,1205,1207,1210,1212,1215],{"class":55,"line":1204},29,[53,1206,1188],{"class":59},[53,1208,1209],{"class":114}," merged",[53,1211,80],{"class":59},[53,1213,1214],{"class":63}," mergeDeepPartial",[53,1216,1217],{"class":67},"(defaults, constraints)\n",[53,1219,1221,1223,1226,1228,1231,1233,1236,1239],{"class":55,"line":1220},30,[53,1222,1135],{"class":59},[53,1224,1225],{"class":67}," { data: merged, errors: ",[53,1227,602],{"class":114},[53,1229,1230],{"class":67},", success: ",[53,1232,667],{"class":114},[53,1234,1235],{"class":67},", formKey: ",[53,1237,1238],{"class":944},"''",[53,1240,1241],{"class":67}," }\n",[53,1243,1245],{"class":55,"line":1244},31,[53,1246,1155],{"class":67},[53,1248,1250],{"class":55,"line":1249},32,[53,1251,122],{"emptyLinePlaceholder":121},[53,1253,1255,1258,1260,1262],{"class":55,"line":1254},33,[53,1256,1257],{"class":63},"    getDefaultAtPath",[53,1259,137],{"class":67},[53,1261,167],{"class":140},[53,1263,1264],{"class":67},") {\n",[53,1266,1268,1270,1273],{"class":55,"line":1267},34,[53,1269,1135],{"class":59},[53,1271,1272],{"class":63}," walkSchemaToDefault",[53,1274,1275],{"class":67},"(schema, path)\n",[53,1277,1279],{"class":55,"line":1278},35,[53,1280,1155],{"class":67},[53,1282,1284],{"class":55,"line":1283},36,[53,1285,122],{"emptyLinePlaceholder":121},[53,1287,1289,1292,1294,1296],{"class":55,"line":1288},37,[53,1290,1291],{"class":63},"    arrayShapeAtPath",[53,1293,137],{"class":67},[53,1295,167],{"class":140},[53,1297,1264],{"class":67},[53,1299,1301,1303,1306],{"class":55,"line":1300},38,[53,1302,1135],{"class":59},[53,1304,1305],{"class":63}," walkSchemaToArrayShape",[53,1307,1275],{"class":67},[53,1309,1311],{"class":55,"line":1310},39,[53,1312,1155],{"class":67},[53,1314,1316],{"class":55,"line":1315},40,[53,1317,122],{"emptyLinePlaceholder":121},[53,1319,1321,1324,1326,1328],{"class":55,"line":1320},41,[53,1322,1323],{"class":63},"    isLeafAtPath",[53,1325,137],{"class":67},[53,1327,167],{"class":140},[53,1329,1264],{"class":67},[53,1331,1333,1335,1338,1340,1343],{"class":55,"line":1332},42,[53,1334,1188],{"class":59},[53,1336,1337],{"class":114}," kinds",[53,1339,80],{"class":59},[53,1341,1342],{"class":63}," walkSchemaToSlimPrimitives",[53,1344,1275],{"class":67},[53,1346,1348,1351,1354,1357,1359,1362,1365],{"class":55,"line":1347},43,[53,1349,1350],{"class":59},"      if",[53,1352,1353],{"class":67}," (kinds ",[53,1355,1356],{"class":59},"===",[53,1358,397],{"class":114},[53,1360,1361],{"class":67},") ",[53,1363,1364],{"class":59},"return",[53,1366,1367],{"class":114}," false\n",[53,1369,1371,1373,1376,1379,1382,1385,1388,1391,1394,1396,1399,1402,1404,1407,1410,1412,1414,1417,1419,1421,1423,1426,1428,1430,1432,1435],{"class":55,"line":1370},44,[53,1372,1135],{"class":59},[53,1374,1375],{"class":59}," !",[53,1377,1378],{"class":67},"[",[53,1380,1381],{"class":59},"...",[53,1383,1384],{"class":67},"kinds].",[53,1386,1387],{"class":63},"some",[53,1389,1390],{"class":67},"((",[53,1392,1393],{"class":140},"k",[53,1395,1361],{"class":67},[53,1397,1398],{"class":59},"=>",[53,1400,1401],{"class":67}," k ",[53,1403,1356],{"class":59},[53,1405,1406],{"class":944}," 'object'",[53,1408,1409],{"class":59}," ||",[53,1411,1401],{"class":67},[53,1413,1356],{"class":59},[53,1415,1416],{"class":944}," 'array'",[53,1418,1409],{"class":59},[53,1420,1401],{"class":67},[53,1422,1356],{"class":59},[53,1424,1425],{"class":944}," 'map'",[53,1427,1409],{"class":59},[53,1429,1401],{"class":67},[53,1431,1356],{"class":59},[53,1433,1434],{"class":944}," 'set'",[53,1436,1437],{"class":67},")\n",[53,1439,1441],{"class":55,"line":1440},45,[53,1442,1155],{"class":67},[53,1444,1446],{"class":55,"line":1445},46,[53,1447,122],{"emptyLinePlaceholder":121},[53,1449,1451,1454,1456,1458],{"class":55,"line":1450},47,[53,1452,1453],{"class":63},"    isRequiredAtPath",[53,1455,137],{"class":67},[53,1457,167],{"class":140},[53,1459,1264],{"class":67},[53,1461,1463,1465,1468,1470,1473],{"class":55,"line":1462},48,[53,1464,1188],{"class":59},[53,1466,1467],{"class":114}," leaf",[53,1469,80],{"class":59},[53,1471,1472],{"class":63}," walkSchemaToLeaf",[53,1474,1275],{"class":67},[53,1476,1478,1480,1483,1485],{"class":55,"line":1477},49,[53,1479,1135],{"class":59},[53,1481,1482],{"class":67}," leaf?.isRequired ",[53,1484,1147],{"class":59},[53,1486,1367],{"class":114},[53,1488,1490],{"class":55,"line":1489},50,[53,1491,1155],{"class":67},[53,1493,1495],{"class":55,"line":1494},51,[53,1496,122],{"emptyLinePlaceholder":121},[53,1498,1500,1503],{"class":55,"line":1499},52,[53,1501,1502],{"class":63},"    getSchemasAtPath",[53,1504,1130],{"class":67},[53,1506,1508,1510],{"class":55,"line":1507},53,[53,1509,1135],{"class":59},[53,1511,1512],{"class":67}," []\n",[53,1514,1516],{"class":55,"line":1515},54,[53,1517,1155],{"class":67},[53,1519,1521],{"class":55,"line":1520},55,[53,1522,122],{"emptyLinePlaceholder":121},[53,1524,1526,1529,1531,1533],{"class":55,"line":1525},56,[53,1527,1528],{"class":63},"    getSlimPrimitiveTypesAtPath",[53,1530,137],{"class":67},[53,1532,167],{"class":140},[53,1534,1264],{"class":67},[53,1536,1538,1540,1542,1545,1547],{"class":55,"line":1537},57,[53,1539,1135],{"class":59},[53,1541,1342],{"class":63},[53,1543,1544],{"class":67},"(schema, path) ",[53,1546,1147],{"class":59},[53,1548,1549],{"class":114}," PERMISSIVE\n",[53,1551,1553],{"class":55,"line":1552},58,[53,1554,1155],{"class":67},[53,1556,1558],{"class":55,"line":1557},59,[53,1559,122],{"emptyLinePlaceholder":121},[53,1561,1563,1566],{"class":55,"line":1562},60,[53,1564,1565],{"class":63},"    getUnionDiscriminatorAtPath",[53,1567,1130],{"class":67},[53,1569,1571,1573],{"class":55,"line":1570},61,[53,1572,1135],{"class":59},[53,1574,222],{"class":114},[53,1576,1578],{"class":55,"line":1577},62,[53,1579,1155],{"class":67},[53,1581,1583],{"class":55,"line":1582},63,[53,1584,122],{"emptyLinePlaceholder":121},[53,1586,1588,1591,1593,1596,1598,1600],{"class":55,"line":1587},64,[53,1589,1590],{"class":63},"    validateAtPath",[53,1592,137],{"class":67},[53,1594,1595],{"class":140},"data",[53,1597,74],{"class":67},[53,1599,167],{"class":140},[53,1601,1264],{"class":67},[53,1603,1605,1607,1610,1612,1615,1618,1620,1623,1625,1628,1631,1633,1635,1638],{"class":55,"line":1604},65,[53,1606,1188],{"class":59},[53,1608,1609],{"class":114}," result",[53,1611,80],{"class":59},[53,1613,1614],{"class":67}," path ",[53,1616,1617],{"class":59},"!==",[53,1619,397],{"class":114},[53,1621,1622],{"class":59}," ?",[53,1624,1138],{"class":67},[53,1626,1627],{"class":63},"parseAtPath",[53,1629,1630],{"class":67},"(data, path) ",[53,1632,111],{"class":59},[53,1634,1138],{"class":67},[53,1636,1637],{"class":63},"parse",[53,1639,1640],{"class":67},"(data)\n",[53,1642,1644],{"class":55,"line":1643},66,[53,1645,122],{"emptyLinePlaceholder":121},[53,1647,1649,1651],{"class":55,"line":1648},67,[53,1650,1350],{"class":59},[53,1652,1653],{"class":67}," (result.success) {\n",[53,1655,1657,1660,1663,1665,1668,1670],{"class":55,"line":1656},68,[53,1658,1659],{"class":59},"        return",[53,1661,1662],{"class":67}," { success: ",[53,1664,667],{"class":114},[53,1666,1667],{"class":67},", data: result.data, errors: [], formKey: ",[53,1669,1238],{"class":944},[53,1671,1241],{"class":67},[53,1673,1675],{"class":55,"line":1674},69,[53,1676,1677],{"class":67},"      }\n",[53,1679,1681],{"class":55,"line":1680},70,[53,1682,122],{"emptyLinePlaceholder":121},[53,1684,1686,1688,1691,1693,1696,1699,1701,1704,1707,1709,1712,1714,1716],{"class":55,"line":1685},71,[53,1687,1188],{"class":59},[53,1689,1690],{"class":114}," errors",[53,1692,111],{"class":59},[53,1694,1695],{"class":63}," ValidationError",[53,1697,1698],{"class":67},"[] ",[53,1700,89],{"class":59},[53,1702,1703],{"class":67}," result.issues.",[53,1705,1706],{"class":63},"map",[53,1708,1390],{"class":67},[53,1710,1711],{"class":140},"issue",[53,1713,1361],{"class":67},[53,1715,1398],{"class":59},[53,1717,1718],{"class":67}," ({\n",[53,1720,1722],{"class":55,"line":1721},72,[53,1723,1724],{"class":67},"        path: issue.path,\n",[53,1726,1728],{"class":55,"line":1727},73,[53,1729,1730],{"class":67},"        message: issue.message,\n",[53,1732,1734,1737,1740,1742,1744,1746,1749,1752],{"class":55,"line":1733},74,[53,1735,1736],{"class":67},"        code: ",[53,1738,1739],{"class":944},"`my-lib:${",[53,1741,1711],{"class":67},[53,1743,617],{"class":944},[53,1745,21],{"class":67},[53,1747,1748],{"class":59}," ??",[53,1750,1751],{"class":944}," 'unknown'}`",[53,1753,382],{"class":67},[53,1755,1757,1760,1762],{"class":55,"line":1756},75,[53,1758,1759],{"class":67},"        formKey: ",[53,1761,1238],{"class":944},[53,1763,382],{"class":67},[53,1765,1767],{"class":55,"line":1766},76,[53,1768,1769],{"class":67},"      }))\n",[53,1771,1773],{"class":55,"line":1772},77,[53,1774,122],{"emptyLinePlaceholder":121},[53,1776,1778,1780,1782,1784,1787,1789,1791,1793],{"class":55,"line":1777},78,[53,1779,1135],{"class":59},[53,1781,1662],{"class":67},[53,1783,671],{"class":114},[53,1785,1786],{"class":67},", errors, data: ",[53,1788,602],{"class":114},[53,1790,1235],{"class":67},[53,1792,1238],{"class":944},[53,1794,1241],{"class":67},[53,1796,1798],{"class":55,"line":1797},79,[53,1799,1155],{"class":67},[53,1801,1803],{"class":55,"line":1802},80,[53,1804,1805],{"class":67},"  }\n",[53,1807,1809],{"class":55,"line":1808},81,[53,1810,489],{"class":67},[17,1812,1813,1814,111],{},"Wire your adapter through the schema-agnostic ",[21,1815,1816],{},"useForm",[44,1818,1820],{"className":46,"code":1819,"language":48,"meta":49,"style":49},"import { useForm } from 'attaform'\nimport { myLibAdapter } from '.\u002Fmy-adapter'\n\nconst form = useForm({ schema: myLibAdapter(mySchema) })\n",[21,1821,1822,1833,1845,1849],{"__ignoreMap":49},[53,1823,1824,1826,1829,1831],{"class":55,"line":56},[53,1825,903],{"class":59},[53,1827,1828],{"class":67}," { useForm } ",[53,1830,941],{"class":59},[53,1832,945],{"class":944},[53,1834,1835,1837,1840,1842],{"class":55,"line":95},[53,1836,903],{"class":59},[53,1838,1839],{"class":67}," { myLibAdapter } ",[53,1841,941],{"class":59},[53,1843,1844],{"class":944}," '.\u002Fmy-adapter'\n",[53,1846,1847],{"class":55,"line":102},[53,1848,122],{"emptyLinePlaceholder":121},[53,1850,1851,1853,1856,1858,1861,1864,1867],{"class":55,"line":118},[53,1852,967],{"class":59},[53,1854,1855],{"class":114}," form",[53,1857,80],{"class":59},[53,1859,1860],{"class":63}," useForm",[53,1862,1863],{"class":67},"({ schema: ",[53,1865,1866],{"class":63},"myLibAdapter",[53,1868,1869],{"class":67},"(mySchema) })\n",[39,1871,1873],{"id":1872},"zod-v3-vs-zod-v4-an-introspection-asymmetry","Zod-v3 vs. Zod-v4: an introspection asymmetry",[17,1875,1876,1877,74,1880,562,1883,1886,1887,1890,1891,1893],{},"Worth knowing if you're studying the reference implementations: the v4 adapter exports ",[21,1878,1879],{},"kindOf",[21,1881,1882],{},"ZodKind",[21,1884,1885],{},"assertZodVersion"," for runtime introspection of Zod nodes; the v3 adapter exports ",[21,1888,1889],{},"isZodSchemaType"," but not the broader set. Both adapters implement the full ",[21,1892,5],{}," contract; the difference is in the consumer-facing diagnostic helpers above the contract surface. If you're forking a Zod adapter as a starting point, the v4 source is the richer reference; the v3 source is the leaner one.",[39,1895,1897],{"id":1896},"where-to-next","Where to next",[508,1899,1900,1911,1918],{},[511,1901,1902,1907,1908,1910],{},[1903,1904,1906],"a",{"href":1905},"\u002Fdocs\u002Fschemas\u002Fcontract","The schema contract",": the high-level mental model ",[21,1909,5],{}," implements.",[511,1912,1913,1917],{},[1903,1914,1916],{"href":1915},"\u002Fdocs\u002Freference\u002Ftypes","Types reference",": every type the contract references.",[511,1919,1920,1924,1925,1927,1928,1931],{},[1903,1921,1923],{"href":1922},"\u002Fdocs\u002Freference\u002Fentry-points","Entry-point reference",": which subpath ships ",[21,1926,5],{}," (the framework-agnostic ",[21,1929,1930],{},"attaform",").",[1933,1934,1935],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}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);}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}",{"title":49,"searchDepth":95,"depth":95,"links":1937},[1938,1939,1942,1946,1954,1957,1963,1964,1965],{"id":41,"depth":95,"text":42},{"id":495,"depth":95,"text":496,"children":1940},[1941],{"id":500,"depth":102,"text":503},{"id":534,"depth":95,"text":535,"children":1943},[1944,1945],{"id":538,"depth":102,"text":541},{"id":569,"depth":102,"text":572},{"id":628,"depth":95,"text":629,"children":1947},[1948,1949,1950,1951,1952,1953],{"id":632,"depth":102,"text":635},{"id":659,"depth":102,"text":662},{"id":688,"depth":102,"text":691},{"id":716,"depth":102,"text":719},{"id":739,"depth":102,"text":742},{"id":769,"depth":102,"text":772},{"id":785,"depth":95,"text":786,"children":1955},[1956],{"id":789,"depth":102,"text":792},{"id":821,"depth":95,"text":822,"children":1958},[1959,1961],{"id":825,"depth":102,"text":1960},"getFieldMetaAtPath(path: Path): ResolvedFieldMeta (optional)",{"id":852,"depth":102,"text":1962},"needsAsyncValidation(): boolean (optional)",{"id":869,"depth":95,"text":870},{"id":1872,"depth":95,"text":1873},{"id":1896,"depth":95,"text":1897},"The schema-agnostic contract the core consumes (12 required methods plus 2 optional hooks) covering identity, defaults, shape introspection, and validation. Implement it to wire any schema library into Attaform.","md",{},[1970,1973,1976,1978],{"label":1971,"value":1972},"Category","Reference",{"label":1974,"value":1975,"kind":21},"Contract","AbstractSchema\u003CForm, GetValue>",{"label":1977,"value":246},"Required methods",{"label":822,"value":1979},"2 (getFieldMetaAtPath, needsAsyncValidation)","\u002Fdocs\u002Fschemas\u002Fabstract-schema",{"title":5,"description":1966},null,"docs\u002Fschemas\u002Fabstract-schema","tjqWnjZ4BtBL45KoLYdf5ajKDL21HBDVg24B-n-CQz4",1780949758025]