@sincpro/printer-expo 0.1.2 → 1.0.1

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.
Files changed (72) hide show
  1. package/README.md +589 -415
  2. package/android/.editorconfig +20 -0
  3. package/android/README.md +103 -0
  4. package/android/build.gradle +36 -34
  5. package/android/libs/pdf/Bixolon_pdf.aar +0 -0
  6. package/android/libs/{jniLibs/x86_64/libbxl_common.so → sincpro-printer-sdk.aar} +0 -0
  7. package/android/src/main/java/sincpro/expo/printer/entrypoint/PrinterModule.kt +387 -0
  8. package/build/SincproPrinter.d.ts +191 -0
  9. package/build/SincproPrinter.d.ts.map +1 -0
  10. package/build/SincproPrinter.js +120 -0
  11. package/build/SincproPrinter.js.map +1 -0
  12. package/build/index.d.ts +11 -3
  13. package/build/index.d.ts.map +1 -1
  14. package/build/index.js +13 -3
  15. package/build/index.js.map +1 -1
  16. package/build/types/bluetooth.types.d.ts +19 -0
  17. package/build/types/bluetooth.types.d.ts.map +1 -0
  18. package/build/types/bluetooth.types.js +5 -0
  19. package/build/types/bluetooth.types.js.map +1 -0
  20. package/build/types/index.d.ts +7 -0
  21. package/build/types/index.d.ts.map +1 -0
  22. package/build/types/index.js +7 -0
  23. package/build/types/index.js.map +1 -0
  24. package/build/types/printer.types.d.ts +118 -0
  25. package/build/types/printer.types.d.ts.map +1 -0
  26. package/build/types/printer.types.js +5 -0
  27. package/build/types/printer.types.js.map +1 -0
  28. package/build/types/receipt.types.d.ts +96 -0
  29. package/build/types/receipt.types.d.ts.map +1 -0
  30. package/build/types/receipt.types.js +5 -0
  31. package/build/types/receipt.types.js.map +1 -0
  32. package/expo-module.config.json +2 -5
  33. package/package.json +6 -7
  34. package/android/libs/BixolonLabelPrinterLibrary_V2.0.9.jar +0 -0
  35. package/android/libs/jniLibs/arm64-v8a/libbxl_common.so +0 -0
  36. package/android/libs/jniLibs/armeabi-v7a/libbxl_common.so +0 -0
  37. package/android/libs/jniLibs/x86/libbxl_common.so +0 -0
  38. package/android/libs/libcommon_V1.4.0.jar +0 -0
  39. package/android/src/main/java/expo/sincpro/ExpoBixolonModule.kt +0 -271
  40. package/android/src/main/java/expo/sincpro/bixolon/BixolonQRPrinter.kt +0 -423
  41. package/android/src/main/java/expo/sincpro/managers/BluetoothManager.kt +0 -139
  42. package/android/src/main/java/expo/sincpro/managers/ConnectionManager.kt +0 -124
  43. package/android/src/main/java/expo/sincpro/managers/PermissionManager.kt +0 -122
  44. package/android/src/main/java/expo/sincpro/managers/PrinterManager.kt +0 -396
  45. package/android/src/main/jniLibs/arm64-v8a/libbxl_common.so +0 -0
  46. package/android/src/main/jniLibs/armeabi-v7a/libbxl_common.so +0 -0
  47. package/android/src/main/jniLibs/x86/libbxl_common.so +0 -0
  48. package/android/src/main/jniLibs/x86_64/libbxl_common.so +0 -0
  49. package/build/BixolonPrinter.d.ts +0 -4
  50. package/build/BixolonPrinter.d.ts.map +0 -1
  51. package/build/BixolonPrinter.js +0 -12
  52. package/build/BixolonPrinter.js.map +0 -1
  53. package/build/ExpoBixolon.types.d.ts +0 -45
  54. package/build/ExpoBixolon.types.d.ts.map +0 -1
  55. package/build/ExpoBixolon.types.js +0 -2
  56. package/build/ExpoBixolon.types.js.map +0 -1
  57. package/build/ExpoBixolonModule.d.ts +0 -24
  58. package/build/ExpoBixolonModule.d.ts.map +0 -1
  59. package/build/ExpoBixolonModule.js +0 -3
  60. package/build/ExpoBixolonModule.js.map +0 -1
  61. package/build/QrCodePrinter.d.ts +0 -45
  62. package/build/QrCodePrinter.d.ts.map +0 -1
  63. package/build/QrCodePrinter.js +0 -118
  64. package/build/QrCodePrinter.js.map +0 -1
  65. package/ios/ExpoBixolon.podspec +0 -29
  66. package/ios/ExpoBixolonModule.swift +0 -33
  67. package/ios/ExpoBixolonView.swift +0 -36
  68. package/src/BixolonPrinter.ts +0 -16
  69. package/src/ExpoBixolon.types.ts +0 -60
  70. package/src/ExpoBixolonModule.ts +0 -38
  71. package/src/QrCodePrinter.ts +0 -201
  72. package/src/index.ts +0 -3
