This content originally appeared on DEV Community and was authored by es404020
The simplest, and perhaps most common, type of declaration merging is interface merging. At the most basic level, the merge mechanically joins the members of both declarations into a single interface with the same name.
interface Box {
height: number;
width: number;
}
interface Box {
scale: number;
}
let box: Box = { height: 5, width: 6, scale: 10 };
This content originally appeared on DEV Community and was authored by es404020

es404020 | Sciencx (2021-09-08T21:09:27+00:00) Merging Interfaces in Typescript. Retrieved from https://www.scien.cx/2021/09/08/merging-interfaces-in-typescript/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.