import { Adapter } from '@node-escpos/adapter';
import EventEmitter from 'eventemitter3';
import { MutableBuffer } from 'mutable-buffer';
import qr from 'qr-image';
import { NdArray } from 'ndarray';

declare const LF = "\n";
declare const FS = "\u001C";
declare const FF = "\f";
declare const GS = "\u001D";
declare const DLE = "\u0010";
declare const EOT = "\u0004";
declare const NUL = "\0";
declare const ESC = "\u001B";
declare const TAB = "t";
declare const EOL = "\n";
/**
 * [FEED_CONTROL_SEQUENCES Feed control sequences]
 * @type {Object}
 */
declare const FEED_CONTROL_SEQUENCES: {
    CTL_LF: string;
    CTL_GLF: string;
    CTL_FF: string;
    CTL_CR: string;
    CTL_HT: string;
    CTL_VT: string;
};
declare const CHARACTER_SPACING: {
    CS_DEFAULT: string;
    CS_SET: string;
};
declare const LINE_SPACING: {
    LS_DEFAULT: string;
    LS_SET: string;
};
/**
 * [HARDWARE Printer hardware]
 * @type {Object}
 */
declare const HARDWARE: {
    HW_INIT: string;
    HW_SELECT: string;
    HW_RESET: string;
};
/**
 * [CASH_DRAWER Cash Drawer]
 * @type {Object}
 */
declare const CASH_DRAWER: {
    CD_KICK_2: string;
    CD_KICK_5: string;
};
/**
 * [MARGINS Margins sizes]
 * @type {Object}
 */
declare const MARGINS: {
    BOTTOM: string;
    LEFT: string;
    RIGHT: string;
};
/**
 * [PAPER Paper]
 * @type {Object}
 */
declare const PAPER: {
    PAPER_FULL_CUT: string;
    PAPER_PART_CUT: string;
    PAPER_CUT_A: string;
    PAPER_CUT_B: string;
    STAR_FULL_CUT: string;
};
/**
 * [TEXT_FORMAT Text format]
 * @type {Object}
 */
declare const TEXT_FORMAT: {
    TXT_NORMAL: string;
    TXT_2HEIGHT: string;
    TXT_2WIDTH: string;
    TXT_4SQUARE: string;
    STAR_TXT_EMPHASIZED: string;
    STAR_CANCEL_TXT_EMPHASIZED: string;
    TXT_CUSTOM_SIZE(width: number, height: number): string;
    TXT_HEIGHT: {
        1: string;
        2: string;
        3: string;
        4: string;
        5: string;
        6: string;
        7: string;
        8: string;
    };
    TXT_WIDTH: {
        1: string;
        2: string;
        3: string;
        4: string;
        5: string;
        6: string;
        7: string;
        8: string;
    };
    TXT_UNDERL_OFF: string;
    TXT_UNDERL_ON: string;
    TXT_UNDERL2_ON: string;
    TXT_BOLD_OFF: string;
    TXT_BOLD_ON: string;
    TXT_ITALIC_OFF: string;
    TXT_ITALIC_ON: string;
    TXT_FONT_A: string;
    TXT_FONT_B: string;
    TXT_FONT_C: string;
    TXT_ALIGN_LT: string;
    TXT_ALIGN_CT: string;
    TXT_ALIGN_RT: string;
    STAR_TXT_ALIGN_LA: string;
    STAR_TXT_ALIGN_CA: string;
    STAR_TXT_ALIGN_RA: string;
};
/**
 * Qsprinter-compatible
 * Added by Attawit Kittikrairit
 * [MODEL Model-specific commands]
 * @type {Object}
 */
