declare interface Printer {
  id: string | number
  name: string
  status: string
}
declare interface PrintJob {
  printer: Printer
  receipt: Receipt
}
declare interface PrinterDriver {
  print: (printJob: PrintJob) => Promise<void>
  cleanUp: (printer: Printer) => Promise<void>
  checkStatus: (printer: Printer) => Promise<boolean>
  findPrinters: () => Promise<Printer[]>
  setup: (printer: Printer) => Promise<void>
  restart: () => Promise<void>
  canInteractWithPrinter: (printer: Printer) => Promise<boolean>
}
declare type Path = string

interface Receipt {
  id: string | number
  name: string
  price: number
  quantity: number
  template: Path
}

class TSPIVPrinter implements PrinterDriver {
  async print(receipt: Receipt): Promise<void> {
    console.log('TSP IV Printer: Printing receipt', receipt)
  }

  async cleanUp(): Promise<void> {
    console.log('TSP IV Printer: Cleaning up print job...')
  }

  async checkStatus(): Promise<boolean> {
    console.log('TSP IV Printer: Checking online status...')
    return true 
  }
}

export const tspIVPrinter: PrinterDriver = new TSPIVPrinter()