[{"data":1,"prerenderedAt":3068},["ShallowReactive",2],{"navigation_docs":3,"-runtypes-guide-type-builders":399},[4,162,346],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":24},"RPC","icon-park-outline:lightning","\u002Frpc","01.rpc",[10,25,63,77,102,136],{"title":11,"icon":12,"redirect":7,"path":13,"stem":14,"children":15,"page":24},"Introduction","icon-park-outline:home","\u002Frpc\u002Fintroduction","01.rpc\u002F01.introduction",[16,20],{"title":17,"path":18,"stem":19},"Quick Start","\u002Frpc\u002Fintroduction\u002Fquick-start","01.rpc\u002F01.introduction\u002F02.quick-start",{"title":21,"path":22,"stem":23},"Manual Install","\u002Frpc\u002Fintroduction\u002Fmanual-install","01.rpc\u002F01.introduction\u002F03.manual-install",false,{"title":26,"icon":27,"path":28,"stem":29,"children":30,"page":24},"Server","icon-park-outline:server","\u002Frpc\u002Fserver","01.rpc\u002F02.server",[31,35,39,43,47,51,55,59],{"title":32,"path":33,"stem":34},"Routes","\u002Frpc\u002Fserver\u002Froutes","01.rpc\u002F02.server\u002F01.routes",{"title":36,"path":37,"stem":38},"Middleware","\u002Frpc\u002Fserver\u002Fmiddleware","01.rpc\u002F02.server\u002F02.middleware",{"title":40,"path":41,"stem":42},"Call Context","\u002Frpc\u002Fserver\u002Fcall-context","01.rpc\u002F02.server\u002F03.call-context",{"title":44,"path":45,"stem":46},"Headers","\u002Frpc\u002Fserver\u002Fheaders","01.rpc\u002F02.server\u002F04.headers",{"title":48,"path":49,"stem":50},"Error Handling","\u002Frpc\u002Fserver\u002Ferror-handling","01.rpc\u002F02.server\u002F05.error-handling",{"title":52,"path":53,"stem":54},"Validation","\u002Frpc\u002Fserver\u002Fvalidation","01.rpc\u002F02.server\u002F06.validation",{"title":56,"path":57,"stem":58},"JSON Round Trip","\u002Frpc\u002Fserver\u002Fjson-round-trip","01.rpc\u002F02.server\u002F07.json-round-trip",{"title":60,"path":61,"stem":62},"Drizzle Tables","\u002Frpc\u002Fserver\u002Fdrizzle-tables","01.rpc\u002F02.server\u002F08.drizzle-tables",{"title":64,"icon":65,"path":66,"stem":67,"children":68,"page":24},"Middlewares","icon-park-outline:link-one","\u002Frpc\u002Fmiddlewares","01.rpc\u002F03.middlewares",[69,73],{"title":70,"path":71,"stem":72},"fetchMetadata","\u002Frpc\u002Fmiddlewares\u002Ffetch-metadata","01.rpc\u002F03.middlewares\u002F01.fetch-metadata",{"title":74,"path":75,"stem":76},"syncRoutes","\u002Frpc\u002Fmiddlewares\u002Fsync-routes","01.rpc\u002F03.middlewares\u002F02.sync-routes",{"title":78,"icon":79,"path":80,"stem":81,"children":82,"page":24},"Client","icon-park-outline:computer","\u002Frpc\u002Fclient","01.rpc\u002F04.client",[83,87,91,94,98],{"title":84,"path":85,"stem":86},"Client Overview","\u002Frpc\u002Fclient\u002Fclient-overview","01.rpc\u002F04.client\u002F00.client-overview",{"title":88,"path":89,"stem":90},"Client Middleware","\u002Frpc\u002Fclient\u002Fclient-middleware","01.rpc\u002F04.client\u002F01.client-middleware",{"title":48,"path":92,"stem":93},"\u002Frpc\u002Fclient\u002Ferror-handling","01.rpc\u002F04.client\u002F02.error-handling",{"title":95,"path":96,"stem":97},"Batch Requests","\u002Frpc\u002Fclient\u002Fbatch","01.rpc\u002F04.client\u002F03.batch",{"title":99,"path":100,"stem":101},"Cancellation & Timeouts","\u002Frpc\u002Fclient\u002Fcancellation-timeouts","01.rpc\u002F04.client\u002F04.cancellation-timeouts",{"title":103,"redirect":104,"icon":105,"path":106,"stem":107,"children":108,"page":24},"Platforms","\u002Frpc\u002Fplatforms\u002Fnode-js","icon-park-outline:play","\u002Frpc\u002Fplatforms","01.rpc\u002F06.platforms",[109,112,116,120,124,128,132],{"title":110,"path":104,"stem":111},"Node.js","01.rpc\u002F06.platforms\u002F01.node-js",{"title":113,"path":114,"stem":115},"Bun","\u002Frpc\u002Fplatforms\u002Fbun","01.rpc\u002F06.platforms\u002F02.bun",{"title":117,"path":118,"stem":119},"AWS Lambda","\u002Frpc\u002Fplatforms\u002Faws-lambda","01.rpc\u002F06.platforms\u002F03.aws-lambda",{"title":121,"path":122,"stem":123},"Google Cloud Functions","\u002Frpc\u002Fplatforms\u002Fgoogle-cloud-functions","01.rpc\u002F06.platforms\u002F04.google-cloud-functions",{"title":125,"path":126,"stem":127},"Cloudflare Workers","\u002Frpc\u002Fplatforms\u002Fcloudflare","01.rpc\u002F06.platforms\u002F05.cloudflare",{"title":129,"path":130,"stem":131},"Vercel","\u002Frpc\u002Fplatforms\u002Fvercel","01.rpc\u002F06.platforms\u002F06.vercel",{"title":133,"path":134,"stem":135},"uWebSockets.js","\u002Frpc\u002Fplatforms\u002Fuwebsockets","01.rpc\u002F06.platforms\u002F07.uwebsockets",{"title":137,"icon":138,"path":139,"stem":140,"children":141,"page":24},"Devtools","icon-park-outline:tool","\u002Frpc\u002Fdevtools","01.rpc\u002F07.devtools",[142,146,150,154,158],{"title":143,"path":144,"stem":145},"Linter","\u002Frpc\u002Fdevtools\u002Flinter","01.rpc\u002F07.devtools\u002F01.linter",{"title":147,"path":148,"stem":149},"Vite","\u002Frpc\u002Fdevtools\u002Fvite","01.rpc\u002F07.devtools\u002F02.vite",{"title":151,"path":152,"stem":153},"Next.js","\u002Frpc\u002Fdevtools\u002Fnextjs","01.rpc\u002F07.devtools\u002F03.nextjs",{"title":155,"path":156,"stem":157},"CLI","\u002Frpc\u002Fdevtools\u002Fcli","01.rpc\u002F07.devtools\u002F04.cli",{"title":159,"path":160,"stem":161},"API Types","\u002Frpc\u002Fdevtools\u002Fapi-types","01.rpc\u002F07.devtools\u002F05.api-types",{"title":163,"icon":164,"path":165,"stem":166,"children":167,"page":24},"RunTypes","i-lucide-braces","\u002Fruntypes","02.runtypes",[168,184,224,254,268,290,332],{"title":11,"icon":169,"redirect":165,"path":170,"stem":171,"children":172,"page":24},"i-lucide-rocket","\u002Fruntypes\u002Fintroduction","02.runtypes\u002F01.introduction",[173,177,180],{"title":174,"path":175,"stem":176},"Built on typescript-go","\u002Fruntypes\u002Fintroduction\u002Fbuilt-on-typescript-go","02.runtypes\u002F01.introduction\u002F02.built-on-typescript-go",{"title":17,"path":178,"stem":179},"\u002Fruntypes\u002Fintroduction\u002Fquick-start","02.runtypes\u002F01.introduction\u002F03.quick-start",{"title":181,"path":182,"stem":183},"Configuration","\u002Fruntypes\u002Fintroduction\u002Fconfiguration","02.runtypes\u002F01.introduction\u002F04.configuration",{"title":185,"icon":186,"redirect":187,"path":188,"stem":189,"children":190,"page":24},"Guide","i-lucide-book-open","\u002Fruntypes\u002Fguide\u002Ftype-builders","\u002Fruntypes\u002Fguide","02.runtypes\u002F02.guide",[191,194,198,201,204,208,212,216,220],{"title":192,"path":187,"stem":193},"Types vs Type Builders","02.runtypes\u002F02.guide\u002F01.type-builders",{"title":195,"path":196,"stem":197},"Reflection","\u002Fruntypes\u002Fguide\u002Freflection","02.runtypes\u002F02.guide\u002F02.reflection",{"title":52,"path":199,"stem":200},"\u002Fruntypes\u002Fguide\u002Fvalidation","02.runtypes\u002F02.guide\u002F03.validation",{"title":56,"path":202,"stem":203},"\u002Fruntypes\u002Fguide\u002Fjson-round-trip","02.runtypes\u002F02.guide\u002F04.json-round-trip",{"title":205,"path":206,"stem":207},"Data Mocking","\u002Fruntypes\u002Fguide\u002Fmocking","02.runtypes\u002F02.guide\u002F07.mocking",{"title":209,"path":210,"stem":211},"JSON Schemas","\u002Fruntypes\u002Fguide\u002Fjson-schemas","02.runtypes\u002F02.guide\u002F08.json-schemas",{"title":213,"path":214,"stem":215},"Pure Functions","\u002Fruntypes\u002Fguide\u002Fpure-functions","02.runtypes\u002F02.guide\u002F09.pure-functions",{"title":217,"path":218,"stem":219},"Compiler Markers","\u002Fruntypes\u002Fguide\u002Fcompiler-markers","02.runtypes\u002F02.guide\u002F10.compiler-markers",{"title":221,"path":222,"stem":223},"All Compiled Functions","\u002Fruntypes\u002Fguide\u002Fall-compiled-functions","02.runtypes\u002F02.guide\u002F11.all-compiled-functions",{"title":225,"icon":226,"redirect":227,"path":228,"stem":229,"children":230,"page":24},"Type Formats","i-lucide-shapes","\u002Fruntypes\u002Ftype-formats\u002Foverview","\u002Fruntypes\u002Ftype-formats","02.runtypes\u002F03.type-formats",[231,234,238,242,246,250],{"title":232,"path":227,"stem":233},"Overview","02.runtypes\u002F03.type-formats\u002F01.overview",{"title":235,"path":236,"stem":237},"String Formats","\u002Fruntypes\u002Ftype-formats\u002Fstring","02.runtypes\u002F03.type-formats\u002F02.string",{"title":239,"path":240,"stem":241},"Number Formats","\u002Fruntypes\u002Ftype-formats\u002Fnumber","02.runtypes\u002F03.type-formats\u002F03.number",{"title":243,"path":244,"stem":245},"BigInt Formats","\u002Fruntypes\u002Ftype-formats\u002Fbigint","02.runtypes\u002F03.type-formats\u002F04.bigint",{"title":247,"path":248,"stem":249},"Date and Time Formats","\u002Fruntypes\u002Ftype-formats\u002Fdate-time","02.runtypes\u002F03.type-formats\u002F05.date-time",{"title":251,"path":252,"stem":253},"Collection Formats","\u002Fruntypes\u002Ftype-formats\u002Fcollections","02.runtypes\u002F03.type-formats\u002F06.collections",{"title":255,"icon":256,"redirect":257,"path":258,"stem":259,"children":260,"page":24},"Tooling","i-lucide-wrench","\u002Fruntypes\u002Ftooling\u002Flinting","\u002Fruntypes\u002Ftooling","02.runtypes\u002F04.tooling",[261,264],{"title":262,"path":257,"stem":263},"Linting","02.runtypes\u002F04.tooling\u002F01.linting",{"title":265,"path":266,"stem":267},"Source Conversion","\u002Fruntypes\u002Ftooling\u002Fsource-conversion","02.runtypes\u002F04.tooling\u002F02.source-conversion",{"title":269,"icon":270,"redirect":271,"path":272,"stem":273,"children":274,"page":24},"AI Integration","i-lucide-sparkles","\u002Fruntypes\u002Fai-integration\u002Fworkflow-and-commands","\u002Fruntypes\u002Fai-integration","02.runtypes\u002F05.ai-integration",[275,278,282,286],{"title":276,"path":271,"stem":277},"AI Workflow","02.runtypes\u002F05.ai-integration\u002F01.workflow-and-commands",{"title":279,"path":280,"stem":281},"FriendlyText","\u002Fruntypes\u002Fai-integration\u002Ffriendly-text","02.runtypes\u002F05.ai-integration\u002F02.friendly-text",{"title":283,"path":284,"stem":285},"MockData","\u002Fruntypes\u002Fai-integration\u002Fmock-data","02.runtypes\u002F05.ai-integration\u002F03.mock-data",{"title":287,"path":288,"stem":289},"Translations (i18n)","\u002Fruntypes\u002Fai-integration\u002Fi18n","02.runtypes\u002F05.ai-integration\u002F04.i18n",{"title":291,"icon":292,"redirect":293,"path":294,"stem":295,"children":296,"page":24},"Drizzle ORM","i-lineicons-drizzle","\u002Fruntypes\u002Fdrizzle-orm\u002Fdrizzle-overview","\u002Fruntypes\u002Fdrizzle-orm","02.runtypes\u002F06.drizzle-orm",[297,300,304,308,312,316,320,324,328],{"title":298,"path":293,"stem":299},"Drizzle Overview","02.runtypes\u002F06.drizzle-orm\u002F00.drizzle-overview",{"title":301,"path":302,"stem":303},"Column Formats","\u002Fruntypes\u002Fdrizzle-orm\u002Fcolumn-formats","02.runtypes\u002F06.drizzle-orm\u002F01.column-formats",{"title":305,"path":306,"stem":307},"Views","\u002Fruntypes\u002Fdrizzle-orm\u002Fviews","02.runtypes\u002F06.drizzle-orm\u002F02.views",{"title":309,"path":310,"stem":311},"Indexes and Constraints","\u002Fruntypes\u002Fdrizzle-orm\u002Fconstraints","02.runtypes\u002F06.drizzle-orm\u002F03.constraints",{"title":313,"path":314,"stem":315},"Row Level Security","\u002Fruntypes\u002Fdrizzle-orm\u002Frow-level-security","02.runtypes\u002F06.drizzle-orm\u002F04.row-level-security",{"title":317,"path":318,"stem":319},"Relations","\u002Fruntypes\u002Fdrizzle-orm\u002Frelations","02.runtypes\u002F06.drizzle-orm\u002F05.relations",{"title":321,"path":322,"stem":323},"The Schema File","\u002Fruntypes\u002Fdrizzle-orm\u002Fschema-file","02.runtypes\u002F06.drizzle-orm\u002F06.schema-file",{"title":325,"path":326,"stem":327},"Migrate an Existing Schema","\u002Fruntypes\u002Fdrizzle-orm\u002Fmigrate-an-existing-schema","02.runtypes\u002F06.drizzle-orm\u002F07.migrate-an-existing-schema",{"title":329,"path":330,"stem":331},"Cloudflare D1 and Durable Objects","\u002Fruntypes\u002Fdrizzle-orm\u002Fcloudflare-storage","02.runtypes\u002F06.drizzle-orm\u002F08.cloudflare-storage",{"title":333,"icon":334,"redirect":335,"path":336,"stem":337,"children":338,"page":24},"Diagnostics","i-lucide-triangle-alert","\u002Fruntypes\u002Fdiagnostics\u002Ferror-levels","\u002Fruntypes\u002Fdiagnostics","02.runtypes\u002F08.diagnostics",[339,342],{"title":340,"path":335,"stem":341},"Error Levels","02.runtypes\u002F08.diagnostics\u002F01.error-levels",{"title":343,"path":344,"stem":345},"All Diagnostics","\u002Fruntypes\u002Fdiagnostics\u002Fall-diagnostics","02.runtypes\u002F08.diagnostics\u002F02.all-diagnostics",{"title":347,"icon":348,"path":349,"stem":350,"children":351,"page":24},"Benchmarks","i-lucide-gauge","\u002Fbenchmarks","03.benchmarks",[352,372],{"title":5,"icon":6,"redirect":353,"path":354,"stem":355,"children":356,"page":24},"\u002Fbenchmarks\u002Frpc\u002Fhello-world","\u002Fbenchmarks\u002Frpc","03.benchmarks\u002F02.rpc",[357,360,364,368],{"title":358,"path":353,"stem":359},"Hello World","03.benchmarks\u002F02.rpc\u002F01.hello-world",{"title":361,"path":362,"stem":363},"Light Validation","\u002Fbenchmarks\u002Frpc\u002Flight-validation","03.benchmarks\u002F02.rpc\u002F02.light-validation",{"title":365,"path":366,"stem":367},"Heavy Validation","\u002Fbenchmarks\u002Frpc\u002Fheavy-validation","03.benchmarks\u002F02.rpc\u002F03.heavy-validation",{"title":369,"path":370,"stem":371},"Payload Sizes","\u002Fbenchmarks\u002Frpc\u002Fpayload-sizes","03.benchmarks\u002F02.rpc\u002F04.payload-sizes",{"title":163,"icon":164,"redirect":373,"path":374,"stem":375,"children":376,"page":24},"\u002Fbenchmarks\u002Fruntypes\u002Fis-valid","\u002Fbenchmarks\u002Fruntypes","03.benchmarks\u002F03.runtypes",[377,380,384,388,392,395],{"title":378,"path":373,"stem":379},"Is Valid","03.benchmarks\u002F03.runtypes\u002F01.is-valid",{"title":381,"path":382,"stem":383},"Is Valid Formats","\u002Fbenchmarks\u002Fruntypes\u002Fis-valid-formats","03.benchmarks\u002F03.runtypes\u002F02.is-valid-formats",{"title":385,"path":386,"stem":387},"Get Errors","\u002Fbenchmarks\u002Fruntypes\u002Fget-errors","03.benchmarks\u002F03.runtypes\u002F03.get-errors",{"title":389,"path":390,"stem":391},"Get Errors Formats","\u002Fbenchmarks\u002Fruntypes\u002Fget-errors-formats","03.benchmarks\u002F03.runtypes\u002F04.get-errors-formats",{"title":56,"path":393,"stem":394},"\u002Fbenchmarks\u002Fruntypes\u002Fjson-round-trip","03.benchmarks\u002F03.runtypes\u002F05.json-round-trip",{"title":396,"path":397,"stem":398},"Type Checking","\u002Fbenchmarks\u002Fruntypes\u002Ftype-checking","03.benchmarks\u002F03.runtypes\u002F07.type-checking",{"id":400,"title":192,"body":401,"description":3062,"extension":3063,"links":3064,"meta":3065,"navigation":552,"path":187,"seo":3066,"stem":193,"__hash__":3067},"docs\u002F02.runtypes\u002F02.guide\u002F01.type-builders.md",{"type":402,"value":403},"minimark",[404,408,421,804,808,814,1113,1117,1121,1124,1508,1512,1522,2267,2362,2365,2369,2379,2690,2739,2745,2749,2752,2937,2943,2947,2957,3058],[405,406,192],"h2",{"id":407},"types-vs-type-builders",[409,410,411,412,416,417,420],"p",{},"Same shape, two spellings: ",[413,414,415],"code",{},"isProductA"," and ",[413,418,419],{},"isProductB"," are identical validators. A builder returns a run-type, a value you can store, pass to a function or build up piece by piece.",[422,423,426,584],"div",{"className":424},[425],"rt-define-cols",[427,428,429],"code-group",{},[430,431,437],"pre",{"className":432,"code":433,"filename":434,"language":435,"meta":436,"style":436},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Option A: a plain TypeScript type, nothing extra to write.\ntype Product = {\n  id: number;\n  name: string;\n  tags: string[];\n  status: 'draft' | 'live';\n};\n\nconst isProductA = createValidateFn\u003CProduct>();\n","Type Definition","ts","",[413,438,439,448,466,482,495,511,541,547,554],{"__ignoreMap":436},[440,441,444],"span",{"class":442,"line":443},"line",1,[440,445,447],{"class":446},"sHwdD","\u002F\u002F Option A: a plain TypeScript type, nothing extra to write.\n",[440,449,451,455,459,463],{"class":442,"line":450},2,[440,452,454],{"class":453},"spNyl","type",[440,456,458],{"class":457},"sBMFI"," Product",[440,460,462],{"class":461},"sMK4o"," =",[440,464,465],{"class":461}," {\n",[440,467,469,473,476,479],{"class":442,"line":468},3,[440,470,472],{"class":471},"swJcz","  id",[440,474,475],{"class":461},":",[440,477,478],{"class":457}," number",[440,480,481],{"class":461},";\n",[440,483,485,488,490,493],{"class":442,"line":484},4,[440,486,487],{"class":471},"  name",[440,489,475],{"class":461},[440,491,492],{"class":457}," string",[440,494,481],{"class":461},[440,496,498,501,503,505,509],{"class":442,"line":497},5,[440,499,500],{"class":471},"  tags",[440,502,475],{"class":461},[440,504,492],{"class":457},[440,506,508],{"class":507},"sTEyZ","[]",[440,510,481],{"class":461},[440,512,514,517,519,522,526,529,532,534,537,539],{"class":442,"line":513},6,[440,515,516],{"class":471},"  status",[440,518,475],{"class":461},[440,520,521],{"class":461}," '",[440,523,525],{"class":524},"sfazB","draft",[440,527,528],{"class":461},"'",[440,530,531],{"class":461}," |",[440,533,521],{"class":461},[440,535,536],{"class":524},"live",[440,538,528],{"class":461},[440,540,481],{"class":461},[440,542,544],{"class":442,"line":543},7,[440,545,546],{"class":461},"};\n",[440,548,550],{"class":442,"line":549},8,[440,551,553],{"emptyLinePlaceholder":552},true,"\n",[440,555,557,560,563,566,570,573,576,579,582],{"class":442,"line":556},9,[440,558,559],{"class":453},"const",[440,561,562],{"class":507}," isProductA ",[440,564,565],{"class":461},"=",[440,567,569],{"class":568},"s2Zo4"," createValidateFn",[440,571,572],{"class":461},"\u003C",[440,574,575],{"class":457},"Product",[440,577,578],{"class":461},">",[440,580,581],{"class":507},"()",[440,583,481],{"class":461},[427,585,586],{},[430,587,590],{"className":432,"code":588,"filename":589,"language":435,"meta":436,"style":436},"\u002F\u002F Option B: the RT.* builders, if you like the Zod \u002F TypeBox feel.\nconst productRunType = RT.object({\n  id: TF.number(),\n  name: TF.string(),\n  tags: RT.array(TF.string()),\n  status: RT.union([RT.literal('draft'), RT.literal('live')]),\n});\n\n\u002F\u002F Recover the TypeScript type, then generate from the type.\ntype ProductFromRunType = InferType\u003Ctypeof productRunType>;\n\nconst isProductB = createValidateFn\u003CProductFromRunType>();\n","Type Builder",[413,591,592,597,621,640,657,682,736,745,749,754,776,781],{"__ignoreMap":436},[440,593,594],{"class":442,"line":443},[440,595,596],{"class":446},"\u002F\u002F Option B: the RT.* builders, if you like the Zod \u002F TypeBox feel.\n",[440,598,599,601,604,606,609,612,615,618],{"class":442,"line":450},[440,600,559],{"class":453},[440,602,603],{"class":507}," productRunType ",[440,605,565],{"class":461},[440,607,608],{"class":507}," RT",[440,610,611],{"class":461},".",[440,613,614],{"class":568},"object",[440,616,617],{"class":507},"(",[440,619,620],{"class":461},"{\n",[440,622,623,625,627,630,632,635,637],{"class":442,"line":468},[440,624,472],{"class":471},[440,626,475],{"class":461},[440,628,629],{"class":507}," TF",[440,631,611],{"class":461},[440,633,634],{"class":568},"number",[440,636,581],{"class":507},[440,638,639],{"class":461},",\n",[440,641,642,644,646,648,650,653,655],{"class":442,"line":484},[440,643,487],{"class":471},[440,645,475],{"class":461},[440,647,629],{"class":507},[440,649,611],{"class":461},[440,651,652],{"class":568},"string",[440,654,581],{"class":507},[440,656,639],{"class":461},[440,658,659,661,663,665,667,670,673,675,677,680],{"class":442,"line":497},[440,660,500],{"class":471},[440,662,475],{"class":461},[440,664,608],{"class":507},[440,666,611],{"class":461},[440,668,669],{"class":568},"array",[440,671,672],{"class":507},"(TF",[440,674,611],{"class":461},[440,676,652],{"class":568},[440,678,679],{"class":507},"())",[440,681,639],{"class":461},[440,683,684,686,688,690,692,695,698,700,703,705,707,709,711,714,717,719,721,723,725,727,729,731,734],{"class":442,"line":513},[440,685,516],{"class":471},[440,687,475],{"class":461},[440,689,608],{"class":507},[440,691,611],{"class":461},[440,693,694],{"class":568},"union",[440,696,697],{"class":507},"([RT",[440,699,611],{"class":461},[440,701,702],{"class":568},"literal",[440,704,617],{"class":507},[440,706,528],{"class":461},[440,708,525],{"class":524},[440,710,528],{"class":461},[440,712,713],{"class":507},")",[440,715,716],{"class":461},",",[440,718,608],{"class":507},[440,720,611],{"class":461},[440,722,702],{"class":568},[440,724,617],{"class":507},[440,726,528],{"class":461},[440,728,536],{"class":524},[440,730,528],{"class":461},[440,732,733],{"class":507},")])",[440,735,639],{"class":461},[440,737,738,741,743],{"class":442,"line":543},[440,739,740],{"class":461},"}",[440,742,713],{"class":507},[440,744,481],{"class":461},[440,746,747],{"class":442,"line":549},[440,748,553],{"emptyLinePlaceholder":552},[440,750,751],{"class":442,"line":556},[440,752,753],{"class":446},"\u002F\u002F Recover the TypeScript type, then generate from the type.\n",[440,755,757,759,762,764,767,770,773],{"class":442,"line":756},10,[440,758,454],{"class":453},[440,760,761],{"class":457}," ProductFromRunType",[440,763,462],{"class":461},[440,765,766],{"class":457}," InferType",[440,768,769],{"class":461},"\u003Ctypeof",[440,771,772],{"class":507}," productRunType",[440,774,775],{"class":461},">;\n",[440,777,779],{"class":442,"line":778},11,[440,780,553],{"emptyLinePlaceholder":552},[440,782,784,786,789,791,793,795,798,800,802],{"class":442,"line":783},12,[440,785,559],{"class":453},[440,787,788],{"class":507}," isProductB ",[440,790,565],{"class":461},[440,792,569],{"class":568},[440,794,572],{"class":461},[440,796,797],{"class":457},"ProductFromRunType",[440,799,578],{"class":461},[440,801,581],{"class":507},[440,803,481],{"class":461},[405,805,807],{"id":806},"inferring-the-type-from-a-builder","Inferring the Type from a Builder",[409,809,810,813],{},[413,811,812],{},"InferType\u003Ctypeof runType>"," gives you back the TypeScript type of a run-type. Reflect a type or infer one from a run-type: either way you never write a shape twice.",[430,815,817],{"className":432,"code":816,"language":435,"meta":436,"style":436},"import * as TF from '@mionjs\u002Frun-types\u002Fformats';\nimport {type InferType} from '@mionjs\u002Frun-types';\nimport * as RT from '@mionjs\u002Frun-types\u002Fbuilders';\n\nconst address = RT.object({\n  street: TF.string(),\n  city: TF.string(),\n  zip: TF.string(),\n});\n\ntype Address = InferType\u003Ctypeof address>;\n\n\u002F\u002F a normal type, use it anywhere\nconst home: Address = {\n  street: '1 Infinite Loop',\n  city: 'Cupertino',\n  zip: '95014',\n};\n\nexport {address, home};\nexport type {Address};\n",[413,818,819,846,871,893,897,916,933,950,967,975,979,997,1001,1007,1023,1039,1055,1071,1076,1081,1098],{"__ignoreMap":436},[440,820,821,825,828,831,834,837,839,842,844],{"class":442,"line":443},[440,822,824],{"class":823},"s7zQu","import",[440,826,827],{"class":461}," *",[440,829,830],{"class":823}," as",[440,832,833],{"class":507}," TF ",[440,835,836],{"class":823},"from",[440,838,521],{"class":461},[440,840,841],{"class":524},"@mionjs\u002Frun-types\u002Fformats",[440,843,528],{"class":461},[440,845,481],{"class":461},[440,847,848,850,853,855,857,859,862,864,867,869],{"class":442,"line":450},[440,849,824],{"class":823},[440,851,852],{"class":461}," {",[440,854,454],{"class":823},[440,856,766],{"class":507},[440,858,740],{"class":461},[440,860,861],{"class":823}," from",[440,863,521],{"class":461},[440,865,866],{"class":524},"@mionjs\u002Frun-types",[440,868,528],{"class":461},[440,870,481],{"class":461},[440,872,873,875,877,879,882,884,886,889,891],{"class":442,"line":468},[440,874,824],{"class":823},[440,876,827],{"class":461},[440,878,830],{"class":823},[440,880,881],{"class":507}," RT ",[440,883,836],{"class":823},[440,885,521],{"class":461},[440,887,888],{"class":524},"@mionjs\u002Frun-types\u002Fbuilders",[440,890,528],{"class":461},[440,892,481],{"class":461},[440,894,895],{"class":442,"line":484},[440,896,553],{"emptyLinePlaceholder":552},[440,898,899,901,904,906,908,910,912,914],{"class":442,"line":497},[440,900,559],{"class":453},[440,902,903],{"class":507}," address ",[440,905,565],{"class":461},[440,907,608],{"class":507},[440,909,611],{"class":461},[440,911,614],{"class":568},[440,913,617],{"class":507},[440,915,620],{"class":461},[440,917,918,921,923,925,927,929,931],{"class":442,"line":513},[440,919,920],{"class":471},"  street",[440,922,475],{"class":461},[440,924,629],{"class":507},[440,926,611],{"class":461},[440,928,652],{"class":568},[440,930,581],{"class":507},[440,932,639],{"class":461},[440,934,935,938,940,942,944,946,948],{"class":442,"line":543},[440,936,937],{"class":471},"  city",[440,939,475],{"class":461},[440,941,629],{"class":507},[440,943,611],{"class":461},[440,945,652],{"class":568},[440,947,581],{"class":507},[440,949,639],{"class":461},[440,951,952,955,957,959,961,963,965],{"class":442,"line":549},[440,953,954],{"class":471},"  zip",[440,956,475],{"class":461},[440,958,629],{"class":507},[440,960,611],{"class":461},[440,962,652],{"class":568},[440,964,581],{"class":507},[440,966,639],{"class":461},[440,968,969,971,973],{"class":442,"line":556},[440,970,740],{"class":461},[440,972,713],{"class":507},[440,974,481],{"class":461},[440,976,977],{"class":442,"line":756},[440,978,553],{"emptyLinePlaceholder":552},[440,980,981,983,986,988,990,992,995],{"class":442,"line":778},[440,982,454],{"class":453},[440,984,985],{"class":457}," Address",[440,987,462],{"class":461},[440,989,766],{"class":457},[440,991,769],{"class":461},[440,993,994],{"class":507}," address",[440,996,775],{"class":461},[440,998,999],{"class":442,"line":783},[440,1000,553],{"emptyLinePlaceholder":552},[440,1002,1004],{"class":442,"line":1003},13,[440,1005,1006],{"class":446},"\u002F\u002F a normal type, use it anywhere\n",[440,1008,1010,1012,1015,1017,1019,1021],{"class":442,"line":1009},14,[440,1011,559],{"class":453},[440,1013,1014],{"class":507}," home",[440,1016,475],{"class":461},[440,1018,985],{"class":457},[440,1020,462],{"class":461},[440,1022,465],{"class":461},[440,1024,1026,1028,1030,1032,1035,1037],{"class":442,"line":1025},15,[440,1027,920],{"class":471},[440,1029,475],{"class":461},[440,1031,521],{"class":461},[440,1033,1034],{"class":524},"1 Infinite Loop",[440,1036,528],{"class":461},[440,1038,639],{"class":461},[440,1040,1042,1044,1046,1048,1051,1053],{"class":442,"line":1041},16,[440,1043,937],{"class":471},[440,1045,475],{"class":461},[440,1047,521],{"class":461},[440,1049,1050],{"class":524},"Cupertino",[440,1052,528],{"class":461},[440,1054,639],{"class":461},[440,1056,1058,1060,1062,1064,1067,1069],{"class":442,"line":1057},17,[440,1059,954],{"class":471},[440,1061,475],{"class":461},[440,1063,521],{"class":461},[440,1065,1066],{"class":524},"95014",[440,1068,528],{"class":461},[440,1070,639],{"class":461},[440,1072,1074],{"class":442,"line":1073},18,[440,1075,546],{"class":461},[440,1077,1079],{"class":442,"line":1078},19,[440,1080,553],{"emptyLinePlaceholder":552},[440,1082,1084,1087,1089,1092,1094,1096],{"class":442,"line":1083},20,[440,1085,1086],{"class":823},"export",[440,1088,852],{"class":461},[440,1090,1091],{"class":507},"address",[440,1093,716],{"class":461},[440,1095,1014],{"class":507},[440,1097,546],{"class":461},[440,1099,1101,1103,1106,1108,1111],{"class":442,"line":1100},21,[440,1102,1086],{"class":823},[440,1104,1105],{"class":823}," type",[440,1107,852],{"class":461},[440,1109,1110],{"class":507},"Address",[440,1112,546],{"class":461},[1114,1115,1116],"tip",{},"When other files only need the shape, export the type rather than the schema: a schema you only take the type of adds nothing to your bundle. Pass it to a create function, read its properties or export it, and its runtime description ships too.",[405,1118,1120],{"id":1119},"mixing-types-and-builders","Mixing Types and Builders",[409,1122,1123],{},"Use both in one file. Either way you get the same validator, JSON codec and mock.",[430,1125,1127],{"className":432,"code":1126,"language":435,"meta":436,"style":436},"import * as TF from '@mionjs\u002Frun-types\u002Fformats';\nimport {createValidateFn} from '@mionjs\u002Frun-types';\nimport * as RT from '@mionjs\u002Frun-types\u002Fbuilders';\n\ntype Money = {amount: number; currency: 'USD' | 'EUR'};\n\n\u002F\u002F the Money shape again, written with builders\nconst invoice = RT.object({\n  id: TF.string(),\n  lines: RT.array(\n    RT.object({\n      sku: TF.string(),\n      total: RT.object({\n        amount: TF.number(),\n        currency: RT.union([RT.literal('USD'), RT.literal('EUR')]),\n      }),\n    })\n  ),\n});\n\nconst isMoney = createValidateFn\u003CMoney>();\nconst isInvoice = createValidateFn(invoice);\n\nexport {isMoney, isInvoice};\n",[413,1128,1129,1149,1170,1190,1194,1238,1242,1247,1266,1282,1298,1311,1328,1345,1362,1411,1420,1428,1435,1443,1447,1469,1486,1491],{"__ignoreMap":436},[440,1130,1131,1133,1135,1137,1139,1141,1143,1145,1147],{"class":442,"line":443},[440,1132,824],{"class":823},[440,1134,827],{"class":461},[440,1136,830],{"class":823},[440,1138,833],{"class":507},[440,1140,836],{"class":823},[440,1142,521],{"class":461},[440,1144,841],{"class":524},[440,1146,528],{"class":461},[440,1148,481],{"class":461},[440,1150,1151,1153,1155,1158,1160,1162,1164,1166,1168],{"class":442,"line":450},[440,1152,824],{"class":823},[440,1154,852],{"class":461},[440,1156,1157],{"class":507},"createValidateFn",[440,1159,740],{"class":461},[440,1161,861],{"class":823},[440,1163,521],{"class":461},[440,1165,866],{"class":524},[440,1167,528],{"class":461},[440,1169,481],{"class":461},[440,1171,1172,1174,1176,1178,1180,1182,1184,1186,1188],{"class":442,"line":468},[440,1173,824],{"class":823},[440,1175,827],{"class":461},[440,1177,830],{"class":823},[440,1179,881],{"class":507},[440,1181,836],{"class":823},[440,1183,521],{"class":461},[440,1185,888],{"class":524},[440,1187,528],{"class":461},[440,1189,481],{"class":461},[440,1191,1192],{"class":442,"line":484},[440,1193,553],{"emptyLinePlaceholder":552},[440,1195,1196,1198,1201,1203,1205,1208,1210,1212,1215,1218,1220,1222,1225,1227,1229,1231,1234,1236],{"class":442,"line":497},[440,1197,454],{"class":453},[440,1199,1200],{"class":457}," Money",[440,1202,462],{"class":461},[440,1204,852],{"class":461},[440,1206,1207],{"class":471},"amount",[440,1209,475],{"class":461},[440,1211,478],{"class":457},[440,1213,1214],{"class":461},";",[440,1216,1217],{"class":471}," currency",[440,1219,475],{"class":461},[440,1221,521],{"class":461},[440,1223,1224],{"class":524},"USD",[440,1226,528],{"class":461},[440,1228,531],{"class":461},[440,1230,521],{"class":461},[440,1232,1233],{"class":524},"EUR",[440,1235,528],{"class":461},[440,1237,546],{"class":461},[440,1239,1240],{"class":442,"line":513},[440,1241,553],{"emptyLinePlaceholder":552},[440,1243,1244],{"class":442,"line":543},[440,1245,1246],{"class":446},"\u002F\u002F the Money shape again, written with builders\n",[440,1248,1249,1251,1254,1256,1258,1260,1262,1264],{"class":442,"line":549},[440,1250,559],{"class":453},[440,1252,1253],{"class":507}," invoice ",[440,1255,565],{"class":461},[440,1257,608],{"class":507},[440,1259,611],{"class":461},[440,1261,614],{"class":568},[440,1263,617],{"class":507},[440,1265,620],{"class":461},[440,1267,1268,1270,1272,1274,1276,1278,1280],{"class":442,"line":556},[440,1269,472],{"class":471},[440,1271,475],{"class":461},[440,1273,629],{"class":507},[440,1275,611],{"class":461},[440,1277,652],{"class":568},[440,1279,581],{"class":507},[440,1281,639],{"class":461},[440,1283,1284,1287,1289,1291,1293,1295],{"class":442,"line":756},[440,1285,1286],{"class":471},"  lines",[440,1288,475],{"class":461},[440,1290,608],{"class":507},[440,1292,611],{"class":461},[440,1294,669],{"class":568},[440,1296,1297],{"class":507},"(\n",[440,1299,1300,1303,1305,1307,1309],{"class":442,"line":778},[440,1301,1302],{"class":507},"    RT",[440,1304,611],{"class":461},[440,1306,614],{"class":568},[440,1308,617],{"class":507},[440,1310,620],{"class":461},[440,1312,1313,1316,1318,1320,1322,1324,1326],{"class":442,"line":783},[440,1314,1315],{"class":471},"      sku",[440,1317,475],{"class":461},[440,1319,629],{"class":507},[440,1321,611],{"class":461},[440,1323,652],{"class":568},[440,1325,581],{"class":507},[440,1327,639],{"class":461},[440,1329,1330,1333,1335,1337,1339,1341,1343],{"class":442,"line":1003},[440,1331,1332],{"class":471},"      total",[440,1334,475],{"class":461},[440,1336,608],{"class":507},[440,1338,611],{"class":461},[440,1340,614],{"class":568},[440,1342,617],{"class":507},[440,1344,620],{"class":461},[440,1346,1347,1350,1352,1354,1356,1358,1360],{"class":442,"line":1009},[440,1348,1349],{"class":471},"        amount",[440,1351,475],{"class":461},[440,1353,629],{"class":507},[440,1355,611],{"class":461},[440,1357,634],{"class":568},[440,1359,581],{"class":507},[440,1361,639],{"class":461},[440,1363,1364,1367,1369,1371,1373,1375,1377,1379,1381,1383,1385,1387,1389,1391,1393,1395,1397,1399,1401,1403,1405,1407,1409],{"class":442,"line":1025},[440,1365,1366],{"class":471},"        currency",[440,1368,475],{"class":461},[440,1370,608],{"class":507},[440,1372,611],{"class":461},[440,1374,694],{"class":568},[440,1376,697],{"class":507},[440,1378,611],{"class":461},[440,1380,702],{"class":568},[440,1382,617],{"class":507},[440,1384,528],{"class":461},[440,1386,1224],{"class":524},[440,1388,528],{"class":461},[440,1390,713],{"class":507},[440,1392,716],{"class":461},[440,1394,608],{"class":507},[440,1396,611],{"class":461},[440,1398,702],{"class":568},[440,1400,617],{"class":507},[440,1402,528],{"class":461},[440,1404,1233],{"class":524},[440,1406,528],{"class":461},[440,1408,733],{"class":507},[440,1410,639],{"class":461},[440,1412,1413,1416,1418],{"class":442,"line":1041},[440,1414,1415],{"class":461},"      }",[440,1417,713],{"class":507},[440,1419,639],{"class":461},[440,1421,1422,1425],{"class":442,"line":1057},[440,1423,1424],{"class":461},"    }",[440,1426,1427],{"class":507},")\n",[440,1429,1430,1433],{"class":442,"line":1073},[440,1431,1432],{"class":507},"  )",[440,1434,639],{"class":461},[440,1436,1437,1439,1441],{"class":442,"line":1078},[440,1438,740],{"class":461},[440,1440,713],{"class":507},[440,1442,481],{"class":461},[440,1444,1445],{"class":442,"line":1083},[440,1446,553],{"emptyLinePlaceholder":552},[440,1448,1449,1451,1454,1456,1458,1460,1463,1465,1467],{"class":442,"line":1100},[440,1450,559],{"class":453},[440,1452,1453],{"class":507}," isMoney ",[440,1455,565],{"class":461},[440,1457,569],{"class":568},[440,1459,572],{"class":461},[440,1461,1462],{"class":457},"Money",[440,1464,578],{"class":461},[440,1466,581],{"class":507},[440,1468,481],{"class":461},[440,1470,1472,1474,1477,1479,1481,1484],{"class":442,"line":1471},22,[440,1473,559],{"class":453},[440,1475,1476],{"class":507}," isInvoice ",[440,1478,565],{"class":461},[440,1480,569],{"class":568},[440,1482,1483],{"class":507},"(invoice)",[440,1485,481],{"class":461},[440,1487,1489],{"class":442,"line":1488},23,[440,1490,553],{"emptyLinePlaceholder":552},[440,1492,1494,1496,1498,1501,1503,1506],{"class":442,"line":1493},24,[440,1495,1086],{"class":823},[440,1497,852],{"class":461},[440,1499,1500],{"class":507},"isMoney",[440,1502,716],{"class":461},[440,1504,1505],{"class":507}," isInvoice",[440,1507,546],{"class":461},[405,1509,1511],{"id":1510},"labeled-tuples-and-named-parameters","Labeled Tuples and Named Parameters",[409,1513,1514,1515,1518,1519,611],{},"A tuple label like ",[413,1516,1517],{},"[x: number, y: number]"," is part of the type. To write one with builders, wrap each element in ",[413,1520,1521],{},"RT.slot(name, runType)",[430,1523,1525],{"className":432,"code":1524,"language":435,"meta":436,"style":436},"import * as TF from '@mionjs\u002Frun-types\u002Fformats';\nimport {createValidateFn, type InferType} from '@mionjs\u002Frun-types';\nimport * as RT from '@mionjs\u002Frun-types\u002Fbuilders';\n\n\u002F\u002F the same type as the labeled tuple written by hand\nconst pointRunType = RT.tuple({\n  required: [RT.slot('x', TF.number()), RT.slot('y', TF.number())],\n});\ntype Point = InferType\u003Ctypeof pointRunType>; \u002F\u002F [x: number, y: number]\n\nconst isPoint = createValidateFn(pointRunType);\nconst samePoint = createValidateFn\u003C[x: number, y: number]>(); \u002F\u002F same cached validator\n\n\u002F\u002F optional and rest elements take slots too; write only the groups you need\nconst rowRunType = RT.tuple({\n  required: [RT.slot('id', TF.number())],\n  optional: [RT.slot('note', TF.string())],\n  rest: RT.slot('tags', TF.string()),\n});\ntype Row = InferType\u003Ctypeof rowRunType>; \u002F\u002F [id: number, note?: string, ...tags: string[]]\n\n\u002F\u002F no optional elements, so no optional group\nconst logRunType = RT.tuple({\n  required: [RT.slot('level', TF.string())],\n  rest: RT.slot('lines', TF.string()),\n});\ntype Log = InferType\u003Ctypeof logRunType>; \u002F\u002F [level: string, ...lines: string[]]\n\n\u002F\u002F RT.func names its parameters the same way\nconst handlerRunType = RT.func({\n  params: [RT.slot('event', TF.string()), RT.slot('retries', TF.number())],\n  ret: RT.boolean(),\n});\ntype Handler = InferType\u003Ctypeof handlerRunType>; \u002F\u002F (event: string, retries: number) => boolean\n\nexport {isPoint, samePoint, rowRunType, logRunType, handlerRunType};\nexport type {Point, Row, Log, Handler};\n",[413,1526,1527,1547,1573,1593,1597,1602,1622,1686,1694,1716,1720,1736,1779,1783,1788,1807,1840,1874,1908,1916,1937,1941,1946,1965,1998,2032,2041,2063,2068,2074,2095,2157,2176,2185,2207,2212,2241],{"__ignoreMap":436},[440,1528,1529,1531,1533,1535,1537,1539,1541,1543,1545],{"class":442,"line":443},[440,1530,824],{"class":823},[440,1532,827],{"class":461},[440,1534,830],{"class":823},[440,1536,833],{"class":507},[440,1538,836],{"class":823},[440,1540,521],{"class":461},[440,1542,841],{"class":524},[440,1544,528],{"class":461},[440,1546,481],{"class":461},[440,1548,1549,1551,1553,1555,1557,1559,1561,1563,1565,1567,1569,1571],{"class":442,"line":450},[440,1550,824],{"class":823},[440,1552,852],{"class":461},[440,1554,1157],{"class":507},[440,1556,716],{"class":461},[440,1558,1105],{"class":823},[440,1560,766],{"class":507},[440,1562,740],{"class":461},[440,1564,861],{"class":823},[440,1566,521],{"class":461},[440,1568,866],{"class":524},[440,1570,528],{"class":461},[440,1572,481],{"class":461},[440,1574,1575,1577,1579,1581,1583,1585,1587,1589,1591],{"class":442,"line":468},[440,1576,824],{"class":823},[440,1578,827],{"class":461},[440,1580,830],{"class":823},[440,1582,881],{"class":507},[440,1584,836],{"class":823},[440,1586,521],{"class":461},[440,1588,888],{"class":524},[440,1590,528],{"class":461},[440,1592,481],{"class":461},[440,1594,1595],{"class":442,"line":484},[440,1596,553],{"emptyLinePlaceholder":552},[440,1598,1599],{"class":442,"line":497},[440,1600,1601],{"class":446},"\u002F\u002F the same type as the labeled tuple written by hand\n",[440,1603,1604,1606,1609,1611,1613,1615,1618,1620],{"class":442,"line":513},[440,1605,559],{"class":453},[440,1607,1608],{"class":507}," pointRunType ",[440,1610,565],{"class":461},[440,1612,608],{"class":507},[440,1614,611],{"class":461},[440,1616,1617],{"class":568},"tuple",[440,1619,617],{"class":507},[440,1621,620],{"class":461},[440,1623,1624,1627,1629,1632,1634,1637,1639,1641,1644,1646,1648,1650,1652,1654,1656,1658,1660,1662,1664,1666,1668,1671,1673,1675,1677,1679,1681,1684],{"class":442,"line":543},[440,1625,1626],{"class":471},"  required",[440,1628,475],{"class":461},[440,1630,1631],{"class":507}," [RT",[440,1633,611],{"class":461},[440,1635,1636],{"class":568},"slot",[440,1638,617],{"class":507},[440,1640,528],{"class":461},[440,1642,1643],{"class":524},"x",[440,1645,528],{"class":461},[440,1647,716],{"class":461},[440,1649,629],{"class":507},[440,1651,611],{"class":461},[440,1653,634],{"class":568},[440,1655,679],{"class":507},[440,1657,716],{"class":461},[440,1659,608],{"class":507},[440,1661,611],{"class":461},[440,1663,1636],{"class":568},[440,1665,617],{"class":507},[440,1667,528],{"class":461},[440,1669,1670],{"class":524},"y",[440,1672,528],{"class":461},[440,1674,716],{"class":461},[440,1676,629],{"class":507},[440,1678,611],{"class":461},[440,1680,634],{"class":568},[440,1682,1683],{"class":507},"())]",[440,1685,639],{"class":461},[440,1687,1688,1690,1692],{"class":442,"line":549},[440,1689,740],{"class":461},[440,1691,713],{"class":507},[440,1693,481],{"class":461},[440,1695,1696,1698,1701,1703,1705,1707,1710,1713],{"class":442,"line":556},[440,1697,454],{"class":453},[440,1699,1700],{"class":457}," Point",[440,1702,462],{"class":461},[440,1704,766],{"class":457},[440,1706,769],{"class":461},[440,1708,1709],{"class":507}," pointRunType",[440,1711,1712],{"class":461},">;",[440,1714,1715],{"class":446}," \u002F\u002F [x: number, y: number]\n",[440,1717,1718],{"class":442,"line":756},[440,1719,553],{"emptyLinePlaceholder":552},[440,1721,1722,1724,1727,1729,1731,1734],{"class":442,"line":778},[440,1723,559],{"class":453},[440,1725,1726],{"class":507}," isPoint ",[440,1728,565],{"class":461},[440,1730,569],{"class":568},[440,1732,1733],{"class":507},"(pointRunType)",[440,1735,481],{"class":461},[440,1737,1738,1740,1743,1745,1747,1749,1752,1754,1756,1758,1760,1763,1765,1767,1770,1772,1774,1776],{"class":442,"line":783},[440,1739,559],{"class":453},[440,1741,1742],{"class":507}," samePoint ",[440,1744,565],{"class":461},[440,1746,569],{"class":568},[440,1748,572],{"class":461},[440,1750,1751],{"class":507},"[",[440,1753,1643],{"class":457},[440,1755,475],{"class":461},[440,1757,478],{"class":457},[440,1759,716],{"class":461},[440,1761,1762],{"class":457}," y",[440,1764,475],{"class":461},[440,1766,478],{"class":457},[440,1768,1769],{"class":507},"]",[440,1771,578],{"class":461},[440,1773,581],{"class":507},[440,1775,1214],{"class":461},[440,1777,1778],{"class":446}," \u002F\u002F same cached validator\n",[440,1780,1781],{"class":442,"line":1003},[440,1782,553],{"emptyLinePlaceholder":552},[440,1784,1785],{"class":442,"line":1009},[440,1786,1787],{"class":446},"\u002F\u002F optional and rest elements take slots too; write only the groups you need\n",[440,1789,1790,1792,1795,1797,1799,1801,1803,1805],{"class":442,"line":1025},[440,1791,559],{"class":453},[440,1793,1794],{"class":507}," rowRunType ",[440,1796,565],{"class":461},[440,1798,608],{"class":507},[440,1800,611],{"class":461},[440,1802,1617],{"class":568},[440,1804,617],{"class":507},[440,1806,620],{"class":461},[440,1808,1809,1811,1813,1815,1817,1819,1821,1823,1826,1828,1830,1832,1834,1836,1838],{"class":442,"line":1041},[440,1810,1626],{"class":471},[440,1812,475],{"class":461},[440,1814,1631],{"class":507},[440,1816,611],{"class":461},[440,1818,1636],{"class":568},[440,1820,617],{"class":507},[440,1822,528],{"class":461},[440,1824,1825],{"class":524},"id",[440,1827,528],{"class":461},[440,1829,716],{"class":461},[440,1831,629],{"class":507},[440,1833,611],{"class":461},[440,1835,634],{"class":568},[440,1837,1683],{"class":507},[440,1839,639],{"class":461},[440,1841,1842,1845,1847,1849,1851,1853,1855,1857,1860,1862,1864,1866,1868,1870,1872],{"class":442,"line":1057},[440,1843,1844],{"class":471},"  optional",[440,1846,475],{"class":461},[440,1848,1631],{"class":507},[440,1850,611],{"class":461},[440,1852,1636],{"class":568},[440,1854,617],{"class":507},[440,1856,528],{"class":461},[440,1858,1859],{"class":524},"note",[440,1861,528],{"class":461},[440,1863,716],{"class":461},[440,1865,629],{"class":507},[440,1867,611],{"class":461},[440,1869,652],{"class":568},[440,1871,1683],{"class":507},[440,1873,639],{"class":461},[440,1875,1876,1879,1881,1883,1885,1887,1889,1891,1894,1896,1898,1900,1902,1904,1906],{"class":442,"line":1073},[440,1877,1878],{"class":471},"  rest",[440,1880,475],{"class":461},[440,1882,608],{"class":507},[440,1884,611],{"class":461},[440,1886,1636],{"class":568},[440,1888,617],{"class":507},[440,1890,528],{"class":461},[440,1892,1893],{"class":524},"tags",[440,1895,528],{"class":461},[440,1897,716],{"class":461},[440,1899,629],{"class":507},[440,1901,611],{"class":461},[440,1903,652],{"class":568},[440,1905,679],{"class":507},[440,1907,639],{"class":461},[440,1909,1910,1912,1914],{"class":442,"line":1078},[440,1911,740],{"class":461},[440,1913,713],{"class":507},[440,1915,481],{"class":461},[440,1917,1918,1920,1923,1925,1927,1929,1932,1934],{"class":442,"line":1083},[440,1919,454],{"class":453},[440,1921,1922],{"class":457}," Row",[440,1924,462],{"class":461},[440,1926,766],{"class":457},[440,1928,769],{"class":461},[440,1930,1931],{"class":507}," rowRunType",[440,1933,1712],{"class":461},[440,1935,1936],{"class":446}," \u002F\u002F [id: number, note?: string, ...tags: string[]]\n",[440,1938,1939],{"class":442,"line":1100},[440,1940,553],{"emptyLinePlaceholder":552},[440,1942,1943],{"class":442,"line":1471},[440,1944,1945],{"class":446},"\u002F\u002F no optional elements, so no optional group\n",[440,1947,1948,1950,1953,1955,1957,1959,1961,1963],{"class":442,"line":1488},[440,1949,559],{"class":453},[440,1951,1952],{"class":507}," logRunType ",[440,1954,565],{"class":461},[440,1956,608],{"class":507},[440,1958,611],{"class":461},[440,1960,1617],{"class":568},[440,1962,617],{"class":507},[440,1964,620],{"class":461},[440,1966,1967,1969,1971,1973,1975,1977,1979,1981,1984,1986,1988,1990,1992,1994,1996],{"class":442,"line":1493},[440,1968,1626],{"class":471},[440,1970,475],{"class":461},[440,1972,1631],{"class":507},[440,1974,611],{"class":461},[440,1976,1636],{"class":568},[440,1978,617],{"class":507},[440,1980,528],{"class":461},[440,1982,1983],{"class":524},"level",[440,1985,528],{"class":461},[440,1987,716],{"class":461},[440,1989,629],{"class":507},[440,1991,611],{"class":461},[440,1993,652],{"class":568},[440,1995,1683],{"class":507},[440,1997,639],{"class":461},[440,1999,2001,2003,2005,2007,2009,2011,2013,2015,2018,2020,2022,2024,2026,2028,2030],{"class":442,"line":2000},25,[440,2002,1878],{"class":471},[440,2004,475],{"class":461},[440,2006,608],{"class":507},[440,2008,611],{"class":461},[440,2010,1636],{"class":568},[440,2012,617],{"class":507},[440,2014,528],{"class":461},[440,2016,2017],{"class":524},"lines",[440,2019,528],{"class":461},[440,2021,716],{"class":461},[440,2023,629],{"class":507},[440,2025,611],{"class":461},[440,2027,652],{"class":568},[440,2029,679],{"class":507},[440,2031,639],{"class":461},[440,2033,2035,2037,2039],{"class":442,"line":2034},26,[440,2036,740],{"class":461},[440,2038,713],{"class":507},[440,2040,481],{"class":461},[440,2042,2044,2046,2049,2051,2053,2055,2058,2060],{"class":442,"line":2043},27,[440,2045,454],{"class":453},[440,2047,2048],{"class":457}," Log",[440,2050,462],{"class":461},[440,2052,766],{"class":457},[440,2054,769],{"class":461},[440,2056,2057],{"class":507}," logRunType",[440,2059,1712],{"class":461},[440,2061,2062],{"class":446}," \u002F\u002F [level: string, ...lines: string[]]\n",[440,2064,2066],{"class":442,"line":2065},28,[440,2067,553],{"emptyLinePlaceholder":552},[440,2069,2071],{"class":442,"line":2070},29,[440,2072,2073],{"class":446},"\u002F\u002F RT.func names its parameters the same way\n",[440,2075,2077,2079,2082,2084,2086,2088,2091,2093],{"class":442,"line":2076},30,[440,2078,559],{"class":453},[440,2080,2081],{"class":507}," handlerRunType ",[440,2083,565],{"class":461},[440,2085,608],{"class":507},[440,2087,611],{"class":461},[440,2089,2090],{"class":568},"func",[440,2092,617],{"class":507},[440,2094,620],{"class":461},[440,2096,2098,2101,2103,2105,2107,2109,2111,2113,2116,2118,2120,2122,2124,2126,2128,2130,2132,2134,2136,2138,2140,2143,2145,2147,2149,2151,2153,2155],{"class":442,"line":2097},31,[440,2099,2100],{"class":471},"  params",[440,2102,475],{"class":461},[440,2104,1631],{"class":507},[440,2106,611],{"class":461},[440,2108,1636],{"class":568},[440,2110,617],{"class":507},[440,2112,528],{"class":461},[440,2114,2115],{"class":524},"event",[440,2117,528],{"class":461},[440,2119,716],{"class":461},[440,2121,629],{"class":507},[440,2123,611],{"class":461},[440,2125,652],{"class":568},[440,2127,679],{"class":507},[440,2129,716],{"class":461},[440,2131,608],{"class":507},[440,2133,611],{"class":461},[440,2135,1636],{"class":568},[440,2137,617],{"class":507},[440,2139,528],{"class":461},[440,2141,2142],{"class":524},"retries",[440,2144,528],{"class":461},[440,2146,716],{"class":461},[440,2148,629],{"class":507},[440,2150,611],{"class":461},[440,2152,634],{"class":568},[440,2154,1683],{"class":507},[440,2156,639],{"class":461},[440,2158,2160,2163,2165,2167,2169,2172,2174],{"class":442,"line":2159},32,[440,2161,2162],{"class":471},"  ret",[440,2164,475],{"class":461},[440,2166,608],{"class":507},[440,2168,611],{"class":461},[440,2170,2171],{"class":568},"boolean",[440,2173,581],{"class":507},[440,2175,639],{"class":461},[440,2177,2179,2181,2183],{"class":442,"line":2178},33,[440,2180,740],{"class":461},[440,2182,713],{"class":507},[440,2184,481],{"class":461},[440,2186,2188,2190,2193,2195,2197,2199,2202,2204],{"class":442,"line":2187},34,[440,2189,454],{"class":453},[440,2191,2192],{"class":457}," Handler",[440,2194,462],{"class":461},[440,2196,766],{"class":457},[440,2198,769],{"class":461},[440,2200,2201],{"class":507}," handlerRunType",[440,2203,1712],{"class":461},[440,2205,2206],{"class":446}," \u002F\u002F (event: string, retries: number) => boolean\n",[440,2208,2210],{"class":442,"line":2209},35,[440,2211,553],{"emptyLinePlaceholder":552},[440,2213,2215,2217,2219,2222,2224,2227,2229,2231,2233,2235,2237,2239],{"class":442,"line":2214},36,[440,2216,1086],{"class":823},[440,2218,852],{"class":461},[440,2220,2221],{"class":507},"isPoint",[440,2223,716],{"class":461},[440,2225,2226],{"class":507}," samePoint",[440,2228,716],{"class":461},[440,2230,1931],{"class":507},[440,2232,716],{"class":461},[440,2234,2057],{"class":507},[440,2236,716],{"class":461},[440,2238,2201],{"class":507},[440,2240,546],{"class":461},[440,2242,2244,2246,2248,2250,2253,2255,2257,2259,2261,2263,2265],{"class":442,"line":2243},37,[440,2245,1086],{"class":823},[440,2247,1105],{"class":823},[440,2249,852],{"class":461},[440,2251,2252],{"class":507},"Point",[440,2254,716],{"class":461},[440,2256,1922],{"class":507},[440,2258,716],{"class":461},[440,2260,2048],{"class":507},[440,2262,716],{"class":461},[440,2264,2192],{"class":507},[440,2266,546],{"class":461},[2268,2269,2270,2286],"table",{},[2271,2272,2273],"thead",{},[2274,2275,2276,2280,2283],"tr",{},[2277,2278,2279],"th",{},"Builder",[2277,2281,2282],{},"Group",[2277,2284,2285],{},"Holds",[2287,2288,2289,2305,2319,2333,2348],"tbody",{},[2274,2290,2291,2297,2302],{},[2292,2293,2294],"td",{},[413,2295,2296],{},"RT.tuple",[2292,2298,2299],{},[413,2300,2301],{},"required",[2292,2303,2304],{},"The elements that always appear",[2274,2306,2307,2311,2316],{},[2292,2308,2309],{},[413,2310,2296],{},[2292,2312,2313],{},[413,2314,2315],{},"optional",[2292,2317,2318],{},"The trailing elements that may be left out",[2274,2320,2321,2325,2330],{},[2292,2322,2323],{},[413,2324,2296],{},[2292,2326,2327],{},[413,2328,2329],{},"rest",[2292,2331,2332],{},"A single element type that repeats",[2274,2334,2335,2340,2345],{},[2292,2336,2337],{},[413,2338,2339],{},"RT.func",[2292,2341,2342],{},[413,2343,2344],{},"params",[2292,2346,2347],{},"The parameters",[2274,2349,2350,2354,2359],{},[2292,2351,2352],{},[413,2353,2339],{},[2292,2355,2356],{},[413,2357,2358],{},"ret",[2292,2360,2361],{},"The return type",[1114,2363,2364],{},"Use slots on every element or on none, as TypeScript requires for tuple labels. Without slots you get unlabeled tuples and unnamed parameters.",[405,2366,2368],{"id":2367},"recursive-shapes","Recursive Shapes",[409,2370,2371,2372,2375,2376,611],{},"A shape can contain itself, like a comment with replies. Wrap the body in ",[413,2373,2374],{},"RT.circular"," and point back at it with ",[413,2377,2378],{},"RT.self()",[430,2380,2382],{"className":432,"code":2381,"language":435,"meta":436,"style":436},"import * as TF from '@mionjs\u002Frun-types\u002Fformats';\nimport {createValidateFn, type InferType} from '@mionjs\u002Frun-types';\nimport * as RT from '@mionjs\u002Frun-types\u002Fbuilders';\n\nconst commentRunType = RT.circular(\n  RT.object({\n    text: TF.string(),\n    replies: RT.array(RT.self()), \u002F\u002F RT.self() stands for the whole shape\n  })\n);\ntype Comment = InferType\u003Ctypeof commentRunType>; \u002F\u002F {text: string; replies: Comment[]}\n\nconst isComment = createValidateFn(commentRunType);\n\n\u002F\u002F the same shape written as a type\ntype CommentType = {text: string; replies: CommentType[]};\nconst isCommentType = createValidateFn\u003CCommentType>(); \u002F\u002F same cached validator\n\nexport {commentRunType, isComment, isCommentType};\nexport type {Comment, CommentType};\n",[413,2383,2384,2404,2430,2450,2454,2472,2485,2502,2530,2537,2543,2564,2568,2584,2588,2593,2624,2648,2652,2673],{"__ignoreMap":436},[440,2385,2386,2388,2390,2392,2394,2396,2398,2400,2402],{"class":442,"line":443},[440,2387,824],{"class":823},[440,2389,827],{"class":461},[440,2391,830],{"class":823},[440,2393,833],{"class":507},[440,2395,836],{"class":823},[440,2397,521],{"class":461},[440,2399,841],{"class":524},[440,2401,528],{"class":461},[440,2403,481],{"class":461},[440,2405,2406,2408,2410,2412,2414,2416,2418,2420,2422,2424,2426,2428],{"class":442,"line":450},[440,2407,824],{"class":823},[440,2409,852],{"class":461},[440,2411,1157],{"class":507},[440,2413,716],{"class":461},[440,2415,1105],{"class":823},[440,2417,766],{"class":507},[440,2419,740],{"class":461},[440,2421,861],{"class":823},[440,2423,521],{"class":461},[440,2425,866],{"class":524},[440,2427,528],{"class":461},[440,2429,481],{"class":461},[440,2431,2432,2434,2436,2438,2440,2442,2444,2446,2448],{"class":442,"line":468},[440,2433,824],{"class":823},[440,2435,827],{"class":461},[440,2437,830],{"class":823},[440,2439,881],{"class":507},[440,2441,836],{"class":823},[440,2443,521],{"class":461},[440,2445,888],{"class":524},[440,2447,528],{"class":461},[440,2449,481],{"class":461},[440,2451,2452],{"class":442,"line":484},[440,2453,553],{"emptyLinePlaceholder":552},[440,2455,2456,2458,2461,2463,2465,2467,2470],{"class":442,"line":497},[440,2457,559],{"class":453},[440,2459,2460],{"class":507}," commentRunType ",[440,2462,565],{"class":461},[440,2464,608],{"class":507},[440,2466,611],{"class":461},[440,2468,2469],{"class":568},"circular",[440,2471,1297],{"class":507},[440,2473,2474,2477,2479,2481,2483],{"class":442,"line":513},[440,2475,2476],{"class":507},"  RT",[440,2478,611],{"class":461},[440,2480,614],{"class":568},[440,2482,617],{"class":507},[440,2484,620],{"class":461},[440,2486,2487,2490,2492,2494,2496,2498,2500],{"class":442,"line":543},[440,2488,2489],{"class":471},"    text",[440,2491,475],{"class":461},[440,2493,629],{"class":507},[440,2495,611],{"class":461},[440,2497,652],{"class":568},[440,2499,581],{"class":507},[440,2501,639],{"class":461},[440,2503,2504,2507,2509,2511,2513,2515,2518,2520,2523,2525,2527],{"class":442,"line":549},[440,2505,2506],{"class":471},"    replies",[440,2508,475],{"class":461},[440,2510,608],{"class":507},[440,2512,611],{"class":461},[440,2514,669],{"class":568},[440,2516,2517],{"class":507},"(RT",[440,2519,611],{"class":461},[440,2521,2522],{"class":568},"self",[440,2524,679],{"class":507},[440,2526,716],{"class":461},[440,2528,2529],{"class":446}," \u002F\u002F RT.self() stands for the whole shape\n",[440,2531,2532,2535],{"class":442,"line":556},[440,2533,2534],{"class":461},"  }",[440,2536,1427],{"class":507},[440,2538,2539,2541],{"class":442,"line":756},[440,2540,713],{"class":507},[440,2542,481],{"class":461},[440,2544,2545,2547,2550,2552,2554,2556,2559,2561],{"class":442,"line":778},[440,2546,454],{"class":453},[440,2548,2549],{"class":457}," Comment",[440,2551,462],{"class":461},[440,2553,766],{"class":457},[440,2555,769],{"class":461},[440,2557,2558],{"class":507}," commentRunType",[440,2560,1712],{"class":461},[440,2562,2563],{"class":446}," \u002F\u002F {text: string; replies: Comment[]}\n",[440,2565,2566],{"class":442,"line":783},[440,2567,553],{"emptyLinePlaceholder":552},[440,2569,2570,2572,2575,2577,2579,2582],{"class":442,"line":1003},[440,2571,559],{"class":453},[440,2573,2574],{"class":507}," isComment ",[440,2576,565],{"class":461},[440,2578,569],{"class":568},[440,2580,2581],{"class":507},"(commentRunType)",[440,2583,481],{"class":461},[440,2585,2586],{"class":442,"line":1009},[440,2587,553],{"emptyLinePlaceholder":552},[440,2589,2590],{"class":442,"line":1025},[440,2591,2592],{"class":446},"\u002F\u002F the same shape written as a type\n",[440,2594,2595,2597,2600,2602,2604,2607,2609,2611,2613,2616,2618,2620,2622],{"class":442,"line":1041},[440,2596,454],{"class":453},[440,2598,2599],{"class":457}," CommentType",[440,2601,462],{"class":461},[440,2603,852],{"class":461},[440,2605,2606],{"class":471},"text",[440,2608,475],{"class":461},[440,2610,492],{"class":457},[440,2612,1214],{"class":461},[440,2614,2615],{"class":471}," replies",[440,2617,475],{"class":461},[440,2619,2599],{"class":457},[440,2621,508],{"class":507},[440,2623,546],{"class":461},[440,2625,2626,2628,2631,2633,2635,2637,2640,2642,2644,2646],{"class":442,"line":1057},[440,2627,559],{"class":453},[440,2629,2630],{"class":507}," isCommentType ",[440,2632,565],{"class":461},[440,2634,569],{"class":568},[440,2636,572],{"class":461},[440,2638,2639],{"class":457},"CommentType",[440,2641,578],{"class":461},[440,2643,581],{"class":507},[440,2645,1214],{"class":461},[440,2647,1778],{"class":446},[440,2649,2650],{"class":442,"line":1073},[440,2651,553],{"emptyLinePlaceholder":552},[440,2653,2654,2656,2658,2661,2663,2666,2668,2671],{"class":442,"line":1078},[440,2655,1086],{"class":823},[440,2657,852],{"class":461},[440,2659,2660],{"class":507},"commentRunType",[440,2662,716],{"class":461},[440,2664,2665],{"class":507}," isComment",[440,2667,716],{"class":461},[440,2669,2670],{"class":507}," isCommentType",[440,2672,546],{"class":461},[440,2674,2675,2677,2679,2681,2684,2686,2688],{"class":442,"line":1083},[440,2676,1086],{"class":823},[440,2678,1105],{"class":823},[440,2680,852],{"class":461},[440,2682,2683],{"class":507},"Comment",[440,2685,716],{"class":461},[440,2687,2599],{"class":507},[440,2689,546],{"class":461},[2268,2691,2692,2702],{},[2271,2693,2694],{},[2274,2695,2696,2699],{},[2277,2697,2698],{},"Limit",[2277,2700,2701],{},"What happens",[2287,2703,2704,2717,2728],{},[2274,2705,2706,2711],{},[2292,2707,2708,2710],{},[413,2709,2378],{}," more than 24 levels deep in the body",[2292,2712,2713,2714,2716],{},"The inferred type keeps ",[413,2715,2378],{}," instead of your shape",[2274,2718,2719,2725],{},[2292,2720,2721,2722],{},"The shape points back straight from a tuple slot, like ",[413,2723,2724],{},"[number, Pair]",[2292,2726,2727],{},"Builders cannot write it. Put the loop behind an object, array, Map, Set or function, or write the shape as a type",[2274,2729,2730,2733],{},[2292,2731,2732],{},"A value nested deeper than the call stack",[2292,2734,2735,2736],{},"Validation throws ",[413,2737,2738],{},"RangeError",[1114,2740,2741,2742,2744],{},"For two shapes that point at each other, write ",[413,2743,2378],{}," for the shape itself and name the other one by its const.",[405,2746,2748],{"id":2747},"reusing-shared-fields-across-builders","Reusing Shared Fields Across Builders",[409,2750,2751],{},"Keep shared fields in one object and spread it into each builder that needs them. The spread is read at build time, so every run-type keeps its full, exact type.",[430,2753,2755],{"className":432,"code":2754,"language":435,"meta":436,"style":436},"import * as RT from '@mionjs\u002Frun-types\u002Fbuilders';\nimport * as TF from '@mionjs\u002Frun-types\u002Fformats';\n\nconst base = {id: TF.number(), createdAt: TF.number()};\n\nconst User = RT.object({...base, name: TF.string()});      \u002F\u002F {id, createdAt, name}\nconst Post = RT.object({...base, published: RT.boolean()}); \u002F\u002F {id, createdAt, published}\n",[413,2756,2757,2777,2797,2801,2841,2845,2892],{"__ignoreMap":436},[440,2758,2759,2761,2763,2765,2767,2769,2771,2773,2775],{"class":442,"line":443},[440,2760,824],{"class":823},[440,2762,827],{"class":461},[440,2764,830],{"class":823},[440,2766,881],{"class":507},[440,2768,836],{"class":823},[440,2770,521],{"class":461},[440,2772,888],{"class":524},[440,2774,528],{"class":461},[440,2776,481],{"class":461},[440,2778,2779,2781,2783,2785,2787,2789,2791,2793,2795],{"class":442,"line":450},[440,2780,824],{"class":823},[440,2782,827],{"class":461},[440,2784,830],{"class":823},[440,2786,833],{"class":507},[440,2788,836],{"class":823},[440,2790,521],{"class":461},[440,2792,841],{"class":524},[440,2794,528],{"class":461},[440,2796,481],{"class":461},[440,2798,2799],{"class":442,"line":468},[440,2800,553],{"emptyLinePlaceholder":552},[440,2802,2803,2805,2808,2810,2812,2814,2816,2818,2820,2822,2824,2826,2829,2831,2833,2835,2837,2839],{"class":442,"line":484},[440,2804,559],{"class":453},[440,2806,2807],{"class":507}," base ",[440,2809,565],{"class":461},[440,2811,852],{"class":461},[440,2813,1825],{"class":471},[440,2815,475],{"class":461},[440,2817,629],{"class":507},[440,2819,611],{"class":461},[440,2821,634],{"class":568},[440,2823,581],{"class":507},[440,2825,716],{"class":461},[440,2827,2828],{"class":471}," createdAt",[440,2830,475],{"class":461},[440,2832,629],{"class":507},[440,2834,611],{"class":461},[440,2836,634],{"class":568},[440,2838,581],{"class":507},[440,2840,546],{"class":461},[440,2842,2843],{"class":442,"line":497},[440,2844,553],{"emptyLinePlaceholder":552},[440,2846,2847,2849,2852,2854,2856,2858,2860,2862,2865,2868,2870,2873,2875,2877,2879,2881,2883,2885,2887,2889],{"class":442,"line":513},[440,2848,559],{"class":453},[440,2850,2851],{"class":507}," User ",[440,2853,565],{"class":461},[440,2855,608],{"class":507},[440,2857,611],{"class":461},[440,2859,614],{"class":568},[440,2861,617],{"class":507},[440,2863,2864],{"class":461},"{...",[440,2866,2867],{"class":507},"base",[440,2869,716],{"class":461},[440,2871,2872],{"class":471}," name",[440,2874,475],{"class":461},[440,2876,629],{"class":507},[440,2878,611],{"class":461},[440,2880,652],{"class":568},[440,2882,581],{"class":507},[440,2884,740],{"class":461},[440,2886,713],{"class":507},[440,2888,1214],{"class":461},[440,2890,2891],{"class":446},"      \u002F\u002F {id, createdAt, name}\n",[440,2893,2894,2896,2899,2901,2903,2905,2907,2909,2911,2913,2915,2918,2920,2922,2924,2926,2928,2930,2932,2934],{"class":442,"line":543},[440,2895,559],{"class":453},[440,2897,2898],{"class":507}," Post ",[440,2900,565],{"class":461},[440,2902,608],{"class":507},[440,2904,611],{"class":461},[440,2906,614],{"class":568},[440,2908,617],{"class":507},[440,2910,2864],{"class":461},[440,2912,2867],{"class":507},[440,2914,716],{"class":461},[440,2916,2917],{"class":471}," published",[440,2919,475],{"class":461},[440,2921,608],{"class":507},[440,2923,611],{"class":461},[440,2925,2171],{"class":568},[440,2927,581],{"class":507},[440,2929,740],{"class":461},[440,2931,713],{"class":507},[440,2933,1214],{"class":461},[440,2935,2936],{"class":446}," \u002F\u002F {id, createdAt, published}\n",[1114,2938,2939,2940,2942],{},"Spread a ",[413,2941,559],{},", written inline or imported from another module. Spreading a value made at runtime, like a function call's result, is reported as an error.",[405,2944,2946],{"id":2945},"reusing-option-presets","Reusing Option Presets",[409,2948,2949,2950,2952,2953,2956],{},"A ",[413,2951,1157],{}," or ",[413,2954,2955],{},"createJsonEncoderFn"," call can spread a preset of options and override keys inline. A key written after the spread wins.",[430,2958,2960],{"className":432,"code":2959,"language":435,"meta":436,"style":436},"import {createJsonEncoderFn} from '@mionjs\u002Frun-types';\n\nconst preset = {strategy: 'mutate'} as const;\n\nconst encodePost = createJsonEncoderFn\u003CPost>(undefined, {...preset});\n",[413,2961,2962,2982,2986,3018,3022],{"__ignoreMap":436},[440,2963,2964,2966,2968,2970,2972,2974,2976,2978,2980],{"class":442,"line":443},[440,2965,824],{"class":823},[440,2967,852],{"class":461},[440,2969,2955],{"class":507},[440,2971,740],{"class":461},[440,2973,861],{"class":823},[440,2975,521],{"class":461},[440,2977,866],{"class":524},[440,2979,528],{"class":461},[440,2981,481],{"class":461},[440,2983,2984],{"class":442,"line":450},[440,2985,553],{"emptyLinePlaceholder":552},[440,2987,2988,2990,2993,2995,2997,3000,3002,3004,3007,3009,3011,3013,3016],{"class":442,"line":468},[440,2989,559],{"class":453},[440,2991,2992],{"class":507}," preset ",[440,2994,565],{"class":461},[440,2996,852],{"class":461},[440,2998,2999],{"class":471},"strategy",[440,3001,475],{"class":461},[440,3003,521],{"class":461},[440,3005,3006],{"class":524},"mutate",[440,3008,528],{"class":461},[440,3010,740],{"class":461},[440,3012,830],{"class":823},[440,3014,3015],{"class":453}," const",[440,3017,481],{"class":461},[440,3019,3020],{"class":442,"line":484},[440,3021,553],{"emptyLinePlaceholder":552},[440,3023,3024,3026,3029,3031,3034,3036,3039,3041,3043,3046,3049,3052,3054,3056],{"class":442,"line":497},[440,3025,559],{"class":453},[440,3027,3028],{"class":507}," encodePost ",[440,3030,565],{"class":461},[440,3032,3033],{"class":568}," createJsonEncoderFn",[440,3035,572],{"class":461},[440,3037,3038],{"class":457},"Post",[440,3040,578],{"class":461},[440,3042,617],{"class":507},[440,3044,3045],{"class":461},"undefined,",[440,3047,3048],{"class":461}," {...",[440,3050,3051],{"class":507},"preset",[440,3053,740],{"class":461},[440,3055,713],{"class":507},[440,3057,481],{"class":461},[3059,3060,3061],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .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 .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}","Describe a shape as a TypeScript type or with builders; both compile to the same thing.","md",null,{"toc":24},{"title":192,"description":3062},"QFEw4hwKhpDyp5mZ5RmJvCOkhcjTTOB72lR7itmi7qI",1793324363741]