@@ -0,0 +1,191 @@
1
+ import type { BluetoothDevice, PairedPrinter, PrinterStatus, PrinterInfo, PrintTextOptions, PrintTextsOptions, PrintQROptions, PrintBarcodeOptions, PrintImageOptions, PrintPdfOptions, PrintKeyValueOptions, PrintReceiptOptions, Receipt } from './types';
2
+ /**
3
+ * Bluetooth API for device discovery
4
+ */
5
+ export declare const bluetooth: {
6
+ /**
7
+ * Get all paired/bonded Bluetooth devices
8
+ */
9
+ getPairedDevices: () => BluetoothDevice[];
10
+ /**
11
+ * Get paired devices that are printers
12
+ */
13
+ getPairedPrinters: () => PairedPrinter[];
14
+ };
15
+ /**
16
+ * Connection API for printer connectivity
17
+ */
18
+ export declare const connection: {
19
+ /**
20
+ * Connect to printer via Bluetooth
21
+ * @param address MAC address (e.g., "00:11:22:33:44:55")
22
+ * @param timeoutMs Connection timeout in milliseconds (default: 10000)
23
+ */
24
+ connectBluetooth: (address: string, timeoutMs?: number) => Promise<void>;
25
+ /**
26
+ * Connect to printer via WiFi
27
+ * @param ip IP address (e.g., "192.168.1.100")
28
+ * @param port TCP port (default: 9100)
29
+ * @param timeoutMs Connection timeout in milliseconds (default: 10000)
30
+ */
31
+ connectWifi: (ip: string, port?: number, timeoutMs?: number) => Promise<void>;
32
+ /**
33
+ * Connect to printer via USB
34
+ */
35
+ connectUsb: () => Promise<void>;
36
+ /**
37
+ * Disconnect from current printer
38
+ */
39
+ disconnect: () => Promise<void>;
40
+ /**
41
+ * Check if currently connected
42
+ */
43
+ isConnected: () => boolean;
44
+ /**
45
+ * Get printer status (paper, cover, errors)
46
+ */
47
+ getStatus: () => Promise<PrinterStatus>;
48
+ /**
49
+ * Get printer info (model, firmware, serial)
50
+ */
51
+ getInfo: () => Promise<PrinterInfo>;
52
+ /**
53
+ * Get printer DPI
54
+ */
55
+ getDpi: () => number;
56
+ };
57
+ /**
58
+ * Print API for all printing operations
59
+ */
60
+ export declare const print: {
61
+ /**
62
+ * Print a single line of text
63
+ */
64
+ text: (text: string, options?: PrintTextOptions) => Promise<void>;
65
+ /**
66
+ * Print multiple lines of text
67
+ */
68
+ texts: (texts: string[], options?: PrintTextsOptions) => Promise<void>;
69
+ /**
70
+ * Print a QR code
71
+ */
72
+ qr: (data: string, options?: PrintQROptions) => Promise<void>;
73
+ /**
74
+ * Print a barcode
75
+ */
76
+ barcode: (data: string, options?: PrintBarcodeOptions) => Promise<void>;
77
+ /**
78
+ * Print an image from base64
79
+ */
80
+ imageBase64: (base64Data: string, options?: PrintImageOptions) => Promise<void>;
81
+ /**
82
+ * Print a PDF page from base64
83
+ */
84
+ pdfBase64: (base64Data: string, options?: PrintPdfOptions) => Promise<void>;
85
+ /**
86
+ * Get page count from a PDF (base64)
87
+ */
88
+ getPdfPageCount: (base64Data: string) => number;
89
+ /**
90
+ * Print a complete receipt with header, body, footer
91
+ */
92
+ receipt: (receipt: Receipt, options?: PrintReceiptOptions) => Promise<void>;
93
+ /**
94
+ * Print a key-value pair (two columns)
95
+ */
96
+ keyValue: (key: string, value: string, options?: PrintKeyValueOptions) => Promise<void>;
97
+ };
98
+ /**
99
+ * Sincpro Printer SDK for Expo
100
+ */
101
+ declare const SincproPrinter: {
102
+ bluetooth: {
103
+ /**
104
+ * Get all paired/bonded Bluetooth devices
105
+ */
106
+ getPairedDevices: () => BluetoothDevice[];
107
+ /**
108
+ * Get paired devices that are printers
109
+ */
110
+ getPairedPrinters: () => PairedPrinter[];
111
+ };
112
+ connection: {
113
+ /**
114
+ * Connect to printer via Bluetooth
115
+ * @param address MAC address (e.g., "00:11:22:33:44:55")
116
+ * @param timeoutMs Connection timeout in milliseconds (default: 10000)
117
+ */
118
+ connectBluetooth: (address: string, timeoutMs?: number) => Promise<void>;
119
+ /**
120
+ * Connect to printer via WiFi
121
+ * @param ip IP address (e.g., "192.168.1.100")
122
+ * @param port TCP port (default: 9100)
123
+ * @param timeoutMs Connection timeout in milliseconds (default: 10000)
124
+ */
125
+ connectWifi: (ip: string, port?: number, timeoutMs?: number) => Promise<void>;
126
+ /**
127
+ * Connect to printer via USB
128
+ */
129
+ connectUsb: () => Promise<void>;
130
+ /**
131
+ * Disconnect from current printer
132
+ */
133
+ disconnect: () => Promise<void>;
134
+ /**
135
+ * Check if currently connected
136
+ */
137
+ isConnected: () => boolean;
138
+ /**
139
+ * Get printer status (paper, cover, errors)
140
+ */
141
+ getStatus: () => Promise<PrinterStatus>;
142
+ /**
143
+ * Get printer info (model, firmware, serial)
144
+ */
145
+ getInfo: () => Promise<PrinterInfo>;
146
+ /**
147
+ * Get printer DPI
148
+ */
149
+ getDpi: () => number;
150
+ };
151
+ print: {
152
+ /**
153
+ * Print a single line of text
154
+ */
155
+ text: (text: string, options?: PrintTextOptions) => Promise<void>;
156
+ /**
157
+ * Print multiple lines of text
158
+ */
159
+ texts: (texts: string[], options?: PrintTextsOptions) => Promise<void>;
160
+ /**
161
+ * Print a QR code
162
+ */
163
+ qr: (data: string, options?: PrintQROptions) => Promise<void>;
164
+ /**
165
+ * Print a barcode
166
+ */
167
+ barcode: (data: string, options?: PrintBarcodeOptions) => Promise<void>;
168
+ /**
169
+ * Print an image from base64
170
+ */
171
+ imageBase64: (base64Data: string, options?: PrintImageOptions) => Promise<void>;
172
+ /**
173
+ * Print a PDF page from base64
174
+ */
175
+ pdfBase64: (base64Data: string, options?: PrintPdfOptions) => Promise<void>;
176
+ /**
177
+ * Get page count from a PDF (base64)
178
+ */
179
+ getPdfPageCount: (base64Data: string) => number;
180
+ /**
181
+ * Print a complete receipt with header, body, footer
182
+ */
183
+ receipt: (receipt: Receipt, options?: PrintReceiptOptions) => Promise<void>;
184
+ /**
185
+ * Print a key-value pair (two columns)
186
+ */
187
+ keyValue: (key: string, value: string, options?: PrintKeyValueOptions) => Promise<void>;
188
+ };
189
+ };
190
+ export default SincproPrinter;
191
+ //# sourceMappingURL=SincproPrinter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SincproPrinter.d.ts","sourceRoot":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mBAAmB,KAAG,OAAO,CAAC,IAAI,CAAC;QAGzE;;WAEG;wBACa,MAAM,SAAS,MAAM,YAAY,oBAAoB,KAAG,OAAO,CAAC,IAAI,CAAC;;CAetF,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,120 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ const NativeModule = requireNativeModule('SincproPrinter');
3
+ // ============================================================
4
+ // BLUETOOTH API
5
+ // ============================================================
6
+ /**
7
+ * Bluetooth API for device discovery
8
+ */
9
+ export const bluetooth = {
10
+ /**
11
+ * Get all paired/bonded Bluetooth devices
12
+ */
13
+ getPairedDevices: () => NativeModule.getPairedDevices(),
14
+ /**
15
+ * Get paired devices that are printers
16
+ */
17
+ getPairedPrinters: () => NativeModule.getPairedPrinters(),
18
+ };
19
+ // ============================================================
20
+ // CONNECTION API
21
+ // ============================================================
22
+ /**
23
+ * Connection API for printer connectivity
24
+ */
25
+ export const connection = {
26
+ /**
27
+ * Connect to printer via Bluetooth
28
+ * @param address MAC address (e.g., "00:11:22:33:44:55")
29
+ * @param timeoutMs Connection timeout in milliseconds (default: 10000)
30
+ */
31
+ connectBluetooth: (address, timeoutMs) => NativeModule.connectBluetooth(address, timeoutMs),
32
+ /**
33
+ * Connect to printer via WiFi
34
+ * @param ip IP address (e.g., "192.168.1.100")
35
+ * @param port TCP port (default: 9100)
36
+ * @param timeoutMs Connection timeout in milliseconds (default: 10000)
37
+ */
38
+ connectWifi: (ip, port, timeoutMs) => NativeModule.connectWifi(ip, port, timeoutMs),
39
+ /**
40
+ * Connect to printer via USB
41
+ */
42
+ connectUsb: () => NativeModule.connectUsb(),
43
+ /**
44
+ * Disconnect from current printer
45
+ */
46
+ disconnect: () => NativeModule.disconnect(),
47
+ /**
48
+ * Check if currently connected
49
+ */
50
+ isConnected: () => NativeModule.isConnected(),
51
+ /**
52
+ * Get printer status (paper, cover, errors)
53
+ */
54
+ getStatus: () => NativeModule.getStatus(),
55
+ /**
56
+ * Get printer info (model, firmware, serial)
57
+ */
58
+ getInfo: () => NativeModule.getInfo(),
59
+ /**
60
+ * Get printer DPI
61
+ */
62
+ getDpi: () => NativeModule.getDpi(),
63
+ };
64
+ // ============================================================
65
+ // PRINT API
66
+ // ============================================================
67
+ /**
68
+ * Print API for all printing operations
69
+ */
70
+ export const print = {
71
+ /**
72
+ * Print a single line of text
73
+ */
74
+ text: (text, options) => NativeModule.printText(text, options),
75
+ /**
76
+ * Print multiple lines of text
77
+ */
78
+ texts: (texts, options) => NativeModule.printTexts(texts, options),
79
+ /**
80
+ * Print a QR code
81
+ */
82
+ qr: (data, options) => NativeModule.printQR(data, options),
83
+ /**
84
+ * Print a barcode
85
+ */
86
+ barcode: (data, options) => NativeModule.printBarcode(data, options),
87
+ /**
88
+ * Print an image from base64
89
+ */
90
+ imageBase64: (base64Data, options) => NativeModule.printImageBase64(base64Data, options),
91
+ /**
92
+ * Print a PDF page from base64
93
+ */
94
+ pdfBase64: (base64Data, options) => NativeModule.printPdfBase64(base64Data, options),
95
+ /**
96
+ * Get page count from a PDF (base64)
97
+ */
98
+ getPdfPageCount: (base64Data) => NativeModule.getPdfPageCount(base64Data),
99
+ /**
100
+ * Print a complete receipt with header, body, footer
101
+ */
102
+ receipt: (receipt, options) => NativeModule.printReceipt(receipt, options),
103
+ /**
104
+ * Print a key-value pair (two columns)
105
+ */
106
+ keyValue: (key, value, options) => NativeModule.printKeyValue(key, value, options),
107
+ };
108
+ // ============================================================
109
+ // DEFAULT EXPORT
110
+ // ============================================================
111
+ /**
112
+ * Sincpro Printer SDK for Expo
113
+ */
114
+ const SincproPrinter = {
115
+ bluetooth,
116
+ connection,
117
+ print,
118
+ };
119
+ export default SincproPrinter;
120
+ //# sourceMappingURL=SincproPrinter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SincproPrinter.js","sourceRoot":"","sources":["../src/SincproPrinter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,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,cAAc,GAAG;IACrB,SAAS;IACT,UAAU;IACV,KAAK;CACN,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\nimport type {\n BluetoothDevice,\n PairedPrinter,\n PrinterStatus,\n PrinterInfo,\n PrintTextOptions,\n PrintTextsOptions,\n PrintQROptions,\n PrintBarcodeOptions,\n PrintImageOptions,\n PrintPdfOptions,\n PrintKeyValueOptions,\n PrintReceiptOptions,\n Receipt,\n} from './types';\n\n/**\n * Native module interface matching PrinterModule.kt\n */\ninterface SincproPrinterNativeModule {\n // Bluetooth\n getPairedDevices(): BluetoothDevice[];\n getPairedPrinters(): PairedPrinter[];\n\n // Connection\n connectBluetooth(address: string, timeoutMs?: number): Promise<void>;\n connectWifi(ip: string, port?: number, timeoutMs?: number): Promise<void>;\n connectUsb(): Promise<void>;\n disconnect(): Promise<void>;\n isConnected(): boolean;\n getStatus(): Promise<PrinterStatus>;\n getInfo(): Promise<PrinterInfo>;\n getDpi(): number;\n\n // Print - Text\n printText(text: string, options?: PrintTextOptions): Promise<void>;\n printTexts(texts: string[], options?: PrintTextsOptions): Promise<void>;\n\n // Print - QR & Barcode\n printQR(data: string, options?: PrintQROptions): Promise<void>;\n printBarcode(data: string, options?: PrintBarcodeOptions): Promise<void>;\n\n // Print - Images & PDF\n printImageBase64(base64Data: string, options?: PrintImageOptions): Promise<void>;\n printPdfBase64(base64Data: string, options?: PrintPdfOptions): Promise<void>;\n getPdfPageCount(base64Data: string): number;\n\n // Print - Receipt\n printReceipt(receipt: Receipt, options?: PrintReceiptOptions): Promise<void>;\n\n // Print - Key-Value\n printKeyValue(key: string, value: string, options?: PrintKeyValueOptions): Promise<void>;\n}\n\nconst NativeModule = requireNativeModule<SincproPrinterNativeModule>('SincproPrinter');\n\n// ============================================================\n// BLUETOOTH API\n// ============================================================\n\n/**\n * Bluetooth API for device discovery\n */\nexport const bluetooth = {\n /**\n * Get all paired/bonded Bluetooth devices\n */\n getPairedDevices: (): BluetoothDevice[] => NativeModule.getPairedDevices(),\n\n /**\n * Get paired devices that are printers\n */\n getPairedPrinters: (): PairedPrinter[] => NativeModule.getPairedPrinters(),\n};\n\n// ============================================================\n// CONNECTION API\n// ============================================================\n\n/**\n * Connection API for printer connectivity\n */\nexport const connection = {\n /**\n * Connect to printer via Bluetooth\n * @param address MAC address (e.g., \"00:11:22:33:44:55\")\n * @param timeoutMs Connection timeout in milliseconds (default: 10000)\n */\n connectBluetooth: (address: string, timeoutMs?: number): Promise<void> =>\n NativeModule.connectBluetooth(address, timeoutMs),\n\n /**\n * Connect to printer via WiFi\n * @param ip IP address (e.g., \"192.168.1.100\")\n * @param port TCP port (default: 9100)\n * @param timeoutMs Connection timeout in milliseconds (default: 10000)\n */\n connectWifi: (ip: string, port?: number, timeoutMs?: number): Promise<void> =>\n NativeModule.connectWifi(ip, port, timeoutMs),\n\n /**\n * Connect to printer via USB\n */\n connectUsb: (): Promise<void> => NativeModule.connectUsb(),\n\n /**\n * Disconnect from current printer\n */\n disconnect: (): Promise<void> => NativeModule.disconnect(),\n\n /**\n * Check if currently connected\n */\n isConnected: (): boolean => NativeModule.isConnected(),\n\n /**\n * Get printer status (paper, cover, errors)\n */\n getStatus: (): Promise<PrinterStatus> => NativeModule.getStatus(),\n\n /**\n * Get printer info (model, firmware, serial)\n */\n getInfo: (): Promise<PrinterInfo> => NativeModule.getInfo(),\n\n /**\n * Get printer DPI\n */\n getDpi: (): number => NativeModule.getDpi(),\n};\n\n// ============================================================\n// PRINT API\n// ============================================================\n\n/**\n * Print API for all printing operations\n */\nexport const print = {\n /**\n * Print a single line of text\n */\n text: (text: string, options?: PrintTextOptions): Promise<void> =>\n NativeModule.printText(text, options),\n\n /**\n * Print multiple lines of text\n */\n texts: (texts: string[], options?: PrintTextsOptions): Promise<void> =>\n NativeModule.printTexts(texts, options),\n\n /**\n * Print a QR code\n */\n qr: (data: string, options?: PrintQROptions): Promise<void> =>\n NativeModule.printQR(data, options),\n\n /**\n * Print a barcode\n */\n barcode: (data: string, options?: PrintBarcodeOptions): Promise<void> =>\n NativeModule.printBarcode(data, options),\n\n /**\n * Print an image from base64\n */\n imageBase64: (base64Data: string, options?: PrintImageOptions): Promise<void> =>\n NativeModule.printImageBase64(base64Data, options),\n\n /**\n * Print a PDF page from base64\n */\n pdfBase64: (base64Data: string, options?: PrintPdfOptions): Promise<void> =>\n NativeModule.printPdfBase64(base64Data, options),\n\n /**\n * Get page count from a PDF (base64)\n */\n getPdfPageCount: (base64Data: string): number => NativeModule.getPdfPageCount(base64Data),\n\n /**\n * Print a complete receipt with header, body, footer\n */\n receipt: (receipt: Receipt, options?: PrintReceiptOptions): Promise<void> =>\n NativeModule.printReceipt(receipt, options),\n\n /**\n * Print a key-value pair (two columns)\n */\n keyValue: (key: string, value: string, options?: PrintKeyValueOptions): Promise<void> =>\n NativeModule.printKeyValue(key, value, options),\n};\n\n// ============================================================\n// DEFAULT EXPORT\n// ============================================================\n\n/**\n * Sincpro Printer SDK for Expo\n */\nconst SincproPrinter = {\n bluetooth,\n connection,\n print,\n};\n\nexport default SincproPrinter;\n"]}
package/build/index.d.ts CHANGED
@@ -1,4 +1,12 @@
1
- export { default } from './ExpoBixolonModule';
2
- export * from './ExpoBixolon.types';
3
- export { default as BixolonPrinter } from './BixolonPrinter';
1
+ /**
2
+ * @sincpro/printer-expo
3
+ *
4
+ * Expo module for Bluetooth/WiFi/USB thermal printers.
5
+ * Supports Bixolon label printers.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ export { default } from './SincproPrinter';
10
+ export { bluetooth, connection, print } from './SincproPrinter';
11
+ export * from './types';
4
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGhE,cAAc,SAAS,CAAC"}
package/build/index.js CHANGED
@@ -1,4 +1,14 @@
1
- export { default } from './ExpoBixolonModule';
2
- export * from './ExpoBixolon.types';
3
- export { default as BixolonPrinter } from './BixolonPrinter';
1
+ /**
2
+ * @sincpro/printer-expo
3
+ *
4
+ * Expo module for Bluetooth/WiFi/USB thermal printers.
5
+ * Supports Bixolon label printers.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ // Main module export
10
+ export { default } from './SincproPrinter';
11
+ export { bluetooth, connection, print } from './SincproPrinter';
12
+ // Type exports
13
+ export * from './types';
4
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './ExpoBixolonModule';\nexport * from './ExpoBixolon.types';\nexport { default as BixolonPrinter } from './BixolonPrinter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qBAAqB;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEhE,eAAe;AACf,cAAc,SAAS,CAAC","sourcesContent":["/**\n * @sincpro/printer-expo\n *\n * Expo module for Bluetooth/WiFi/USB thermal printers.\n * Supports Bixolon label printers.\n *\n * @packageDocumentation\n */\n\n// Main module export\nexport { default } from './SincproPrinter';\nexport { bluetooth, connection, print } from './SincproPrinter';\n\n// Type exports\nexport * from './types';\n"]}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Bluetooth types for @sincpro/printer-expo
3
+ */
4
+ /**
5
+ * Bluetooth device information
6
+ */
7
+ export interface BluetoothDevice {
8
+ name: string;
9
+ address: string;
10
+ isPrinter: boolean;
11
+ }
12
+ /**
13
+ * Paired printer (simplified device)
14
+ */
15
+ export interface PairedPrinter {
16
+ name: string;
17
+ address: string;
18
+ }
19
+ //# sourceMappingURL=bluetooth.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bluetooth.types.d.ts","sourceRoot":"","sources":["../../src/types/bluetooth.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Bluetooth types for @sincpro/printer-expo
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=bluetooth.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bluetooth.types.js","sourceRoot":"","sources":["../../src/types/bluetooth.types.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Bluetooth types for @sincpro/printer-expo\n */\n\n/**\n * Bluetooth device information\n */\nexport interface BluetoothDevice {\n name: string;\n address: string;\n isPrinter: boolean;\n}\n\n/**\n * Paired printer (simplified device)\n */\nexport interface PairedPrinter {\n name: string;\n address: string;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Type exports for @sincpro/printer-expo
3
+ */
4
+ export * from './bluetooth.types';
5
+ export * from './printer.types';
6
+ export * from './receipt.types';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Type exports for @sincpro/printer-expo
3
+ */
4
+ export * from './bluetooth.types';
5
+ export * from './printer.types';
6
+ export * from './receipt.types';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC","sourcesContent":["/**\n * Type exports for @sincpro/printer-expo\n */\n\nexport * from './bluetooth.types';\nexport * from './printer.types';\nexport * from './receipt.types';\n"]}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Printer types for @sincpro/printer-expo
3
+ */
4
+ /**
5
+ * Printer status from getStatus()
6
+ */
7
+ export interface PrinterStatus {
8
+ connectionState: ConnectionState;
9
+ hasPaper: boolean;
10
+ isCoverOpen: boolean;
11
+ isOverheated: boolean;
12
+ hasError: boolean;
13
+ errorMessage: string | null;
14
+ }
15
+ /**
16
+ * Connection state
17
+ */
18
+ export type ConnectionState = 'DISCONNECTED' | 'CONNECTING' | 'CONNECTED' | 'ERROR';
19
+ /**
20
+ * Printer info from getInfo()
21
+ */
22
+ export interface PrinterInfo {
23
+ model: string;
24
+ firmware: string;
25
+ serial: string;
26
+ dpi: number;
27
+ }
28
+ /**
29
+ * Media configuration
30
+ */
31
+ export interface MediaConfig {
32
+ /** Use preset instead of manual widthDots/heightDots */
33
+ preset?: MediaPreset;
34
+ /** Width in dots (ignored if preset is set) */
35
+ widthDots?: number;
36
+ /** Height in dots (ignored if preset is set) */
37
+ heightDots?: number;
38
+ }
39
+ /**
40
+ * Media presets
41
+ */
42
+ export type MediaPreset = 'continuous58mm' | 'continuous80mm';
43
+ /**
44
+ * Font size options
45
+ */
46
+ export type FontSize = 'small' | 'medium' | 'large' | 'xlarge';
47
+ /**
48
+ * Alignment options
49
+ */
50
+ export type Alignment = 'left' | 'center' | 'right';
51
+ /**
52
+ * Barcode types
53
+ */
54
+ export type BarcodeType = 'CODE128' | 'CODE39' | 'EAN13' | 'EAN8' | 'UPCA' | 'UPCE' | 'CODE93' | 'CODABAR';
55
+ /**
56
+ * Print text options
57
+ */
58
+ export interface PrintTextOptions {
59
+ fontSize?: FontSize;
60
+ alignment?: Alignment;
61
+ bold?: boolean;
62
+ media?: MediaConfig;
63
+ }
64
+ /**
65
+ * Print texts options (multiple lines)
66
+ */
67
+ export interface PrintTextsOptions {
68
+ fontSize?: FontSize;
69
+ media?: MediaConfig;
70
+ }
71
+ /**
72
+ * Print QR options
73
+ */
74
+ export interface PrintQROptions {
75
+ size?: number;
76
+ alignment?: Alignment;
77
+ media?: MediaConfig;
78
+ }
79
+ /**
80
+ * Print barcode options
81
+ */
82
+ export interface PrintBarcodeOptions {
83
+ type?: BarcodeType;
84
+ height?: number;
85
+ alignment?: Alignment;
86
+ media?: MediaConfig;
87
+ }
88
+ /**
89
+ * Print image options
90
+ */
91
+ export interface PrintImageOptions {
92
+ alignment?: Alignment;
93
+ media?: MediaConfig;
94
+ }
95
+ /**
96
+ * Print PDF options
97
+ */
98
+ export interface PrintPdfOptions {
99
+ page?: number;
100
+ alignment?: Alignment;
101
+ media?: MediaConfig;
102
+ }
103
+ /**
104
+ * Print key-value options
105
+ */
106
+ export interface PrintKeyValueOptions {
107
+ fontSize?: FontSize;
108
+ bold?: boolean;
109
+ media?: MediaConfig;
110
+ }
111
+ /**
112
+ * Print receipt options
113
+ */
114
+ export interface PrintReceiptOptions {
115
+ media?: MediaConfig;
116
+ copies?: number;
117
+ }
118
+ //# sourceMappingURL=printer.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printer.types.d.ts","sourceRoot":"","sources":["../../src/types/printer.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,QAAQ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* Printer types for @sincpro/printer-expo
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=printer.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printer.types.js","sourceRoot":"","sources":["../../src/types/printer.types.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Printer types for @sincpro/printer-expo\n */\n\n/**\n * Printer status from getStatus()\n */\nexport interface PrinterStatus {\n connectionState: ConnectionState;\n hasPaper: boolean;\n isCoverOpen: boolean;\n isOverheated: boolean;\n hasError: boolean;\n errorMessage: string | null;\n}\n\n/**\n * Connection state\n */\nexport type ConnectionState = 'DISCONNECTED' | 'CONNECTING' | 'CONNECTED' | 'ERROR';\n\n/**\n * Printer info from getInfo()\n */\nexport interface PrinterInfo {\n model: string;\n firmware: string;\n serial: string;\n dpi: number;\n}\n\n/**\n * Media configuration\n */\nexport interface MediaConfig {\n /** Use preset instead of manual widthDots/heightDots */\n preset?: MediaPreset;\n /** Width in dots (ignored if preset is set) */\n widthDots?: number;\n /** Height in dots (ignored if preset is set) */\n heightDots?: number;\n}\n\n/**\n * Media presets\n */\nexport type MediaPreset = 'continuous58mm' | 'continuous80mm';\n\n/**\n * Font size options\n */\nexport type FontSize = 'small' | 'medium' | 'large' | 'xlarge';\n\n/**\n * Alignment options\n */\nexport type Alignment = 'left' | 'center' | 'right';\n\n/**\n * Barcode types\n */\nexport type BarcodeType =\n | 'CODE128'\n | 'CODE39'\n | 'EAN13'\n | 'EAN8'\n | 'UPCA'\n | 'UPCE'\n | 'CODE93'\n | 'CODABAR';\n\n/**\n * Print text options\n */\nexport interface PrintTextOptions {\n fontSize?: FontSize;\n alignment?: Alignment;\n bold?: boolean;\n media?: MediaConfig;\n}\n\n/**\n * Print texts options (multiple lines)\n */\nexport interface PrintTextsOptions {\n fontSize?: FontSize;\n media?: MediaConfig;\n}\n\n/**\n * Print QR options\n */\nexport interface PrintQROptions {\n size?: number;\n alignment?: Alignment;\n media?: MediaConfig;\n}\n\n/**\n * Print barcode options\n */\nexport interface PrintBarcodeOptions {\n type?: BarcodeType;\n height?: number;\n alignment?: Alignment;\n media?: MediaConfig;\n}\n\n/**\n * Print image options\n */\nexport interface PrintImageOptions {\n alignment?: Alignment;\n media?: MediaConfig;\n}\n\n/**\n * Print PDF options\n */\nexport interface PrintPdfOptions {\n page?: number;\n alignment?: Alignment;\n media?: MediaConfig;\n}\n\n/**\n * Print key-value options\n */\nexport interface PrintKeyValueOptions {\n fontSize?: FontSize;\n bold?: boolean;\n media?: MediaConfig;\n}\n\n/**\n * Print receipt options\n */\nexport interface PrintReceiptOptions {\n media?: MediaConfig;\n copies?: number;\n}\n"]}