Type vs Interface
Type
Use
type
when defining an alias for primitive types (string, boolean, number, bigint, symbol, etc)Use
type
when defining tuple typesUse
type
when defining function typesUse
type
when defining a union
Interface
Use
interface
for all object types where usingtype
is not required (see above)Using
interface
can extends from another interface, due to inheritance
Last updated
Was this helpful?