@kubb/ast 5.14.6 → 5.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +35 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -47
- package/dist/index.d.ts +0 -47
- package/dist/index.js +35 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//#endregion
|
|
2
|
-
//#region src/constants.d.ts
|
|
3
1
|
/**
|
|
4
2
|
* Node kind discriminators used by every AST node (for example `node.kind === nodeKinds.text`).
|
|
5
3
|
*/
|
|
@@ -145,8 +143,6 @@ export declare const schemaTypes: {
|
|
|
145
143
|
*/
|
|
146
144
|
readonly never: 'never';
|
|
147
145
|
};
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/nodes/base.d.ts
|
|
150
146
|
/**
|
|
151
147
|
* `kind` values used by AST nodes.
|
|
152
148
|
*
|
|
@@ -178,8 +174,6 @@ type BaseNode = {
|
|
|
178
174
|
};
|
|
179
175
|
/** `Omit` applied to each member of a union, so the union survives. */
|
|
180
176
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/nodes/property.d.ts
|
|
183
177
|
/**
|
|
184
178
|
* AST node representing one named object property.
|
|
185
179
|
*
|
|
@@ -227,8 +221,6 @@ type UserPropertyNode = Pick<PropertyNode, 'name' | 'schema'> & Partial<Omit<Pro
|
|
|
227
221
|
* ```
|
|
228
222
|
*/
|
|
229
223
|
declare function createProperty(input: UserPropertyNode): PropertyNode;
|
|
230
|
-
//#endregion
|
|
231
|
-
//#region src/nodes/schema.d.ts
|
|
232
224
|
type PrimitiveSchemaType =
|
|
233
225
|
/**
|
|
234
226
|
* Text value.
|
|
@@ -849,8 +841,6 @@ type CreateSchemaOutput<T extends CreateSchemaInput> = SchemaNodeByType[T['type'
|
|
|
849
841
|
*/
|
|
850
842
|
declare function createSchema<T extends CreateSchemaInput>(props: T): CreateSchemaOutput<T>;
|
|
851
843
|
declare function createSchema(props: CreateSchemaInput): SchemaNode;
|
|
852
|
-
//#endregion
|
|
853
|
-
//#region src/nodes/parameter.d.ts
|
|
854
844
|
type ParameterLocation = 'path' | 'query' | 'header' | 'cookie';
|
|
855
845
|
/**
|
|
856
846
|
* Parameter serialization style, controlling how a parameter value is rendered into the request.
|
|
@@ -925,8 +915,6 @@ type UserParameterNode = Pick<ParameterNode, 'name' | 'in' | 'schema'> & Partial
|
|
|
925
915
|
* ```
|
|
926
916
|
*/
|
|
927
917
|
declare function createParameter(input: UserParameterNode): ParameterNode;
|
|
928
|
-
//#endregion
|
|
929
|
-
//#region src/nodes/content.d.ts
|
|
930
918
|
/**
|
|
931
919
|
* How one body property is serialized, from the `encoding` entry of its media type.
|
|
932
920
|
*/
|
|
@@ -990,8 +978,6 @@ type ContentNode = BaseNode & {
|
|
|
990
978
|
* Creates a `ContentNode` for a single request-body or response content type.
|
|
991
979
|
*/
|
|
992
980
|
declare const createContent: (input: Omit<ContentNode, "kind">) => ContentNode;
|
|
993
|
-
//#endregion
|
|
994
|
-
//#region src/nodes/requestBody.d.ts
|
|
995
981
|
/**
|
|
996
982
|
* AST node representing an operation request body.
|
|
997
983
|
*
|
|
@@ -1032,8 +1018,6 @@ type RequestBodyNode = BaseNode & {
|
|
|
1032
1018
|
* Creates a `RequestBodyNode`.
|
|
1033
1019
|
*/
|
|
1034
1020
|
declare const createRequestBody: (input: Omit<RequestBodyNode, "kind">) => RequestBodyNode;
|
|
1035
|
-
//#endregion
|
|
1036
|
-
//#region src/nodes/response.d.ts
|
|
1037
1021
|
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
1038
1022
|
/**
|
|
1039
1023
|
* Response status code literal used by operations.
|
|
@@ -1112,8 +1096,6 @@ type ResponseInput = Pick<ResponseNode, 'statusCode'> & Partial<Omit<ResponseNod
|
|
|
1112
1096
|
* ```
|
|
1113
1097
|
*/
|
|
1114
1098
|
declare function createResponse(props: ResponseInput): ResponseNode;
|
|
1115
|
-
//#endregion
|
|
1116
|
-
//#region src/nodes/operation.d.ts
|
|
1117
1099
|
/**
|
|
1118
1100
|
* HTTP method an operation responds to. `QUERY` is the safe, idempotent method with a request body
|
|
1119
1101
|
* from RFC 10008, declared with the `query` field of an OpenAPI 3.2 path item.
|
|
@@ -1228,8 +1210,6 @@ declare function createOperation(props: Pick<HttpOperationNode, 'operationId' |
|
|
|
1228
1210
|
declare function createOperation(props: Pick<GenericOperationNode, 'operationId'> & Partial<Omit<GenericOperationNode, 'kind' | 'operationId' | 'requestBody'>> & {
|
|
1229
1211
|
requestBody?: Omit<RequestBodyNode, 'kind'>;
|
|
1230
1212
|
}): GenericOperationNode;
|
|
1231
|
-
//#endregion
|
|
1232
|
-
//#region src/guards.d.ts
|
|
1233
1213
|
/**
|
|
1234
1214
|
* Narrows a `SchemaNode` to the variant that matches `type`.
|
|
1235
1215
|
*
|
|
@@ -1251,8 +1231,6 @@ export declare function narrowSchema<T extends SchemaNode['type']>(node: SchemaN
|
|
|
1251
1231
|
* ```
|
|
1252
1232
|
*/
|
|
1253
1233
|
export declare function isHttpOperationNode(node: OperationNode): node is HttpOperationNode;
|
|
1254
|
-
//#endregion
|
|
1255
|
-
//#region src/nodes/code.d.ts
|
|
1256
1234
|
/**
|
|
1257
1235
|
* JSDoc documentation metadata attached to code declarations.
|
|
1258
1236
|
*/
|
|
@@ -1553,8 +1531,6 @@ declare function createBreak(): BreakNode;
|
|
|
1553
1531
|
* ```
|
|
1554
1532
|
*/
|
|
1555
1533
|
declare function createJsx(value: string): JsxNode;
|
|
1556
|
-
//#endregion
|
|
1557
|
-
//#region src/nodes/file.d.ts
|
|
1558
1534
|
/**
|
|
1559
1535
|
* Supported file extensions.
|
|
1560
1536
|
*/
|
|
@@ -1877,8 +1853,6 @@ type UserFileNode<TMeta extends object = object> = Omit<FileNode<TMeta>, 'kind'
|
|
|
1877
1853
|
* ```
|
|
1878
1854
|
*/
|
|
1879
1855
|
declare function createFile<TMeta extends object = object>(input: UserFileNode<TMeta>): FileNode<TMeta>;
|
|
1880
|
-
//#endregion
|
|
1881
|
-
//#region src/nodes/input.d.ts
|
|
1882
1856
|
/**
|
|
1883
1857
|
* A server from the source document, with `{variable}` placeholders filled from their defaults.
|
|
1884
1858
|
*/
|
|
@@ -2039,8 +2013,6 @@ declare namespace index_d_exports$1 {
|
|
|
2039
2013
|
* ```
|
|
2040
2014
|
*/
|
|
2041
2015
|
type Node = InputNode | OperationNode | SchemaNode | PropertyNode | ParameterNode | ResponseNode | RequestBodyNode | ContentNode | FileNode | ImportNode | ExportNode | SourceNode | ConstNode | TypeNode | FunctionNode | ArrowFunctionNode | TextNode | BreakNode | JsxNode;
|
|
2042
|
-
//#endregion
|
|
2043
|
-
//#region src/visitor.d.ts
|
|
2044
2016
|
/**
|
|
2045
2017
|
* Ordered mapping of `[NodeType, ParentType]` pairs.
|
|
2046
2018
|
*
|
|
@@ -2266,8 +2238,6 @@ export declare function collect<T>(node: Node, options: CollectOptions<T>): Gene
|
|
|
2266
2238
|
* ```
|
|
2267
2239
|
*/
|
|
2268
2240
|
export declare function collectSync<T>(node: Node, options: CollectOptions<T>): Array<T>;
|
|
2269
|
-
//#endregion
|
|
2270
|
-
//#region src/defineMacro.d.ts
|
|
2271
2241
|
/**
|
|
2272
2242
|
* Ordering hint shared by macros and plugins. `pre` runs before unmarked items, `post` after,
|
|
2273
2243
|
* and `undefined` keeps declaration order.
|
|
@@ -2341,15 +2311,11 @@ export declare function composeMacros(macros: ReadonlyArray<Macro>): Visitor;
|
|
|
2341
2311
|
export declare function applyMacros<TNode extends Node>(root: TNode, macros: ReadonlyArray<Macro>, options?: {
|
|
2342
2312
|
depth?: VisitorDepth;
|
|
2343
2313
|
}): TNode;
|
|
2344
|
-
//#endregion
|
|
2345
|
-
//#region src/optionality.d.ts
|
|
2346
2314
|
/**
|
|
2347
2315
|
* Generic JSON Schema optionality: a non-required field is optional, and a
|
|
2348
2316
|
* non-required nullable field is nullish.
|
|
2349
2317
|
*/
|
|
2350
2318
|
export declare function optionality(schema: SchemaNode, required: boolean): SchemaNode;
|
|
2351
|
-
//#endregion
|
|
2352
|
-
//#region src/createPrinter.d.ts
|
|
2353
2319
|
/**
|
|
2354
2320
|
* Runtime context passed as `this` to printer handlers.
|
|
2355
2321
|
*
|
|
@@ -2545,8 +2511,6 @@ type PrinterBuilder<T extends PrinterFactoryOptions> = (options: T['options']) =
|
|
|
2545
2511
|
* ```
|
|
2546
2512
|
*/
|
|
2547
2513
|
export declare function createPrinter<T extends PrinterFactoryOptions = PrinterFactoryOptions>(build: PrinterBuilder<T>): (options?: T['options']) => Printer<T>;
|
|
2548
|
-
//#endregion
|
|
2549
|
-
//#region src/utils/extractStringsFromNodes.d.ts
|
|
2550
2514
|
/**
|
|
2551
2515
|
* Extracts all string content from a `CodeNode` tree recursively.
|
|
2552
2516
|
*
|
|
@@ -2554,8 +2518,6 @@ export declare function createPrinter<T extends PrinterFactoryOptions = PrinterF
|
|
|
2554
2518
|
* and nested node content. Used to build the full source string for import filtering.
|
|
2555
2519
|
*/
|
|
2556
2520
|
export declare function extractStringsFromNodes(nodes: Array<CodeNode> | undefined): string;
|
|
2557
|
-
//#endregion
|
|
2558
|
-
//#region src/utils/inline.d.ts
|
|
2559
2521
|
/**
|
|
2560
2522
|
* Whether every source of `file` is inline. Other files absorb such a file, so it is never written.
|
|
2561
2523
|
*/
|
|
@@ -2601,8 +2563,6 @@ type InlineFilesOptions = {
|
|
|
2601
2563
|
* `inline.expression`, until no inline names are left. The definitions' own imports move to the importing file.
|
|
2602
2564
|
*/
|
|
2603
2565
|
export declare function inlineFiles(files: ReadonlyArray<FileNode>, { language }: InlineFilesOptions): InlineFilesResult;
|
|
2604
|
-
//#endregion
|
|
2605
|
-
//#region src/utils/refs.d.ts
|
|
2606
2566
|
/**
|
|
2607
2567
|
* Returns the last segment of a `$ref` pointer, for example `'Pet'` for `#/components/schemas/Pet`.
|
|
2608
2568
|
* The segment is decoded like the pointer resolver does: percent-escapes first, then `~1` and `~0`
|
|
@@ -2654,8 +2614,6 @@ export declare function mergeRefWithSchema(node: RefSchemaNode): SchemaNode;
|
|
|
2654
2614
|
* referenced schema variable with those modifiers already applied.
|
|
2655
2615
|
*/
|
|
2656
2616
|
export declare function isBareRef(node: SchemaNode | null | undefined, keysToOmit?: Array<string> | null): boolean;
|
|
2657
|
-
//#endregion
|
|
2658
|
-
//#region src/utils/schemaGraph.d.ts
|
|
2659
2617
|
/**
|
|
2660
2618
|
* Collects the names of every schema a node's subtree references, resolved with `resolveRefName`.
|
|
2661
2619
|
* Each ref contributes its name only, so the schema it points to is never traversed. The walk is
|
|
@@ -2735,8 +2693,6 @@ export declare function findCircularSchemasFromGraph(graph: ReadonlyMap<string,
|
|
|
2735
2693
|
* @note Call this once on the full graph, then check individual schemas with `containsCircularRef()`.
|
|
2736
2694
|
*/
|
|
2737
2695
|
export declare function findCircularSchemas(schemas: ReadonlyArray<SchemaNode>): Set<string>;
|
|
2738
|
-
//#endregion
|
|
2739
|
-
//#region src/utils/schemaProperties.d.ts
|
|
2740
2696
|
/**
|
|
2741
2697
|
* Finds every matching property exposed by an object, resolved reference, or intersection.
|
|
2742
2698
|
*
|
|
@@ -2788,8 +2744,6 @@ export declare function getSchemaLiteralValues(node: SchemaNode): ReadonlyArray<
|
|
|
2788
2744
|
* literal value, the same shape a declared OpenAPI `discriminator` already narrows on.
|
|
2789
2745
|
*/
|
|
2790
2746
|
export declare function inferDiscriminatorPropertyName(members: ReadonlyArray<SchemaNode>): string | undefined;
|
|
2791
|
-
//#endregion
|
|
2792
|
-
//#region src/infer.d.ts
|
|
2793
2747
|
/**
|
|
2794
2748
|
* How `format: 'date-time'` schemas are represented downstream.
|
|
2795
2749
|
* - `false` falls through to a plain `string` (no validation).
|
|
@@ -2859,6 +2813,5 @@ type ParserOptions = {
|
|
|
2859
2813
|
declare namespace index_d_exports {
|
|
2860
2814
|
export { ArraySchemaNode, ArrowFunctionNode, BreakNode, CodeNode, ConstNode, ContentNode, DateOnlyTypeValue, DateSchemaNode, DateTimeTypeValue, DateTypeOptions, DatetimeSchemaNode, DistributiveOmit, EncodingNode, Enforce, EnumSchemaNode, ExportNode, FileNode, FunctionNode, GenericOperationNode, HttpMethod, HttpOperationNode, ImportNode, InlineLanguage, InputMeta, InputNode, InputSecurityScheme, InputServer, IntersectionSchemaNode, JSDocNode, JsxNode, Macro, Node, NodeKind, NotSchemaNode, NumberSchemaNode, ObjectSchemaNode, OperationNode, ParameterLocation, ParameterNode, ParameterStyle, ParentOf, ParserOptions, PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, PropertyNode, RefSchemaNode, RequestBodyNode, ResponseNode, ScalarSchemaNode, ScalarSchemaType, SchemaNode, SchemaNodeByType, SchemaType, SourceNode, StatusCode, StringSchemaNode, TextNode, TimeSchemaNode, TypeNode, UnionSchemaNode, UrlSchemaNode, UserFileNode, Visitor, VisitorContext, applyMacros, index_d_exports as ast, collect, collectImportedRefNames, collectSchemaRefs, collectSync, collectUsedSchemaNames, composeMacros, createPrinter, defineMacro, extractStringsFromNodes, index_d_exports$1 as factory, findCircularSchemas, findCircularSchemasFromGraph, findSchema, forEachChild, forEachSchema, getSchemaLiteralValues, inferDiscriminatorPropertyName, inlineFiles, isBareRef, isHttpOperationNode, isVirtualFile, mergeRefWithSchema, narrowSchema, nodeKinds, optionality, refName, resolveRef, resolveRefName, resolveSchemaProperties, schemaTypes, transform };
|
|
2861
2815
|
}
|
|
2862
|
-
//#endregion
|
|
2863
2816
|
export { type ArraySchemaNode, type ArrowFunctionNode, type BreakNode, type CodeNode, type ConstNode, type ContentNode, type DateOnlyTypeValue, type DateSchemaNode, type DateTimeTypeValue, type DateTypeOptions, type DatetimeSchemaNode, type DistributiveOmit, type EncodingNode, type Enforce, type EnumSchemaNode, type ExportNode, type FileNode, type FunctionNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type ImportNode, type InlineLanguage, type InputMeta, type InputNode, type InputSecurityScheme, type InputServer, type IntersectionSchemaNode, type JSDocNode, type JsxNode, type Macro, type Node, type NodeKind, type NotSchemaNode, type NumberSchemaNode, type ObjectSchemaNode, type OperationNode, type ParameterLocation, type ParameterNode, type ParameterStyle, type ParentOf, type ParserOptions, type PrimitiveSchemaType, type Printer, type PrinterFactoryOptions, type PrinterPartial, type PropertyNode, type RefSchemaNode, type RequestBodyNode, type ResponseNode, type ScalarSchemaNode, type ScalarSchemaType, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, type UserFileNode, type Visitor, type VisitorContext, index_d_exports as ast, index_d_exports$1 as factory };
|
|
2864
2817
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//#endregion
|
|
2
|
-
//#region src/constants.d.ts
|
|
3
1
|
/**
|
|
4
2
|
* Node kind discriminators used by every AST node (for example `node.kind === nodeKinds.text`).
|
|
5
3
|
*/
|
|
@@ -145,8 +143,6 @@ export declare const schemaTypes: {
|
|
|
145
143
|
*/
|
|
146
144
|
readonly never: 'never';
|
|
147
145
|
};
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/nodes/base.d.ts
|
|
150
146
|
/**
|
|
151
147
|
* `kind` values used by AST nodes.
|
|
152
148
|
*
|
|
@@ -178,8 +174,6 @@ type BaseNode = {
|
|
|
178
174
|
};
|
|
179
175
|
/** `Omit` applied to each member of a union, so the union survives. */
|
|
180
176
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/nodes/property.d.ts
|
|
183
177
|
/**
|
|
184
178
|
* AST node representing one named object property.
|
|
185
179
|
*
|
|
@@ -227,8 +221,6 @@ type UserPropertyNode = Pick<PropertyNode, 'name' | 'schema'> & Partial<Omit<Pro
|
|
|
227
221
|
* ```
|
|
228
222
|
*/
|
|
229
223
|
declare function createProperty(input: UserPropertyNode): PropertyNode;
|
|
230
|
-
//#endregion
|
|
231
|
-
//#region src/nodes/schema.d.ts
|
|
232
224
|
type PrimitiveSchemaType =
|
|
233
225
|
/**
|
|
234
226
|
* Text value.
|
|
@@ -849,8 +841,6 @@ type CreateSchemaOutput<T extends CreateSchemaInput> = SchemaNodeByType[T['type'
|
|
|
849
841
|
*/
|
|
850
842
|
declare function createSchema<T extends CreateSchemaInput>(props: T): CreateSchemaOutput<T>;
|
|
851
843
|
declare function createSchema(props: CreateSchemaInput): SchemaNode;
|
|
852
|
-
//#endregion
|
|
853
|
-
//#region src/nodes/parameter.d.ts
|
|
854
844
|
type ParameterLocation = 'path' | 'query' | 'header' | 'cookie';
|
|
855
845
|
/**
|
|
856
846
|
* Parameter serialization style, controlling how a parameter value is rendered into the request.
|
|
@@ -925,8 +915,6 @@ type UserParameterNode = Pick<ParameterNode, 'name' | 'in' | 'schema'> & Partial
|
|
|
925
915
|
* ```
|
|
926
916
|
*/
|
|
927
917
|
declare function createParameter(input: UserParameterNode): ParameterNode;
|
|
928
|
-
//#endregion
|
|
929
|
-
//#region src/nodes/content.d.ts
|
|
930
918
|
/**
|
|
931
919
|
* How one body property is serialized, from the `encoding` entry of its media type.
|
|
932
920
|
*/
|
|
@@ -990,8 +978,6 @@ type ContentNode = BaseNode & {
|
|
|
990
978
|
* Creates a `ContentNode` for a single request-body or response content type.
|
|
991
979
|
*/
|
|
992
980
|
declare const createContent: (input: Omit<ContentNode, "kind">) => ContentNode;
|
|
993
|
-
//#endregion
|
|
994
|
-
//#region src/nodes/requestBody.d.ts
|
|
995
981
|
/**
|
|
996
982
|
* AST node representing an operation request body.
|
|
997
983
|
*
|
|
@@ -1032,8 +1018,6 @@ type RequestBodyNode = BaseNode & {
|
|
|
1032
1018
|
* Creates a `RequestBodyNode`.
|
|
1033
1019
|
*/
|
|
1034
1020
|
declare const createRequestBody: (input: Omit<RequestBodyNode, "kind">) => RequestBodyNode;
|
|
1035
|
-
//#endregion
|
|
1036
|
-
//#region src/nodes/response.d.ts
|
|
1037
1021
|
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
1038
1022
|
/**
|
|
1039
1023
|
* Response status code literal used by operations.
|
|
@@ -1112,8 +1096,6 @@ type ResponseInput = Pick<ResponseNode, 'statusCode'> & Partial<Omit<ResponseNod
|
|
|
1112
1096
|
* ```
|
|
1113
1097
|
*/
|
|
1114
1098
|
declare function createResponse(props: ResponseInput): ResponseNode;
|
|
1115
|
-
//#endregion
|
|
1116
|
-
//#region src/nodes/operation.d.ts
|
|
1117
1099
|
/**
|
|
1118
1100
|
* HTTP method an operation responds to. `QUERY` is the safe, idempotent method with a request body
|
|
1119
1101
|
* from RFC 10008, declared with the `query` field of an OpenAPI 3.2 path item.
|
|
@@ -1228,8 +1210,6 @@ declare function createOperation(props: Pick<HttpOperationNode, 'operationId' |
|
|
|
1228
1210
|
declare function createOperation(props: Pick<GenericOperationNode, 'operationId'> & Partial<Omit<GenericOperationNode, 'kind' | 'operationId' | 'requestBody'>> & {
|
|
1229
1211
|
requestBody?: Omit<RequestBodyNode, 'kind'>;
|
|
1230
1212
|
}): GenericOperationNode;
|
|
1231
|
-
//#endregion
|
|
1232
|
-
//#region src/guards.d.ts
|
|
1233
1213
|
/**
|
|
1234
1214
|
* Narrows a `SchemaNode` to the variant that matches `type`.
|
|
1235
1215
|
*
|
|
@@ -1251,8 +1231,6 @@ export declare function narrowSchema<T extends SchemaNode['type']>(node: SchemaN
|
|
|
1251
1231
|
* ```
|
|
1252
1232
|
*/
|
|
1253
1233
|
export declare function isHttpOperationNode(node: OperationNode): node is HttpOperationNode;
|
|
1254
|
-
//#endregion
|
|
1255
|
-
//#region src/nodes/code.d.ts
|
|
1256
1234
|
/**
|
|
1257
1235
|
* JSDoc documentation metadata attached to code declarations.
|
|
1258
1236
|
*/
|
|
@@ -1553,8 +1531,6 @@ declare function createBreak(): BreakNode;
|
|
|
1553
1531
|
* ```
|
|
1554
1532
|
*/
|
|
1555
1533
|
declare function createJsx(value: string): JsxNode;
|
|
1556
|
-
//#endregion
|
|
1557
|
-
//#region src/nodes/file.d.ts
|
|
1558
1534
|
/**
|
|
1559
1535
|
* Supported file extensions.
|
|
1560
1536
|
*/
|
|
@@ -1877,8 +1853,6 @@ type UserFileNode<TMeta extends object = object> = Omit<FileNode<TMeta>, 'kind'
|
|
|
1877
1853
|
* ```
|
|
1878
1854
|
*/
|
|
1879
1855
|
declare function createFile<TMeta extends object = object>(input: UserFileNode<TMeta>): FileNode<TMeta>;
|
|
1880
|
-
//#endregion
|
|
1881
|
-
//#region src/nodes/input.d.ts
|
|
1882
1856
|
/**
|
|
1883
1857
|
* A server from the source document, with `{variable}` placeholders filled from their defaults.
|
|
1884
1858
|
*/
|
|
@@ -2039,8 +2013,6 @@ declare namespace index_d_exports$1 {
|
|
|
2039
2013
|
* ```
|
|
2040
2014
|
*/
|
|
2041
2015
|
type Node = InputNode | OperationNode | SchemaNode | PropertyNode | ParameterNode | ResponseNode | RequestBodyNode | ContentNode | FileNode | ImportNode | ExportNode | SourceNode | ConstNode | TypeNode | FunctionNode | ArrowFunctionNode | TextNode | BreakNode | JsxNode;
|
|
2042
|
-
//#endregion
|
|
2043
|
-
//#region src/visitor.d.ts
|
|
2044
2016
|
/**
|
|
2045
2017
|
* Ordered mapping of `[NodeType, ParentType]` pairs.
|
|
2046
2018
|
*
|
|
@@ -2266,8 +2238,6 @@ export declare function collect<T>(node: Node, options: CollectOptions<T>): Gene
|
|
|
2266
2238
|
* ```
|
|
2267
2239
|
*/
|
|
2268
2240
|
export declare function collectSync<T>(node: Node, options: CollectOptions<T>): Array<T>;
|
|
2269
|
-
//#endregion
|
|
2270
|
-
//#region src/defineMacro.d.ts
|
|
2271
2241
|
/**
|
|
2272
2242
|
* Ordering hint shared by macros and plugins. `pre` runs before unmarked items, `post` after,
|
|
2273
2243
|
* and `undefined` keeps declaration order.
|
|
@@ -2341,15 +2311,11 @@ export declare function composeMacros(macros: ReadonlyArray<Macro>): Visitor;
|
|
|
2341
2311
|
export declare function applyMacros<TNode extends Node>(root: TNode, macros: ReadonlyArray<Macro>, options?: {
|
|
2342
2312
|
depth?: VisitorDepth;
|
|
2343
2313
|
}): TNode;
|
|
2344
|
-
//#endregion
|
|
2345
|
-
//#region src/optionality.d.ts
|
|
2346
2314
|
/**
|
|
2347
2315
|
* Generic JSON Schema optionality: a non-required field is optional, and a
|
|
2348
2316
|
* non-required nullable field is nullish.
|
|
2349
2317
|
*/
|
|
2350
2318
|
export declare function optionality(schema: SchemaNode, required: boolean): SchemaNode;
|
|
2351
|
-
//#endregion
|
|
2352
|
-
//#region src/createPrinter.d.ts
|
|
2353
2319
|
/**
|
|
2354
2320
|
* Runtime context passed as `this` to printer handlers.
|
|
2355
2321
|
*
|
|
@@ -2545,8 +2511,6 @@ type PrinterBuilder<T extends PrinterFactoryOptions> = (options: T['options']) =
|
|
|
2545
2511
|
* ```
|
|
2546
2512
|
*/
|
|
2547
2513
|
export declare function createPrinter<T extends PrinterFactoryOptions = PrinterFactoryOptions>(build: PrinterBuilder<T>): (options?: T['options']) => Printer<T>;
|
|
2548
|
-
//#endregion
|
|
2549
|
-
//#region src/utils/extractStringsFromNodes.d.ts
|
|
2550
2514
|
/**
|
|
2551
2515
|
* Extracts all string content from a `CodeNode` tree recursively.
|
|
2552
2516
|
*
|
|
@@ -2554,8 +2518,6 @@ export declare function createPrinter<T extends PrinterFactoryOptions = PrinterF
|
|
|
2554
2518
|
* and nested node content. Used to build the full source string for import filtering.
|
|
2555
2519
|
*/
|
|
2556
2520
|
export declare function extractStringsFromNodes(nodes: Array<CodeNode> | undefined): string;
|
|
2557
|
-
//#endregion
|
|
2558
|
-
//#region src/utils/inline.d.ts
|
|
2559
2521
|
/**
|
|
2560
2522
|
* Whether every source of `file` is inline. Other files absorb such a file, so it is never written.
|
|
2561
2523
|
*/
|
|
@@ -2601,8 +2563,6 @@ type InlineFilesOptions = {
|
|
|
2601
2563
|
* `inline.expression`, until no inline names are left. The definitions' own imports move to the importing file.
|
|
2602
2564
|
*/
|
|
2603
2565
|
export declare function inlineFiles(files: ReadonlyArray<FileNode>, { language }: InlineFilesOptions): InlineFilesResult;
|
|
2604
|
-
//#endregion
|
|
2605
|
-
//#region src/utils/refs.d.ts
|
|
2606
2566
|
/**
|
|
2607
2567
|
* Returns the last segment of a `$ref` pointer, for example `'Pet'` for `#/components/schemas/Pet`.
|
|
2608
2568
|
* The segment is decoded like the pointer resolver does: percent-escapes first, then `~1` and `~0`
|
|
@@ -2654,8 +2614,6 @@ export declare function mergeRefWithSchema(node: RefSchemaNode): SchemaNode;
|
|
|
2654
2614
|
* referenced schema variable with those modifiers already applied.
|
|
2655
2615
|
*/
|
|
2656
2616
|
export declare function isBareRef(node: SchemaNode | null | undefined, keysToOmit?: Array<string> | null): boolean;
|
|
2657
|
-
//#endregion
|
|
2658
|
-
//#region src/utils/schemaGraph.d.ts
|
|
2659
2617
|
/**
|
|
2660
2618
|
* Collects the names of every schema a node's subtree references, resolved with `resolveRefName`.
|
|
2661
2619
|
* Each ref contributes its name only, so the schema it points to is never traversed. The walk is
|
|
@@ -2735,8 +2693,6 @@ export declare function findCircularSchemasFromGraph(graph: ReadonlyMap<string,
|
|
|
2735
2693
|
* @note Call this once on the full graph, then check individual schemas with `containsCircularRef()`.
|
|
2736
2694
|
*/
|
|
2737
2695
|
export declare function findCircularSchemas(schemas: ReadonlyArray<SchemaNode>): Set<string>;
|
|
2738
|
-
//#endregion
|
|
2739
|
-
//#region src/utils/schemaProperties.d.ts
|
|
2740
2696
|
/**
|
|
2741
2697
|
* Finds every matching property exposed by an object, resolved reference, or intersection.
|
|
2742
2698
|
*
|
|
@@ -2788,8 +2744,6 @@ export declare function getSchemaLiteralValues(node: SchemaNode): ReadonlyArray<
|
|
|
2788
2744
|
* literal value, the same shape a declared OpenAPI `discriminator` already narrows on.
|
|
2789
2745
|
*/
|
|
2790
2746
|
export declare function inferDiscriminatorPropertyName(members: ReadonlyArray<SchemaNode>): string | undefined;
|
|
2791
|
-
//#endregion
|
|
2792
|
-
//#region src/infer.d.ts
|
|
2793
2747
|
/**
|
|
2794
2748
|
* How `format: 'date-time'` schemas are represented downstream.
|
|
2795
2749
|
* - `false` falls through to a plain `string` (no validation).
|
|
@@ -2859,6 +2813,5 @@ type ParserOptions = {
|
|
|
2859
2813
|
declare namespace index_d_exports {
|
|
2860
2814
|
export { ArraySchemaNode, ArrowFunctionNode, BreakNode, CodeNode, ConstNode, ContentNode, DateOnlyTypeValue, DateSchemaNode, DateTimeTypeValue, DateTypeOptions, DatetimeSchemaNode, DistributiveOmit, EncodingNode, Enforce, EnumSchemaNode, ExportNode, FileNode, FunctionNode, GenericOperationNode, HttpMethod, HttpOperationNode, ImportNode, InlineLanguage, InputMeta, InputNode, InputSecurityScheme, InputServer, IntersectionSchemaNode, JSDocNode, JsxNode, Macro, Node, NodeKind, NotSchemaNode, NumberSchemaNode, ObjectSchemaNode, OperationNode, ParameterLocation, ParameterNode, ParameterStyle, ParentOf, ParserOptions, PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, PropertyNode, RefSchemaNode, RequestBodyNode, ResponseNode, ScalarSchemaNode, ScalarSchemaType, SchemaNode, SchemaNodeByType, SchemaType, SourceNode, StatusCode, StringSchemaNode, TextNode, TimeSchemaNode, TypeNode, UnionSchemaNode, UrlSchemaNode, UserFileNode, Visitor, VisitorContext, applyMacros, index_d_exports as ast, collect, collectImportedRefNames, collectSchemaRefs, collectSync, collectUsedSchemaNames, composeMacros, createPrinter, defineMacro, extractStringsFromNodes, index_d_exports$1 as factory, findCircularSchemas, findCircularSchemasFromGraph, findSchema, forEachChild, forEachSchema, getSchemaLiteralValues, inferDiscriminatorPropertyName, inlineFiles, isBareRef, isHttpOperationNode, isVirtualFile, mergeRefWithSchema, narrowSchema, nodeKinds, optionality, refName, resolveRef, resolveRefName, resolveSchemaProperties, schemaTypes, transform };
|
|
2861
2815
|
}
|
|
2862
|
-
//#endregion
|
|
2863
2816
|
export { type ArraySchemaNode, type ArrowFunctionNode, type BreakNode, type CodeNode, type ConstNode, type ContentNode, type DateOnlyTypeValue, type DateSchemaNode, type DateTimeTypeValue, type DateTypeOptions, type DatetimeSchemaNode, type DistributiveOmit, type EncodingNode, type Enforce, type EnumSchemaNode, type ExportNode, type FileNode, type FunctionNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type ImportNode, type InlineLanguage, type InputMeta, type InputNode, type InputSecurityScheme, type InputServer, type IntersectionSchemaNode, type JSDocNode, type JsxNode, type Macro, type Node, type NodeKind, type NotSchemaNode, type NumberSchemaNode, type ObjectSchemaNode, type OperationNode, type ParameterLocation, type ParameterNode, type ParameterStyle, type ParentOf, type ParserOptions, type PrimitiveSchemaType, type Printer, type PrinterFactoryOptions, type PrinterPartial, type PropertyNode, type RefSchemaNode, type RequestBodyNode, type ResponseNode, type ScalarSchemaNode, type ScalarSchemaType, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, type UserFileNode, type Visitor, type VisitorContext, index_d_exports as ast, index_d_exports$1 as factory };
|
|
2864
2817
|
//# sourceMappingURL=index.d.ts.map
|