@kubb/ast 5.0.0-alpha.4 → 5.0.0-alpha.40

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/src/printer.ts CHANGED
@@ -1,14 +1,24 @@
1
1
  import type { SchemaNode, SchemaNodeByType, SchemaType } from './nodes/index.ts'
2
2
 
3
3
  /**
4
- * Handler context for `definePrinter` mirrors `PluginContext` from `@kubb/core`.
5
- * Available as `this` inside each node handler.
4
+ * Runtime context passed as `this` to printer handlers.
5
+ *
6
+ * `this.transform` dispatches to node-level handlers from `nodes`.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const context: PrinterHandlerContext<string, {}> = {
11
+ * options: {},
12
+ * transform: () => 'value',
13
+ * }
14
+ * ```
6
15
  */
7
16
  export type PrinterHandlerContext<TOutput, TOptions extends object> = {
8
17
  /**
9
- * Recursively print a nested `SchemaNode`.
18
+ * Recursively transform a nested `SchemaNode` to `TOutput` using the node-level handlers.
19
+ * Use `this.transform` inside `nodes` handlers and inside the `print` override.
10
20
  */
11
- print: (node: SchemaNode) => TOutput | null | undefined
21
+ transform: (node: SchemaNode) => TOutput | null | undefined
12
22
  /**
13
23
  * Options for this printer instance.
14
24
  */
@@ -16,8 +26,16 @@ export type PrinterHandlerContext<TOutput, TOptions extends object> = {
16
26
  }
17
27
 
18
28
  /**
19
- * Handler for a specific `SchemaNode` variant identified by `SchemaType` key `T`.
20
- * Use a regular function (not an arrow function) so that `this` is available.
29
+ * Handler for one schema node type.
30
+ *
31
+ * Use a regular function (not an arrow function) if you need `this`.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const handler: PrinterHandler<string, {}, 'string'> = function () {
36
+ * return 'string'
37
+ * }
38
+ * ```
21
39
  */
22
40
  export type PrinterHandler<TOutput, TOptions extends object, T extends SchemaType = SchemaType> = (
23
41
  this: PrinterHandlerContext<TOutput, TOptions>,
@@ -25,22 +43,56 @@ export type PrinterHandler<TOutput, TOptions extends object, T extends SchemaTyp
25
43
  ) => TOutput | null | undefined
26
44
 
27
45
  /**
28
- * Shape of the type parameter passed to `definePrinter`.
29
- * Mirrors `AdapterFactoryOptions` / `PluginFactoryOptions` from `@kubb/core`.
46
+ * Partial map of per-node-type handler overrides for a printer.
30
47
  *
31
- * - `TName` — unique string identifier (e.g. `'zod'`, `'ts'`)
32
- * - `TOptions` options passed to and stored on the printer
33
- * - `TOutput` the type emitted by `print` (typically `string`)
48
+ * Each key is a `SchemaType` string (e.g. `'date'`, `'string'`).
49
+ * Supply only the handlers you want to replace; the printer's built-in
50
+ * defaults fill in the rest.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * pluginZod({
55
+ * printer: {
56
+ * nodes: {
57
+ * date(): string {
58
+ * return 'z.string().date()'
59
+ * },
60
+ * } satisfies PrinterPartial<string, PrinterZodOptions>,
61
+ * },
62
+ * })
63
+ * ```
64
+ */
65
+ export type PrinterPartial<TOutput, TOptions extends object> = Partial<{
66
+ [K in SchemaType]: PrinterHandler<TOutput, TOptions, K>
67
+ }>
68
+
69
+ /**
70
+ * Generic shape used by `definePrinter`.
71
+ *
72
+ * - `TName` — unique string identifier (e.g. `'zod'`, `'ts'`)
73
+ * - `TOptions` — options passed to and stored on the printer instance
74
+ * - `TOutput` — the type emitted by node handlers
75
+ * - `TPrintOutput` — type returned by public `print` (defaults to `TOutput`)
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * type MyPrinter = PrinterFactoryOptions<'my', { strict: boolean }, string>
80
+ * ```
34
81
  */
35
- export type PrinterFactoryOptions<TName extends string = string, TOptions extends object = object, TOutput = unknown> = {
82
+ export type PrinterFactoryOptions<TName extends string = string, TOptions extends object = object, TOutput = unknown, TPrintOutput = TOutput> = {
36
83
  name: TName
37
84
  options: TOptions
38
85
  output: TOutput
86
+ printOutput: TPrintOutput
39
87
  }
40
88
 
41
89
  /**
42
- * The object returned by calling a `definePrinter` instance.
43
- * Mirrors the shape of `Adapter` from `@kubb/core`.
90
+ * Printer instance returned by a printer factory.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * const printer = definePrinter((options: {}) => ({ name: 'x', options, nodes: {} }))({})
95
+ * ```
44
96
  */
45
97
  export type Printer<T extends PrinterFactoryOptions = PrinterFactoryOptions> = {
46
98
  /**
@@ -52,15 +104,33 @@ export type Printer<T extends PrinterFactoryOptions = PrinterFactoryOptions> = {
52
104
  */
53
105
  options: T['options']
54
106
  /**
55
- * Emits `TOutput` from a `SchemaNode`. Returns `null | undefined` when no handler matches.
107
+ * Node-level dispatcher converts a `SchemaNode` directly to `TOutput` using the `nodes` handlers.
108
+ * Always dispatches through the `nodes` map; never calls the `print` override.
109
+ * Use this when you need the raw output (e.g. `ts.TypeNode`) without declaration wrapping.
56
110
  */
57
- print: (node: SchemaNode) => T['output'] | null | undefined
111
+ transform: (node: SchemaNode) => T['output'] | null | undefined
58
112
  /**
59
- * Maps `print` over an array of `SchemaNode`s.
113
+ * Public printer. If the builder provides a root-level `print`, this calls that
114
+ * higher-level function (which may produce full declarations).
115
+ * Otherwise, falls back to the node-level dispatcher.
60
116
  */
61
- for: (nodes: Array<SchemaNode>) => Array<T['output'] | null | undefined>
117
+ print: (node: SchemaNode) => T['printOutput'] | null | undefined
62
118
  }
63
119
 
120
+ /**
121
+ * Builder function passed to `definePrinter`.
122
+ *
123
+ * It receives resolved options and returns:
124
+ * - `name`
125
+ * - `options`
126
+ * - `nodes` handlers
127
+ * - optional top-level `print` override
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * const build = (options: {}) => ({ name: 'x' as const, options, nodes: {} })
132
+ * ```
133
+ */
64
134
  type PrinterBuilder<T extends PrinterFactoryOptions> = (options: T['options']) => {
65
135
  name: T['name']
66
136
  /**
@@ -70,60 +140,102 @@ type PrinterBuilder<T extends PrinterFactoryOptions> = (options: T['options']) =
70
140
  nodes: Partial<{
71
141
  [K in SchemaType]: PrinterHandler<T['output'], T['options'], K>
72
142
  }>
143
+ /**
144
+ * Optional root-level print override. When provided, becomes the public `printer.print`.
145
+ * Use `this.transform(node)` inside this function to dispatch to the node-level handlers (`nodes`),
146
+ * not the override itself — so recursion is safe.
147
+ */
148
+ print?: (this: PrinterHandlerContext<T['output'], T['options']>, node: SchemaNode) => T['printOutput'] | null
73
149
  }
74
150
 
75
151
  /**
76
- * Creates a named printer factory. Mirrors the `definePlugin` / `defineAdapter` pattern
77
- * from `@kubb/core` — wraps a builder to make options optional and separates raw options
78
- * from resolved options.
152
+ * Creates a schema printer factory.
79
153
  *
80
- * @example
154
+ * This function wraps a builder and makes options optional at call sites.
155
+ *
156
+ * The builder receives resolved options and returns:
157
+ * - `name` — a unique identifier for the printer
158
+ * - `options` — options stored on the returned printer instance
159
+ * - `nodes` — a map of `SchemaType` → handler functions that convert a `SchemaNode` to `TOutput`
160
+ * - `print` _(optional)_ — top-level override exposed as `printer.print`
161
+ * - Inside this function, use `this.transform(node)` to dispatch to the `nodes` map
162
+ * - This keeps recursion safe and avoids self-calls
163
+ *
164
+ * When no `print` override is provided, `printer.print` falls back to `printer.transform` (the node-level dispatcher).
165
+ *
166
+ * @example Basic usage — Zod schema printer
81
167
  * ```ts
82
- * type ZodPrinter = PrinterFactoryOptions<'zod', { strict?: boolean }, { strict: boolean }, string>
168
+ * type PrinterZod = PrinterFactoryOptions<'zod', { strict?: boolean }, string>
83
169
  *
84
- * export const zodPrinter = definePrinter<ZodPrinter>((options) => {
85
- * const { strict = true } = options
86
- * return {
87
- * name: 'zod',
88
- * options: { strict },
89
- * nodes: {
90
- * string(node) {
91
- * return `z.string()`
92
- * },
93
- * object(node) {
94
- * const props = node.properties
95
- * ?.map(p => `${p.name}: ${this.print(p)}`)
96
- * .join(', ') ?? ''
97
- * return `z.object({ ${props} })`
98
- * },
170
+ * export const zodPrinter = definePrinter<PrinterZod>((options) => ({
171
+ * name: 'zod',
172
+ * options: { strict: options.strict ?? true },
173
+ * nodes: {
174
+ * string: () => 'z.string()',
175
+ * object(node) {
176
+ * const props = node.properties.map(p => `${p.name}: ${this.transform(p.schema)}`).join(', ')
177
+ * return `z.object({ ${props} })`
99
178
  * },
100
- * }
101
- * })
102
- *
103
- * const printer = zodPrinter({ strict: false })
104
- * printer.name // 'zod'
105
- * printer.options // { strict: false }
106
- * printer.print(node) // 'z.string()'
179
+ * },
180
+ * }))
107
181
  * ```
108
182
  */
109
183
  export function definePrinter<T extends PrinterFactoryOptions = PrinterFactoryOptions>(build: PrinterBuilder<T>): (options?: T['options']) => Printer<T> {
110
- return (options) => {
111
- const { name, options: resolvedOptions, nodes } = build(options ?? ({} as T['options']))
184
+ return createPrinterFactory<SchemaNode, SchemaType, SchemaNodeByType>((node) => node.type)(build) as (options?: T['options']) => Printer<T>
185
+ }
112
186
 
113
- const context: PrinterHandlerContext<T['output'], T['options']> = {
114
- options: resolvedOptions,
115
- print: (node: SchemaNode) => {
116
- const type = node.type as SchemaType
117
- const handler = nodes[type]
118
- return handler ? (handler as PrinterHandler<T['output'], T['options']>).call(context, node as SchemaNodeByType[SchemaType]) : undefined
119
- },
120
- }
187
+ /**
188
+ * Generic printer-factory function used by `definePrinter` and `defineFunctionPrinter`.
189
+ **
190
+ * @example
191
+ * ```ts
192
+ * export const defineFunctionPrinter = createPrinterFactory<FunctionNode, FunctionNodeType, FunctionNodeByType>(
193
+ * (node) => kindToHandlerKey[node.kind],
194
+ * )
195
+ * ```
196
+ */
197
+ export function createPrinterFactory<TNode, TKey extends string, TNodeByKey extends Partial<Record<TKey, TNode>>>(getKey: (node: TNode) => TKey | undefined) {
198
+ return function <T extends PrinterFactoryOptions>(
199
+ build: (options: T['options']) => {
200
+ name: T['name']
201
+ options: T['options']
202
+ nodes: Partial<{
203
+ [K in TKey]: (
204
+ this: { transform: (node: TNode) => T['output'] | null | undefined; options: T['options'] },
205
+ node: TNodeByKey[K],
206
+ ) => T['output'] | null | undefined
207
+ }>
208
+ print?: (this: { transform: (node: TNode) => T['output'] | null | undefined; options: T['options'] }, node: TNode) => T['printOutput'] | null | undefined
209
+ },
210
+ ): (options?: T['options']) => {
211
+ name: T['name']
212
+ options: T['options']
213
+ transform: (node: TNode) => T['output'] | null | undefined
214
+ print: (node: TNode) => T['printOutput'] | null | undefined
215
+ } {
216
+ return (options) => {
217
+ const { name, options: resolvedOptions, nodes, print: printOverride } = build(options ?? ({} as T['options']))
218
+
219
+ const context = {
220
+ options: resolvedOptions,
221
+ transform: (node: TNode): T['output'] | null | undefined => {
222
+ const key = getKey(node)
223
+ if (key === undefined) return null
224
+
225
+ const handler = nodes[key]
226
+
227
+ if (!handler) return null
228
+
229
+ return (handler as (this: typeof context, node: TNode) => T['output'] | null | undefined).call(context, node)
230
+ },
231
+ }
121
232
 
122
- return {
123
- name,
124
- options: resolvedOptions,
125
- print: context.print,
126
- for: (nodes) => nodes.map(context.print),
233
+ return {
234
+ name,
235
+ options: resolvedOptions,
236
+ transform: context.transform,
237
+ print: (printOverride ? printOverride.bind(context) : context.transform) as (node: TNode) => T['printOutput'] | null | undefined,
238
+ }
127
239
  }
128
240
  }
129
241
  }
package/src/refs.ts CHANGED
@@ -1,18 +1,40 @@
1
- import type { RootNode } from './nodes/root.ts'
1
+ import type { InputNode } from './nodes/root.ts'
2
2
  import type { SchemaNode } from './nodes/schema.ts'
3
3
 
4
4
  /**
5
- * Schema name to `SchemaNode` mapping.
5
+ * Lookup map from schema name to `SchemaNode`.
6
6
  */
7
7
  export type RefMap = Map<string, SchemaNode>
8
8
 
9
9
  /**
10
- * Indexes named schemas from `root.schemas` by name. Unnamed schemas are skipped.
10
+ * Returns the last path segment of a reference string.
11
+ *
12
+ * Example: `#/components/schemas/Pet` becomes `Pet`.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * extractRefName('#/components/schemas/Pet') // 'Pet'
17
+ * ```
11
18
  */
12
- export function buildRefMap(root: RootNode): RefMap {
19
+ export function extractRefName(ref: string): string {
20
+ return ref.split('/').at(-1) ?? ref
21
+ }
22
+
23
+ /**
24
+ * Builds a `RefMap` from `input.schemas` using each schema's `name`.
25
+ *
26
+ * Unnamed schemas are skipped.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const refMap = buildRefMap(input)
31
+ * const pet = refMap.get('Pet')
32
+ * ```
33
+ */
34
+ export function buildRefMap(input: InputNode): RefMap {
13
35
  const map: RefMap = new Map()
14
36
 
15
- for (const schema of root.schemas) {
37
+ for (const schema of input.schemas) {
16
38
  if (schema.name) {
17
39
  map.set(schema.name, schema)
18
40
  }
@@ -21,14 +43,24 @@ export function buildRefMap(root: RootNode): RefMap {
21
43
  }
22
44
 
23
45
  /**
24
- * Looks up a schema by name. Prefer over `RefMap.get()` to keep the resolution strategy swappable.
46
+ * Resolves a schema by name from a `RefMap`.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const petSchema = resolveRef(refMap, 'Pet')
51
+ * ```
25
52
  */
26
53
  export function resolveRef(refMap: RefMap, ref: string): SchemaNode | undefined {
27
54
  return refMap.get(ref)
28
55
  }
29
56
 
30
57
  /**
31
- * Converts a `RefMap` to a plain object.
58
+ * Converts a `RefMap` into a plain object.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const refsObject = refMapToObject(refMap)
63
+ * ```
32
64
  */
33
65
  export function refMapToObject(refMap: RefMap): Record<string, SchemaNode> {
34
66
  return Object.fromEntries(refMap)
@@ -0,0 +1,45 @@
1
+ import { pascalCase } from '@internals/utils'
2
+ import { narrowSchema } from './guards.ts'
3
+ import type { SchemaNode } from './nodes/schema.ts'
4
+ import { extractRefName } from './refs.ts'
5
+ import { collect } from './visitor.ts'
6
+
7
+ export function findDiscriminator(mapping: Record<string, string> | undefined, ref: string | undefined): string | null {
8
+ if (!mapping || !ref) return null
9
+ return Object.entries(mapping).find(([, value]) => value === ref)?.[0] ?? null
10
+ }
11
+
12
+ export function childName(parentName: string | null | undefined, propName: string): string | null {
13
+ return parentName ? pascalCase([parentName, propName].join(' ')) : null
14
+ }
15
+
16
+ export function enumPropName(parentName: string | null | undefined, propName: string, enumSuffix: string): string {
17
+ return pascalCase([parentName, propName, enumSuffix].filter(Boolean).join(' '))
18
+ }
19
+
20
+ /**
21
+ * Collects import entries for all `ref` schema nodes in `node`.
22
+ */
23
+ export function collectImports<TImport>({
24
+ node,
25
+ nameMapping,
26
+ resolve,
27
+ }: {
28
+ node: SchemaNode
29
+ nameMapping: Map<string, string>
30
+ resolve: (schemaName: string) => TImport | undefined
31
+ }): Array<TImport> {
32
+ return collect<TImport>(node, {
33
+ schema(schemaNode): TImport | undefined {
34
+ const schemaRef = narrowSchema(schemaNode, 'ref')
35
+ if (!schemaRef?.ref) return
36
+
37
+ const rawName = extractRefName(schemaRef.ref)
38
+ const schemaName = nameMapping.get(rawName) ?? rawName
39
+ const result = resolve(schemaName)
40
+ if (!result) return
41
+
42
+ return result
43
+ },
44
+ })
45
+ }
@@ -0,0 +1,156 @@
1
+ import { isScalarPrimitive } from './constants.ts'
2
+ import { createProperty, createSchema } from './factory.ts'
3
+ import { narrowSchema } from './guards.ts'
4
+ import type { SchemaNode } from './nodes/schema.ts'
5
+ import { enumPropName } from './resolvers.ts'
6
+
7
+ /**
8
+ * Replaces a discriminator property's schema with a string enum of allowed values.
9
+ *
10
+ * If `node` is not an object schema, or if the property does not exist, the input
11
+ * node is returned as-is.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const schema = createSchema({
16
+ * type: 'object',
17
+ * properties: [createProperty({ name: 'type', required: true, schema: createSchema({ type: 'string' }) })],
18
+ * })
19
+ * const result = setDiscriminatorEnum({ node: schema, propertyName: 'type', values: ['dog', 'cat'] })
20
+ * ```
21
+ */
22
+ export function setDiscriminatorEnum({
23
+ node,
24
+ propertyName,
25
+ values,
26
+ enumName,
27
+ }: {
28
+ node: SchemaNode
29
+ propertyName: string
30
+ values: Array<string>
31
+ enumName?: string
32
+ }): SchemaNode {
33
+ const objectNode = narrowSchema(node, 'object')
34
+ if (!objectNode?.properties?.length) {
35
+ return node
36
+ }
37
+
38
+ const hasProperty = objectNode.properties.some((prop) => prop.name === propertyName)
39
+ if (!hasProperty) {
40
+ return node
41
+ }
42
+
43
+ return createSchema({
44
+ ...objectNode,
45
+ properties: objectNode.properties.map((prop) => {
46
+ if (prop.name !== propertyName) {
47
+ return prop
48
+ }
49
+
50
+ return createProperty({
51
+ ...prop,
52
+ schema: createSchema({
53
+ type: 'enum',
54
+ primitive: 'string',
55
+ enumValues: values,
56
+ name: enumName,
57
+ readOnly: prop.schema.readOnly,
58
+ writeOnly: prop.schema.writeOnly,
59
+ }),
60
+ })
61
+ }),
62
+ })
63
+ }
64
+
65
+ /**
66
+ * Merges adjacent anonymous object members into a single anonymous object member.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const merged = mergeAdjacentObjects([
71
+ * createSchema({ type: 'object', properties: [createProperty({ name: 'a', schema: createSchema({ type: 'string' }) })] }),
72
+ * createSchema({ type: 'object', properties: [createProperty({ name: 'b', schema: createSchema({ type: 'number' }) })] }),
73
+ * ])
74
+ * ```
75
+ */
76
+ export function mergeAdjacentObjects(members: Array<SchemaNode>): Array<SchemaNode> {
77
+ return members.reduce<Array<SchemaNode>>((acc, member) => {
78
+ const objectMember = narrowSchema(member, 'object')
79
+ if (objectMember && !objectMember.name) {
80
+ const previous = acc.at(-1)
81
+ const previousObject = previous ? narrowSchema(previous, 'object') : undefined
82
+
83
+ if (previousObject && !previousObject.name) {
84
+ acc[acc.length - 1] = createSchema({
85
+ ...previousObject,
86
+ properties: [...(previousObject.properties ?? []), ...(objectMember.properties ?? [])],
87
+ })
88
+ return acc
89
+ }
90
+ }
91
+
92
+ acc.push(member)
93
+ return acc
94
+ }, [])
95
+ }
96
+
97
+ /**
98
+ * Removes enum members that are covered by broader scalar primitives in the same union.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const simplified = simplifyUnion([
103
+ * createSchema({ type: 'enum', primitive: 'string', enumValues: ['active'] }),
104
+ * createSchema({ type: 'string' }),
105
+ * ])
106
+ * // keeps only string member
107
+ * ```
108
+ */
109
+ export function simplifyUnion(members: Array<SchemaNode>): Array<SchemaNode> {
110
+ const scalarPrimitives = new Set(members.filter((member) => isScalarPrimitive(member.type)).map((m) => m.type))
111
+
112
+ if (!scalarPrimitives.size) {
113
+ return members
114
+ }
115
+
116
+ return members.filter((member) => {
117
+ const enumNode = narrowSchema(member, 'enum')
118
+ if (!enumNode) {
119
+ return true
120
+ }
121
+
122
+ const primitive = enumNode.primitive
123
+ if (!primitive) {
124
+ return true
125
+ }
126
+
127
+ const enumValueCount = enumNode.namedEnumValues?.length ?? enumNode.enumValues?.length ?? 0
128
+ if (enumValueCount <= 1) {
129
+ return true
130
+ }
131
+
132
+ if (scalarPrimitives.has(primitive)) {
133
+ return false
134
+ }
135
+
136
+ if ((primitive === 'integer' || primitive === 'number') && (scalarPrimitives.has('integer') || scalarPrimitives.has('number'))) {
137
+ return false
138
+ }
139
+
140
+ return true
141
+ })
142
+ }
143
+
144
+ export function setEnumName(propNode: SchemaNode, parentName: string | null | undefined, propName: string, enumSuffix: string): SchemaNode {
145
+ const enumNode = narrowSchema(propNode, 'enum')
146
+
147
+ if (enumNode?.primitive === 'boolean') {
148
+ return { ...propNode, name: undefined }
149
+ }
150
+
151
+ if (enumNode) {
152
+ return { ...propNode, name: enumPropName(parentName, propName, enumSuffix) }
153
+ }
154
+
155
+ return propNode
156
+ }
package/src/types.ts CHANGED
@@ -1,41 +1,67 @@
1
1
  export type { VisitorDepth } from './constants.ts'
2
2
  export type { DistributiveOmit } from './factory.ts'
3
+ export type { InferSchema, InferSchemaNode, ParserOptions } from './infer.ts'
3
4
  export type {
4
5
  ArraySchemaNode,
6
+ ArrowFunctionNode,
5
7
  BaseNode,
8
+ BreakNode,
9
+ CodeNode,
6
10
  ComplexSchemaType,
11
+ ConstNode,
7
12
  DateSchemaNode,
8
13
  DatetimeSchemaNode,
9
14
  EnumSchemaNode,
10
15
  EnumValueNode,
16
+ ExportNode,
17
+ FileNode,
18
+ FormatStringSchemaNode,
19
+ FunctionNode,
20
+ FunctionNodeType,
21
+ FunctionParameterNode,
22
+ FunctionParametersNode,
23
+ FunctionParamNode,
11
24
  HttpMethod,
12
25
  HttpStatusCode,
26
+ ImportNode,
27
+ InputMeta,
28
+ InputNode,
13
29
  IntersectionSchemaNode,
30
+ Ipv4SchemaNode,
31
+ Ipv6SchemaNode,
32
+ JSDocNode,
33
+ JsxNode,
14
34
  MediaType,
15
35
  Node,
16
36
  NodeKind,
17
37
  NumberSchemaNode,
18
38
  ObjectSchemaNode,
19
39
  OperationNode,
40
+ OutputNode,
41
+ ParameterGroupNode,
20
42
  ParameterLocation,
21
43
  ParameterNode,
44
+ ParamsTypeNode,
22
45
  PrimitiveSchemaType,
23
46
  PropertyNode,
24
47
  RefSchemaNode,
25
48
  ResponseNode,
26
- RootMeta,
27
- RootNode,
28
49
  ScalarSchemaNode,
29
50
  ScalarSchemaType,
30
51
  SchemaNode,
31
52
  SchemaNodeByType,
32
53
  SchemaType,
54
+ SourceNode,
33
55
  SpecialSchemaType,
34
56
  StatusCode,
35
57
  StringSchemaNode,
58
+ TextNode,
36
59
  TimeSchemaNode,
60
+ TypeDeclarationNode,
61
+ TypeNode,
37
62
  UnionSchemaNode,
63
+ UrlSchemaNode,
38
64
  } from './nodes/index.ts'
39
- export type { Printer, PrinterFactoryOptions, PrinterHandler, PrinterHandlerContext } from './printer.ts'
65
+ export type { Printer, PrinterFactoryOptions, PrinterPartial } from './printer.ts'
40
66
  export type { RefMap } from './refs.ts'
41
- export type { AsyncVisitor, CollectVisitor, Visitor } from './visitor.ts'
67
+ export type { AsyncVisitor, CollectOptions, CollectVisitor, ParentOf, TransformOptions, Visitor, VisitorContext, WalkOptions } from './visitor.ts'