Antarmuka TypeScript vs tipe

// An interface can only describe objects, while a type is more flexible
type StringOrNumber = string | number; // not possible with interface

// An interface can be extended, while a type cannot. This makes
// interfaces great for generic components since a more specific
// component can extend its interface.
interface Dog extends Animal {
  tailShape: string;
  owner: string;
}
Stupid Scarab