@kubb/plugin-ts 5.0.0-alpha.5 → 5.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/printer.ts CHANGED
@@ -1,32 +1,57 @@
1
- import { jsStringEscape, stringify } from '@internals/utils'
1
+ import { jsStringEscape, pascalCase, stringify } from '@internals/utils'
2
2
  import { isPlainStringType } from '@kubb/ast'
3
3
  import type { ArraySchemaNode, SchemaNode } from '@kubb/ast/types'
4
4
  import type { PrinterFactoryOptions } from '@kubb/core'
5
5
  import { definePrinter } from '@kubb/core'
6
6
  import type ts from 'typescript'
7
+ import { ENUM_TYPES_WITH_KEY_SUFFIX, OPTIONAL_ADDS_QUESTION_TOKEN, OPTIONAL_ADDS_UNDEFINED } from './constants.ts'
7
8
  import * as factory from './factory.ts'
9
+ import type { PluginTs } from './types.ts'
8
10
 
9
11
  type TsOptions = {
10
12
  /**
11
13
  * @default `'questionToken'`
12
14
  */
13
- optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined'
15
+ optionalType: PluginTs['resolvedOptions']['optionalType']
14
16
  /**
15
17
  * @default `'array'`
16
18
  */
17
- arrayType: 'array' | 'generic'
19
+ arrayType: PluginTs['resolvedOptions']['arrayType']
18
20
  /**
19
21
  * @default `'inlineLiteral'`
20
22
  */
21
- enumType: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral'
23
+ enumType: PluginTs['resolvedOptions']['enumType']
22
24
  /**
23
- * Custom property signatures that override specific object properties by name.
25
+ * Controls whether a `type` alias or `interface` declaration is emitted.
26
+ * @default `'type'`
24
27
  */
25
- mapper?: Record<string, ts.PropertySignature>
28
+ syntaxType?: PluginTs['resolvedOptions']['syntaxType']
29
+ /**
30
+ * When set, `printer.print(node)` produces a full `type Name = …` declaration.
31
+ * When omitted, `printer.print(node)` returns the raw type node.
32
+ */
33
+ typeName?: string
34
+
35
+ /**
36
+ * JSDoc `@description` comment added to the generated type or interface declaration.
37
+ */
38
+ description?: string
39
+ /**
40
+ * Property keys to exclude from the generated type via `Omit<Type, Keys>`.
41
+ * Forces type-alias syntax even when `syntaxType` is `'interface'`.
42
+ */
43
+ keysToOmit?: Array<string>
26
44
  }
27
45
 
28
- type TsPrinter = PrinterFactoryOptions<'typescript', TsOptions, ts.TypeNode>
46
+ /**
47
+ * TypeScript printer factory options: maps `SchemaNode` → `ts.TypeNode` (raw) or `ts.Node` (full declaration).
48
+ */
49
+ type TsPrinter = PrinterFactoryOptions<'typescript', TsOptions, ts.TypeNode, ts.Node>
29
50
 
