TypeScript Interfaces
An interface describes the shape of an object — which properties it has and their types. It is one of the most useful TypeScript features.
interface User {
name: string
age: number
}
const u: User = { name: "Sam", age: 29 }
Try it yourself
Loading editor…