[JS/IR] fix: add ability to render type constraints into TypeScript definitions.
This commit is contained in:
@@ -81,7 +81,7 @@ data class ExportedRegularClass(
|
||||
val isAbstract: Boolean = false,
|
||||
override val superClass: ExportedType? = null,
|
||||
override val superInterfaces: List<ExportedType> = emptyList(),
|
||||
val typeParameters: List<String>,
|
||||
val typeParameters: List<ExportedType.TypeParameter>,
|
||||
override val members: List<ExportedDeclaration>,
|
||||
override val nestedClasses: List<ExportedClass>,
|
||||
override val ir: IrClass,
|
||||
|
||||
+1
-1
@@ -378,7 +378,7 @@ class ExportModelGenerator(
|
||||
members: List<ExportedDeclaration>,
|
||||
nestedClasses: List<ExportedClass>
|
||||
): ExportedDeclaration {
|
||||
val typeParameters = klass.typeParameters.map { it.name.identifier }
|
||||
val typeParameters = klass.typeParameters.map(::exportTypeParameter)
|
||||
|
||||
// TODO: Handle non-exported super types
|
||||
|
||||
|
||||
+1
-1
@@ -258,7 +258,7 @@ class ExportModelToTsDeclarations {
|
||||
}
|
||||
|
||||
val renderedTypeParameters = if (typeParameters.isNotEmpty()) {
|
||||
"<" + typeParameters.joinToString(", ") + ">"
|
||||
"<" + typeParameters.joinToString(", ") { it.toTypeScript(indent) } + ">"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user