Suppose I have the following two interface
interface Bird {
type: 'bird';
flyingSpeed: number;
}
interface Horse {
type: 'horse';
runningSpeed: number;
}
Now I want to create another interface that will extend either the Bird
or Horse
interface. I know that it's possible by using type. I am just curious about whether it is possible by using an interface or not like the following
interface Animal extends Bird | Horse {
name: string
}