@thermal-print/escpos 0.1.0 → 0.3.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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 NUVEL
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 NUVEL
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * ESC/Bematech Command Adapter
4
3
  *
@@ -10,47 +9,12 @@
10
9
  *
11
10
  * Reference: Bematech MP-4200 TH Programming Manual
12
11
  */
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
- Object.defineProperty(exports, "__esModule", { value: true });
47
- exports.ESCBematechCommandAdapter = void 0;
48
- const ESCBema = __importStar(require("../commands/escbematech"));
12
+ import * as ESCBema from '../commands/escbematech';
49
13
  /**
50
14
  * ESC/Bematech Command Adapter
51
15
  * For Bematech printers in ESC/Bema mode
52
16
  */
53
- class ESCBematechCommandAdapter {
17
+ export class ESCBematechCommandAdapter {
54
18
  getName() {
55
19
  return 'ESC/Bematech';
56
20
  }
@@ -172,4 +136,3 @@ class ESCBematechCommandAdapter {
172
136
  return this.getLineFeedCommand(lines);
173
137
  }
174
138
  }
175
- exports.ESCBematechCommandAdapter = ESCBematechCommandAdapter;
@@ -1,46 +1,10 @@
1
- "use strict";
2
1
  /**
3
2
  * ESC/POS Command Adapter
4
3
  *
5
4
  * Standard ESC/POS command implementation using ESC ! for character sizing.
6
5
  * Compatible with most thermal printers that support ESC/POS protocol.
7
6
  */
8
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
- if (k2 === undefined) k2 = k;
10
- var desc = Object.getOwnPropertyDescriptor(m, k);
11
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
- desc = { enumerable: true, get: function() { return m[k]; } };
13
- }
14
- Object.defineProperty(o, k2, desc);
15
- }) : (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- o[k2] = m[k];
18
- }));
19
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
- Object.defineProperty(o, "default", { enumerable: true, value: v });
21
- }) : function(o, v) {
22
- o["default"] = v;
23
- });
24
- var __importStar = (this && this.__importStar) || (function () {
25
- var ownKeys = function(o) {
26
- ownKeys = Object.getOwnPropertyNames || function (o) {
27
- var ar = [];
28
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
- return ar;
30
- };
31
- return ownKeys(o);
32
- };
33
- return function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
- __setModuleDefault(result, mod);
38
- return result;
39
- };
40
- })();
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.ESCPOSCommandAdapter = void 0;
43
- const ESCPOS = __importStar(require("../commands/escpos"));
7
+ import * as ESCPOS from "../commands/escpos";
44
8
  // Control characters (for backward compatibility)
45
9
  const ESC = ESCPOS.ESC;
46
10
  const GS = ESCPOS.GS;
@@ -49,7 +13,7 @@ const LF = ESCPOS.LF;
49
13
  * ESC/POS Command Adapter
50
14
  * Uses ESC ! for character sizing (max 2x2) for better compatibility
51
15
  */
52
- class ESCPOSCommandAdapter {
16
+ export class ESCPOSCommandAdapter {
53
17
  getName() {
54
18
  return "ESC/POS";
55
19
  }
@@ -141,4 +105,3 @@ class ESCPOSCommandAdapter {
141
105
  return ESCPOS.feedLines(lines);
142
106
  }
143
107
  }
144
- exports.ESCPOSCommandAdapter = ESCPOSCommandAdapter;
@@ -5,7 +5,7 @@
5
5
  * - ESC/POS: Standard thermal printer protocol
6
6
  * - ESC/Bematech: Bematech-specific protocol
7
7
  */
8
- export { CommandAdapter, CharacterSize } from './types';
8
+ export type { CommandAdapter, CharacterSize } from './types';
9
9
  export { ESCPOSCommandAdapter } from './escpos-adapter';
10
10
  export { ESCBematechCommandAdapter } from './escbematech-adapter';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command-adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command-adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * Command Adapters
4
3
  *
@@ -6,9 +5,5 @@
6
5
  * - ESC/POS: Standard thermal printer protocol
7
6
  * - ESC/Bematech: Bematech-specific protocol
8
7
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.ESCBematechCommandAdapter = exports.ESCPOSCommandAdapter = void 0;
11
- var escpos_adapter_1 = require("./escpos-adapter");
12
- Object.defineProperty(exports, "ESCPOSCommandAdapter", { enumerable: true, get: function () { return escpos_adapter_1.ESCPOSCommandAdapter; } });
13
- var escbematech_adapter_1 = require("./escbematech-adapter");
14
- Object.defineProperty(exports, "ESCBematechCommandAdapter", { enumerable: true, get: function () { return escbematech_adapter_1.ESCBematechCommandAdapter; } });
8
+ export { ESCPOSCommandAdapter } from './escpos-adapter';
9
+ export { ESCBematechCommandAdapter } from './escbematech-adapter';
@@ -1,8 +1,7 @@
1
- "use strict";
2
1
  /**
3
2
  * Command Adapter Interface
4
3
  *
5
4
  * Abstracts printer-specific ESC/POS command generation to support
6
5
  * different printer protocols (ESC/POS, ESC/Bematech, etc.)
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
7
+ export {};