> First we declare the interfaces we will union. Each interface has a kind property with a different string literal type. The kind property is called the discriminant or tag. The other properties are specific to each interface. Notice that the interfaces are currently unrelated. Let’s put them into a union:
>
> `type Shape = Square | Rectangle | Circle;`
>
> Now let’s use the discriminated union:
>
> ```
> function area(s: Shape) {
> switch (s.kind) {
> case "square": return s.size * s.size;
> case "rectangle": return s.height * s.width;
> case "circle": return Math.PI * s.radius ** 2;
> }
> }
> ```