@kubb/ast 5.0.0-alpha.31 → 5.0.0-alpha.33

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 { t as __name } from "./chunk--u3MIqq1.js";
2
- import { A as createTypeNode, At as schemaTypes, C as createOperation, D as createResponse, Dt as httpMethods, E as createProperty, G as ParameterNode, O as createRoot, Ot as isScalarPrimitive, P as ParserOptions, S as createFunctionParameters, T as createParameterGroup, Tt as ScalarPrimitive, _ as PrinterPartial, bt as FunctionParametersNode, ct as SchemaNode, d as transform, f as walk, g as PrinterFactoryOptions, h as Printer, j as syncOptionality, k as createSchema, kt as mediaTypes, l as collect, lt as SchemaNodeByType, m as extractRefName, u as composeTransformers, v as createPrinterFactory, w as createParameter, x as createFunctionParameter, xt as ParameterGroupNode, y as definePrinter, yt as FunctionParameterNode, z as OperationNode } from "./visitor-z-5U8NoF.js";
2
+ import { A as createInput, B as createSource, C as createConst, D as createFunctionParameter, E as createFunction, F as createParameterGroup, H as createType, Ht as CodeNode, I as createParamsType, K as ParserOptions, L as createProperty, M as createOperation, Mt as FunctionParameterNode, N as createOutput, Nt as FunctionParametersNode, O as createFunctionParameters, P as createParameter, Pt as ParameterGroupNode, Q as OperationNode, Qt as ScalarPrimitive, R as createResponse, S as createBreak, St as SchemaNodeByType, T as createFile, U as syncOptionality, V as createText, X as OutputNode, Y as InputNode, _ as PrinterPartial, d as transform, en as httpMethods, f as walk, g as PrinterFactoryOptions, h as Printer, in as schemaTypes, it as ParameterNode, j as createJsx, k as createImport, l as collect, m as extractRefName, nn as mediaTypes, rn as nodeKinds, tn as isScalarPrimitive, u as composeTransformers, v as createPrinterFactory, w as createExport, x as createArrowFunction, xt as SchemaNode, y as definePrinter, z as createSchema } from "./visitor-CJMIoAE3.js";
3
3
 
4
4
  //#region src/guards.d.ts
5
5
  /**
@@ -12,6 +12,28 @@ import { A as createTypeNode, At as schemaTypes, C as createOperation, D as crea
12
12
  * ```
13
13
  */
14
14
  declare function narrowSchema<T extends SchemaNode['type']>(node: SchemaNode | undefined, type: T): SchemaNodeByType[T] | undefined;
15
+ /**
16
+ * Returns `true` when the input is an `InputNode`.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * if (isInputNode(node)) {
21
+ * console.log(node.schemas.length)
22
+ * }
23
+ * ```
24
+ */
25
+ declare const isInputNode: (node: unknown) => node is InputNode;
26
+ /**
27
+ * Returns `true` when the input is an `OutputNode`.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * if (isOutputNode(node)) {
32
+ * console.log(node.files.length)
33
+ * }
34
+ * ```
35
+ */
36
+ declare const isOutputNode: (node: unknown) => node is OutputNode;
15
37
  /**
16
38
  * Returns `true` when the input is an `OperationNode`.
17
39
  *
@@ -300,11 +322,19 @@ type CreateOperationParamsOptions = {
300
322
  * paramsType: 'inline',
301
323
  * pathParamsType: 'inline',
302
324
  * resolver: tsResolver,
303
- * extraParams: [createFunctionParameter({ name: 'options', type: createTypeNode({ variant: 'reference', name: 'Partial<RequestOptions>' }), default: '{}' })],
325
+ * extraParams: [createFunctionParameter({ name: 'options', type: createParamsType({ variant: 'reference', name: 'Partial<RequestOptions>' }), default: '{}' })],
304
326
  * })
305
327
  * ```
306
328
  */
307
329
  declare function createOperationParams(node: OperationNode, options: CreateOperationParamsOptions): FunctionParametersNode;
330
+ /**
331
+ * Recursively extracts all string content embedded in a {@link CodeNode} tree.
332
+ *
333
+ * Includes text node values, and string attribute fields (`params`, `generics`,
334
+ * `returnType`, `type`) that may reference identifiers needing imports.
335
+ * Used by `createFile` to build the full source string for import filtering.
336
+ */
337
+ declare function extractStringsFromNodes(nodes: Array<CodeNode> | undefined): string;
308
338
  //#endregion
309
- export { type OperationParamsResolver, type ParserOptions, type Printer, type PrinterFactoryOptions, type PrinterPartial, type ScalarPrimitive, caseParams, childName, collect, collectImports, composeTransformers, createDiscriminantNode, createFunctionParameter, createFunctionParameters, createOperation, createOperationParams, createParameter, createParameterGroup, createPrinterFactory, createProperty, createResponse, createRoot, createSchema, createTypeNode, definePrinter, enumPropName, extractRefName, findDiscriminator, httpMethods, isOperationNode, isScalarPrimitive, isSchemaNode, isStringType, mediaTypes, mergeAdjacentObjects, narrowSchema, schemaTypes, setDiscriminatorEnum, setEnumName, simplifyUnion, syncOptionality, syncSchemaRef, transform, walk };
339
+ export { type OperationParamsResolver, type ParserOptions, type Printer, type PrinterFactoryOptions, type PrinterPartial, type ScalarPrimitive, caseParams, childName, collect, collectImports, composeTransformers, createArrowFunction, createBreak, createConst, createDiscriminantNode, createExport, createFile, createFunction, createFunctionParameter, createFunctionParameters, createImport, createInput, createJsx, createOperation, createOperationParams, createOutput, createParameter, createParameterGroup, createParamsType, createPrinterFactory, createProperty, createResponse, createSchema, createSource, createText, createType, definePrinter, enumPropName, extractRefName, extractStringsFromNodes, findDiscriminator, httpMethods, isInputNode, isOperationNode, isOutputNode, isScalarPrimitive, isSchemaNode, isStringType, mediaTypes, mergeAdjacentObjects, narrowSchema, nodeKinds, schemaTypes, setDiscriminatorEnum, setEnumName, simplifyUnion, syncOptionality, syncSchemaRef, transform, walk };
310
340
  //# sourceMappingURL=index.d.ts.map