interface and a type alias in TypeScript?An interface can be extended or implemented multiple times, allowing declaration merging, while a type alias cannot be reopened once declared.
type alias represent union or intersection types in TypeScript?Yes, type aliases can represent complex types like unions (|) and intersections (&), which interfaces cannot directly express.
interface over a type alias?Use interface when you want to take advantage of declaration merging or when defining object shapes that might be extended or implemented by classes.
type alias to define a function signature in TypeScript?Yes, type aliases can define function types, for example: type Fn = (x: number) => string;.
interfaces with the same name in TypeScript?TypeScript merges the declarations, combining their members into a single interface.
Only interface supports extension and declaration merging in TypeScript.
Type aliases can represent union types, but interfaces cannot.
Type aliases are commonly used to define function types.
TypeScript merges interfaces with the same name into one combined interface.
Type aliases do NOT support declaration merging; only interfaces do.