[{"data":1,"prerenderedAt":4003,"buildId":4004},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fast":3},{"id":4,"title":5,"body":6,"description":3985,"extension":3986,"frontmatter":3987,"heading":5,"meta":3994,"navigation":3996,"order":3990,"path":3997,"seo":3998,"sitemap":3999,"source":4000,"stem":4001,"__hash__":4002},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fast.md","AST and node builders",{"type":7,"value":8,"toc":3957},"minimark",[9,16,38,185,189,214,218,225,228,232,246,384,409,414,419,512,601,606,640,698,712,1067,1073,1098,1238,1244,1256,1300,1502,1514,1556,1561,1591,1744,1750,1764,1801,1875,1888,1894,1957,1968,2089,2095,2100,2156,2287,2293,2440,2580,2903,2913,2919,2922,2963,3015,3021,3049,3114,3118,3157,3181,3196,3200,3208,3299,3329,3410,3423,3510,3524,3642,3655,3663,3670,3674,3677,3693,3854,3858,3867],[10,11,13],"h2",{"id":12},"ast",[14,15,12],"code",{},[17,18,19,21,22,25,26,29,30,33,34,37],"p",{},[14,20,12],{}," from ",[14,23,24],{},"kubb\u002Fkit"," gives you the whole AST API in one namespace, like ",[14,27,28],{},"ts.factory"," for TypeScript. ",[14,31,32],{},"ast.factory"," builds nodes, and ",[14,35,36],{},"ast.node"," walks them. Each other group reads one subject, such as refs.",[39,40,45],"pre",{"language":41,"filename":42,"code":43,"class":44},"typescript","ast-namespace.ts","import { ast } from 'kubb\u002Fkit'\n\nconst root = ast.factory.createInput({\n schemas: [ast.factory.createSchema({ name: 'Pet', type: 'object', properties: [] })],\n operations: [],\n})","highlights",[14,46,48,75,76,75,78,75,106,75,166,75,180],{"class":47},"language-typescript",[49,50,53,57,61,65,68,71],"span",{"class":51,"style":52},"line","display: inline",[49,54,56],{"style":55},"color:#d73a49;--hls-dark:#f97583","import ",[49,58,60],{"style":59},"color:#005cc5;--hls-dark:#79b8ff","{ ",[49,62,64],{"style":63},"color:#24292e;--hls-dark:#e1e4e8","ast ",[49,66,67],{"style":59},"} ",[49,69,70],{"style":55},"from ",[49,72,74],{"style":73},"color:#032f62;--hls-dark:#9ecbff","'kubb\u002Fkit'","\n",[49,77],{"class":51,"style":52},[49,79,80,83,86,89,91,94,97,99,103],{"class":51,"style":52},[49,81,82],{"style":55},"const ",[49,84,85],{"style":63},"root ",[49,87,88],{"style":55},"= ",[49,90,12],{"style":63},[49,92,93],{"style":55},".",[49,95,96],{"style":59},"factory",[49,98,93],{"style":55},[49,100,102],{"style":101},"color:#6f42c1;--hls-dark:#b392f0","createInput",[49,104,105],{"style":59},"({",[49,107,108,111,114,117,120,122,124,126,128,131,134,137,139,142,145,148,150,153,155,158,160,163],{"class":51,"style":52},[49,109,110],{"style":59}," ",[49,112,113],{"style":59},"schemas",[49,115,116],{"style":55},": ",[49,118,119],{"style":59},"[",[49,121,12],{"style":63},[49,123,93],{"style":55},[49,125,96],{"style":59},[49,127,93],{"style":55},[49,129,130],{"style":101},"createSchema",[49,132,133],{"style":59},"({ ",[49,135,136],{"style":59},"name",[49,138,116],{"style":55},[49,140,141],{"style":73},"'Pet'",[49,143,144],{"style":55},", ",[49,146,147],{"style":59},"type",[49,149,116],{"style":55},[49,151,152],{"style":73},"'object'",[49,154,144],{"style":55},[49,156,157],{"style":59},"properties",[49,159,116],{"style":55},[49,161,162],{"style":59},"[] })]",[49,164,165],{"style":55},",",[49,167,168,170,173,175,178],{"class":51,"style":52},[49,169,110],{"style":55},[49,171,172],{"style":59},"operations",[49,174,116],{"style":55},[49,176,177],{"style":59},"[]",[49,179,165],{"style":55},[49,181,182],{"class":51,"style":52},[49,183,184],{"style":59},"})",[10,186,188],{"id":187},"node-tree","Node tree",[17,190,191,192,195,196,199,200,203,204,206,207,210,211,213],{},"An adapter returns one ",[14,193,194],{},"InputNode",". Every node has a ",[14,197,198],{},"kind",", such as ",[14,201,202],{},"'Schema'",". A schema also has a ",[14,205,147],{},". A ",[14,208,209],{},"ref"," schema points at a schema in ",[14,212,113],{}," instead of copying it.",[215,216],"mermaid",{"svg":217},"\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" class=\"pele pele-flowchart\" viewBox=\"0 0 843 484\" width=\"843\" height=\"484\" style=\"--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,monospace);font:16px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,sans-serif)\" fill=\"var(--_fg)\" role=\"graphics-document document\" aria-roledescription=\"flowchart\">\u003Cg class=\"pele-edges\" fill=\"none\" stroke=\"var(--_l)\" stroke-linecap=\"round\">\u003Cg class=\"pele-edge\" data-id=\"L_input_schemas_0\">\u003Cpath d=\"M538.6,56C538.6,74.49 119.82,81.51 119.82,100L119.82,106\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M119.82,113L116.46,105L123.18,105Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_input_operations_0\">\u003Cpath d=\"M554.6,56L554.6,97\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M554.6,104L551.24,96L557.96,96Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_input_meta_0\">\u003Cpath d=\"M570.6,56C570.6,78 747.1,78 747.1,100L747.1,106\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M747.1,113L743.74,105L750.46,105Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_operations_parameters_0\">\u003Cpath d=\"M529.9,170C529.9,187.5 350.54,187.5 350.54,205L350.54,211\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M350.54,218L347.18,210L353.9,210Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_operations_requestBody_0\">\u003Cpath d=\"M554.6,170L554.6,211\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M554.6,218L551.24,210L557.96,210Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_operations_responses_0\">\u003Cpath d=\"M579.3,170C579.3,187.5 757.33,187.5 757.33,205L757.33,211\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M757.33,218L753.97,210L760.69,210Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_requestBody_content_0\">\u003Cpath d=\"M554.6,284L554.6,325\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M554.6,332L551.24,324L557.96,324Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_responses_content_0\">\u003Cpath d=\"M757.33,284C757.33,301.5 624.22,301.5 624.22,319L624.22,325\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M624.22,332L620.86,324L627.58,324Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_schemas_properties_0\">\u003Cpath d=\"M119.82,161L119.82,220\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M119.82,227L116.46,219L123.18,219Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_parameters_schema_0\">\u003Cpath d=\"M350.54,284L350.54,380C350.54,397.5 325.99,397.5 325.99,415L325.99,421\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M325.99,428L322.63,420L329.35,420Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_properties_schema_0\">\u003Cpath d=\"M119.82,275L119.82,380C119.82,397.5 223.6,397.5 223.6,415L223.6,421\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M223.6,428L220.24,420L226.96,420Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_content_schema_0\">\u003Cpath d=\"M575.94,380C575.94,397.5 341.99,397.5 341.99,415L341.99,421\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M341.99,428L338.63,420L345.35,420Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg class=\"pele-nodes\">\u003Cg class=\"pele-node pele-shape-rect core\" data-id=\"input\" transform=\"translate(554.6,32)\">\u003Crect x=\"-54.91\" y=\"-24\" width=\"109.82\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">InputNode\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"schemas\" transform=\"translate(119.82,137)\">\u003Crect x=\"-107.37\" y=\"-24\" width=\"214.74\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">schemas: SchemaNode[]\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"operations\" transform=\"translate(554.6,137)\">\u003Crect x=\"-76.7\" y=\"-33\" width=\"153.39\" height=\"66\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" text-anchor=\"middle\" xml:space=\"preserve\">\u003Ctspan x=\"0\" y=\"-4.9\">operations:\u003C\u002Ftspan>\u003Ctspan x=\"0\" y=\"16.1\">OperationNode[]\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"meta\" transform=\"translate(747.1,137)\">\u003Crect x=\"-75.81\" y=\"-24\" width=\"151.62\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">meta: InputMeta\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"parameters\" transform=\"translate(350.54,251)\">\u003Crect x=\"-78.91\" y=\"-33\" width=\"157.82\" height=\"66\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" text-anchor=\"middle\" xml:space=\"preserve\">\u003Ctspan x=\"0\" y=\"-4.9\">parameters:\u003C\u002Ftspan>\u003Ctspan x=\"0\" y=\"16.1\">ParameterNode[]\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"requestBody\" transform=\"translate(554.6,251)\">\u003Crect x=\"-85.14\" y=\"-33\" width=\"170.29\" height=\"66\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" text-anchor=\"middle\" xml:space=\"preserve\">\u003Ctspan x=\"0\" y=\"-4.9\">requestBody:\u003C\u002Ftspan>\u003Ctspan x=\"0\" y=\"16.1\">RequestBodyNode\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"responses\" transform=\"translate(757.33,251)\">\u003Crect x=\"-77.58\" y=\"-33\" width=\"155.17\" height=\"66\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" text-anchor=\"middle\" xml:space=\"preserve\">\u003Ctspan x=\"0\" y=\"-4.9\">responses:\u003C\u002Ftspan>\u003Ctspan x=\"0\" y=\"16.1\">ResponseNode[]\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"content\" transform=\"translate(575.94,356)\">\u003Crect x=\"-100.27\" y=\"-24\" width=\"200.54\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">content: ContentNode[]\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"properties\" transform=\"translate(119.82,251)\">\u003Crect x=\"-111.82\" y=\"-24\" width=\"223.63\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">properties: PropertyNode[]\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"schema\" transform=\"translate(270.52,452)\">\u003Crect x=\"-98.92\" y=\"-24\" width=\"197.84\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">schema: SchemaNode\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003C\u002Fsvg>",[17,219,220,221,224],{},"A template returns ",[14,222,223],{},"FileNode","s, a second tree:",[215,226],{"svg":227},"\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" class=\"pele pele-flowchart\" viewBox=\"0 0 630 260\" width=\"630\" height=\"260\" style=\"--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,monospace);font:16px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,sans-serif)\" fill=\"var(--_fg)\" role=\"graphics-document document\" aria-roledescription=\"flowchart\">\u003Cg class=\"pele-edges\" fill=\"none\" stroke=\"var(--_l)\" stroke-linecap=\"round\">\u003Cg class=\"pele-edge\" data-id=\"L_file_sources_0\">\u003Cpath d=\"M108.02,127.5C125.52,127.5 125.52,51.5 143.02,51.5L149.02,51.5\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M156.02,51.5L148.02,54.86L148.02,48.14Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_file_imports_0\">\u003Cpath d=\"M108.02,139.5L153.47,139.5\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M160.47,139.5L152.47,142.86L152.47,136.14Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_file_exports_0\">\u003Cpath d=\"M108.02,151.5C127.52,151.5 127.52,227.5 147.02,227.5L153.02,227.5\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M160.02,227.5L152.02,230.86L152.02,224.14Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_sources_nodes_0\">\u003Cpath d=\"M354.75,51.5L395.75,51.5\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M402.75,51.5L394.75,54.86L394.75,48.14Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg class=\"pele-nodes\">\u003Cg class=\"pele-node pele-shape-rect core\" data-id=\"file\" transform=\"translate(58.01,139.5)\">\u003Crect x=\"-50.01\" y=\"-24\" width=\"100.02\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">FileNode\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"sources\" transform=\"translate(255.38,51.5)\">\u003Crect x=\"-99.37\" y=\"-24\" width=\"198.74\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">sources: SourceNode[]\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"imports\" transform=\"translate(255.38,139.5)\">\u003Crect x=\"-94.91\" y=\"-24\" width=\"189.82\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">imports: ImportNode[]\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"exports\" transform=\"translate(255.38,227.5)\">\u003Crect x=\"-95.37\" y=\"-24\" width=\"190.74\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">exports: ExportNode[]\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"nodes\" transform=\"translate(512.35,51.5)\">\u003Crect x=\"-109.6\" y=\"-43.5\" width=\"219.2\" height=\"87\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" text-anchor=\"middle\" xml:space=\"preserve\">\u003Ctspan x=\"0\" y=\"-15.4\">nodes: Text, Const, Type,\u003C\u002Ftspan>\u003Ctspan x=\"0\" y=\"5.6\">Function, ArrowFunction,\u003C\u002Ftspan>\u003Ctspan x=\"0\" y=\"26.6\">Jsx, Break\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003C\u002Fsvg>",[10,229,231],{"id":230},"schema-node-types","Schema node types",[17,233,234,235,238,239,241,242,245],{},"You narrow a ",[14,236,237],{},"SchemaNode"," by its ",[14,240,147],{},". ",[14,243,244],{},"ast.schema.types"," lists every value.",[247,248,249,265],"table",{},[250,251,252],"thead",{},[253,254,255,259,262],"tr",{},[256,257,258],"th",{},"Family",[256,260,261],{},"Types",[256,263,264],{},"Notes",[266,267,268,299,343],"tbody",{},[253,269,270,274,297],{},[271,272,273],"td",{},"Structural",[271,275,276,144,279,144,282,144,285,144,288,144,291,144,294],{},[14,277,278],{},"object",[14,280,281],{},"array",[14,283,284],{},"tuple",[14,286,287],{},"union",[14,289,290],{},"intersection",[14,292,293],{},"enum",[14,295,296],{},"not",[271,298],{},[253,300,301,304,336],{},[271,302,303],{},"Scalar",[271,305,306,144,309,144,312,144,315,144,318,144,321,144,324,144,327,144,330,144,333],{},[14,307,308],{},"string",[14,310,311],{},"number",[14,313,314],{},"integer",[14,316,317],{},"bigint",[14,319,320],{},"boolean",[14,322,323],{},"null",[14,325,326],{},"any",[14,328,329],{},"unknown",[14,331,332],{},"void",[14,334,335],{},"never",[271,337,338,340,341,93],{},[14,339,314],{}," prints as ",[14,342,311],{},[253,344,345,348,379],{},[271,346,347],{},"Special",[271,349,350,144,352,144,355,144,358,144,361,144,364,144,367,144,370,144,373,144,376],{},[14,351,209],{},[14,353,354],{},"date",[14,356,357],{},"datetime",[14,359,360],{},"time",[14,362,363],{},"uuid",[14,365,366],{},"email",[14,368,369],{},"url",[14,371,372],{},"ipv4",[14,374,375],{},"ipv6",[14,377,378],{},"blob",[271,380,381,383],{},[14,382,378],{}," is binary data",[17,385,386,387,390,391,394,395,397,398,401,402,405,406,93],{},"Schema, parameter, request body, response and content nodes keep the source object's vendor extensions (",[14,388,389],{},"x-*"," keys) in ",[14,392,393],{},"extensions",", as input and operation nodes do. A ",[14,396,378],{}," node keeps ",[14,399,400],{},"contentMediaType"," and ",[14,403,404],{},"contentEncoding"," in ",[14,407,408],{},"content",[10,410,412],{"id":411},"factory-functions",[14,413,32],{},[17,415,416,418],{},[14,417,32],{}," builds typed nodes with the defaults filled in. Use it instead of object literals.",[247,420,421,431],{},[250,422,423],{},[253,424,425,428],{},[256,426,427],{},"Tree",[256,429,430],{},"Factories",[266,432,433,465,484],{},[253,434,435,438],{},[271,436,437],{},"Input",[271,439,440,144,442,144,444,144,447,144,450,144,453,144,456,144,459,144,462],{},[14,441,102],{},[14,443,130],{},[14,445,446],{},"createOperation",[14,448,449],{},"createOperations",[14,451,452],{},"createParameter",[14,454,455],{},"createProperty",[14,457,458],{},"createResponse",[14,460,461],{},"createRequestBody",[14,463,464],{},"createContent",[253,466,467,470],{},[271,468,469],{},"File",[271,471,472,144,475,144,478,144,481],{},[14,473,474],{},"createFile",[14,476,477],{},"createSource",[14,479,480],{},"createImport",[14,482,483],{},"createExport",[253,485,486,489],{},[271,487,488],{},"Code nodes",[271,490,491,144,494,144,497,144,500,144,503,144,506,144,509],{},[14,492,493],{},"createText",[14,495,496],{},"createConst",[14,498,499],{},"createType",[14,501,502],{},"createFunction",[14,504,505],{},"createArrowFunction",[14,507,508],{},"createJsx",[14,510,511],{},"createBreak",[39,513,516],{"language":41,"filename":514,"code":515,"class":44},"factory.ts","import { ast } from 'kubb\u002Fkit'\n\nast.factory.createSchema({ type: 'string', format: 'email' })\n\u002F\u002F { kind: 'Schema', type: 'string', primitive: 'string', format: 'email' }\n\nast.factory.createText('export const a = 1')\n\u002F\u002F { kind: 'Text', value: 'export const a = 1' }",[14,517,518,75,532,75,534,75,567,75,573,75,575,75,596],{"class":47},[49,519,520,522,524,526,528,530],{"class":51,"style":52},[49,521,56],{"style":55},[49,523,60],{"style":59},[49,525,64],{"style":63},[49,527,67],{"style":59},[49,529,70],{"style":55},[49,531,74],{"style":73},[49,533],{"class":51,"style":52},[49,535,536,538,540,542,544,546,548,550,552,555,557,560,562,565],{"class":51,"style":52},[49,537,12],{"style":63},[49,539,93],{"style":55},[49,541,96],{"style":59},[49,543,93],{"style":55},[49,545,130],{"style":101},[49,547,133],{"style":59},[49,549,147],{"style":59},[49,551,116],{"style":55},[49,553,554],{"style":73},"'string'",[49,556,144],{"style":55},[49,558,559],{"style":59},"format",[49,561,116],{"style":55},[49,563,564],{"style":73},"'email' ",[49,566,184],{"style":59},[49,568,569],{"class":51,"style":52},[49,570,572],{"style":571},"color:#6a737d;--hls-dark:#6a737d","\u002F\u002F { kind: 'Schema', type: 'string', primitive: 'string', format: 'email' }",[49,574],{"class":51,"style":52},[49,576,577,579,581,583,585,587,590,593],{"class":51,"style":52},[49,578,12],{"style":63},[49,580,93],{"style":55},[49,582,96],{"style":59},[49,584,93],{"style":55},[49,586,493],{"style":101},[49,588,589],{"style":59},"(",[49,591,592],{"style":73},"'export const a = 1'",[49,594,595],{"style":59},")",[49,597,598],{"class":51,"style":52},[49,599,600],{"style":571},"\u002F\u002F { kind: 'Text', value: 'export const a = 1' }",[10,602,604],{"id":603},"visitors",[14,605,36],{},[17,607,608,610,611,144,614,144,617,144,620,144,623,626,627,630,631,636,637,93],{},[14,609,36],{}," walks a tree with a visitor, which has a callback per kind: ",[14,612,613],{},"input",[14,615,616],{},"operation",[14,618,619],{},"schema",[14,621,622],{},"property",[14,624,625],{},"parameter",", and ",[14,628,629],{},"response",". In a plugin, use a ",[632,633,635],"a",{"href":634},"#macros","macro"," instead of ",[14,638,639],{},"transform",[247,641,642,652],{},[250,643,644],{},[253,645,646,649],{},[256,647,648],{},"Helper",[256,650,651],{},"Returns",[266,653,654,664,674,688],{},[253,655,656,661],{},[271,657,658],{},[14,659,660],{},"ast.node.transform",[271,662,663],{},"A new tree with the visitor's replacements",[253,665,666,671],{},[271,667,668],{},[14,669,670],{},"ast.node.collect",[271,672,673],{},"The visitor's non-null results, depth-first",[253,675,676,681],{},[271,677,678],{},[14,679,680],{},"ast.node.kinds",[271,682,683,684,199,686],{},"Every node ",[14,685,198],{},[14,687,202],{},[253,689,690,695],{},[271,691,692],{},[14,693,694],{},"ast.node.getText",[271,696,697],{},"Code node text, joined by newlines",[17,699,700,701,704,705,707,708,711],{},"Pass ",[14,702,703],{},"depth: 'shallow'"," to ",[14,706,639],{}," or ",[14,709,710],{},"collect"," to skip nested schemas.",[39,713,716],{"language":41,"filename":714,"code":715,"class":44},"node.ts","import { ast } from 'kubb\u002Fkit'\n\nconst root = ast.factory.createInput({ schemas: [], operations: [] })\n\nconst strict = ast.node.transform(root, {\n schema(node) {\n return node.type === 'object' && node.additionalProperties === undefined ? { ...node, additionalProperties: false } : node\n },\n})\n\nconst mutations = ast.node.collect\u003Cast.OperationNode>(root, {\n operation(node) {\n return node.method === 'POST' ? node : undefined\n },\n})\n\u002F\u002F Array\u003COperationNode>\n\nast.node.kinds.schema \u002F\u002F 'Schema'\nast.node.getText([ast.factory.createText('const a = 1'), ast.factory.createText('const b = 2')]) \u002F\u002F 'const a = 1\\nconst b = 2'",[14,717,718,75,732,75,734,75,769,75,771,75,801,75,814,75,876,75,885,75,889,75,891,75,931,75,943,75,971,75,979,75,983,75,988,75,990,75,1011],{"class":47},[49,719,720,722,724,726,728,730],{"class":51,"style":52},[49,721,56],{"style":55},[49,723,60],{"style":59},[49,725,64],{"style":63},[49,727,67],{"style":59},[49,729,70],{"style":55},[49,731,74],{"style":73},[49,733],{"class":51,"style":52},[49,735,736,738,740,742,744,746,748,750,752,754,756,758,760,762,764,766],{"class":51,"style":52},[49,737,82],{"style":55},[49,739,85],{"style":63},[49,741,88],{"style":55},[49,743,12],{"style":63},[49,745,93],{"style":55},[49,747,96],{"style":59},[49,749,93],{"style":55},[49,751,102],{"style":101},[49,753,133],{"style":59},[49,755,113],{"style":59},[49,757,116],{"style":55},[49,759,177],{"style":59},[49,761,144],{"style":55},[49,763,172],{"style":59},[49,765,116],{"style":55},[49,767,768],{"style":59},"[] })",[49,770],{"class":51,"style":52},[49,772,773,775,778,780,782,784,787,789,791,793,796,798],{"class":51,"style":52},[49,774,82],{"style":55},[49,776,777],{"style":63},"strict ",[49,779,88],{"style":55},[49,781,12],{"style":63},[49,783,93],{"style":55},[49,785,786],{"style":59},"node",[49,788,93],{"style":55},[49,790,639],{"style":101},[49,792,589],{"style":59},[49,794,795],{"style":63},"root",[49,797,144],{"style":55},[49,799,800],{"style":59},"{",[49,802,803,805,807,809,811],{"class":51,"style":52},[49,804,110],{"style":59},[49,806,619],{"style":101},[49,808,589],{"style":59},[49,810,786],{"style":63},[49,812,813],{"style":59},") {",[49,815,816,819,822,824,826,829,832,835,838,840,842,845,847,850,853,855,858,860,862,865,867,870,872,874],{"class":51,"style":52},[49,817,818],{"style":59}," ",[49,820,821],{"style":55},"return ",[49,823,786],{"style":63},[49,825,93],{"style":55},[49,827,828],{"style":59},"type ",[49,830,831],{"style":55},"=== ",[49,833,834],{"style":73},"'object' ",[49,836,837],{"style":55},"&& ",[49,839,786],{"style":63},[49,841,93],{"style":55},[49,843,844],{"style":59},"additionalProperties ",[49,846,831],{"style":55},[49,848,849],{"style":59},"undefined ",[49,851,852],{"style":55},"? ",[49,854,60],{"style":59},[49,856,857],{"style":55},"...",[49,859,786],{"style":63},[49,861,144],{"style":55},[49,863,864],{"style":59},"additionalProperties",[49,866,116],{"style":55},[49,868,869],{"style":59},"false ",[49,871,67],{"style":59},[49,873,116],{"style":55},[49,875,786],{"style":63},[49,877,878,880,883],{"class":51,"style":52},[49,879,110],{"style":63},[49,881,882],{"style":59},"}",[49,884,165],{"style":55},[49,886,887],{"class":51,"style":52},[49,888,184],{"style":59},[49,890],{"class":51,"style":52},[49,892,893,895,898,900,902,904,906,908,910,913,915,917,920,923,925,927,929],{"class":51,"style":52},[49,894,82],{"style":55},[49,896,897],{"style":63},"mutations ",[49,899,88],{"style":55},[49,901,12],{"style":63},[49,903,93],{"style":55},[49,905,786],{"style":59},[49,907,93],{"style":55},[49,909,710],{"style":59},[49,911,912],{"style":55},"\u003C",[49,914,12],{"style":63},[49,916,93],{"style":55},[49,918,919],{"style":59},"OperationNode",[49,921,922],{"style":55},">",[49,924,589],{"style":59},[49,926,795],{"style":63},[49,928,144],{"style":55},[49,930,800],{"style":59},[49,932,933,935,937,939,941],{"class":51,"style":52},[49,934,110],{"style":59},[49,936,616],{"style":101},[49,938,589],{"style":59},[49,940,786],{"style":63},[49,942,813],{"style":59},[49,944,945,947,949,951,953,956,958,961,963,966,968],{"class":51,"style":52},[49,946,818],{"style":59},[49,948,821],{"style":55},[49,950,786],{"style":63},[49,952,93],{"style":55},[49,954,955],{"style":59},"method ",[49,957,831],{"style":55},[49,959,960],{"style":73},"'POST' ",[49,962,852],{"style":55},[49,964,965],{"style":63},"node ",[49,967,116],{"style":55},[49,969,970],{"style":59},"undefined",[49,972,973,975,977],{"class":51,"style":52},[49,974,110],{"style":59},[49,976,882],{"style":59},[49,978,165],{"style":55},[49,980,981],{"class":51,"style":52},[49,982,184],{"style":59},[49,984,985],{"class":51,"style":52},[49,986,987],{"style":571},"\u002F\u002F Array\u003COperationNode>",[49,989],{"class":51,"style":52},[49,991,992,994,996,998,1000,1003,1005,1008],{"class":51,"style":52},[49,993,12],{"style":63},[49,995,93],{"style":55},[49,997,786],{"style":59},[49,999,93],{"style":55},[49,1001,1002],{"style":59},"kinds",[49,1004,93],{"style":55},[49,1006,1007],{"style":59},"schema ",[49,1009,1010],{"style":571},"\u002F\u002F 'Schema'",[49,1012,1013,1015,1017,1019,1021,1024,1027,1029,1031,1033,1035,1037,1039,1042,1044,1046,1048,1050,1052,1054,1056,1058,1061,1064],{"class":51,"style":52},[49,1014,12],{"style":63},[49,1016,93],{"style":55},[49,1018,786],{"style":59},[49,1020,93],{"style":55},[49,1022,1023],{"style":101},"getText",[49,1025,1026],{"style":59},"([",[49,1028,12],{"style":63},[49,1030,93],{"style":55},[49,1032,96],{"style":59},[49,1034,93],{"style":55},[49,1036,493],{"style":101},[49,1038,589],{"style":59},[49,1040,1041],{"style":73},"'const a = 1'",[49,1043,595],{"style":59},[49,1045,144],{"style":55},[49,1047,12],{"style":63},[49,1049,93],{"style":55},[49,1051,96],{"style":59},[49,1053,93],{"style":55},[49,1055,493],{"style":101},[49,1057,589],{"style":59},[49,1059,1060],{"style":73},"'const b = 2'",[49,1062,1063],{"style":59},")]) ",[49,1065,1066],{"style":571},"\u002F\u002F 'const a = 1\\nconst b = 2'",[10,1068,1070],{"id":1069},"ast-file",[14,1071,1072],{},"ast.file",[247,1074,1075,1083],{},[250,1076,1077],{},[253,1078,1079,1081],{},[256,1080,648],{},[256,1082,651],{},[266,1084,1085],{},[253,1086,1087,1092],{},[271,1088,1089],{},[14,1090,1091],{},"ast.file.inline",[271,1093,1094,1097],{},[14,1095,1096],{},"{ files, virtualPaths, problems }",", with virtual-file imports inlined",[39,1099,1102],{"language":41,"filename":1100,"code":1101,"class":44},"file.ts","import { ast } from 'kubb\u002Fkit'\n\n\u002F\u002F Array\u003CFileNode>, Array\u003Cstring>, Array\u003C{ path: string, message: string }>\nconst {\n files: inlined,\n virtualPaths,\n problems,\n} = ast.file.inline(files, {\n language: (file) => parsers.get(file.extname)?.inline,\n})",[14,1103,1104,75,1118,75,1120,75,1125,75,1131,75,1145,75,1154,75,1163,75,1189,75,1234],{"class":47},[49,1105,1106,1108,1110,1112,1114,1116],{"class":51,"style":52},[49,1107,56],{"style":55},[49,1109,60],{"style":59},[49,1111,64],{"style":63},[49,1113,67],{"style":59},[49,1115,70],{"style":55},[49,1117,74],{"style":73},[49,1119],{"class":51,"style":52},[49,1121,1122],{"class":51,"style":52},[49,1123,1124],{"style":571},"\u002F\u002F Array\u003CFileNode>, Array\u003Cstring>, Array\u003C{ path: string, message: string }>",[49,1126,1127,1129],{"class":51,"style":52},[49,1128,82],{"style":55},[49,1130,800],{"style":59},[49,1132,1133,1135,1138,1140,1143],{"class":51,"style":52},[49,1134,110],{"style":59},[49,1136,1137],{"style":59},"files",[49,1139,116],{"style":55},[49,1141,1142],{"style":63},"inlined",[49,1144,165],{"style":55},[49,1146,1147,1149,1152],{"class":51,"style":52},[49,1148,110],{"style":55},[49,1150,1151],{"style":63},"virtualPaths",[49,1153,165],{"style":55},[49,1155,1156,1158,1161],{"class":51,"style":52},[49,1157,110],{"style":55},[49,1159,1160],{"style":63},"problems",[49,1162,165],{"style":55},[49,1164,1165,1167,1169,1171,1173,1176,1178,1181,1183,1185,1187],{"class":51,"style":52},[49,1166,67],{"style":59},[49,1168,88],{"style":55},[49,1170,12],{"style":63},[49,1172,93],{"style":55},[49,1174,1175],{"style":59},"file",[49,1177,93],{"style":55},[49,1179,1180],{"style":101},"inline",[49,1182,589],{"style":59},[49,1184,1137],{"style":63},[49,1186,144],{"style":55},[49,1188,800],{"style":59},[49,1190,1191,1193,1196,1198,1200,1202,1205,1208,1211,1213,1216,1218,1220,1222,1225,1227,1230,1232],{"class":51,"style":52},[49,1192,110],{"style":59},[49,1194,1195],{"style":59},"language",[49,1197,116],{"style":55},[49,1199,589],{"style":59},[49,1201,1175],{"style":63},[49,1203,1204],{"style":59},") ",[49,1206,1207],{"style":55},"=> ",[49,1209,1210],{"style":63},"parsers",[49,1212,93],{"style":55},[49,1214,1215],{"style":101},"get",[49,1217,589],{"style":59},[49,1219,1175],{"style":63},[49,1221,93],{"style":55},[49,1223,1224],{"style":59},"extname",[49,1226,595],{"style":59},[49,1228,1229],{"style":55},"?.",[49,1231,1180],{"style":59},[49,1233,165],{"style":55},[49,1235,1236],{"class":51,"style":52},[49,1237,184],{"style":59},[10,1239,1241],{"id":1240},"macros",[14,1242,1243],{},"ast.macro",[17,1245,1246,1247,1250,1251,1255],{},"A macro is a named transform that rewrites nodes before printing. Define one with ",[14,1248,1249],{},"defineMacro",", as ",[632,1252,1254],{"href":1253},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize#macros","Macros"," shows.",[247,1257,1258,1266],{},[250,1259,1260],{},[253,1261,1262,1264],{},[256,1263,648],{},[256,1265,651],{},[266,1267,1268,1278],{},[253,1269,1270,1275],{},[271,1271,1272],{},[14,1273,1274],{},"ast.macro.apply",[271,1276,1277],{},"The tree after running the macros",[253,1279,1280,1285],{},[271,1281,1282],{},[14,1283,1284],{},"ast.macro.compareOrder",[271,1286,1287,1288,1291,1292,1295,1296,1299],{},"Sorts ",[14,1289,1290],{},"enforce"," values: ",[14,1293,1294],{},"'pre'"," first, ",[14,1297,1298],{},"'post'"," last",[39,1301,1304],{"language":41,"filename":1302,"code":1303,"class":44},"macro.ts","import { ast, defineMacro } from 'kubb\u002Fkit'\n\nconst macroUntagged = defineMacro({\n name: 'untagged',\n operation: (node) => (node.tags?.length ? undefined : { ...node, tags: ['untagged'] }),\n})\n\nast.macro.apply(operation, [macroUntagged]).tags \u002F\u002F ['untagged']\nast.macro.compareOrder('pre', 'post') \u002F\u002F -2\nast.macro.compareOrder(undefined, 'post') \u002F\u002F -1",[14,1305,1306,75,1325,75,1327,75,1340,75,1353,75,1410,75,1414,75,1416,75,1451,75,1477],{"class":47},[49,1307,1308,1310,1312,1314,1316,1319,1321,1323],{"class":51,"style":52},[49,1309,56],{"style":55},[49,1311,60],{"style":59},[49,1313,12],{"style":63},[49,1315,144],{"style":55},[49,1317,1318],{"style":63},"defineMacro ",[49,1320,67],{"style":59},[49,1322,70],{"style":55},[49,1324,74],{"style":73},[49,1326],{"class":51,"style":52},[49,1328,1329,1331,1334,1336,1338],{"class":51,"style":52},[49,1330,82],{"style":55},[49,1332,1333],{"style":63},"macroUntagged ",[49,1335,88],{"style":55},[49,1337,1249],{"style":101},[49,1339,105],{"style":59},[49,1341,1342,1344,1346,1348,1351],{"class":51,"style":52},[49,1343,110],{"style":59},[49,1345,136],{"style":59},[49,1347,116],{"style":55},[49,1349,1350],{"style":73},"'untagged'",[49,1352,165],{"style":55},[49,1354,1355,1357,1359,1361,1363,1365,1367,1369,1371,1373,1375,1378,1380,1383,1385,1387,1389,1391,1393,1395,1397,1399,1401,1403,1405,1408],{"class":51,"style":52},[49,1356,110],{"style":55},[49,1358,616],{"style":59},[49,1360,116],{"style":55},[49,1362,589],{"style":59},[49,1364,786],{"style":63},[49,1366,1204],{"style":59},[49,1368,1207],{"style":55},[49,1370,589],{"style":59},[49,1372,786],{"style":63},[49,1374,93],{"style":55},[49,1376,1377],{"style":59},"tags",[49,1379,1229],{"style":55},[49,1381,1382],{"style":59},"length ",[49,1384,852],{"style":55},[49,1386,849],{"style":59},[49,1388,116],{"style":55},[49,1390,60],{"style":59},[49,1392,857],{"style":55},[49,1394,786],{"style":63},[49,1396,144],{"style":55},[49,1398,1377],{"style":59},[49,1400,116],{"style":55},[49,1402,119],{"style":59},[49,1404,1350],{"style":73},[49,1406,1407],{"style":59},"] })",[49,1409,165],{"style":55},[49,1411,1412],{"class":51,"style":52},[49,1413,184],{"style":59},[49,1415],{"class":51,"style":52},[49,1417,1418,1420,1422,1424,1426,1429,1431,1433,1435,1437,1440,1443,1445,1448],{"class":51,"style":52},[49,1419,12],{"style":63},[49,1421,93],{"style":55},[49,1423,635],{"style":59},[49,1425,93],{"style":55},[49,1427,1428],{"style":101},"apply",[49,1430,589],{"style":59},[49,1432,616],{"style":63},[49,1434,144],{"style":55},[49,1436,119],{"style":59},[49,1438,1439],{"style":63},"macroUntagged",[49,1441,1442],{"style":59},"])",[49,1444,93],{"style":55},[49,1446,1447],{"style":59},"tags ",[49,1449,1450],{"style":571},"\u002F\u002F ['untagged']",[49,1452,1453,1455,1457,1459,1461,1464,1466,1468,1470,1472,1474],{"class":51,"style":52},[49,1454,12],{"style":63},[49,1456,93],{"style":55},[49,1458,635],{"style":59},[49,1460,93],{"style":55},[49,1462,1463],{"style":101},"compareOrder",[49,1465,589],{"style":59},[49,1467,1294],{"style":73},[49,1469,144],{"style":55},[49,1471,1298],{"style":73},[49,1473,1204],{"style":59},[49,1475,1476],{"style":571},"\u002F\u002F -2",[49,1478,1479,1481,1483,1485,1487,1489,1491,1493,1495,1497,1499],{"class":51,"style":52},[49,1480,12],{"style":63},[49,1482,93],{"style":55},[49,1484,635],{"style":59},[49,1486,93],{"style":55},[49,1488,1463],{"style":101},[49,1490,589],{"style":59},[49,1492,970],{"style":59},[49,1494,144],{"style":55},[49,1496,1298],{"style":73},[49,1498,1204],{"style":59},[49,1500,1501],{"style":571},"\u002F\u002F -1",[17,1503,1504,1506,1507,401,1510,1513],{},[14,1505,24],{}," also exports built-in macros. Call ",[14,1508,1509],{},"macroDiscriminatorEnum",[14,1511,1512],{},"macroEnumName"," with options to get the macro.",[247,1515,1516,1526],{},[250,1517,1518],{},[253,1519,1520,1523],{},[256,1521,1522],{},"Macro",[256,1524,1525],{},"Purpose",[266,1527,1528,1538,1547],{},[253,1529,1530,1535],{},[271,1531,1532],{},[14,1533,1534],{},"macroDedupeUnion",[271,1536,1537],{},"Drops repeated union members, ignoring the source pointer",[253,1539,1540,1544],{},[271,1541,1542],{},[14,1543,1509],{},[271,1545,1546],{},"Turns a discriminator property into an enum of its values",[253,1548,1549,1553],{},[271,1550,1551],{},[14,1552,1512],{},[271,1554,1555],{},"Names an inline enum from its parent and property",[1557,1558,1560],"h3",{"id":1559},"macro-options-and-callbacks","Macro options and callbacks",[17,1562,1563,1564,1569,1570,1572,1573,401,1575,1578,1579,1250,1582,1585,1586,707,1588,1590],{},"A macro has the callbacks of an ",[632,1565,1567],{"href":1566},"#visitors",[14,1568,36],{}," visitor, a ",[14,1571,136],{},", and optional ",[14,1574,1290],{},[14,1576,1577],{},"match",". Each callback gets the visitor context, with the node's ",[14,1580,1581],{},"parent",[14,1583,1584],{},"this"," and as its second argument. It returns a replacement node, or ",[14,1587,970],{},[14,1589,323],{}," to keep the original.",[39,1592,1595],{"language":41,"filename":1593,"code":1594,"class":44},"Type definition","type Macro = {\n name: string\n enforce?: 'pre' | 'post'\n match?: (node: Node) => boolean\n schema?(node: SchemaNode, context): SchemaNode | null | undefined\n operation?(node: OperationNode, context): OperationNode | null | undefined\n \u002F\u002F input, property, parameter, response\n}",[14,1596,1597,75,1608,75,1618,75,1637,75,1662,75,1698,75,1733,75,1740],{"class":47},[49,1598,1599,1601,1604,1606],{"class":51,"style":52},[49,1600,828],{"style":55},[49,1602,1603],{"style":101},"Macro ",[49,1605,88],{"style":55},[49,1607,800],{"style":59},[49,1609,1610,1612,1614,1616],{"class":51,"style":52},[49,1611,110],{"style":59},[49,1613,136],{"style":59},[49,1615,116],{"style":63},[49,1617,308],{"style":101},[49,1619,1620,1622,1624,1627,1629,1632,1635],{"class":51,"style":52},[49,1621,110],{"style":101},[49,1623,1290],{"style":63},[49,1625,1626],{"style":63},"?",[49,1628,116],{"style":55},[49,1630,1631],{"style":73},"'pre' ",[49,1633,1634],{"style":55},"| ",[49,1636,1298],{"style":73},[49,1638,1639,1641,1643,1645,1647,1649,1651,1653,1656,1658,1660],{"class":51,"style":52},[49,1640,110],{"style":73},[49,1642,1577],{"style":63},[49,1644,1626],{"style":63},[49,1646,116],{"style":55},[49,1648,589],{"style":59},[49,1650,786],{"style":63},[49,1652,116],{"style":63},[49,1654,1655],{"style":101},"Node",[49,1657,1204],{"style":59},[49,1659,1207],{"style":55},[49,1661,320],{"style":63},[49,1663,1664,1667,1669,1671,1673,1675,1677,1679,1682,1684,1686,1689,1691,1694,1696],{"class":51,"style":52},[49,1665,1666],{"style":63}," schema",[49,1668,1626],{"style":55},[49,1670,589],{"style":59},[49,1672,786],{"style":63},[49,1674,116],{"style":63},[49,1676,237],{"style":101},[49,1678,144],{"style":55},[49,1680,1681],{"style":63},"context",[49,1683,595],{"style":59},[49,1685,116],{"style":63},[49,1687,1688],{"style":101},"SchemaNode ",[49,1690,1634],{"style":55},[49,1692,1693],{"style":59},"null ",[49,1695,1634],{"style":55},[49,1697,970],{"style":59},[49,1699,1700,1702,1704,1706,1708,1710,1712,1714,1716,1718,1720,1722,1725,1727,1729,1731],{"class":51,"style":52},[49,1701,110],{"style":59},[49,1703,616],{"style":63},[49,1705,1626],{"style":55},[49,1707,589],{"style":59},[49,1709,786],{"style":63},[49,1711,116],{"style":63},[49,1713,919],{"style":101},[49,1715,144],{"style":55},[49,1717,1681],{"style":63},[49,1719,595],{"style":59},[49,1721,116],{"style":63},[49,1723,1724],{"style":101},"OperationNode ",[49,1726,1634],{"style":55},[49,1728,1693],{"style":59},[49,1730,1634],{"style":55},[49,1732,970],{"style":59},[49,1734,1735,1737],{"class":51,"style":52},[49,1736,110],{"style":59},[49,1738,1739],{"style":571},"\u002F\u002F input, property, parameter, response",[49,1741,1742],{"class":51,"style":52},[49,1743,882],{"style":59},[10,1745,1747],{"id":1746},"ast-json",[14,1748,1749],{},"ast.json",[17,1751,1752,1753,1755,1756,1759,1760,1763],{},"Use ",[14,1754,1749],{}," to cache a parsed spec or to send one to another thread or process. A plain ",[14,1757,1758],{},"JSON.stringify(root)"," writes the whole target schema again at every ref. ",[14,1761,1762],{},"ast.json.stringify"," writes each target once.",[247,1765,1766,1774],{},[250,1767,1768],{},[253,1769,1770,1772],{},[256,1771,648],{},[256,1773,651],{},[266,1775,1776,1788],{},[253,1777,1778,1782],{},[271,1779,1780],{},[14,1781,1762],{},[271,1783,1784,1785,1787],{},"JSON text for an ",[14,1786,194],{},", with every ref target written once",[253,1789,1790,1795],{},[271,1791,1792],{},[14,1793,1794],{},"ast.json.parse",[271,1796,1797,1798,1800],{},"The ",[14,1799,194],{}," from that text. Refs to one schema share one object again.",[39,1802,1805],{"language":41,"filename":1803,"code":1804,"class":44},"json.ts","import { ast } from 'kubb\u002Fkit'\n\nconst text = ast.json.stringify(root)\n\nast.json.parse(text) \u002F\u002F InputNode, equal to root",[14,1806,1807,75,1821,75,1823,75,1850,75,1852],{"class":47},[49,1808,1809,1811,1813,1815,1817,1819],{"class":51,"style":52},[49,1810,56],{"style":55},[49,1812,60],{"style":59},[49,1814,64],{"style":63},[49,1816,67],{"style":59},[49,1818,70],{"style":55},[49,1820,74],{"style":73},[49,1822],{"class":51,"style":52},[49,1824,1825,1827,1830,1832,1834,1836,1839,1841,1844,1846,1848],{"class":51,"style":52},[49,1826,82],{"style":55},[49,1828,1829],{"style":63},"text ",[49,1831,88],{"style":55},[49,1833,12],{"style":63},[49,1835,93],{"style":55},[49,1837,1838],{"style":59},"json",[49,1840,93],{"style":55},[49,1842,1843],{"style":101},"stringify",[49,1845,589],{"style":59},[49,1847,795],{"style":63},[49,1849,595],{"style":59},[49,1851],{"class":51,"style":52},[49,1853,1854,1856,1858,1860,1862,1865,1867,1870,1872],{"class":51,"style":52},[49,1855,12],{"style":63},[49,1857,93],{"style":55},[49,1859,1838],{"style":59},[49,1861,93],{"style":55},[49,1863,1864],{"style":101},"parse",[49,1866,589],{"style":59},[49,1868,1869],{"style":63},"text",[49,1871,1204],{"style":59},[49,1873,1874],{"style":571},"\u002F\u002F InputNode, equal to root",[17,1876,1877,1878,1880,1881,401,1884,1887],{},"A ",[14,1879,223],{}," holds no refs, so plain ",[14,1882,1883],{},"JSON.stringify(file)",[14,1885,1886],{},"JSON.parse"," are enough for files.",[10,1889,1891],{"id":1890},"ast-ref",[14,1892,1893],{},"ast.ref",[247,1895,1896,1904],{},[250,1897,1898],{},[253,1899,1900,1902],{},[256,1901,648],{},[256,1903,651],{},[266,1905,1906,1923,1933,1943],{},[253,1907,1908,1913],{},[271,1909,1910],{},[14,1911,1912],{},"ast.ref.getName",[271,1914,1915,1916,1919,1920,93],{},"The target name, ",[14,1917,1918],{},"targetName"," first. Pass the node, not ",[14,1921,1922],{},"node.ref",[253,1924,1925,1930],{},[271,1926,1927],{},[14,1928,1929],{},"ast.ref.getSchema",[271,1931,1932],{},"The schema a ref points at, or the node itself",[253,1934,1935,1940],{},[271,1936,1937],{},[14,1938,1939],{},"ast.ref.isAlias",[271,1941,1942],{},"Whether a ref adds nothing and prints as its target name",[253,1944,1945,1950],{},[271,1946,1947],{},[14,1948,1949],{},"ast.ref.mergeSchema",[271,1951,1952,1953,1956],{},"The ref merged with its schema, ref fields such as ",[14,1954,1955],{},"description"," winning",[17,1958,1959,1961,1962,401,1965,93],{},[14,1960,24],{}," also exports the name builders ",[14,1963,1964],{},"childName",[14,1966,1967],{},"enumPropName",[39,1969,1972],{"language":41,"filename":1970,"code":1971,"class":44},"ref.ts","import { ast } from 'kubb\u002Fkit'\n\nast.ref.getName('#\u002Fcomponents\u002Fschemas\u002FPet') \u002F\u002F 'Pet'\nast.ref.getSchema(petRef).type \u002F\u002F 'object'\nast.ref.isAlias(petRef) \u002F\u002F true\nast.ref.mergeSchema(petRef).description \u002F\u002F 'The owner pet', from the ref",[14,1973,1974,75,1988,75,1990,75,2013,75,2040,75,2062],{"class":47},[49,1975,1976,1978,1980,1982,1984,1986],{"class":51,"style":52},[49,1977,56],{"style":55},[49,1979,60],{"style":59},[49,1981,64],{"style":63},[49,1983,67],{"style":59},[49,1985,70],{"style":55},[49,1987,74],{"style":73},[49,1989],{"class":51,"style":52},[49,1991,1992,1994,1996,1998,2000,2003,2005,2008,2010],{"class":51,"style":52},[49,1993,12],{"style":63},[49,1995,93],{"style":55},[49,1997,209],{"style":59},[49,1999,93],{"style":55},[49,2001,2002],{"style":101},"getName",[49,2004,589],{"style":59},[49,2006,2007],{"style":73},"'#\u002Fcomponents\u002Fschemas\u002FPet'",[49,2009,1204],{"style":59},[49,2011,2012],{"style":571},"\u002F\u002F 'Pet'",[49,2014,2015,2017,2019,2021,2023,2026,2028,2031,2033,2035,2037],{"class":51,"style":52},[49,2016,12],{"style":63},[49,2018,93],{"style":55},[49,2020,209],{"style":59},[49,2022,93],{"style":55},[49,2024,2025],{"style":101},"getSchema",[49,2027,589],{"style":59},[49,2029,2030],{"style":63},"petRef",[49,2032,595],{"style":59},[49,2034,93],{"style":55},[49,2036,828],{"style":59},[49,2038,2039],{"style":571},"\u002F\u002F 'object'",[49,2041,2042,2044,2046,2048,2050,2053,2055,2057,2059],{"class":51,"style":52},[49,2043,12],{"style":63},[49,2045,93],{"style":55},[49,2047,209],{"style":59},[49,2049,93],{"style":55},[49,2051,2052],{"style":101},"isAlias",[49,2054,589],{"style":59},[49,2056,2030],{"style":63},[49,2058,1204],{"style":59},[49,2060,2061],{"style":571},"\u002F\u002F true",[49,2063,2064,2066,2068,2070,2072,2075,2077,2079,2081,2083,2086],{"class":51,"style":52},[49,2065,12],{"style":63},[49,2067,93],{"style":55},[49,2069,209],{"style":59},[49,2071,93],{"style":55},[49,2073,2074],{"style":101},"mergeSchema",[49,2076,589],{"style":59},[49,2078,2030],{"style":63},[49,2080,595],{"style":59},[49,2082,93],{"style":55},[49,2084,2085],{"style":59},"description ",[49,2087,2088],{"style":571},"\u002F\u002F 'The owner pet', from the ref",[10,2090,2092],{"id":2091},"ast-graph",[14,2093,2094],{},"ast.graph",[17,2096,1752,2097,2099],{},[14,2098,2094],{}," to drop unused schemas or to wrap circular ones in a lazy getter.",[247,2101,2102,2110],{},[250,2103,2104],{},[253,2105,2106,2108],{},[256,2107,648],{},[256,2109,651],{},[266,2111,2112,2122,2136,2146],{},[253,2113,2114,2119],{},[271,2115,2116],{},[14,2117,2118],{},"ast.graph.getRefNames",[271,2120,2121],{},"Every schema name a node refers to, at any depth",[253,2123,2124,2129],{},[271,2125,2126],{},[14,2127,2128],{},"ast.graph.getImportedNames",[271,2130,2131,2132,2135],{},"The ref names a printed schema imports. ",[14,2133,2134],{},"{ checks: true }"," adds refs in checks.",[253,2137,2138,2143],{},[271,2139,2140],{},[14,2141,2142],{},"ast.graph.getUsedNames",[271,2144,2145],{},"The schema names operations reach, also through other schemas",[253,2147,2148,2153],{},[271,2149,2150],{},[14,2151,2152],{},"ast.graph.getCircularNames",[271,2154,2155],{},"The schemas in a circular chain",[39,2157,2160],{"language":41,"filename":2158,"code":2159,"class":44},"graph.ts","import { ast } from 'kubb\u002Fkit'\n\nast.graph.getRefNames(ownerSchema) \u002F\u002F Set { 'Pet' }\nast.graph.getImportedNames(petListSchema) \u002F\u002F ['Pet']\nast.graph.getUsedNames(root.operations, root.schemas) \u002F\u002F Set { 'Pet' }\nast.graph.getCircularNames([nodeSchema, tagSchema]) \u002F\u002F Set { 'Node' }",[14,2161,2162,75,2176,75,2178,75,2202,75,2225,75,2258],{"class":47},[49,2163,2164,2166,2168,2170,2172,2174],{"class":51,"style":52},[49,2165,56],{"style":55},[49,2167,60],{"style":59},[49,2169,64],{"style":63},[49,2171,67],{"style":59},[49,2173,70],{"style":55},[49,2175,74],{"style":73},[49,2177],{"class":51,"style":52},[49,2179,2180,2182,2184,2187,2189,2192,2194,2197,2199],{"class":51,"style":52},[49,2181,12],{"style":63},[49,2183,93],{"style":55},[49,2185,2186],{"style":59},"graph",[49,2188,93],{"style":55},[49,2190,2191],{"style":101},"getRefNames",[49,2193,589],{"style":59},[49,2195,2196],{"style":63},"ownerSchema",[49,2198,1204],{"style":59},[49,2200,2201],{"style":571},"\u002F\u002F Set { 'Pet' }",[49,2203,2204,2206,2208,2210,2212,2215,2217,2220,2222],{"class":51,"style":52},[49,2205,12],{"style":63},[49,2207,93],{"style":55},[49,2209,2186],{"style":59},[49,2211,93],{"style":55},[49,2213,2214],{"style":101},"getImportedNames",[49,2216,589],{"style":59},[49,2218,2219],{"style":63},"petListSchema",[49,2221,1204],{"style":59},[49,2223,2224],{"style":571},"\u002F\u002F ['Pet']",[49,2226,2227,2229,2231,2233,2235,2238,2240,2242,2244,2246,2248,2250,2252,2254,2256],{"class":51,"style":52},[49,2228,12],{"style":63},[49,2230,93],{"style":55},[49,2232,2186],{"style":59},[49,2234,93],{"style":55},[49,2236,2237],{"style":101},"getUsedNames",[49,2239,589],{"style":59},[49,2241,795],{"style":63},[49,2243,93],{"style":55},[49,2245,172],{"style":59},[49,2247,144],{"style":55},[49,2249,795],{"style":63},[49,2251,93],{"style":55},[49,2253,113],{"style":59},[49,2255,1204],{"style":59},[49,2257,2201],{"style":571},[49,2259,2260,2262,2264,2266,2268,2271,2273,2276,2278,2281,2284],{"class":51,"style":52},[49,2261,12],{"style":63},[49,2263,93],{"style":55},[49,2265,2186],{"style":59},[49,2267,93],{"style":55},[49,2269,2270],{"style":101},"getCircularNames",[49,2272,1026],{"style":59},[49,2274,2275],{"style":63},"nodeSchema",[49,2277,144],{"style":55},[49,2279,2280],{"style":63},"tagSchema",[49,2282,2283],{"style":59},"]) ",[49,2285,2286],{"style":571},"\u002F\u002F Set { 'Node' }",[10,2288,2290],{"id":2289},"ast-schema",[14,2291,2292],{},"ast.schema",[247,2294,2295,2303],{},[250,2296,2297],{},[253,2298,2299,2301],{},[256,2300,648],{},[256,2302,651],{},[266,2304,2305,2318,2333,2347,2365,2375,2385,2395,2411],{},[253,2306,2307,2311],{},[271,2308,2309],{},[14,2310,244],{},[271,2312,2313,2314,199,2316],{},"Every schema ",[14,2315,147],{},[14,2317,554],{},[253,2319,2320,2325],{},[271,2321,2322],{},[14,2323,2324],{},"ast.schema.narrow",[271,2326,2327,2328,2330,2331],{},"The schema typed as a given ",[14,2329,147],{},", or ",[14,2332,323],{},[253,2334,2335,2340],{},[271,2336,2337],{},[14,2338,2339],{},"ast.schema.find",[271,2341,2342,2343,2346],{},"The first matching schema. ",[14,2344,2345],{},"follow: ['ref']"," also searches resolved refs.",[253,2348,2349,2354],{},[271,2350,2351],{},[14,2352,2353],{},"ast.schema.applyOptionality",[271,2355,2356,2357,2360,2361,2364],{},"Marks the schema ",[14,2358,2359],{},"optional"," if not required, ",[14,2362,2363],{},"nullish"," if also nullable",[253,2366,2367,2372],{},[271,2368,2369],{},[14,2370,2371],{},"ast.schema.findProperties",[271,2373,2374],{},"The named properties on an object, resolved ref, or intersection, not a union",[253,2376,2377,2382],{},[271,2378,2379],{},[14,2380,2381],{},"ast.schema.getLiterals",[271,2383,2384],{},"The literals an enum, resolved ref, or literal union allows",[253,2386,2387,2392],{},[271,2388,2389],{},[14,2390,2391],{},"ast.schema.inferDiscriminator",[271,2393,2394],{},"The property each member pins to its own literal",[253,2396,2397,2402],{},[271,2398,2399],{},[14,2400,2401],{},"ast.schema.getEmbeddedJson",[271,2403,2404,2405,2407,2408,595],{},"The schema of JSON inside a string (",[14,2406,400],{}," with ",[14,2409,2410],{},"contentSchema",[253,2412,2413,2418],{},[271,2414,2415],{},[14,2416,2417],{},"ast.schema.is",[271,2419,2420,2421,144,2424,144,2426,144,2428,144,2431,144,2434,2330,2437],{},"Whether a schema is ",[14,2422,2423],{},"binary",[14,2425,308],{},[14,2427,1869],{},[14,2429,2430],{},"scalar",[14,2432,2433],{},"const",[14,2435,2436],{},"enumLike",[14,2438,2439],{},"untyped",[39,2441,2445],{"language":41,"meta":2442,"code":2443,"filename":2444,"class":44},"twoslash","import { ast } from 'kubb\u002Fkit'\n\nconst root = ast.factory.createInput({ schemas: [], operations: [] })\n\nconst dateSchema = ast.schema.find(root, {\n follow: ['ref'],\n predicate: (schema) => schema.type === 'date',\n})","schema.ts",[14,2446,2447,75,2461,75,2463,75,2497,75,2499,75,2527,75,2546,75,2576],{"class":47},[49,2448,2449,2451,2453,2455,2457,2459],{"class":51,"style":52},[49,2450,56],{"style":55},[49,2452,60],{"style":59},[49,2454,64],{"style":63},[49,2456,67],{"style":59},[49,2458,70],{"style":55},[49,2460,74],{"style":73},[49,2462],{"class":51,"style":52},[49,2464,2465,2467,2469,2471,2473,2475,2477,2479,2481,2483,2485,2487,2489,2491,2493,2495],{"class":51,"style":52},[49,2466,82],{"style":55},[49,2468,85],{"style":63},[49,2470,88],{"style":55},[49,2472,12],{"style":63},[49,2474,93],{"style":55},[49,2476,96],{"style":59},[49,2478,93],{"style":55},[49,2480,102],{"style":101},[49,2482,133],{"style":59},[49,2484,113],{"style":59},[49,2486,116],{"style":55},[49,2488,177],{"style":59},[49,2490,144],{"style":55},[49,2492,172],{"style":59},[49,2494,116],{"style":55},[49,2496,768],{"style":59},[49,2498],{"class":51,"style":52},[49,2500,2501,2503,2506,2508,2510,2512,2514,2516,2519,2521,2523,2525],{"class":51,"style":52},[49,2502,82],{"style":55},[49,2504,2505],{"style":63},"dateSchema ",[49,2507,88],{"style":55},[49,2509,12],{"style":63},[49,2511,93],{"style":55},[49,2513,619],{"style":59},[49,2515,93],{"style":55},[49,2517,2518],{"style":101},"find",[49,2520,589],{"style":59},[49,2522,795],{"style":63},[49,2524,144],{"style":55},[49,2526,800],{"style":59},[49,2528,2529,2531,2534,2536,2538,2541,2544],{"class":51,"style":52},[49,2530,110],{"style":59},[49,2532,2533],{"style":59},"follow",[49,2535,116],{"style":55},[49,2537,119],{"style":59},[49,2539,2540],{"style":73},"'ref'",[49,2542,2543],{"style":59},"]",[49,2545,165],{"style":55},[49,2547,2548,2550,2553,2555,2557,2559,2561,2563,2565,2567,2569,2571,2574],{"class":51,"style":52},[49,2549,110],{"style":55},[49,2551,2552],{"style":59},"predicate",[49,2554,116],{"style":55},[49,2556,589],{"style":59},[49,2558,619],{"style":63},[49,2560,1204],{"style":59},[49,2562,1207],{"style":55},[49,2564,619],{"style":63},[49,2566,93],{"style":55},[49,2568,828],{"style":59},[49,2570,831],{"style":55},[49,2572,2573],{"style":73},"'date'",[49,2575,165],{"style":55},[49,2577,2578],{"class":51,"style":52},[49,2579,184],{"style":59},[39,2581,2584],{"language":41,"filename":2582,"code":2583,"class":44},"schema-values.ts","ast.schema.types.string \u002F\u002F 'string'\nast.schema.narrow(node, 'object')?.properties.length \u002F\u002F number | undefined\nast.schema.applyOptionality(nullableName, false).nullish \u002F\u002F true\nast.schema.findProperties({ node: petSchema, propertyName: 'id' }).map((property) => property.schema.type) \u002F\u002F ['integer']\nast.schema.getLiterals(petKind) \u002F\u002F ['cat', 'dog']\nast.schema.inferDiscriminator([catSchema, dogSchema]) \u002F\u002F 'kind'\nast.schema.getEmbeddedJson(jsonStringSchema)?.name \u002F\u002F 'Pet'\nast.schema.is(ast.factory.createSchema({ type: 'uuid' }), 'string') \u002F\u002F true\nast.schema.is(uploadSchema, 'binary', { follow: ['ref', 'array'] }) \u002F\u002F true for Blob or Blob[] behind refs",[14,2585,2586,75,2607,75,2641,75,2673,75,2736,75,2759,75,2787,75,2814,75,2858],{"class":47},[49,2587,2588,2590,2592,2594,2596,2599,2601,2604],{"class":51,"style":52},[49,2589,12],{"style":63},[49,2591,93],{"style":55},[49,2593,619],{"style":59},[49,2595,93],{"style":55},[49,2597,2598],{"style":59},"types",[49,2600,93],{"style":55},[49,2602,2603],{"style":59},"string ",[49,2605,2606],{"style":571},"\u002F\u002F 'string'",[49,2608,2609,2611,2613,2615,2617,2620,2622,2624,2626,2628,2630,2632,2634,2636,2638],{"class":51,"style":52},[49,2610,12],{"style":63},[49,2612,93],{"style":55},[49,2614,619],{"style":59},[49,2616,93],{"style":55},[49,2618,2619],{"style":101},"narrow",[49,2621,589],{"style":59},[49,2623,786],{"style":63},[49,2625,144],{"style":55},[49,2627,152],{"style":73},[49,2629,595],{"style":59},[49,2631,1229],{"style":55},[49,2633,157],{"style":59},[49,2635,93],{"style":55},[49,2637,1382],{"style":59},[49,2639,2640],{"style":571},"\u002F\u002F number | undefined",[49,2642,2643,2645,2647,2649,2651,2654,2656,2659,2661,2664,2666,2668,2671],{"class":51,"style":52},[49,2644,12],{"style":63},[49,2646,93],{"style":55},[49,2648,619],{"style":59},[49,2650,93],{"style":55},[49,2652,2653],{"style":101},"applyOptionality",[49,2655,589],{"style":59},[49,2657,2658],{"style":63},"nullableName",[49,2660,144],{"style":55},[49,2662,2663],{"style":59},"false",[49,2665,595],{"style":59},[49,2667,93],{"style":55},[49,2669,2670],{"style":59},"nullish ",[49,2672,2061],{"style":571},[49,2674,2675,2677,2679,2681,2683,2686,2688,2690,2692,2695,2697,2700,2702,2705,2707,2709,2712,2715,2717,2719,2721,2723,2725,2727,2729,2731,2733],{"class":51,"style":52},[49,2676,12],{"style":63},[49,2678,93],{"style":55},[49,2680,619],{"style":59},[49,2682,93],{"style":55},[49,2684,2685],{"style":101},"findProperties",[49,2687,133],{"style":59},[49,2689,786],{"style":59},[49,2691,116],{"style":55},[49,2693,2694],{"style":63},"petSchema",[49,2696,144],{"style":55},[49,2698,2699],{"style":59},"propertyName",[49,2701,116],{"style":55},[49,2703,2704],{"style":73},"'id' ",[49,2706,184],{"style":59},[49,2708,93],{"style":55},[49,2710,2711],{"style":101},"map",[49,2713,2714],{"style":59},"((",[49,2716,622],{"style":63},[49,2718,1204],{"style":59},[49,2720,1207],{"style":55},[49,2722,622],{"style":63},[49,2724,93],{"style":55},[49,2726,619],{"style":59},[49,2728,93],{"style":55},[49,2730,147],{"style":59},[49,2732,1204],{"style":59},[49,2734,2735],{"style":571},"\u002F\u002F ['integer']",[49,2737,2738,2740,2742,2744,2746,2749,2751,2754,2756],{"class":51,"style":52},[49,2739,12],{"style":63},[49,2741,93],{"style":55},[49,2743,619],{"style":59},[49,2745,93],{"style":55},[49,2747,2748],{"style":101},"getLiterals",[49,2750,589],{"style":59},[49,2752,2753],{"style":63},"petKind",[49,2755,1204],{"style":59},[49,2757,2758],{"style":571},"\u002F\u002F ['cat', 'dog']",[49,2760,2761,2763,2765,2767,2769,2772,2774,2777,2779,2782,2784],{"class":51,"style":52},[49,2762,12],{"style":63},[49,2764,93],{"style":55},[49,2766,619],{"style":59},[49,2768,93],{"style":55},[49,2770,2771],{"style":101},"inferDiscriminator",[49,2773,1026],{"style":59},[49,2775,2776],{"style":63},"catSchema",[49,2778,144],{"style":55},[49,2780,2781],{"style":63},"dogSchema",[49,2783,2283],{"style":59},[49,2785,2786],{"style":571},"\u002F\u002F 'kind'",[49,2788,2789,2791,2793,2795,2797,2800,2802,2805,2807,2809,2812],{"class":51,"style":52},[49,2790,12],{"style":63},[49,2792,93],{"style":55},[49,2794,619],{"style":59},[49,2796,93],{"style":55},[49,2798,2799],{"style":101},"getEmbeddedJson",[49,2801,589],{"style":59},[49,2803,2804],{"style":63},"jsonStringSchema",[49,2806,595],{"style":59},[49,2808,1229],{"style":55},[49,2810,2811],{"style":59},"name ",[49,2813,2012],{"style":571},[49,2815,2816,2818,2820,2822,2824,2827,2829,2831,2833,2835,2837,2839,2841,2843,2845,2848,2850,2852,2854,2856],{"class":51,"style":52},[49,2817,12],{"style":63},[49,2819,93],{"style":55},[49,2821,619],{"style":59},[49,2823,93],{"style":55},[49,2825,2826],{"style":101},"is",[49,2828,589],{"style":59},[49,2830,12],{"style":63},[49,2832,93],{"style":55},[49,2834,96],{"style":59},[49,2836,93],{"style":55},[49,2838,130],{"style":101},[49,2840,133],{"style":59},[49,2842,147],{"style":59},[49,2844,116],{"style":55},[49,2846,2847],{"style":73},"'uuid' ",[49,2849,184],{"style":59},[49,2851,144],{"style":55},[49,2853,554],{"style":73},[49,2855,1204],{"style":59},[49,2857,2061],{"style":571},[49,2859,2860,2862,2864,2866,2868,2870,2872,2875,2877,2880,2882,2884,2886,2888,2890,2892,2894,2897,2900],{"class":51,"style":52},[49,2861,12],{"style":63},[49,2863,93],{"style":55},[49,2865,619],{"style":59},[49,2867,93],{"style":55},[49,2869,2826],{"style":101},[49,2871,589],{"style":59},[49,2873,2874],{"style":63},"uploadSchema",[49,2876,144],{"style":55},[49,2878,2879],{"style":73},"'binary'",[49,2881,144],{"style":55},[49,2883,60],{"style":59},[49,2885,2533],{"style":59},[49,2887,116],{"style":55},[49,2889,119],{"style":59},[49,2891,2540],{"style":73},[49,2893,144],{"style":55},[49,2895,2896],{"style":73},"'array'",[49,2898,2899],{"style":59},"] }) ",[49,2901,2902],{"style":571},"\u002F\u002F true for Blob or Blob[] behind refs",[17,2904,2905,2906,2908,2909,93],{},"To reuse ",[14,2907,2518],{}," results, see ",[632,2910,2912],{"href":2911},"#schema-search-cache","Schema search cache",[10,2914,2916],{"id":2915},"ast-media-type",[14,2917,2918],{},"ast.mediaType",[17,2920,2921],{},"Each helper takes a media type string or a content entry.",[247,2923,2924,2932],{},[250,2925,2926],{},[253,2927,2928,2930],{},[256,2929,648],{},[256,2931,651],{},[266,2933,2934,2944],{},[253,2935,2936,2941],{},[271,2937,2938],{},[14,2939,2940],{},"ast.mediaType.getBase",[271,2942,2943],{},"The lowercase media type without parameters",[253,2945,2946,2951],{},[271,2947,2948],{},[14,2949,2950],{},"ast.mediaType.isJson",[271,2952,2953,2954,144,2957,2330,2960],{},"Whether it is ",[14,2955,2956],{},"application\u002Fjson",[14,2958,2959],{},"text\u002Fjson",[14,2961,2962],{},"+json",[39,2964,2967],{"language":41,"filename":2965,"code":2966,"class":44},"media-type.ts","ast.mediaType.getBase('Application\u002FJSON; charset=utf-8') \u002F\u002F 'application\u002Fjson'\nast.mediaType.isJson('application\u002Fproblem+json') \u002F\u002F true",[14,2968,2969,75,2993],{"class":47},[49,2970,2971,2973,2975,2978,2980,2983,2985,2988,2990],{"class":51,"style":52},[49,2972,12],{"style":63},[49,2974,93],{"style":55},[49,2976,2977],{"style":59},"mediaType",[49,2979,93],{"style":55},[49,2981,2982],{"style":101},"getBase",[49,2984,589],{"style":59},[49,2986,2987],{"style":73},"'Application\u002FJSON; charset=utf-8'",[49,2989,1204],{"style":59},[49,2991,2992],{"style":571},"\u002F\u002F 'application\u002Fjson'",[49,2994,2995,2997,2999,3001,3003,3006,3008,3011,3013],{"class":51,"style":52},[49,2996,12],{"style":63},[49,2998,93],{"style":55},[49,3000,2977],{"style":59},[49,3002,93],{"style":55},[49,3004,3005],{"style":101},"isJson",[49,3007,589],{"style":59},[49,3009,3010],{"style":73},"'application\u002Fproblem+json'",[49,3012,1204],{"style":59},[49,3014,2061],{"style":571},[10,3016,3018],{"id":3017},"ast-http",[14,3019,3020],{},"ast.http",[247,3022,3023,3031],{},[250,3024,3025],{},[253,3026,3027,3029],{},[256,3028,648],{},[256,3030,651],{},[266,3032,3033],{},[253,3034,3035,3040],{},[271,3036,3037],{},[14,3038,3039],{},"ast.http.isOperation",[271,3041,3042,3043,401,3046],{},"Whether an operation is HTTP, narrowing it to have ",[14,3044,3045],{},"method",[14,3047,3048],{},"path",[39,3050,3053],{"language":41,"filename":3051,"code":3052,"class":44},"http.ts","import { ast } from 'kubb\u002Fkit'\n\nif (ast.http.isOperation(node)) {\n node.method \u002F\u002F 'GET'\n}",[14,3054,3055,75,3069,75,3071,75,3097,75,3110],{"class":47},[49,3056,3057,3059,3061,3063,3065,3067],{"class":51,"style":52},[49,3058,56],{"style":55},[49,3060,60],{"style":59},[49,3062,64],{"style":63},[49,3064,67],{"style":59},[49,3066,70],{"style":55},[49,3068,74],{"style":73},[49,3070],{"class":51,"style":52},[49,3072,3073,3076,3078,3080,3082,3085,3087,3090,3092,3094],{"class":51,"style":52},[49,3074,3075],{"style":55},"if ",[49,3077,589],{"style":59},[49,3079,12],{"style":63},[49,3081,93],{"style":55},[49,3083,3084],{"style":59},"http",[49,3086,93],{"style":55},[49,3088,3089],{"style":101},"isOperation",[49,3091,589],{"style":59},[49,3093,786],{"style":63},[49,3095,3096],{"style":59},")) {",[49,3098,3099,3101,3103,3105,3107],{"class":51,"style":52},[49,3100,110],{"style":59},[49,3102,786],{"style":63},[49,3104,93],{"style":55},[49,3106,955],{"style":59},[49,3108,3109],{"style":571},"\u002F\u002F 'GET'",[49,3111,3112],{"class":51,"style":52},[49,3113,882],{"style":59},[10,3115,3117],{"id":3116},"printers","Printers",[247,3119,3120,3131],{},[250,3121,3122],{},[253,3123,3124,3129],{},[256,3125,3126,3128],{},[14,3127,24],{}," export",[256,3130,651],{},[266,3132,3133,3146],{},[253,3134,3135,3140],{},[271,3136,3137],{},[14,3138,3139],{},"createPrinter",[271,3141,3142,3143],{},"A factory from printer options to a ",[14,3144,3145],{},"Printer",[253,3147,3148,3152],{},[271,3149,3150],{},[14,3151,1249],{},[271,3153,3154,3155],{},"The same macro object, typed as a ",[14,3156,1522],{},[17,3158,3159,3160,3163,3164,3167,3168,144,3171,626,3174,3177,3178,1255],{},"A printer's ",[14,3161,3162],{},"overrides"," map replaces the handlers of single schema types. The ",[14,3165,3166],{},"printer.nodes"," option of ",[14,3169,3170],{},"@kubb\u002Fplugin-ts",[14,3172,3173],{},"@kubb\u002Fplugin-zod",[14,3175,3176],{},"@kubb\u002Fplugin-faker"," fills it, as ",[632,3179,3117],{"href":3180},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize#printers",[3182,3183,3185,3186,3188,3189,144,3192,3195],"blockquote",{"as":3184},"warning","Pass overrides through ",[14,3187,3162],{},". If you spread them into ",[14,3190,3191],{},"nodes",[14,3193,3194],{},"this.base"," cannot find the original handler.",[1557,3197,3199],{"id":3198},"printer-handlers-and-context","Printer handlers and context",[17,3201,3202,3203,199,3205,3207],{},"Key the map by schema ",[14,3204,147],{},[14,3206,554],{},". A type without a handler keeps the built-in one.",[39,3209,3211],{"language":41,"filename":1593,"code":3210,"class":44},"type PrinterNodes = Partial\u003C{\n [K in SchemaType]: (this: Context, node: SchemaNodeByType[K], ctx?: Context) => Output | null\n}>",[14,3212,3213,75,3229,75,3293],{"class":47},[49,3214,3215,3217,3220,3222,3225,3227],{"class":51,"style":52},[49,3216,828],{"style":55},[49,3218,3219],{"style":101},"PrinterNodes ",[49,3221,88],{"style":55},[49,3223,3224],{"style":101},"Partial",[49,3226,912],{"style":55},[49,3228,800],{"style":59},[49,3230,3231,3234,3237,3240,3243,3245,3247,3249,3251,3253,3256,3258,3260,3262,3265,3267,3270,3272,3274,3277,3280,3282,3284,3286,3289,3291],{"class":51,"style":52},[49,3232,3233],{"style":59}," [",[49,3235,3236],{"style":101},"K ",[49,3238,3239],{"style":55},"in ",[49,3241,3242],{"style":101},"SchemaType",[49,3244,2543],{"style":59},[49,3246,116],{"style":55},[49,3248,589],{"style":59},[49,3250,1584],{"style":63},[49,3252,116],{"style":63},[49,3254,3255],{"style":101},"Context",[49,3257,144],{"style":55},[49,3259,786],{"style":59},[49,3261,116],{"style":63},[49,3263,3264],{"style":101},"SchemaNodeByType",[49,3266,119],{"style":59},[49,3268,3269],{"style":59},"K",[49,3271,2543],{"style":59},[49,3273,144],{"style":55},[49,3275,3276],{"style":59},"ctx",[49,3278,3279],{"style":63},"?: ",[49,3281,3255],{"style":101},[49,3283,1204],{"style":59},[49,3285,1207],{"style":55},[49,3287,3288],{"style":101},"Output ",[49,3290,1634],{"style":55},[49,3292,323],{"style":59},[49,3294,3295,3297],{"class":51,"style":52},[49,3296,882],{"style":59},[49,3298,922],{"style":55},[17,3300,3301,3302,3304,3305,199,3307,3310,3311,3314,3315,3317,3318,3320,3321,3324,3325,3328],{},"A handler gets the context as ",[14,3303,1584],{}," and as its second argument, so an arrow function can read it as ",[14,3306,3276],{},[14,3308,3309],{},"array: (node, ctx) => ctx!.transform(node.items[0])",". The second argument is typed as optional, and its ",[14,3312,3313],{},"options"," as ",[14,3316,278],{},", so handler types written for ",[14,3319,1584],{}," alone keep compiling. Read typed options from ",[14,3322,3323],{},"this.options",". The root ",[14,3326,3327],{},"print"," override gets the root context the same way.",[247,3330,3331,3343],{},[250,3332,3333],{},[253,3334,3335,3340],{},[256,3336,3337,3339],{},[14,3338,1584],{}," member",[256,3341,3342],{},"Does",[266,3344,3345,3355,3365,3380,3396],{},[253,3346,3347,3352],{},[271,3348,3349],{},[14,3350,3351],{},"this.transform(node, options?)",[271,3353,3354],{},"Prints a nested schema with every handler, overrides included",[253,3356,3357,3362],{},[271,3358,3359],{},[14,3360,3361],{},"this.base(node, options?)",[271,3363,3364],{},"Runs the replaced built-in handler, to wrap its output",[253,3366,3367,3371],{},[271,3368,3369],{},[14,3370,3323],{},[271,3372,3373,3374,3377,3378],{},"The resolved printer options, such as ",[14,3375,3376],{},"arrayType"," on ",[14,3379,3170],{},[253,3381,3382,3387],{},[271,3383,3384],{},[14,3385,3386],{},"this.parent",[271,3388,3389,3390,144,3393,3395],{},"The schema node whose handler called ",[14,3391,3392],{},"this.transform",[14,3394,970],{}," at the root",[253,3397,3398,3403],{},[271,3399,3400],{},[14,3401,3402],{},"this.import(node)",[271,3404,3405,3406,3409],{},"Declares an import, as an ",[14,3407,3408],{},"ast.factory.createImport()"," node",[17,3411,1797,3412,3414,3415,707,3417,3419,3420,3422],{},[14,3413,3313],{}," you pass to ",[14,3416,3392],{},[14,3418,3194],{}," are merged over ",[14,3421,3323],{}," for that child and what it prints, and leave the caller's options unchanged:",[39,3424,3426],{"language":41,"code":3425,"class":44},"string(node) {\n const contentNode = ast.schema.getEmbeddedJson(node)\n return contentNode ? this.transform(contentNode, { direction: 'decode' }) : 'z.string()'\n}",[14,3427,3428,75,3438,75,3465,75,3506],{"class":47},[49,3429,3430,3432,3434,3436],{"class":51,"style":52},[49,3431,308],{"style":101},[49,3433,589],{"style":59},[49,3435,786],{"style":63},[49,3437,813],{"style":59},[49,3439,3440,3442,3444,3447,3449,3451,3453,3455,3457,3459,3461,3463],{"class":51,"style":52},[49,3441,110],{"style":59},[49,3443,82],{"style":55},[49,3445,3446],{"style":63},"contentNode ",[49,3448,88],{"style":55},[49,3450,12],{"style":63},[49,3452,93],{"style":55},[49,3454,619],{"style":59},[49,3456,93],{"style":55},[49,3458,2799],{"style":101},[49,3460,589],{"style":59},[49,3462,786],{"style":63},[49,3464,595],{"style":59},[49,3466,3467,3469,3471,3473,3475,3477,3479,3481,3483,3486,3488,3490,3493,3495,3498,3501,3503],{"class":51,"style":52},[49,3468,110],{"style":59},[49,3470,821],{"style":55},[49,3472,3446],{"style":63},[49,3474,852],{"style":55},[49,3476,1584],{"style":63},[49,3478,93],{"style":55},[49,3480,639],{"style":101},[49,3482,589],{"style":59},[49,3484,3485],{"style":63},"contentNode",[49,3487,144],{"style":55},[49,3489,60],{"style":59},[49,3491,3492],{"style":59},"direction",[49,3494,116],{"style":55},[49,3496,3497],{"style":73},"'decode' ",[49,3499,3500],{"style":59},"}) ",[49,3502,116],{"style":55},[49,3504,3505],{"style":73},"'z.string()'",[49,3507,3508],{"class":51,"style":52},[49,3509,882],{"style":59},[17,3511,3512,3513,3519,3520,3523],{},"A handler that runs during a build, from a template that calls the printer, can call ",[632,3514,3516],{"href":3515},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Ftemplates#from",[14,3517,3518],{},"from()"," for another plugin's names and their imports. So a printer needs no ",[14,3521,3522],{},"resolver"," in its options:",[39,3525,3527],{"language":41,"code":3526,"class":44},"ref(node) {\n const type = from('plugin-ts').resolver.name(ast.ref.getName(node) ?? '')\n if (type.import) this.import(type.import)\n return type.name\n}",[14,3528,3529,75,3539,75,3593,75,3626,75,3638],{"class":47},[49,3530,3531,3533,3535,3537],{"class":51,"style":52},[49,3532,209],{"style":101},[49,3534,589],{"style":59},[49,3536,786],{"style":63},[49,3538,813],{"style":59},[49,3540,3541,3543,3545,3547,3549,3552,3554,3557,3559,3561,3563,3565,3567,3569,3571,3573,3575,3577,3579,3581,3583,3585,3588,3591],{"class":51,"style":52},[49,3542,110],{"style":59},[49,3544,82],{"style":55},[49,3546,828],{"style":63},[49,3548,88],{"style":55},[49,3550,3551],{"style":101},"from",[49,3553,589],{"style":59},[49,3555,3556],{"style":73},"'plugin-ts'",[49,3558,595],{"style":59},[49,3560,93],{"style":55},[49,3562,3522],{"style":59},[49,3564,93],{"style":55},[49,3566,136],{"style":101},[49,3568,589],{"style":59},[49,3570,12],{"style":63},[49,3572,93],{"style":55},[49,3574,209],{"style":59},[49,3576,93],{"style":55},[49,3578,2002],{"style":101},[49,3580,589],{"style":59},[49,3582,786],{"style":63},[49,3584,1204],{"style":59},[49,3586,3587],{"style":55},"?? ",[49,3589,3590],{"style":73},"''",[49,3592,595],{"style":59},[49,3594,3595,3597,3599,3601,3603,3605,3608,3610,3612,3614,3616,3618,3620,3622,3624],{"class":51,"style":52},[49,3596,110],{"style":59},[49,3598,3075],{"style":55},[49,3600,589],{"style":59},[49,3602,147],{"style":63},[49,3604,93],{"style":55},[49,3606,3607],{"style":59},"import",[49,3609,1204],{"style":59},[49,3611,1584],{"style":63},[49,3613,93],{"style":55},[49,3615,3607],{"style":101},[49,3617,589],{"style":59},[49,3619,147],{"style":63},[49,3621,93],{"style":55},[49,3623,3607],{"style":59},[49,3625,595],{"style":59},[49,3627,3628,3630,3632,3634,3636],{"class":51,"style":52},[49,3629,110],{"style":59},[49,3631,821],{"style":55},[49,3633,147],{"style":63},[49,3635,93],{"style":55},[49,3637,136],{"style":59},[49,3639,3640],{"class":51,"style":52},[49,3641,882],{"style":59},[17,3643,3644,3646,3647,3650,3651,3654],{},[14,3645,3518],{}," reports ",[14,3648,3649],{},"KUBB_NO_CONTEXT"," when the printer runs outside a build, such as in a test that calls it directly. Run that call inside ",[14,3652,3653],{},"withContext"," with a mocked context.",[3182,3656,3658,3659,3662],{"as":3657},"important","The built-in templates collect those imports. In your own template, call ",[14,3660,3661],{},"printer.drainImports()"," after printing.",[17,3664,3665,3669],{},[632,3666,3668],{"href":3667},"\u002Fdocs\u002F5.x\u002Fintroduction\u002Farchitecture#ast","Architecture"," explains why the AST exists.",[10,3671,3673],{"id":3672},"less-common-cases","Less common cases",[1557,3675,2912],{"id":3676},"schema-search-cache",[17,3678,3679,3680,3682,3683,3686,3687,3689,3690,3692],{},"When you call ",[14,3681,2339],{}," across many schemas, reuse its answers with a ",[14,3684,3685],{},"cache",". Keep one ",[14,3688,3685],{}," per predicate and ",[14,3691,2533],{}," value, so later calls skip what earlier ones searched.",[39,3694,3697],{"language":41,"filename":3695,"code":3696,"class":44},"find-cache.ts","import { ast } from 'kubb\u002Fkit'\n\nconst dateCache = new WeakMap\u003Cast.SchemaNode, ast.SchemaNode | null>()\nconst hasDate = (schema: ast.SchemaNode) =>\n ast.schema.find(schema, { follow: ['ref'], cache: dateCache, predicate: (node) => node.type === 'date' }) !== undefined",[14,3698,3699,75,3713,75,3715,75,3755,75,3781],{"class":47},[49,3700,3701,3703,3705,3707,3709,3711],{"class":51,"style":52},[49,3702,56],{"style":55},[49,3704,60],{"style":59},[49,3706,64],{"style":63},[49,3708,67],{"style":59},[49,3710,70],{"style":55},[49,3712,74],{"style":73},[49,3714],{"class":51,"style":52},[49,3716,3717,3719,3722,3724,3727,3730,3732,3734,3736,3738,3740,3742,3744,3746,3748,3750,3752],{"class":51,"style":52},[49,3718,82],{"style":55},[49,3720,3721],{"style":63},"dateCache ",[49,3723,88],{"style":55},[49,3725,3726],{"style":55},"new ",[49,3728,3729],{"style":101},"WeakMap",[49,3731,912],{"style":55},[49,3733,12],{"style":63},[49,3735,93],{"style":55},[49,3737,237],{"style":59},[49,3739,144],{"style":55},[49,3741,12],{"style":63},[49,3743,93],{"style":55},[49,3745,1688],{"style":59},[49,3747,1634],{"style":55},[49,3749,323],{"style":59},[49,3751,922],{"style":55},[49,3753,3754],{"style":59},"()",[49,3756,3757,3759,3762,3764,3766,3768,3770,3772,3774,3776,3778],{"class":51,"style":52},[49,3758,82],{"style":55},[49,3760,3761],{"style":63},"hasDate ",[49,3763,88],{"style":55},[49,3765,589],{"style":59},[49,3767,619],{"style":63},[49,3769,116],{"style":55},[49,3771,12],{"style":63},[49,3773,93],{"style":55},[49,3775,237],{"style":59},[49,3777,1204],{"style":59},[49,3779,3780],{"style":55},"=>",[49,3782,3783,3785,3787,3789,3791,3793,3795,3797,3799,3801,3803,3805,3807,3809,3811,3813,3815,3817,3819,3822,3824,3826,3828,3830,3832,3834,3836,3838,3840,3842,3844,3847,3849,3852],{"class":51,"style":52},[49,3784,110],{"style":55},[49,3786,12],{"style":63},[49,3788,93],{"style":55},[49,3790,619],{"style":59},[49,3792,93],{"style":55},[49,3794,2518],{"style":101},[49,3796,589],{"style":59},[49,3798,619],{"style":63},[49,3800,144],{"style":55},[49,3802,60],{"style":59},[49,3804,2533],{"style":59},[49,3806,116],{"style":55},[49,3808,119],{"style":59},[49,3810,2540],{"style":73},[49,3812,2543],{"style":59},[49,3814,144],{"style":55},[49,3816,3685],{"style":59},[49,3818,116],{"style":55},[49,3820,3821],{"style":63},"dateCache",[49,3823,144],{"style":55},[49,3825,2552],{"style":59},[49,3827,116],{"style":55},[49,3829,589],{"style":59},[49,3831,786],{"style":63},[49,3833,1204],{"style":59},[49,3835,1207],{"style":55},[49,3837,786],{"style":63},[49,3839,93],{"style":55},[49,3841,828],{"style":59},[49,3843,831],{"style":55},[49,3845,3846],{"style":73},"'date' ",[49,3848,3500],{"style":59},[49,3850,3851],{"style":55},"!== ",[49,3853,970],{"style":59},[1557,3855,3857],{"id":3856},"ast-helper-details","AST helper details",[17,3859,3860,3861,3863,3864,3866],{},"Helper names are a verb plus what they return (",[14,3862,2002],{},") or a question (",[14,3865,3005],{},").",[247,3868,3869,3878],{},[250,3870,3871],{},[253,3872,3873,3875],{},[256,3874,648],{},[256,3876,3877],{},"Detail",[266,3879,3880,3899,3919,3941],{},[253,3881,3882,3889],{},[271,3883,3884],{},[632,3885,3887],{"href":3886},"#printers",[14,3888,3139],{},[271,3890,3891,3895,3896,3898],{},[632,3892,3894],{"href":3893},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-zod\u002Fguides\u002Fcustomization#import-a-custom-codec","Import a custom codec"," shows an ",[14,3897,3162],{}," map in practice.",[253,3900,3901,3908],{},[271,3902,3903],{},[632,3904,3906],{"href":3905},"#ast-schema",[14,3907,2417],{},[271,3909,3910,3912,3913,3915,3916,3918],{},[14,3911,2533],{}," adds links on top of the node itself: ",[14,3914,2540],{}," jumps to a resolved ref's target, and ",[14,3917,2896],{}," matches when some item matches. Following repeats and stops on a ref cycle.",[253,3920,3921,3928],{},[271,3922,3923],{},[632,3924,3926],{"href":3925},"#ast-graph",[14,3927,2128],{},[271,3929,700,3930,3932,3933,144,3936,626,3939,93],{},[14,3931,2134],{}," to include refs inside ",[14,3934,3935],{},"conditionals",[14,3937,3938],{},"contains",[14,3940,408],{},[253,3942,3943,3949],{},[271,3944,3945],{},[632,3946,3947],{"href":634},[14,3948,1243],{},[271,3950,3951,3952,3954,3955,93],{},"A macro is a named transform that rewrites nodes before printing, with ordering through ",[14,3953,1290],{}," and gating through ",[14,3956,1577],{},{"title":3958,"searchDepth":3959,"depth":3959,"links":3960},"",5,[3961,3963,3964,3965,3966,3967,3968,3972,3973,3974,3975,3976,3977,3978,3981],{"id":12,"depth":3962,"text":12},2,{"id":187,"depth":3962,"text":188},{"id":230,"depth":3962,"text":231},{"id":411,"depth":3962,"text":32},{"id":603,"depth":3962,"text":36},{"id":1069,"depth":3962,"text":1072},{"id":1240,"depth":3962,"text":1243,"children":3969},[3970],{"id":1559,"depth":3971,"text":1560},3,{"id":1746,"depth":3962,"text":1749},{"id":1890,"depth":3962,"text":1893},{"id":2091,"depth":3962,"text":2094},{"id":2289,"depth":3962,"text":2292},{"id":2915,"depth":3962,"text":2918},{"id":3017,"depth":3962,"text":3020},{"id":3116,"depth":3962,"text":3117,"children":3979},[3980],{"id":3198,"depth":3971,"text":3199},{"id":3672,"depth":3962,"text":3673,"children":3982},[3983,3984],{"id":3676,"depth":3971,"text":2912},{"id":3856,"depth":3971,"text":3857},"The ast namespace from kubb\u002Fkit. Covers the node tree, schema types, and every helper group, each with what it returns and a sample call.","md",{"layout":3988,"title":5,"description":3985,"outline":3989,"order":3990,"navigation":3991},"doc",[3962,3971],8,{"title":3992,"icon":3993},"AST & node builders","i-iconoir-code-brackets",{"layout":3988,"outline":3995},[3962,3971],{"title":3992,"icon":3993},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fast",{"title":5,"description":3985},{"loc":3997},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fast.md","docs\u002F5.x\u002Freference\u002Fkit\u002Fast","l7qsfmvo9G9SmL3UFIA-zlVzw8tfNPG_yW4HZ1c3s6k",1795727677607,"1b64b1eb-29b7-4f90-ad41-6f24721e1669"]