cesqpos 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,507 @@
1
+ export type Font = 'A' | 'B';
2
+ /**
3
+ * HT -- Moves the print position to the next horizontal tab position
4
+ *
5
+ - This command is ignored unless the next horizontal tab position has been set.
6
+ - If the next horizontal tab position exceeds the print area, the printer sets the print position to [Print area width + 1].
7
+ - If this command is processed when the print position is at [Print area width + 1], the printer executes Print buffer-full printing of the current line and horizontal tab processing from the beginning of the next line. In this case, in Page mode, the printer does not execute printing, but the print position is moved.
8
+ - Horizontal tab positions are set by ESC D.
9
+ - The printer will not be in the beginning of the line by executing this command.
10
+ - When underline mode is turned on, the underline will not be printed under the tab space skipped by this command.
11
+ * */
12
+ export declare function horizontalTab(): number[];
13
+ /**
14
+ * LF -- Prints the data in the print buffer and feeds one line, based on the current line spacing.
15
+ - The amount of paper fed per line is based on the value set using the line spacing command (ESC 2 or ESC 3).
16
+ - After printing, the print postion is moved to left side of the printable area. Also, the printer is in the status "Beginning of the line".
17
+ - When this command is processed in Page mode, only the print position moves, and the printer does not perform actual printing.
18
+ */
19
+ export declare function printAndLineFeed(): number[];
20
+ /**
21
+ * FF (Page Mode) -- In **Page mode**, prints all the data in the print buffer collectively and switches from Page mode to Standard mode.
22
+ - This command is enabled only in Page mode. See FF (in Standard mode) to use this command in Standard mode. Page mode can be selected by ESC L.
23
+ - The data is deleted in the print area after being printed.
24
+ - This command returns the values set by ESC W to the default values.
25
+ - The value set by ESC T is maintained.
26
+ - After printing, the printer returns to Standard mode and moves the print position to left side of the printable area. Also, the printer is in the status "Beginning of the line".
27
+ */
28
+ export declare function printAndReturnToStandardModeInPageMode(): number[];
29
+ /**
30
+ * CAN -- In **Page mode**, deletes all the print data in the current print area.
31
+ - This command is enabled only in Page mode. Page mode is selected by ESC L.
32
+ - If data set in the previously specified print area is set in the currently specified print area, it is deleted.
33
+ */
34
+ export declare function cancelPrintDataInPageMode(): number[];
35
+ /**
36
+ * ESC FF -- In Page mode, prints the data in the print buffer collectively.
37
+ - This command is enabled only in Page mode. Page mode can be selected by ESC L.
38
+ - After printing, the printer does not clear the buffered data, the print position, or values set by other commands.
39
+ - The printer returns to Standard mode with FF (in Page mode), ESC S, and ESC @. When it returns to Standard mode by ESC @, all settings are canceled.
40
+ - This command is used when the data in Page mode is printed repeatedly.
41
+ */
42
+ export declare function printDataInPageMode(): number[];
43
+ /**
44
+ * ESC SP -- Sets the right-side character spacing to n × (horizontal or vertical motion unit).
45
+ - The character spacing set by this command is effective for alphanumeric, Kana, and user-defined characters.
46
+ - When characters are enlarged, the character spacing is n times normal value.
47
+ - When Standard mode is selected, the horizontal motion unit is used.
48
+ - When Page mode is selected, the vertical or horizontal motion unit is used for the print direction set by ESC T.
49
+ - When the starting position is set to the upper left or lower right of the print area using ESC T, the horizontal motion unit is used.
50
+ - When the starting position is set to the upper right or lower left of the print area using ESC T, the vertical motion unit is used.
51
+ - The character spacing can be set independently in Standard mode and in Page mode.
52
+ - In Standard mode this command sets the character spacing of Standard mode.
53
+ - in Page mode this command sets the character spacing of page mode.
54
+ - If the horizontal or vertical motion unit is changed after this command is executed, the character spacing is not changed.
55
+ - Settings of this command are effective until ESC @ is executed, the printer is reset, or the power is turned off.
56
+ - It is used to change the spacing between characters.
57
+ */
58
+ export declare function setRightSideCharacterSpacing(n?: number): number[];
59
+ /**
60
+ * ESC ! -- Select print mode(s)
61
+ - Configurations of Font 1 and Font 2 are different, depending on the printer model. If the desired font type cannot be selected with this command, use ESC M.
62
+ - The settings of font (Bit 0), double-height (Bit 4), double-width (Bit 5) and underline (Bit 7) are effective for 1-byte code characters. On some models, the settings of double-height (Bit 4), double-width (Bit 5) and underline (Bit 7) are effective also for Korean characters.
63
+ - The emphasized print modes set by this command (Bit 3) is effective for both 1-byte code characters and multi-byte code characters.
64
+ - Settings of this command are effective until ESC @ is executed, the printer is reset, the power is turned off, or one of the following commands is executed:
65
+ - Bit 0 (character font): ESC M
66
+ - Bit 3 (Emphasized mode): ESC E
67
+ - Bit 4, 5 (character size): GS !
68
+ - Bit 7 (underline mode): ESC -
69
+ - When some characters in a line are double-height, all characters on the line are aligned at the Baseline.
70
+ - When double-width mode is turned on, the characters are enlarged to the right, based on the left side of the character.
71
+ - When both double-height and double-width modes are turned on, quadruple size characters are printed.
72
+ - In Standard mode, the character is enlarged in the paper feed direction when double-height mode is selected, and it is enlarged perpendicular to the paper feed direction when double-width mode is selected. However, when character orientation changes in 90° clockwise rotation mode, the relationship between double-height and double-width is reversed.
73
+ - in Page mode, double-height and double-width are on the character orientation.
74
+ - The underline thickness is that specified by ESC -, regardless of the character size. The underline is the same color as the printed character. The printed character's color is specified by GS ( N <Function 48> .
75
+ - The following are not underlined.
76
+ - 90° clockwise-rotated characters
77
+ - white/black reverse characters
78
+ - space set by HT, ESC $, and ESC \
79
+ - On printers that have the Automatic font replacement function, the replaced font with GS ( E <Function 5> (a = 111, 112, 113) is selected by this command.
80
+ */
81
+ export declare function selectPrintModes(font: Font, emphasised?: boolean, doubleHeight?: boolean, doubleWidth?: boolean, underline?: boolean): number[];
82
+ /**
83
+ * ESC $ -- Moves the print position to (nL + nH × 256) × (horizontal or vertical motion unit) from the left edge of the print area.
84
+ - The printer ignores any setting that exceeds the print area.
85
+ - When Standard mode is selected, the horizontal motion unit is used.
86
+ - When Page mode is selected, the horizontal or vertical motion unit is used for the print direction set by ESC T.
87
+ - When the starting position is set to the upper left or lower right of the print area using ESC T, the horizontal motion unit is used.
88
+ - When the starting position is set to the upper right or lower left of the print area using ESC T, the vertical motion unit is used.
89
+ - If the horizontal or vertical motion unit is changed after this command is executed, the print position is not changed.
90
+ - The printer will not be in the beginning of the line by executing this command.
91
+ - Even if underline mode is turned on, the underline will not be printed under the space skipped by this command.
92
+
93
+
94
+ */
95
+ export declare function setAbsolutePrintPosition(value: number): number[];
96
+ /**
97
+ * ESC % -- Select/cancel user-defined character set.
98
+ *
99
+ * When the LSB of n is 0, the user-defined character set is canceled.
100
+ * When the LSB of n is 1, the user-defined character set is selected.
101
+ - When the user-defined character set is canceled, the resident character set is automatically selected.
102
+ - settings of this command are effective until ESC @ is executed, the printer is reset, or the power is turned off.
103
+ */
104
+ export declare function selectUserDefinedCharacterSet(enable?: boolean): number[];
105
+ /**
106
+ * ESC & -- Define user-defined characters
107
+ *
108
+ * When the LSB of n is 0, the user-defined character set is canceled.
109
+ * When the LSB of n is 1, the user-defined character set is selected.
110
+ - When the user-defined character set is canceled, the resident character set is automatically selected.
111
+ - settings of this command are effective until ESC @ is executed, the printer is reset, or the power is turned off.
112
+ */
113
+ export declare function defineUserDefinedCharacterSet(verticalBytes: number, characterCodeRangeStart: number, characterCodeRangeEnd: number, data: number[][][]): number[];
114
+ /**
115
+ * ESC * -- Select bit-image mode
116
+ *
117
+ - Data (d) specifies a bit printed to 1 and not printed to 0.
118
+ - If the bit image data exceeds the number of dots to be printed on a line, the excess data is ignored.
119
+ - The bit-image is not affected by print mode (emphasized, double-strike, underline, character size, white/black reverse printing, or 90° clockwise-rotated), except for upside-down print mode.
120
+ - After printing a bit image, the printer processes normal data.
121
+ - When printing multiple line bit images, selecting unidirectional print mode with ESC U enables printing patterns in which the top and bottom parts are aligned vertically.
122
+ - This command is used to print a picture or logo.
123
+ - The relationship between the bit image data and the print result is as follows.
124
+ - 8 dot mode: https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/image/esc_asterisk-1.png
125
+ - 24 dot mode: https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/image/esc_asterisk-2.png
126
+ */
127
+ export declare function selectBitImageMode(verticalDensity: number | undefined, horizontalDensity: "single" | "double" | undefined, data: number[]): number[];
128
+ /**
129
+ * ESC - -- Turn underline mode on/off
130
+ *
131
+ - The underline mode is effective for alphanumeric, Kana, and user-defined characters. On some models, it is effective also for Korean characters.
132
+ - The color of underline is the same as that of the printing character. The printing character's color is selected by GS ( N <Function 48> .
133
+ - Changing the character size does not affect the current underline thickness.
134
+ - When underline mode is turned off, the following data cannot be underlined, but the thickness is maintained.
135
+ - The printer does not underline 90° clockwise rotated characters, white/black reverse characters, and the space set by HT, ESC $, and ESC \.
136
+ - Setting of this command is effective until ESC ! is executed, ESC @ is executed, the printer is reset, or the power is turned off.
137
+ - Some of the printer models support the 2-dot thick underline (n = 2 or 50).
138
+ */
139
+ export declare function underline(enable?: boolean, thickness?: 1 | 2): number[];
140
+ /**
141
+ * ESC 3 -- Sets the line spacing to the "default line spacing."
142
+ *
143
+ - The line spacing can be set independently in Standard mode and in Page mode.
144
+ - In Standard mode this command sets the line spacing of Standard mode.
145
+ - in Page mode this command sets the line spacing of page mode.
146
+ - Selected line spacing is effective until ESC 3 is executed, ESC @ is executed, the printer is reset, or the power is turned off.
147
+ */
148
+ export declare function selectDefaultLineSpacing(): number[];
149
+ /**
150
+ * ESC 3 -- Sets the line spacing to n × (vertical or horizontal motion unit).
151
+ *
152
+ - The maximum line spacing is 1016 mm {40 inches}. However, it may be smaller depending on models.
153
+ - If the specified amount exceeds the maximum line spacing, the line spacing is automatically set to the maximum.
154
+ - When Standard mode is selected, the vertical motion unit is used.
155
+ - When Page mode is selected, the vertical or horizontal motion unit is used for the print direction set by ESC T.
156
+ - When the starting position is set to the upper left or lower right of the print area using ESC T, the vertical motion unit is used.
157
+ - When the starting position is set to the upper right or lower left of the print area using ESC T, the horizontal motion unit is used.
158
+ - The line spacing can be set independently in Standard mode and in Page mode.
159
+ - In Standard mode this command sets the line spacing of Standard mode.
160
+ - In Page mode this command sets the line spacing of Page mode.
161
+ - When the motion unit is changed after the line spacing is set, the line spacing setting does not change.
162
+ - Selected line spacing is effective until ESC 2 is executed, ESC @ is executed, the printer is reset, or the power is turned off.
163
+ */
164
+ export declare function setLineSpacing(units?: number): number[];
165
+ /**
166
+ * ESC ? -- Deletes the user-defined character pattern specified by character code n.
167
+ *
168
+ - After the user-defined characters are canceled, the resident character set is printed.
169
+ - This command can cancel user-defined characters for each font independently. To select a font, use ESC ! or ESC M.
170
+ */
171
+ export declare function cancelUserDefinedCharacters(n: number): number[];
172
+ /**
173
+ * ESC @ -- Clears the data in the print buffer and resets the printer modes to the modes that were in effect when the power was turned on.
174
+ *
175
+ - Any macro definitions are not cleared.
176
+ - Offline response selection is not cleared.
177
+ - Contents of user NV memory are not cleared.
178
+ - NV graphics (NV bit image) and NV user memory are not cleared.
179
+ - The maintenance counter value is not affected by this command.
180
+ - Software setting values are not cleared.
181
+
182
+ Notes:
183
+ - The DIP switch settings are not checked again.
184
+ - The data in the receive buffer is not cleared.
185
+ - When this command is processed in Page mode, the printer deletes the data in the print areas, initializes all settings, and selects Standard mode.
186
+ - This command can cancel all the settings, such as print mode and line feed, at the same time.
187
+ - The command execution moves the print position to left side of the printable area. Also, the printer is in the status "Beginning of the line".
188
+ */
189
+ export declare function initialise(): number[];
190
+ export declare const DEFAULT_TAB_STOPS: number[];
191
+ /**
192
+ * ESC D -- Sets horizontal tab positions. n specifies the number of digits from the setting position to the left edge of the print area.
193
+ *
194
+ - The horizontal tab position is stored as a value of [character width × n] measured from the beginning of the line. The character width includes the right-side character spacing, and double-width characters are selected with twice the width of normal characters.
195
+ - The character width should be set before using this command. Settings of character fonts, space width, and enlargement affect the setting of character width.
196
+ - A maximum of 32 horizontal tab positions can be set. Data exceeding 32 horizontal tab positions is processed as normal data.
197
+ - This command cancels any previous horizontal tab settings.
198
+ - Transmit [n]k in ascending order and place a NUL code at the end. ESC D NUL cancels all horizontal tab positions.
199
+ - When [n]k is less than or equal to the preceding value [n]k-1, horizontal tab setting is finished, and the following data is processed as normal data.
200
+ - k is not transmission data to the printer.
201
+ - Even if the character width is changed after setting the horizontal tab positions, the setting of the horizontal tab positions will not be changed.
202
+ - Horizontal tab position settings are effective until ESC @ is executed, the printer is reset, or the power is turned off.
203
+ - Print position can be changed by HT.
204
+ - When the left margin setting is changed, the horizontal tab position is also changed.
205
+ - Horizontal tab positions that exceed the print area can be set. In this case, when the print area width is changed, available horizontal tab positions are changed.
206
+ */
207
+ export declare function setHorizontalTabPositions(tabStops?: number[]): number[];
208
+ /**
209
+ * ESC D -- Turn emphasized mode on/off
210
+ *
211
+ - This mode is effective for alphanumeric, Kana, multilingual, and user-defined characters.
212
+ - Settings of this command are effective until ESC ! is executed, ESC @ is executed, the printer is reset, or the power is turned off.
213
+ */
214
+ export declare function bold(enable?: boolean): number[];
215
+ /**
216
+ * ESC G -- Turns double-strike mode on or off.
217
+ *
218
+ - This mode is effective for alphanumeric, Kana, multilingual, and user-defined characters.
219
+ - Settings of this command are effective until ESC ! is executed, ESC @ is executed, the printer is reset, or the power is turned off.
220
+ */
221
+ export declare function doubleStrike(enable?: boolean): number[];
222
+ /**
223
+ * ESC J -- Prints the data in the print buffer and feeds the paper [n × (vertical or horizontal motion unit)].
224
+ *
225
+ - When Standard mode is selected, the vertical motion unit is used.
226
+ - When Page mode is selected, the vertical or horizontal motion unit is used for the print direction set by ESC T.
227
+ - When the starting position is set to the upper left or lower right of the print area using ESC T, the vertical motion unit is used.
228
+ - When the starting position is set to the upper right or lower left of the print area using ESC T, the horizontal motion unit is used.
229
+ - The maximum paper feed amount depends on the printer model. If specified over the maximum amount, the maximum paper feed is executed.
230
+ - After printing, the print postion is moved to left side of the printable area. Also, the printer is in the status "Beginning of the line".
231
+ - When this command is processed in Page mode, only the print position moves; the printer does not perform actual printing.
232
+ - This command is used to temporarily feed a specific length without changing the line spacing set by other commands.
233
+ */
234
+ export declare function printAndFeedPaper(n?: number): number[];
235
+ /**
236
+ * ESC L -- Switches from Standard mode to page mode.
237
+ - This command is enabled only when processed at the beginning of the line in Standard mode. In other cases, this command is ignored.
238
+ - The print position is the starting position specified by ESC T within the print area defined by ESC W.
239
+ - The following commands switch the settings for Page modebecause these commands can be set independently in Standard mode and in Page mode:
240
+ - ESC SP, ESC 2, ESC 3, ESC U, and FS S
241
+ - The following commands are disabled in Page mode.
242
+ - ESC L, FS g 1 [obsolete command] , FS q [obsolete command] , GS ( A, GS ( C (part of functions), GS ( E, GS ( L / GS 8 L (part of functions), GS ( M (part of functions), GS ( P, GS T, and GS g 0
243
+ - The following commands are not effective in Page mode.
244
+ - ESC V, ESC a, ESC {, GS L, and GS W
245
+ - The printer returns to Standard mode with ESC S, FF (in Page mode), and ESC @. When it returns to Standard mode by ESC @, all settings are canceled.
246
+ - Standard mode is selected as the default.
247
+ - in Page mode, the printer prints the data in the print buffer for the print area specified by ESC W collectively by FF (in Page mode) or ESC FF. When executing the print and paper feed commands, such as LF, CR, ESC J, and ESC d, only the print position moves; the printer does not perform actual printing.
248
+ */
249
+ export declare function selectPageMode(): number[];
250
+ /**
251
+ * ESC M -- Selects a character font
252
+ - The character font set by this command is effective for alphanumeric, Kana, and user-defined characters.
253
+ - Configurations of Font A and Font B depend on the printer model.
254
+ - Settings of this command are effective until ESC ! is executed, ESC @ is executed, the printer is reset, or the power is turned off.
255
+ - On the printer that has the Automatic font replacement function, the replaced font with GS ( E <Function 5> (a = 111 or 112 or 113) is selected by this command.
256
+ */
257
+ export declare function selectFont(font: Font): number[];
258
+ export type InternationalCharacterSet = 'usa' | 'france' | 'germany' | 'uk' | 'denmark-1' | 'sweden' | 'italy' | 'spain-1' | 'japan' | 'norway' | 'denmark-2' | 'spain-2' | 'latin-america' | 'korea' | 'slovenia-croatia' | 'china';
259
+ /**
260
+ * ESC R -- Select an international character set
261
+ - The selected international character set is effective until ESC @ is executed, the printer is reset, or the power is turned off.
262
+ - Refer to Character Code Tables for TM printers for the international characters.
263
+ */
264
+ export declare function selectInternationalCharacterSet(characterSet: InternationalCharacterSet): number[];
265
+ /**
266
+ * ESC S -- Switches from Page mode to Standard mode.
267
+ - This command is enabled only in Page mode. Page mode can be selected by ESC L.
268
+ - When this command is executed, data in all the print areas is cleared, the print area set by ESC W returns to the default value, but the value set by ESC T is maintained.
269
+ - The following commands switch the settings for Standard mode because these commands can be set independently in Standard mode and in Page mode:
270
+ - ESC SP, ESC 2, ESC 3, ESC U, FS S
271
+ - In Standard mode, the following commands are ignored.
272
+ - CAN, ESC FF, GS $, GS ( Q, GS \
273
+ - The settings of the following commands do not affect printing in Standard mode.
274
+ - ESC T, ESC W, GS ( P
275
+ - Standard mode is selected as the default.
276
+ */
277
+ export declare function selectStandardMode(n: number): number[];
278
+ /**
279
+ * ESC T -- In Page mode, selects the print direction and starting position using n as follows:
280
+ * https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/image/esc_ct-1.png
281
+ - 0: Left to right
282
+ - 1: Bottom to top
283
+ - 2: Right to left
284
+ - 3: Top to bottom
285
+
286
+ Notes:
287
+ - The print direction set by this command is effective only in Page mode.
288
+ - This command setting has no effect in Standard mode.
289
+ - The parameters for the horizontal or vertical motion unit differ, depending on the starting position of the print area as follows:
290
+ - If the starting position is the upper left or lower right of the print area:
291
+ - These commands use horizontal motion units: ESC SP, ESC $, ESC \, FS S
292
+ - These commands use vertical motion units: ESC 3, ESC J, ESC K, GS $, GS \
293
+ - If the starting position is the upper right or lower left of the print area:
294
+ - These commands use horizontal motion units: ESC 3, ESC J, ESC K, GS $, GS \
295
+ - These commands use vertical motion units: ESC SP, ESC $, ESC \, FS S
296
+ - Settings of this command are effective until ESC @ is executed, the printer is reset, or the power is turned off.
297
+ */
298
+ export declare function selectPrintDirectionInPageMode(n: number): number[];
299
+ /**
300
+ * ESC V -- Set print area in Page mode
301
+ - This command can be used in Page mode. Page mode is selected by ESC L.
302
+ - With this command, the printing position is moved to a starting point selected by ESC T in the print area set.
303
+ - For this command, the horizontal direction means the direction perpendicular to paper feeding direction and the vertical direction means the paper feeding direction.
304
+ - Both print area width and height cannot be set to 0.
305
+ - The horizontal logical origin and the vertical logical origin cannot be set outside the printable area.
306
+ - The absolute origin is the upper left of the printable area.
307
+ - Horizontal logical origin and print area width are calculated using the horizontal motion unit.
308
+ - Vertical logical origin and print area height are calculated using the vertical motion unit.
309
+ - If [horizontal logical origin + print area width] exceeds the printable area, the print area width is automatically set to [horizontal printable area - horizontal logical origin].
310
+ - If [vertical logical origin + print area height] exceeds the printable area, the print area height is automatically set to [vertical printable area - vertical logical origin].
311
+ - Keep the following conditions in mind for printers that support GS ( P <Function 48> .
312
+ - The maximum area that can be specified by this command is the same as the printable area specified by GS ( P <Function 48> .
313
+ - The origin of this command is the same as the upper left point of the printable area specified by GS ( P <Function 48> .
314
+ - When adjusting the printable area of the Page modewith GS ( P <Function 48> , specify the printable area to be the same as the setting of the printable area by this command after executing ESC L.
315
+ - Even if the horizontal or vertical motion unit is changed after changing the printable area, the setting of the printable area will not be changed.
316
+ - Settings of this command are effective until FF (in Page mode) is executed, ESC @ is executed, the printer is reset, or the power is turned off.
317
+ - This command setting has no effect in Standard mode.
318
+ */
319
+ export declare function setPrintAreaInPageMode(originX: number, originY: number, width: number, height: number): number[];
320
+ /**
321
+ * ESC V -- Set relative print position
322
+ - The printer ignores any setting that exceeds the print area.
323
+ - A positive number specifies movement to the right, and a negative number specifies movement to the left.
324
+ - When Standard mode is selected, the horizontal motion unit is used.
325
+ - When Page mode is selected, the horizontal or vertical motion unit is used for the print direction set by ESC T.
326
+ - When the starting position is set to the upper left or lower right of the print area using ESC T, the horizontal motion unit is used.
327
+ - When the starting position is set to the upper right or lower left of the print area using ESC T, the vertical motion unit is used.
328
+ - Even if the vertical or horizontal motion unit is changed after changing the print position, the setting of the print position will not be changed.
329
+ - When underline mode is turned on, the underline will not be printed under the space skipped by this command.
330
+ - "\" corresponds to "¥" in the JIS code system.
331
+ */
332
+ export declare function setRelativePrintPosition(d: number): number[];
333
+ export type Justification = 'left' | 'centered' | 'right';
334
+ /**
335
+ * ESC a -- Select justification
336
+ - When Standard mode is selected, this command is enabled only when processed at the beginning of the line in Standard mode.
337
+ - The justification has no effect in Page mode.
338
+ - This command executes justification in the print area set by GS L and GS W.
339
+ - This command justifies printing data (such as characters, all graphics, barcodes, and two-dimensional code) and space area set by HT, ESC $, and ESC \.
340
+ - Settings of this command are effective until ESC @ is executed, the printer is reset, or the power is turned off.
341
+ */
342
+ export declare function selectJustification(justification?: Justification): number[];
343
+ /**
344
+ * ESC d -- Prints the data in the print buffer and feeds n lines.
345
+ - The amount of paper fed per line is based on the value set using the line spacing command (ESC 2 or ESC 3).
346
+ - The maximum paper feed amount depends on the printer model. If specified over the maximum amount, the maximum paper feed is executed.
347
+ - After printing, the print postion is moved to left side of the printable area. Also, the printer is in the status "Beginning of the line".
348
+ - When this command is processed in Page mode, only the print position moves, and the printer does not perform actual printing.
349
+ - This command is used to temporarily feed a specific line without changing the line spacing set by other commands.
350
+ */
351
+ export declare function printAndFeedLines(n: number): number[];
352
+ export type CharacterCodeTable = 'pc437-usa-standard-europe' | 'katakana' | 'pc850-multilingual' | 'pc860-portuguese' | 'pc863-canadian-french' | 'pc865-nordic' | 'wpc1252' | 'pc866-cyrillic-2' | 'pc852-latin-2' | 'pc858-euro' | 'page-255';
353
+ /**
354
+ * ESC t -- Select character code table
355
+ - The characters of each page are the same for alphanumeric parts (ASCII code: Hex = 20h – 7Fh / Decimal = 32 – 127), and different for the escape character parts (ASCII code: Hex = 80h – FFh / Decimal = 128 – 255).
356
+ - The selected character code table is valid until ESC @ is executed, the printer is reset, or the power is turned off.
357
+ - For characters in each code page, refer to Character Code Tables for TM printers > Single-byte Characters > Code Pages.
358
+ */
359
+ export declare function selectCharacterCodeTable(table: CharacterCodeTable): number[];
360
+ /**
361
+ * ESC { -- In Standard mode, turns upside-down print mode on or off.
362
+ - When Standard mode is selected, this command is enabled only when processed at the Beginning of the line.
363
+ - The upside-down print mode is effective for all data in Standard mode except the following:
364
+ - The graphics from GS ( L / GS 8 L <Function 112> , GS ( L / GS 8 L <Function 113> .
365
+ - Raster bit image from GS v 0 [obsolete command] .
366
+ - Variable vertical size bit image from GS Q 0 [obsolete command] .
367
+ - The upside-down print mode has no effect in Page mode.
368
+ - Settings of this command are effective until ESC @ is executed, the printer is reset, or the power is turned off.
369
+ - When upside-down print mode is turned on, the printer prints 180°-rotated characters from right to left. The line printing order is not reversed; therefore, be careful of the order of the data transmitted.
370
+ */
371
+ export declare function setUpsideDown(enable?: boolean): number[];
372
+ /**
373
+ * GS ! -- In Standard mode, turns upside-down print mode on or off.
374
+ - The character size set by this command is effective for alphanumeric, Kana, multilingual, and user-defined characters.
375
+ - When the characters are enlarged with different heights on one line, all the characters on the line are aligned at the Baseline.
376
+ - When the characters are enlarged widthwise, the characters are enlarged to the right, based on the left side of the character.
377
+ - ESC ! can also turn double-width and double-height modes on or off.
378
+ - In Standard mode, the character is enlarged in the paper feed direction when double-height mode is selected, and it is enlarged perpendicular to the paper feed direction when double-width mode is selected. However, when character orientation changes in 90° clockwise rotation mode, the relationship between double-height and double-width is reversed.
379
+ - In Page mode, double-height and double-width are on the character orientation.
380
+ - The setting of the character size of alphanumeric and Katakana is effective until ESC ! is executed, ESC @ is executed, the printer is reset, or the power is turned off.
381
+ - The setting of the character size of Kanji and multilingual characters is effective until FS ! is executed, FS W is executed, ESC @ is executed, the printer is reset, or the power is turned off.
382
+ */
383
+ export declare function selectCharacterSize(width?: number, height?: number): number[];
384
+ /**
385
+ * GS ! -- In Page mode, moves the vertical print position to (nL + nH × 256) × (vertical or horizontal motion unit) from the starting position set by ESC T.
386
+ - This command is enabled only in Page mode. If this command is processed in Standard mode, it is ignored.
387
+ - The printer ignores any setting that exceeds the print area set by ESC W.
388
+ - The horizontal or vertical motion unit is used for the print direction set by ESC T.
389
+ - When the starting position is set to the upper left or lower right of the print area using ESC T, the vertical motion unit is used.
390
+ - When the starting position is set to the upper right or lower left of the print area using ESC T, the horizontal motion unit is used.
391
+ - Even if the vertical or horizontal motion unit is changed after changing the print position, the print position will not be changed.
392
+ */
393
+ export declare function setAbsoluteVerticalPrintPositionInPageMode(n: number): number[];
394
+ /**
395
+ * GS B -- Turns white/black reverse print mode on or off.
396
+ - The white/black reverse print is effective for 1-byte code characters and multi-byte code characters.
397
+ - When white/black reverse print mode is turned on, it also affects the right-side character spacing set by ESC SP and left- and right-side spacing of multi-byte code characters set by FS S.
398
+ - When white/black reverse print mode is turned on, it does not affect the space between lines and the spaces skipped by HT, ESC $, or ESC \.
399
+ - When underline mode is turned on, the printer does not underline white/black reverse characters.
400
+ - This command is effective until ESC @ is executed, the printer is reset, or the power is turned off.
401
+ - In white/black reverse print mode, characters are printed in white on a black background.
402
+ */
403
+ export declare function inverse(enable?: boolean): number[];
404
+ export type PrintPositionOfHriCharacters = 'none' | 'above' | 'below' | 'both';
405
+ /**
406
+ * GS H -- Selects the print position of Human Readable Interpretation (HRI) characters when printing a barcode
407
+ - HRI characters are printed using the font specified by GS f.
408
+ - This command setting is effective until performing of ESC @, reset or power-off.
409
+ - HRI character is Human Readable Interpretation character indicated with barcode.
410
+ */
411
+ export declare function selectPrintPositionOfBarcodeHriCharacters(position: PrintPositionOfHriCharacters): number[];
412
+ /**
413
+ * GS L -- In Standard mode, sets the left margin to (nL + nH × 256) × (horizontal motion unit) from the left edge of the printable area.
414
+ - When Standard mode is selected, this command is enabled only when processed at the beginning of the line.
415
+ - The left margin has no effect in Page mode. If this command is processed in Page mode, the left margin is set and it is enabled when the printer returns to Standard mode.
416
+ - If the setting exceeds the printable area, the left margin is automatically set to the maximum value of the printable area.
417
+ - If this command and GS W set the print area width to less than the width of one character, the print area width is extended to accommodate one character for the line.
418
+ - Horizontal motion unit is used.
419
+ - If horizontal motion unit is changed after changing left margin, left margin setting is not changed.
420
+ - Left margin setting is effective until ESC @ is executed, the printer is reset, or the power is turned off.
421
+ - Left margin position is left edge of the printable area. If left margin setting is changed, left edge of the printable area will move.
422
+ */
423
+ export declare function setLeftMargin(n: number): number[];
424
+ /**
425
+ * GS P -- Sets the horizontal and vertical motion units to approximately 25.4/x mm {1/x"} and approximately 25.4/y mm {1/y"}, respectively.
426
+ - The horizontal and vertical motion units indicate the minimum pitch used for calculating the values of related commands.
427
+ - The horizontal direction is perpendicular to the paper feed direction and the vertical direction is the paper feed direction.
428
+ - In Standard mode, the following commands use x or y.
429
+ - Commands using x: ESC SP, ESC $, ESC \, FS S, GS ( P, GS L, and GS W
430
+ - Commands using y: ESC 3, ESC J, ESC K, GS ( P, and GS V
431
+ - In Page mode, the following commands use x or y, when the starting position is set to the upper left or lower right of the print area using ESC T.
432
+ - Commands using x: ESC SP, ESC $, ESC W, ESC \, GS ( Q, and FS S
433
+ - Commands using y: ESC 3, ESC J, ESC K, ESC W, GS $, GS V, GS ( Q, and GS \
434
+ - In Page mode, the following commands use x or y, when the starting position is set to the upper right or lower left of the print area using ESC T.
435
+ - Commands using x: ESC 3, ESC J, ESC K, ESC W, GS $, GS ( Q, and GS \
436
+ - Commands using y: ESC SP, ESC $, ESC W, ESC \, FS S, GS ( Q, and GS V
437
+ - Setting of this command is effective until ESC @ is executed, the printer is reset, or the power is turned off.
438
+ - The calculated result from combining this command with others is truncated to the minimum value of the mechanical pitch.
439
+ - This command does not affect the current setting values.
440
+ */
441
+ export declare function setHorizontalAndVerticalMotionUnits(x: number, y: number): number[];
442
+ /**
443
+ * GS V -- Cut paper
444
+ * There are extra cutting modes defined https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/gs_cv.html but
445
+ * I don't think they are supported aside from partial cut
446
+ */
447
+ export declare function cut(feedVertical?: number): number[];
448
+ /**
449
+ * GS W -- In Standard mode, sets the print area width to (nL + nH × 256) × (horizontal motion unit).
450
+ *
451
+ - When Standard mode is selected, this command is enabled only when processed at the beginning of the line.
452
+ - The print area width has no effect in Page mode. If this command is processed in Page mode, the print area width is set and it is enabled when the printer returns to Standard mode.
453
+ - If the [left margin + print area width] exceeds the printable area, the print area width is automatically set to [printable area - left margin].
454
+ - If this command and GS L set the print area width to less than the width of one character, the print area width is extended to accommodate one character for the line.
455
+ - Horizontal motion unit is used.
456
+ - If horizontal motion unit is changed after setting the printable area width, the printable area width setting will not be changed.
457
+ - Printable area width setting is effective until ESC @ is executed, the printer is reset, or the power is turned off.
458
+ */
459
+ export declare function setPrintAreaWidth(width?: number): number[];
460
+ /**
461
+ * GS \ -- In Page mode, moves the vertical print position to (nL + nH × 256) × (vertical or horizontal motion unit) from the current position.
462
+ - This command is enabled only in Page mode. If this command is processed in Standard mode, it is ignored.
463
+ - The printer ignores any setting that exceeds the print area set by ESC W.
464
+ - A positive number specifies movement downward, and a negative number specifies movement upward.
465
+ - The horizontal or vertical motion unit is used for the print direction set by ESC T.
466
+ - When the starting position is set to the upper left or lower right of the print area using ESC T, the vertical motion unit is used.
467
+ - When the starting position is set to the upper right or lower left of the print area using ESC T, the horizontal motion unit is used.
468
+ - Even if vertical or horizontal motion unit is changed after changing the print position, the setting of print position will not be changed.
469
+ - "\" corresponds to "¥" in the JIS code set.
470
+ */
471
+ export declare function setRelativeVerticalPrintPositionInPageMode(d: number): number[];
472
+ /**
473
+ * GS b -- Turns smoothing mode on or off.
474
+ - The smoothing mode is effective for quadruple-size or larger characters [alphanumeric, Kana, multilingual, and user-defined characters.]
475
+ - This command is effective until ESC @ is executed, the printer is reset, or the power is turned off.
476
+ */
477
+ export declare function setSmoothing(enable?: boolean): number[];
478
+ /**
479
+ * GS f -- Selects a font for the Human Readable Interpretation (HRI) characters when printing a barcode.
480
+ *
481
+ - The font set by this command is effective only for HRI character.
482
+ - Variety of fonts that each printer has and the font size are shown in model specific information of ESC M.
483
+ - HRI characters are printed at the position specified by GS H.
484
+ - HRI character is Human Readable Interpretation character indicated with barcode.
485
+ - The Automatic font replacement with GS ( E <Function 5> (a = 111 or 112) is not applied to the HRI characters.
486
+ */
487
+ export declare function selectFontForBarcodeHriCharacters(font: Font): number[];
488
+ /**
489
+ * GS h -- Sets the height of a barcode to n dots.
490
+ *
491
+ - The units for n depend on the printer model.
492
+ - This command setting is effective until performing of ESC @, reset or power-off.
493
+ */
494
+ export declare function setBarcodeHeight(n: number): number[];
495
+ /**
496
+ * GS h -- Prints the barcode using the barcode system specified.
497
+ *
498
+ - The units for n depend on the printer model.
499
+ - This command setting is effective until performing of ESC @, reset or power-off.
500
+ */
501
+ /**
502
+ * GS h -- Prints a raster bit image
503
+ *
504
+ - The units for n depend on the printer model.
505
+ - This command setting is effective until performing of ESC @, reset or power-off.
506
+ */
507
+ export declare function printRasterBitImage(data: number[][], verticalScale?: 1 | 2, horizontalScale?: 1 | 2): number[];