TypeScript · Middle · Question 11 of 75
What is declaration merging?
- ✓Correct answer: Combining same-named declarations, e.g. two
interface Windows, into one - 2Automatically merging two npm type packages into one on install
- 3Combining a
typealias and aninterfacewith the same name
Explanation
Interfaces, namespaces and some other declarations with the same name merge. That's how global types are extended: interface Window { analytics: Analytics } in declare global. type aliases don't merge - redeclaring one is an error.