|
6 | 6 | addRange,
|
7 | 7 | addRelatedInfo,
|
8 | 8 | addSyntheticLeadingComment,
|
| 9 | + addSyntheticTrailingComment, |
9 | 10 | AliasDeclarationNode,
|
10 | 11 | AllAccessorDeclarations,
|
11 | 12 | AmbientModuleDeclaration,
|
@@ -7054,6 +7055,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
7054 | 7055 |
|
7055 | 7056 | function createTypeNodesFromResolvedType(resolvedType: ResolvedType): TypeElement[] | undefined {
|
7056 | 7057 | if (checkTruncationLength(context)) {
|
| 7058 | + if (context.flags & NodeBuilderFlags.NoTruncation) { |
| 7059 | + return []; |
| 7060 | + } |
| 7061 | + |
7057 | 7062 | return [factory.createPropertySignature(/*modifiers*/ undefined, "...", /*questionToken*/ undefined, /*type*/ undefined)];
|
7058 | 7063 | }
|
7059 | 7064 | const typeElements: TypeElement[] = [];
|
@@ -7085,7 +7090,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
7085 | 7090 | }
|
7086 | 7091 | }
|
7087 | 7092 | if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
|
7088 |
| - typeElements.push(factory.createPropertySignature(/*modifiers*/ undefined, `... ${properties.length - i} more ...`, /*questionToken*/ undefined, /*type*/ undefined)); |
| 7093 | + if (context.flags & NodeBuilderFlags.NoTruncation) { |
| 7094 | + const typeElement = typeElements.pop()!; |
| 7095 | + typeElements.push(addSyntheticTrailingComment(typeElement, SyntaxKind.MultiLineCommentTrivia, `... ${properties.length - i} more ...`)); |
| 7096 | + } |
| 7097 | + else { |
| 7098 | + typeElements.push(factory.createPropertySignature(/*modifiers*/ undefined, `... ${properties.length - i} more ...`, /*questionToken*/ undefined, /*type*/ undefined)); |
| 7099 | + } |
7089 | 7100 | addPropertyToElementList(properties[properties.length - 1], context, typeElements);
|
7090 | 7101 | break;
|
7091 | 7102 | }
|
|
0 commit comments