typescript 2.8 - Conditional Type
Conditional Type
Which basically trying to say if type A kinda like B type, then we can just use C type.
interface Car {
drive(): void; } interface Ferarri extends Car { drivefaster(): void; } // Foo becomes number type Foo = Ferarri extends Car ? number : string;
Comments