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

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

	*// Parent Class*
  class CoffeeMaker {

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

    private constructor(coffeeBeans: number) {
      this.coffeeBeans = coffeeBeans;
    }

    static makeMachine(coffeeBeans: number) {
      return new CoffeeMaker(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*
	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,      *// coffee λŠ” super.makeCoffee(shots) μ—μ„œ λ°˜ν™˜λœ 객체 μ΄μ§€λ§Œ ...coffee λŠ” 객체 μ•ˆμ˜ μš”μ†Œλ“€μ„ μ˜λ―Έν•œλ‹€.*
        hasMilk: true,  *// object 의 key의 이름이 같은 경우, 맨 λ’€μ—μ˜€λŠ” 같은 이름이 μ•žμ˜ 같은 μ΄λ¦„μ˜ key의 값을 λ₯μ–΄ μ”Œμš΄λ‹€.*
      }
    }
		*// 상속을 톡해 λ©”μ†Œλ“œ μž¬μ‚¬μš©(μ˜€λ²„λΌμ΄λ”©)ν•˜μ—¬ 컀피머신에 우유λ₯Ό μΆ”κ°€ν•˜λŠ” μƒˆλ‘œμš΄ κΈ°λŠ₯을 κΈ°λŠ₯을 μΆ”κ°€ν•˜μ˜€λ‹€.*
  }

	const latteMachine = new CaffeLatteMachine(33, 'ssss');
  const coffee = latteMachine.makeCoffee(2);
  console.log(coffee);
}