51
+ /**
52
+ * Converts a primitive const value to a TypeScript literal type node.
53
+ * Handles negative numbers via a prefix unary expression.
54
+ */
30
55
  function constToTypeNode(value: string | number | boolean, format: 'string' | 'number' | 'boolean'): ts.TypeNode | undefined {
31
56
  if (format === 'boolean') {
32
57
  return factory.createLiteralTypeNode(value === true ? factory.createTrue() : factory.createFalse())
@@ -40,16 +65,26 @@ function constToTypeNode(value: string | number | boolean, format: 'string' | 'n
40
65
  return factory.createLiteralTypeNode(factory.createStringLiteral(String(value)))
41
66
  }
42
67
 
68
+ /**
69
+ * Returns a `Date` reference type node when `representation` is `'date'`, otherwise falls back to `string`.
70
+ */
43
71
  function dateOrStringNode(node: { representation?: string }): ts.TypeNode {
44
72
  return node.representation === 'date' ? factory.createTypeReferenceNode(factory.createIdentifier('Date')) : factory.keywordTypeNodes.string
45
73
  }
46
74
 
75
+ /**
76
+ * Maps an array of `SchemaNode`s through the printer, filtering out `null` and `undefined` results.
77
+ */
47
78
  function buildMemberNodes(members: Array<SchemaNode> | undefined, print: (node: SchemaNode) => ts.TypeNode | null | undefined): Array<ts.TypeNode> {
48
- return (members ?? []).map(print).filter(Boolean) as Array<ts.TypeNode>
79
+ return (members ?? []).map(print).filter(Boolean)
49
80
  }
50
81
 
82
+ /**
83
+ * Builds a TypeScript tuple type node from an array schema's `items`,
84
+ * applying min/max slice and optional/rest element rules.
85
+ */
51
86
  function buildTupleNode(node: ArraySchemaNode, print: (node: SchemaNode) => ts.TypeNode | null | undefined): ts.TypeNode | undefined {
52
- let items = (node.items ?? []).map(print).filter(Boolean) as Array<ts.TypeNode>
87
+ let items = (node.items ?? []).map(print).filter(Boolean)
53
88
 
54
89
  const restNode = node.rest ? (print(node.rest) ?? undefined) : undefined
55
90
  const { min, max } = node
@@ -72,25 +107,31 @@ function buildTupleNode(node: ArraySchemaNode, print: (node: SchemaNode) => ts.T
72
107
  return factory.createTupleTypeNode(items)
73
108
  }
74
109
 
110
+ /**
111
+ * Applies `nullable` and optional/nullish `| undefined` union modifiers to a property's resolved base type.
112
+ */
75
113
  function buildPropertyType(schema: SchemaNode, baseType: ts.TypeNode, optionalType: TsOptions['optionalType']): ts.TypeNode {
76
- const addsUndefined = ['undefined', 'questionTokenAndUndefined'].includes(optionalType)
114
+ const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(optionalType)
77
115
 
78
116
  let type = baseType
79
117
 
80
118
  if (schema.nullable) {
81
- type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] }) as ts.TypeNode
119
+ type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] })
82
120
  }
83
121
 
84
122
  if ((schema.nullish || schema.optional) && addsUndefined) {
85
- type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] }) as ts.TypeNode
123
+ type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] })
86
124
  }
87
125
 
88
126
  return type
89
127
  }
90
128
 
129
+ /**
130
+ * Collects JSDoc annotation strings (description, deprecated, min/max, pattern, default, example, type) for a schema node.
131
+ */
91
132
  function buildPropertyJSDocComments(schema: SchemaNode): Array<string | undefined> {
92
133
  return [
93
- 'description' in schema && schema.description ? `@description ${jsStringEscape(schema.description as string)}` : undefined,
134
+ 'description' in schema && schema.description ? `@description ${jsStringEscape(schema.description)}` : undefined,
94
135
  'deprecated' in schema && schema.deprecated ? '@deprecated' : undefined,
95
136
  'min' in schema && schema.min !== undefined ? `@minLength ${schema.min}` : undefined,
96
137
  'max' in schema && schema.max !== undefined ? `@maxLength ${schema.max}` : undefined,
@@ -105,6 +146,9 @@ function buildPropertyJSDocComments(schema: SchemaNode): Array<string | undefine
105
146
  ]
106
147
  }
107
148
 
