{
  type CoffeeCup = {
    shots: number;
    hasMilk: boolean;
  };

	*// interface*
  interface CoffeeMakerA {
    makeCoffee(shots: number): CoffeeCup;
  }

	*// Parent Class*
  class CoffeeMaker {

    private static BEANS_GRANS_PER_SHOT = 7; 
    private coffeeBeans: number = 0;

    constructor(coffeeBeans: number) {
      this.coffeeBeans = coffeeBeans;
    }
		
		private grindBeans(shots: number) {
      console.log(`grinding beans for ${shots}`);
      if (this.coffeeBeans < shots * CoffeeMaker.BEANS_GRANS_PER_SHOT) {
        throw new Error('Not enough coffee beans!');
      }
      this.coffeeBeans -= shots * CoffeeMaker.BEANS_GRANS_PER_SHOT;
    }

    private preheat(): void {
      console.log('heating up...πŸ”₯');
    }

    private extract(shots: number): CoffeeCup {
      console.log(`Pulling ${shots} shots...β˜•`);
      return {
        shots: shots,
        hasMilk: false,
      }
    }
		
    public makeCoffee(shots: number): CoffeeCup {
			this.grindBeans(shots);
			this.preheat();
			return this.extract(shots);
    }
		
		public clean() {
      console.log("Coffee Cleaning~...✨");
    }
  }

	*// Child Class - 01
  // λ‹€ν˜•μ„± 1*
	class CaffeLatteMachine extends CoffeeMaker {
    
    constructor(coffeeBeans: number, public serialNumber: string) {
      super(coffeeBeans);
    }

    private steamMilk(): void {
      console.log('Steaming some milk... πŸ₯›');
    }

    public makeCoffee(shots: number): CoffeeCup { *// μ˜€λ²„λΌμ΄λ”© λ˜μ–΄ ν˜ΈμΆœλœλ‹€.*
      const coffee = super.makeCoffee(shots);
      this.steamMilk();
      console.log(coffee);
      return {
        ...coffee,      
        hasMilk: true,  
      }
    }
  }

	*// Child Class - 02
  // λ‹€ν˜•μ„± 2*
  class SweetCoffeeMaker extends CoffeeMaker {

    public makeCoffee(shots: number): CoffeeCup {
      const coffee = super.makeCoffee(shots);
      console.log('sugar...');
      return {
        ...coffee,
        hasSugar: true,
      }
    }
  }
	
	const machines = [
		new CoffeeMaker(24),
		new CoffeeLatteMachine(24, 'ssss-1'),
		new SweetCoffeeMaker(24),
		new CoffeeMaker(24),
		new CoffeeLatteMachine(24, 'ssss-2'),
		new SweetCoffeeMaker(24),
	];

	machines.forEach(machine => {
		console.log('----------------------');
		machine.makeCoffee(1);
	});
}