@twin.org/tools-core 0.0.3-next.14 → 0.0.3-next.16

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.
Files changed (133) hide show
  1. package/README.md +2 -2
  2. package/dist/es/index.js +20 -11
  3. package/dist/es/index.js.map +1 -1
  4. package/dist/es/models/ITypeScriptToSchemaContext.js +2 -0
  5. package/dist/es/models/ITypeScriptToSchemaContext.js.map +1 -0
  6. package/dist/es/models/ITypeScriptToSchemaDiagnostics.js +4 -0
  7. package/dist/es/models/ITypeScriptToSchemaDiagnostics.js.map +1 -0
  8. package/dist/es/models/ITypeScriptToSchemaOptions.js +4 -0
  9. package/dist/es/models/ITypeScriptToSchemaOptions.js.map +1 -0
  10. package/dist/es/utils/constants.js +43 -0
  11. package/dist/es/utils/constants.js.map +1 -0
  12. package/dist/es/utils/diagnosticReporter.js +32 -0
  13. package/dist/es/utils/diagnosticReporter.js.map +1 -0
  14. package/dist/es/utils/disallowedTypeGuard.js +151 -0
  15. package/dist/es/utils/disallowedTypeGuard.js.map +1 -0
  16. package/dist/es/utils/enum.js +152 -0
  17. package/dist/es/utils/enum.js.map +1 -0
  18. package/dist/es/utils/fileUtils.js +130 -0
  19. package/dist/es/utils/fileUtils.js.map +1 -0
  20. package/dist/es/utils/importTypeQuerySchemaResolver.js +328 -0
  21. package/dist/es/utils/importTypeQuerySchemaResolver.js.map +1 -0
  22. package/dist/es/utils/indexSignaturePatternResolver.js +94 -0
  23. package/dist/es/utils/indexSignaturePatternResolver.js.map +1 -0
  24. package/dist/es/utils/intersectionSchemaMerger.js +85 -0
  25. package/dist/es/utils/intersectionSchemaMerger.js.map +1 -0
  26. package/dist/es/utils/jsonSchemaBuilder.js +3189 -0
  27. package/dist/es/utils/jsonSchemaBuilder.js.map +1 -0
  28. package/dist/es/utils/mappedTypeSchemaResolver.js +231 -0
  29. package/dist/es/utils/mappedTypeSchemaResolver.js.map +1 -0
  30. package/dist/es/utils/objectTransformer.js +162 -0
  31. package/dist/es/utils/objectTransformer.js.map +1 -0
  32. package/dist/es/utils/regEx.js +128 -0
  33. package/dist/es/utils/regEx.js.map +1 -0
  34. package/dist/es/utils/resolver.js +164 -0
  35. package/dist/es/utils/resolver.js.map +1 -0
  36. package/dist/es/utils/templateLiteralPatternBuilder.js +94 -0
  37. package/dist/es/utils/templateLiteralPatternBuilder.js.map +1 -0
  38. package/dist/es/utils/typeScriptToSchema.js +102 -0
  39. package/dist/es/utils/typeScriptToSchema.js.map +1 -0
  40. package/dist/es/utils/utility.js +134 -0
  41. package/dist/es/utils/utility.js.map +1 -0
  42. package/dist/es/utils/utilityTypeSchemaMapper.js +412 -0
  43. package/dist/es/utils/utilityTypeSchemaMapper.js.map +1 -0
  44. package/dist/types/index.d.ts +20 -11
  45. package/dist/types/models/ITypeScriptToSchemaContext.d.ts +64 -0
  46. package/dist/types/models/ITypeScriptToSchemaDiagnostics.d.ts +31 -0
  47. package/dist/types/models/ITypeScriptToSchemaOptions.d.ts +22 -0
  48. package/dist/types/utils/constants.d.ts +13 -0
  49. package/dist/types/utils/diagnosticReporter.d.ts +17 -0
  50. package/dist/types/utils/disallowedTypeGuard.d.ts +16 -0
  51. package/dist/types/utils/enum.d.ts +42 -0
  52. package/dist/types/utils/fileUtils.d.ts +66 -0
  53. package/dist/types/utils/importTypeQuerySchemaResolver.d.ts +52 -0
  54. package/dist/types/utils/indexSignaturePatternResolver.d.ts +21 -0
  55. package/dist/types/utils/intersectionSchemaMerger.d.ts +16 -0
  56. package/dist/types/utils/jsonSchemaBuilder.d.ts +721 -0
  57. package/dist/types/utils/mappedTypeSchemaResolver.d.ts +46 -0
  58. package/dist/types/utils/objectTransformer.d.ts +33 -0
  59. package/dist/types/utils/regEx.d.ts +24 -0
  60. package/dist/types/utils/resolver.d.ts +16 -0
  61. package/dist/types/utils/templateLiteralPatternBuilder.d.ts +12 -0
  62. package/dist/types/utils/typeScriptToSchema.d.ts +31 -0
  63. package/dist/types/utils/utility.d.ts +58 -0
  64. package/dist/types/utils/utilityTypeSchemaMapper.d.ts +92 -0
  65. package/docs/changelog.md +22 -1
  66. package/docs/examples.md +87 -1
  67. package/docs/reference/classes/Constants.md +29 -0
  68. package/docs/reference/classes/DiagnosticReporter.md +49 -0
  69. package/docs/reference/classes/DisallowedTypeGuard.md +35 -0
  70. package/docs/reference/classes/Enum.md +93 -0
  71. package/docs/reference/classes/FileUtils.md +237 -0
  72. package/docs/reference/classes/ImportTypeQuerySchemaResolver.md +87 -0
  73. package/docs/reference/classes/IndexSignaturePatternResolver.md +69 -0
  74. package/docs/reference/classes/IntersectionSchemaMerger.md +48 -0
  75. package/docs/reference/classes/JsonSchemaBuilder.md +2772 -0
  76. package/docs/reference/classes/MappedTypeSchemaResolver.md +211 -0
  77. package/docs/reference/classes/ObjectTransformer.md +119 -0
  78. package/docs/reference/classes/RegEx.md +99 -0
  79. package/docs/reference/classes/Resolver.md +41 -0
  80. package/docs/reference/classes/TemplateLiteralPatternBuilder.md +35 -0
  81. package/docs/reference/classes/TypeScriptToSchema.md +91 -0
  82. package/docs/reference/classes/Utility.md +164 -0
  83. package/docs/reference/classes/UtilityTypeSchemaMapper.md +341 -0
  84. package/docs/reference/index.md +20 -14
  85. package/docs/reference/interfaces/ITypeScriptToSchemaContext.md +113 -0
  86. package/docs/reference/interfaces/ITypeScriptToSchemaDiagnostics.md +55 -0
  87. package/docs/reference/interfaces/ITypeScriptToSchemaOptions.md +44 -0
  88. package/locales/en.json +30 -1
  89. package/package.json +4 -3
  90. package/dist/es/models/IJsonSchema.js +0 -2
  91. package/dist/es/models/IJsonSchema.js.map +0 -1
  92. package/dist/es/models/IOpenApi.js +0 -2
  93. package/dist/es/models/IOpenApi.js.map +0 -1
  94. package/dist/es/models/IOpenApiExample.js +0 -4
  95. package/dist/es/models/IOpenApiExample.js.map +0 -1
  96. package/dist/es/models/IOpenApiHeader.js +0 -4
  97. package/dist/es/models/IOpenApiHeader.js.map +0 -1
  98. package/dist/es/models/IOpenApiPathMethod.js +0 -2
  99. package/dist/es/models/IOpenApiPathMethod.js.map +0 -1
  100. package/dist/es/models/IOpenApiResponse.js +0 -2
  101. package/dist/es/models/IOpenApiResponse.js.map +0 -1
  102. package/dist/es/models/IOpenApiSecurityScheme.js +0 -4
  103. package/dist/es/models/IOpenApiSecurityScheme.js.map +0 -1
  104. package/dist/es/models/IPackageJson.js +0 -4
  105. package/dist/es/models/IPackageJson.js.map +0 -1
  106. package/dist/es/models/jsonTypeName.js +0 -2
  107. package/dist/es/models/jsonTypeName.js.map +0 -1
  108. package/dist/es/utils/jsonSchemaHelper.js +0 -282
  109. package/dist/es/utils/jsonSchemaHelper.js.map +0 -1
  110. package/dist/es/utils/openApiHelper.js +0 -12
  111. package/dist/es/utils/openApiHelper.js.map +0 -1
  112. package/dist/types/models/IJsonSchema.d.ts +0 -5
  113. package/dist/types/models/IOpenApi.d.ts +0 -54
  114. package/dist/types/models/IOpenApiExample.d.ts +0 -13
  115. package/dist/types/models/IOpenApiHeader.d.ts +0 -19
  116. package/dist/types/models/IOpenApiPathMethod.d.ts +0 -65
  117. package/dist/types/models/IOpenApiResponse.d.ts +0 -32
  118. package/dist/types/models/IOpenApiSecurityScheme.d.ts +0 -25
  119. package/dist/types/models/IPackageJson.d.ts +0 -15
  120. package/dist/types/models/jsonTypeName.d.ts +0 -5
  121. package/dist/types/utils/jsonSchemaHelper.d.ts +0 -78
  122. package/dist/types/utils/openApiHelper.d.ts +0 -9
  123. package/docs/reference/classes/JsonSchemaHelper.md +0 -233
  124. package/docs/reference/classes/OpenApiHelper.md +0 -21
  125. package/docs/reference/interfaces/IOpenApi.md +0 -103
  126. package/docs/reference/interfaces/IOpenApiExample.md +0 -19
  127. package/docs/reference/interfaces/IOpenApiHeader.md +0 -31
  128. package/docs/reference/interfaces/IOpenApiPathMethod.md +0 -119
  129. package/docs/reference/interfaces/IOpenApiResponse.md +0 -35
  130. package/docs/reference/interfaces/IOpenApiSecurityScheme.md +0 -43
  131. package/docs/reference/interfaces/IPackageJson.md +0 -23
  132. package/docs/reference/type-aliases/IJsonSchema.md +0 -5
  133. package/docs/reference/type-aliases/JsonTypeName.md +0 -5
