import { NativeEventEmitter } from "react-native"; import { COMMANDS } from "./utils/printer-commands"; export interface PrinterOptions { beep?: boolean; cut?: boolean; tailingLine?: boolean; encoding?: string; } export declare enum PrinterWidth { "58mm" = 58, "80mm" = 80 } export interface PrinterImageOptions { beep?: boolean; cut?: boolean; tailingLine?: boolean; encoding?: string; imageWidth?: number; imageHeight?: number; printerWidthType?: PrinterWidth; paddingX?: number; } export interface IUSBPrinter { device_name: string; vendor_id: string; product_id: string; } export interface IBLEPrinter { device_name: string; inner_mac_address: string; } export interface INetPrinter { host: string; port: number; } export declare enum ColumnAlignment { LEFT = 0, CENTER = 1, RIGHT = 2 } declare const USBPrinter: { init: () => Promise; getDeviceList: () => Promise; connectPrinter: (vendorId: string, productId: string) => Promise; closeConn: () => Promise; isConnected: () => Promise; printText: (text: string, opts: PrinterOptions | undefined, errorCallBack: (error: Error) => void) => void; printBill: (text: string, opts: PrinterOptions | undefined, errorCallBack: (error: Error) => void) => void; /** * image url * @param imgUrl * @param opts */ printImage: (imgUrl: string, opts: PrinterImageOptions | undefined, errorCallBack: (error: Error) => void) => void; /** * base 64 string * @param Base64 * @param opts */ printImageBase64: (Base64: string, opts: PrinterImageOptions | undefined, errorCallBack: (error: Error) => void) => void; /** * android print with encoder * @param text */ printRaw: (text: string, errorCallBack: (error: Error) => void) => void; /** * `columnWidth` * 80mm => 46 character * 58mm => 30 character */ printColumnsText: (texts: string[], columnWidth: number[], columnAlignment: ColumnAlignment[], columnStyle: string[], opts: PrinterOptions | undefined, errorCallBack: (error: Error) => void) => void; }; declare const BLEPrinter: { init: () => Promise; getDeviceList: () => Promise; connectPrinter: (inner_mac_address: string) => Promise; closeConn: () => Promise; isConnected: () => any; printText: (text: string, opts?: PrinterOptions) => void; printBill: (text: string, opts?: PrinterOptions) => void; /** * image url * @param imgUrl * @param opts */ printImage: (imgUrl: string, opts?: PrinterImageOptions) => void; /** * base 64 string * @param Base64 * @param opts */ printImageBase64: (Base64: string, opts?: PrinterImageOptions) => void; /** * android print with encoder * @param text */ printRaw: (text: string) => void; /** * `columnWidth` * 80mm => 46 character * 58mm => 30 character */ printColumnsText: (texts: string[], columnWidth: number[], columnAlignment: ColumnAlignment[], columnStyle: string[], opts?: PrinterOptions) => void; }; declare const NetPrinter: { init: () => Promise; isConnected: () => any; getDeviceList: () => Promise; connectPrinter: (host: string, port: number, timeout?: number) => Promise; closeConn: () => Promise; printText: (text: string, opts?: {}) => void; printBill: (text: string, opts?: PrinterOptions) => void; /** * image url * @param imgUrl * @param opts */ printImage: (imgUrl: string, opts?: PrinterImageOptions) => void; /** * base 64 string * @param Base64 * @param opts */ printImageBase64: (Base64: string, opts?: PrinterImageOptions) => void; /** * Android print with encoder * @param text */ printRaw: (text: string) => void; /** * `columnWidth` * 80mm => 46 character * 58mm => 30 character */ printColumnsText: (texts: string[], columnWidth: number[], columnAlignment: ColumnAlignment[], columnStyle?: string[], opts?: PrinterOptions) => void; }; declare const NetPrinterEventEmitter: NativeEventEmitter; export { COMMANDS, NetPrinter, BLEPrinter, USBPrinter, NetPrinterEventEmitter }; export declare enum RN_THERMAL_RECEIPT_PRINTER_EVENTS { EVENT_NET_PRINTER_SCANNED_SUCCESS = "scannerResolved", EVENT_NET_PRINTER_SCANNING = "scannerRunning", EVENT_NET_PRINTER_SCANNED_ERROR = "registerError" }