Here is my example and I don't know how to implement the function "MakeCoffee". Please help. thanks.
interface Latte {
ouncesEspresso: number;
milkToEspresso: 4;
};
interface Cappuccino = {
ouncesEspresso: number;
milkToEspresso: 2;
};
interface IceLatte extends Latte {
icePortion: "light" | "normal" | "extra";
}
type Coffee = Latte | Cappuccino;
function MakeCoffee<T extends Coffee>(): T {
// I don't know how to figure out which type is used in that union type
// is this possible? if not, how to change the design
}