forked from januslo/react-native-bluetooth-escpos-printer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
146 lines (139 loc) · 2.62 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import { NativeModules } from 'react-native';
const {BluetoothManager,BluetoothEscposPrinter, BluetoothTscPrinter }= NativeModules;
BluetoothTscPrinter.DIRECTION = {
FORWARD: 0,
BACKWARD: 1
};
BluetoothTscPrinter.DENSITY = {
DNESITY0: 0,
DNESITY1: 1,
DNESITY2: 2,
DNESITY3: 3,
DNESITY4: 4,
DNESITY5: 5,
DNESITY6: 6,
DNESITY7: 7,
DNESITY8: 8,
DNESITY9: 9,
DNESITY10: 10,
DNESITY11: 11,
DNESITY12: 12,
DNESITY13: 13,
DNESITY14: 14,
DNESITY15: 15
};
BluetoothTscPrinter.BARCODETYPE = {
CODE128: "128",
CODE128M: "128M",
EAN128: "EAN128",
ITF25: "25",
ITF25C: "25C",
CODE39: "39",
CODE39C: "39C",
CODE39S: "39S",
CODE93: "93",
EAN13: "EAN13",
EAN13_2: "EAN13+2",
EAN13_5: "EAN13+5",
EAN8: "EAN8",
EAN8_2: "EAN8+2",
EAN8_5: "EAN8+5",
CODABAR: "CODA",
POST: "POST",
UPCA: "EAN13",
UPCA_2: "EAN13+2",
UPCA_5: "EAN13+5",
UPCE: "EAN13",
UPCE_2: "EAN13+2",
UPCE_5: "EAN13+5",
CPOST: "CPOST",
MSI: "MSI",
MSIC: "MSIC",
PLESSEY: "PLESSEY",
ITF14: "ITF14",
EAN14: "EAN14"
};
BluetoothTscPrinter.FONTTYPE = {
FONT_1: "1",
FONT_2: "2",
FONT_3: "3",
FONT_4: "4",
FONT_5: "5",
FONT_6: "6",
FONT_7: "7",
FONT_8: "8",
SIMPLIFIED_CHINESE: "TSS24.BF2",
TRADITIONAL_CHINESE: "TST24.BF2",
KOREAN: "K"
};
BluetoothTscPrinter.EEC = {
LEVEL_L: "L",
LEVEL_M: "M",
LEVEL_Q: "Q",
LEVEL_H: "H"
};
BluetoothTscPrinter.ROTATION = {
ROTATION_0: 0,
ROTATION_90: 90,
ROTATION_180: 180,
ROTATION_270: 270
};
BluetoothTscPrinter.FONTMUL = {
MUL_1: 1,
MUL_2: 2,
MUL_3: 3,
MUL_4: 4,
MUL_5: 5,
MUL_6: 6,
MUL_7: 7,
MUL_8: 8,
MUL_9: 9,
MUL_10: 10
};
BluetoothTscPrinter.BITMAP_MODE = {
OVERWRITE: 0,
OR: 1,
XOR: 2
};
BluetoothTscPrinter.PRINT_SPEED = {
SPEED1DIV5:1,
SPEED2:2,
SPEED3:3,
SPEED4:4
};
BluetoothTscPrinter.TEAR = {
ON:'ON',
OFF:'OFF'
};
BluetoothTscPrinter.READABLE={
DISABLE:0,
EANBLE:1
};
BluetoothEscposPrinter.ERROR_CORRECTION = {
L:1,
M:0,
Q:3,
H:2
};
BluetoothEscposPrinter.BARCODETYPE={
UPC_A:65,//11<=n<=12
UPC_E:66,//11<=n<=12
JAN13:67,//12<=n<=12
JAN8:68,//7<=n<=8
CODE39:69,//1<=n<=255
ITF:70,//1<=n<=255(even numbers)
CODABAR:71,//1<=n<=255
CODE93:72,//1<=n<=255
CODE128:73//2<=n<=255
};
BluetoothEscposPrinter.ROTATION={
OFF:0,
ON:1
};
BluetoothEscposPrinter.ALIGN={
LEFT:0,
CENTER:1,
RIGHT:2
};
module.exports ={
BluetoothManager,BluetoothEscposPrinter, BluetoothTscPrinter };