declare const MODEL: {
    QSPRINTER: {
        BARCODE_MODE: {
            ON: string;
            OFF: string;
        };
        BARCODE_HEIGHT_DEFAULT: string;
        CODE2D_FORMAT: {
            PIXEL_SIZE: {
                CMD: string;
                MIN: number;
                MAX: number;
                DEFAULT: number;
            };
            VERSION: {
                CMD: string;
                MIN: number;
                MAX: number;
                DEFAULT: number;
            };
            LEVEL: {
                CMD: string;
                OPTIONS: {
                    L: number;
                    M: number;
                    Q: number;
                    H: number;
                };
            };
            LEN_OFFSET: number;
            SAVEBUF: {
                CMD_P1: string;
                CMD_P2: string;
            };
            PRINTBUF: {
                CMD_P1: string;
                CMD_P2: string;
            };
        };
    };
};
/**
 * [BARCODE_FORMAT Barcode format]
 * @type {Object}
 */
declare const BARCODE_FORMAT: {
    BARCODE_TXT_OFF: string;
    BARCODE_TXT_ABV: string;
    BARCODE_TXT_BLW: string;
    BARCODE_TXT_BTH: string;
    BARCODE_FONT_A: string;
    BARCODE_FONT_B: string;
    BARCODE_HEIGHT(height: number): Buffer;
    BARCODE_WIDTH: {
        1: string;
        2: string;
        3: string;
        4: string;
        5: string;
    };
    BARCODE_HEIGHT_DEFAULT: string;
    BARCODE_WIDTH_DEFAULT: string;
    BARCODE_UPC_A: string;
    BARCODE_UPC_E: string;
    BARCODE_EAN13: string;
    BARCODE_EAN8: string;
    BARCODE_CODE39: string;
    BARCODE_ITF: string;
    BARCODE_NW7: string;
    BARCODE_CODE93: string;
    BARCODE_CODE128: string;
};
/**
 * [CODE2D_FORMAT description]
 * @type {Object}
 */
declare const CODE2D_FORMAT: {
    TYPE_PDF417: string;
    TYPE_DATAMATRIX: string;
    TYPE_QR: string;
    CODE2D: string;
    QR_LEVEL_L: string;
    QR_LEVEL_M: string;
    QR_LEVEL_Q: string;
    QR_LEVEL_H: string;
};
/**
 * [IMAGE_FORMAT Image format]
 * @type {Object}
 */
declare const IMAGE_FORMAT: {
    S_RASTER_N: string;
    S_RASTER_2W: string;
    S_RASTER_2H: string;
    S_RASTER_Q: string;
};
/**
 * [BITMAP_FORMAT description]
 * @type {Object}
 */
declare const BITMAP_FORMAT: {
    BITMAP_S8: string;
    BITMAP_D8: string;
    BITMAP_S24: string;
    BITMAP_D24: string;
};
/**
 * [GSV0_FORMAT description]
 * @type {Object}
 */
declare const GSV0_FORMAT: {
    GSV0_NORMAL: string;
    GSV0_DW: string;
    GSV0_DH: string;
    GSV0_DWDH: string;
};
/**
 * [BEEP description]
 * @type {string}
 */
declare const BEEP = "\u001BB";
/**
 * [COLOR description]
 * @type {Object}
 */
declare const COLOR: {
    0: string;
    1: string;
    REVERSE: string;
    UNREVERSE: string;
};
/**
 * Receipt Enhancements as defining a static bottom or top logo
 * @type {string}
 */
declare const RECEIPT_ENHANCEMENT = "\u001C(E";
/**
 * List of available character sets
 * @type {Object}
 */
declare const CHARACTER_SET: {
    TM_T20: {
        US: number;
        FR: number;
        DE: number;
        EN: number;
        DK: number;
        SE: number;
        IT: number;
        ES: number;
        JP: number;
        NO: number;
        DK_2: number;
        ES_2: number;
        LATIN_A: number;
        KR: number;
        SI: number;
        HR: number;
        CN: number;
        VN: number;
        ARABIA: number;
    };
};
/**
 * Character Code Table
 */
