sunmi-device-sdk
Version:
JavaScript SDK for Sunmi card readers and printers
71 lines (64 loc) • 1.14 kB
text/typescript
/**
* Card types supported by Sunmi card readers
*/
export enum CardType {
MIFARE = 'mifare',
IC = 'ic',
MAGNETIC = 'magnetic',
PSAM = 'psam'
}
/**
* Mifare key types for authentication
*/
export enum MifareKeyType {
KEY_A = 'A',
KEY_B = 'B'
}
/**
* Text alignment options for printing
*/
export enum PrintAlignment {
LEFT = 0,
CENTER = 1,
RIGHT = 2
}
/**
* Text position for barcode printing
*/
export enum BarcodeTextPosition {
NO_TEXT = 0,
ABOVE = 1,
BELOW = 2,
BOTH = 3
}
/**
* Printer status codes
*/
export enum PrinterStatus {
NORMAL = 'NORMAL',
OUT_OF_PAPER = 'OUT_OF_PAPER',
ERROR = 'ERROR',
COVER_OPEN = 'COVER_OPEN',
COVER_ERROR = 'COVER_ERROR',
KNIFE_ERROR_1 = 'KNIFE_ERROR_1',
KNIFE_ERROR_2 = 'KNIFE_ERROR_2',
OVER_HEATING = 'OVER_HEATING',
FIRMWARE_UPDATING = 'FIRMWARE_UPDATING'
}
/**
* Card reading result
*/
export interface CardReadResult {
cardType: string;
cardNumber?: string;
atr?: string;
uid?: string;
}
/**
* Printer configuration
*/
export interface PrinterConfig {
alignment?: PrintAlignment;
fontSize?: number;
fontName?: string;
}