TypeScript – Interface (I)

I found the concept of Interface is quite fun, cause no matter what kind of languages, e.g. Golang, Java, Kotlin, etc. Even Swift/Objective-C also provide similar concept protocol to support the polymorphism. Then, let’s check what power TS interface gets.

One of TypeScript’s core principles is that type checking focuses on the shape that values have. This is sometimes called “duck typing” or “structural subtyping”. In TypeScript, interfaces fill the role of naming these types, and are a powerful way of defining contracts within your code as well as contracts with code outside of your project.

Continue reading “TypeScript – Interface (I)”