declare const CHARACTER_CODE_TABLE: {
    TM_T20: {
        PC437: number;
        KATAKANA: number;
        PC850: number;
        PC860: number;
        PC863: number;
        PC865: number;
        PC851: number;
        PC853: number;
        PC857: number;
        PC737: number;
        ISO8859_7: number;
        WPC1252: number;
        PC866: number;
        PC852: number;
        PC858: number;
        KU42: number;
        TIS11: number;
        TIS18: number;
        TCVN_3: number;
        TCVN_3_2: number;
        PC720: number;
        WPC775: number;
        PC855: number;
        PC861: number;
        PC862: number;
        PC864: number;
        PC869: number;
        ISO8859_2: number;
        ISO8859_15: number;
        PC1098: number;
        PC1118: number;
        PC1119: number;
        PC1125: number;
        WPC1250: number;
        WPC1251: number;
        WPC1253: number;
        WPC1254: number;
        WPC1255: number;
        WPC1256: number;
        WPC1257: number;
        WPC1258: number;
        KZ_1048: number;
        USER_PAGE2: number;
        USER_PAGE1: number;
    };
};

declare const __LF: typeof LF;
declare const __FS: typeof FS;
declare const __FF: typeof FF;
declare const __GS: typeof GS;
declare const __DLE: typeof DLE;
declare const __EOT: typeof EOT;
declare const __NUL: typeof NUL;
declare const __ESC: typeof ESC;
declare const __TAB: typeof TAB;
declare const __EOL: typeof EOL;
declare const __FEED_CONTROL_SEQUENCES: typeof FEED_CONTROL_SEQUENCES;
declare const __CHARACTER_SPACING: typeof CHARACTER_SPACING;
declare const __LINE_SPACING: typeof LINE_SPACING;
declare const __HARDWARE: typeof HARDWARE;
declare const __CASH_DRAWER: typeof CASH_DRAWER;
declare const __MARGINS: typeof MARGINS;
declare const __PAPER: typeof PAPER;
declare const __TEXT_FORMAT: typeof TEXT_FORMAT;
declare const __MODEL: typeof MODEL;
declare const __BARCODE_FORMAT: typeof BARCODE_FORMAT;
declare const __CODE2D_FORMAT: typeof CODE2D_FORMAT;
declare const __IMAGE_FORMAT: typeof IMAGE_FORMAT;
declare const __BITMAP_FORMAT: typeof BITMAP_FORMAT;
declare const __GSV0_FORMAT: typeof GSV0_FORMAT;
declare const __BEEP: typeof BEEP;
declare const __COLOR: typeof COLOR;
declare const __RECEIPT_ENHANCEMENT: typeof RECEIPT_ENHANCEMENT;
declare const __CHARACTER_SET: typeof CHARACTER_SET;
declare const __CHARACTER_CODE_TABLE: typeof CHARACTER_CODE_TABLE;
declare namespace _ {
  export {
    __LF as LF,
    __FS as FS,
    __FF as FF,
    __GS as GS,
    __DLE as DLE,
    __EOT as EOT,
    __NUL as NUL,
    __ESC as ESC,
    __TAB as TAB,
    __EOL as EOL,
    __FEED_CONTROL_SEQUENCES as FEED_CONTROL_SEQUENCES,
    __CHARACTER_SPACING as CHARACTER_SPACING,
    __LINE_SPACING as LINE_SPACING,
    __HARDWARE as HARDWARE,
    __CASH_DRAWER as CASH_DRAWER,
    __MARGINS as MARGINS,
    __PAPER as PAPER,
    __TEXT_FORMAT as TEXT_FORMAT,
    __MODEL as MODEL,
    __BARCODE_FORMAT as BARCODE_FORMAT,
    __CODE2D_FORMAT as CODE2D_FORMAT,
    __IMAGE_FORMAT as IMAGE_FORMAT,
    __BITMAP_FORMAT as BITMAP_FORMAT,
    __GSV0_FORMAT as GSV0_FORMAT,
    __BEEP as BEEP,
    __COLOR as COLOR,
    __RECEIPT_ENHANCEMENT as RECEIPT_ENHANCEMENT,
    __CHARACTER_SET as CHARACTER_SET,
    __CHARACTER_CODE_TABLE as CHARACTER_CODE_TABLE,
  };
}

