@@ -16,9 +16,9 @@ abstract class TypeScriptToKotlinBase(
16
16
17
17
open val defaultAnnotations: List <KtAnnotation > = listOf ()
18
18
19
- open fun addVariable (symbol : Symbol ? , name : String , type : KtType , extendsType : KtType ? = null, typeParams : List <KtTypeParam >? = null, isVar : Boolean = true, needsNoImpl : Boolean = true , additionalAnnotations : List <KtAnnotation > = listOf(), isOverride : Boolean = false) {
19
+ open fun addVariable (symbol : Symbol ? , name : String , type : KtType , extendsType : KtType ? = null, typeParams : List <KtTypeParam >? = null, isVar : Boolean = true, isAbstract : Boolean = false, needsNoImpl : Boolean = !isAbstract , additionalAnnotations : List <KtAnnotation > = listOf(), isOverride : Boolean = false) {
20
20
val annotations = defaultAnnotations + additionalAnnotations
21
- addDeclaration(symbol, KtVariable (KtName (name), KtTypeAnnotation (type), extendsType?.let { KtHeritageType (it) }, annotations, typeParams, isVar = isVar, needsNoImpl = needsNoImpl, isInInterface = isInterface, isOverride = isOverride, hasOpenModifier = hasMembersOpenModifier))
21
+ addDeclaration(symbol, KtVariable (KtName (name), KtTypeAnnotation (type), extendsType?.let { KtHeritageType (it) }, annotations, typeParams, isVar = isVar, needsNoImpl = needsNoImpl, isInInterface = isInterface, isOverride = isOverride, hasOpenModifier = hasMembersOpenModifier && ! isAbstract, isAbstract = isAbstract ))
22
22
}
23
23
24
24
open fun addFunction (symbol : Symbol ? , name : String , callSignature : KtCallSignature , extendsType : KtType ? = null, needsNoImpl : Boolean = true, additionalAnnotations : List <KtAnnotation > = listOf(), isOverride : Boolean = false, isOperator : Boolean = false, isAbstract : Boolean = false) {
@@ -38,6 +38,10 @@ abstract class TypeScriptToKotlinBase(
38
38
return node.modifiers?.arr?.any { it.kind == SyntaxKind .AbstractKeyword } == true
39
39
}
40
40
41
+ fun isReadonly (node : Node ): Boolean {
42
+ return node.modifiers?.arr?.any { it.kind == SyntaxKind .ReadonlyKeyword } == true
43
+ }
44
+
41
45
// TODO
42
46
open fun visitList (node : typescriptServices.ts.Node ) {
43
47
forEachChild(this , node)
0 commit comments