@kubb/ast 5.0.0-alpha.16 → 5.0.0-alpha.17

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.
@@ -0,0 +1,1974 @@
1
+ import { t as __name } from "./chunk--u3MIqq1.js";
2
+
3
+ //#region src/constants.d.ts
4
+ /**
5
+ * Traversal depth used by AST visitor utilities.
6
+ */
7
+ type VisitorDepth = 'shallow' | 'deep';
8
+ declare const nodeKinds: {
9
+ readonly root: "Root";
10
+ readonly operation: "Operation";
11
+ readonly schema: "Schema";
12
+ readonly property: "Property";
13
+ readonly parameter: "Parameter";
14
+ readonly response: "Response";
15
+ readonly functionParameter: "FunctionParameter";
16
+ readonly objectBindingParameter: "ObjectBindingParameter";
17
+ readonly functionParameters: "FunctionParameters";
18
+ };
19
+ /**
20
+ * Canonical schema type strings used by AST schema nodes.
21
+ *
22
+ * These values are used across the AST as stable discriminators
23
+ * (for example `schema.type === schemaTypes.object`).
24
+ *
25
+ * The map is grouped by intent:
26
+ * - primitives (`string`, `number`, `boolean`, ...)
27
+ * - structural/composite (`object`, `array`, `union`, ...)
28
+ * - special OpenAPI-oriented types (`ref`, `datetime`, `uuid`, ...)
29
+ */
30
+ declare const schemaTypes: {
31
+ /**
32
+ * Text value.
33
+ */
34
+ readonly string: "string";
35
+ /**
36
+ * Floating-point number (`float`, `double`).
37
+ */
38
+ readonly number: "number";
39
+ /**
40
+ * Whole number (`int32`). Use `bigint` for `int64`.
41
+ */
42
+ readonly integer: "integer";
43
+ /**
44
+ * 64-bit integer (`int64`). Only used when `integerType` is set to `'bigint'`.
45
+ */
46
+ readonly bigint: "bigint";
47
+ /**
48
+ * Boolean value
49
+ */
50
+ readonly boolean: "boolean";
51
+ /**
52
+ * Explicit null value.
53
+ */
54
+ readonly null: "null";
55
+ /**
56
+ * Any value (no type restriction).
57
+ */
58
+ readonly any: "any";
59
+ /**
60
+ * Unknown value (must be narrowed before usage).
61
+ */
62
+ readonly unknown: "unknown";
63
+ /**
64
+ * No return value (`void`).
65
+ */
66
+ readonly void: "void";
67
+ /**
68
+ * Object with named properties.
69
+ */
70
+ readonly object: "object";
71
+ /**
72
+ * Sequential list of items.
73
+ */
74
+ readonly array: "array";
75
+ /**
76
+ * Fixed-length list with position-specific items.
77
+ */
78
+ readonly tuple: "tuple";
79
+ /**
80
+ * "One of" multiple schema members.
81
+ */
82
+ readonly union: "union";
83
+ /**
84
+ * "All of" multiple schema members.
85
+ */
86
+ readonly intersection: "intersection";
87
+ /**
88
+ * Enum schema.
89
+ */
90
+ readonly enum: "enum";
91
+ /**
92
+ * Reference to another schema.
93
+ */
94
+ readonly ref: "ref";
95
+ /**
96
+ * Calendar date (for example `2026-03-24`).
97
+ */
98
+ readonly date: "date";
99
+ /**
100
+ * Date-time value (for example `2026-03-24T09:00:00Z`).
101
+ */
102
+ readonly datetime: "datetime";
103
+ /**
104
+ * Time-only value (for example `09:00:00`).
105
+ */
106
+ readonly time: "time";
107
+ /**
108
+ * UUID value.
109
+ */
110
+ readonly uuid: "uuid";
111
+ /**
112
+ * Email address value.
113
+ */
114
+ readonly email: "email";
115
+ /**
116
+ * URL value.
117
+ */
118
+ readonly url: "url";
119
+ /**
120
+ * Binary/blob value.
121
+ */
122
+ readonly blob: "blob";
123
+ /**
124
+ * Impossible value (`never`).
125
+ */
126
+ readonly never: "never";
127
+ };
128
+ /**
129
+ * Primitive scalar schema types used when simplifying union members.
130
+ */
131
+ declare const SCALAR_PRIMITIVE_TYPES: Set<"string" | "number" | "bigint" | "boolean" | "integer">;
132
+ declare const httpMethods: {
133
+ readonly get: "GET";
134
+ readonly post: "POST";
135
+ readonly put: "PUT";
136
+ readonly patch: "PATCH";
137
+ readonly delete: "DELETE";
138
+ readonly head: "HEAD";
139
+ readonly options: "OPTIONS";
140
+ readonly trace: "TRACE";
141
+ };
142
+ declare const mediaTypes: {
143
+ readonly applicationJson: "application/json";
144
+ readonly applicationXml: "application/xml";
145
+ readonly applicationFormUrlEncoded: "application/x-www-form-urlencoded";
146
+ readonly applicationOctetStream: "application/octet-stream";
147
+ readonly applicationPdf: "application/pdf";
148
+ readonly applicationZip: "application/zip";
149
+ readonly applicationGraphql: "application/graphql";
150
+ readonly multipartFormData: "multipart/form-data";
151
+ readonly textPlain: "text/plain";
152
+ readonly textHtml: "text/html";
153
+ readonly textCsv: "text/csv";
154
+ readonly textXml: "text/xml";
155
+ readonly imagePng: "image/png";
156
+ readonly imageJpeg: "image/jpeg";
157
+ readonly imageGif: "image/gif";
158
+ readonly imageWebp: "image/webp";
159
+ readonly imageSvgXml: "image/svg+xml";
160
+ readonly audioMpeg: "audio/mpeg";
161
+ readonly videoMp4: "video/mp4";
162
+ };
163
+ //#endregion
164
+ //#region src/nodes/base.d.ts
165
+ /**
166
+ * `kind` values used by AST nodes.
167
+ *
168
+ * @example
169
+ * ```ts
170
+ * const kind: NodeKind = 'Schema'
171
+ * ```
172
+ */
173
+ type NodeKind = 'Root' | 'Operation' | 'Schema' | 'Property' | 'Parameter' | 'Response' | 'FunctionParameter' | 'ObjectBindingParameter' | 'FunctionParameters';
174
+ /**
175
+ * Base shape shared by all AST nodes.
176
+ *
177
+ * @example
178
+ * ```ts
179
+ * const base: BaseNode = { kind: 'Root' }
180
+ * ```
181
+ */
182
+ type BaseNode = {
183
+ /**
184
+ * Node discriminator.
185
+ */
186
+ kind: NodeKind;
187
+ };
188
+ //#endregion
189
+ //#region src/nodes/function.d.ts
190
+ /**
191
+ * AST node for one function parameter.
192
+ *
193
+ * @example Required parameter
194
+ * `name: Type`
195
+ *
196
+ * @example Optional param
197
+ * `name?: Type`
198
+ *
199
+ * @example Parameter with default
200
+ * `name: Type = defaultValue`
201
+ *
202
+ * @example Rest parameter
203
+ * `...name: Type[]`
204
+ */
205
+ type FunctionParameterNode = BaseNode & {
206
+ /**
207
+ * Node kind.
208
+ */
209
+ kind: 'FunctionParameter';
210
+ /**
211
+ * Parameter name in the generated signature.
212
+ */
213
+ name: string;
214
+ /**
215
+ * TypeScript type text, for example, `"string"` or `"Pet[]"`.
216
+ * Omit for untyped JavaScript output.
217
+ */
218
+ type?: string;
219
+ /**
220
+ * When `true` the parameter is emitted as a rest parameter (`...name`).
221
+ * @default false
222
+ */
223
+ rest?: boolean;
224
+ }
225
+ /**
226
+ * Optional parameter, rendered with `?` in declarations.
227
+ * Cannot be combined with `default` because defaulted parameters are already optional.
228
+ * @example `name?: Type`
229
+ */
230
+ & ({
231
+ optional: true;
232
+ default?: never;
233
+ }
234
+ /**
235
+ * Required parameter, or parameter with a default value.
236
+ * @example Required: `name: Type`
237
+ * @example With default: `name: Type = default`
238
+ */
239
+ | {
240
+ optional?: false;
241
+ default?: string;
242
+ });
243
+ /**
244
+ * AST node for object-destructured function parameters.
245
+ *
246
+ * This node renders as `{ key1, key2 }: { key1: Type1; key2: Type2 } = {}` in declarations,
247
+ * or as individual top-level parameters when `inline` is `true`.
248
+ *
249
+ * This replaces `mode: 'object'` and `mode: 'inlineSpread'` from the old `FunctionParams` API.
250
+ *
251
+ * @example Object destructuring with auto-computed type (declaration)
252
+ * `{ id, name }: { id: string; name: string } = {}`
253
+ *
254
+ * @example Inline (spread) — children emitted as individual top-level params
255
+ * `id: string, name: string`
256
+ */
257
+ type ObjectBindingParameterNode = BaseNode & {
258
+ /**
259
+ * Node kind.
260
+ */
261
+ kind: 'ObjectBindingParameter';
262
+ /**
263
+ * The individual parameters that form the destructured object.
264
+ * Rendered as `{ key1, key2 }` in declarations, or spread inline when `inline` is `true`.
265
+ */
266
+ properties: Array<FunctionParameterNode>;
267
+ /**
268
+ * Optional type text for the full object parameter.
269
+ * When absent, the printer auto-computes `{ key1: Type1; key2: Type2 }` from `properties`.
270
+ */
271
+ type?: string;
272
+ /**
273
+ * When `true`, `properties` are emitted as individual top-level parameters instead of
274
+ * being wrapped in a destructuring pattern (`{ key1, key2 }`).
275
+ *
276
+ * Equivalent to `mode: 'inlineSpread'` in the legacy `FunctionParams` API.
277
+ * @default false
278
+ */
279
+ inline?: boolean;
280
+ /**
281
+ * Whether the full object binding is optional.
282
+ * If omitted, printers infer this from child properties.
283
+ */
284
+ optional?: boolean;
285
+ /**
286
+ * Default value for the object group, written verbatim after `=`.
287
+ * Commonly `'{}'` to allow omitting the argument entirely.
288
+ */
289
+ default?: string;
290
+ };
291
+ /**
292
+ * AST node for a complete function parameter list.
293
+ *
294
+ * Printers are responsible for sorting (`required` → `optional` → `defaulted`).
295
+ * Nodes are plain immutable data.
296
+ *
297
+ * Renders differently depending on the output mode:
298
+ * - `declaration` → `(id: string, config: Config = {})` — function declaration parameters
299
+ * - `call` → `(id, { method, url })` — function call arguments
300
+ * - `keys` → `{ id, config }` — key names only (for destructuring)
301
+ * - `values` → `{ id: id, config: config }` — key → value pairs
302
+ */
303
+ type FunctionParametersNode = BaseNode & {
304
+ /**
305
+ * Node kind.
306
+ */
307
+ kind: 'FunctionParameters';
308
+ /**
309
+ * Ordered parameter nodes.
310
+ */
311
+ params: Array<FunctionParameterNode | ObjectBindingParameterNode>;
312
+ };
313
+ /**
314
+ * The three function-signature AST node variants.
315
+ */
316
+ type FunctionNode = FunctionParameterNode | ObjectBindingParameterNode | FunctionParametersNode;
317
+ /**
318
+ * Handler map keys — one per `FunctionNode` kind.
319
+ */
320
+ type FunctionNodeType = 'functionParameter' | 'objectBindingParameter' | 'functionParameters';
321
+ //#endregion
322
+ //#region src/nodes/property.d.ts
323
+ /**
324
+ * AST node representing one named object property.
325
+ *
326
+ * @example
327
+ * ```ts
328
+ * const property: PropertyNode = {
329
+ * kind: 'Property',
330
+ * name: 'id',
331
+ * schema: createSchema({ type: 'integer' }),
332
+ * required: true,
333
+ * }
334
+ * ```
335
+ */
336
+ type PropertyNode = BaseNode & {
337
+ /**
338
+ * Node kind.
339
+ */
340
+ kind: 'Property';
341
+ /**
342
+ * Property key.
343
+ */
344
+ name: string;
345
+ /**
346
+ * Property schema.
347
+ */
348
+ schema: SchemaNode;
349
+ /**
350
+ * Whether the property is required.
351
+ */
352
+ required: boolean;
353
+ };
354
+ //#endregion
355
+ //#region src/nodes/schema.d.ts
356
+ type PrimitiveSchemaType =
357
+ /**
358
+ * Text value.
359
+ */
360
+ 'string'
361
+ /**
362
+ * Floating-point number.
363
+ */
364
+ | 'number'
365
+ /**
366
+ * Integer number.
367
+ */
368
+ | 'integer'
369
+ /**
370
+ * Big integer number.
371
+ */
372
+ | 'bigint'
373
+ /**
374
+ * Boolean value.
375
+ */
376
+ | 'boolean'
377
+ /**
378
+ * Null value.
379
+ */
380
+ | 'null'
381
+ /**
382
+ * Any value.
383
+ */
384
+ | 'any'
385
+ /**
386
+ * Unknown value.
387
+ */
388
+ | 'unknown'
389
+ /**
390
+ * No value (`void`).
391
+ */
392
+ | 'void'
393
+ /**
394
+ * Never value.
395
+ */
396
+ | 'never'
397
+ /**
398
+ * Object value.
399
+ */
400
+ | 'object'
401
+ /**
402
+ * Array value.
403
+ */
404
+ | 'array'
405
+ /**
406
+ * Date value.
407
+ */
408
+ | 'date';
409
+ /**
410
+ * Composite schema types.
411
+ */
412
+ type ComplexSchemaType = 'tuple' | 'union' | 'intersection' | 'enum';
413
+ /**
414
+ * Schema types that need special handling in generators.
415
+ */
416
+ type SpecialSchemaType = 'ref' | 'datetime' | 'time' | 'uuid' | 'email' | 'url' | 'blob';
417
+ /**
418
+ * All schema type strings.
419
+ */
420
+ type SchemaType = PrimitiveSchemaType | ComplexSchemaType | SpecialSchemaType;
421
+ /**
422
+ * Scalar schema types without extra object/array/ref structure.
423
+ */
424
+ type ScalarSchemaType = Exclude<SchemaType, 'object' | 'array' | 'tuple' | 'union' | 'intersection' | 'enum' | 'ref' | 'datetime' | 'date' | 'time' | 'string' | 'number' | 'integer' | 'bigint' | 'url'>;
425
+ /**
426
+ * Fields shared by all schema nodes.
427
+ */
428
+ type SchemaNodeBase = BaseNode & {
429
+ /**
430
+ * Node kind.
431
+ */
432
+ kind: 'Schema';
433
+ /**
434
+ * Schema name for named definitions (for example, `"Pet"`).
435
+ * Inline schemas omit this field.
436
+ */
437
+ name?: string;
438
+ /**
439
+ * Short schema title.
440
+ */
441
+ title?: string;
442
+ /**
443
+ * Schema description text.
444
+ */
445
+ description?: string;
446
+ /**
447
+ * Whether `null` is allowed.
448
+ */
449
+ nullable?: boolean;
450
+ /**
451
+ * Whether the field is optional.
452
+ */
453
+ optional?: boolean;
454
+ /**
455
+ * Both optional and nullable (`optional` + `nullable`).
456
+ */
457
+ nullish?: boolean;
458
+ /**
459
+ * Whether the schema is deprecated.
460
+ */
461
+ deprecated?: boolean;
462
+ /**
463
+ * Whether the schema is read-only.
464
+ */
465
+ readOnly?: boolean;
466
+ /**
467
+ * Whether the schema is write-only.
468
+ */
469
+ writeOnly?: boolean;
470
+ /**
471
+ * Default value.
472
+ */
473
+ default?: unknown;
474
+ /**
475
+ * Example value.
476
+ */
477
+ example?: unknown;
478
+ /**
479
+ * Base primitive type.
480
+ * For example, this is `'string'` for a `uuid` schema.
481
+ */
482
+ primitive?: PrimitiveSchemaType;
483
+ };
484
+ /**
485
+ * Object schema with ordered properties.
486
+ *
487
+ * @example
488
+ * ```ts
489
+ * const objectSchema: ObjectSchemaNode = {
490
+ * kind: 'Schema',
491
+ * type: 'object',
492
+ * properties: [],
493
+ * }
494
+ * ```
495
+ */
496
+ type ObjectSchemaNode = SchemaNodeBase & {
497
+ /**
498
+ * Schema type discriminator.
499
+ */
500
+ type: 'object';
501
+ /**
502
+ * Ordered object properties.
503
+ */
504
+ properties: Array<PropertyNode>;
505
+ /**
506
+ * Additional object properties behavior:
507
+ * - `true`: allow any value
508
+ * - `SchemaNode`: allow values that match that schema
509
+ * - `undefined`: no additional properties
510
+ */
511
+ additionalProperties?: SchemaNode | true;
512
+ /**
513
+ * Pattern-based property schemas.
514
+ */
515
+ patternProperties?: Record<string, SchemaNode>;
516
+ };
517
+ /**
518
+ * Array-like schema (`array` or `tuple`).
519
+ *
520
+ * @example
521
+ * ```ts
522
+ * const arraySchema: ArraySchemaNode = {
523
+ * kind: 'Schema',
524
+ * type: 'array',
525
+ * items: [],
526
+ * }
527
+ * ```
528
+ */
529
+ type ArraySchemaNode = SchemaNodeBase & {
530
+ /**
531
+ * Schema type discriminator (`array` or `tuple`).
532
+ */
533
+ type: 'array' | 'tuple';
534
+ /**
535
+ * Item schemas.
536
+ */
537
+ items?: Array<SchemaNode>;
538
+ /**
539
+ * Tuple rest-item schema for elements beyond positional `items`.
540
+ */
541
+ rest?: SchemaNode;
542
+ /**
543
+ * Minimum item count (or tuple length).
544
+ */
545
+ min?: number;
546
+ /**
547
+ * Maximum item count (or tuple length).
548
+ */
549
+ max?: number;
550
+ /**
551
+ * Whether all items must be unique.
552
+ */
553
+ unique?: boolean;
554
+ };
555
+ /**
556
+ * Shared shape for union and intersection schemas.
557
+ */
558
+ type CompositeSchemaNodeBase = SchemaNodeBase & {
559
+ /**
560
+ * Member schemas.
561
+ */
562
+ members?: Array<SchemaNode>;
563
+ };
564
+ /**
565
+ * Union schema, often from `oneOf` or `anyOf`.
566
+ *
567
+ * @example
568
+ * ```ts
569
+ * const unionSchema: UnionSchemaNode = {
570
+ * kind: 'Schema',
571
+ * type: 'union',
572
+ * members: [],
573
+ * }
574
+ * ```
575
+ */
576
+ type UnionSchemaNode = CompositeSchemaNodeBase & {
577
+ /**
578
+ * Schema type discriminator.
579
+ */
580
+ type: 'union';
581
+ /**
582
+ * Discriminator property name from OpenAPI `discriminator.propertyName`.
583
+ */
584
+ discriminatorPropertyName?: string;
585
+ };
586
+ /**
587
+ * Intersection schema, often from `allOf`.
588
+ *
589
+ * @example
590
+ * ```ts
591
+ * const intersectionSchema: IntersectionSchemaNode = {
592
+ * kind: 'Schema',
593
+ * type: 'intersection',
594
+ * members: [],
595
+ * }
596
+ * ```
597
+ */
598
+ type IntersectionSchemaNode = CompositeSchemaNodeBase & {
599
+ /**
600
+ * Schema type discriminator.
601
+ */
602
+ type: 'intersection';
603
+ };
604
+ /**
605
+ * One named enum item.
606
+ */
607
+ type EnumValueNode = {
608
+ /**
609
+ * Enum item name.
610
+ */
611
+ name: string;
612
+ /**
613
+ * Enum item value.
614
+ */
615
+ value: string | number | boolean;
616
+ /**
617
+ * Primitive type of the enum value.
618
+ */
619
+ primitive: Extract<PrimitiveSchemaType, 'string' | 'number' | 'boolean'>;
620
+ };
621
+ /**
622
+ * Enum schema node.
623
+ *
624
+ * @example
625
+ * ```ts
626
+ * const enumSchema: EnumSchemaNode = {
627
+ * kind: 'Schema',
628
+ * type: 'enum',
629
+ * enumValues: ['a', 'b'],
630
+ * }
631
+ * ```
632
+ */
633
+ type EnumSchemaNode = SchemaNodeBase & {
634
+ /**
635
+ * Schema type discriminator.
636
+ */
637
+ type: 'enum';
638
+ /**
639
+ * Enum values in simple form.
640
+ */
641
+ enumValues?: Array<string | number | boolean | null>;
642
+ /**
643
+ * Enum values in named form.
644
+ * If present, this is used instead of `enumValues`.
645
+ */
646
+ namedEnumValues?: Array<EnumValueNode>;
647
+ };
648
+ /**
649
+ * Reference schema that points to another schema definition.
650
+ *
651
+ * @example
652
+ * ```ts
653
+ * const refSchema: RefSchemaNode = {
654
+ * kind: 'Schema',
655
+ * type: 'ref',
656
+ * ref: '#/components/schemas/Pet',
657
+ * }
658
+ * ```
659
+ */
660
+ type RefSchemaNode = SchemaNodeBase & {
661
+ /**
662
+ * Schema type discriminator.
663
+ */
664
+ type: 'ref';
665
+ /**
666
+ * Referenced schema name.
667
+ */
668
+ name?: string;
669
+ /**
670
+ * Original `$ref` path, for example, `#/components/schemas/Order`.
671
+ * Used to resolve names later.
672
+ */
673
+ ref?: string;
674
+ /**
675
+ * Pattern copied from a sibling `pattern` field.
676
+ */
677
+ pattern?: string;
678
+ };
679
+ /**
680
+ * Datetime schema.
681
+ *
682
+ * @example
683
+ * ```ts
684
+ * const datetimeSchema: DatetimeSchemaNode = { kind: 'Schema', type: 'datetime' }
685
+ * ```
686
+ */
687
+ type DatetimeSchemaNode = SchemaNodeBase & {
688
+ /**
689
+ * Schema type discriminator.
690
+ */
691
+ type: 'datetime';
692
+ /**
693
+ * Whether the datetime includes a timezone offset (`dateType: 'stringOffset'`).
694
+ */
695
+ offset?: boolean;
696
+ /**
697
+ * Whether the datetime is local (no timezone, `dateType: 'stringLocal'`).
698
+ */
699
+ local?: boolean;
700
+ };
701
+ /**
702
+ * Shared base for `date` and `time` schemas.
703
+ */
704
+ type TemporalSchemaNodeBase<T extends 'date' | 'time'> = SchemaNodeBase & {
705
+ /**
706
+ * Schema type discriminator.
707
+ */
708
+ type: T;
709
+ /**
710
+ * Output representation in generated code.
711
+ */
712
+ representation: 'date' | 'string';
713
+ };
714
+ /**
715
+ * Date schema node.
716
+ *
717
+ * @example
718
+ * ```ts
719
+ * const dateSchema: DateSchemaNode = { kind: 'Schema', type: 'date', representation: 'string' }
720
+ * ```
721
+ */
722
+ type DateSchemaNode = TemporalSchemaNodeBase<'date'>;
723
+ /**
724
+ * Time schema node.
725
+ *
726
+ * @example
727
+ * ```ts
728
+ * const timeSchema: TimeSchemaNode = { kind: 'Schema', type: 'time', representation: 'string' }
729
+ * ```
730
+ */
731
+ type TimeSchemaNode = TemporalSchemaNodeBase<'time'>;
732
+ /**
733
+ * String schema node.
734
+ *
735
+ * @example
736
+ * ```ts
737
+ * const stringSchema: StringSchemaNode = { kind: 'Schema', type: 'string' }
738
+ * ```
739
+ */
740
+ type StringSchemaNode = SchemaNodeBase & {
741
+ /**
742
+ * Schema type discriminator.
743
+ */
744
+ type: 'string';
745
+ /**
746
+ * Minimum string length.
747
+ */
748
+ min?: number;
749
+ /**
750
+ * Maximum string length.
751
+ */
752
+ max?: number;
753
+ /**
754
+ * Regex pattern.
755
+ */
756
+ pattern?: string;
757
+ };
758
+ /**
759
+ * Numeric schema (`number`, `integer`, or `bigint`).
760
+ *
761
+ * @example
762
+ * ```ts
763
+ * const numberSchema: NumberSchemaNode = { kind: 'Schema', type: 'number' }
764
+ * ```
765
+ */
766
+ type NumberSchemaNode = SchemaNodeBase & {
767
+ /**
768
+ * Schema type discriminator.
769
+ */
770
+ type: 'number' | 'integer' | 'bigint';
771
+ /**
772
+ * Minimum value.
773
+ */
774
+ min?: number;
775
+ /**
776
+ * Maximum value.
777
+ */
778
+ max?: number;
779
+ /**
780
+ * Exclusive minimum value.
781
+ */
782
+ exclusiveMinimum?: number;
783
+ /**
784
+ * Exclusive maximum value.
785
+ */
786
+ exclusiveMaximum?: number;
787
+ };
788
+ /**
789
+ * Scalar schema with no extra constraints.
790
+ *
791
+ * @example
792
+ * ```ts
793
+ * const anySchema: ScalarSchemaNode = { kind: 'Schema', type: 'any' }
794
+ * ```
795
+ */
796
+ type ScalarSchemaNode = SchemaNodeBase & {
797
+ /**
798
+ * Schema type discriminator.
799
+ */
800
+ type: ScalarSchemaType;
801
+ };
802
+ /**
803
+ * URL schema node.
804
+ * Can include an Express-style path template for template literal types.
805
+ *
806
+ * @example
807
+ * ```ts
808
+ * const urlSchema: UrlSchemaNode = { kind: 'Schema', type: 'url', path: '/pets/:petId' }
809
+ * ```
810
+ */
811
+ type UrlSchemaNode = SchemaNodeBase & {
812
+ /**
813
+ * Schema type discriminator.
814
+ */
815
+ type: 'url';
816
+ /**
817
+ * Express-style path template, for example, `'/pets/:petId'`.
818
+ */
819
+ path?: string;
820
+ };
821
+ /**
822
+ * Mapping from schema type literals to concrete schema node types.
823
+ * Used by `narrowSchema`.
824
+ */
825
+ type SchemaNodeByType = {
826
+ object: ObjectSchemaNode;
827
+ array: ArraySchemaNode;
828
+ tuple: ArraySchemaNode;
829
+ union: UnionSchemaNode;
830
+ intersection: IntersectionSchemaNode;
831
+ enum: EnumSchemaNode;
832
+ ref: RefSchemaNode;
833
+ datetime: DatetimeSchemaNode;
834
+ date: DateSchemaNode;
835
+ time: TimeSchemaNode;
836
+ string: StringSchemaNode;
837
+ number: NumberSchemaNode;
838
+ integer: NumberSchemaNode;
839
+ bigint: NumberSchemaNode;
840
+ boolean: ScalarSchemaNode;
841
+ null: ScalarSchemaNode;
842
+ any: ScalarSchemaNode;
843
+ unknown: ScalarSchemaNode;
844
+ void: ScalarSchemaNode;
845
+ never: ScalarSchemaNode;
846
+ uuid: ScalarSchemaNode;
847
+ email: ScalarSchemaNode;
848
+ url: UrlSchemaNode;
849
+ blob: ScalarSchemaNode;
850
+ };
851
+ /**
852
+ * Union of all schema node types.
853
+ */
854
+ type SchemaNode = ObjectSchemaNode | ArraySchemaNode | UnionSchemaNode | IntersectionSchemaNode | EnumSchemaNode | RefSchemaNode | DatetimeSchemaNode | DateSchemaNode | TimeSchemaNode | StringSchemaNode | NumberSchemaNode | UrlSchemaNode | ScalarSchemaNode;
855
+ //#endregion
856
+ //#region src/nodes/parameter.d.ts
857
+ type ParameterLocation = 'path' | 'query' | 'header' | 'cookie';
858
+ /**
859
+ * AST node representing one operation parameter.
860
+ *
861
+ * @example
862
+ * ```ts
863
+ * const param: ParameterNode = {
864
+ * kind: 'Parameter',
865
+ * name: 'petId',
866
+ * in: 'path',
867
+ * schema: createSchema({ type: 'string' }),
868
+ * required: true,
869
+ * }
870
+ * ```
871
+ */
872
+ type ParameterNode = BaseNode & {
873
+ /**
874
+ * Node kind.
875
+ */
876
+ kind: 'Parameter';
877
+ /**
878
+ * Parameter name.
879
+ */
880
+ name: string;
881
+ /**
882
+ * Parameter location (`path`, `query`, `header`, or `cookie`).
883
+ */
884
+ in: ParameterLocation;
885
+ /**
886
+ * Parameter schema.
887
+ */
888
+ schema: SchemaNode;
889
+ /**
890
+ * Whether the parameter is required.
891
+ */
892
+ required: boolean;
893
+ };
894
+ //#endregion
895
+ //#region src/nodes/http.d.ts
896
+ /**
897
+ * All supported HTTP status code literals as strings, as used in API specs
898
+ * (for example, `"200"` and `"404"`).
899
+ */
900
+ type HttpStatusCode = '100' | '101' | '102' | '103' | '200' | '201' | '202' | '203' | '204' | '205' | '206' | '207' | '208' | '226' | '300' | '301' | '302' | '303' | '304' | '305' | '307' | '308' | '400' | '401' | '402' | '403' | '404' | '405' | '406' | '407' | '408' | '409' | '410' | '411' | '412' | '413' | '414' | '415' | '416' | '417' | '418' | '421' | '422' | '423' | '424' | '425' | '426' | '428' | '429' | '431' | '451' | '500' | '501' | '502' | '503' | '504' | '505' | '506' | '507' | '508' | '510' | '511';
901
+ /**
902
+ * Response status code literal used by operations.
903
+ *
904
+ * Includes specific HTTP status code strings and `"default"` for catch-all responses.
905
+ *
906
+ * @example
907
+ * ```ts
908
+ * const status: StatusCode = '200'
909
+ * const fallback: StatusCode = 'default'
910
+ * ```
911
+ */
912
+ type StatusCode = HttpStatusCode | 'default';
913
+ /**
914
+ * Supported media type strings used in request and response bodies.
915
+ *
916
+ * @example
917
+ * ```ts
918
+ * const mediaType: MediaType = 'application/json'
919
+ * ```
920
+ */
921
+ type MediaType = 'application/json' | 'application/xml' | 'application/x-www-form-urlencoded' | 'application/octet-stream' | 'application/pdf' | 'application/zip' | 'application/graphql' | 'multipart/form-data' | 'text/plain' | 'text/html' | 'text/csv' | 'text/xml' | 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'image/svg+xml' | 'audio/mpeg' | 'video/mp4';
922
+ //#endregion
923
+ //#region src/nodes/response.d.ts
924
+ /**
925
+ * AST node representing one operation response variant.
926
+ *
927
+ * @example
928
+ * ```ts
929
+ * const response: ResponseNode = {
930
+ * kind: 'Response',
931
+ * statusCode: '200',
932
+ * schema: createSchema({ type: 'string' }),
933
+ * }
934
+ * ```
935
+ */
936
+ type ResponseNode = BaseNode & {
937
+ /**
938
+ * Node kind.
939
+ */
940
+ kind: 'Response';
941
+ /**
942
+ * HTTP status code or `'default'` for a fallback response.
943
+ */
944
+ statusCode: StatusCode;
945
+ /**
946
+ * Optional response description.
947
+ */
948
+ description?: string;
949
+ /**
950
+ * Response body schema.
951
+ */
952
+ schema: SchemaNode;
953
+ /**
954
+ * Response media type.
955
+ */
956
+ mediaType?: MediaType;
957
+ /**
958
+ * Property keys to exclude from the generated type via `Omit<Type, Keys>`.
959
+ * Set when a referenced schema has `writeOnly` fields that should not appear in response types.
960
+ */
961
+ keysToOmit?: Array<string>;
962
+ };
963
+ //#endregion
964
+ //#region src/nodes/operation.d.ts
965
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE';
966
+ /**
967
+ * AST node representing one API operation.
968
+ *
969
+ * @example
970
+ * ```ts
971
+ * const operation: OperationNode = {
972
+ * kind: 'Operation',
973
+ * operationId: 'listPets',
974
+ * method: 'GET',
975
+ * path: '/pets',
976
+ * tags: [],
977
+ * parameters: [],
978
+ * responses: [],
979
+ * }
980
+ * ```
981
+ */
982
+ type OperationNode = BaseNode & {
983
+ /**
984
+ * Node kind.
985
+ */
986
+ kind: 'Operation';
987
+ /**
988
+ * Operation identifier, usually from OpenAPI `operationId`.
989
+ */
990
+ operationId: string;
991
+ /**
992
+ * HTTP Method like 'GET'
993
+ */
994
+ method: HttpMethod;
995
+ /**
996
+ * Express-style path string, for example `/pets/:petId`.
997
+ * OpenAPI `{param}` parts are converted to `:param`.
998
+ */
999
+ path: string;
1000
+ /**
1001
+ * Group labels for the operation.
1002
+ * Usually copied from OpenAPI `tags`.
1003
+ */
1004
+ tags: Array<string>;
1005
+ /**
1006
+ * Short one-line operation summary.
1007
+ */
1008
+ summary?: string;
1009
+ /**
1010
+ * Full operation description.
1011
+ */
1012
+ description?: string;
1013
+ /**
1014
+ * Marks the operation as deprecated.
1015
+ */
1016
+ deprecated?: boolean;
1017
+ /**
1018
+ * Parameters that could be used, we have QueryParams, PathParams, HeaderParams and CookieParams
1019
+ */
1020
+ parameters: Array<ParameterNode>;
1021
+ /**
1022
+ * Request body metadata for the operation.
1023
+ */
1024
+ requestBody?: {
1025
+ /**
1026
+ * Human-readable request body description.
1027
+ */
1028
+ description?: string;
1029
+ /**
1030
+ * Request body schema.
1031
+ * For OpenAPI, this is the schema from the first `content` entry.
1032
+ */
1033
+ schema?: SchemaNode;
1034
+ /**
1035
+ * Property keys to exclude from the generated request body type via `Omit<Type, Keys>`.
1036
+ * Set when a referenced schema has `readOnly` fields that should be omitted in request types.
1037
+ */
1038
+ keysToOmit?: Array<string>;
1039
+ };
1040
+ /**
1041
+ * Operation responses.
1042
+ */
1043
+ responses: Array<ResponseNode>;
1044
+ };
1045
+ //#endregion
1046
+ //#region src/nodes/root.d.ts
1047
+ /**
1048
+ * Basic metadata for an API document.
1049
+ * Adapters fill fields that exist in their source format.
1050
+ *
1051
+ * @example
1052
+ * ```ts
1053
+ * const meta: RootMeta = { title: 'Pet API', version: '1.0.0' }
1054
+ * ```
1055
+ */
1056
+ type RootMeta = {
1057
+ /**
1058
+ * API title (from `info.title` in OAS/AsyncAPI).
1059
+ */
1060
+ title?: string;
1061
+ /**
1062
+ * API description (from `info.description` in OAS/AsyncAPI).
1063
+ */
1064
+ description?: string;
1065
+ /**
1066
+ * API version string (from `info.version` in OAS/AsyncAPI).
1067
+ */
1068
+ version?: string;
1069
+ /**
1070
+ * Resolved API base URL.
1071
+ * For OpenAPI and AsyncAPI, this comes from the selected server URL.
1072
+ */
1073
+ baseURL?: string;
1074
+ };
1075
+ /**
1076
+ * Root AST node that contains all schemas and operations for one API document.
1077
+ *
1078
+ * @example
1079
+ * ```ts
1080
+ * const root: RootNode = {
1081
+ * kind: 'Root',
1082
+ * schemas: [],
1083
+ * operations: [],
1084
+ * }
1085
+ * ```
1086
+ */
1087
+ type RootNode = BaseNode & {
1088
+ /**
1089
+ * Node kind.
1090
+ */
1091
+ kind: 'Root';
1092
+ /**
1093
+ * All schema nodes in the document.
1094
+ */
1095
+ schemas: Array<SchemaNode>;
1096
+ /**
1097
+ * All operation nodes in the document.
1098
+ */
1099
+ operations: Array<OperationNode>;
1100
+ /**
1101
+ * Optional document metadata populated by the adapter.
1102
+ */
1103
+ meta?: RootMeta;
1104
+ };
1105
+ //#endregion
1106
+ //#region src/nodes/index.d.ts
1107
+ /**
1108
+ * Union of all AST node types.
1109
+ *
1110
+ * This lets TypeScript narrow types in `switch (node.kind)` blocks.
1111
+ *
1112
+ * @example
1113
+ * ```ts
1114
+ * function getKind(node: Node): string {
1115
+ * switch (node.kind) {
1116
+ * case 'Root':
1117
+ * return 'root'
1118
+ * default:
1119
+ * return 'other'
1120
+ * }
1121
+ * }
1122
+ * ```
1123
+ */
1124
+ type Node = RootNode | OperationNode | SchemaNode | PropertyNode | ParameterNode | ResponseNode | FunctionNode;
1125
+ //#endregion
1126
+ //#region src/infer.d.ts
1127
+ /**
1128
+ * Shared parser options used by OAS-to-AST inference and parser flows.
1129
+ */
1130
+ type ParserOptions = {
1131
+ /**
1132
+ * How `format: 'date-time'` schemas are represented. `false` falls through to a plain string.
1133
+ */
1134
+ dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
1135
+ /**
1136
+ * Whether `type: 'integer'` and `format: 'int64'` produce `number` or `bigint` nodes.
1137
+ */
1138
+ integerType?: 'number' | 'bigint';
1139
+ /**
1140
+ * AST type used when no schema type can be inferred.
1141
+ */
1142
+ unknownType: 'any' | 'unknown' | 'void';
1143
+ /**
1144
+ * AST type used for completely empty schemas (`{}`).
1145
+ */
1146
+ emptySchemaType: 'any' | 'unknown' | 'void';
1147
+ /**
1148
+ * Suffix appended to derived enum names when building property schema names.
1149
+ */
1150
+ enumSuffix: 'enum' | (string & {});
1151
+ };
1152
+ /**
1153
+ * Maps each `dateType` option value to the AST node produced by `format: 'date-time'`.
1154
+ */
1155
+ type DateTimeNodeByDateType = {
1156
+ date: DateSchemaNode;
1157
+ string: DatetimeSchemaNode;
1158
+ stringOffset: DatetimeSchemaNode;
1159
+ stringLocal: DatetimeSchemaNode;
1160
+ false: StringSchemaNode;
1161
+ };
1162
+ /**
1163
+ * Resolves the AST node produced by `format: 'date-time'` based on the `dateType` option.
1164
+ */
1165
+ type ResolveDateTimeNode<TDateType extends ParserOptions['dateType']> = DateTimeNodeByDateType[TDateType extends keyof DateTimeNodeByDateType ? TDateType : 'string'];
1166
+ /**
1167
+ * Ordered list of `[schema-shape, SchemaNode]` pairs.
1168
+ * `InferSchemaNode` walks this tuple in order and returns the first matching node type.
1169
+ */
1170
+ type SchemaNodeMap<TDateType extends ParserOptions['dateType'] = 'string'> = [[{
1171
+ $ref: string;
1172
+ }, RefSchemaNode], [{
1173
+ allOf: ReadonlyArray<unknown>;
1174
+ properties: object;
1175
+ }, IntersectionSchemaNode], [{
1176
+ allOf: readonly [unknown, unknown, ...unknown[]];
1177
+ }, IntersectionSchemaNode], [{
1178
+ allOf: ReadonlyArray<unknown>;
1179
+ }, SchemaNode], [{
1180
+ oneOf: ReadonlyArray<unknown>;
1181
+ }, UnionSchemaNode], [{
1182
+ anyOf: ReadonlyArray<unknown>;
1183
+ }, UnionSchemaNode], [{
1184
+ const: null;
1185
+ }, ScalarSchemaNode], [{
1186
+ const: string | number | boolean;
1187
+ }, EnumSchemaNode], [{
1188
+ type: ReadonlyArray<string>;
1189
+ }, UnionSchemaNode], [{
1190
+ type: 'array';
1191
+ enum: ReadonlyArray<unknown>;
1192
+ }, ArraySchemaNode], [{
1193
+ enum: ReadonlyArray<unknown>;
1194
+ }, EnumSchemaNode], [{
1195
+ type: 'enum';
1196
+ }, EnumSchemaNode], [{
1197
+ type: 'union';
1198
+ }, UnionSchemaNode], [{
1199
+ type: 'intersection';
1200
+ }, IntersectionSchemaNode], [{
1201
+ type: 'tuple';
1202
+ }, ArraySchemaNode], [{
1203
+ type: 'ref';
1204
+ }, RefSchemaNode], [{
1205
+ type: 'datetime';
1206
+ }, DatetimeSchemaNode], [{
1207
+ type: 'date';
1208
+ }, DateSchemaNode], [{
1209
+ type: 'time';
1210
+ }, TimeSchemaNode], [{
1211
+ type: 'url';
1212
+ }, UrlSchemaNode], [{
1213
+ type: 'object';
1214
+ }, ObjectSchemaNode], [{
1215
+ additionalProperties: boolean | {};
1216
+ }, ObjectSchemaNode], [{
1217
+ type: 'array';
1218
+ }, ArraySchemaNode], [{
1219
+ items: object;
1220
+ }, ArraySchemaNode], [{
1221
+ prefixItems: ReadonlyArray<unknown>;
1222
+ }, ArraySchemaNode], [{
1223
+ type: string;
1224
+ format: 'date-time';
1225
+ }, ResolveDateTimeNode<TDateType>], [{
1226
+ type: string;
1227
+ format: 'date';
1228
+ }, DateSchemaNode], [{
1229
+ type: string;
1230
+ format: 'time';
1231
+ }, TimeSchemaNode], [{
1232
+ format: 'date-time';
1233
+ }, ResolveDateTimeNode<TDateType>], [{
1234
+ format: 'date';
1235
+ }, DateSchemaNode], [{
1236
+ format: 'time';
1237
+ }, TimeSchemaNode], [{
1238
+ type: 'string';
1239
+ }, StringSchemaNode], [{
1240
+ type: 'number';
1241
+ }, NumberSchemaNode], [{
1242
+ type: 'integer';
1243
+ }, NumberSchemaNode], [{
1244
+ type: 'bigint';
1245
+ }, NumberSchemaNode], [{
1246
+ type: string;
1247
+ }, ScalarSchemaNode], [{
1248
+ minLength: number;
1249
+ }, StringSchemaNode], [{
1250
+ maxLength: number;
1251
+ }, StringSchemaNode], [{
1252
+ pattern: string;
1253
+ }, StringSchemaNode], [{
1254
+ minimum: number;
1255
+ }, NumberSchemaNode], [{
1256
+ maximum: number;
1257
+ }, NumberSchemaNode]];
1258
+ /**
1259
+ * Infers the matching AST `SchemaNode` type from an input schema shape.
1260
+ */
1261
+ type InferSchemaNode<TSchema extends object, TDateType extends ParserOptions['dateType'] = 'string', TEntries extends ReadonlyArray<[object, SchemaNode]> = SchemaNodeMap<TDateType>> = TEntries extends [infer TEntry extends [object, SchemaNode], ...infer TRest extends ReadonlyArray<[object, SchemaNode]>] ? TSchema extends TEntry[0] ? TEntry[1] : InferSchemaNode<TSchema, TDateType, TRest> : SchemaNode;
1262
+ /**
1263
+ * Backward-compatible alias for `InferSchemaNode`.
1264
+ */
1265
+ type InferSchema<TSchema extends object, TDateType extends ParserOptions['dateType'] = 'string', TEntries extends ReadonlyArray<[object, SchemaNode]> = SchemaNodeMap<TDateType>> = InferSchemaNode<TSchema, TDateType, TEntries>;
1266
+ //#endregion
1267
+ //#region src/factory.d.ts
1268
+ /**
1269
+ * Distributive `Omit` that preserves each member of a union.
1270
+ *
1271
+ * @example
1272
+ * ```ts
1273
+ * type A = { kind: 'a'; keep: string; drop: number }
1274
+ * type B = { kind: 'b'; keep: boolean; drop: number }
1275
+ * type Result = DistributiveOmit<A | B, 'drop'>
1276
+ * // -> { kind: 'a'; keep: string } | { kind: 'b'; keep: boolean }
1277
+ * ```
1278
+ */
1279
+ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
1280
+ type CreateSchemaObjectInput = Omit<ObjectSchemaNode, 'kind' | 'properties'> & {
1281
+ properties?: Array<PropertyNode>;
1282
+ };
1283
+ type CreateSchemaInput = CreateSchemaObjectInput | DistributiveOmit<Exclude<SchemaNode, ObjectSchemaNode>, 'kind'>;
1284
+ type CreateSchemaOutput<T extends CreateSchemaInput> = InferSchemaNode<T> & {
1285
+ kind: 'Schema';
1286
+ };
1287
+ /**
1288
+ * Creates a `RootNode` with stable defaults for `schemas` and `operations`.
1289
+ *
1290
+ * @example
1291
+ * ```ts
1292
+ * const root = createRoot()
1293
+ * // { kind: 'Root', schemas: [], operations: [] }
1294
+ * ```
1295
+ *
1296
+ * @example
1297
+ * ```ts
1298
+ * const root = createRoot({ schemas: [petSchema] })
1299
+ * // keeps default operations: []
1300
+ * ```
1301
+ */
1302
+ declare function createRoot(overrides?: Partial<Omit<RootNode, 'kind'>>): RootNode;
1303
+ /**
1304
+ * Creates an `OperationNode` with default empty arrays for `tags`, `parameters`, and `responses`.
1305
+ *
1306
+ * @example
1307
+ * ```ts
1308
+ * const operation = createOperation({
1309
+ * operationId: 'getPetById',
1310
+ * method: 'GET',
1311
+ * path: '/pet/{petId}',
1312
+ * })
1313
+ * // tags, parameters, and responses are []
1314
+ * ```
1315
+ *
1316
+ * @example
1317
+ * ```ts
1318
+ * const operation = createOperation({
1319
+ * operationId: 'findPets',
1320
+ * method: 'GET',
1321
+ * path: '/pet/findByStatus',
1322
+ * tags: ['pet'],
1323
+ * })
1324
+ * ```
1325
+ */
1326
+ declare function createOperation(props: Pick<OperationNode, 'operationId' | 'method' | 'path'> & Partial<Omit<OperationNode, 'kind' | 'operationId' | 'method' | 'path'>>): OperationNode;
1327
+ /**
1328
+ * Creates a `SchemaNode`, narrowed to the variant of `props.type`.
1329
+ * For object schemas, `properties` defaults to an empty array.
1330
+ *
1331
+ * @example
1332
+ * ```ts
1333
+ * const scalar = createSchema({ type: 'string' })
1334
+ * // { kind: 'Schema', type: 'string' }
1335
+ * ```
1336
+ *
1337
+ * @example
1338
+ * ```ts
1339
+ * const object = createSchema({ type: 'object' })
1340
+ * // { kind: 'Schema', type: 'object', properties: [] }
1341
+ * ```
1342
+ *
1343
+ * @example
1344
+ * ```ts
1345
+ * const enumSchema = createSchema({
1346
+ * type: 'enum',
1347
+ * primitive: 'string',
1348
+ * enumValues: ['available', 'pending'],
1349
+ * })
1350
+ * ```
1351
+ */
1352
+ declare function createSchema<T extends CreateSchemaInput>(props: T): CreateSchemaOutput<T>;
1353
+ declare function createSchema(props: CreateSchemaInput): SchemaNode;
1354
+ /**
1355
+ * Creates a `PropertyNode`.
1356
+ *
1357
+ * `required` defaults to `false`.
1358
+ * `schema.optional` and `schema.nullish` are derived from `required` and `schema.nullable`.
1359
+ *
1360
+ * @example
1361
+ * ```ts
1362
+ * const property = createProperty({
1363
+ * name: 'status',
1364
+ * schema: createSchema({ type: 'string' }),
1365
+ * })
1366
+ * // required=false, schema.optional=true
1367
+ * ```
1368
+ *
1369
+ * @example
1370
+ * ```ts
1371
+ * const property = createProperty({
1372
+ * name: 'status',
1373
+ * required: true,
1374
+ * schema: createSchema({ type: 'string', nullable: true }),
1375
+ * })
1376
+ * // required=true, no optional/nullish
1377
+ * ```
1378
+ */
1379
+ declare function createProperty(props: Pick<PropertyNode, 'name' | 'schema'> & Partial<Omit<PropertyNode, 'kind' | 'name' | 'schema'>>): PropertyNode;
1380
+ /**
1381
+ * Creates a `ParameterNode`.
1382
+ *
1383
+ * `required` defaults to `false`.
1384
+ * Nested schema flags are set from `required` and `schema.nullable`.
1385
+ *
1386
+ * @example
1387
+ * ```ts
1388
+ * const param = createParameter({
1389
+ * name: 'petId',
1390
+ * in: 'path',
1391
+ * required: true,
1392
+ * schema: createSchema({ type: 'string' }),
1393
+ * })
1394
+ * ```
1395
+ *
1396
+ * @example
1397
+ * ```ts
1398
+ * const param = createParameter({
1399
+ * name: 'status',
1400
+ * in: 'query',
1401
+ * schema: createSchema({ type: 'string', nullable: true }),
1402
+ * })
1403
+ * // required=false, schema.nullish=true
1404
+ * ```
1405
+ */
1406
+ declare function createParameter(props: Pick<ParameterNode, 'name' | 'in' | 'schema'> & Partial<Omit<ParameterNode, 'kind' | 'name' | 'in' | 'schema'>>): ParameterNode;
1407
+ /**
1408
+ * Creates a `ResponseNode`.
1409
+ *
1410
+ * @example
1411
+ * ```ts
1412
+ * const response = createResponse({
1413
+ * statusCode: '200',
1414
+ * description: 'Success',
1415
+ * schema: createSchema({ type: 'object', properties: [] }),
1416
+ * })
1417
+ * ```
1418
+ */
1419
+ declare function createResponse(props: Pick<ResponseNode, 'statusCode' | 'schema'> & Partial<Omit<ResponseNode, 'kind' | 'statusCode' | 'schema'>>): ResponseNode;
1420
+ /**
1421
+ * Creates a single-property object schema used as a discriminator literal.
1422
+ *
1423
+ * @example
1424
+ * ```ts
1425
+ * createDiscriminantNode({ propertyName: 'type', value: 'dog' })
1426
+ * // -> { type: 'object', properties: [{ name: 'type', required: true, schema: enum('dog') }] }
1427
+ * ```
1428
+ */
1429
+ declare function createDiscriminantNode({
1430
+ propertyName,
1431
+ value
1432
+ }: {
1433
+ propertyName: string;
1434
+ value: string;
1435
+ }): SchemaNode;
1436
+ /**
1437
+ * Creates a `FunctionParameterNode`.
1438
+ *
1439
+ * `optional` defaults to `false`.
1440
+ *
1441
+ * @example Required typed param
1442
+ * ```ts
1443
+ * createFunctionParameter({ name: 'petId', type: 'string' })
1444
+ * // → petId: string
1445
+ * ```
1446
+ *
1447
+ * @example Optional param
1448
+ * ```ts
1449
+ * createFunctionParameter({ name: 'params', type: 'QueryParams', optional: true })
1450
+ * // → params?: QueryParams
1451
+ * ```
1452
+ *
1453
+ * @example Param with default (implicitly optional; cannot combine with `optional: true`)
1454
+ * ```ts
1455
+ * createFunctionParameter({ name: 'config', type: 'RequestConfig', default: '{}' })
1456
+ * // → config: RequestConfig = {}
1457
+ * ```
1458
+ */
1459
+ declare function createFunctionParameter(props: {
1460
+ name: string;
1461
+ type?: string;
1462
+ rest?: boolean;
1463
+ } & ({
1464
+ optional: true;
1465
+ default?: never;
1466
+ } | {
1467
+ optional?: false;
1468
+ default?: string;
1469
+ })): FunctionParameterNode;
1470
+ /**
1471
+ * Creates an `ObjectBindingParameterNode` for object-destructured parameter groups.
1472
+ *
1473
+ * @example Destructured object param
1474
+ * ```ts
1475
+ * createObjectBindingParameter({
1476
+ * properties: [
1477
+ * createFunctionParameter({ name: 'id', type: 'string', optional: false }),
1478
+ * createFunctionParameter({ name: 'name', type: 'string', optional: true }),
1479
+ * ],
1480
+ * default: '{}',
1481
+ * })
1482
+ * // declaration → { id, name? }: { id: string; name?: string } = {}
1483
+ * // call → { id, name }
1484
+ * ```
1485
+ *
1486
+ * @example Inline mode — children emitted as individual top-level parameters
1487
+ * ```ts
1488
+ * createObjectBindingParameter({
1489
+ * properties: [createFunctionParameter({ name: 'petId', type: 'string', optional: false })],
1490
+ * inline: true,
1491
+ * })
1492
+ * // declaration → petId: string
1493
+ * // call → petId
1494
+ * ```
1495
+ */
1496
+ declare function createObjectBindingParameter(props: Pick<ObjectBindingParameterNode, 'properties'> & Partial<Omit<ObjectBindingParameterNode, 'kind' | 'properties'>>): ObjectBindingParameterNode;
1497
+ /**
1498
+ * Creates a `FunctionParametersNode` from an ordered list of parameters.
1499
+ *
1500
+ * @example
1501
+ * ```ts
1502
+ * createFunctionParameters({
1503
+ * params: [
1504
+ * createFunctionParameter({ name: 'petId', type: 'string', optional: false }),
1505
+ * createFunctionParameter({ name: 'config', type: 'RequestConfig', optional: false, default: '{}' }),
1506
+ * ],
1507
+ * })
1508
+ * ```
1509
+ *
1510
+ * @example
1511
+ * ```ts
1512
+ * const empty = createFunctionParameters()
1513
+ * // { kind: 'FunctionParameters', params: [] }
1514
+ * ```
1515
+ */
1516
+ declare function createFunctionParameters(props?: Partial<Omit<FunctionParametersNode, 'kind'>>): FunctionParametersNode;
1517
+ //#endregion
1518
+ //#region src/printers/printer.d.ts
1519
+ /**
1520
+ * Runtime context passed as `this` to printer handlers.
1521
+ *
1522
+ * `this.print` always dispatches to node-level handlers from `nodes`.
1523
+ *
1524
+ * @example
1525
+ * ```ts
1526
+ * const context: PrinterHandlerContext<string, {}> = {
1527
+ * options: {},
1528
+ * print: () => 'value',
1529
+ * }
1530
+ * ```
1531
+ */
1532
+ type PrinterHandlerContext<TOutput, TOptions extends object> = {
1533
+ /**
1534
+ * Recursively print a nested `SchemaNode` using the node-level handlers.
1535
+ */
1536
+ print: (node: SchemaNode) => TOutput | null | undefined;
1537
+ /**
1538
+ * Options for this printer instance.
1539
+ */
1540
+ options: TOptions;
1541
+ };
1542
+ /**
1543
+ * Handler for one schema node type.
1544
+ *
1545
+ * Use a regular function (not an arrow function) if you need `this`.
1546
+ *
1547
+ * @example
1548
+ * ```ts
1549
+ * const handler: PrinterHandler<string, {}, 'string'> = function () {
1550
+ * return 'string'
1551
+ * }
1552
+ * ```
1553
+ */
1554
+ type PrinterHandler<TOutput, TOptions extends object, T extends SchemaType = SchemaType> = (this: PrinterHandlerContext<TOutput, TOptions>, node: SchemaNodeByType[T]) => TOutput | null | undefined;
1555
+ /**
1556
+ * Generic shape used by `definePrinter`.
1557
+ *
1558
+ * - `TName` — unique string identifier (e.g. `'zod'`, `'ts'`)
1559
+ * - `TOptions` — options passed to and stored on the printer instance
1560
+ * - `TOutput` — the type emitted by node handlers
1561
+ * - `TPrintOutput` — type returned by public `print` (defaults to `TOutput`)
1562
+ *
1563
+ * @example
1564
+ * ```ts
1565
+ * type MyPrinter = PrinterFactoryOptions<'my', { strict: boolean }, string>
1566
+ * ```
1567
+ */
1568
+ type PrinterFactoryOptions<TName extends string = string, TOptions extends object = object, TOutput = unknown, TPrintOutput = TOutput> = {
1569
+ name: TName;
1570
+ options: TOptions;
1571
+ output: TOutput;
1572
+ printOutput: TPrintOutput;
1573
+ };
1574
+ /**
1575
+ * Printer instance returned by a printer factory.
1576
+ *
1577
+ * @example
1578
+ * ```ts
1579
+ * const printer = definePrinter((options: {}) => ({ name: 'x', options, nodes: {} }))({})
1580
+ * ```
1581
+ */
1582
+ type Printer<T extends PrinterFactoryOptions = PrinterFactoryOptions> = {
1583
+ /**
1584
+ * Unique identifier supplied at creation time.
1585
+ */
1586
+ name: T['name'];
1587
+ /**
1588
+ * Options for this printer instance.
1589
+ */
1590
+ options: T['options'];
1591
+ /**
1592
+ * Public printer. If the builder provides a root-level `print`, this calls that
1593
+ * higher-level function (which may produce full declarations).
1594
+ * Otherwise, falls back to the node-level dispatcher.
1595
+ */
1596
+ print: (node: SchemaNode) => T['printOutput'] | null | undefined;
1597
+ };
1598
+ /**
1599
+ * Builder function passed to `definePrinter`.
1600
+ *
1601
+ * It receives resolved options and returns:
1602
+ * - `name`
1603
+ * - `options`
1604
+ * - `nodes` handlers
1605
+ * - optional top-level `print` override
1606
+ *
1607
+ * @example
1608
+ * ```ts
1609
+ * const build = (options: {}) => ({ name: 'x' as const, options, nodes: {} })
1610
+ * ```
1611
+ */
1612
+ type PrinterBuilder<T extends PrinterFactoryOptions> = (options: T['options']) => {
1613
+ name: T['name'];
1614
+ /**
1615
+ * Options to store on the printer.
1616
+ */
1617
+ options: T['options'];
1618
+ nodes: Partial<{ [K in SchemaType]: PrinterHandler<T['output'], T['options'], K> }>;
1619
+ /**
1620
+ * Optional root-level print override. When provided, becomes the public `printer.print`.
1621
+ * `this.print(node)` inside this function calls the node-level dispatcher (`nodes` handlers),
1622
+ * not the override itself — so recursion is safe.
1623
+ */
1624
+ print?: (this: PrinterHandlerContext<T['output'], T['options']>, node: SchemaNode) => T['printOutput'] | null | undefined;
1625
+ };
1626
+ /**
1627
+ * Creates a schema printer factory.
1628
+ *
1629
+ * This function wraps a builder and makes options optional at call sites.
1630
+ *
1631
+ * The builder receives resolved options and returns:
1632
+ * - `name` — a unique identifier for the printer
1633
+ * - `options` — options stored on the returned printer instance
1634
+ * - `nodes` — a map of `SchemaType` → handler functions that convert a `SchemaNode` to `TOutput`
1635
+ * - `print` _(optional)_ — top-level override exposed as `printer.print`
1636
+ * - Inside this function, `this.print(node)` still dispatches to the `nodes` map
1637
+ * - This keeps recursion safe and avoids self-calls
1638
+ *
1639
+ * When no `print` override is provided, `printer.print` is the node-level dispatcher directly.
1640
+ *
1641
+ * @example Basic usage — Zod schema printer
1642
+ * ```ts
1643
+ * type ZodPrinter = PrinterFactoryOptions<'zod', { strict?: boolean }, string>
1644
+ *
1645
+ * export const zodPrinter = definePrinter<ZodPrinter>((options) => ({
1646
+ * name: 'zod',
1647
+ * options: { strict: options.strict ?? true },
1648
+ * nodes: {
1649
+ * string: () => 'z.string()',
1650
+ * object(node) {
1651
+ * const props = node.properties.map(p => `${p.name}: ${this.print(p.schema)}`).join(', ')
1652
+ * return `z.object({ ${props} })`
1653
+ * },
1654
+ * },
1655
+ * }))
1656
+ * ```
1657
+ */
1658
+ declare function definePrinter<T extends PrinterFactoryOptions = PrinterFactoryOptions>(build: PrinterBuilder<T>): (options?: T['options']) => Printer<T>;
1659
+ //#endregion
1660
+ //#region src/refs.d.ts
1661
+ /**
1662
+ * Lookup map from schema name to `SchemaNode`.
1663
+ */
1664
+ type RefMap = Map<string, SchemaNode>;
1665
+ /**
1666
+ * Returns the last path segment of a reference string.
1667
+ *
1668
+ * Example: `#/components/schemas/Pet` becomes `Pet`.
1669
+ *
1670
+ * @example
1671
+ * ```ts
1672
+ * extractRefName('#/components/schemas/Pet') // 'Pet'
1673
+ * ```
1674
+ */
1675
+ declare function extractRefName(ref: string): string;
1676
+ /**
1677
+ * Builds a `RefMap` from `root.schemas` using each schema's `name`.
1678
+ *
1679
+ * Unnamed schemas are skipped.
1680
+ *
1681
+ * @example
1682
+ * ```ts
1683
+ * const refMap = buildRefMap(root)
1684
+ * const pet = refMap.get('Pet')
1685
+ * ```
1686
+ */
1687
+ declare function buildRefMap(root: RootNode): RefMap;
1688
+ /**
1689
+ * Resolves a schema by name from a `RefMap`.
1690
+ *
1691
+ * @example
1692
+ * ```ts
1693
+ * const petSchema = resolveRef(refMap, 'Pet')
1694
+ * ```
1695
+ */
1696
+ declare function resolveRef(refMap: RefMap, ref: string): SchemaNode | undefined;
1697
+ /**
1698
+ * Converts a `RefMap` into a plain object.
1699
+ *
1700
+ * @example
1701
+ * ```ts
1702
+ * const refsObject = refMapToObject(refMap)
1703
+ * ```
1704
+ */
1705
+ declare function refMapToObject(refMap: RefMap): Record<string, SchemaNode>;
1706
+ //#endregion
1707
+ //#region src/visitor.d.ts
1708
+ /**
1709
+ * Ordered mapping of `[NodeType, ParentType]` pairs.
1710
+ *
1711
+ * `ParentOf` uses this map to find parent types.
1712
+ */
1713
+ type ParentNodeMap = [[RootNode, undefined], [OperationNode, RootNode], [SchemaNode, RootNode | OperationNode | SchemaNode | PropertyNode | ParameterNode | ResponseNode], [PropertyNode, SchemaNode], [ParameterNode, OperationNode], [ResponseNode, OperationNode]];
1714
+ /**
1715
+ * Resolves the parent node type for a given AST node type.
1716
+ *
1717
+ * This is used by visitor context so `ctx.parent` is correctly typed
1718
+ * for each callback.
1719
+ *
1720
+ * @example
1721
+ * ```ts
1722
+ * type RootParent = ParentOf<RootNode>
1723
+ * // undefined
1724
+ * ```
1725
+ *
1726
+ * @example
1727
+ * ```ts
1728
+ * type PropertyParent = ParentOf<PropertyNode>
1729
+ * // SchemaNode
1730
+ * ```
1731
+ *
1732
+ * @example
1733
+ * ```ts
1734
+ * type SchemaParent = ParentOf<SchemaNode>
1735
+ * // RootNode | OperationNode | SchemaNode | PropertyNode | ParameterNode | ResponseNode
1736
+ * ```
1737
+ */
1738
+ type ParentOf<T extends Node, TEntries extends ReadonlyArray<[Node, unknown]> = ParentNodeMap> = TEntries extends [infer TEntry extends [Node, unknown], ...infer TRest extends ReadonlyArray<[Node, unknown]>] ? T extends TEntry[0] ? TEntry[1] : ParentOf<T, TRest> : Node;
1739
+ /**
1740
+ * Traversal context passed as the second argument to every visitor callback.
1741
+ * `parent` is typed from the current node type.
1742
+ *
1743
+ * @example
1744
+ * ```ts
1745
+ * const visitor: Visitor = {
1746
+ * schema(node, { parent }) {
1747
+ * // parent type is narrowed by node kind
1748
+ * },
1749
+ * }
1750
+ * ```
1751
+ */
1752
+ type VisitorContext<T extends Node = Node> = {
1753
+ /**
1754
+ * Parent node of the currently visited node.
1755
+ * For `RootNode`, this is `undefined`.
1756
+ */
1757
+ parent?: ParentOf<T>;
1758
+ };
1759
+ /**
1760
+ * Synchronous visitor used by `transform`.
1761
+ *
1762
+ * @example
1763
+ * ```ts
1764
+ * const visitor: Visitor = {
1765
+ * operation(node) {
1766
+ * return { ...node, operationId: `x_${node.operationId}` }
1767
+ * },
1768
+ * }
1769
+ * ```
1770
+ */
1771
+ type Visitor = {
1772
+ root?(node: RootNode, context: VisitorContext<RootNode>): void | RootNode;
1773
+ operation?(node: OperationNode, context: VisitorContext<OperationNode>): void | OperationNode;
1774
+ schema?(node: SchemaNode, context: VisitorContext<SchemaNode>): void | SchemaNode;
1775
+ property?(node: PropertyNode, context: VisitorContext<PropertyNode>): void | PropertyNode;
1776
+ parameter?(node: ParameterNode, context: VisitorContext<ParameterNode>): void | ParameterNode;
1777
+ response?(node: ResponseNode, context: VisitorContext<ResponseNode>): void | ResponseNode;
1778
+ };
1779
+ /**
1780
+ * Utility type for values that can be returned directly or asynchronously.
1781
+ */
1782
+ type MaybePromise<T> = T | Promise<T>;
1783
+ /**
1784
+ * Async visitor for `walk`. Synchronous `Visitor` objects are compatible.
1785
+ *
1786
+ * @example
1787
+ * ```ts
1788
+ * const visitor: AsyncVisitor = {
1789
+ * async operation(node) {
1790
+ * await Promise.resolve(node.operationId)
1791
+ * },
1792
+ * }
1793
+ * ```
1794
+ */
1795
+ type AsyncVisitor = {
1796
+ root?(node: RootNode, context: VisitorContext<RootNode>): MaybePromise<void | RootNode>;
1797
+ operation?(node: OperationNode, context: VisitorContext<OperationNode>): MaybePromise<void | OperationNode>;
1798
+ schema?(node: SchemaNode, context: VisitorContext<SchemaNode>): MaybePromise<void | SchemaNode>;
1799
+ property?(node: PropertyNode, context: VisitorContext<PropertyNode>): MaybePromise<void | PropertyNode>;
1800
+ parameter?(node: ParameterNode, context: VisitorContext<ParameterNode>): MaybePromise<void | ParameterNode>;
1801
+ response?(node: ResponseNode, context: VisitorContext<ResponseNode>): MaybePromise<void | ResponseNode>;
1802
+ };
1803
+ /**
1804
+ * Visitor used by `collect`.
1805
+ *
1806
+ * @example
1807
+ * ```ts
1808
+ * const visitor: CollectVisitor<string> = {
1809
+ * operation(node) {
1810
+ * return node.operationId
1811
+ * },
1812
+ * }
1813
+ * ```
1814
+ */
1815
+ type CollectVisitor<T> = {
1816
+ root?(node: RootNode, context: VisitorContext<RootNode>): T | undefined;
1817
+ operation?(node: OperationNode, context: VisitorContext<OperationNode>): T | undefined;
1818
+ schema?(node: SchemaNode, context: VisitorContext<SchemaNode>): T | undefined;
1819
+ property?(node: PropertyNode, context: VisitorContext<PropertyNode>): T | undefined;
1820
+ parameter?(node: ParameterNode, context: VisitorContext<ParameterNode>): T | undefined;
1821
+ response?(node: ResponseNode, context: VisitorContext<ResponseNode>): T | undefined;
1822
+ };
1823
+ /**
1824
+ * Options for `transform`.
1825
+ *
1826
+ * @example
1827
+ * ```ts
1828
+ * const options: TransformOptions = { depth: 'deep', schema: (node) => node }
1829
+ * ```
1830
+ *
1831
+ * @example
1832
+ * ```ts
1833
+ * // Only transform the current node, not nested children
1834
+ * const options: TransformOptions = { depth: 'shallow', schema: (node) => node }
1835
+ * ```
1836
+ */
1837
+ type TransformOptions = Visitor & {
1838
+ /**
1839
+ * Traversal depth (`'deep'` by default).
1840
+ * @default 'deep'
1841
+ */
1842
+ depth?: VisitorDepth;
1843
+ /**
1844
+ * Internal parent override used during recursion.
1845
+ */
1846
+ parent?: Node;
1847
+ };
1848
+ /**
1849
+ * Options for `walk`.
1850
+ *
1851
+ * @example
1852
+ * ```ts
1853
+ * const options: WalkOptions = { depth: 'deep', concurrency: 10, root: () => {} }
1854
+ * ```
1855
+ */
1856
+ type WalkOptions = AsyncVisitor & {
1857
+ /**
1858
+ * Traversal depth (`'deep'` by default).
1859
+ * @default 'deep'
1860
+ */
1861
+ depth?: VisitorDepth;
1862
+ /**
1863
+ * Maximum number of sibling nodes visited concurrently.
1864
+ * @default 30
1865
+ */
1866
+ concurrency?: number;
1867
+ };
1868
+ /**
1869
+ * Options for `collect`.
1870
+ *
1871
+ * @example
1872
+ * ```ts
1873
+ * const options: CollectOptions<string> = { depth: 'shallow', schema: () => undefined }
1874
+ * ```
1875
+ */
1876
+ type CollectOptions<T> = CollectVisitor<T> & {
1877
+ /**
1878
+ * Traversal depth (`'deep'` by default).
1879
+ * @default 'deep'
1880
+ */
1881
+ depth?: VisitorDepth;
1882
+ /**
1883
+ * Internal parent override used during recursion.
1884
+ */
1885
+ parent?: Node;
1886
+ };
1887
+ /**
1888
+ * Depth-first traversal for side effects. Visitor return values are ignored.
1889
+ * Sibling nodes at each level are visited concurrently up to `options.concurrency`
1890
+ * (default: `WALK_CONCURRENCY`).
1891
+ *
1892
+ * @example
1893
+ * ```ts
1894
+ * await walk(root, {
1895
+ * operation(node) {
1896
+ * console.log(node.operationId)
1897
+ * },
1898
+ * })
1899
+ * ```
1900
+ *
1901
+ * @example
1902
+ * ```ts
1903
+ * // Visit only the current node
1904
+ * await walk(root, { depth: 'shallow', root: () => {} })
1905
+ * ```
1906
+ */
1907
+ declare function walk(node: Node, options: WalkOptions): Promise<void>;
1908
+ /**
1909
+ * Runs a depth-first immutable transform.
1910
+ *
1911
+ * If a visitor returns a node, it replaces the current node.
1912
+ * If it returns `undefined`, the current node stays the same.
1913
+ *
1914
+ * @example
1915
+ * ```ts
1916
+ * const next = transform(root, {
1917
+ * operation(node) {
1918
+ * return { ...node, operationId: `prefixed_${node.operationId}` }
1919
+ * },
1920
+ * })
1921
+ * ```
1922
+ *
1923
+ * @example
1924
+ * ```ts
1925
+ * // Shallow mode: only transform the input node
1926
+ * const next = transform(root, { depth: 'shallow', root: (node) => node })
1927
+ * ```
1928
+ */
1929
+ declare function transform(node: RootNode, options: TransformOptions): RootNode;
1930
+ declare function transform(node: OperationNode, options: TransformOptions): OperationNode;
1931
+ declare function transform(node: SchemaNode, options: TransformOptions): SchemaNode;
1932
+ declare function transform(node: PropertyNode, options: TransformOptions): PropertyNode;
1933
+ declare function transform(node: ParameterNode, options: TransformOptions): ParameterNode;
1934
+ declare function transform(node: ResponseNode, options: TransformOptions): ResponseNode;
1935
+ declare function transform(node: Node, options: TransformOptions): Node;
1936
+ /**
1937
+ * Composes multiple visitors into one visitor, applied left to right.
1938
+ *
1939
+ * For each node kind, output from one visitor is input to the next.
1940
+ * If a visitor returns `undefined`, the previous node value is kept.
1941
+ *
1942
+ * @example
1943
+ * ```ts
1944
+ * const visitor = composeTransformers(
1945
+ * { operation: (node) => ({ ...node, operationId: `a_${node.operationId}` }) },
1946
+ * { operation: (node) => ({ ...node, operationId: `b_${node.operationId}` }) },
1947
+ * )
1948
+ * ```
1949
+ */
1950
+ declare function composeTransformers(...visitors: Array<Visitor>): Visitor;
1951
+ /**
1952
+ * Runs a depth-first synchronous collection pass.
1953
+ *
1954
+ * Non-`undefined` values returned by visitor callbacks are appended to the result.
1955
+ *
1956
+ * @example
1957
+ * ```ts
1958
+ * const ids = collect(root, {
1959
+ * operation(node) {
1960
+ * return node.operationId
1961
+ * },
1962
+ * })
1963
+ * ```
1964
+ *
1965
+ * @example
1966
+ * ```ts
1967
+ * // Collect from only the current node
1968
+ * const values = collect(root, { depth: 'shallow', root: () => 'root' })
1969
+ * ```
1970
+ */
1971
+ declare function collect<T>(node: Node, options: CollectOptions<T>): Array<T>;
1972
+ //#endregion
1973
+ export { NumberSchemaNode as $, createRoot as A, ResponseNode as B, createFunctionParameter as C, httpMethods as Ct, createParameter as D, createOperation as E, schemaTypes as Et, Node as F, ParameterNode as G, MediaType as H, RootMeta as I, DateSchemaNode as J, ArraySchemaNode as K, RootNode as L, InferSchema as M, InferSchemaNode as N, createProperty as O, ParserOptions as P, IntersectionSchemaNode as Q, HttpMethod as R, createDiscriminantNode as S, VisitorDepth as St, createObjectBindingParameter as T, nodeKinds as Tt, StatusCode as U, HttpStatusCode as V, ParameterLocation as W, EnumSchemaNode as X, DatetimeSchemaNode as Y, EnumValueNode as Z, resolveRef as _, FunctionParametersNode as _t, TransformOptions as a, SchemaNode as at, definePrinter as b, NodeKind as bt, WalkOptions as c, SpecialSchemaType as ct, transform as d, UnionSchemaNode as dt, ObjectSchemaNode as et, walk as f, UrlSchemaNode as ft, refMapToObject as g, FunctionParameterNode as gt, extractRefName as h, FunctionNodeType as ht, ParentOf as i, ScalarSchemaType as it, createSchema as j, createResponse as k, collect as l, StringSchemaNode as lt, buildRefMap as m, FunctionNode as mt, CollectOptions as n, RefSchemaNode as nt, Visitor as o, SchemaNodeByType as ot, RefMap as p, PropertyNode as pt, ComplexSchemaType as q, CollectVisitor as r, ScalarSchemaNode as rt, VisitorContext as s, SchemaType as st, AsyncVisitor as t, PrimitiveSchemaType as tt, composeTransformers as u, TimeSchemaNode as ut, Printer as v, ObjectBindingParameterNode as vt, createFunctionParameters as w, mediaTypes as wt, DistributiveOmit as x, SCALAR_PRIMITIVE_TYPES as xt, PrinterFactoryOptions as y, BaseNode as yt, OperationNode as z };
1974
+ //# sourceMappingURL=visitor-BFn3X90U.d.ts.map