@microsoft/api-extractor 7.55.2 → 7.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@microsoft/api-extractor",
3
3
  "entries": [
4
+ {
5
+ "version": "7.56.0",
6
+ "tag": "@microsoft/api-extractor_v7.56.0",
7
+ "date": "Fri, 30 Jan 2026 01:16:12 GMT",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "comment": "Fix an issue where destructured parameters produced an incorrect parameter name"
12
+ }
13
+ ]
14
+ }
15
+ },
16
+ {
17
+ "version": "7.55.5",
18
+ "tag": "@microsoft/api-extractor_v7.55.5",
19
+ "date": "Thu, 08 Jan 2026 01:12:30 GMT",
20
+ "comments": {
21
+ "patch": [
22
+ {
23
+ "comment": "Fix missing 'export' keyword for namespace re-exports that produced invalid TypeScript output"
24
+ }
25
+ ]
26
+ }
27
+ },
28
+ {
29
+ "version": "7.55.4",
30
+ "tag": "@microsoft/api-extractor_v7.55.4",
31
+ "date": "Wed, 07 Jan 2026 01:12:24 GMT",
32
+ "comments": {
33
+ "dependency": [
34
+ {
35
+ "comment": "Updating dependency \"@rushstack/terminal\" to `0.21.0`"
36
+ },
37
+ {
38
+ "comment": "Updating dependency \"@rushstack/ts-command-line\" to `5.1.7`"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "version": "7.55.3",
45
+ "tag": "@microsoft/api-extractor_v7.55.3",
46
+ "date": "Mon, 05 Jan 2026 16:12:49 GMT",
47
+ "comments": {
48
+ "dependency": [
49
+ {
50
+ "comment": "Updating dependency \"@rushstack/terminal\" to `0.20.0`"
51
+ },
52
+ {
53
+ "comment": "Updating dependency \"@rushstack/ts-command-line\" to `5.1.6`"
54
+ }
55
+ ]
56
+ }
57
+ },
4
58
  {
5
59
  "version": "7.55.2",
6
60
  "tag": "@microsoft/api-extractor_v7.55.2",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,30 @@
1
1
  # Change Log - @microsoft/api-extractor
2
2
 
3
- This log was last generated on Sat, 06 Dec 2025 01:12:28 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 30 Jan 2026 01:16:12 GMT and should not be manually modified.
4
+
5
+ ## 7.56.0
6
+ Fri, 30 Jan 2026 01:16:12 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - Fix an issue where destructured parameters produced an incorrect parameter name
11
+
12
+ ## 7.55.5
13
+ Thu, 08 Jan 2026 01:12:30 GMT
14
+
15
+ ### Patches
16
+
17
+ - Fix missing 'export' keyword for namespace re-exports that produced invalid TypeScript output
18
+
19
+ ## 7.55.4
20
+ Wed, 07 Jan 2026 01:12:24 GMT
21
+
22
+ _Version update only_
23
+
24
+ ## 7.55.3
25
+ Mon, 05 Jan 2026 16:12:49 GMT
26
+
27
+ _Version update only_
4
28
 
5
29
  ## 7.55.2
6
30
  Sat, 06 Dec 2025 01:12:28 GMT
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.54.0"
8
+ "packageVersion": "7.55.2"
9
9
  }
10
10
  ]
11
11
  }
@@ -41,7 +41,7 @@ export declare class ApiModelGenerator {
41
41
  private _processApiTypeAlias;
42
42
  private _processApiVariable;
43
43
  /**
44
- * @param nodesToCapture - A list of child nodes whose token ranges we want to capture
44
+ * @param nodeTransforms - A list of child nodes whose token ranges we want to capture
45
45
  */
46
46
  private _buildExcerptTokens;
47
47
  private _captureTypeParameters;
@@ -1 +1 @@
1
- {"version":3,"file":"ApiModelGenerator.d.ts","sourceRoot":"","sources":["../../src/generators/ApiModelGenerator.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,QAAQ,EAER,UAAU,EAOV,UAAU,EAiBX,MAAM,gCAAgC,CAAC;AAGxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAYxD,OAAO,KAAK,EAA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AAO,CAAC,oBAAoB;IAgC5B,OAAO,CAAC,mBAAmB;IAiE3B,OAAO,CAAC,4BAA4B;IAgDpC,OAAO,CAAC,oBAAoB;IA4C5B,OAAO,CAAC,mBAAmB;IAkD3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,sBAAsB;IA2B9B,OAAO,CAAC,kBAAkB;IA6B1B,OAAO,CAAC,WAAW;IA+BnB,OAAO,CAAC,eAAe;CAcxB"}
@@ -46,6 +46,7 @@ const AstSymbol_1 = require("../analyzer/AstSymbol");
46
46
  const DeclarationReferenceGenerator_1 = require("./DeclarationReferenceGenerator");
47
47
  const AstNamespaceImport_1 = require("../analyzer/AstNamespaceImport");
48
48
  const TypeScriptInternals_1 = require("../analyzer/TypeScriptInternals");
49
+ const DtsEmitHelpers_1 = require("./DtsEmitHelpers");
49
50
  class ApiModelGenerator {
50
51
  constructor(collector, extractorConfig) {
51
52
  this._collector = collector;
@@ -238,12 +239,14 @@ class ApiModelGenerator {
238
239
  let apiCallSignature = parentApiItem.tryGetMemberByKey(containerKey);
239
240
  if (apiCallSignature === undefined) {
240
241
  const callSignature = astDeclaration.declaration;
241
- const nodesToCapture = [];
242
+ const nodeTransforms = [];
242
243
  const returnTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
243
- nodesToCapture.push({ node: callSignature.type, tokenRange: returnTypeTokenRange });
244
- const typeParameters = this._captureTypeParameters(nodesToCapture, callSignature.typeParameters);
245
- const parameters = this._captureParameters(nodesToCapture, callSignature.parameters);
246
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
244
+ if (callSignature.type) {
245
+ nodeTransforms.push({ node: callSignature.type, captureTokenRange: returnTypeTokenRange });
246
+ }
247
+ const typeParameters = this._captureTypeParameters(nodeTransforms, callSignature.typeParameters);
248
+ const parameters = this._captureParameters(nodeTransforms, callSignature.parameters);
249
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
247
250
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
248
251
  const docComment = apiItemMetadata.tsdocComment;
249
252
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -268,9 +271,9 @@ class ApiModelGenerator {
268
271
  let apiConstructor = parentApiItem.tryGetMemberByKey(containerKey);
269
272
  if (apiConstructor === undefined) {
270
273
  const constructorDeclaration = astDeclaration.declaration;
271
- const nodesToCapture = [];
272
- const parameters = this._captureParameters(nodesToCapture, constructorDeclaration.parameters);
273
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
274
+ const nodeTransforms = [];
275
+ const parameters = this._captureParameters(nodeTransforms, constructorDeclaration.parameters);
276
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
274
277
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
275
278
  const docComment = apiItemMetadata.tsdocComment;
276
279
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -294,26 +297,26 @@ class ApiModelGenerator {
294
297
  let apiClass = parentApiItem.tryGetMemberByKey(containerKey);
295
298
  if (apiClass === undefined) {
296
299
  const classDeclaration = astDeclaration.declaration;
297
- const nodesToCapture = [];
298
- const typeParameters = this._captureTypeParameters(nodesToCapture, classDeclaration.typeParameters);
300
+ const nodeTransforms = [];
301
+ const typeParameters = this._captureTypeParameters(nodeTransforms, classDeclaration.typeParameters);
299
302
  let extendsTokenRange = undefined;
300
303
  const implementsTokenRanges = [];
301
304
  for (const heritageClause of classDeclaration.heritageClauses || []) {
302
305
  if (heritageClause.token === ts.SyntaxKind.ExtendsKeyword) {
303
306
  extendsTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
304
307
  if (heritageClause.types.length > 0) {
305
- nodesToCapture.push({ node: heritageClause.types[0], tokenRange: extendsTokenRange });
308
+ nodeTransforms.push({ node: heritageClause.types[0], captureTokenRange: extendsTokenRange });
306
309
  }
307
310
  }
308
311
  else if (heritageClause.token === ts.SyntaxKind.ImplementsKeyword) {
309
312
  for (const heritageType of heritageClause.types) {
310
313
  const implementsTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
311
314
  implementsTokenRanges.push(implementsTokenRange);
312
- nodesToCapture.push({ node: heritageType, tokenRange: implementsTokenRange });
315
+ nodeTransforms.push({ node: heritageType, captureTokenRange: implementsTokenRange });
313
316
  }
314
317
  }
315
318
  }
316
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
319
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
317
320
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
318
321
  const docComment = apiItemMetadata.tsdocComment;
319
322
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -345,12 +348,14 @@ class ApiModelGenerator {
345
348
  let apiConstructSignature = parentApiItem.tryGetMemberByKey(containerKey);
346
349
  if (apiConstructSignature === undefined) {
347
350
  const constructSignature = astDeclaration.declaration;
348
- const nodesToCapture = [];
351
+ const nodeTransforms = [];
349
352
  const returnTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
350
- nodesToCapture.push({ node: constructSignature.type, tokenRange: returnTypeTokenRange });
351
- const typeParameters = this._captureTypeParameters(nodesToCapture, constructSignature.typeParameters);
352
- const parameters = this._captureParameters(nodesToCapture, constructSignature.parameters);
353
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
353
+ if (constructSignature.type) {
354
+ nodeTransforms.push({ node: constructSignature.type, captureTokenRange: returnTypeTokenRange });
355
+ }
356
+ const typeParameters = this._captureTypeParameters(nodeTransforms, constructSignature.typeParameters);
357
+ const parameters = this._captureParameters(nodeTransforms, constructSignature.parameters);
358
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
354
359
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
355
360
  const docComment = apiItemMetadata.tsdocComment;
356
361
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -401,13 +406,13 @@ class ApiModelGenerator {
401
406
  let apiEnumMember = parentApiItem.tryGetMemberByKey(containerKey);
402
407
  if (apiEnumMember === undefined) {
403
408
  const enumMember = astDeclaration.declaration;
404
- const nodesToCapture = [];
409
+ const nodeTransforms = [];
405
410
  let initializerTokenRange = undefined;
406
411
  if (enumMember.initializer) {
407
412
  initializerTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
408
- nodesToCapture.push({ node: enumMember.initializer, tokenRange: initializerTokenRange });
413
+ nodeTransforms.push({ node: enumMember.initializer, captureTokenRange: initializerTokenRange });
409
414
  }
410
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
415
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
411
416
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
412
417
  const docComment = apiItemMetadata.tsdocComment;
413
418
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -430,12 +435,14 @@ class ApiModelGenerator {
430
435
  let apiFunction = parentApiItem.tryGetMemberByKey(containerKey);
431
436
  if (apiFunction === undefined) {
432
437
  const functionDeclaration = altFunctionDeclaration !== null && altFunctionDeclaration !== void 0 ? altFunctionDeclaration : astDeclaration.declaration;
433
- const nodesToCapture = [];
438
+ const nodeTransforms = [];
434
439
  const returnTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
435
- nodesToCapture.push({ node: functionDeclaration.type, tokenRange: returnTypeTokenRange });
436
- const typeParameters = this._captureTypeParameters(nodesToCapture, functionDeclaration.typeParameters);
437
- const parameters = this._captureParameters(nodesToCapture, functionDeclaration.parameters);
438
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
440
+ if (functionDeclaration.type) {
441
+ nodeTransforms.push({ node: functionDeclaration.type, captureTokenRange: returnTypeTokenRange });
442
+ }
443
+ const typeParameters = this._captureTypeParameters(nodeTransforms, functionDeclaration.typeParameters);
444
+ const parameters = this._captureParameters(nodeTransforms, functionDeclaration.parameters);
445
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
439
446
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
440
447
  const docComment = apiItemMetadata.tsdocComment;
441
448
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -462,11 +469,11 @@ class ApiModelGenerator {
462
469
  let apiIndexSignature = parentApiItem.tryGetMemberByKey(containerKey);
463
470
  if (apiIndexSignature === undefined) {
464
471
  const indexSignature = astDeclaration.declaration;
465
- const nodesToCapture = [];
472
+ const nodeTransforms = [];
466
473
  const returnTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
467
- nodesToCapture.push({ node: indexSignature.type, tokenRange: returnTypeTokenRange });
468
- const parameters = this._captureParameters(nodesToCapture, indexSignature.parameters);
469
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
474
+ nodeTransforms.push({ node: indexSignature.type, captureTokenRange: returnTypeTokenRange });
475
+ const parameters = this._captureParameters(nodeTransforms, indexSignature.parameters);
476
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
470
477
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
471
478
  const docComment = apiItemMetadata.tsdocComment;
472
479
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -491,19 +498,19 @@ class ApiModelGenerator {
491
498
  let apiInterface = parentApiItem.tryGetMemberByKey(containerKey);
492
499
  if (apiInterface === undefined) {
493
500
  const interfaceDeclaration = astDeclaration.declaration;
494
- const nodesToCapture = [];
495
- const typeParameters = this._captureTypeParameters(nodesToCapture, interfaceDeclaration.typeParameters);
501
+ const nodeTransforms = [];
502
+ const typeParameters = this._captureTypeParameters(nodeTransforms, interfaceDeclaration.typeParameters);
496
503
  const extendsTokenRanges = [];
497
504
  for (const heritageClause of interfaceDeclaration.heritageClauses || []) {
498
505
  if (heritageClause.token === ts.SyntaxKind.ExtendsKeyword) {
499
506
  for (const heritageType of heritageClause.types) {
500
507
  const extendsTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
501
508
  extendsTokenRanges.push(extendsTokenRange);
502
- nodesToCapture.push({ node: heritageType, tokenRange: extendsTokenRange });
509
+ nodeTransforms.push({ node: heritageType, captureTokenRange: extendsTokenRange });
503
510
  }
504
511
  }
505
512
  }
506
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
513
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
507
514
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
508
515
  const docComment = apiItemMetadata.tsdocComment;
509
516
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -533,12 +540,14 @@ class ApiModelGenerator {
533
540
  let apiMethod = parentApiItem.tryGetMemberByKey(containerKey);
534
541
  if (apiMethod === undefined) {
535
542
  const methodDeclaration = astDeclaration.declaration;
536
- const nodesToCapture = [];
543
+ const nodeTransforms = [];
537
544
  const returnTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
538
- nodesToCapture.push({ node: methodDeclaration.type, tokenRange: returnTypeTokenRange });
539
- const typeParameters = this._captureTypeParameters(nodesToCapture, methodDeclaration.typeParameters);
540
- const parameters = this._captureParameters(nodesToCapture, methodDeclaration.parameters);
541
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
545
+ if (methodDeclaration.type) {
546
+ nodeTransforms.push({ node: methodDeclaration.type, captureTokenRange: returnTypeTokenRange });
547
+ }
548
+ const typeParameters = this._captureTypeParameters(nodeTransforms, methodDeclaration.typeParameters);
549
+ const parameters = this._captureParameters(nodeTransforms, methodDeclaration.parameters);
550
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
542
551
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
543
552
  const docComment = apiItemMetadata.tsdocComment;
544
553
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -574,12 +583,14 @@ class ApiModelGenerator {
574
583
  let apiMethodSignature = parentApiItem.tryGetMemberByKey(containerKey);
575
584
  if (apiMethodSignature === undefined) {
576
585
  const methodSignature = astDeclaration.declaration;
577
- const nodesToCapture = [];
586
+ const nodeTransforms = [];
578
587
  const returnTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
579
- nodesToCapture.push({ node: methodSignature.type, tokenRange: returnTypeTokenRange });
580
- const typeParameters = this._captureTypeParameters(nodesToCapture, methodSignature.typeParameters);
581
- const parameters = this._captureParameters(nodesToCapture, methodSignature.parameters);
582
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
588
+ if (methodSignature.type) {
589
+ nodeTransforms.push({ node: methodSignature.type, captureTokenRange: returnTypeTokenRange });
590
+ }
591
+ const typeParameters = this._captureTypeParameters(nodeTransforms, methodSignature.typeParameters);
592
+ const parameters = this._captureParameters(nodeTransforms, methodSignature.parameters);
593
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
583
594
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
584
595
  const docComment = apiItemMetadata.tsdocComment;
585
596
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -632,7 +643,7 @@ class ApiModelGenerator {
632
643
  let apiProperty = parentApiItem.tryGetMemberByKey(containerKey);
633
644
  if (apiProperty === undefined) {
634
645
  const declaration = astDeclaration.declaration;
635
- const nodesToCapture = [];
646
+ const nodeTransforms = [];
636
647
  const propertyTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
637
648
  let propertyTypeNode;
638
649
  if (ts.isPropertyDeclaration(declaration) || ts.isGetAccessorDeclaration(declaration)) {
@@ -642,13 +653,15 @@ class ApiModelGenerator {
642
653
  // Note that TypeScript always reports an error if a setter does not have exactly one parameter.
643
654
  propertyTypeNode = declaration.parameters[0].type;
644
655
  }
645
- nodesToCapture.push({ node: propertyTypeNode, tokenRange: propertyTypeTokenRange });
656
+ if (propertyTypeNode) {
657
+ nodeTransforms.push({ node: propertyTypeNode, captureTokenRange: propertyTypeTokenRange });
658
+ }
646
659
  let initializerTokenRange = undefined;
647
660
  if (ts.isPropertyDeclaration(declaration) && declaration.initializer) {
648
661
  initializerTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
649
- nodesToCapture.push({ node: declaration.initializer, tokenRange: initializerTokenRange });
662
+ nodeTransforms.push({ node: declaration.initializer, captureTokenRange: initializerTokenRange });
650
663
  }
651
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
664
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
652
665
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
653
666
  const docComment = apiItemMetadata.tsdocComment;
654
667
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -684,10 +697,12 @@ class ApiModelGenerator {
684
697
  let apiPropertySignature = parentApiItem.tryGetMemberByKey(containerKey);
685
698
  if (apiPropertySignature === undefined) {
686
699
  const propertySignature = astDeclaration.declaration;
687
- const nodesToCapture = [];
700
+ const nodeTransforms = [];
688
701
  const propertyTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
689
- nodesToCapture.push({ node: propertySignature.type, tokenRange: propertyTypeTokenRange });
690
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
702
+ if (propertySignature.type) {
703
+ nodeTransforms.push({ node: propertySignature.type, captureTokenRange: propertyTypeTokenRange });
704
+ }
705
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
691
706
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
692
707
  const docComment = apiItemMetadata.tsdocComment;
693
708
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -717,11 +732,11 @@ class ApiModelGenerator {
717
732
  let apiTypeAlias = parentApiItem.tryGetMemberByKey(containerKey);
718
733
  if (apiTypeAlias === undefined) {
719
734
  const typeAliasDeclaration = astDeclaration.declaration;
720
- const nodesToCapture = [];
721
- const typeParameters = this._captureTypeParameters(nodesToCapture, typeAliasDeclaration.typeParameters);
735
+ const nodeTransforms = [];
736
+ const typeParameters = this._captureTypeParameters(nodeTransforms, typeAliasDeclaration.typeParameters);
722
737
  const typeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
723
- nodesToCapture.push({ node: typeAliasDeclaration.type, tokenRange: typeTokenRange });
724
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
738
+ nodeTransforms.push({ node: typeAliasDeclaration.type, captureTokenRange: typeTokenRange });
739
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
725
740
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
726
741
  const docComment = apiItemMetadata.tsdocComment;
727
742
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -745,15 +760,20 @@ class ApiModelGenerator {
745
760
  let apiVariable = parentApiItem.tryGetMemberByKey(containerKey);
746
761
  if (apiVariable === undefined) {
747
762
  const variableDeclaration = astDeclaration.declaration;
748
- const nodesToCapture = [];
763
+ const nodeTransforms = [];
749
764
  const variableTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
750
- nodesToCapture.push({ node: variableDeclaration.type, tokenRange: variableTypeTokenRange });
765
+ if (variableDeclaration.type) {
766
+ nodeTransforms.push({ node: variableDeclaration.type, captureTokenRange: variableTypeTokenRange });
767
+ }
751
768
  let initializerTokenRange = undefined;
752
769
  if (variableDeclaration.initializer) {
753
770
  initializerTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
754
- nodesToCapture.push({ node: variableDeclaration.initializer, tokenRange: initializerTokenRange });
771
+ nodeTransforms.push({
772
+ node: variableDeclaration.initializer,
773
+ captureTokenRange: initializerTokenRange
774
+ });
755
775
  }
756
- const excerptTokens = this._buildExcerptTokens(astDeclaration, nodesToCapture);
776
+ const excerptTokens = this._buildExcerptTokens(astDeclaration, nodeTransforms);
757
777
  const apiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
758
778
  const docComment = apiItemMetadata.tsdocComment;
759
779
  const releaseTag = apiItemMetadata.effectiveReleaseTag;
@@ -774,28 +794,32 @@ class ApiModelGenerator {
774
794
  }
775
795
  }
776
796
  /**
777
- * @param nodesToCapture - A list of child nodes whose token ranges we want to capture
797
+ * @param nodeTransforms - A list of child nodes whose token ranges we want to capture
778
798
  */
779
- _buildExcerptTokens(astDeclaration, nodesToCapture) {
799
+ _buildExcerptTokens(astDeclaration, nodeTransforms) {
780
800
  const excerptTokens = [];
781
801
  // Build the main declaration
782
- ExcerptBuilder_1.ExcerptBuilder.addDeclaration(excerptTokens, astDeclaration, nodesToCapture, this._referenceGenerator);
802
+ ExcerptBuilder_1.ExcerptBuilder.addDeclaration(excerptTokens, astDeclaration, nodeTransforms, this._referenceGenerator);
783
803
  const declarationMetadata = this._collector.fetchDeclarationMetadata(astDeclaration);
784
804
  // Add any ancillary declarations
785
805
  for (const ancillaryDeclaration of declarationMetadata.ancillaryDeclarations) {
786
806
  ExcerptBuilder_1.ExcerptBuilder.addBlankLine(excerptTokens);
787
- ExcerptBuilder_1.ExcerptBuilder.addDeclaration(excerptTokens, ancillaryDeclaration, nodesToCapture, this._referenceGenerator);
807
+ ExcerptBuilder_1.ExcerptBuilder.addDeclaration(excerptTokens, ancillaryDeclaration, nodeTransforms, this._referenceGenerator);
788
808
  }
789
809
  return excerptTokens;
790
810
  }
791
- _captureTypeParameters(nodesToCapture, typeParameterNodes) {
811
+ _captureTypeParameters(nodeTransforms, typeParameterNodes) {
792
812
  const typeParameters = [];
793
813
  if (typeParameterNodes) {
794
814
  for (const typeParameter of typeParameterNodes) {
795
815
  const constraintTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
796
- nodesToCapture.push({ node: typeParameter.constraint, tokenRange: constraintTokenRange });
816
+ if (typeParameter.constraint) {
817
+ nodeTransforms.push({ node: typeParameter.constraint, captureTokenRange: constraintTokenRange });
818
+ }
797
819
  const defaultTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
798
- nodesToCapture.push({ node: typeParameter.default, tokenRange: defaultTypeTokenRange });
820
+ if (typeParameter.default) {
821
+ nodeTransforms.push({ node: typeParameter.default, captureTokenRange: defaultTypeTokenRange });
822
+ }
799
823
  typeParameters.push({
800
824
  typeParameterName: typeParameter.name.getText().trim(),
801
825
  constraintTokenRange,
@@ -805,17 +829,23 @@ class ApiModelGenerator {
805
829
  }
806
830
  return typeParameters;
807
831
  }
808
- _captureParameters(nodesToCapture, parameterNodes) {
832
+ _captureParameters(nodeTransforms, parameterNodes) {
809
833
  const parameters = [];
810
- for (const parameter of parameterNodes) {
834
+ DtsEmitHelpers_1.DtsEmitHelpers.forEachParameterToNormalize(parameterNodes, (parameter, syntheticName) => {
811
835
  const parameterTypeTokenRange = ExcerptBuilder_1.ExcerptBuilder.createEmptyTokenRange();
812
- nodesToCapture.push({ node: parameter.type, tokenRange: parameterTypeTokenRange });
836
+ if (parameter.type) {
837
+ nodeTransforms.push({ node: parameter.type, captureTokenRange: parameterTypeTokenRange });
838
+ }
813
839
  parameters.push({
814
- parameterName: parameter.name.getText().trim(),
840
+ parameterName: syntheticName !== null && syntheticName !== void 0 ? syntheticName : parameter.name.getText().trim(),
815
841
  parameterTypeTokenRange,
816
842
  isOptional: this._collector.typeChecker.isOptionalParameter(parameter)
817
843
  });
818
- }
844
+ if (syntheticName !== undefined) {
845
+ // Replace the subexpression like "{ y, z }" with the synthesized parameter name
846
+ nodeTransforms.push({ node: parameter.name, replacementText: syntheticName });
847
+ }
848
+ });
819
849
  return parameters;
820
850
  }
821
851
  _isReadonly(astDeclaration) {