Skip to content

Commit 02ec72b

Browse files
committed
Fix conversion of object literals with construct signatures
Closes #2036
1 parent e50d7bf commit 02ec72b

File tree

5 files changed

+295
-101
lines changed

5 files changed

+295
-101
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### Bug Fixes
44

5+
- Fixed conversion of object literal types containing construct signatures, #2036.
56
- Fixed centering of title bar on wide displays, actually this time, #2046.
67

78
## v0.23.13 (2022-09-01)

src/lib/converter/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@ const typeLiteralConverter: TypeConverter<ts.TypeLiteralNode> = {
556556
for (const signature of type.getCallSignatures()) {
557557
createSignature(rc, ReflectionKind.CallSignature, signature);
558558
}
559+
for (const signature of type.getConstructSignatures()) {
560+
createSignature(rc, ReflectionKind.ConstructorSignature, signature);
561+
}
559562

560563
convertIndexSignature(rc, symbol);
561564

@@ -584,6 +587,13 @@ const typeLiteralConverter: TypeConverter<ts.TypeLiteralNode> = {
584587
signature
585588
);
586589
}
590+
for (const signature of type.getConstructSignatures()) {
591+
createSignature(
592+
context.withScope(reflection),
593+
ReflectionKind.ConstructorSignature,
594+
signature
595+
);
596+
}
587597

588598
convertIndexSignature(context.withScope(reflection), type.symbol);
589599

0 commit comments

Comments
 (0)