import { PrinterLanguage } from "./languages/base-printer-language"; import { ReceiptConfig } from "./receipt"; /** * Contains all data necessary to generate a printer receipt from a template */ type Source = { templateType: 'receipt' | 'html'; /** The username of the mobile device. Used when retrieving templates online */ userName: string; /** The template to use */ template: string; /** Can contain settings to change specific parameters, if necessary. * @remarks Not used at the moment */ settings: any; /** An array of key-value pairs which contain all labels. This translations are used to replace * all labels containing '{#...#}' */ translations: any; /** Contains an array of objects, describing the receipt */ model: any; /** The printer language to use. This will determine which how the receipt is printed */ printerLanguage: PrinterLanguage; /** For internal use. */ appVersion: string; /** Additional configuration for receipts */ config?: ReceiptConfig; }; /** * Used to generate printer receipt from a template */ export declare class ReceiptTemplateGenerator { /** Used to register handlebar helper functions */ private intstallHandlebarsHelpers; private validateJsonTemplate; /** * [ASYNC] Used to generate and return a string representation of the document. This document contains all * necessary commands for the printer to print the receipt. * @param source - Options for generating the receipt. See {@link Source} for more details * @param loadImageFromFileInBase64 - [ASYNC] Function used to load images from file system, before generating the receipt * @throws Error if source argument is null, or if the source parameters are null */ generate(source: Source, loadImageFromFileInBase64?: Function, loadTemplateFunction?: (templateName: string, templateParams?: Record) => Promise): Promise; private parseJsonTemplate; private replaceTextLabels; /** * [ASYNC] Used to generate and return an array representation of the document. This array will contain all * necessary commands for the printer to print the receipt. The purpose of this method is to print a very long receipt * in smaller batches, to avoid printer buffer overflow. * @param source - Options for generating the receipt. See {@link Source} for more details * @param batchInstructions - Number of instructions per batch. If 0 or not provided, the whole receipt will be generated in a single batch * @param loadImageFromFileInBase64 - [ASYNC] Function used to load images from file system, before generating the receipt * @param loadTemplateFunction - [ASYNC] Function used to load external templates, before generating the receipt * @throws Error if source argument is null, or if the source parameters are null */ generateBatchesAsync(source: Source, batchInstructions?: number, options?: any, loadImageFromFileInBase64?: Function, loadTemplateFunction?: (templateName: string, templateParams?: Record) => Promise): Promise>; /** * [ASYNC] Used to generate and return a string representation of the document. This document contains all * necessary commands for the printer to print the receipt. * @param source - Options for generating the receipt. See {@link Source} for more details * @param loadImageFromFileInBase64 - [ASYNC] Function used to load images from file system, before generating the receipt * @throws Error if source argument is null, or if the source parameters are null */ generateAsync(source: Source, loadImageFromFileInBase64?: Function): Promise; private validateSource; } export {};