and @nullable types:
property?: type
in interface is same as if you said
property: type | undefined
so if you had a Kotlin
data class A(
id: Int,
name: String,
imageId: Int? = null,
modified: String? = null,
)
then it's constructor would behave same as constructing ts/js objects in interface A
eg, equivalent of
const a: A = {
id: 1,
name: "The Answer",
imageId: 42,
}
would be
val a = A(
id = 4,
name = "The Answer",
imageId = 42,
)
(and yes,
modified
would be
null
and not
undefined
, but unless you do some
heavy magic, you won't be able to distinguish the two... but your TS code also shouldn't make difference between null & undefined)