declare type ImageMimeType = "image/png" | "image/jpg" | "image/jpeg" | "image/gif" | "image/bmp";
/**
 * [Image description]
 * @param {[type]} pixels [description]
 */
declare class Image {
    private readonly pixels;
    private readonly data;
    constructor(pixels: NdArray<Uint8Array>);
    get size(): {
        width: number;
        height: number;
        colors: number;
    };
    private RGB2Gray;
    toBitmap(density?: number): {
        data: number[][];
        density: number;
    };
    toRaster(): {
        data: number[];
        width: number;
        height: number;
    };
    /**
     * Load image from URL
     * @param  {[string]}   url      [description]
     * @param  {[type]}   type     [description]
     * @return {[Promise<Image>]}            [description]
     */
    static load(url: string | Uint8Array, type?: ImageMimeType | null): Promise<Image>;
}

declare enum Status {
    Ok = "ok",
    Warning = "warning",
    Error = "error"
}
interface StatusJSONElementSingle {
    bit: number;
    value: 0 | 1;
    label: string;
    status: Status;
}
interface StatusJSONElementMultiple {
    bit: string;
    value: string;
    label: string;
    status: Status;
}
declare type StatusJSONElement = StatusJSONElementSingle | StatusJSONElementMultiple;
interface StatusJSON<T extends string> {
    className: T;
    byte: number;
    bits: string;
    statuses: StatusJSONElement[];
}
declare abstract class DeviceStatus {
    byte: number;
    bits: (0 | 1)[];
    bitsAsc: (0 | 1)[];
    constructor(byte: number);
    private getBits;
    protected toBaseJSON<T extends StatusClassName>(name: T): StatusJSON<T>;
    abstract toJSON(): StatusJSON<string>;
}
declare class PrinterStatus extends DeviceStatus {
    static commands(): string[];
    toJSON(): StatusJSON<"PrinterStatus">;
}
declare class OfflineCauseStatus extends DeviceStatus {
    static commands(): string[];
    toJSON(): StatusJSON<"OfflineCauseStatus">;
}
declare class ErrorCauseStatus extends DeviceStatus {
    static commands(): string[];
    toJSON(): StatusJSON<"ErrorCauseStatus">;
}
declare class RollPaperSensorStatus extends DeviceStatus {
    static commands(): string[];
    toJSON(): StatusJSON<"RollPaperSensorStatus">;
}
declare const statusClasses: {
    PrinterStatus: typeof PrinterStatus;
    OfflineCauseStatus: typeof OfflineCauseStatus;
    ErrorCauseStatus: typeof ErrorCauseStatus;
    RollPaperSensorStatus: typeof RollPaperSensorStatus;
};
declare type Statuses = typeof statusClasses;
declare type StatusClassName = keyof Statuses;
interface StatusClassConstructor<T extends DeviceStatus> {
    new (byte: number): T;
    commands(): string[];
}

declare type AnyCase<T extends string> = Uppercase<T> | Lowercase<T>;

interface PrinterOptions {
    encoding?: string | undefined;
    width?: number | undefined;
}
declare type PrinterModel = null | "qsprinter" | "xprinter";
/**
 * 'dhdw', 'dwh' and 'dhw' are treated as 'dwdh'
 */
declare type RasterMode = AnyCase<"normal" | "dw" | "dh" | "dwdh" | "dhdw" | "dwh" | "dhw">;
interface QrImageOptions extends qr.Options {
    mode: RasterMode;
}
declare type BitmapDensity = AnyCase<"s8" | "d8" | "s24" | "d24">;
declare type StyleString = AnyCase<"normal" | `${"b" | ""}${"i" | ""}${"u" | "u2" | ""}`>;
declare type FeedControlSequence = AnyCase<"lf" | "glf" | "ff" | "cr" | "ht" | "vt">;
declare type Alignment = AnyCase<"lt" | "ct" | "rt">;
declare type FontFamily = AnyCase<"a" | "b" | "c">;
declare type HardwareCommand = AnyCase<"init" | "select" | "reset">;
declare type BarcodeType = AnyCase<"UPC_A" | "UPC-A" | "UPC-E" | "UPC_E" | "EAN13" | "EAN8" | "CODE39" | "ITF" | "NW7" | "CODE93" | "CODE128">;
declare type BarcodePosition = AnyCase<"off" | "abv" | "blw" | "bth">;
declare type BarcodeFont = AnyCase<"a" | "b">;
interface BarcodeOptions {
    width: number;
    height: number;
    position?: BarcodePosition | undefined;
    font?: BarcodeFont | undefined;
    includeParity?: boolean | undefined;
}
declare type LegacyBarcodeArguments = [
    width: number,
    height: number,
    position?: BarcodePosition | undefined,
    font?: BarcodeFont | undefined
];
declare type QRLevel = AnyCase<"l" | "m" | "q" | "h">;
declare type TableAlignment = AnyCase<"left" | "center" | "right">;
declare type CustomTableItem = {
    text: string;
    align?: TableAlignment;
    style?: StyleString | undefined;
} & ({
    width: number;
} | {
    cols: number;
});
interface CustomTableOptions {
    size: [number, number];
    encoding: string;
}
declare class Printer<AdapterCloseArgs extends []> extends EventEmitter {
    adapter: Adapter<AdapterCloseArgs>;
    buffer: MutableBuffer;
    protected options: PrinterOptions | undefined;
    protected encoding: string;
    protected width: number;
    protected _model: PrinterModel;
    /**
     * [function ESC/POS Printer]
     * @param  {[Adapter]} adapter [eg: usb, network, or serialport]
     * @param {[PrinterOptions]} options
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    constructor(adapter: Adapter<AdapterCloseArgs>, options: PrinterOptions);
    /**
     * Set printer model to recognize model-specific commands.
     * Supported models: [ null, 'qsprinter' ]
     *
     * For generic printers, set model to null
     *
     * [function set printer model]
     * @param  {[String]} model [mandatory]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    model(model: PrinterModel): this;
    /**
     * Set character code table
     * @param  {[Number]} codeTable
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    setCharacterCodeTable(codeTable: number): this;
    /**
     * Set charset
     * @param  {[Number]} charset
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    setCharset(charset?: number): this;
    /**
     * Fix bottom margin
     * @param  {[String]} size
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    marginBottom(size: number): this;
    /**
     * Fix left margin
     * @param  {[String]} size
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    marginLeft(size: number): this;
    /**
     * Set left margin using GS command
     * @param  {[String]} size
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    setMarginLeft(size: number): Printer<AdapterCloseArgs>;
    /**
     * Fix right margin
     * @param  {[String]} size
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    marginRight(size: number): this;
    /**
     * [function print]
     * @param  {[String]}  content  [mandatory]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    print(content: string | Buffer): this;
    /**
     * [function print pure content with End Of Line]
     * @param  {[String]}  content  [mandatory]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    println(content: string): this;
    /**
     * [function print End Of Line]
     * @param  {[Number]} Amount of new lines
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    newLine(count?: number): this;
    /**
     * [function Print encoded alpha-numeric text with End Of Line]
     * @param  {[String]}  content  [mandatory]
     * @param  {[String]}  encoding [optional]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    text(content: string, encoding?: string): this;
    /**
     * [function Print draw line End Of Line]
     * @param  {[Buffer|string]}  character [optional]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    drawLine(character?: Buffer | string): this;
    /**
     * [function Print  table   with End Of Line]
     * @param  {[data]}  data  [mandatory]
     * @param  {[String]}  encoding [optional]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    table(data: (string | number)[], encoding?: string): this;
    /**
     * [function Print  custom table  with End Of Line]
     * @param  {[data]}  data  [mandatory]
     * @param  {[String]}  options [optional]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    tableCustom(data: CustomTableItem[], options?: CustomTableOptions): this;
    /**
     * [function Print encoded alpha-numeric text without End Of Line]
     * @param  {[String]}  content  [mandatory]
     * @param  {[String]}  encoding [optional]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    pureText(content: string, encoding?: string): this;
    /**
     * [function encode text]
     * @param  {[String]}  encoding [mandatory]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    encode(encoding: string): this;
    /**
     * [line feed]
     * @param  {[type]}    n   Number of lines
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    feed(n?: number): this;
    /**
     * [feed control sequences]
     * @param  {[type]}    ctrl     [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    control(ctrl: FeedControlSequence): this;
    /**
     * [text align]
     * @param  {[type]}    align    [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    align(align: Alignment): this;
    /**
     * [font family]
     * @param  {[type]}    family  [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    font(family: FontFamily): this;
    /**
     * [font style]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    _getStyle(string: StyleString): string;
    _getStyle(bold: boolean, italic: boolean, underline: boolean | 0 | 1 | 2): string;
    /**
     * [font style]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    style(string: StyleString): this;
    style(bold: boolean, italic: boolean, underline: boolean | 0 | 1 | 2): this;
    /**
     * [font size]
     * @param  {[String]}  width   [description]
     * @param  {[String]}  height  [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    size(width: number, height: number): this;
    /**
     * [set character spacing]
     * @param  {[type]}    n     [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    spacing(n?: number | null): this;
    /**
     * [set line spacing]
     * @param  {[type]} n [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    lineSpace(n?: number | null): this;
    /**
     * [hardware]
     * @param  {[type]}    hw       [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    hardware(hw: HardwareCommand): this;
    /**
     * [barcode]
     * @param  {[type]}    code     [description]
     * @param  {[type]}    type     [description]
     * @param  {[type]}    options  [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    barcode(code: number | string, type: BarcodeType, options: BarcodeOptions): this;
    /**
     * [print qrcode]
     * @param  {[type]} content    [description]
     * @param  {[type]} version [description]
     * @param  {[type]} level   [description]
     * @param  {[type]} size    [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    qrcode(content: string, version?: number | undefined, level?: QRLevel | undefined, size?: number | undefined): this;
    /**
     * [print qrcode image]
     * @param  {[type]}   text  [description]
     * @param  {[type]}   options  [description]
     * @return {[Promise]}
     */
    qrimage(text: string, options?: QrImageOptions): Promise<this>;
    /**
     * [image description]
     * @param  {[type]} image   [description]
     * @param  {[type]} density [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    image(image: Image, density?: BitmapDensity): Promise<this>;
    /**
     * [raster description]
     * @param  {[type]} image [description]
     * @param  {[type]} mode  Raster mode (
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    raster(image: Image, mode?: RasterMode): this;
    /**
     * [function Send pulse to kick the cash drawer]
     * @param  {[type]} pin [description]
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    cashdraw(pin?: 2 | 5): this;
    /**
     * Printer Buzzer (Beep sound)
     * @param  {[Number]} n Refers to the number of buzzer times
     * @param  {[Number]} t Refers to the buzzer sound length in (t * 100) milliseconds.
     */
    beep(n: number, t: number): this;
    /**
     * Send data to hardware and flush buffer
     * @return {[Promise]}
     */
    flush(): Promise<this>;
    /**
     * Cut paper
     * @param  {[boolean]} partial set a full or partial cut. Default: full Partial cut is not implemented in all printers
     * @param  {[number]} feed Number of lines to feed before cutting
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    cut(partial?: boolean, feed?: number): this;
    /**
     * [close description]
     * @param closeArgs Arguments passed to adapter's close function
     */
    close(...closeArgs: AdapterCloseArgs): Promise<this>;
    /**
     * [color select between two print color modes, if your printer supports it]
     * @param  {Number} color - 0 for primary color (black) 1 for secondary color (red)
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    color(color: 0 | 1): this;
    /**
     * [reverse colors, if your printer supports it]
     * @param {Boolean} reverse - True for reverse, false otherwise
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    setReverseColors(reverse: boolean): this;
    /**
     * [writes a low level command to the printer buffer]
     *
     * @usage
     * 1) raw('1d:77:06:1d:6b:02:32:32:30:30:30:30:32:30:30:30:35:30:35:00:0a')
     * 2) raw('1d 77 06 1d 6b 02 32 32 30 30 30 30 32 30 30 30 35 30 35 00 0a')
     * 3) raw(Buffer.from('1d77061d6b0232323030303032303030353035000a','hex'))
     *
     * @param data {Buffer|string}
     * @returns {Printer}
     */
    raw(data: Buffer | string): this;
    /**
     * get one specific status from the printer using it's class
     * @param  {string} StatusClass
     * @return {Promise} promise returning given status
     */
    getStatus<T extends DeviceStatus>(StatusClass: StatusClassConstructor<T>): Promise<T>;
    /**
     * get statuses from the printer
     * @return {Promise}
     */
    getStatuses(): Promise<DeviceStatus[]>;
    /****************************
    /* Receipt Enhancements
    /****************************/
    /**
     * Sets the alignment of the top and bottom logo
     * @param  {[Alignment]} align - Align left, center or right
     */
    private setLogoAlignment;
    /**
     * [Function 62 & 63] Set top and bottom logo printing
     * @param  {[String]} pL_pH - Hex string to set the function range
     * @param  {[String]} fn - Hex string to set the receipt enhancement function
     * @param  {[Number]} kc1 - NV memory keycode 1 of the logo
     * @param  {[Number]} kc2 - NV memory keycode 2 of the logo
     * @param  {[Alignment]} align - Align left, center or right
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    private setLogoPrinting;
    /**
     * [Function 62] Set top logo printing
     * @param  {[Number]} kc1 - NV memory keycode 1 of the logo
     * @param  {[Number]} kc2 - NV memory keycode 2 of the logo
     * @param  {[Alignment]} align - Align left, center or right
     * @param  {[Number]} space - Set number of lines to be removed after top logo printing
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    setTopLogoPrinting(kc1: number, kc2: number, align?: Alignment, space?: number): Printer<AdapterCloseArgs>;
    /**
     * [Function 63] Set bottom logo printing
     * @param  {[Number]} kc1 - NV memory keycode 1 of the logo
     * @param  {[Number]} kc2 - NV memory keycode 2 of the logo
     * @param  {[Alignment]} align - Align left, center or right
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    setBottomLogoPrinting(kc1: number, kc2: number, align?: Alignment): Printer<AdapterCloseArgs>;
    /**
     * [Function 65] Enable or disable top logo printing
     * @param  {[Boolean]} enable - Enable or disable top logo printing
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    enableTopLogoPrinting(enable?: boolean): Printer<AdapterCloseArgs>;
    /**
     * [Function 65] Enable or disable bottom logo printing
     * @param  {[Boolean]} enable - Enable or disable bottom logo printing
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    enableBottomLogoPrinting(enable?: boolean): Printer<AdapterCloseArgs>;
    /****************************
    /* STAR printer
    /****************************/
    /**
     * STAR printer - Paper cut instruction
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    starFullCut(): this;
    /**
     * STAR printer - Select emphasized printing
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    emphasize(): this;
    /**
     * STAR printer - Cancel emphasized printing
     * @return {[Printer]} printer  [the escpos printer instance]
     */
    cancelEmphasize(): this;
}

declare const command: typeof _;

export { Alignment, BarcodeFont, BarcodeOptions, BarcodePosition, BarcodeType, BitmapDensity, CustomTableItem, CustomTableOptions, FeedControlSequence, FontFamily, HardwareCommand, Image, LegacyBarcodeArguments, Printer, PrinterModel, PrinterOptions, QRLevel, QrImageOptions, RasterMode, StyleString, TableAlignment, command, Printer as default };
