Skip to content

Instantly share code, notes, and snippets.

@AmirTugi
Last active January 25, 2019 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmirTugi/a3e0a40fc19193cd23ca90448fbc1704 to your computer and use it in GitHub Desktop.
Save AmirTugi/a3e0a40fc19193cd23ca90448fbc1704 to your computer and use it in GitHub Desktop.
type MargheritaToppings = {
mushrooms?: boolean;
olives?: boolean;
onion?: boolean;
basil?: boolean;
};
type MargheritaCheeses = {
mozzarella?: boolean;
parmesan?: boolean;
};
type BasePizzaCheeses = {
feta: boolean;
};
class Pizza<T, C = BasePizzaCheeses> {
addToppings(toppings: T) {}
addCheeses(cheeses: C) {}
}
class PizzaMargherita extends Pizza<MargheritaToppings, MargheritaCheeses> {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment