In TypeScript, what is the difference between an `interface` and a `type` alias when defining the shape of an object?
-
A
Interfaces can be extended and merged via declaration merging; type aliases cannot be re-opened
-
B
Type aliases are compiled into JavaScript; interfaces are erased at compile time
-
C
Interfaces only work with classes; type aliases work with any shape
-
D
Type aliases enforce stricter null checking than interfaces