@@ -0,0 +1,2772 @@
1
+ # Class: JsonSchemaBuilder
2
+
3
+ Builder for composing JSON schema fragments from TypeScript AST nodes.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new JsonSchemaBuilder**(): `JsonSchemaBuilder`
10
+
11
+ #### Returns
12
+
13
+ `JsonSchemaBuilder`
14
+
15
+ ## Properties
16
+
17
+ ### SCHEMA\_VERSION {#schema_version}
18
+
19
+ > `readonly` `static` **SCHEMA\_VERSION**: `"https://json-schema.org/draft/2020-12/schema"` = `"https://json-schema.org/draft/2020-12/schema"`
20
+
21
+ The JSON Schema version used.
22
+
23
+ ***
24
+
25
+ ### CLASS\_NAME {#class_name}
26
+
27
+ > `readonly` `static` **CLASS\_NAME**: `string`
28
+
29
+ Runtime name for the class.
30
+
31
+ ## Methods
32
+
33
+ ### parseAllObjectSchemas() {#parseallobjectschemas}
34
+
35
+ > `static` **parseAllObjectSchemas**(`context`, `sourceFilePath`, `source`, `visitedFiles`): `string`[]
36
+
37
+ Parse all object declarations from a source file.
38
+
39
+ #### Parameters
40
+
41
+ ##### context
42
+
43
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
44
+
45
+ The generation context.
46
+
47
+ ##### sourceFilePath
48
+
49
+ `string`
50
+
51
+ The source file path.
52
+
53
+ ##### source
54
+
55
+ `string`
56
+
57
+ The TypeScript source.
58
+
59
+ ##### visitedFiles
60
+
61
+ `string`[]
62
+
63
+ The list of visited source files.
64
+
65
+ #### Returns
66
+
67
+ `string`[]
68
+
69
+ The generated schema titles.
70
+
71
+ ***
72
+
73
+ ### applyJsonSchemaTags() {#applyjsonschematags}
74
+
75
+ > `static` **applyJsonSchemaTags**(`schema`, `node`): `void`
76
+
77
+ Apply
78
+
79
+ #### Parameters
80
+
81
+ ##### schema
82
+
83
+ `Partial`\<`IJsonSchema`\>
84
+
85
+ The schema to expand.
86
+
87
+ ##### node
88
+
89
+ `Node`
90
+
91
+ The node to inspect for tags.
92
+
93
+ #### Returns
94
+
95
+ `void`
96
+
97
+ #### Throws
98
+
99
+ GeneralError Thrown when a tag key is not supported by IJsonSchema.
100
+
101
+ ***
102
+
103
+ ### isAllowedJsonSchemaTagKey() {#isallowedjsonschematagkey}
104
+
105
+ > `static` **isAllowedJsonSchemaTagKey**(`key`): `boolean`
106
+
107
+ Determine whether a mapped
108
+
109
+ #### Parameters
110
+
111
+ ##### key
112
+
113
+ `string`
114
+
115
+ The mapped schema key.
116
+
117
+ #### Returns
118
+
119
+ `boolean`
120
+
121
+ True if the key is supported.
122
+
123
+ ***
124
+
125
+ ### buildBaseSchema() {#buildbaseschema}
126
+
127
+ > `static` **buildBaseSchema**(`namespace`, `title`, `statement`): `Partial`\<`IJsonSchema`\>
128
+
129
+ Build the base schema with common properties.
130
+
131
+ #### Parameters
132
+
133
+ ##### namespace
134
+
135
+ `string`
136
+
137
+ The namespace for generated schema id.
138
+
139
+ ##### title
140
+
141
+ `string`
142
+
143
+ The schema title.
144
+
145
+ ##### statement
146
+
147
+ `Node`
148
+
149
+ The type statement node.
150
+
151
+ #### Returns
152
+
153
+ `Partial`\<`IJsonSchema`\>
154
+
155
+ The base schema to be expanded.
156
+
157
+ ***
158
+
159
+ ### buildEnumSchema() {#buildenumschema}
160
+
161
+ > `static` **buildEnumSchema**(`schema`, `entries`): `void`
162
+
163
+ Add enum information to a schema.
164
+
165
+ #### Parameters
166
+
167
+ ##### schema
168
+
169
+ `Partial`\<`IJsonSchema`\>
170
+
171
+ The schema to expand.
172
+
173
+ ##### entries
174
+
175
+ `object`[]
176
+
177
+ The enum entries.
178
+
179
+ #### Returns
180
+
181
+ `void`
182
+
183
+ ***
184
+
185
+ ### buildObjectSchema() {#buildobjectschema}
186
+
187
+ > `static` **buildObjectSchema**(`context`, `schema`, `members`): `void`
188
+
189
+ Build an object schema from interface or type literal members.
190
+
191
+ #### Parameters
192
+
193
+ ##### context
194
+
195
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
196
+
197
+ The generation context.
198
+
199
+ ##### schema
200
+
201
+ `Partial`\<`IJsonSchema`\>
202
+
203
+ The schema to expand.
204
+
205
+ ##### members
206
+
207
+ `NodeArray`\<`TypeElement`\>
208
+
209
+ The members to process.
210
+
211
+ #### Returns
212
+
213
+ `void`
214
+
215
+ ***
216
+
217
+ ### buildObjectMembersSchema() {#buildobjectmembersschema}
218
+
219
+ > `static` **buildObjectMembersSchema**(`context`, `members`): `object`
220
+
221
+ Build property schemas and required list from type members.
222
+
223
+ #### Parameters
224
+
225
+ ##### context
226
+
227
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
228
+
229
+ The generation context.
230
+
231
+ ##### members
232
+
233
+ `NodeArray`\<`TypeElement`\>
234
+
235
+ The members to process.
236
+
237
+ #### Returns
238
+
239
+ `object`
240
+
241
+ The object property schema map and required list.
242
+
243
+ ##### properties
244
+
245
+ > **properties**: `object`
246
+
247
+ ###### Index Signature
248
+
249
+ \[`key`: `string`\]: `IJsonSchema`
250
+
251
+ ##### required
252
+
253
+ > **required**: `string`[]
254
+
255
+ ##### patternProperties?
256
+
257
+ > `optional` **patternProperties?**: `object`
258
+
259
+ ###### Index Signature
260
+
261
+ \[`pattern`: `string`\]: `IJsonSchema`
262
+
263
+ ##### additionalProperties?
264
+
265
+ > `optional` **additionalProperties?**: `IJsonSchema`
266
+
267
+ ##### propertyNames?
268
+
269
+ > `optional` **propertyNames?**: `IJsonSchema`
270
+
271
+ ***
272
+
273
+ ### buildTypeLiteralSchema() {#buildtypeliteralschema}
274
+
275
+ > `static` **buildTypeLiteralSchema**(`context`, `typeNode`): `IJsonSchema`
276
+
277
+ Build an object schema from a type literal node.
278
+
279
+ #### Parameters
280
+
281
+ ##### context
282
+
283
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
284
+
285
+ The generation context.
286
+
287
+ ##### typeNode
288
+
289
+ `TypeLiteralNode`
290
+
291
+ The type literal node.
292
+
293
+ #### Returns
294
+
295
+ `IJsonSchema`
296
+
297
+ The object schema.
298
+
299
+ ***
300
+
301
+ ### mergePatternPropertySchemas() {#mergepatternpropertyschemas}
302
+
303
+ > `static` **mergePatternPropertySchemas**(`patternPropertySchemas`): \{\[`pattern`: `string`\]: `IJsonSchema`; \} \| `undefined`
304
+
305
+ Merge pattern property schemas by pattern, deduplicating equivalent branches.
306
+
307
+ #### Parameters
308
+
309
+ ##### patternPropertySchemas
310
+
311
+ `object`[]
312
+
313
+ Pattern and schema entries to merge.
314
+
315
+ #### Returns
316
+
317
+ \{\[`pattern`: `string`\]: `IJsonSchema`; \} \| `undefined`
318
+
319
+ Merged patternProperties map.
320
+
321
+ ***
322
+
323
+ ### mapMemberTypeToSchema() {#mapmembertypetoschema}
324
+
325
+ > `static` **mapMemberTypeToSchema**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
326
+
327
+ Map a property type node to schema.
328
+
329
+ #### Parameters
330
+
331
+ ##### context
332
+
333
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
334
+
335
+ The generation context.
336
+
337
+ ##### typeNode
338
+
339
+ `TypeNode`
340
+
341
+ The member type node.
342
+
343
+ #### Returns
344
+
345
+ `IJsonSchema` \| `undefined`
346
+
347
+ The mapped member schema.
348
+
349
+ ***
350
+
351
+ ### mapTypeNodeToSchema() {#maptypenodetoschema}
352
+
353
+ > `static` **mapTypeNodeToSchema**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
354
+
355
+ Map TypeScript type nodes to JSON schema.
356
+
357
+ #### Parameters
358
+
359
+ ##### context
360
+
361
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
362
+
363
+ The generation context.
364
+
365
+ ##### typeNode
366
+
367
+ `TypeNode`
368
+
369
+ The node to process.
370
+
371
+ #### Returns
372
+
373
+ `IJsonSchema` \| `undefined`
374
+
375
+ The mapped schema.
376
+
377
+ ***
378
+
379
+ ### isNeverDiscriminatedObjectUnion() {#isneverdiscriminatedobjectunion}
380
+
381
+ > `static` **isNeverDiscriminatedObjectUnion**(`context`, `unionTypeNodes`, `unionSchemas`): `boolean`
382
+
383
+ Determine whether a union of schemas represents mutually exclusive object branches.
384
+
385
+ #### Parameters
386
+
387
+ ##### context
388
+
389
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
390
+
391
+ The generation context.
392
+
393
+ ##### unionTypeNodes
394
+
395
+ `NodeArray`\<`TypeNode`\>
396
+
397
+ The union branch type nodes for cross-checking with the mapped schemas.
398
+
399
+ ##### unionSchemas
400
+
401
+ `IJsonSchema`[]
402
+
403
+ The mapped union branch schemas.
404
+
405
+ #### Returns
406
+
407
+ `boolean`
408
+
409
+ True if each branch is an object schema with a unique required key set.
410
+
411
+ ***
412
+
413
+ ### isLiteralTagDiscriminatedObjectUnion() {#isliteraltagdiscriminatedobjectunion}
414
+
415
+ > `static` **isLiteralTagDiscriminatedObjectUnion**(`context`, `unionSchemas`): `boolean`
416
+
417
+ Determine whether object union branches are discriminated by a shared required literal tag.
418
+
419
+ #### Parameters
420
+
421
+ ##### context
422
+
423
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
424
+
425
+ The generation context.
426
+
427
+ ##### unionSchemas
428
+
429
+ `IJsonSchema`[]
430
+
431
+ The mapped union branch schemas.
432
+
433
+ #### Returns
434
+
435
+ `boolean`
436
+
437
+ True if the union can be safely represented as oneOf.
438
+
439
+ ***
440
+
441
+ ### resolveNeverDiscriminatorMembers() {#resolveneverdiscriminatormembers}
442
+
443
+ > `static` **resolveNeverDiscriminatorMembers**(`context`, `unionTypeNode`): `NodeArray`\<`TypeElement`\> \| `undefined`
444
+
445
+ Resolve branch members that can encode never-based discriminators.
446
+
447
+ #### Parameters
448
+
449
+ ##### context
450
+
451
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
452
+
453
+ The generation context.
454
+
455
+ ##### unionTypeNode
456
+
457
+ `TypeNode`
458
+
459
+ The union branch type node.
460
+
461
+ #### Returns
462
+
463
+ `NodeArray`\<`TypeElement`\> \| `undefined`
464
+
465
+ Type members for the branch when resolvable.
466
+
467
+ ***
468
+
469
+ ### resolveLocalSchemaReference() {#resolvelocalschemareference}
470
+
471
+ > `static` **resolveLocalSchemaReference**(`context`, `schema`): `IJsonSchema` \| `undefined`
472
+
473
+ Resolve a local $ref schema to its stored schema definition.
474
+
475
+ #### Parameters
476
+
477
+ ##### context
478
+
479
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
480
+
481
+ The generation context.
482
+
483
+ ##### schema
484
+
485
+ `IJsonSchema`
486
+
487
+ The schema that may contain a local reference.
488
+
489
+ #### Returns
490
+
491
+ `IJsonSchema` \| `undefined`
492
+
493
+ The resolved schema when available.
494
+
495
+ ***
496
+
497
+ ### resolveConstObjectProperty() {#resolveconstobjectproperty}
498
+
499
+ > `static` **resolveConstObjectProperty**(`context`, `objectName`, `propertyName`): `string` \| `number` \| `undefined`
500
+
501
+ Resolve a property value from a const object declaration in an imported source file.
502
+
503
+ #### Parameters
504
+
505
+ ##### context
506
+
507
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
508
+
509
+ The generation context.
510
+
511
+ ##### objectName
512
+
513
+ `string`
514
+
515
+ The name of the const object.
516
+
517
+ ##### propertyName
518
+
519
+ `string`
520
+
521
+ The name of the property to resolve.
522
+
523
+ #### Returns
524
+
525
+ `string` \| `number` \| `undefined`
526
+
527
+ The resolved string or number value, or undefined if unresolvable.
528
+
529
+ ***
530
+
531
+ ### findVariableDeclarationInModuleGraph() {#findvariabledeclarationinmodulegraph}
532
+
533
+ > `static` **findVariableDeclarationInModuleGraph**(`sourceFilePath`, `variableName`, `visitedFiles`): `VariableDeclaration` \| `undefined`
534
+
535
+ Find a variable declaration by traversing import and export chains.
536
+
537
+ #### Parameters
538
+
539
+ ##### sourceFilePath
540
+
541
+ `string`
542
+
543
+ The source file path to start from.
544
+
545
+ ##### variableName
546
+
547
+ `string`
548
+
549
+ The variable declaration name to find.
550
+
551
+ ##### visitedFiles
552
+
553
+ `Set`\<`string`\>
554
+
555
+ The file set already visited.
556
+
557
+ #### Returns
558
+
559
+ `VariableDeclaration` \| `undefined`
560
+
561
+ The variable declaration when found.
562
+
563
+ ***
564
+
565
+ ### findImportedValueReference() {#findimportedvaluereference}
566
+
567
+ > `static` **findImportedValueReference**(`sourceFile`, `localName`): \{ `moduleSpecifier`: `string`; `importedName`: `string`; \} \| `undefined`
568
+
569
+ Find an imported symbol reference by local identifier name.
570
+
571
+ #### Parameters
572
+
573
+ ##### sourceFile
574
+
575
+ `SourceFile`
576
+
577
+ The source file to inspect.
578
+
579
+ ##### localName
580
+
581
+ `string`
582
+
583
+ The local identifier name.
584
+
585
+ #### Returns
586
+
587
+ \{ `moduleSpecifier`: `string`; `importedName`: `string`; \} \| `undefined`
588
+
589
+ The module specifier and imported symbol name.
590
+
591
+ ***
592
+
593
+ ### resolveImportDeclarationSourceFile() {#resolveimportdeclarationsourcefile}
594
+
595
+ > `static` **resolveImportDeclarationSourceFile**(`containingSourceFilePath`, `moduleSpecifier`): `string` \| `undefined`
596
+
597
+ Resolve an import declaration module specifier to a source file.
598
+
599
+ #### Parameters
600
+
601
+ ##### containingSourceFilePath
602
+
603
+ `string`
604
+
605
+ The containing source file path.
606
+
607
+ ##### moduleSpecifier
608
+
609
+ `string`
610
+
611
+ The module specifier text.
612
+
613
+ #### Returns
614
+
615
+ `string` \| `undefined`
616
+
617
+ The resolved source file path.
618
+
619
+ ***
620
+
621
+ ### extractConstObjectPropertyFromDeclarationInitializer() {#extractconstobjectpropertyfromdeclarationinitializer}
622
+
623
+ > `static` **extractConstObjectPropertyFromDeclarationInitializer**(`objectDeclaration`, `propertyName`): `string` \| `number` \| `undefined`
624
+
625
+ Extract a const-object property value from a declaration initializer.
626
+
627
+ #### Parameters
628
+
629
+ ##### objectDeclaration
630
+
631
+ `VariableDeclaration`
632
+
633
+ The variable declaration.
634
+
635
+ ##### propertyName
636
+
637
+ `string`
638
+
639
+ The property to resolve.
640
+
641
+ #### Returns
642
+
643
+ `string` \| `number` \| `undefined`
644
+
645
+ The resolved value.
646
+
647
+ ***
648
+
649
+ ### extractConstObjectPropertyFromDeclarationType() {#extractconstobjectpropertyfromdeclarationtype}
650
+
651
+ > `static` **extractConstObjectPropertyFromDeclarationType**(`declarationTypeNode`, `propertyName`): `string` \| `number` \| `undefined`
652
+
653
+ Extract a const-object property value from a declaration type annotation.
654
+
655
+ #### Parameters
656
+
657
+ ##### declarationTypeNode
658
+
659
+ `TypeNode`
660
+
661
+ The declaration type annotation.
662
+
663
+ ##### propertyName
664
+
665
+ `string`
666
+
667
+ The property to resolve.
668
+
669
+ #### Returns
670
+
671
+ `string` \| `number` \| `undefined`
672
+
673
+ The resolved value.
674
+
675
+ ***
676
+
677
+ ### extractLiteralValueFromTypeNode() {#extractliteralvaluefromtypenode}
678
+
679
+ > `static` **extractLiteralValueFromTypeNode**(`typeNode`): `string` \| `number` \| `undefined`
680
+
681
+ Extract a literal value from a type node when possible.
682
+
683
+ #### Parameters
684
+
685
+ ##### typeNode
686
+
687
+ `TypeNode`
688
+
689
+ The type node.
690
+
691
+ #### Returns
692
+
693
+ `string` \| `number` \| `undefined`
694
+
695
+ The literal value.
696
+
697
+ ***
698
+
699
+ ### extractImportTypeName() {#extractimporttypename}
700
+
701
+ > `static` **extractImportTypeName**(`qualifier`): `string` \| `undefined`
702
+
703
+ Extract a referenced type name from an import type qualifier.
704
+
705
+ #### Parameters
706
+
707
+ ##### qualifier
708
+
709
+ `EntityName` \| `undefined`
710
+
711
+ The import type qualifier.
712
+
713
+ #### Returns
714
+
715
+ `string` \| `undefined`
716
+
717
+ The resolved type name.
718
+
719
+ ***
720
+
721
+ ### resolveImportTypeReferenceSchemaId() {#resolveimporttypereferenceschemaid}
722
+
723
+ > `static` **resolveImportTypeReferenceSchemaId**(`context`, `moduleSpecifier`, `typeName`, `title`): `string` \| `undefined`
724
+
725
+ Resolve import-type references to local or external schema ids.
726
+
727
+ #### Parameters
728
+
729
+ ##### context
730
+
731
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
732
+
733
+ The generation context.
734
+
735
+ ##### moduleSpecifier
736
+
737
+ `string`
738
+
739
+ The import module specifier.
740
+
741
+ ##### typeName
742
+
743
+ `string`
744
+
745
+ The imported type name.
746
+
747
+ ##### title
748
+
749
+ `string`
750
+
751
+ The derived schema title.
752
+
753
+ #### Returns
754
+
755
+ `string` \| `undefined`
756
+
757
+ The resolved schema id.
758
+
759
+ ***
760
+
761
+ ### inferSchemaFromExpression() {#inferschemafromexpression}
762
+
763
+ > `static` **inferSchemaFromExpression**(`context`, `expr`, `asConst?`): `IJsonSchema`
764
+
765
+ Infer a primitive JSON schema from a literal expression.
766
+
767
+ #### Parameters
768
+
769
+ ##### context
770
+
771
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
772
+
773
+ The generation context.
774
+
775
+ ##### expr
776
+
777
+ `Expression`
778
+
779
+ The expression to inspect.
780
+
781
+ ##### asConst?
782
+
783
+ `boolean` = `false`
784
+
785
+ Whether to produce exact const schemas matching an as-const assertion.
786
+
787
+ #### Returns
788
+
789
+ `IJsonSchema`
790
+
791
+ The inferred schema.
792
+
793
+ ***
794
+
795
+ ### inferObjectLiteralSchema() {#inferobjectliteralschema}
796
+
797
+ > `static` **inferObjectLiteralSchema**(`context`, `expr`, `asConst`): `IJsonSchema`
798
+
799
+ Infer an object schema from an object literal expression, using const or widened types.
800
+
801
+ #### Parameters
802
+
803
+ ##### context
804
+
805
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
806
+
807
+ The generation context.
808
+
809
+ ##### expr
810
+
811
+ `ObjectLiteralExpression`
812
+
813
+ The object literal expression.
814
+
815
+ ##### asConst
816
+
817
+ `boolean`
818
+
819
+ Whether property value schemas should be exact const types.
820
+
821
+ #### Returns
822
+
823
+ `IJsonSchema`
824
+
825
+ The inferred object schema.
826
+
827
+ ***
828
+
829
+ ### inferArrayLiteralSchema() {#inferarrayliteralschema}
830
+
831
+ > `static` **inferArrayLiteralSchema**(`context`, `expr`, `asConst`): `IJsonSchema`
832
+
833
+ Infer an array schema from an array literal expression.
834
+ For as-const arrays a fixed-length tuple schema is produced; otherwise a plain array schema.
835
+
836
+ #### Parameters
837
+
838
+ ##### context
839
+
840
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
841
+
842
+ The generation context.
843
+
844
+ ##### expr
845
+
846
+ `ArrayLiteralExpression`
847
+
848
+ The array literal expression.
849
+
850
+ ##### asConst
851
+
852
+ `boolean`
853
+
854
+ Whether to produce a const-exact tuple schema.
855
+
856
+ #### Returns
857
+
858
+ `IJsonSchema`
859
+
860
+ The inferred array schema.
861
+
862
+ ***
863
+
864
+ ### mapConditionalTypeToSchema() {#mapconditionaltypetoschema}
865
+
866
+ > `static` **mapConditionalTypeToSchema**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
867
+
868
+ Map conditional type nodes (e.g. T extends U ? X : Y) to schema.
869
+
870
+ #### Parameters
871
+
872
+ ##### context
873
+
874
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
875
+
876
+ The generation context.
877
+
878
+ ##### typeNode
879
+
880
+ `ConditionalTypeNode`
881
+
882
+ The conditional type node.
883
+
884
+ #### Returns
885
+
886
+ `IJsonSchema` \| `undefined`
887
+
888
+ The mapped schema.
889
+
890
+ ***
891
+
892
+ ### mapIndexedAccessTypeToSchema() {#mapindexedaccesstypetoschema}
893
+
894
+ > `static` **mapIndexedAccessTypeToSchema**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
895
+
896
+ Map indexed access type nodes (e.g. T["id"]) to schema.
897
+
898
+ #### Parameters
899
+
900
+ ##### context
901
+
902
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
903
+
904
+ The generation context.
905
+
906
+ ##### typeNode
907
+
908
+ `IndexedAccessTypeNode`
909
+
910
+ The indexed access type node.
911
+
912
+ #### Returns
913
+
914
+ `IJsonSchema` \| `undefined`
915
+
916
+ The mapped schema.
917
+
918
+ ***
919
+
920
+ ### mapTemplateLiteralTypeToSchema() {#maptemplateliteraltypetoschema}
921
+
922
+ > `static` **mapTemplateLiteralTypeToSchema**(`context`, `typeNode`): `IJsonSchema`
923
+
924
+ Map template literal type nodes to string schemas.
925
+
926
+ #### Parameters
927
+
928
+ ##### context
929
+
930
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
931
+
932
+ The generation context.
933
+
934
+ ##### typeNode
935
+
936
+ `TemplateLiteralTypeNode`
937
+
938
+ The template literal type node.
939
+
940
+ #### Returns
941
+
942
+ `IJsonSchema`
943
+
944
+ The mapped schema.
945
+
946
+ ***
947
+
948
+ ### mapMappedTypeToSchema() {#mapmappedtypetoschema}
949
+
950
+ > `static` **mapMappedTypeToSchema**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
951
+
952
+ Map mapped type nodes to object schemas.
953
+
954
+ #### Parameters
955
+
956
+ ##### context
957
+
958
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
959
+
960
+ The generation context.
961
+
962
+ ##### typeNode
963
+
964
+ `MappedTypeNode`
965
+
966
+ The mapped type node.
967
+
968
+ #### Returns
969
+
970
+ `IJsonSchema` \| `undefined`
971
+
972
+ The mapped schema.
973
+
974
+ ***
975
+
976
+ ### isMappedTypeIndexedValueByTypeParameter() {#ismappedtypeindexedvaluebytypeparameter}
977
+
978
+ > `static` **isMappedTypeIndexedValueByTypeParameter**(`typeNode`, `mappedTypeParameterName`): `boolean`
979
+
980
+ Determine whether a mapped type value uses indexed access with the mapped key parameter.
981
+
982
+ #### Parameters
983
+
984
+ ##### typeNode
985
+
986
+ `MappedTypeNode`
987
+
988
+ The mapped type node.
989
+
990
+ ##### mappedTypeParameterName
991
+
992
+ `string`
993
+
994
+ The mapped type parameter name.
995
+
996
+ #### Returns
997
+
998
+ `boolean`
999
+
1000
+ True if the value shape is based on source indexed access.
1001
+
1002
+ ***
1003
+
1004
+ ### checkTypeNodeAllowed() {#checktypenodeallowed}
1005
+
1006
+ > `static` **checkTypeNodeAllowed**(`context`, `typeNode`, `propertyName?`, `enclosingObjectName?`): `boolean`
1007
+
1008
+ Check whether a type node is allowed for schema generation.
1009
+
1010
+ #### Parameters
1011
+
1012
+ ##### context
1013
+
1014
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1015
+
1016
+ The generation context.
1017
+
1018
+ ##### typeNode
1019
+
1020
+ `TypeNode`
1021
+
1022
+ The type node to inspect.
1023
+
1024
+ ##### propertyName?
1025
+
1026
+ `string`
1027
+
1028
+ The optional property name when the type is a property type.
1029
+
1030
+ ##### enclosingObjectName?
1031
+
1032
+ `string`
1033
+
1034
+ The optional enclosing object name when the type is a property type.
1035
+
1036
+ #### Returns
1037
+
1038
+ `boolean`
1039
+
1040
+ True when the type is allowed.
1041
+
1042
+ ***
1043
+
1044
+ ### isFunctionPropertyType() {#isfunctionpropertytype}
1045
+
1046
+ > `static` **isFunctionPropertyType**(`typeNode`): `boolean`
1047
+
1048
+ Determine whether a property type should be treated as a function and skipped.
1049
+
1050
+ #### Parameters
1051
+
1052
+ ##### typeNode
1053
+
1054
+ `TypeNode`
1055
+
1056
+ The property type node.
1057
+
1058
+ #### Returns
1059
+
1060
+ `boolean`
1061
+
1062
+ True if the property type is function-like.
1063
+
1064
+ ***
1065
+
1066
+ ### isSymbolTypeNode() {#issymboltypenode}
1067
+
1068
+ > `static` **isSymbolTypeNode**(`typeNode`): `boolean`
1069
+
1070
+ Determine whether a type node represents symbol or unique symbol.
1071
+
1072
+ #### Parameters
1073
+
1074
+ ##### typeNode
1075
+
1076
+ `TypeNode`
1077
+
1078
+ The type node to inspect.
1079
+
1080
+ #### Returns
1081
+
1082
+ `boolean`
1083
+
1084
+ True when the type is symbol or unique symbol.
1085
+
1086
+ ***
1087
+
1088
+ ### isSymbolKeyedComputedExpression() {#issymbolkeyedcomputedexpression}
1089
+
1090
+ > `static` **isSymbolKeyedComputedExpression**(`context`, `expression`): `boolean`
1091
+
1092
+ Determine whether a computed property expression references a symbol.
1093
+ Covers well-known symbols (Symbol.iterator, etc.) and const variables
1094
+ declared with a unique symbol type annotation.
1095
+
1096
+ #### Parameters
1097
+
1098
+ ##### context
1099
+
1100
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1101
+
1102
+ The generation context.
1103
+
1104
+ ##### expression
1105
+
1106
+ `Expression`
1107
+
1108
+ The computed property expression.
1109
+
1110
+ #### Returns
1111
+
1112
+ `boolean`
1113
+
1114
+ True when the key is symbol-based.
1115
+
1116
+ ***
1117
+
1118
+ ### extractPropertyName() {#extractpropertyname}
1119
+
1120
+ > `static` **extractPropertyName**(`context`, `propertyName`): `string` \| `undefined`
1121
+
1122
+ Extract a property name from TypeScript property syntax.
1123
+ Computed names are resolved when they evaluate to concrete literals.
1124
+
1125
+ #### Parameters
1126
+
1127
+ ##### context
1128
+
1129
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1130
+
1131
+ The generation context.
1132
+
1133
+ ##### propertyName
1134
+
1135
+ `PropertyName`
1136
+
1137
+ The property name node.
1138
+
1139
+ #### Returns
1140
+
1141
+ `string` \| `undefined`
1142
+
1143
+ The normalized property name.
1144
+
1145
+ ***
1146
+
1147
+ ### findVariableDeclaration() {#findvariabledeclaration}
1148
+
1149
+ > `static` **findVariableDeclaration**(`sourceFile`, `variableName`): `VariableDeclaration` \| `undefined`
1150
+
1151
+ Find a variable declaration by name in a source file.
1152
+
1153
+ #### Parameters
1154
+
1155
+ ##### sourceFile
1156
+
1157
+ `SourceFile` \| `undefined`
1158
+
1159
+ The source file to search.
1160
+
1161
+ ##### variableName
1162
+
1163
+ `string`
1164
+
1165
+ The variable name.
1166
+
1167
+ #### Returns
1168
+
1169
+ `VariableDeclaration` \| `undefined`
1170
+
1171
+ The declaration if found.
1172
+
1173
+ ***
1174
+
1175
+ ### resolveImportedTypeQuerySchema() {#resolveimportedtypequeryschema}
1176
+
1177
+ > `static` **resolveImportedTypeQuerySchema**(`context`, `localName`): `IJsonSchema` \| `undefined`
1178
+
1179
+ Resolve a schema for an imported identifier used in a type query.
1180
+
1181
+ #### Parameters
1182
+
1183
+ ##### context
1184
+
1185
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1186
+
1187
+ The generation context.
1188
+
1189
+ ##### localName
1190
+
1191
+ `string`
1192
+
1193
+ The local imported symbol name.
1194
+
1195
+ #### Returns
1196
+
1197
+ `IJsonSchema` \| `undefined`
1198
+
1199
+ The mapped schema if resolvable.
1200
+
1201
+ ***
1202
+
1203
+ ### resolveComputedPropertyNameExpression() {#resolvecomputedpropertynameexpression}
1204
+
1205
+ > `static` **resolveComputedPropertyNameExpression**(`context`, `expression`, `resolvingIdentifiers`): `string` \| `undefined`
1206
+
1207
+ Resolve computed property name expressions when they can be evaluated to concrete keys.
1208
+
1209
+ #### Parameters
1210
+
1211
+ ##### context
1212
+
1213
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1214
+
1215
+ The generation context.
1216
+
1217
+ ##### expression
1218
+
1219
+ `Expression`
1220
+
1221
+ The computed property expression.
1222
+
1223
+ ##### resolvingIdentifiers
1224
+
1225
+ `Set`\<`string`\>
1226
+
1227
+ Identifier names currently being resolved.
1228
+
1229
+ #### Returns
1230
+
1231
+ `string` \| `undefined`
1232
+
1233
+ The resolved property key.
1234
+
1235
+ ***
1236
+
1237
+ ### findConstVariableDeclaration() {#findconstvariabledeclaration}
1238
+
1239
+ > `static` **findConstVariableDeclaration**(`context`, `variableName`): `VariableDeclaration` \| `undefined`
1240
+
1241
+ Find a local const variable declaration in the active source file.
1242
+
1243
+ #### Parameters
1244
+
1245
+ ##### context
1246
+
1247
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1248
+
1249
+ The generation context.
1250
+
1251
+ ##### variableName
1252
+
1253
+ `string`
1254
+
1255
+ The variable name.
1256
+
1257
+ #### Returns
1258
+
1259
+ `VariableDeclaration` \| `undefined`
1260
+
1261
+ The declaration when found.
1262
+
1263
+ ***
1264
+
1265
+ ### resolveLocalConstObjectProperty() {#resolvelocalconstobjectproperty}
1266
+
1267
+ > `static` **resolveLocalConstObjectProperty**(`context`, `objectName`, `propertyName`): `string` \| `number` \| `undefined`
1268
+
1269
+ Resolve a property value from a local const object declaration.
1270
+
1271
+ #### Parameters
1272
+
1273
+ ##### context
1274
+
1275
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1276
+
1277
+ The generation context.
1278
+
1279
+ ##### objectName
1280
+
1281
+ `string`
1282
+
1283
+ The const object name.
1284
+
1285
+ ##### propertyName
1286
+
1287
+ `string`
1288
+
1289
+ The property to resolve.
1290
+
1291
+ #### Returns
1292
+
1293
+ `string` \| `number` \| `undefined`
1294
+
1295
+ The resolved value when available.
1296
+
1297
+ ***
1298
+
1299
+ ### mapTupleTypeToSchema() {#maptupletypetoschema}
1300
+
1301
+ > `static` **mapTupleTypeToSchema**(`context`, `tupleTypeNode`): `IJsonSchema` \| `undefined`
1302
+
1303
+ Map a tuple type node to schema.
1304
+
1305
+ #### Parameters
1306
+
1307
+ ##### context
1308
+
1309
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1310
+
1311
+ The generation context.
1312
+
1313
+ ##### tupleTypeNode
1314
+
1315
+ `TupleTypeNode`
1316
+
1317
+ The tuple type node.
1318
+
1319
+ #### Returns
1320
+
1321
+ `IJsonSchema` \| `undefined`
1322
+
1323
+ The mapped tuple schema.
1324
+
1325
+ ***
1326
+
1327
+ ### extractRestElementSchema() {#extractrestelementschema}
1328
+
1329
+ > `static` **extractRestElementSchema**(`context`, `restElementType`): `IJsonSchema` \| `undefined`
1330
+
1331
+ Extract schema for a tuple rest element.
1332
+
1333
+ #### Parameters
1334
+
1335
+ ##### context
1336
+
1337
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1338
+
1339
+ The generation context.
1340
+
1341
+ ##### restElementType
1342
+
1343
+ `TypeNode`
1344
+
1345
+ The rest element type.
1346
+
1347
+ #### Returns
1348
+
1349
+ `IJsonSchema` \| `undefined`
1350
+
1351
+ The mapped rest element schema.
1352
+
1353
+ ***
1354
+
1355
+ ### findExistingSchemaIdByTitle() {#findexistingschemaidbytitle}
1356
+
1357
+ > `static` **findExistingSchemaIdByTitle**(`context`, `schemaTitle`): `string` \| `undefined`
1358
+
1359
+ Find an existing schema id by title in known package schemas.
1360
+
1361
+ #### Parameters
1362
+
1363
+ ##### context
1364
+
1365
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1366
+
1367
+ The generation context.
1368
+
1369
+ ##### schemaTitle
1370
+
1371
+ `string`
1372
+
1373
+ The schema title to find.
1374
+
1375
+ #### Returns
1376
+
1377
+ `string` \| `undefined`
1378
+
1379
+ The existing schema id if found.
1380
+
1381
+ ***
1382
+
1383
+ ### applyInterfaceExtendsSchema() {#applyinterfaceextendsschema}
1384
+
1385
+ > `static` **applyInterfaceExtendsSchema**(`context`, `schema`, `declaration`): `void`
1386
+
1387
+ Apply interface inheritance (`extends`) as `allOf` references.
1388
+
1389
+ #### Parameters
1390
+
1391
+ ##### context
1392
+
1393
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1394
+
1395
+ The generation context.
1396
+
1397
+ ##### schema
1398
+
1399
+ `Partial`\<`IJsonSchema`\>
1400
+
1401
+ The schema to expand.
1402
+
1403
+ ##### declaration
1404
+
1405
+ `InterfaceDeclaration`
1406
+
1407
+ The interface declaration.
1408
+
1409
+ #### Returns
1410
+
1411
+ `void`
1412
+
1413
+ ***
1414
+
1415
+ ### mapPartialUtilityType() {#mappartialutilitytype}
1416
+
1417
+ > `static` **mapPartialUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1418
+
1419
+ Map Partial<T> to an object schema with no required properties.
1420
+
1421
+ #### Parameters
1422
+
1423
+ ##### context
1424
+
1425
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1426
+
1427
+ The generation context.
1428
+
1429
+ ##### typeNode
1430
+
1431
+ `TypeReferenceNode`
1432
+
1433
+ The Partial type reference.
1434
+
1435
+ #### Returns
1436
+
1437
+ `IJsonSchema` \| `undefined`
1438
+
1439
+ The mapped schema.
1440
+
1441
+ ***
1442
+
1443
+ ### mapRequiredUtilityType() {#maprequiredutilitytype}
1444
+
1445
+ > `static` **mapRequiredUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1446
+
1447
+ Map Required<T> to an object schema with all properties required.
1448
+
1449
+ #### Parameters
1450
+
1451
+ ##### context
1452
+
1453
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1454
+
1455
+ The generation context.
1456
+
1457
+ ##### typeNode
1458
+
1459
+ `TypeReferenceNode`
1460
+
1461
+ The Required type reference.
1462
+
1463
+ #### Returns
1464
+
1465
+ `IJsonSchema` \| `undefined`
1466
+
1467
+ The mapped schema.
1468
+
1469
+ ***
1470
+
1471
+ ### mapPickUtilityType() {#mappickutilitytype}
1472
+
1473
+ > `static` **mapPickUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1474
+
1475
+ Map Pick<T, K> to an object schema with selected keys preserved.
1476
+
1477
+ #### Parameters
1478
+
1479
+ ##### context
1480
+
1481
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1482
+
1483
+ The generation context.
1484
+
1485
+ ##### typeNode
1486
+
1487
+ `TypeReferenceNode`
1488
+
1489
+ The Pick type reference.
1490
+
1491
+ #### Returns
1492
+
1493
+ `IJsonSchema` \| `undefined`
1494
+
1495
+ The mapped schema.
1496
+
1497
+ ***
1498
+
1499
+ ### mapOmitUtilityType() {#mapomitutilitytype}
1500
+
1501
+ > `static` **mapOmitUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1502
+
1503
+ Map Omit<T, K> to an object schema with selected keys removed.
1504
+
1505
+ #### Parameters
1506
+
1507
+ ##### context
1508
+
1509
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1510
+
1511
+ The generation context.
1512
+
1513
+ ##### typeNode
1514
+
1515
+ `TypeReferenceNode`
1516
+
1517
+ The Omit type reference.
1518
+
1519
+ #### Returns
1520
+
1521
+ `IJsonSchema` \| `undefined`
1522
+
1523
+ The mapped schema.
1524
+
1525
+ ***
1526
+
1527
+ ### mapExcludeUtilityType() {#mapexcludeutilitytype}
1528
+
1529
+ > `static` **mapExcludeUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1530
+
1531
+ Map Exclude<T, U> to a schema that removes U members from T.
1532
+
1533
+ #### Parameters
1534
+
1535
+ ##### context
1536
+
1537
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1538
+
1539
+ The generation context.
1540
+
1541
+ ##### typeNode
1542
+
1543
+ `TypeReferenceNode`
1544
+
1545
+ The Exclude type reference.
1546
+
1547
+ #### Returns
1548
+
1549
+ `IJsonSchema` \| `undefined`
1550
+
1551
+ The mapped schema.
1552
+
1553
+ ***
1554
+
1555
+ ### mapExtractUtilityType() {#mapextractutilitytype}
1556
+
1557
+ > `static` **mapExtractUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1558
+
1559
+ Map Extract<T, U> to a schema that keeps U members from T.
1560
+
1561
+ #### Parameters
1562
+
1563
+ ##### context
1564
+
1565
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1566
+
1567
+ The generation context.
1568
+
1569
+ ##### typeNode
1570
+
1571
+ `TypeReferenceNode`
1572
+
1573
+ The Extract type reference.
1574
+
1575
+ #### Returns
1576
+
1577
+ `IJsonSchema` \| `undefined`
1578
+
1579
+ The mapped schema.
1580
+
1581
+ ***
1582
+
1583
+ ### mapNonNullableUtilityType() {#mapnonnullableutilitytype}
1584
+
1585
+ > `static` **mapNonNullableUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1586
+
1587
+ Map NonNullable<T> by removing null and undefined branches from T.
1588
+
1589
+ #### Parameters
1590
+
1591
+ ##### context
1592
+
1593
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1594
+
1595
+ The generation context.
1596
+
1597
+ ##### typeNode
1598
+
1599
+ `TypeReferenceNode`
1600
+
1601
+ The NonNullable type reference.
1602
+
1603
+ #### Returns
1604
+
1605
+ `IJsonSchema` \| `undefined`
1606
+
1607
+ The mapped schema.
1608
+
1609
+ ***
1610
+
1611
+ ### mapRecordUtilityType() {#maprecordutilitytype}
1612
+
1613
+ > `static` **mapRecordUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1614
+
1615
+ Map Record<K, V> to an object schema with key constraints where possible.
1616
+
1617
+ #### Parameters
1618
+
1619
+ ##### context
1620
+
1621
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1622
+
1623
+ The generation context.
1624
+
1625
+ ##### typeNode
1626
+
1627
+ `TypeReferenceNode`
1628
+
1629
+ The Record type reference.
1630
+
1631
+ #### Returns
1632
+
1633
+ `IJsonSchema` \| `undefined`
1634
+
1635
+ The mapped schema.
1636
+
1637
+ ***
1638
+
1639
+ ### isNullOrUndefinedTypeNode() {#isnullorundefinedtypenode}
1640
+
1641
+ > `static` **isNullOrUndefinedTypeNode**(`typeNode`): `boolean`
1642
+
1643
+ Determine whether a type node represents null or undefined.
1644
+
1645
+ #### Parameters
1646
+
1647
+ ##### typeNode
1648
+
1649
+ `TypeNode`
1650
+
1651
+ The type node.
1652
+
1653
+ #### Returns
1654
+
1655
+ `boolean`
1656
+
1657
+ True if the node is null or undefined.
1658
+
1659
+ ***
1660
+
1661
+ ### extractRecordLiteralKeys() {#extractrecordliteralkeys}
1662
+
1663
+ > `static` **extractRecordLiteralKeys**(`keyTypeNode`): `string`[]
1664
+
1665
+ Extract literal keys from a Record key type argument.
1666
+
1667
+ #### Parameters
1668
+
1669
+ ##### keyTypeNode
1670
+
1671
+ `TypeNode`
1672
+
1673
+ The key type argument node.
1674
+
1675
+ #### Returns
1676
+
1677
+ `string`[]
1678
+
1679
+ The extracted literal keys.
1680
+
1681
+ ***
1682
+
1683
+ ### mapJsonLdObjectUtilityType() {#mapjsonldobjectutilitytype}
1684
+
1685
+ > `static` **mapJsonLdObjectUtilityType**(`context`, `typeNode`, `options`): `IJsonSchema` \| `undefined`
1686
+
1687
+ Map JsonLdObject utility types using key-removal and optional key-addition rules.
1688
+
1689
+ #### Parameters
1690
+
1691
+ ##### context
1692
+
1693
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1694
+
1695
+ The generation context.
1696
+
1697
+ ##### typeNode
1698
+
1699
+ `TypeReferenceNode`
1700
+
1701
+ The JsonLdObject utility type reference.
1702
+
1703
+ ##### options
1704
+
1705
+ Mapping options.
1706
+
1707
+ ###### keysToRemove
1708
+
1709
+ `string`[]
1710
+
1711
+ Keys to remove from the base schema.
1712
+
1713
+ ###### keyToAdd?
1714
+
1715
+ `"type"` \| `"id"` \| `"@id"` \| `"@type"` \| `"@context"`
1716
+
1717
+ Optional key to add to the base schema.
1718
+
1719
+ ###### isAddedKeyRequired?
1720
+
1721
+ `boolean`
1722
+
1723
+ Whether the added key should be required.
1724
+
1725
+ #### Returns
1726
+
1727
+ `IJsonSchema` \| `undefined`
1728
+
1729
+ The mapped schema.
1730
+
1731
+ ***
1732
+
1733
+ ### mapJsonLdObjectDefaultSchemaByKey() {#mapjsonldobjectdefaultschemabykey}
1734
+
1735
+ > `static` **mapJsonLdObjectDefaultSchemaByKey**(`baseSchema`, `keyToAdd`): `IJsonSchema`
1736
+
1737
+ Resolve a default schema for JsonLdObject utility key additions when the type argument is omitted.
1738
+
1739
+ #### Parameters
1740
+
1741
+ ##### baseSchema
1742
+
1743
+ `IJsonSchema`
1744
+
1745
+ The base object schema.
1746
+
1747
+ ##### keyToAdd
1748
+
1749
+ `"type"` \| `"id"` \| `"@id"` \| `"@type"` \| `"@context"`
1750
+
1751
+ The key being added by the utility.
1752
+
1753
+ #### Returns
1754
+
1755
+ `IJsonSchema`
1756
+
1757
+ The resolved schema.
1758
+
1759
+ ***
1760
+
1761
+ ### mapJsonLdObjectWithIdDefaultIdSchema() {#mapjsonldobjectwithiddefaultidschema}
1762
+
1763
+ > `static` **mapJsonLdObjectWithIdDefaultIdSchema**(`baseSchema`): `IJsonSchema`
1764
+
1765
+ Resolve default id schema for JsonLdObjectWithId when Id type argument is omitted.
1766
+
1767
+ #### Parameters
1768
+
1769
+ ##### baseSchema
1770
+
1771
+ `IJsonSchema`
1772
+
1773
+ The base object schema.
1774
+
1775
+ #### Returns
1776
+
1777
+ `IJsonSchema`
1778
+
1779
+ The resolved id schema.
1780
+
1781
+ ***
1782
+
1783
+ ### mapJsonLdObjectWithTypeDefaultTypeSchema() {#mapjsonldobjectwithtypedefaulttypeschema}
1784
+
1785
+ > `static` **mapJsonLdObjectWithTypeDefaultTypeSchema**(`baseSchema`): `IJsonSchema`
1786
+
1787
+ Resolve default type schema for JsonLdObjectWithType when Type argument is omitted.
1788
+
1789
+ #### Parameters
1790
+
1791
+ ##### baseSchema
1792
+
1793
+ `IJsonSchema`
1794
+
1795
+ The base object schema.
1796
+
1797
+ #### Returns
1798
+
1799
+ `IJsonSchema`
1800
+
1801
+ The resolved type schema.
1802
+
1803
+ ***
1804
+
1805
+ ### mapJsonLdObjectWithContextDefaultContextSchema() {#mapjsonldobjectwithcontextdefaultcontextschema}
1806
+
1807
+ > `static` **mapJsonLdObjectWithContextDefaultContextSchema**(`baseSchema`): `IJsonSchema`
1808
+
1809
+ Resolve default context schema for JsonLdObjectWithContext when Context argument is omitted.
1810
+
1811
+ #### Parameters
1812
+
1813
+ ##### baseSchema
1814
+
1815
+ `IJsonSchema`
1816
+
1817
+ The base object schema.
1818
+
1819
+ #### Returns
1820
+
1821
+ `IJsonSchema`
1822
+
1823
+ The resolved context schema.
1824
+
1825
+ ***
1826
+
1827
+ ### mapJsonLdObjectDefaultEitherSchema() {#mapjsonldobjectdefaulteitherschema}
1828
+
1829
+ > `static` **mapJsonLdObjectDefaultEitherSchema**(`baseSchema`, `firstKey`, `secondKey`, `fallbackSchema`): `IJsonSchema`
1830
+
1831
+ Resolve default schema from either of two source keys, with fallback when both are absent.
1832
+
1833
+ #### Parameters
1834
+
1835
+ ##### baseSchema
1836
+
1837
+ `IJsonSchema`
1838
+
1839
+ The base object schema.
1840
+
1841
+ ##### firstKey
1842
+
1843
+ `string`
1844
+
1845
+ The primary key to resolve.
1846
+
1847
+ ##### secondKey
1848
+
1849
+ `string`
1850
+
1851
+ The secondary key to resolve.
1852
+
1853
+ ##### fallbackSchema
1854
+
1855
+ `IJsonSchema`
1856
+
1857
+ The fallback schema.
1858
+
1859
+ #### Returns
1860
+
1861
+ `IJsonSchema`
1862
+
1863
+ The resolved schema.
1864
+
1865
+ ***
1866
+
1867
+ ### mapObjectOrArrayUtilityType() {#mapobjectorarrayutilitytype}
1868
+
1869
+ > `static` **mapObjectOrArrayUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1870
+
1871
+ Map ObjectOrArray<T> to a schema accepting T or T[].
1872
+
1873
+ #### Parameters
1874
+
1875
+ ##### context
1876
+
1877
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1878
+
1879
+ The generation context.
1880
+
1881
+ ##### typeNode
1882
+
1883
+ `TypeReferenceNode`
1884
+
1885
+ The ObjectOrArray type reference.
1886
+
1887
+ #### Returns
1888
+
1889
+ `IJsonSchema` \| `undefined`
1890
+
1891
+ The mapped schema.
1892
+
1893
+ ***
1894
+
1895
+ ### mapSingleOccurrenceArrayUtilityType() {#mapsingleoccurrencearrayutilitytype}
1896
+
1897
+ > `static` **mapSingleOccurrenceArrayUtilityType**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
1898
+
1899
+ Map SingleOccurrenceArray<T, U> to a non-empty array containing exactly one U.
1900
+
1901
+ #### Parameters
1902
+
1903
+ ##### context
1904
+
1905
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1906
+
1907
+ The generation context.
1908
+
1909
+ ##### typeNode
1910
+
1911
+ `TypeReferenceNode`
1912
+
1913
+ The SingleOccurrenceArray type reference.
1914
+
1915
+ #### Returns
1916
+
1917
+ `IJsonSchema` \| `undefined`
1918
+
1919
+ The mapped schema.
1920
+
1921
+ ***
1922
+
1923
+ ### annotateUtilityInlineSchema() {#annotateutilityinlineschema}
1924
+
1925
+ > `static` **annotateUtilityInlineSchema**(`schema`, `baseTypeDescription`): `IJsonSchema`
1926
+
1927
+ Add a comment to schemas inlined for utility type transformations.
1928
+
1929
+ #### Parameters
1930
+
1931
+ ##### schema
1932
+
1933
+ `IJsonSchema`
1934
+
1935
+ The schema to annotate.
1936
+
1937
+ ##### baseTypeDescription
1938
+
1939
+ `string`
1940
+
1941
+ The utility base type description.
1942
+
1943
+ #### Returns
1944
+
1945
+ `IJsonSchema`
1946
+
1947
+ The annotated schema.
1948
+
1949
+ ***
1950
+
1951
+ ### resolveUtilityBaseObjectSchema() {#resolveutilitybaseobjectschema}
1952
+
1953
+ > `static` **resolveUtilityBaseObjectSchema**(`context`, `baseTypeNode`): `IJsonSchema` \| `undefined`
1954
+
1955
+ Resolve a utility base type node to an object schema.
1956
+
1957
+ #### Parameters
1958
+
1959
+ ##### context
1960
+
1961
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1962
+
1963
+ The generation context.
1964
+
1965
+ ##### baseTypeNode
1966
+
1967
+ `TypeNode`
1968
+
1969
+ The utility base type node.
1970
+
1971
+ #### Returns
1972
+
1973
+ `IJsonSchema` \| `undefined`
1974
+
1975
+ The resolved object schema.
1976
+
1977
+ #### Throws
1978
+
1979
+ GeneralError when a named type reference cannot be resolved to a schema.
1980
+
1981
+ ***
1982
+
1983
+ ### resolveMappedUtilityBaseObjectSchema() {#resolvemappedutilitybaseobjectschema}
1984
+
1985
+ > `static` **resolveMappedUtilityBaseObjectSchema**(`context`, `mappedSchema`): `IJsonSchema` \| `undefined`
1986
+
1987
+ Resolve a mapped utility schema to an object schema when possible.
1988
+
1989
+ #### Parameters
1990
+
1991
+ ##### context
1992
+
1993
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
1994
+
1995
+ The generation context.
1996
+
1997
+ ##### mappedSchema
1998
+
1999
+ `IJsonSchema`
2000
+
2001
+ The mapped schema.
2002
+
2003
+ #### Returns
2004
+
2005
+ `IJsonSchema` \| `undefined`
2006
+
2007
+ The resolved object schema.
2008
+
2009
+ ***
2010
+
2011
+ ### expandAllOfReferences() {#expandallofreferences}
2012
+
2013
+ > `static` **expandAllOfReferences**(`context`, `schema`, `currentSchemaTitle?`): `IJsonSchema`
2014
+
2015
+ Expand allOf references in a schema by inlining referenced schemas.
2016
+ This handles inheritance cases where a type extends another type.
2017
+ When applying utility operations (Omit, Pick) to types with allOf inheritance,
2018
+ the referenced schemas must be expanded so properties are available for omit/pick.
2019
+
2020
+ #### Parameters
2021
+
2022
+ ##### context
2023
+
2024
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2025
+
2026
+ The generation context.
2027
+
2028
+ ##### schema
2029
+
2030
+ `IJsonSchema`
2031
+
2032
+ The schema potentially containing allOf with references.
2033
+
2034
+ ##### currentSchemaTitle?
2035
+
2036
+ `string`
2037
+
2038
+ The title of the current schema being processed, used for $comment annotations.
2039
+
2040
+ #### Returns
2041
+
2042
+ `IJsonSchema`
2043
+
2044
+ The schema with expanded references merged into properties.
2045
+
2046
+ ***
2047
+
2048
+ ### tryLoadExternalSchemaByTitle() {#tryloadexternalschemabytitle}
2049
+
2050
+ > `static` **tryLoadExternalSchemaByTitle**(`context`, `schemaTitle`): `IJsonSchema` \| `undefined`
2051
+
2052
+ Attempt to load an external schema by title from imported module declarations.
2053
+
2054
+ #### Parameters
2055
+
2056
+ ##### context
2057
+
2058
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2059
+
2060
+ The generation context.
2061
+
2062
+ ##### schemaTitle
2063
+
2064
+ `string`
2065
+
2066
+ The schema title.
2067
+
2068
+ #### Returns
2069
+
2070
+ `IJsonSchema` \| `undefined`
2071
+
2072
+ The loaded schema.
2073
+
2074
+ ***
2075
+
2076
+ ### resolveObjectTypeSchemaForUtility() {#resolveobjecttypeschemaforutility}
2077
+
2078
+ > `static` **resolveObjectTypeSchemaForUtility**(`context`, `typeName`): `IJsonSchema` \| `undefined`
2079
+
2080
+ Resolve an object schema for utility type application.
2081
+
2082
+ #### Parameters
2083
+
2084
+ ##### context
2085
+
2086
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2087
+
2088
+ The generation context.
2089
+
2090
+ ##### typeName
2091
+
2092
+ `string`
2093
+
2094
+ The referenced type name.
2095
+
2096
+ #### Returns
2097
+
2098
+ `IJsonSchema` \| `undefined`
2099
+
2100
+ The resolved object schema.
2101
+
2102
+ ***
2103
+
2104
+ ### findImportedTypeReference() {#findimportedtypereference}
2105
+
2106
+ > `static` **findImportedTypeReference**(`context`, `typeName`): \{ `moduleSpecifier`: `string`; `candidateTypeName`: `string`; \} \| `undefined`
2107
+
2108
+ Find an imported type reference from the active source file by local or exported symbol name.
2109
+
2110
+ #### Parameters
2111
+
2112
+ ##### context
2113
+
2114
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2115
+
2116
+ The generation context.
2117
+
2118
+ ##### typeName
2119
+
2120
+ `string`
2121
+
2122
+ The local or exported type name to find.
2123
+
2124
+ #### Returns
2125
+
2126
+ \{ `moduleSpecifier`: `string`; `candidateTypeName`: `string`; \} \| `undefined`
2127
+
2128
+ The module specifier and exported candidate type name when found.
2129
+
2130
+ ***
2131
+
2132
+ ### resolveImportedObjectTypeSchemaForUtility() {#resolveimportedobjecttypeschemaforutility}
2133
+
2134
+ > `static` **resolveImportedObjectTypeSchemaForUtility**(`context`, `moduleSpecifier`, `candidateTypeName`, `title`): `IJsonSchema` \| `undefined`
2135
+
2136
+ Resolve an imported object schema for utility type application.
2137
+
2138
+ #### Parameters
2139
+
2140
+ ##### context
2141
+
2142
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2143
+
2144
+ The generation context.
2145
+
2146
+ ##### moduleSpecifier
2147
+
2148
+ `string`
2149
+
2150
+ The module where the type is imported from.
2151
+
2152
+ ##### candidateTypeName
2153
+
2154
+ `string`
2155
+
2156
+ The exported candidate type name.
2157
+
2158
+ ##### title
2159
+
2160
+ `string`
2161
+
2162
+ The stripped title of the requested type.
2163
+
2164
+ #### Returns
2165
+
2166
+ `IJsonSchema` \| `undefined`
2167
+
2168
+ The resolved object schema.
2169
+
2170
+ ***
2171
+
2172
+ ### mapObjectTypeFromLocalDeclaration() {#mapobjecttypefromlocaldeclaration}
2173
+
2174
+ > `static` **mapObjectTypeFromLocalDeclaration**(`context`, `typeName`): `IJsonSchema` \| `undefined`
2175
+
2176
+ Map a local interface or type alias declaration to an object schema.
2177
+
2178
+ #### Parameters
2179
+
2180
+ ##### context
2181
+
2182
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2183
+
2184
+ The generation context.
2185
+
2186
+ ##### typeName
2187
+
2188
+ `string`
2189
+
2190
+ The referenced type name.
2191
+
2192
+ #### Returns
2193
+
2194
+ `IJsonSchema` \| `undefined`
2195
+
2196
+ The mapped schema.
2197
+
2198
+ ***
2199
+
2200
+ ### extractUtilityTypeKeys() {#extractutilitytypekeys}
2201
+
2202
+ > `static` **extractUtilityTypeKeys**(`context`, `keysTypeNode`): `string`[]
2203
+
2204
+ Extract string literal keys from a utility type key argument (e.g. Pick or Omit).
2205
+
2206
+ #### Parameters
2207
+
2208
+ ##### context
2209
+
2210
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2211
+
2212
+ The generation context.
2213
+
2214
+ ##### keysTypeNode
2215
+
2216
+ `TypeNode` \| `undefined`
2217
+
2218
+ The keys type node.
2219
+
2220
+ #### Returns
2221
+
2222
+ `string`[]
2223
+
2224
+ The extracted keys.
2225
+
2226
+ ***
2227
+
2228
+ ### extractIndexedAccessKeys() {#extractindexedaccesskeys}
2229
+
2230
+ > `static` **extractIndexedAccessKeys**(`context`, `indexTypeNode`): `string`[]
2231
+
2232
+ Extract property keys from an indexed access index type.
2233
+
2234
+ #### Parameters
2235
+
2236
+ ##### context
2237
+
2238
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2239
+
2240
+ The generation context.
2241
+
2242
+ ##### indexTypeNode
2243
+
2244
+ `TypeNode`
2245
+
2246
+ The index type node.
2247
+
2248
+ #### Returns
2249
+
2250
+ `string`[]
2251
+
2252
+ The extracted keys.
2253
+
2254
+ ***
2255
+
2256
+ ### extractMappedTypeKeys() {#extractmappedtypekeys}
2257
+
2258
+ > `static` **extractMappedTypeKeys**(`context`, `constraintTypeNode`): `string`[]
2259
+
2260
+ Extract keys for a mapped type constraint.
2261
+
2262
+ #### Parameters
2263
+
2264
+ ##### context
2265
+
2266
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2267
+
2268
+ The generation context.
2269
+
2270
+ ##### constraintTypeNode
2271
+
2272
+ `TypeNode` \| `undefined`
2273
+
2274
+ The mapped type constraint.
2275
+
2276
+ #### Returns
2277
+
2278
+ `string`[]
2279
+
2280
+ The extracted keys.
2281
+
2282
+ ***
2283
+
2284
+ ### resolveReferencedTypeNodeFromLocalDeclaration() {#resolvereferencedtypenodefromlocaldeclaration}
2285
+
2286
+ > `static` **resolveReferencedTypeNodeFromLocalDeclaration**(`context`, `typeNode`): `TypeNode` \| `undefined`
2287
+
2288
+ Resolve a referenced type node from a local type alias declaration.
2289
+
2290
+ #### Parameters
2291
+
2292
+ ##### context
2293
+
2294
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2295
+
2296
+ The generation context.
2297
+
2298
+ ##### typeNode
2299
+
2300
+ `TypeReferenceNode`
2301
+
2302
+ The type reference node.
2303
+
2304
+ #### Returns
2305
+
2306
+ `TypeNode` \| `undefined`
2307
+
2308
+ The referenced type node, if found locally.
2309
+
2310
+ ***
2311
+
2312
+ ### withTypeParameterBindings() {#withtypeparameterbindings}
2313
+
2314
+ > `static` **withTypeParameterBindings**(`context`, `typeParameters`, `typeArguments?`): [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2315
+
2316
+ Create a nested mapping context with generic parameters bound.
2317
+
2318
+ #### Parameters
2319
+
2320
+ ##### context
2321
+
2322
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2323
+
2324
+ The current generation context.
2325
+
2326
+ ##### typeParameters
2327
+
2328
+ `NodeArray`\<`TypeParameterDeclaration`\> \| `undefined`
2329
+
2330
+ The generic type parameters for the declaration.
2331
+
2332
+ ##### typeArguments?
2333
+
2334
+ `NodeArray`\<`TypeNode`\>
2335
+
2336
+ Explicit type arguments, when provided.
2337
+
2338
+ #### Returns
2339
+
2340
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2341
+
2342
+ The scoped mapping context.
2343
+
2344
+ ***
2345
+
2346
+ ### getTypeParameterBinding() {#gettypeparameterbinding}
2347
+
2348
+ > `static` **getTypeParameterBinding**(`context`, `typeName`): `TypeNode` \| `null` \| `undefined`
2349
+
2350
+ Get a bound generic type parameter for the current mapping scope.
2351
+
2352
+ #### Parameters
2353
+
2354
+ ##### context
2355
+
2356
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2357
+
2358
+ The current generation context.
2359
+
2360
+ ##### typeName
2361
+
2362
+ `string`
2363
+
2364
+ The type name to resolve.
2365
+
2366
+ #### Returns
2367
+
2368
+ `TypeNode` \| `null` \| `undefined`
2369
+
2370
+ The bound type node, null for unresolved generic parameters, or undefined when not generic.
2371
+
2372
+ ***
2373
+
2374
+ ### isHomomorphicMappedType() {#ishomomorphicmappedtype}
2375
+
2376
+ > `static` **isHomomorphicMappedType**(`typeNode`): `boolean`
2377
+
2378
+ Determine whether a mapped type is a homomorphic source-preserving form.
2379
+
2380
+ #### Parameters
2381
+
2382
+ ##### typeNode
2383
+
2384
+ `MappedTypeNode`
2385
+
2386
+ The mapped type node.
2387
+
2388
+ #### Returns
2389
+
2390
+ `boolean`
2391
+
2392
+ True if the mapped type mirrors an existing object shape.
2393
+
2394
+ ***
2395
+
2396
+ ### resolveMappedTypeSourceObjectSchema() {#resolvemappedtypesourceobjectschema}
2397
+
2398
+ > `static` **resolveMappedTypeSourceObjectSchema**(`context`, `typeNode`): `IJsonSchema` \| `undefined`
2399
+
2400
+ Resolve a source object schema for a mapped type when one exists.
2401
+
2402
+ #### Parameters
2403
+
2404
+ ##### context
2405
+
2406
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2407
+
2408
+ The generation context.
2409
+
2410
+ ##### typeNode
2411
+
2412
+ `MappedTypeNode`
2413
+
2414
+ The mapped type node.
2415
+
2416
+ #### Returns
2417
+
2418
+ `IJsonSchema` \| `undefined`
2419
+
2420
+ The resolved source object schema.
2421
+
2422
+ ***
2423
+
2424
+ ### mapMappedTypePropertySchema() {#mapmappedtypepropertyschema}
2425
+
2426
+ > `static` **mapMappedTypePropertySchema**(`context`, `typeNode`, `sourcePropertyKey`, `mappedTypeParameterName`, `sourceObjectSchema?`): `IJsonSchema` \| `undefined`
2427
+
2428
+ Map a single mapped-type property schema.
2429
+
2430
+ #### Parameters
2431
+
2432
+ ##### context
2433
+
2434
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2435
+
2436
+ The generation context.
2437
+
2438
+ ##### typeNode
2439
+
2440
+ `MappedTypeNode`
2441
+
2442
+ The mapped type node.
2443
+
2444
+ ##### sourcePropertyKey
2445
+
2446
+ `string`
2447
+
2448
+ The original property key from the source object, used for lookup when the mapped type is homomorphic.
2449
+
2450
+ ##### mappedTypeParameterName
2451
+
2452
+ `string`
2453
+
2454
+ The mapped type parameter name.
2455
+
2456
+ ##### sourceObjectSchema?
2457
+
2458
+ `IJsonSchema`
2459
+
2460
+ The optional source object schema.
2461
+
2462
+ #### Returns
2463
+
2464
+ `IJsonSchema` \| `undefined`
2465
+
2466
+ The mapped property schema.
2467
+
2468
+ ***
2469
+
2470
+ ### resolveIndexedPropertySchema() {#resolveindexedpropertyschema}
2471
+
2472
+ > `static` **resolveIndexedPropertySchema**(`context`, `objectTypeNode`, `propertyKey`, `sourceObjectSchema?`): `IJsonSchema` \| `undefined`
2473
+
2474
+ Resolve a concrete property schema for an indexed access object type and key.
2475
+
2476
+ #### Parameters
2477
+
2478
+ ##### context
2479
+
2480
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2481
+
2482
+ The generation context.
2483
+
2484
+ ##### objectTypeNode
2485
+
2486
+ `TypeNode`
2487
+
2488
+ The source object type node.
2489
+
2490
+ ##### propertyKey
2491
+
2492
+ `string`
2493
+
2494
+ The property key to resolve.
2495
+
2496
+ ##### sourceObjectSchema?
2497
+
2498
+ `IJsonSchema`
2499
+
2500
+ The optional pre-resolved source object schema.
2501
+
2502
+ #### Returns
2503
+
2504
+ `IJsonSchema` \| `undefined`
2505
+
2506
+ The resolved property schema.
2507
+
2508
+ ***
2509
+
2510
+ ### isMappedTypeParameterReference() {#ismappedtypeparameterreference}
2511
+
2512
+ > `static` **isMappedTypeParameterReference**(`typeNode`, `mappedTypeParameterName`): `boolean`
2513
+
2514
+ Determine whether a type node is a reference to the mapped type parameter.
2515
+
2516
+ #### Parameters
2517
+
2518
+ ##### typeNode
2519
+
2520
+ `TypeNode`
2521
+
2522
+ The type node.
2523
+
2524
+ ##### mappedTypeParameterName
2525
+
2526
+ `string`
2527
+
2528
+ The mapped type parameter name.
2529
+
2530
+ #### Returns
2531
+
2532
+ `boolean`
2533
+
2534
+ True if the node references the mapped parameter.
2535
+
2536
+ ***
2537
+
2538
+ ### applyMappedTypeOptionality() {#applymappedtypeoptionality}
2539
+
2540
+ > `static` **applyMappedTypeOptionality**(`schema`, `optionalToken`): `void`
2541
+
2542
+ Apply mapped-type optionality to a schema cloned from a source object.
2543
+
2544
+ #### Parameters
2545
+
2546
+ ##### schema
2547
+
2548
+ `IJsonSchema`
2549
+
2550
+ The mapped schema.
2551
+
2552
+ ##### optionalToken
2553
+
2554
+ `QuestionToken` \| `PlusToken` \| `MinusToken` \| `undefined`
2555
+
2556
+ The mapped type optional token.
2557
+
2558
+ #### Returns
2559
+
2560
+ `void`
2561
+
2562
+ ***
2563
+
2564
+ ### applyMappedTypeRequiredKeys() {#applymappedtyperequiredkeys}
2565
+
2566
+ > `static` **applyMappedTypeRequiredKeys**(`schema`, `propertyKeys`, `optionalToken`): `void`
2567
+
2568
+ Apply mapped-type required keys for generated property sets.
2569
+
2570
+ #### Parameters
2571
+
2572
+ ##### schema
2573
+
2574
+ `IJsonSchema`
2575
+
2576
+ The mapped schema.
2577
+
2578
+ ##### propertyKeys
2579
+
2580
+ `string`[]
2581
+
2582
+ The generated property keys.
2583
+
2584
+ ##### optionalToken
2585
+
2586
+ `QuestionToken` \| `PlusToken` \| `MinusToken` \| `undefined`
2587
+
2588
+ The mapped type optional token.
2589
+
2590
+ #### Returns
2591
+
2592
+ `void`
2593
+
2594
+ ***
2595
+
2596
+ ### extractKeyofTypeKeys() {#extractkeyoftypekeys}
2597
+
2598
+ > `static` **extractKeyofTypeKeys**(`context`, `keysOperandNode`): `string`[]
2599
+
2600
+ Extract key names from a keyof operand where possible.
2601
+
2602
+ #### Parameters
2603
+
2604
+ ##### context
2605
+
2606
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2607
+
2608
+ The generation context.
2609
+
2610
+ ##### keysOperandNode
2611
+
2612
+ `TypeNode`
2613
+
2614
+ The operand used with keyof.
2615
+
2616
+ #### Returns
2617
+
2618
+ `string`[]
2619
+
2620
+ The extracted keys.
2621
+
2622
+ ***
2623
+
2624
+ ### isGenericKeyofOperand() {#isgenerickeyofoperand}
2625
+
2626
+ > `static` **isGenericKeyofOperand**(`context`, `keysOperandNode`): `boolean`
2627
+
2628
+ Determine whether a keyof operand is a generic type parameter reference.
2629
+
2630
+ #### Parameters
2631
+
2632
+ ##### context
2633
+
2634
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2635
+
2636
+ The generation context.
2637
+
2638
+ ##### keysOperandNode
2639
+
2640
+ `TypeNode`
2641
+
2642
+ The operand used with keyof.
2643
+
2644
+ #### Returns
2645
+
2646
+ `boolean`
2647
+
2648
+ True if the operand is a generic parameter.
2649
+
2650
+ ***
2651
+
2652
+ ### resolveExternalTypeReferenceSchemaId() {#resolveexternaltypereferenceschemaid}
2653
+
2654
+ > `static` **resolveExternalTypeReferenceSchemaId**(`context`, `typeNode`, `typeName`): `string` \| `undefined`
2655
+
2656
+ Resolve a schema id for an external imported type reference.
2657
+
2658
+ #### Parameters
2659
+
2660
+ ##### context
2661
+
2662
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2663
+
2664
+ The generation context.
2665
+
2666
+ ##### typeNode
2667
+
2668
+ `TypeReferenceNode`
2669
+
2670
+ The type reference node.
2671
+
2672
+ ##### typeName
2673
+
2674
+ `string`
2675
+
2676
+ The referenced type name.
2677
+
2678
+ #### Returns
2679
+
2680
+ `string` \| `undefined`
2681
+
2682
+ The resolved schema id.
2683
+
2684
+ ***
2685
+
2686
+ ### resolveReferenceMappingTarget() {#resolvereferencemappingtarget}
2687
+
2688
+ > `static` **resolveReferenceMappingTarget**(`context`, `packageName`, `typeName`): \{ `schemaId`: `string`; `namespace?`: `string`; \} \| `undefined`
2689
+
2690
+ Resolve a mapped schema target for an imported reference.
2691
+
2692
+ #### Parameters
2693
+
2694
+ ##### context
2695
+
2696
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
2697
+
2698
+ The generation context.
2699
+
2700
+ ##### packageName
2701
+
2702
+ `string`
2703
+
2704
+ The referenced package or module specifier.
2705
+
2706
+ ##### typeName
2707
+
2708
+ `string`
2709
+
2710
+ The imported type name.
2711
+
2712
+ #### Returns
2713
+
2714
+ \{ `schemaId`: `string`; `namespace?`: `string`; \} \| `undefined`
2715
+
2716
+ The mapped schema id and optional namespace if one matches.
2717
+
2718
+ ***
2719
+
2720
+ ### findImportedModuleSpecifier() {#findimportedmodulespecifier}
2721
+
2722
+ > `static` **findImportedModuleSpecifier**(`sourceFile`, `typeNode`, `typeName`): `string` \| `undefined`
2723
+
2724
+ Find a module specifier for a referenced type in the active source file imports.
2725
+
2726
+ #### Parameters
2727
+
2728
+ ##### sourceFile
2729
+
2730
+ `SourceFile`
2731
+
2732
+ The active source file.
2733
+
2734
+ ##### typeNode
2735
+
2736
+ `TypeReferenceNode`
2737
+
2738
+ The referenced type node.
2739
+
2740
+ ##### typeName
2741
+
2742
+ `string`
2743
+
2744
+ The referenced type name.
2745
+
2746
+ #### Returns
2747
+
2748
+ `string` \| `undefined`
2749
+
2750
+ The module specifier.
2751
+
2752
+ ***
2753
+
2754
+ ### mapJsonSchemaTagKey() {#mapjsonschematagkey}
2755
+
2756
+ > `static` **mapJsonSchemaTagKey**(`key`): `string`
2757
+
2758
+ Map custom tag key names to JSON schema property names.
2759
+
2760
+ #### Parameters
2761
+
2762
+ ##### key
2763
+
2764
+ `string`
2765
+
2766
+ The raw tag key.
2767
+
2768
+ #### Returns
2769
+
2770
+ `string`
2771
+
2772
+ The schema key.