I Kotlin if I have an interface
like this:
interface User {
val name: String
val email: String
}
I can write an extension function like this anywhere in the code:
fun User.toUserDto(): UserDto {
TODO()
}
In Typescript if I have a similar interface
:
export default interface User {
name: string;
email: string;
}
How can I augment it in a similar way? Is this a best practice in the language? Is there an alternative to this I don't know about?