export default class MerchantPrinter { merchantPrinter: undefined } declare global { export type TPrinterId = string // 'ip:port' export type TCutPapaerMode = 'item' | 'category' | 'none' export enum ETextStyle { Small = 0, // 小 Medium = 1, // 中 Large = 2, // 大 MediumWidth = 3, // 中闊 LargeWidth = 4, // 大闊 } export interface IPrinterSetting { printers: IPrinter[] priority: { [printerId: string]: null } defaultSettings: IPrinterDefaultSetting // 預設設定 confirmReceiptSettings: IConfirmReceiptSetting[] // 確認單設定 kitchenReceiptSettings: IKitchenReceiptSetting[] // 廚房單設定 invoiceSettings: IInvoiceSetting[] // 收據設定 defaultPrinter: string | null // 預設印表機(只能設一台) qrcodePrinter: string | null // QRCode 印表機(只能設一台) reportPrinter: string | null // 報表印表機(只能設一台) } export interface IPrinter { id: TPrinterId name: string } // 預設設定 export interface IPrinterDefaultSetting { syncReceipt: boolean // 即時打印顧客收據(堂食) syncTakeawayReceipt: boolean // 即時打印顧客收據(外賣) printCancelledItem: boolean // 打印取消項目 cutPaperMode: TCutPapaerMode // 切紙模式 printSetmenuBundled: boolean // 套餐組合打印 splitItem: boolean // 逐項打印 printWithPrice: boolean // 顯示價錢 batchMenuStyleText: ETextStyle // 廚房單字型 customerReceiptStyleText: ETextStyle // 客人收據字型 printTimes?: number // 重複打印次數 } // 確認單設定 export interface IConfirmReceiptSetting { id: string name: string // 名稱 printer: TPrinterId[] // 打印機 table: string[] // 抬號 category: string[] // 分類 printTimes: number // 重複打印次數 batchMenuStyleText: ETextStyle // 字型 } // 廚房單設定 export interface IKitchenReceiptSetting { id: string name: string // 名稱 printer: TPrinterId[] // 打印機 table: string[] // 抬號 category: string[] // 分類 printTimes: number // 重複打印次數 printCancelledItem: boolean // 打印取消項目 cutPaperMode: TCutPapaerMode printSetmenuBundled: boolean // 套餐組合打印 splitItem: boolean // 逐項打印 printWithPrice: boolean // 顯示價格 batchMenuStyleText: ETextStyle // 字型 menu: null // ? } // 收據設定 export interface IInvoiceSetting { id: string name: string // 名稱 printer: TPrinterId[] // 打印機 table: string[] // 抬號 category: string[] // 分類 printTimes: number // 重複打印次數 syncReceipt: boolean // 即時打印顧客收據(堂食) syncTakeawayReceipt: boolean // 即時打印顧客收據(外賣) customerReceiptStyleText: ETextStyle // 字型 } }