import { ConfigurationChunk, chunkOptions, image, imageOptions, line } from '../tools/formatters'; import { LineSegment, PrinterImageBase } from './base-printer-language'; import * as utils from '../tools/utils'; import * as formatters2 from '../tools/formatters'; import { TextPrinterLanguage } from './text-printer-language'; /** * This class is used to convert images to a format that can be printed by zebra printers. */ export declare class EscP2Image { private rawData; private width; private height; private font; /** * Creates temporary html content, in order to draw the image and get it's data */ private createCanvas; /** * Removes all temporary html content, in order to preserve the view layout */ private clearCanvas; private b64tou8; private createImageFromText; /** * Merges multiple base64 images side by side (horizontally) into one image. * @param imagesBase64 Array of base64 image strings (without data URL prefix) * @param height Height of the resulting image (all images must have the same height) * @returns Uint8Array of the merged image in JPEG format */ protected loadImage(imageSrc: any, width?: number, height?: number): Promise; createMergedImage(imagesBase64Array: Array<{ data: string; width: number; height: number; offset?: number; }>, options?: imageOptions): Promise; private setCanvasFont; private drawText; private createImage; constructor(rawData: any, width: any, height: any, font: any); /** * * @returns {string} a string containing the image data in bytes. */ toImageFromText(options?: imageOptions): string; /** * * @returns {object} an object containing the image data in hexadecimal format, as well additional information about the image */ toImage(): PrinterImageBase; mergeImages(images: Array, width: number, height: number, options?: imageOptions): Promise; } /** * This class implements the Epson ESC/P2 printer language used various printer brands. */ export declare class EscP2Language extends TextPrinterLanguage { constructor(); /** @ignore */ protected lines: any[]; /** Can be used to increase the document height if necessary */ additionalDocumentHeight: number; /** * Generates the commands for printing the document * @returns */ printDocument(): string; printDocumentAsync(): Promise; init(config?: any): void; changeConfiguration(chunk: ConfigurationChunk): void; renderWord(word: string, options?: chunkOptions): string; /** * Use to print an image. * @param imageDataInBase64 - Contains the image data in a format that can be printed by ESC/P2 printers. * If this parameter is null, empty or undefined, the method will do nothing. * @param width - The width of the image in pixels * @param height - The width of the image in pixels * @param alignment - How the image is aligned on the paper */ printImage(imageDataInBase64: any, width: number, height: number, alignment: utils.Alignment, options: imageOptions): void; printImageRow(images: Array, width: number, height: number, alignment: utils.Alignment, options?: imageOptions): Promise; /** * Used to print a text line on the paper. * @param line - An array of LineSegment objects. Each LineSegment object contains the text to print and the style to use. */ printLine(line: Array): void; printBarcode(barcodeData: string, barcodeType: utils.Barcode, height: number, width: number, offset: number, alignment: utils.Alignment, options?: formatters2.barcodeOptions): void; }