@kubb/ast 5.3.19 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as __name, t as __exportAll } from "./rolldown-runtime-CNktS9qV.js";
2
- import { $ as importDef, $t as textDef, A as ResponseNode, At as InferSchemaNode, B as createParameter, Bt as TypeNode, C as inputDef, Ct as schemaDef, D as OperationNode, Dt as DateOnlyTypeValue, E as HttpOperationNode, Et as propertyDef, F as createRequestBody, Ft as ConstNode, G as SourceNode, Gt as createBreak, H as ExportNode, Ht as breakDef, I as requestBodyDef, It as FunctionNode, J as createFile, Jt as createJsx, K as UserFileNode, Kt as createConst, L as ParameterLocation, Lt as JSDocNode, M as createResponse, Mt as ArrowFunctionNode, N as responseDef, Nt as BreakNode, O as createOperation, Ot as DateTimeTypeValue, P as RequestBodyNode, Pt as CodeNode, Q as fileDef, Qt as jsxDef, R as ParameterNode, Rt as JsxNode, S as createInput, St as createSchema, T as HttpMethod, Tt as createProperty, U as FileNode, Ut as constDef, V as parameterDef, Vt as arrowFunctionDef, W as ImportNode, Wt as createArrowFunction, X as createSource, Xt as createType, Y as createImport, Yt as createText, Z as exportDef, Zt as functionDef, _ as OutputNode, _t as SchemaType, a as Enforce, an as NodeKind, at as DateSchemaNode, b as InputMeta, bt as UnionSchemaNode, c as composeMacros, ct as IntersectionSchemaNode, d as Visitor, dt as PrimitiveSchemaType, en as typeDef, et as sourceDef, f as VisitorContext, ft as RefSchemaNode, g as Node, gt as SchemaNodeByType, h as transform, ht as SchemaNode, i as createPrinter, in as BaseNode, it as ArraySchemaNode, j as StatusCode, jt as ParserOptions, k as operationDef, kt as DateTypeOptions, l as defineMacro, lt as NumberSchemaNode, m as collectSync, mt as ScalarSchemaType, n as PrinterFactoryOptions, nn as NodeDef, nt as contentDef, o as Macro, on as schemaTypes, ot as DatetimeSchemaNode, p as collect, pt as ScalarSchemaNode, q as createExport, qt as createFunction, r as PrinterPartial, rn as defineNode, rt as createContent, s as applyMacros, st as EnumSchemaNode, t as Printer, tn as DistributiveOmit, tt as ContentNode, u as ParentOf, ut as ObjectSchemaNode, v as createOutput, vt as StringSchemaNode, w as GenericOperationNode, wt as PropertyNode, x as InputNode, xt as UrlSchemaNode, y as outputDef, yt as TimeSchemaNode, z as ParameterStyle, zt as TextNode } from "./types-C_kqUloi.js";
2
+ import { $ as importDef, $t as textDef, A as ResponseNode, At as InferSchemaNode, B as createParameter, Bt as TypeNode, C as inputDef, Ct as schemaDef, D as OperationNode, Dt as DateOnlyTypeValue, E as HttpOperationNode, Et as propertyDef, F as createRequestBody, Ft as ConstNode, G as SourceNode, Gt as createBreak, H as ExportNode, Ht as breakDef, I as requestBodyDef, It as FunctionNode, J as createFile, Jt as createJsx, K as UserFileNode, Kt as createConst, L as ParameterLocation, Lt as JSDocNode, M as createResponse, Mt as ArrowFunctionNode, N as responseDef, Nt as BreakNode, O as createOperation, Ot as DateTimeTypeValue, P as RequestBodyNode, Pt as CodeNode, Q as fileDef, Qt as jsxDef, R as ParameterNode, Rt as JsxNode, S as createInput, St as createSchema, T as HttpMethod, Tt as createProperty, U as FileNode, Ut as constDef, V as parameterDef, Vt as arrowFunctionDef, W as ImportNode, Wt as createArrowFunction, X as createSource, Xt as createType, Y as createImport, Yt as createText, Z as exportDef, Zt as functionDef, _ as OutputNode, _t as SchemaType, a as Enforce, an as NodeKind, at as DateSchemaNode, b as InputMeta, bt as UnionSchemaNode, c as composeMacros, ct as IntersectionSchemaNode, d as Visitor, dt as PrimitiveSchemaType, en as typeDef, et as sourceDef, f as VisitorContext, ft as RefSchemaNode, g as Node, gt as SchemaNodeByType, h as transform, ht as SchemaNode, i as createPrinter, in as BaseNode, it as ArraySchemaNode, j as StatusCode, jt as ParserOptions, k as operationDef, kt as DateTypeOptions, l as defineMacro, lt as NumberSchemaNode, m as collectSync, mt as ScalarSchemaType, n as PrinterFactoryOptions, nn as NodeDef, nt as contentDef, o as Macro, on as schemaTypes, ot as DatetimeSchemaNode, p as collect, pt as ScalarSchemaNode, q as createExport, qt as createFunction, r as PrinterPartial, rn as defineNode, rt as createContent, s as applyMacros, st as EnumSchemaNode, t as Printer, tn as DistributiveOmit, tt as ContentNode, u as ParentOf, ut as ObjectSchemaNode, v as createOutput, vt as StringSchemaNode, w as GenericOperationNode, wt as PropertyNode, x as InputNode, xt as UrlSchemaNode, y as outputDef, yt as TimeSchemaNode, z as ParameterStyle, zt as TextNode } from "./types-D10wBFnV.js";
3
3
  //#region src/guards.d.ts
4
4
  /**
5
5
  * Narrows a `SchemaNode` to the variant that matches `type`.
package/dist/index.js CHANGED
@@ -1296,8 +1296,12 @@ function createPrinter(build) {
1296
1296
  ...nodes,
1297
1297
  ...overrides
1298
1298
  } : nodes;
1299
+ const collectedImports = [];
1299
1300
  const context = {
1300
1301
  options: resolvedOptions,
1302
+ import: (node) => {
1303
+ collectedImports.push(node);
1304
+ },
1301
1305
  transform: (node) => {
1302
1306
  const handler = merged[node.type];
1303
1307
  if (!handler) return null;
@@ -1313,7 +1317,8 @@ function createPrinter(build) {
1313
1317
  name,
1314
1318
  options: resolvedOptions,
1315
1319
  transform: context.transform,
1316
- print: printOverride ? printOverride.bind(context) : context.transform
1320
+ print: printOverride ? printOverride.bind(context) : context.transform,
1321
+ drainImports: () => collectedImports.splice(0)
1317
1322
  };
1318
1323
  };
1319
1324
  }