import { PrinterInstructionType, PrintingRuleType, SplitMethodEnum, PaperWidth, Justification, ServeTypeAndFloorExcludeType, PaperHeight } from '../enums/printer'; import { ServeType } from '../enums/serve-type'; import { TypeValue } from './utils'; export interface VirtualPrinter { id?: string; ip?: string; name: string; instruction: PrinterInstructionType; paperWidth: PaperWidth; paperHeight?: PaperHeight; justification: Justification; enabled: boolean; } export interface PrintingRule { id?: string; virtualPrinterId: string; name: string; type: PrintingRuleType; itemFontSize?: number; headerCroppedLogoUrl?: string; } export interface ServeTypeAndFloorTypeValue extends TypeValue { } export interface KitchenPrintingRule extends PrintingRule { type: PrintingRuleType.kitchen; sameProductIsSeparate: boolean; splitBy: SplitMethodEnum; includeAll: boolean; includeCategoryIds: string[]; includeProductIds: string[]; /** 出單排除樓層 / ServeType */ includeServeTypeAndFloors?: ServeTypeAndFloorTypeValue[]; /** 每個品項上出現訂購人 */ showBuyer?: boolean; } export interface StickerPrintingRule extends PrintingRule { type: PrintingRuleType.sticker; includeAll: boolean; includeCategoryIds: string[]; includeProductIds: string[]; footerText: string; /** 出單排除樓層 / ServeType */ includeServeTypeAndFloors?: ServeTypeAndFloorTypeValue[]; } export interface CustomerPrintingRule extends PrintingRule { type: PrintingRuleType.customer; headerLogoUrl: string; headerCroppedLogoUrl: string; headerLogoCropInfo: CropInfo; footerText: string; /** 出單排除樓層 / ServeType */ includeServeTypeAndFloors?: ServeTypeAndFloorTypeValue[]; } export interface ReceiptPrintingRule extends PrintingRule { type: PrintingRuleType.receipt; headerLogoUrl: string; headerCroppedLogoUrl: string; headerLogoCropInfo: CropInfo; footerText: string; accountConfigId: string; /** 不列印收據 / 發票明細 */ disablePrintingReceiptDetail?: boolean; } export interface CropInfo { x: number; y: number; zoom: number; height: number; width: number; }