oazapfts 6.0.3 → 6.0.5

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/cli.d.ts CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ export { }
package/generate.d.ts CHANGED
@@ -1,155 +1,358 @@
1
- import ts from "typescript";
2
- import { OpenAPIV3, OpenAPIV3_1 } from "openapi-types";
3
- import { Opts } from ".";
4
- export * from "./tscodegen";
5
- export * from "./generateServers";
6
- export declare const verbs: string[];
7
- type ContentType = "json" | "form" | "multipart";
8
- type OnlyMode = "readOnly" | "writeOnly";
9
- type OnlyModes = Record<OnlyMode, boolean>;
10
- type OpenAPISchemaObject = OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject;
11
- type OpenAPIReferenceObject = OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
12
- type OpenAPIParameterObject = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject;
13
- type OpenAPIDocument = OpenAPIV3.Document | OpenAPIV3_1.Document;
14
- type OpenAPIDiscriminatorObject = OpenAPIV3.DiscriminatorObject | OpenAPIV3_1.DiscriminatorObject;
15
- type OpenAPIResponseObject = OpenAPIV3.ResponseObject | OpenAPIV3_1.ResponseObject;
16
- type OpenAPIResponsesObject = OpenAPIV3.ResponsesObject | OpenAPIV3_1.ResponsesObject;
17
- type OpenAPIRequestBodyObject = OpenAPIV3.RequestBodyObject | OpenAPIV3_1.RequestBodyObject;
18
- type OpenAPIMediaTypeObject = OpenAPIV3.MediaTypeObject | OpenAPIV3_1.MediaTypeObject;
19
- export declare function isMimeType(s: unknown): boolean;
20
- export declare function isJsonMimeType(mime: string): boolean;
21
- export declare function getBodyFormatter(body?: OpenAPIRequestBodyObject): ContentType | undefined;
22
- type SchemaObject = OpenAPISchemaObject & {
23
- const?: unknown;
24
- "x-enumNames"?: string[];
25
- "x-enum-varnames"?: string[];
26
- "x-component-ref-path"?: string;
27
- prefixItems?: (OpenAPIReferenceObject | SchemaObject)[];
28
- };
29
- /**
30
- * Get the name of a formatter function for a given parameter.
31
- */
32
- export declare function getFormatter({ style, explode, content, }: OpenAPIParameterObject): "json" | "form" | "deep" | "explode" | "space" | "pipe";
33
- export declare function getOperationIdentifier(id?: string): string | undefined;
34
- /**
35
- * Create a method name for a given operation, either from its operationId or
36
- * the HTTP verb and path.
37
- */
38
- export declare function getOperationName(verb: string, path: string, operationId?: string): string;
39
- export declare function isNullable(schema?: SchemaObject | OpenAPIReferenceObject): boolean | undefined;
40
- export declare function isReference(obj: unknown): obj is OpenAPIReferenceObject;
41
- /**
42
- * Converts a local reference path into an array of property names.
43
- */
44
- export declare function refPathToPropertyPath(ref: string): string[];
45
- /**
46
- * If the given object is a ReferenceObject, return the last part of its path.
47
- */
48
- export declare function getReferenceName(obj: unknown): string | undefined;
49
- export declare function toIdentifier(s: string, upperFirst?: boolean, onlyMode?: OnlyMode): string;
50
- /**
51
- * Create a template string literal from the given OpenAPI urlTemplate.
52
- * Curly braces in the path are turned into identifier expressions,
53
- * which are read from the local scope during runtime.
54
- */
55
- export declare function createUrlExpression(path: string, qs?: ts.Expression): ts.StringLiteral | ts.TemplateExpression;
56
- /**
57
- * Create a call expression for one of the QS runtime functions.
58
- */
59
- export declare function callQsFunction(name: string, args: ts.Expression[]): ts.CallExpression;
60
- /**
61
- * Create a call expression for one of the oazapfts runtime functions.
62
- */
63
- export declare function callOazapftsFunction(name: string, args: ts.Expression[], typeArgs?: ts.TypeNode[]): ts.CallExpression;
64
- /**
65
- * Despite its name, OpenApi's `deepObject` serialization does not support
66
- * deeply nested objects. As a workaround we detect parameters that contain
67
- * square brackets and merge them into a single object.
68
- */
69
- export declare function supportDeepObjects(params: OpenAPIParameterObject[]): OpenAPIV3.ParameterObject[];
70
- /**
71
- * Main entry point that generates TypeScript code from a given API spec.
72
- */
73
- export default class ApiGenerator {
74
- readonly spec: OpenAPIDocument;
75
- readonly opts: Opts;
76
- /** Indicates if the document was converted from an older version of the OpenAPI specification. */
77
- readonly isConverted: boolean;
78
- constructor(spec: OpenAPIDocument, opts?: Opts,
79
- /** Indicates if the document was converted from an older version of the OpenAPI specification. */
80
- isConverted?: boolean);
81
- discriminatingSchemas: Set<string>;
82
- aliases: (ts.TypeAliasDeclaration | ts.InterfaceDeclaration)[];
83
- enumAliases: ts.Statement[];
84
- enumRefs: Record<string, {
85
- values: string;
86
- type: ts.TypeReferenceNode;
87
- }>;
88
- refs: Record<string, {
89
- base: ts.TypeReferenceNode;
90
- readOnly?: ts.TypeReferenceNode;
91
- writeOnly?: ts.TypeReferenceNode;
92
- }>;
93
- refsOnlyMode: Map<string, OnlyModes>;
94
- typeAliases: Record<string, number>;
95
- reset(): void;
96
- resolve<T>(obj: T | OpenAPIReferenceObject): T;
97
- resolveArray<T>(array?: Array<T | OpenAPIReferenceObject>): T[];
98
- skip(tags?: string[]): boolean;
99
- findAvailableRef(ref: string): string;
100
- getUniqueAlias(name: string): string;
101
- getEnumUniqueAlias(name: string, values: string): string;
102
- /**
103
- * Create a type alias for the schema referenced by the given ReferenceObject
104
- */
105
- getRefAlias(obj: OpenAPIReferenceObject, onlyMode?: OnlyMode, ignoreDiscriminator?: boolean): ts.TypeNode;
106
- getUnionType(variants: (OpenAPIReferenceObject | SchemaObject)[], discriminator?: OpenAPIDiscriminatorObject, onlyMode?: OnlyMode): ts.UnionTypeNode;
107
- /**
108
- * Creates a type node from a given schema.
109
- * Delegates to getBaseTypeFromSchema internally and
110
- * optionally adds a union with null.
111
- */
112
- getTypeFromSchema(schema?: SchemaObject | OpenAPIReferenceObject, name?: string, onlyMode?: OnlyMode): ts.TypeNode;
113
- /**
114
- * This is the very core of the OpenAPI to TS conversion - it takes a
115
- * schema and returns the appropriate type.
116
- */
117
- getBaseTypeFromSchema(schema?: SchemaObject | OpenAPIReferenceObject, name?: string, onlyMode?: OnlyMode): ts.TypeNode;
118
- isTrueEnum(schema: SchemaObject, name?: string): name is string;
119
- /**
120
- * Creates literal type (or union) from an array of values
121
- */
122
- getTypeFromEnum(values: unknown[]): ts.LiteralTypeNode | ts.UnionTypeNode;
123
- getEnumValuesString(values: string[]): string;
124
- getTrueEnum(schema: SchemaObject, propName: string): ts.TypeReferenceNode;
125
- /**
126
- * Checks if readOnly/writeOnly properties are present in the given schema.
127
- * Returns a tuple of booleans; the first one is about readOnly, the second
128
- * one is about writeOnly.
129
- */
130
- checkSchemaOnlyMode(schema: SchemaObject | OpenAPIReferenceObject, resolveRefs?: boolean): OnlyModes;
131
- /**
132
- * Recursively creates a type literal with the given props.
133
- */
134
- getTypeFromProperties(props: {
135
- [prop: string]: SchemaObject | OpenAPIReferenceObject;
136
- }, required?: string[], additionalProperties?: boolean | OpenAPISchemaObject | OpenAPIReferenceObject, onlyMode?: OnlyMode): ts.TypeLiteralNode;
137
- getTypeFromResponses(responses: OpenAPIResponsesObject, onlyMode?: OnlyMode): ts.UnionTypeNode;
138
- getTypeFromResponse(resOrRef: OpenAPIResponseObject | OpenAPIReferenceObject, onlyMode?: OnlyMode): ts.TypeNode;
139
- getResponseType(responses?: OpenAPIResponsesObject): "json" | "text" | "blob";
140
- getSchemaFromContent(content: Record<string, OpenAPIMediaTypeObject>): OpenAPISchemaObject | OpenAPIReferenceObject;
141
- getTypeFromParameter(p: OpenAPIParameterObject): ts.TypeNode;
142
- wrapResult(ex: ts.Expression): ts.Expression;
143
- /**
144
- * Does three things:
145
- * 1. Add a `x-component-ref-path` property.
146
- * 2. Record discriminating schemas in `this.discriminatingSchemas`. A discriminating schema
147
- * refers to a schema that has a `discriminator` property which is neither used in conjunction
148
- * with `oneOf` nor `anyOf`.
149
- * 3. Make all mappings of discriminating schemas explicit to generate types immediately.
150
- */
151
- preprocessComponents(schemas: {
152
- [key: string]: OpenAPIReferenceObject | SchemaObject;
153
- }): void;
154
- generateApi(): ts.SourceFile;
155
- }
1
+ import { default as default_2 } from 'typescript';
2
+ import { OpenAPIV3 } from 'openapi-types';
3
+ import { OpenAPIV3_1 } from 'openapi-types';
4
+
5
+ export declare function addComment<T extends default_2.Node>(node: T, comment?: string): T;
6
+
7
+ /**
8
+ * Main entry point that generates TypeScript code from a given API spec.
9
+ */
10
+ declare class ApiGenerator {
11
+ readonly spec: OpenAPIDocument;
12
+ readonly opts: Opts;
13
+ /** Indicates if the document was converted from an older version of the OpenAPI specification. */
14
+ readonly isConverted: boolean;
15
+ constructor(spec: OpenAPIDocument, opts?: Opts,
16
+ /** Indicates if the document was converted from an older version of the OpenAPI specification. */
17
+ isConverted?: boolean);
18
+ discriminatingSchemas: Set<string>;
19
+ aliases: (default_2.TypeAliasDeclaration | default_2.InterfaceDeclaration)[];
20
+ enumAliases: default_2.Statement[];
21
+ enumRefs: Record<string, {
22
+ values: string;
23
+ type: default_2.TypeReferenceNode;
24
+ }>;
25
+ refs: Record<string, {
26
+ base: default_2.TypeReferenceNode;
27
+ readOnly?: default_2.TypeReferenceNode;
28
+ writeOnly?: default_2.TypeReferenceNode;
29
+ }>;
30
+ refsOnlyMode: Map<string, OnlyModes>;
31
+ typeAliases: Record<string, number>;
32
+ reset(): void;
33
+ resolve<T>(obj: T | OpenAPIReferenceObject): T;
34
+ resolveArray<T>(array?: Array<T | OpenAPIReferenceObject>): T[];
35
+ skip(tags?: string[]): boolean;
36
+ findAvailableRef(ref: string): string;
37
+ getUniqueAlias(name: string): string;
38
+ getEnumUniqueAlias(name: string, values: string): string;
39
+ /**
40
+ * Create a type alias for the schema referenced by the given ReferenceObject
41
+ */
42
+ getRefAlias(obj: OpenAPIReferenceObject, onlyMode?: OnlyMode, ignoreDiscriminator?: boolean): default_2.TypeNode;
43
+ getUnionType(variants: (OpenAPIReferenceObject | SchemaObject)[], discriminator?: OpenAPIDiscriminatorObject, onlyMode?: OnlyMode): default_2.UnionTypeNode;
44
+ /**
45
+ * Creates a type node from a given schema.
46
+ * Delegates to getBaseTypeFromSchema internally and
47
+ * optionally adds a union with null.
48
+ */
49
+ getTypeFromSchema(schema?: SchemaObject | OpenAPIReferenceObject, name?: string, onlyMode?: OnlyMode): default_2.TypeNode;
50
+ /**
51
+ * This is the very core of the OpenAPI to TS conversion - it takes a
52
+ * schema and returns the appropriate type.
53
+ */
54
+ getBaseTypeFromSchema(schema?: SchemaObject | OpenAPIReferenceObject, name?: string, onlyMode?: OnlyMode): default_2.TypeNode;
55
+ isTrueEnum(schema: SchemaObject, name?: string): name is string;
56
+ /**
57
+ * Creates literal type (or union) from an array of values
58
+ */
59
+ getTypeFromEnum(values: unknown[]): default_2.LiteralTypeNode | default_2.UnionTypeNode;
60
+ getEnumValuesString(values: string[]): string;
61
+ getTrueEnum(schema: SchemaObject, propName: string): default_2.TypeReferenceNode;
62
+ /**
63
+ * Checks if readOnly/writeOnly properties are present in the given schema.
64
+ * Returns a tuple of booleans; the first one is about readOnly, the second
65
+ * one is about writeOnly.
66
+ */
67
+ checkSchemaOnlyMode(schema: SchemaObject | OpenAPIReferenceObject, resolveRefs?: boolean): OnlyModes;
68
+ /**
69
+ * Recursively creates a type literal with the given props.
70
+ */
71
+ getTypeFromProperties(props: {
72
+ [prop: string]: SchemaObject | OpenAPIReferenceObject;
73
+ }, required?: string[], additionalProperties?: boolean | OpenAPISchemaObject | OpenAPIReferenceObject, onlyMode?: OnlyMode): default_2.TypeLiteralNode;
74
+ getTypeFromResponses(responses: OpenAPIResponsesObject, onlyMode?: OnlyMode): default_2.UnionTypeNode;
75
+ getTypeFromResponse(resOrRef: OpenAPIResponseObject | OpenAPIReferenceObject, onlyMode?: OnlyMode): default_2.TypeNode;
76
+ getResponseType(responses?: OpenAPIResponsesObject): "json" | "text" | "blob";
77
+ getSchemaFromContent(content: Record<string, OpenAPIMediaTypeObject>): OpenAPISchemaObject | OpenAPIReferenceObject;
78
+ getTypeFromParameter(p: OpenAPIParameterObject): default_2.TypeNode;
79
+ wrapResult(ex: default_2.Expression): default_2.Expression;
80
+ /**
81
+ * Does three things:
82
+ * 1. Add a `x-component-ref-path` property.
83
+ * 2. Record discriminating schemas in `this.discriminatingSchemas`. A discriminating schema
84
+ * refers to a schema that has a `discriminator` property which is neither used in conjunction
85
+ * with `oneOf` nor `anyOf`.
86
+ * 3. Make all mappings of discriminating schemas explicit to generate types immediately.
87
+ */
88
+ preprocessComponents(schemas: {
89
+ [key: string]: OpenAPIReferenceObject | SchemaObject;
90
+ }): void;
91
+ generateApi(): default_2.SourceFile;
92
+ }
93
+ export default ApiGenerator;
94
+
95
+ export declare function appendNodes<T extends default_2.Node>(array: default_2.NodeArray<T>, ...nodes: T[]): default_2.NodeArray<T>;
96
+
97
+ export declare function block(...statements: default_2.Statement[]): default_2.Block;
98
+
99
+ /**
100
+ * Create a call expression for one of the oazapfts runtime functions.
101
+ */
102
+ export declare function callOazapftsFunction(name: string, args: default_2.Expression[], typeArgs?: default_2.TypeNode[]): default_2.CallExpression;
103
+
104
+ /**
105
+ * Create a call expression for one of the QS runtime functions.
106
+ */
107
+ export declare function callQsFunction(name: string, args: default_2.Expression[]): default_2.CallExpression;
108
+
109
+ export declare function changePropertyValue(o: default_2.ObjectLiteralExpression, property: string, value: default_2.Expression): void;
110
+
111
+ declare type ContentType = "json" | "form" | "multipart";
112
+
113
+ export declare function createArrowFunction(parameters: default_2.ParameterDeclaration[], body: default_2.ConciseBody, { modifiers, typeParameters, type, equalsGreaterThanToken, }?: {
114
+ modifiers?: default_2.Modifier[];
115
+ typeParameters?: default_2.TypeParameterDeclaration[];
116
+ type?: default_2.TypeNode;
117
+ equalsGreaterThanToken?: default_2.EqualsGreaterThanToken;
118
+ }): default_2.ArrowFunction;
119
+
120
+ export declare function createCall(expression: default_2.Expression | string, { typeArgs, args, }?: {
121
+ typeArgs?: Array<default_2.TypeNode>;
122
+ args?: Array<default_2.Expression>;
123
+ }): default_2.CallExpression;
124
+
125
+ export declare function createClassDeclaration({ modifiers, name, typeParameters, heritageClauses, members, }: {
126
+ modifiers?: Array<default_2.Modifier>;
127
+ name?: string | default_2.Identifier;
128
+ typeParameters?: Array<default_2.TypeParameterDeclaration>;
129
+ heritageClauses?: Array<default_2.HeritageClause>;
130
+ members: Array<default_2.ClassElement>;
131
+ }): default_2.ClassDeclaration;
132
+
133
+ export declare function createConstructor({ modifiers, parameters, body, }: {
134
+ modifiers?: Array<default_2.Modifier>;
135
+ parameters: Array<default_2.ParameterDeclaration>;
136
+ body?: default_2.Block;
137
+ }): default_2.ConstructorDeclaration;
138
+
139
+ export declare function createEnumTypeNode(values: Array<string | boolean | number>): default_2.LiteralTypeNode | default_2.UnionTypeNode;
140
+
141
+ export declare function createFunctionDeclaration(name: string | default_2.Identifier | undefined, { modifiers, asteriskToken, typeParameters, type, }: {
142
+ modifiers?: default_2.Modifier[];
143
+ asteriskToken?: default_2.AsteriskToken;
144
+ typeParameters?: default_2.TypeParameterDeclaration[];
145
+ type?: default_2.TypeNode;
146
+ }, parameters: default_2.ParameterDeclaration[], body?: default_2.Block): default_2.FunctionDeclaration;
147
+
148
+ export declare function createIndexSignature(type: default_2.TypeNode, { modifiers, indexName, indexType, }?: {
149
+ indexName?: string;
150
+ indexType?: default_2.TypeNode;
151
+ modifiers?: Array<default_2.Modifier>;
152
+ }): default_2.IndexSignatureDeclaration;
153
+
154
+ export declare function createInterfaceAliasDeclaration({ modifiers, name, typeParameters, type, inheritedNodeNames, }: {
155
+ modifiers?: Array<default_2.Modifier>;
156
+ name: string | default_2.Identifier;
157
+ typeParameters?: Array<default_2.TypeParameterDeclaration>;
158
+ type: default_2.TypeNode;
159
+ inheritedNodeNames?: (string | default_2.Identifier)[];
160
+ }): default_2.InterfaceDeclaration;
161
+
162
+ export declare function createKeywordType(type: KeywordTypeName): default_2.KeywordTypeNode<default_2.SyntaxKind.AnyKeyword> | default_2.KeywordTypeNode<default_2.SyntaxKind.NumberKeyword> | default_2.KeywordTypeNode<default_2.SyntaxKind.ObjectKeyword> | default_2.KeywordTypeNode<default_2.SyntaxKind.StringKeyword> | default_2.KeywordTypeNode<default_2.SyntaxKind.BooleanKeyword> | default_2.KeywordTypeNode<default_2.SyntaxKind.UndefinedKeyword> | default_2.KeywordTypeNode<default_2.SyntaxKind.VoidKeyword> | default_2.LiteralTypeNode;
163
+
164
+ export declare function createLiteral(v: string | boolean | number): default_2.StringLiteral | default_2.TrueLiteral | default_2.FalseLiteral | default_2.NumericLiteral;
165
+
166
+ export declare function createMethod(name: string | default_2.Identifier | default_2.StringLiteral | default_2.NumericLiteral | default_2.ComputedPropertyName, { modifiers, asteriskToken, questionToken, typeParameters, type, }?: {
167
+ modifiers?: default_2.Modifier[];
168
+ asteriskToken?: default_2.AsteriskToken;
169
+ questionToken?: default_2.QuestionToken | boolean;
170
+ typeParameters?: default_2.TypeParameterDeclaration[];
171
+ type?: default_2.TypeNode;
172
+ }, parameters?: default_2.ParameterDeclaration[], body?: default_2.Block): default_2.MethodDeclaration;
173
+
174
+ export declare function createMethodCall(method: string, opts: {
175
+ typeArgs?: Array<default_2.TypeNode>;
176
+ args?: Array<default_2.Expression>;
177
+ }): default_2.CallExpression;
178
+
179
+ export declare function createObjectBinding(elements: Array<{
180
+ name: string | default_2.BindingName;
181
+ dotDotDotToken?: default_2.DotDotDotToken;
182
+ propertyName?: string | default_2.PropertyName;
183
+ initializer?: default_2.Expression;
184
+ }>): default_2.ObjectBindingPattern;
185
+
186
+ export declare function createObjectLiteral(props: [string, string | default_2.Expression][]): default_2.ObjectLiteralExpression;
187
+
188
+ export declare function createParameter(name: string | default_2.BindingName, { modifiers, dotDotDotToken, questionToken, type, initializer, }: {
189
+ modifiers?: Array<default_2.Modifier>;
190
+ dotDotDotToken?: default_2.DotDotDotToken;
191
+ questionToken?: default_2.QuestionToken | boolean;
192
+ type?: default_2.TypeNode;
193
+ initializer?: default_2.Expression;
194
+ }): default_2.ParameterDeclaration;
195
+
196
+ export declare function createPropertyAssignment(name: string, expression: default_2.Expression): default_2.PropertyAssignment | default_2.ShorthandPropertyAssignment;
197
+
198
+ export declare function createPropertySignature({ modifiers, name, questionToken, type, }: {
199
+ modifiers?: Array<default_2.Modifier>;
200
+ name: default_2.PropertyName | string;
201
+ questionToken?: default_2.QuestionToken | boolean;
202
+ type?: default_2.TypeNode;
203
+ }): default_2.PropertySignature;
204
+
205
+ export declare function createQuestionToken(token?: boolean | default_2.QuestionToken): default_2.QuestionToken | undefined;
206
+
207
+ export declare function createTemplateString(head: string, spans: Array<{
208
+ literal: string;
209
+ expression: default_2.Expression;
210
+ }>): default_2.StringLiteral | default_2.TemplateExpression;
211
+
212
+ export declare function createTypeAliasDeclaration({ modifiers, name, typeParameters, type, }: {
213
+ modifiers?: Array<default_2.Modifier>;
214
+ name: string | default_2.Identifier;
215
+ typeParameters?: Array<default_2.TypeParameterDeclaration>;
216
+ type: default_2.TypeNode;
217
+ }): default_2.TypeAliasDeclaration;
218
+
219
+ /**
220
+ * Create a template string literal from the given OpenAPI urlTemplate.
221
+ * Curly braces in the path are turned into identifier expressions,
222
+ * which are read from the local scope during runtime.
223
+ */
224
+ export declare function createUrlExpression(path: string, qs?: default_2.Expression): default_2.StringLiteral | default_2.TemplateExpression;
225
+
226
+ export declare function defaultBaseUrl(servers: OpenAPIV3.ServerObject[]): default_2.StringLiteral;
227
+
228
+ export declare function findFirstVariableDeclaration(nodes: default_2.NodeArray<default_2.Node>, name: string): default_2.VariableDeclaration;
229
+
230
+ export declare function findNode<T extends default_2.Node>(nodes: default_2.NodeArray<default_2.Node>, kind: T extends {
231
+ kind: infer K;
232
+ } ? K : never, test?: (node: T) => boolean | undefined): T;
233
+
234
+ export declare function getBodyFormatter(body?: OpenAPIRequestBodyObject): ContentType | undefined;
235
+
236
+ export declare function getFirstDeclarationName(n: default_2.VariableStatement): string | (void & {
237
+ __escapedIdentifier: void;
238
+ });
239
+
240
+ /**
241
+ * Get the name of a formatter function for a given parameter.
242
+ */
243
+ export declare function getFormatter({ style, explode, content, }: OpenAPIParameterObject): "json" | "form" | "deep" | "explode" | "space" | "pipe";
244
+
245
+ export declare function getName(name: default_2.Node): string | (void & {
246
+ __escapedIdentifier: void;
247
+ });
248
+
249
+ export declare function getOperationIdentifier(id?: string): string | undefined;
250
+
251
+ /**
252
+ * Create a method name for a given operation, either from its operationId or
253
+ * the HTTP verb and path.
254
+ */
255
+ export declare function getOperationName(verb: string, path: string, operationId?: string): string;
256
+
257
+ /**
258
+ * If the given object is a ReferenceObject, return the last part of its path.
259
+ */
260
+ export declare function getReferenceName(obj: unknown): string | undefined;
261
+
262
+ export declare function isJsonMimeType(mime: string): boolean;
263
+
264
+ export declare function isMimeType(s: unknown): boolean;
265
+
266
+ export declare function isNullable(schema?: SchemaObject | OpenAPIReferenceObject): boolean | undefined;
267
+
268
+ export declare function isReference(obj: unknown): obj is OpenAPIReferenceObject;
269
+
270
+ export declare function isValidIdentifier(str: string): boolean;
271
+
272
+ export declare const keywordType: {
273
+ any: default_2.KeywordTypeNode<default_2.SyntaxKind.AnyKeyword>;
274
+ number: default_2.KeywordTypeNode<default_2.SyntaxKind.NumberKeyword>;
275
+ object: default_2.KeywordTypeNode<default_2.SyntaxKind.ObjectKeyword>;
276
+ string: default_2.KeywordTypeNode<default_2.SyntaxKind.StringKeyword>;
277
+ boolean: default_2.KeywordTypeNode<default_2.SyntaxKind.BooleanKeyword>;
278
+ undefined: default_2.KeywordTypeNode<default_2.SyntaxKind.UndefinedKeyword>;
279
+ void: default_2.KeywordTypeNode<default_2.SyntaxKind.VoidKeyword>;
280
+ null: default_2.LiteralTypeNode;
281
+ };
282
+
283
+ declare type KeywordTypeName = keyof typeof keywordType;
284
+
285
+ export declare const modifier: {
286
+ async: default_2.ModifierToken<default_2.SyntaxKind.AsyncKeyword>;
287
+ export: default_2.ModifierToken<default_2.SyntaxKind.ExportKeyword>;
288
+ };
289
+
290
+ declare type OnlyMode = "readOnly" | "writeOnly";
291
+
292
+ declare type OnlyModes = Record<OnlyMode, boolean>;
293
+
294
+ declare type OpenAPIDiscriminatorObject = OpenAPIV3.DiscriminatorObject | OpenAPIV3_1.DiscriminatorObject;
295
+
296
+ declare type OpenAPIDocument = OpenAPIV3.Document | OpenAPIV3_1.Document;
297
+
298
+ declare type OpenAPIMediaTypeObject = OpenAPIV3.MediaTypeObject | OpenAPIV3_1.MediaTypeObject;
299
+
300
+ declare type OpenAPIParameterObject = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject;
301
+
302
+ declare type OpenAPIReferenceObject = OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
303
+
304
+ declare type OpenAPIRequestBodyObject = OpenAPIV3.RequestBodyObject | OpenAPIV3_1.RequestBodyObject;
305
+
306
+ declare type OpenAPIResponseObject = OpenAPIV3.ResponseObject | OpenAPIV3_1.ResponseObject;
307
+
308
+ declare type OpenAPIResponsesObject = OpenAPIV3.ResponsesObject | OpenAPIV3_1.ResponsesObject;
309
+
310
+ declare type OpenAPISchemaObject = OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject;
311
+
312
+ declare type Opts = {
313
+ include?: string[];
314
+ exclude?: string[];
315
+ optimistic?: boolean;
316
+ unionUndefined?: boolean;
317
+ useEnumType?: boolean;
318
+ mergeReadWriteOnly?: boolean;
319
+ argumentStyle?: (typeof optsArgumentStyles)[number];
320
+ };
321
+
322
+ declare const optsArgumentStyles: string[];
323
+
324
+ export declare function printFile(sourceFile: default_2.SourceFile): string;
325
+
326
+ export declare function printNode(node: default_2.Node): string;
327
+
328
+ export declare function printNodes(nodes: default_2.Node[]): string;
329
+
330
+ export declare const questionToken: default_2.PunctuationToken<default_2.SyntaxKind.QuestionToken>;
331
+
332
+ /**
333
+ * Converts a local reference path into an array of property names.
334
+ */
335
+ export declare function refPathToPropertyPath(ref: string): string[];
336
+
337
+ export declare type SchemaObject = OpenAPISchemaObject & {
338
+ const?: unknown;
339
+ "x-enumNames"?: string[];
340
+ "x-enum-varnames"?: string[];
341
+ "x-component-ref-path"?: string;
342
+ prefixItems?: (OpenAPIReferenceObject | SchemaObject)[];
343
+ };
344
+
345
+ /**
346
+ * Despite its name, OpenApi's `deepObject` serialization does not support
347
+ * deeply nested objects. As a workaround we detect parameters that contain
348
+ * square brackets and merge them into a single object.
349
+ */
350
+ export declare function supportDeepObjects(params: OpenAPIParameterObject[]): OpenAPIV3.ParameterObject[];
351
+
352
+ export declare function toExpression(ex: default_2.Expression | string): default_2.Expression;
353
+
354
+ export declare function toIdentifier(s: string, upperFirst?: boolean, onlyMode?: OnlyMode): string;
355
+
356
+ export declare const verbs: string[];
357
+
358
+ export { }