@simplymobile/capacitor-bixolon-printer 8.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.
- package/Package.swift +28 -0
- package/README.md +257 -0
- package/SimplymobileCapacitorBixolonPrinter.podspec +17 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/pl/simplymobile/plugins/bixolonprinter/BixolonPrinterPlugin.java +725 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +315 -0
- package/dist/esm/definitions.d.ts +117 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +37 -0
- package/dist/esm/web.js +46 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +60 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +63 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/BixolonPrinterPlugin/BixolonPrinter.swift +8 -0
- package/ios/Sources/BixolonPrinterPlugin/BixolonPrinterPlugin.swift +73 -0
- package/ios/Tests/BixolonPrinterPluginTests/BixolonPrinterTests.swift +25 -0
- package/package.json +83 -0
|
File without changes
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "BixolonPrinterPlugin",
|
|
4
|
+
"slug": "bixolonprinterplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "checkPermissions",
|
|
10
|
+
"signature": "() => Promise<PermissionStatus>",
|
|
11
|
+
"parameters": [],
|
|
12
|
+
"returns": "Promise<PermissionStatus>",
|
|
13
|
+
"tags": [],
|
|
14
|
+
"docs": "Check the current Bluetooth permission status.",
|
|
15
|
+
"complexTypes": [
|
|
16
|
+
"PermissionStatus"
|
|
17
|
+
],
|
|
18
|
+
"slug": "checkpermissions"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "requestPermissions",
|
|
22
|
+
"signature": "() => Promise<PermissionStatus>",
|
|
23
|
+
"parameters": [],
|
|
24
|
+
"returns": "Promise<PermissionStatus>",
|
|
25
|
+
"tags": [],
|
|
26
|
+
"docs": "Request the Bluetooth permissions required to discover and connect to printers.",
|
|
27
|
+
"complexTypes": [
|
|
28
|
+
"PermissionStatus"
|
|
29
|
+
],
|
|
30
|
+
"slug": "requestpermissions"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "list",
|
|
34
|
+
"signature": "() => Promise<{ devices: BixolonDevice[]; }>",
|
|
35
|
+
"parameters": [],
|
|
36
|
+
"returns": "Promise<{ devices: BixolonDevice[]; }>",
|
|
37
|
+
"tags": [],
|
|
38
|
+
"docs": "List the Bluetooth devices that are already paired with the system.",
|
|
39
|
+
"complexTypes": [
|
|
40
|
+
"BixolonDevice"
|
|
41
|
+
],
|
|
42
|
+
"slug": "list"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "getStatus",
|
|
46
|
+
"signature": "() => Promise<BixolonStatus>",
|
|
47
|
+
"parameters": [],
|
|
48
|
+
"returns": "Promise<BixolonStatus>",
|
|
49
|
+
"tags": [],
|
|
50
|
+
"docs": "Return the current adapter / connection status.",
|
|
51
|
+
"complexTypes": [
|
|
52
|
+
"BixolonStatus"
|
|
53
|
+
],
|
|
54
|
+
"slug": "getstatus"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "connect",
|
|
58
|
+
"signature": "(options: { name: string; }) => Promise<{ message: string; }>",
|
|
59
|
+
"parameters": [
|
|
60
|
+
{
|
|
61
|
+
"name": "options",
|
|
62
|
+
"docs": "",
|
|
63
|
+
"type": "{ name: string; }"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"returns": "Promise<{ message: string; }>",
|
|
67
|
+
"tags": [],
|
|
68
|
+
"docs": "Connect to a paired printer by its Bluetooth friendly name.",
|
|
69
|
+
"complexTypes": [],
|
|
70
|
+
"slug": "connect"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "disconnect",
|
|
74
|
+
"signature": "() => Promise<void>",
|
|
75
|
+
"parameters": [],
|
|
76
|
+
"returns": "Promise<void>",
|
|
77
|
+
"tags": [],
|
|
78
|
+
"docs": "Close the connection to the currently connected printer.",
|
|
79
|
+
"complexTypes": [],
|
|
80
|
+
"slug": "disconnect"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "printText",
|
|
84
|
+
"signature": "(options: { text: string; }) => Promise<void>",
|
|
85
|
+
"parameters": [
|
|
86
|
+
{
|
|
87
|
+
"name": "options",
|
|
88
|
+
"docs": "",
|
|
89
|
+
"type": "{ text: string; }"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"returns": "Promise<void>",
|
|
93
|
+
"tags": [],
|
|
94
|
+
"docs": "Send raw text to the printer.",
|
|
95
|
+
"complexTypes": [],
|
|
96
|
+
"slug": "printtext"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "printBase64",
|
|
100
|
+
"signature": "(options: { data: string; align?: number; }) => Promise<void>",
|
|
101
|
+
"parameters": [
|
|
102
|
+
{
|
|
103
|
+
"name": "options",
|
|
104
|
+
"docs": "",
|
|
105
|
+
"type": "{ data: string; align?: number | undefined; }"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"returns": "Promise<void>",
|
|
109
|
+
"tags": [
|
|
110
|
+
{
|
|
111
|
+
"name": "param",
|
|
112
|
+
"text": "options.align 0 = left, 1 = center, 2 = right (ignored for the `bixolon` brand)."
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"docs": "Print an image provided as a Base64 string.",
|
|
116
|
+
"complexTypes": [],
|
|
117
|
+
"slug": "printbase64"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "printImageUrl",
|
|
121
|
+
"signature": "(options: { url: string; align?: number; }) => Promise<void>",
|
|
122
|
+
"parameters": [
|
|
123
|
+
{
|
|
124
|
+
"name": "options",
|
|
125
|
+
"docs": "",
|
|
126
|
+
"type": "{ url: string; align?: number | undefined; }"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"returns": "Promise<void>",
|
|
130
|
+
"tags": [
|
|
131
|
+
{
|
|
132
|
+
"name": "param",
|
|
133
|
+
"text": "options.align 0 = left, 1 = center, 2 = right."
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"docs": "Print an image loaded from a local file path.",
|
|
137
|
+
"complexTypes": [],
|
|
138
|
+
"slug": "printimageurl"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "printPOSCommand",
|
|
142
|
+
"signature": "(options: { command: string; }) => Promise<void>",
|
|
143
|
+
"parameters": [
|
|
144
|
+
{
|
|
145
|
+
"name": "options",
|
|
146
|
+
"docs": "",
|
|
147
|
+
"type": "{ command: string; }"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"returns": "Promise<void>",
|
|
151
|
+
"tags": [],
|
|
152
|
+
"docs": "Send a raw ESC/POS command encoded as a hex string.",
|
|
153
|
+
"complexTypes": [],
|
|
154
|
+
"slug": "printposcommand"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "printQRCode",
|
|
158
|
+
"signature": "(options: { text: string; }) => Promise<void>",
|
|
159
|
+
"parameters": [
|
|
160
|
+
{
|
|
161
|
+
"name": "options",
|
|
162
|
+
"docs": "",
|
|
163
|
+
"type": "{ text: string; }"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"returns": "Promise<void>",
|
|
167
|
+
"tags": [],
|
|
168
|
+
"docs": "Print a QR code (currently sends the raw string to the printer).",
|
|
169
|
+
"complexTypes": [],
|
|
170
|
+
"slug": "printqrcode"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "cutPaper",
|
|
174
|
+
"signature": "() => Promise<void>",
|
|
175
|
+
"parameters": [],
|
|
176
|
+
"returns": "Promise<void>",
|
|
177
|
+
"tags": [],
|
|
178
|
+
"docs": "Send the paper-cut command to the printer.",
|
|
179
|
+
"complexTypes": [],
|
|
180
|
+
"slug": "cutpaper"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "setBrand",
|
|
184
|
+
"signature": "(options: { brand: string; }) => Promise<void>",
|
|
185
|
+
"parameters": [
|
|
186
|
+
{
|
|
187
|
+
"name": "options",
|
|
188
|
+
"docs": "",
|
|
189
|
+
"type": "{ brand: string; }"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"returns": "Promise<void>",
|
|
193
|
+
"tags": [],
|
|
194
|
+
"docs": "Set the printer brand. Use `bixolon` to skip alignment commands that some Bixolon models reject.",
|
|
195
|
+
"complexTypes": [],
|
|
196
|
+
"slug": "setbrand"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"properties": []
|
|
200
|
+
},
|
|
201
|
+
"interfaces": [
|
|
202
|
+
{
|
|
203
|
+
"name": "PermissionStatus",
|
|
204
|
+
"slug": "permissionstatus",
|
|
205
|
+
"docs": "",
|
|
206
|
+
"tags": [],
|
|
207
|
+
"methods": [],
|
|
208
|
+
"properties": [
|
|
209
|
+
{
|
|
210
|
+
"name": "bluetooth",
|
|
211
|
+
"tags": [],
|
|
212
|
+
"docs": "Permission state for Bluetooth (BLUETOOTH_CONNECT / BLUETOOTH_SCAN on Android 12+).",
|
|
213
|
+
"complexTypes": [
|
|
214
|
+
"BluetoothPermissionState"
|
|
215
|
+
],
|
|
216
|
+
"type": "BluetoothPermissionState"
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "BixolonDevice",
|
|
222
|
+
"slug": "bixolondevice",
|
|
223
|
+
"docs": "",
|
|
224
|
+
"tags": [],
|
|
225
|
+
"methods": [],
|
|
226
|
+
"properties": [
|
|
227
|
+
{
|
|
228
|
+
"name": "name",
|
|
229
|
+
"tags": [],
|
|
230
|
+
"docs": "Bluetooth friendly name of the paired device.",
|
|
231
|
+
"complexTypes": [],
|
|
232
|
+
"type": "string"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "address",
|
|
236
|
+
"tags": [],
|
|
237
|
+
"docs": "Bluetooth MAC address of the paired device.",
|
|
238
|
+
"complexTypes": [],
|
|
239
|
+
"type": "string"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "type",
|
|
243
|
+
"tags": [],
|
|
244
|
+
"docs": "Bluetooth device type (see `BluetoothDevice.getType()` on Android).",
|
|
245
|
+
"complexTypes": [],
|
|
246
|
+
"type": "number"
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "BixolonStatus",
|
|
252
|
+
"slug": "bixolonstatus",
|
|
253
|
+
"docs": "",
|
|
254
|
+
"tags": [],
|
|
255
|
+
"methods": [],
|
|
256
|
+
"properties": [
|
|
257
|
+
{
|
|
258
|
+
"name": "enabled",
|
|
259
|
+
"tags": [],
|
|
260
|
+
"docs": "Whether the Bluetooth adapter is enabled.",
|
|
261
|
+
"complexTypes": [],
|
|
262
|
+
"type": "boolean"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "connected",
|
|
266
|
+
"tags": [],
|
|
267
|
+
"docs": "Whether there is an active connection to a printer.",
|
|
268
|
+
"complexTypes": [],
|
|
269
|
+
"type": "boolean"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "name",
|
|
273
|
+
"tags": [],
|
|
274
|
+
"docs": "Name of the connected device (only when `connected` is `true`).",
|
|
275
|
+
"complexTypes": [],
|
|
276
|
+
"type": "string | undefined"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "address",
|
|
280
|
+
"tags": [],
|
|
281
|
+
"docs": "Address of the connected device (only when `connected` is `true`).",
|
|
282
|
+
"complexTypes": [],
|
|
283
|
+
"type": "string | undefined"
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
"enums": [],
|
|
289
|
+
"typeAliases": [
|
|
290
|
+
{
|
|
291
|
+
"name": "BluetoothPermissionState",
|
|
292
|
+
"slug": "bluetoothpermissionstate",
|
|
293
|
+
"docs": "",
|
|
294
|
+
"types": [
|
|
295
|
+
{
|
|
296
|
+
"text": "'granted'",
|
|
297
|
+
"complexTypes": []
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"text": "'denied'",
|
|
301
|
+
"complexTypes": []
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"text": "'prompt'",
|
|
305
|
+
"complexTypes": []
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"text": "'prompt-with-rationale'",
|
|
309
|
+
"complexTypes": []
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"pluginConfigs": []
|
|
315
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export interface BixolonDevice {
|
|
2
|
+
/**
|
|
3
|
+
* Bluetooth friendly name of the paired device.
|
|
4
|
+
*/
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* Bluetooth MAC address of the paired device.
|
|
8
|
+
*/
|
|
9
|
+
address: string;
|
|
10
|
+
/**
|
|
11
|
+
* Bluetooth device type (see `BluetoothDevice.getType()` on Android).
|
|
12
|
+
*/
|
|
13
|
+
type: number;
|
|
14
|
+
}
|
|
15
|
+
export interface BixolonStatus {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the Bluetooth adapter is enabled.
|
|
18
|
+
*/
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether there is an active connection to a printer.
|
|
22
|
+
*/
|
|
23
|
+
connected: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Name of the connected device (only when `connected` is `true`).
|
|
26
|
+
*/
|
|
27
|
+
name?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Address of the connected device (only when `connected` is `true`).
|
|
30
|
+
*/
|
|
31
|
+
address?: string;
|
|
32
|
+
}
|
|
33
|
+
export type BluetoothPermissionState = 'granted' | 'denied' | 'prompt' | 'prompt-with-rationale';
|
|
34
|
+
export interface PermissionStatus {
|
|
35
|
+
/**
|
|
36
|
+
* Permission state for Bluetooth (BLUETOOTH_CONNECT / BLUETOOTH_SCAN on Android 12+).
|
|
37
|
+
*/
|
|
38
|
+
bluetooth: BluetoothPermissionState;
|
|
39
|
+
}
|
|
40
|
+
export interface BixolonPrinterPlugin {
|
|
41
|
+
/**
|
|
42
|
+
* Check the current Bluetooth permission status.
|
|
43
|
+
*/
|
|
44
|
+
checkPermissions(): Promise<PermissionStatus>;
|
|
45
|
+
/**
|
|
46
|
+
* Request the Bluetooth permissions required to discover and connect to printers.
|
|
47
|
+
*/
|
|
48
|
+
requestPermissions(): Promise<PermissionStatus>;
|
|
49
|
+
/**
|
|
50
|
+
* List the Bluetooth devices that are already paired with the system.
|
|
51
|
+
*/
|
|
52
|
+
list(): Promise<{
|
|
53
|
+
devices: BixolonDevice[];
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Return the current adapter / connection status.
|
|
57
|
+
*/
|
|
58
|
+
getStatus(): Promise<BixolonStatus>;
|
|
59
|
+
/**
|
|
60
|
+
* Connect to a paired printer by its Bluetooth friendly name.
|
|
61
|
+
*/
|
|
62
|
+
connect(options: {
|
|
63
|
+
name: string;
|
|
64
|
+
}): Promise<{
|
|
65
|
+
message: string;
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Close the connection to the currently connected printer.
|
|
69
|
+
*/
|
|
70
|
+
disconnect(): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Send raw text to the printer.
|
|
73
|
+
*/
|
|
74
|
+
printText(options: {
|
|
75
|
+
text: string;
|
|
76
|
+
}): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Print an image provided as a Base64 string.
|
|
79
|
+
*
|
|
80
|
+
* @param options.align 0 = left, 1 = center, 2 = right (ignored for the `bixolon` brand).
|
|
81
|
+
*/
|
|
82
|
+
printBase64(options: {
|
|
83
|
+
data: string;
|
|
84
|
+
align?: number;
|
|
85
|
+
}): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Print an image loaded from a local file path.
|
|
88
|
+
*
|
|
89
|
+
* @param options.align 0 = left, 1 = center, 2 = right.
|
|
90
|
+
*/
|
|
91
|
+
printImageUrl(options: {
|
|
92
|
+
url: string;
|
|
93
|
+
align?: number;
|
|
94
|
+
}): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Send a raw ESC/POS command encoded as a hex string.
|
|
97
|
+
*/
|
|
98
|
+
printPOSCommand(options: {
|
|
99
|
+
command: string;
|
|
100
|
+
}): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Print a QR code (currently sends the raw string to the printer).
|
|
103
|
+
*/
|
|
104
|
+
printQRCode(options: {
|
|
105
|
+
text: string;
|
|
106
|
+
}): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Send the paper-cut command to the printer.
|
|
109
|
+
*/
|
|
110
|
+
cutPaper(): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Set the printer brand. Use `bixolon` to skip alignment commands that some Bixolon models reject.
|
|
113
|
+
*/
|
|
114
|
+
setBrand(options: {
|
|
115
|
+
brand: string;
|
|
116
|
+
}): Promise<void>;
|
|
117
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface BixolonDevice {\n /**\n * Bluetooth friendly name of the paired device.\n */\n name: string;\n /**\n * Bluetooth MAC address of the paired device.\n */\n address: string;\n /**\n * Bluetooth device type (see `BluetoothDevice.getType()` on Android).\n */\n type: number;\n}\n\nexport interface BixolonStatus {\n /**\n * Whether the Bluetooth adapter is enabled.\n */\n enabled: boolean;\n /**\n * Whether there is an active connection to a printer.\n */\n connected: boolean;\n /**\n * Name of the connected device (only when `connected` is `true`).\n */\n name?: string;\n /**\n * Address of the connected device (only when `connected` is `true`).\n */\n address?: string;\n}\n\nexport type BluetoothPermissionState = 'granted' | 'denied' | 'prompt' | 'prompt-with-rationale';\n\nexport interface PermissionStatus {\n /**\n * Permission state for Bluetooth (BLUETOOTH_CONNECT / BLUETOOTH_SCAN on Android 12+).\n */\n bluetooth: BluetoothPermissionState;\n}\n\nexport interface BixolonPrinterPlugin {\n /**\n * Check the current Bluetooth permission status.\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request the Bluetooth permissions required to discover and connect to printers.\n */\n requestPermissions(): Promise<PermissionStatus>;\n\n /**\n * List the Bluetooth devices that are already paired with the system.\n */\n list(): Promise<{ devices: BixolonDevice[] }>;\n\n /**\n * Return the current adapter / connection status.\n */\n getStatus(): Promise<BixolonStatus>;\n\n /**\n * Connect to a paired printer by its Bluetooth friendly name.\n */\n connect(options: { name: string }): Promise<{ message: string }>;\n\n /**\n * Close the connection to the currently connected printer.\n */\n disconnect(): Promise<void>;\n\n /**\n * Send raw text to the printer.\n */\n printText(options: { text: string }): Promise<void>;\n\n /**\n * Print an image provided as a Base64 string.\n *\n * @param options.align 0 = left, 1 = center, 2 = right (ignored for the `bixolon` brand).\n */\n printBase64(options: { data: string; align?: number }): Promise<void>;\n\n /**\n * Print an image loaded from a local file path.\n *\n * @param options.align 0 = left, 1 = center, 2 = right.\n */\n printImageUrl(options: { url: string; align?: number }): Promise<void>;\n\n /**\n * Send a raw ESC/POS command encoded as a hex string.\n */\n printPOSCommand(options: { command: string }): Promise<void>;\n\n /**\n * Print a QR code (currently sends the raw string to the printer).\n */\n printQRCode(options: { text: string }): Promise<void>;\n\n /**\n * Send the paper-cut command to the printer.\n */\n cutPaper(): Promise<void>;\n\n /**\n * Set the printer brand. Use `bixolon` to skip alignment commands that some Bixolon models reject.\n */\n setBrand(options: { brand: string }): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const BixolonPrinter = registerPlugin('BixolonPrinter', {
|
|
3
|
+
web: () => import('./web').then(m => new m.BixolonPrinterWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { BixolonPrinter };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,cAAc,GAAG,cAAc,CAAuB,gBAAgB,EAAE;IAC5E,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;CAChE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { BixolonPrinterPlugin } from './definitions';\n\nconst BixolonPrinter = registerPlugin<BixolonPrinterPlugin>('BixolonPrinter', {\n web: () => import('./web').then(m => new m.BixolonPrinterWeb()),\n});\n\nexport * from './definitions';\nexport { BixolonPrinter };\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { BixolonDevice, BixolonPrinterPlugin, BixolonStatus, PermissionStatus } from './definitions';
|
|
3
|
+
export declare class BixolonPrinterWeb extends WebPlugin implements BixolonPrinterPlugin {
|
|
4
|
+
checkPermissions(): Promise<PermissionStatus>;
|
|
5
|
+
requestPermissions(): Promise<PermissionStatus>;
|
|
6
|
+
list(): Promise<{
|
|
7
|
+
devices: BixolonDevice[];
|
|
8
|
+
}>;
|
|
9
|
+
getStatus(): Promise<BixolonStatus>;
|
|
10
|
+
connect(options: {
|
|
11
|
+
name: string;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
message: string;
|
|
14
|
+
}>;
|
|
15
|
+
disconnect(): Promise<void>;
|
|
16
|
+
printText(options: {
|
|
17
|
+
text: string;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
printBase64(options: {
|
|
20
|
+
data: string;
|
|
21
|
+
align?: number;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
printImageUrl(options: {
|
|
24
|
+
url: string;
|
|
25
|
+
align?: number;
|
|
26
|
+
}): Promise<void>;
|
|
27
|
+
printPOSCommand(options: {
|
|
28
|
+
command: string;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
printQRCode(options: {
|
|
31
|
+
text: string;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
cutPaper(): Promise<void>;
|
|
34
|
+
setBrand(options: {
|
|
35
|
+
brand: string;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
export class BixolonPrinterWeb extends WebPlugin {
|
|
3
|
+
async checkPermissions() {
|
|
4
|
+
return { bluetooth: 'denied' };
|
|
5
|
+
}
|
|
6
|
+
async requestPermissions() {
|
|
7
|
+
return { bluetooth: 'denied' };
|
|
8
|
+
}
|
|
9
|
+
async list() {
|
|
10
|
+
console.log('NOT IMPLEMENTED');
|
|
11
|
+
return { devices: [] };
|
|
12
|
+
}
|
|
13
|
+
async getStatus() {
|
|
14
|
+
console.log('NOT IMPLEMENTED');
|
|
15
|
+
return { enabled: false, connected: false };
|
|
16
|
+
}
|
|
17
|
+
async connect(options) {
|
|
18
|
+
console.log('NOT IMPLEMENTED', options.name);
|
|
19
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
20
|
+
}
|
|
21
|
+
async disconnect() {
|
|
22
|
+
console.log('NOT IMPLEMENTED');
|
|
23
|
+
}
|
|
24
|
+
async printText(options) {
|
|
25
|
+
console.log('NOT IMPLEMENTED', options.text);
|
|
26
|
+
}
|
|
27
|
+
async printBase64(options) {
|
|
28
|
+
console.log('NOT IMPLEMENTED', options.align);
|
|
29
|
+
}
|
|
30
|
+
async printImageUrl(options) {
|
|
31
|
+
console.log('NOT IMPLEMENTED', options.url, options.align);
|
|
32
|
+
}
|
|
33
|
+
async printPOSCommand(options) {
|
|
34
|
+
console.log('NOT IMPLEMENTED', options.command);
|
|
35
|
+
}
|
|
36
|
+
async printQRCode(options) {
|
|
37
|
+
console.log('NOT IMPLEMENTED', options.text);
|
|
38
|
+
}
|
|
39
|
+
async cutPaper() {
|
|
40
|
+
console.log('NOT IMPLEMENTED');
|
|
41
|
+
}
|
|
42
|
+
async setBrand(options) {
|
|
43
|
+
console.log('NOT IMPLEMENTED', options.brand);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAC9C,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CA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AAiB,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { BixolonDevice, BixolonPrinterPlugin, BixolonStatus, PermissionStatus } from './definitions';\n\nexport class BixolonPrinterWeb extends WebPlugin implements BixolonPrinterPlugin {\n async checkPermissions(): Promise<PermissionStatus> {\n return { bluetooth: 'denied' };\n }\n\n async requestPermissions(): Promise<PermissionStatus> {\n return { bluetooth: 'denied' };\n }\n\n async list(): Promise<{ devices: BixolonDevice[] }> {\n console.log('NOT IMPLEMENTED');\n return { devices: [] };\n }\n\n async getStatus(): Promise<BixolonStatus> {\n console.log('NOT IMPLEMENTED');\n return { enabled: false, connected: false };\n }\n\n async connect(options: { name: string }): Promise<{ message: string }> {\n console.log('NOT IMPLEMENTED', options.name);\n return { message: 'NOT IMPLEMENTED' };\n }\n\n async disconnect(): Promise<void> {\n console.log('NOT IMPLEMENTED');\n }\n\n async printText(options: { text: string }): Promise<void> {\n console.log('NOT IMPLEMENTED', options.text);\n }\n\n async printBase64(options: { data: string; align?: number }): Promise<void> {\n console.log('NOT IMPLEMENTED', options.align);\n }\n\n async printImageUrl(options: { url: string; align?: number }): Promise<void> {\n console.log('NOT IMPLEMENTED', options.url, options.align);\n }\n\n async printPOSCommand(options: { command: string }): Promise<void> {\n console.log('NOT IMPLEMENTED', options.command);\n }\n\n async printQRCode(options: { text: string }): Promise<void> {\n console.log('NOT IMPLEMENTED', options.text);\n }\n\n async cutPaper(): Promise<void> {\n console.log('NOT IMPLEMENTED');\n }\n\n async setBrand(options: { brand: string }): Promise<void> {\n console.log('NOT IMPLEMENTED', options.brand);\n }\n}\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@capacitor/core');
|
|
4
|
+
|
|
5
|
+
const BixolonPrinter = core.registerPlugin('BixolonPrinter', {
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.BixolonPrinterWeb()),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
class BixolonPrinterWeb extends core.WebPlugin {
|
|
10
|
+
async checkPermissions() {
|
|
11
|
+
return { bluetooth: 'denied' };
|
|
12
|
+
}
|
|
13
|
+
async requestPermissions() {
|
|
14
|
+
return { bluetooth: 'denied' };
|
|
15
|
+
}
|
|
16
|
+
async list() {
|
|
17
|
+
console.log('NOT IMPLEMENTED');
|
|
18
|
+
return { devices: [] };
|
|
19
|
+
}
|
|
20
|
+
async getStatus() {
|
|
21
|
+
console.log('NOT IMPLEMENTED');
|
|
22
|
+
return { enabled: false, connected: false };
|
|
23
|
+
}
|
|
24
|
+
async connect(options) {
|
|
25
|
+
console.log('NOT IMPLEMENTED', options.name);
|
|
26
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
27
|
+
}
|
|
28
|
+
async disconnect() {
|
|
29
|
+
console.log('NOT IMPLEMENTED');
|
|
30
|
+
}
|
|
31
|
+
async printText(options) {
|
|
32
|
+
console.log('NOT IMPLEMENTED', options.text);
|
|
33
|
+
}
|
|
34
|
+
async printBase64(options) {
|
|
35
|
+
console.log('NOT IMPLEMENTED', options.align);
|
|
36
|
+
}
|
|
37
|
+
async printImageUrl(options) {
|
|
38
|
+
console.log('NOT IMPLEMENTED', options.url, options.align);
|
|
39
|
+
}
|
|
40
|
+
async printPOSCommand(options) {
|
|
41
|
+
console.log('NOT IMPLEMENTED', options.command);
|
|
42
|
+
}
|
|
43
|
+
async printQRCode(options) {
|
|
44
|
+
console.log('NOT IMPLEMENTED', options.text);
|
|
45
|
+
}
|
|
46
|
+
async cutPaper() {
|
|
47
|
+
console.log('NOT IMPLEMENTED');
|
|
48
|
+
}
|
|
49
|
+
async setBrand(options) {
|
|
50
|
+
console.log('NOT IMPLEMENTED', options.brand);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
55
|
+
__proto__: null,
|
|
56
|
+
BixolonPrinterWeb: BixolonPrinterWeb
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
exports.BixolonPrinter = BixolonPrinter;
|
|
60
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst BixolonPrinter = registerPlugin('BixolonPrinter', {\n web: () => import('./web').then(m => new m.BixolonPrinterWeb()),\n});\nexport * from './definitions';\nexport { BixolonPrinter };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BixolonPrinterWeb extends WebPlugin {\n async checkPermissions() {\n return { bluetooth: 'denied' };\n }\n async requestPermissions() {\n return { bluetooth: 'denied' };\n }\n async list() {\n console.log('NOT IMPLEMENTED');\n return { devices: [] };\n }\n async getStatus() {\n console.log('NOT IMPLEMENTED');\n return { enabled: false, connected: false };\n }\n async connect(options) {\n console.log('NOT IMPLEMENTED', options.name);\n return { message: 'NOT IMPLEMENTED' };\n }\n async disconnect() {\n console.log('NOT IMPLEMENTED');\n }\n async printText(options) {\n console.log('NOT IMPLEMENTED', options.text);\n }\n async printBase64(options) {\n console.log('NOT IMPLEMENTED', options.align);\n }\n async printImageUrl(options) {\n console.log('NOT IMPLEMENTED', options.url, options.align);\n }\n async printPOSCommand(options) {\n console.log('NOT IMPLEMENTED', options.command);\n }\n async printQRCode(options) {\n console.log('NOT IMPLEMENTED', options.text);\n }\n async cutPaper() {\n console.log('NOT IMPLEMENTED');\n }\n async setBrand(options) {\n console.log('NOT IMPLEMENTED', options.brand);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,cAAc,GAAGA,mBAAc,CAAC,gBAAgB,EAAE;AACxD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CA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