[{"data":1,"prerenderedAt":1515},["ShallowReactive",2],{"navigation_docs":3,"-introduction-configuration":132,"-introduction-configuration-surround":1510},[4,27,69,91,127],{"title":5,"icon":6,"redirect":7,"path":8,"stem":9,"children":10,"page":26},"Introduction","i-lucide-rocket","\u002Fintroduction\u002Fabout-ts-runtypes","\u002Fintroduction","1.introduction",[11,14,18,22],{"title":12,"path":7,"stem":13},"About RunTypes","1.introduction\u002F1.about-ts-runtypes",{"title":15,"path":16,"stem":17},"Built on typescript-go","\u002Fintroduction\u002Fbuilt-on-typescript-go","1.introduction\u002F2.built-on-typescript-go",{"title":19,"path":20,"stem":21},"Quick Start","\u002Fintroduction\u002Fquick-start","1.introduction\u002F3.quick-start",{"title":23,"path":24,"stem":25},"Configuration","\u002Fintroduction\u002Fconfiguration","1.introduction\u002F4.configuration",false,{"title":28,"icon":29,"redirect":30,"path":31,"stem":32,"children":33,"page":26},"Guide","i-lucide-book-open","\u002Fguide\u002Ftypes-vs-schemas","\u002Fguide","2.guide",[34,37,41,45,49,53,57,61,65],{"title":35,"path":30,"stem":36},"Types vs Schemas","2.guide\u002F1.types-vs-schemas",{"title":38,"path":39,"stem":40},"Type Formats","\u002Fguide\u002Ftype-formats","2.guide\u002F2.type-formats",{"title":42,"path":43,"stem":44},"Reflection","\u002Fguide\u002Freflection","2.guide\u002F3.reflection",{"title":46,"path":47,"stem":48},"Serialization","\u002Fguide\u002Fserialization","2.guide\u002F4.serialization",{"title":50,"path":51,"stem":52},"Validation","\u002Fguide\u002Fvalidation","2.guide\u002F5.validation",{"title":54,"path":55,"stem":56},"Data Mocking","\u002Fguide\u002Fmocking","2.guide\u002F6.mocking",{"title":58,"path":59,"stem":60},"Compiler Markers","\u002Fguide\u002Fcompiler-markers","2.guide\u002F7.compiler-markers",{"title":62,"path":63,"stem":64},"Pure Functions","\u002Fguide\u002Fpure-functions","2.guide\u002F8.pure-functions",{"title":66,"path":67,"stem":68},"Linting","\u002Fguide\u002Flinting","2.guide\u002F9.linting",{"title":70,"icon":71,"redirect":72,"path":73,"stem":74,"children":75,"page":26},"AI Integration","i-lucide-sparkles","\u002Fai-integration\u002Fworkflow-and-commands","\u002Fai-integration","3.ai-integration",[76,79,83,87],{"title":77,"path":72,"stem":78},"AI Workflow","3.ai-integration\u002F1.workflow-and-commands",{"title":80,"path":81,"stem":82},"FriendlyText","\u002Fai-integration\u002Ffriendly-type","3.ai-integration\u002F2.friendly-type",{"title":84,"path":85,"stem":86},"MockData","\u002Fai-integration\u002Fmock-data","3.ai-integration\u002F3.mock-data",{"title":88,"path":89,"stem":90},"Translations (i18n)","\u002Fai-integration\u002Fi18n","3.ai-integration\u002F4.i18n",{"title":92,"icon":93,"redirect":94,"path":95,"stem":96,"children":97,"page":26},"Benchmarks","i-lucide-gauge","\u002Fbenchmarks\u002Fvalidation","\u002Fbenchmarks","7.benchmarks",[98,100,104,108,112,115,119,123],{"title":50,"path":94,"stem":99},"7.benchmarks\u002F1.validation",{"title":101,"path":102,"stem":103},"Validation Formats","\u002Fbenchmarks\u002Fvalidation-formats","7.benchmarks\u002F2.validation-formats",{"title":105,"path":106,"stem":107},"Validation Errors","\u002Fbenchmarks\u002Fgetvalidationerrors","7.benchmarks\u002F3.getvalidationerrors",{"title":109,"path":110,"stem":111},"Validation Error Formats","\u002Fbenchmarks\u002Fgetvalidationerrors-formats","7.benchmarks\u002F4.getvalidationerrors-formats",{"title":46,"path":113,"stem":114},"\u002Fbenchmarks\u002Fserialization","7.benchmarks\u002F5.serialization",{"title":116,"path":117,"stem":118},"Serialization Formats","\u002Fbenchmarks\u002Fserialization-formats","7.benchmarks\u002F6.serialization-formats",{"title":120,"path":121,"stem":122},"Compile Time","\u002Fbenchmarks\u002Fcompiletime","7.benchmarks\u002F7.compiletime",{"title":124,"path":125,"stem":126},"Correctness","\u002Fbenchmarks\u002Fcorrectness","7.benchmarks\u002F8.correctness",{"title":128,"path":129,"stem":130,"icon":131},"Diagnostics","\u002Fdiagnostics","8.diagnostics","i-lucide-triangle-alert",{"id":133,"title":23,"body":134,"description":1504,"extension":1505,"links":1506,"meta":1507,"navigation":901,"path":24,"seo":1508,"stem":25,"__hash__":1509},"docs\u002F1.introduction\u002F4.configuration.md",{"type":135,"value":136},"minimark",[137,150,155,164,412,418,493,505,580,602,605,629,963,973,980,988,992,996,1013,1101,1118,1316,1320,1338,1380,1387,1391,1394,1500],[138,139,140,141,145,146,149],"p",{},"RunTypes reads its settings from your ",[142,143,144],"code",{},"tsconfig.json",", in the same ",[142,147,148],{},"plugins"," list TypeScript already understands. You configure a project in one place, and every build tool (Vite, Rollup, webpack, Rspack, esbuild) picks it up for free.",[151,152,154],"h2",{"id":153},"options","Options",[138,156,157,158,163],{},"Every option is optional. Leave one out and the compiler uses its default. Set them in your tsconfig plugin entry, shown under ",[159,160,162],"a",{"href":161},"#setting-your-options","Setting your options"," below. The one marked \"bundler plugin only\" is the path used to find your tsconfig, so it cannot live inside it.",[165,166,167,183],"table",{},[168,169,170],"thead",{},[171,172,173,177,180],"tr",{},[174,175,176],"th",{},"Option",[174,178,179],{},"Default",[174,181,182],{},"What it does",[184,185,186,234,259,285,300,319,370,383,395],"tbody",{},[171,187,188,194,197],{},[189,190,191],"td",{},[142,192,193],{},"genDir",[189,195,196],{},"inferred from tsconfig",[189,198,199,200,203,204,207,208,211,212,215,216,215,219,222,223,226,227,229,230,233],{},"The RunTypes generated-output folder in your project. Modules generated on every build land under ",[142,201,202],{},"types\u002F"," (ignored by git); the ",[159,205,206],{"href":51},"enrichment CLI"," writes its committed files under ",[142,209,210],{},"enriched\u002F"," (",[142,213,214],{},"friendly\u002F",", ",[142,217,218],{},"mock\u002F",[142,220,221],{},"i18n\u002F\u003Clocale>\u002F","). Each folder carries a README saying what it is. When omitted, it is created next to your source as ",[142,224,225],{},"__runtypes",". Also settable in tsconfig as ",[142,228,193],{},"; the CLI flag is ",[142,231,232],{},"--gen-dir",".",[171,235,236,241,245],{},[189,237,238],{},[142,239,240],{},"emitMode",[189,242,243],{},[142,244,142],{},[189,246,247,248,250,251,254,255,258],{},"How each generated function ships. ",[142,249,142],{}," ships the function body as a string and builds it on first use (smallest output). ",[142,252,253],{},"functions"," ships ready functions. ",[142,256,257],{},"both"," ships both, for runtimes that block dynamic code (a strict CSP, Cloudflare Workers).",[171,260,261,266,271],{},[189,262,263],{},[142,264,265],{},"moduleMode",[189,267,268],{},[142,269,270],{},"default",[189,272,273,274,276,277,280,281,284],{},"How the generated functions group into modules. ",[142,275,270],{}," gives your bundler the best code splitting. ",[142,278,279],{},"allSingle"," groups each feature into one module (fewest files). ",[142,282,283],{},"allModules"," gives every entry its own module (rarely useful).",[171,286,287,292,297],{},[189,288,289],{},[142,290,291],{},"hashLength",[189,293,294],{},[142,295,296],{},"7",[189,298,299],{},"Length of the short ids in generated names. Only raise it if a build ever reports an id collision.",[171,301,302,307,312],{},[189,303,304],{},[142,305,306],{},"failOnError",[189,308,309],{},[142,310,311],{},"true",[189,313,314,315,318],{},"Error findings (a type that can never be encoded, a contradictory format rule) stop the build in every lane, including tests and the dev server, just like a type error would. Set ",[142,316,317],{},"false"," only for a test program that deliberately contains such types; the findings then surface as warnings.",[171,320,321,326,329],{},[189,322,323],{},[142,324,325],{},"pureFnReport",[189,327,328],{},"off",[189,330,331,332,335,336,339,340,343,344,347,348,350,351,354,355,357,358,361,362,365,366,369],{},"Emit a structured report of every pure function this build generated, for tooling that moves pure function bodies between two builds of one codebase (a framework that declares a mapper in client code but runs it on the server). On the bundler plugin it is one switch with three states: ",[142,333,334],{},"'file'"," writes the report to ",[142,337,338],{},"\u003CgenDir>\u002Ftypes\u002Fpure-fns-report.json"," on every build (in the generated folder, so it is gitignored and rewritten like the rest of the output); ",[142,341,342],{},"'callback'"," delivers it only in process to the ",[142,345,346],{},"onPureFnReport"," handler, writing no file; leave it off (the default) for neither. The file location is fixed (like every path under ",[142,349,193],{},"), so it is not configurable. Each record carries the call site, the registry key, which function and package declared the registrar (so a framework wrapper is attributed to the framework, not to ",[142,352,353],{},"@ts-runtypes\u002Fcore","), and the function body itself. The report shape is the same whatever ",[142,356,265],{}," you use. In tsconfig, set ",[142,359,360],{},"pureFnReport: true"," to write the file (the in process handler is a plugin only API); the CLI flags are ",[142,363,364],{},"--pure-fn-report-file"," (writes the JSON) and ",[142,367,368],{},"--pure-fn-report-wire"," (report on the wire only).",[171,371,372,377,380],{},[189,373,374],{},[142,375,376],{},"size",[189,378,379],{},"unset",[189,381,382],{},"Tuning for the first buffer a binary encoder allocates, an object detailed in the table below. Leave the key out and the defaults apply.",[171,384,385,390,392],{},[189,386,387],{},[142,388,389],{},"i18n",[189,391,379],{},[189,393,394],{},"Translation settings for the friendly maps, an object detailed in the table below. Leave the key out entirely and translations are off.",[171,396,397,402,405],{},[189,398,399],{},[142,400,401],{},"tsconfig",[189,403,404],{},"found like tsc",[189,406,407,408,411],{},"Path to your tsconfig, relative to the project root. Set it on the bundler plugin, on the lint settings, or with the CLI ",[142,409,410],{},"--tsconfig"," flag; it is the one option that cannot live inside the tsconfig itself. When not set, the config is found exactly the way tsc finds it, searching upward from the working directory, and a config you name explicitly must load or the tool stops with an error.",[138,413,414,415,417],{},"The ",[142,416,376],{}," object tunes how the first buffer of a binary encoder is sized:",[165,419,420,431],{},[168,421,422],{},[171,423,424,427,429],{},[174,425,426],{},"Key",[174,428,179],{},[174,430,182],{},[184,432,433,448,463,478],{},[171,434,435,440,445],{},[189,436,437],{},[142,438,439],{},"bias",[189,441,442],{},[142,443,444],{},"0.8",[189,446,447],{},"How generous that first buffer is, from 0 (tight, may need to grow) to 1 (generous).",[171,449,450,455,460],{},[189,451,452],{},[142,453,454],{},"items",[189,456,457],{},[142,458,459],{},"100",[189,461,462],{},"How many elements to assume for an array, Map or Set with no declared limit.",[171,464,465,470,475],{},[189,466,467],{},[142,468,469],{},"stringBytes",[189,471,472],{},[142,473,474],{},"32",[189,476,477],{},"How long to assume a string with no declared limit is.",[171,479,480,485,490],{},[189,481,482],{},[142,483,484],{},"maxBytes",[189,486,487],{},[142,488,489],{},"65536",[189,491,492],{},"A cap on the estimate, so a very large declared limit never creates a huge buffer.",[138,494,414,495,497,498,501,502,504],{},[142,496,389],{}," object configures ",[159,499,500],{"href":89},"translations"," for your ",[159,503,80],{"href":81}," maps:",[165,506,507,517],{},[168,508,509],{},[171,510,511,513,515],{},[174,512,426],{},[174,514,179],{},[174,516,182],{},[184,518,519,538,559],{},[171,520,521,526,531],{},[189,522,523],{},[142,524,525],{},"sourceLocale",[189,527,528],{},[142,529,530],{},"en",[189,532,533,534,537],{},"The language your friendly maps are written in. It decides which plural forms ",[142,535,536],{},"enrich"," scaffolds in them.",[171,539,540,545,548],{},[189,541,542],{},[142,543,544],{},"locales",[189,546,547],{},"none",[189,549,550,551,554,555,558],{},"The locales you translate into; ",[142,552,553],{},"enrich --i18n all"," and its ",[142,556,557],{},"--no-emit"," check walk this list. Don't list the source locale.",[171,560,561,566,570],{},[189,562,563],{},[142,564,565],{},"strict",[189,567,568],{},[142,569,317],{},[189,571,572,573,575,576,579],{},"When ",[142,574,311],{},", an incomplete or out-of-date translation fails the i18n check by default, the same as passing ",[142,577,578],{},"--require-complete"," to a single run. Rendering at runtime stays lenient either way.",[581,582,583,584,587,588,591,592,595,596,598,599,601],"note",{},"For in-process tooling, the bundler plugin also accepts an ",[142,585,586],{},"onPureFnReport(sites, phase)"," callback. It fires once with the whole report after the build scan (phase ",[142,589,590],{},"'build'","), and again under Vite with just the changed file when you edit a pure function body (phase ",[142,593,594],{},"'update'","). It carries the same records as the JSON file, so a plugin can consume the report without reading it back from disk. Providing the callback without setting ",[142,597,325],{}," implies ",[142,600,342],{},", so just adding a handler turns the report on with no file written.",[151,603,162],{"id":604},"setting-your-options",[138,606,607,608,610,611,614,615,618,619,622,623,625,626,628],{},"Your ",[142,609,144],{}," is the home for every option: add an entry named ",[142,612,613],{},"ts-runtypes"," under ",[142,616,617],{},"compilerOptions.plugins"," and every build tool (Vite, Rollup, webpack, Rspack, esbuild) picks it up. Every project option also works directly on the ",[142,620,621],{},"@ts-runtypes\u002Fdevtools"," bundler plugin, as a per build override for when one build needs to differ from the project baseline. Two kinds of option are the exception: the bootstrap and wire knobs that describe the build itself (",[142,624,401],{}," and the internal options below) are plugin only, and the ",[142,627,389],{}," object is tsconfig only.",[630,631,632,840],"code-group",{},[633,634,639],"pre",{"className":635,"code":636,"filename":144,"language":637,"meta":638,"style":638},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"compilerOptions\": {\n    \"plugins\": [\n      {\n        \"name\": \"ts-runtypes\",\n        \"emitMode\": \"code\",\n        \"moduleMode\": \"default\",\n        \"i18n\": {\"sourceLocale\": \"en\", \"locales\": [\"es\", \"pl\"]}\n      }\n    ]\n  }\n}\n","json","",[142,640,641,650,669,685,691,716,735,754,816,822,828,834],{"__ignoreMap":638},[642,643,646],"span",{"class":644,"line":645},"line",1,[642,647,649],{"class":648},"sMK4o","{\n",[642,651,653,656,660,663,666],{"class":644,"line":652},2,[642,654,655],{"class":648},"  \"",[642,657,659],{"class":658},"spNyl","compilerOptions",[642,661,662],{"class":648},"\"",[642,664,665],{"class":648},":",[642,667,668],{"class":648}," {\n",[642,670,672,675,678,680,682],{"class":644,"line":671},3,[642,673,674],{"class":648},"    \"",[642,676,148],{"class":677},"sBMFI",[642,679,662],{"class":648},[642,681,665],{"class":648},[642,683,684],{"class":648}," [\n",[642,686,688],{"class":644,"line":687},4,[642,689,690],{"class":648},"      {\n",[642,692,694,697,701,703,705,708,711,713],{"class":644,"line":693},5,[642,695,696],{"class":648},"        \"",[642,698,700],{"class":699},"sbssI","name",[642,702,662],{"class":648},[642,704,665],{"class":648},[642,706,707],{"class":648}," \"",[642,709,613],{"class":710},"sfazB",[642,712,662],{"class":648},[642,714,715],{"class":648},",\n",[642,717,719,721,723,725,727,729,731,733],{"class":644,"line":718},6,[642,720,696],{"class":648},[642,722,240],{"class":699},[642,724,662],{"class":648},[642,726,665],{"class":648},[642,728,707],{"class":648},[642,730,142],{"class":710},[642,732,662],{"class":648},[642,734,715],{"class":648},[642,736,738,740,742,744,746,748,750,752],{"class":644,"line":737},7,[642,739,696],{"class":648},[642,741,265],{"class":699},[642,743,662],{"class":648},[642,745,665],{"class":648},[642,747,707],{"class":648},[642,749,270],{"class":710},[642,751,662],{"class":648},[642,753,715],{"class":648},[642,755,757,759,761,763,765,768,770,773,775,777,779,781,783,786,788,790,792,794,797,799,802,804,806,808,811,813],{"class":644,"line":756},8,[642,758,696],{"class":648},[642,760,389],{"class":699},[642,762,662],{"class":648},[642,764,665],{"class":648},[642,766,767],{"class":648}," {",[642,769,662],{"class":648},[642,771,525],{"class":772},"swJcz",[642,774,662],{"class":648},[642,776,665],{"class":648},[642,778,707],{"class":648},[642,780,530],{"class":710},[642,782,662],{"class":648},[642,784,785],{"class":648},",",[642,787,707],{"class":648},[642,789,544],{"class":772},[642,791,662],{"class":648},[642,793,665],{"class":648},[642,795,796],{"class":648}," [",[642,798,662],{"class":648},[642,800,801],{"class":710},"es",[642,803,662],{"class":648},[642,805,785],{"class":648},[642,807,707],{"class":648},[642,809,810],{"class":710},"pl",[642,812,662],{"class":648},[642,814,815],{"class":648},"]}\n",[642,817,819],{"class":644,"line":818},9,[642,820,821],{"class":648},"      }\n",[642,823,825],{"class":644,"line":824},10,[642,826,827],{"class":648},"    ]\n",[642,829,831],{"class":644,"line":830},11,[642,832,833],{"class":648},"  }\n",[642,835,837],{"class":644,"line":836},12,[642,838,839],{"class":648},"}\n",[633,841,846],{"className":842,"code":843,"filename":844,"language":845,"meta":638,"style":638},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import {defineConfig} from 'vite';\nimport runtypes from '@ts-runtypes\u002Fdevtools\u002Fvite';\n\nexport default defineConfig({\n  plugins: [runtypes({emitMode: 'functions'})],\n});\n","vite.config.ts","ts",[142,847,848,878,897,903,920,954],{"__ignoreMap":638},[642,849,850,854,856,860,863,866,869,872,875],{"class":644,"line":645},[642,851,853],{"class":852},"s7zQu","import",[642,855,767],{"class":648},[642,857,859],{"class":858},"sTEyZ","defineConfig",[642,861,862],{"class":648},"}",[642,864,865],{"class":852}," from",[642,867,868],{"class":648}," '",[642,870,871],{"class":710},"vite",[642,873,874],{"class":648},"'",[642,876,877],{"class":648},";\n",[642,879,880,882,885,888,890,893,895],{"class":644,"line":652},[642,881,853],{"class":852},[642,883,884],{"class":858}," runtypes ",[642,886,887],{"class":852},"from",[642,889,868],{"class":648},[642,891,892],{"class":710},"@ts-runtypes\u002Fdevtools\u002Fvite",[642,894,874],{"class":648},[642,896,877],{"class":648},[642,898,899],{"class":644,"line":671},[642,900,902],{"emptyLinePlaceholder":901},true,"\n",[642,904,905,908,911,915,918],{"class":644,"line":687},[642,906,907],{"class":852},"export",[642,909,910],{"class":852}," default",[642,912,914],{"class":913},"s2Zo4"," defineConfig",[642,916,917],{"class":858},"(",[642,919,649],{"class":648},[642,921,922,925,927,929,932,934,937,939,941,943,945,947,949,952],{"class":644,"line":693},[642,923,924],{"class":772},"  plugins",[642,926,665],{"class":648},[642,928,796],{"class":858},[642,930,931],{"class":913},"runtypes",[642,933,917],{"class":858},[642,935,936],{"class":648},"{",[642,938,240],{"class":772},[642,940,665],{"class":648},[642,942,868],{"class":648},[642,944,253],{"class":710},[642,946,874],{"class":648},[642,948,862],{"class":648},[642,950,951],{"class":858},")]",[642,953,715],{"class":648},[642,955,956,958,961],{"class":644,"line":718},[642,957,862],{"class":648},[642,959,960],{"class":858},")",[642,962,877],{"class":648},[581,964,965,966,968,969,972],{},"Order ",[142,967,621],{}," first among your ",[142,970,971],{},"enforce: 'pre'"," plugins, so it sees your source before other plugins rewrite it.",[138,974,975,976,979],{},"Settings layer the way ",[142,977,978],{},"tsc"," does. A command-line flag or a build-tool option wins over the tsconfig entry, which wins over the built-in default:",[633,981,986],{"className":982,"code":984,"language":985},[983],"language-text","build-tool option \u002F CLI flag   (highest)\ntsconfig plugin entry\nbuilt-in default               (lowest)\n","text",[142,987,984],{"__ignoreMap":638},[989,990,991],"tip",{},"Set your options once in tsconfig. Reach for a build-tool option or a CLI flag only when a single build needs to differ.",[151,993,995],{"id":994},"enrichment-sync-in-dev-bundler-plugin","Enrichment sync in dev (bundler plugin)",[138,997,414,998,1000,1001,1003,1004,1006,1007,1009,1010,1012],{},[159,999,206],{"href":72}," is the authoring path for your committed ",[142,1002,80],{}," and ",[142,1005,84],{}," maps. If you would rather not run it by hand, the ",[142,1008,621],{}," bundler plugin can scaffold and keep those mirrors in sync while your dev server runs. Turn it on with a nested ",[142,1011,536],{}," object on the plugin. These keys live only on the bundler plugin, never in your tsconfig plugin entry.",[165,1014,1015,1025],{},[168,1016,1017],{},[171,1018,1019,1021,1023],{},[174,1020,426],{},[174,1022,179],{},[174,1024,182],{},[184,1026,1027,1045,1061,1083],{},[171,1028,1029,1034,1038],{},[189,1030,1031],{},[142,1032,1033],{},"friendly",[189,1035,1036],{},[142,1037,317],{},[189,1039,1040,1041,1044],{},"Scaffold and sync the ",[142,1042,1043],{},"enriched\u002Ffriendly\u002F"," maps as your types change.",[171,1046,1047,1052,1056],{},[189,1048,1049],{},[142,1050,1051],{},"mock",[189,1053,1054],{},[142,1055,317],{},[189,1057,1040,1058,1044],{},[142,1059,1060],{},"enriched\u002Fmock\u002F",[171,1062,1063,1067,1069],{},[189,1064,1065],{},[142,1066,389],{},[189,1068,379],{},[189,1070,1071,1072,1075,1076,215,1078,1003,1080,1082],{},"Sync the per-locale ",[142,1073,1074],{},"enriched\u002Fi18n\u002F\u003Clocale>\u002F"," mirrors. Takes ",[142,1077,525],{},[142,1079,544],{},[142,1081,565],{},", the same shape as the tsconfig i18n object; its presence turns the locale sync on.",[171,1084,1085,1090,1094],{},[189,1086,1087],{},[142,1088,1089],{},"suppressHmr",[189,1091,1092],{},[142,1093,317],{},[189,1095,1096,1097,1100],{},"Skip HMR for writes under ",[142,1098,1099],{},"\u003CgenDir>\u002Fenriched",", so the dev server does not reload when the plugin (or you) touch a mirror file.",[138,1102,1103,1104,1106,1107,1110,1111,1114,1115,1117],{},"Everything defaults off, so a plugin with no ",[142,1105,536],{}," object behaves exactly as before. When on, the sync is value-preserving: it lays out and updates the file structure but never fills in translated strings or any other authored value, exactly like ",[142,1108,1109],{},"enrich --update",". It runs only in dev and watch. On a production build the plugin never writes; instead it runs a read-only completeness gate (the build equivalent of ",[142,1112,1113],{},"enrich --require-complete","). It fails the build (when ",[142,1116,306],{}," is on) if any mirror is out of date, missing, or still carries an unfilled blank, so a release can never ship blank labels or mocks. A build never mutates your committed files.",[633,1119,1121],{"className":842,"code":1120,"filename":844,"language":845,"meta":638,"style":638},"import {defineConfig} from 'vite';\nimport runtypes from '@ts-runtypes\u002Fdevtools\u002Fvite';\n\nexport default defineConfig({\n  plugins: [\n    runtypes({\n      enrich: {\n        friendly: true,\n        mock: true,\n        i18n: {sourceLocale: 'en', locales: ['es', 'pl']},\n        suppressHmr: true,\n      },\n    }),\n  ],\n});\n",[142,1122,1123,1143,1159,1163,1175,1183,1192,1201,1214,1225,1273,1284,1289,1299,1307],{"__ignoreMap":638},[642,1124,1125,1127,1129,1131,1133,1135,1137,1139,1141],{"class":644,"line":645},[642,1126,853],{"class":852},[642,1128,767],{"class":648},[642,1130,859],{"class":858},[642,1132,862],{"class":648},[642,1134,865],{"class":852},[642,1136,868],{"class":648},[642,1138,871],{"class":710},[642,1140,874],{"class":648},[642,1142,877],{"class":648},[642,1144,1145,1147,1149,1151,1153,1155,1157],{"class":644,"line":652},[642,1146,853],{"class":852},[642,1148,884],{"class":858},[642,1150,887],{"class":852},[642,1152,868],{"class":648},[642,1154,892],{"class":710},[642,1156,874],{"class":648},[642,1158,877],{"class":648},[642,1160,1161],{"class":644,"line":671},[642,1162,902],{"emptyLinePlaceholder":901},[642,1164,1165,1167,1169,1171,1173],{"class":644,"line":687},[642,1166,907],{"class":852},[642,1168,910],{"class":852},[642,1170,914],{"class":913},[642,1172,917],{"class":858},[642,1174,649],{"class":648},[642,1176,1177,1179,1181],{"class":644,"line":693},[642,1178,924],{"class":772},[642,1180,665],{"class":648},[642,1182,684],{"class":858},[642,1184,1185,1188,1190],{"class":644,"line":718},[642,1186,1187],{"class":913},"    runtypes",[642,1189,917],{"class":858},[642,1191,649],{"class":648},[642,1193,1194,1197,1199],{"class":644,"line":737},[642,1195,1196],{"class":772},"      enrich",[642,1198,665],{"class":648},[642,1200,668],{"class":648},[642,1202,1203,1206,1208,1212],{"class":644,"line":756},[642,1204,1205],{"class":772},"        friendly",[642,1207,665],{"class":648},[642,1209,1211],{"class":1210},"sfNiH"," true",[642,1213,715],{"class":648},[642,1215,1216,1219,1221,1223],{"class":644,"line":818},[642,1217,1218],{"class":772},"        mock",[642,1220,665],{"class":648},[642,1222,1211],{"class":1210},[642,1224,715],{"class":648},[642,1226,1227,1230,1232,1234,1236,1238,1240,1242,1244,1246,1249,1251,1253,1255,1257,1259,1261,1263,1265,1267,1270],{"class":644,"line":824},[642,1228,1229],{"class":772},"        i18n",[642,1231,665],{"class":648},[642,1233,767],{"class":648},[642,1235,525],{"class":772},[642,1237,665],{"class":648},[642,1239,868],{"class":648},[642,1241,530],{"class":710},[642,1243,874],{"class":648},[642,1245,785],{"class":648},[642,1247,1248],{"class":772}," locales",[642,1250,665],{"class":648},[642,1252,796],{"class":858},[642,1254,874],{"class":648},[642,1256,801],{"class":710},[642,1258,874],{"class":648},[642,1260,785],{"class":648},[642,1262,868],{"class":648},[642,1264,810],{"class":710},[642,1266,874],{"class":648},[642,1268,1269],{"class":858},"]",[642,1271,1272],{"class":648},"},\n",[642,1274,1275,1278,1280,1282],{"class":644,"line":830},[642,1276,1277],{"class":772},"        suppressHmr",[642,1279,665],{"class":648},[642,1281,1211],{"class":1210},[642,1283,715],{"class":648},[642,1285,1286],{"class":644,"line":836},[642,1287,1288],{"class":648},"      },\n",[642,1290,1292,1295,1297],{"class":644,"line":1291},13,[642,1293,1294],{"class":648},"    }",[642,1296,960],{"class":858},[642,1298,715],{"class":648},[642,1300,1302,1305],{"class":644,"line":1301},14,[642,1303,1304],{"class":858},"  ]",[642,1306,715],{"class":648},[642,1308,1310,1312,1314],{"class":644,"line":1309},15,[642,1311,862],{"class":648},[642,1313,960],{"class":858},[642,1315,877],{"class":648},[151,1317,1319],{"id":1318},"the-build-cache","The build cache",[138,1321,1322,1323,1326,1327,1330,1331,1334,1335,1337],{},"RunTypes keeps an on-disk artifact cache so a rebuild can skip work for types that did not change. It lives under ",[142,1324,1325],{},"node_modules\u002F.cache\u002Fts-runtypes",", alongside every other tool's cache, and it follows TypeScript's own switch. When your tsconfig sets ",[142,1328,1329],{},"incremental"," (or ",[142,1332,1333],{},"composite","), the cache is on. When it does not, the cache is off. There is no separate knob to set, and nothing new to learn: it works the way ",[142,1336,978],{},"'s own incremental cache already does.",[633,1339,1341],{"className":635,"code":1340,"filename":144,"language":637,"meta":638,"style":638},"{\n  \"compilerOptions\": {\n    \"incremental\": true\n  }\n}\n",[142,1342,1343,1347,1359,1372,1376],{"__ignoreMap":638},[642,1344,1345],{"class":644,"line":645},[642,1346,649],{"class":648},[642,1348,1349,1351,1353,1355,1357],{"class":644,"line":652},[642,1350,655],{"class":648},[642,1352,659],{"class":658},[642,1354,662],{"class":648},[642,1356,665],{"class":648},[642,1358,668],{"class":648},[642,1360,1361,1363,1365,1367,1369],{"class":644,"line":671},[642,1362,674],{"class":648},[642,1364,1329],{"class":677},[642,1366,662],{"class":648},[642,1368,665],{"class":648},[642,1370,1371],{"class":648}," true\n",[642,1373,1374],{"class":644,"line":687},[642,1375,833],{"class":648},[642,1377,1378],{"class":644,"line":693},[642,1379,839],{"class":648},[581,1381,1382,1383,1386],{},"The cache is content addressed and safe across versions: the binary version and your build options fold into every entry, so a new release or a changed setting never reads a stale file. Standard clean recipes that wipe ",[142,1384,1385],{},"node_modules\u002F.cache"," clear it.",[151,1388,1390],{"id":1389},"internal-options","Internal options",[138,1392,1393],{},"These exist for developing RunTypes itself, for benchmarking, and for the lint integration. Leave them at their defaults.",[1395,1396,1397],"collapsible",{},[165,1398,1399,1407],{},[168,1400,1401],{},[171,1402,1403,1405],{},[174,1404,176],{},[174,1406,182],{},[184,1408,1409,1423,1433,1446,1460,1470,1480,1490],{},[171,1410,1411,1416],{},[189,1412,1413],{},[142,1414,1415],{},"inlineMode",[189,1417,1418,1419,1422],{},"How generated functions share code. The default splits them by type, so a shape used in several places is generated once and reused. The alternative (",[142,1420,1421],{},"allInternal",") inlines everything into each function, which repeats code and grows the output. Do not change it.",[171,1424,1425,1430],{},[189,1426,1427],{},[142,1428,1429],{},"singleThreaded",[189,1431,1432],{},"Runs the compiler on one thread, for debugging.",[171,1434,1435,1443],{},[189,1436,1437,215,1440],{},[142,1438,1439],{},"parallelScan",[142,1441,1442],{},"parallelRender",[189,1444,1445],{},"Turn off the compiler's parallel phases, for clean benchmark baselines.",[171,1447,1448,1453],{},[189,1449,1450],{},[142,1451,1452],{},"allowUncheckedPatterns",[189,1454,1455,1456,1459],{},"Lets the build pass a format pattern it cannot verify and hands the check to the ",[159,1457,1458],{"href":67},"lint plugin"," instead.",[171,1461,1462,1467],{},[189,1463,1464],{},[142,1465,1466],{},"binary",[189,1468,1469],{},"Points the plugin at a custom compiler build, used when developing RunTypes itself.",[171,1471,1472,1477],{},[189,1473,1474],{},[142,1475,1476],{},"cwd",[189,1478,1479],{},"Overrides the project root the plugin resolves paths from.",[171,1481,1482,1487],{},[189,1483,1484],{},[142,1485,1486],{},"transformMode",[189,1488,1489],{},"How the rewrite travels between the compiler and the plugin. Both modes produce identical output.",[171,1491,1492,1497],{},[189,1493,1494],{},[142,1495,1496],{},"sourcesContent",[189,1498,1499],{},"Whether the compiler embeds source text in its intermediate source maps. Your final source maps follow your bundler settings either way.",[1501,1502,1503],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}","Configure the compiler from your tsconfig, with build tools overriding per build.","md",null,{"toc":26},{"title":23,"description":1504},"bSLhzrQkZwpV4oF27Sqydc278ee4EqDAw0_wkzypU-Y",[1511,1513],{"title":19,"path":20,"stem":21,"description":1512,"children":-1},"Install the package + Vite plugin and generate your first validator from a TypeScript type.",{"title":35,"path":30,"stem":36,"description":1514,"children":-1},"Describe a shape as a plain TypeScript type or with schema builders; both compile to the same thing.",1785369664460]