react-native-esc-pos-printer
Version:
An unofficial React Native library for printing on an EPSON TM printer with the Epson ePOS SDK for iOS and Epson ePOS SDK for Android
36 lines • 2.2 kB
TypeScript
import { PrinterGetSettingsType } from './constants';
import type { AddBarcodeParams, AddCutTypeParam, AddImageParams, AddPulseParams, AddSymbolParams, AddTextAlignParam, AddTextLangParam, AddTextSizeParams, AddTextSmoothParam, AddTextStyleParams, PrinterInitParams } from './types';
export declare class PrinterWrapper {
private target;
private printerPaperWidth;
currentFontWidth: number;
constructor(target: string);
init: ({ deviceName, lang }: PrinterInitParams) => Promise<void>;
connect: (timeout?: number) => Promise<void>;
disconnect: () => Promise<void>;
/**
* Forcefully Clears the command buffer of the printer
* Caution ☢️: Only use this method if disconnecting the printer is not an option.
*
* Disconnecting will automatically clear the command buffer.
*/
clearCommandBuffer: () => Promise<void>;
addText: (data: string) => Promise<void>;
addTextLang: (lang: AddTextLangParam) => Promise<void>;
addFeedLine: (line?: number) => Promise<void>;
addLineSpace: (linespc: number) => Promise<void>;
addCut: (type?: AddCutTypeParam) => Promise<void>;
sendData: (timeout?: number) => Promise<import("./types").PrinterStatusResponse>;
getPrinterSetting: (type: PrinterGetSettingsType, timeout?: number) => Promise<import("./types").PrinterSettingsResponse>;
getStatus: () => Promise<import("./types").PrinterStatusResponse>;
addImage: ({ source, width, color, mode, halftone, brightness, compress, }: AddImageParams) => Promise<void>;
addBarcode: ({ data, type, hri, font, width, height, }: AddBarcodeParams) => Promise<void>;
addSymbol: ({ data, type, level, width, height, size, }: AddSymbolParams) => Promise<void>;
addCommand: (uint8Array: Uint8Array) => Promise<void>;
addPulse: ({ drawer, time, }?: AddPulseParams) => Promise<void>;
addTextAlign: (align?: AddTextAlignParam) => Promise<void>;
addTextSize: ({ width, height, }?: AddTextSizeParams) => Promise<void>;
addTextSmooth: (smooth?: AddTextSmoothParam) => Promise<void>;
addTextStyle: ({ color, em, reverse, ul, }?: AddTextStyleParams) => Promise<void>;
}
//# sourceMappingURL=PrinterWrapper.d.ts.map