149
+ /**
150
+ * Creates TypeScript index signatures for `additionalProperties` and `patternProperties` on an object schema node.
151
+ */
108
152
  function buildIndexSignatures(
109
153
  node: { additionalProperties?: SchemaNode | boolean; patternProperties?: Record<string, SchemaNode> },
110
154
  propertyCount: number,
@@ -113,7 +157,8 @@ function buildIndexSignatures(
113
157
  const elements: Array<ts.TypeElement> = []
114
158
 
115
159
  if (node.additionalProperties && node.additionalProperties !== true) {
116
- const additionalType = (print(node.additionalProperties as SchemaNode) ?? factory.keywordTypeNodes.unknown) as ts.TypeNode
160
+ const additionalType = print(node.additionalProperties) ?? factory.keywordTypeNodes.unknown
161
+
117
162
  elements.push(factory.createIndexSignature(propertyCount > 0 ? factory.keywordTypeNodes.unknown : additionalType))
118
163
  } else if (node.additionalProperties === true) {
119
164
  elements.push(factory.createIndexSignature(factory.keywordTypeNodes.unknown))
@@ -122,9 +167,10 @@ function buildIndexSignatures(
122
167
  if (node.patternProperties) {
123
168
  const first = Object.values(node.patternProperties)[0]
124
169
  if (first) {
125
- let patternType = (print(first) ?? factory.keywordTypeNodes.unknown) as ts.TypeNode
170
+ let patternType = print(first) ?? factory.keywordTypeNodes.unknown
171
+
126
172
  if (first.nullable) {
127
- patternType = factory.createUnionDeclaration({ nodes: [patternType, factory.keywordTypeNodes.null] }) as ts.TypeNode
173
+ patternType = factory.createUnionDeclaration({ nodes: [patternType, factory.keywordTypeNodes.null] })
128
174
  }
129
175
  elements.push(factory.createIndexSignature(patternType))
130
176
  }
@@ -134,125 +180,189 @@ function buildIndexSignatures(
134
180
  }
135
181
 
136
182
  /**
137
- * Converts a `SchemaNode` AST node into a TypeScript `ts.TypeNode`.
183
+ * TypeScript type printer built with `definePrinter`.
184
+ *
185
+ * Converts a `SchemaNode` AST node into a TypeScript AST node:
186
+ * - **`printer.print(node)`** — when `options.typeName` is set, returns a full
187
+ * `type Name = …` or `interface Name { … }` declaration (`ts.Node`).
188
+ * Without `typeName`, returns the raw `ts.TypeNode` for the schema.
138
189
  *
139
- * Built on `definePrinter` dispatches on `node.type`, with options closed over
140
- * per printer instance. Produces the same `ts.TypeNode` output as the keyword-based
141
- * `parse` in `parser.ts`.
190
+ * Dispatches on `node.type` to the appropriate handler in `nodes`. Options are closed
191
+ * over per printer instance, so each call to `printerTs(options)` produces an independent printer.
192
+ *
193
+ * @example Raw type node (no `typeName`)
194
+ * ```ts
195
+ * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enumType: 'inlineLiteral' })
196
+ * const typeNode = printer.print(schemaNode) // ts.TypeNode
197
+ * ```
198
+ *
199
+ * @example Full declaration (with `typeName`)
200
+ * ```ts
201
+ * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enumType: 'inlineLiteral', typeName: 'MyType' })
202
+ * const declaration = printer.print(schemaNode) // ts.TypeAliasDeclaration | ts.InterfaceDeclaration
203
+ * ```
142
204
  */
143
- export const printerTs = definePrinter<TsPrinter>((options) => ({
144
- name: 'typescript',
145
- options,
146
- nodes: {
147
- any: () => factory.keywordTypeNodes.any,
148
- unknown: () => factory.keywordTypeNodes.unknown,
149
- void: () => factory.keywordTypeNodes.void,
150
- never: () => factory.keywordTypeNodes.never,
151
- boolean: () => factory.keywordTypeNodes.boolean,
152
- null: () => factory.keywordTypeNodes.null,
153
- blob: () => factory.createTypeReferenceNode('Blob', []),
154
- string: () => factory.keywordTypeNodes.string,
155
- uuid: () => factory.keywordTypeNodes.string,
156
- email: () => factory.keywordTypeNodes.string,
157
- url: (node) => {
158
- if (node.path) {
159
- return factory.createUrlTemplateType(node.path)
160
- }
161
- return factory.keywordTypeNodes.string
162
- },
163
- datetime: () => factory.keywordTypeNodes.string,
164
- number: () => factory.keywordTypeNodes.number,
165
- integer: () => factory.keywordTypeNodes.number,
166
- bigint: () => factory.keywordTypeNodes.bigint,
167
- date: (node) => dateOrStringNode(node),
168
- time: (node) => dateOrStringNode(node),
169
- ref(node) {
170
- if (!node.name) {
171
- return undefined
172
- }
173
- return factory.createTypeReferenceNode(node.name, undefined)
174
- },
175
- enum(node) {
176
- const values = node.namedEnumValues?.map((v) => v.value) ?? node.enumValues ?? []
205
+ export const printerTs = definePrinter<TsPrinter>((options) => {
206
+ const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(options.optionalType)
207
+
208
+ return {
209
+ name: 'typescript',
210
+ options,
211
+ nodes: {
212
+ any: () => factory.keywordTypeNodes.any,
213
+ unknown: () => factory.keywordTypeNodes.unknown,
214
+ void: () => factory.keywordTypeNodes.void,
215
+ never: () => factory.keywordTypeNodes.never,
216
+ boolean: () => factory.keywordTypeNodes.boolean,
217
+ null: () => factory.keywordTypeNodes.null,
218
+ blob: () => factory.createTypeReferenceNode('Blob', []),
219
+ string: () => factory.keywordTypeNodes.string,
220
+ uuid: () => factory.keywordTypeNodes.string,
221
+ email: () => factory.keywordTypeNodes.string,
222
+ url: (node) => {
223
+ if (node.path) {
224
+ return factory.createUrlTemplateType(node.path)
225
+ }
226
+ return factory.keywordTypeNodes.string
227
+ },
228
+ datetime: () => factory.keywordTypeNodes.string,
229
+ number: () => factory.keywordTypeNodes.number,
230
+ integer: () => factory.keywordTypeNodes.number,
231
+ bigint: () => factory.keywordTypeNodes.bigint,
232
+ date: dateOrStringNode,
233
+ time: dateOrStringNode,
234
+ ref(node) {
235
+ if (!node.name) {
236
+ return undefined
237
+ }
238
+ return factory.createTypeReferenceNode(node.name, undefined)
239
+ },
240
+ enum(node) {
241
+ const values = node.namedEnumValues?.map((v) => v.value) ?? node.enumValues ?? []
242
+
243
+ if (this.options.enumType === 'inlineLiteral' || !node.name) {
244
+ const literalNodes = values
245
+ .filter((v): v is string | number | boolean => v !== null)
246
+ .map((value) => constToTypeNode(value, typeof value as 'string' | 'number' | 'boolean'))
247
+ .filter(Boolean)
248
+
249
+ return factory.createUnionDeclaration({ withParentheses: true, nodes: literalNodes }) ?? undefined
250
+ }
177
251
 
178
- if (this.options.enumType === 'inlineLiteral' || !node.name) {
179
- const literalNodes = values
180
- .filter((v): v is string | number | boolean => v !== null)
181
- .map((value) => constToTypeNode(value, typeof value === 'number' ? 'number' : typeof value === 'boolean' ? 'boolean' : 'string'))
182
- .filter(Boolean) as Array<ts.TypeNode>
252
+ const resolvedName = pascalCase(node.name)
253
+ const typeName = ENUM_TYPES_WITH_KEY_SUFFIX.has(this.options.enumType) ? `${resolvedName}Key` : resolvedName
183
254
 
184
- return factory.createUnionDeclaration({ withParentheses: true, nodes: literalNodes }) ?? undefined
185
- }
255
+ return factory.createTypeReferenceNode(typeName, undefined)
256
+ },
257
+ union(node) {
258
+ const members = node.members ?? []
186
259
 
187
- const typeName = ['asConst', 'asPascalConst'].includes(this.options.enumType) ? `${node.name}Key` : node.name
260
+ const hasStringLiteral = members.some((m) => m.type === 'enum' && m.enumType === 'string')
261
+ const hasPlainString = members.some((m) => isPlainStringType(m))
188
262
 
189
- return factory.createTypeReferenceNode(typeName, undefined)
190
- },
191
- union(node) {
192
- const members = node.members ?? []
193
-
194
- const hasStringLiteral = members.some((m) => m.type === 'enum' && m.enumType === 'string')
195
- const hasPlainString = members.some((m) => isPlainStringType(m))
196
-
197
- if (hasStringLiteral && hasPlainString) {
198
- const nodes = members
199
- .map((m) => {
200
- if (isPlainStringType(m)) {
201
- return factory.createIntersectionDeclaration({
202
- nodes: [factory.keywordTypeNodes.string, factory.createTypeLiteralNode([])],
203
- withParentheses: true,
204
- }) as ts.TypeNode
205
- }
206
-
207
- return this.print(m)
208
- })
209
- .filter(Boolean) as Array<ts.TypeNode>
263
+ if (hasStringLiteral && hasPlainString) {
264
+ const memberNodes = members
265
+ .map((m) => {
266
+ if (isPlainStringType(m)) {
267
+ return factory.createIntersectionDeclaration({
268
+ nodes: [factory.keywordTypeNodes.string, factory.createTypeLiteralNode([])],
269
+ withParentheses: true,
270
+ })
271
+ }
210
272
 
211
- return factory.createUnionDeclaration({ withParentheses: true, nodes }) ?? undefined
212
- }
273
+ return this.print(m)
274
+ })
275
+ .filter(Boolean)
213
276
 
214
- return factory.createUnionDeclaration({ withParentheses: true, nodes: buildMemberNodes(members, this.print) }) ?? undefined
215
- },
216
- intersection(node) {
217
- return factory.createIntersectionDeclaration({ withParentheses: true, nodes: buildMemberNodes(node.members, this.print) }) ?? undefined
218
- },
219
- array(node) {
220
- const itemNodes = (node.items ?? []).map((item) => this.print(item)).filter(Boolean) as Array<ts.TypeNode>
277
+ return factory.createUnionDeclaration({ withParentheses: true, nodes: memberNodes }) ?? undefined
278
+ }
221
279
 
222
- return factory.createArrayDeclaration({ nodes: itemNodes, arrayType: this.options.arrayType }) ?? undefined
223
- },
224
- tuple(node) {
225
- return buildTupleNode(node, this.print)
226
- },
227
- object(node) {
228
- const addsQuestionToken = ['questionToken', 'questionTokenAndUndefined'].includes(this.options.optionalType)
229
- const { print } = this
280
+ return factory.createUnionDeclaration({ withParentheses: true, nodes: buildMemberNodes(members, this.print) }) ?? undefined
281
+ },
282
+ intersection(node) {
283
+ return factory.createIntersectionDeclaration({ withParentheses: true, nodes: buildMemberNodes(node.members, this.print) }) ?? undefined
284
+ },
285
+ array(node) {
286
+ const itemNodes = (node.items ?? []).map((item) => this.print(item)).filter(Boolean)
287
+
288
+ return factory.createArrayDeclaration({ nodes: itemNodes, arrayType: this.options.arrayType }) ?? undefined
289
+ },
290
+ tuple(node) {
291
+ return buildTupleNode(node, this.print)
292
+ },
293
+ object(node) {
294
+ const { print, options } = this
295
+ const addsQuestionToken = OPTIONAL_ADDS_QUESTION_TOKEN.has(options.optionalType)
296
+
297
+ const propertyNodes: Array<ts.TypeElement> = node.properties.map((prop) => {
298
+ const baseType = print(prop.schema) ?? factory.keywordTypeNodes.unknown
299
+ const type = buildPropertyType(prop.schema, baseType, options.optionalType)
300
+
301
+ const propertyNode = factory.createPropertySignature({
302
+ questionToken: prop.schema.optional || prop.schema.nullish ? addsQuestionToken : false,
303
+ name: prop.name,
304
+ type,
305
+ readOnly: prop.schema.readOnly,
306
+ })
307
+
308
+ return factory.appendJSDocToNode({ node: propertyNode, comments: buildPropertyJSDocComments(prop.schema) })
309
+ })
230
310
 
231
- const propertyNodes: Array<ts.TypeElement> = node.properties.map((prop) => {
232
- if (this.options.mapper && Object.hasOwn(this.options.mapper, prop.name)) {
233
- return this.options.mapper[prop.name]!
311
+ const allElements = [...propertyNodes, ...buildIndexSignatures(node, propertyNodes.length, print)]
312
+
313
+ if (!allElements.length) {
314
+ return factory.keywordTypeNodes.object
234
315
  }
235
316
 
236
- const baseType = (print(prop.schema) ?? factory.keywordTypeNodes.unknown) as ts.TypeNode
237
- const type = buildPropertyType(prop.schema, baseType, this.options.optionalType)
317
+ return factory.createTypeLiteralNode(allElements)
318
+ },
319
+ },
320
+ print(node) {
321
+ let type = this.print(node)
238
322
 
239
- const propertyNode = factory.createPropertySignature({
240
- questionToken: prop.schema.optional || prop.schema.nullish ? addsQuestionToken : false,
241
- name: prop.name,
242
- type,
243
- readOnly: prop.schema.readOnly,
244
- })
323
+ if (!type) {
324
+ return undefined
325
+ }
245
326
 
246
- return factory.appendJSDocToNode({ node: propertyNode, comments: buildPropertyJSDocComments(prop.schema) })
247
- })
327
+ // Apply top-level nullable / optional union modifiers.
328
+ if (node.nullable) {
329
+ type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] })
330
+ }
248
331
 
249
- const allElements = [...propertyNodes, ...buildIndexSignatures(node, propertyNodes.length, print)]
332
+ if ((node.nullish || node.optional) && addsUndefined) {
333
+ type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] })
334
+ }
250
335
 
251
- if (!allElements.length) {
252
- return factory.keywordTypeNodes.object
336
+ // Without typeName, return the type node as-is (no declaration wrapping).
337
+ const { typeName, syntaxType = 'type', description, keysToOmit } = this.options
338
+ if (!typeName) {
339
+ return type
253
340
  }
254
341
 
255
- return factory.createTypeLiteralNode(allElements)
342
+ const useTypeGeneration = syntaxType === 'type' || type.kind === factory.syntaxKind.union || !!keysToOmit?.length
343
+
344
+ return factory.createTypeDeclaration({
345
+ name: typeName,
346
+ isExportable: true,
347
+ type: keysToOmit?.length
348
+ ? factory.createOmitDeclaration({
349
+ keys: keysToOmit,
350
+ type,
351
+ nonNullable: true,
352
+ })
353
+ : type,
354
+ syntax: useTypeGeneration ? 'type' : 'interface',
355
+ comments: [
356
+ node?.title ? jsStringEscape(node.title) : undefined,
357
+ description ? `@description ${jsStringEscape(description)}` : undefined,
358
+ node?.deprecated ? '@deprecated' : undefined,
359
+ node && 'min' in node && node.min !== undefined ? `@minLength ${node.min}` : undefined,
360
+ node && 'max' in node && node.max !== undefined ? `@maxLength ${node.max}` : undefined,
361
+ node && 'pattern' in node && node.pattern ? `@pattern ${node.pattern}` : undefined,
362
+ node?.default ? `@default ${node.default}` : undefined,
363
+ node?.example ? `@example ${node.example}` : undefined,
364
+ ],
365
+ })
256
366
  },
257
- },
258
- }))
367
+ }
368
+ })
package/src/types.ts CHANGED
@@ -2,7 +2,6 @@ import type { Group, Output, PluginFactoryOptions, ResolveNameParams } from '@ku
2
2
  import type { contentType, Oas } from '@kubb/oas'
3
3
  import type { Exclude, Include, Override, ResolvePathOptions } from '@kubb/plugin-oas'
4
4
  import type { Generator } from '@kubb/plugin-oas/generators'
5
- import type ts from 'typescript'
6
5
 
7
6
  export type Options = {
8
7
  /**
@@ -127,17 +126,6 @@ export type Options = {
127
126
  */
128
127
  name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string
129
128
  }
130
- /**
131
- * @example
132
- * Use https://ts-ast-viewer.com to generate factory code(see createPropertySignature)
133
- * category: factory.createPropertySignature(
134
- * undefined,
135
- * factory.createIdentifier("category"),
136
- * factory.createToken(ts.SyntaxKind.QuestionToken),
137
- * factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword)
138
- * )
139
- */
140
- mapper?: Record<string, ts.PropertySignature>
141
129
  /**
142
130
  * How to style your params, by default no casing is applied
143
131
  * - 'camelcase' uses camelCase for pathParams, queryParams and headerParams property names
@@ -170,7 +158,6 @@ type ResolvedOptions = {
170
158
  arrayType: NonNullable<Options['arrayType']>
171
159
  transformers: NonNullable<Options['transformers']>
172
160
  syntaxType: NonNullable<Options['syntaxType']>
173
- mapper: Record<string, any>
174
161
  paramsCasing: Options['paramsCasing']
175
162
  }
176
163