// Version A
interface User { id: string }
interface User { name: string }
const u: User = { id: "1", name: "Ann" };
// Version B
type Account = { id: string };
type Account = { name: string };
Only Version A
Only Version A compiles. Interfaces with the same name merge into one, so User has both id and name.
"Both" is wrong because type aliases cannot be declared twice. Version B fails with a "Duplicate identifier" error.
Read more