@simplymobile/capacitor-bixolon-sdk-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 +411 -0
- package/SimplymobileCapacitorBixolonSdkPrinter.podspec +17 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +19 -0
- package/android/src/main/java/pl/simplymobile/plugins/bixolonsdkprinter/BixolonSdkPrinterPlugin.java +983 -0
- package/android/src/main/libs/BixolonPrinter.jar +0 -0
- package/android/src/main/res/xml/device_filter.xml +7 -0
- package/dist/docs.json +714 -0
- package/dist/esm/definitions.d.ts +205 -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 +49 -0
- package/dist/esm/web.js +53 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +67 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +70 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/BixolonSdkPrinterPlugin/BixolonSdkPrinter.swift +8 -0
- package/ios/Sources/BixolonSdkPrinterPlugin/BixolonSdkPrinterPlugin.swift +78 -0
- package/ios/Tests/BixolonSdkPrinterPluginTests/BixolonSdkPrinterTests.swift +25 -0
- package/package.json +84 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
export type BluetoothPermissionState = 'granted' | 'denied' | 'prompt' | 'prompt-with-rationale';
|
|
3
|
+
export interface PermissionStatus {
|
|
4
|
+
/**
|
|
5
|
+
* Permission state for Bluetooth (BLUETOOTH_CONNECT / BLUETOOTH_SCAN on Android 12+).
|
|
6
|
+
*/
|
|
7
|
+
bluetooth: BluetoothPermissionState;
|
|
8
|
+
}
|
|
9
|
+
export type TextAlign = 'left' | 'center' | 'right';
|
|
10
|
+
export type FontType = 'A' | 'B' | 'C';
|
|
11
|
+
export type FontStyle = 'default' | 'bold' | 'underline' | 'underline2' | 'reversed';
|
|
12
|
+
/**
|
|
13
|
+
* Shared print configuration. All fields are optional; sensible defaults are applied natively
|
|
14
|
+
* (`lineFeed: 0`, `formFeed: true`, `autoConnect: true`, `toastMessage: true`, `codePage: 16`).
|
|
15
|
+
*/
|
|
16
|
+
export interface BixolonSettings {
|
|
17
|
+
/**
|
|
18
|
+
* Number of empty lines to feed after printing (used when `formFeed` is `false`).
|
|
19
|
+
*/
|
|
20
|
+
lineFeed?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to perform a form feed after printing instead of a line feed.
|
|
23
|
+
*/
|
|
24
|
+
formFeed?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Android only. When `true`, connect to the first paired printer automatically; otherwise show
|
|
27
|
+
* a picker dialog.
|
|
28
|
+
*/
|
|
29
|
+
autoConnect?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Android only. Whether the underlying SDK is allowed to show toast messages.
|
|
32
|
+
*/
|
|
33
|
+
toastMessage?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Single-byte code page used for text printing.
|
|
36
|
+
*/
|
|
37
|
+
codePage?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A single line of text to print. Prefix `text` with `[hr]<char>` (e.g. `"[hr]="`) to draw a
|
|
41
|
+
* horizontal rule filling the paper width.
|
|
42
|
+
*/
|
|
43
|
+
export interface TextLine {
|
|
44
|
+
text: string;
|
|
45
|
+
textAlign?: TextAlign;
|
|
46
|
+
/**
|
|
47
|
+
* Horizontal text size, 0-7.
|
|
48
|
+
*/
|
|
49
|
+
textWidth?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Vertical text size, 0-7.
|
|
52
|
+
*/
|
|
53
|
+
textHeight?: number;
|
|
54
|
+
fontType?: FontType;
|
|
55
|
+
fontStyle?: FontStyle;
|
|
56
|
+
}
|
|
57
|
+
export interface BarCodeData {
|
|
58
|
+
text: string;
|
|
59
|
+
alignment?: TextAlign;
|
|
60
|
+
width?: number;
|
|
61
|
+
height?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Bar-code symbology (e.g. `73` for CODE128). See `BarCodeSystem` in the README.
|
|
64
|
+
*/
|
|
65
|
+
barcodeSystem: number;
|
|
66
|
+
/**
|
|
67
|
+
* Position of the human-readable characters (0 = none, 1 = above, 2 = below, 3 = both).
|
|
68
|
+
*/
|
|
69
|
+
characterPosition?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface QRCodeData {
|
|
72
|
+
text: string;
|
|
73
|
+
alignment?: TextAlign;
|
|
74
|
+
/**
|
|
75
|
+
* QR module size, 1-8.
|
|
76
|
+
*/
|
|
77
|
+
size?: number;
|
|
78
|
+
/**
|
|
79
|
+
* QR model (`49` = model 1, `50` = model 2).
|
|
80
|
+
*/
|
|
81
|
+
model?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface BixolonDeviceStatus {
|
|
84
|
+
printerName?: string;
|
|
85
|
+
printerAddress?: string;
|
|
86
|
+
cover?: string;
|
|
87
|
+
paper?: string;
|
|
88
|
+
battery?: string;
|
|
89
|
+
firmwareVersion?: string;
|
|
90
|
+
manufacturer?: string;
|
|
91
|
+
printerModel?: string;
|
|
92
|
+
codePage?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface MsrData {
|
|
95
|
+
msrTrack1: string;
|
|
96
|
+
msrTrack2: string;
|
|
97
|
+
msrTrack3: string;
|
|
98
|
+
}
|
|
99
|
+
export interface ConnectionData {
|
|
100
|
+
isConnected: boolean;
|
|
101
|
+
message: string | null;
|
|
102
|
+
}
|
|
103
|
+
export interface BixolonSdkPrinterPlugin {
|
|
104
|
+
/**
|
|
105
|
+
* Check the current Bluetooth permission status.
|
|
106
|
+
*/
|
|
107
|
+
checkPermissions(): Promise<PermissionStatus>;
|
|
108
|
+
/**
|
|
109
|
+
* Request the Bluetooth permissions required to connect to printers.
|
|
110
|
+
*/
|
|
111
|
+
requestPermissions(): Promise<PermissionStatus>;
|
|
112
|
+
/**
|
|
113
|
+
* Print a list of text lines. Connects to the printer, prints, cuts the paper and disconnects.
|
|
114
|
+
*/
|
|
115
|
+
printText(options: {
|
|
116
|
+
lines: TextLine[];
|
|
117
|
+
config?: BixolonSettings;
|
|
118
|
+
}): Promise<{
|
|
119
|
+
message: string;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* Print a 1D bar code.
|
|
123
|
+
*/
|
|
124
|
+
printBarCode(options: {
|
|
125
|
+
data: BarCodeData;
|
|
126
|
+
config?: BixolonSettings;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
message: string;
|
|
129
|
+
}>;
|
|
130
|
+
/**
|
|
131
|
+
* Print a QR code.
|
|
132
|
+
*/
|
|
133
|
+
printQRCode(options: {
|
|
134
|
+
data: QRCodeData;
|
|
135
|
+
config?: BixolonSettings;
|
|
136
|
+
}): Promise<{
|
|
137
|
+
message: string;
|
|
138
|
+
}>;
|
|
139
|
+
/**
|
|
140
|
+
* Print a Base64-encoded bitmap image.
|
|
141
|
+
*
|
|
142
|
+
* @param options.alignment Image alignment (`-11` as-is, `-1` left, `-2` center, `-3` right).
|
|
143
|
+
*/
|
|
144
|
+
printBitmap(options: {
|
|
145
|
+
base64Image: string;
|
|
146
|
+
width?: number;
|
|
147
|
+
brightness?: number;
|
|
148
|
+
alignment?: number;
|
|
149
|
+
}): Promise<{
|
|
150
|
+
message: string;
|
|
151
|
+
}>;
|
|
152
|
+
/**
|
|
153
|
+
* Feed/form-feed and cut the paper.
|
|
154
|
+
*/
|
|
155
|
+
cutPaper(options?: {
|
|
156
|
+
config?: BixolonSettings;
|
|
157
|
+
}): Promise<{
|
|
158
|
+
message: string;
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* Return the connected printer status. When `printStatus` is `true` the status is also printed.
|
|
162
|
+
*/
|
|
163
|
+
getStatus(options?: {
|
|
164
|
+
printStatus?: boolean;
|
|
165
|
+
config?: BixolonSettings;
|
|
166
|
+
}): Promise<BixolonDeviceStatus>;
|
|
167
|
+
/**
|
|
168
|
+
* Reconnect to the (first paired) printer.
|
|
169
|
+
*/
|
|
170
|
+
reconnect(): Promise<{
|
|
171
|
+
message: string;
|
|
172
|
+
}>;
|
|
173
|
+
/**
|
|
174
|
+
* Disconnect from the currently connected printer.
|
|
175
|
+
*/
|
|
176
|
+
disconnect(): Promise<void>;
|
|
177
|
+
/**
|
|
178
|
+
* Start listening for magnetic-stripe-reader (MSR) data. Emits `msrData` events.
|
|
179
|
+
*/
|
|
180
|
+
startMsrReaderListener(): Promise<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Stop listening for MSR data.
|
|
183
|
+
*/
|
|
184
|
+
stopMsrReaderListener(): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Start listening for connection-state changes. Emits `connectionChanged` events.
|
|
187
|
+
*/
|
|
188
|
+
startConnectionListener(): Promise<void>;
|
|
189
|
+
/**
|
|
190
|
+
* Stop listening for connection-state changes.
|
|
191
|
+
*/
|
|
192
|
+
stopConnectionListener(): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Listen for MSR (magnetic stripe reader) track data.
|
|
195
|
+
*/
|
|
196
|
+
addListener(eventName: 'msrData', listenerFunc: (data: MsrData) => void): Promise<PluginListenerHandle>;
|
|
197
|
+
/**
|
|
198
|
+
* Listen for printer connection-state changes.
|
|
199
|
+
*/
|
|
200
|
+
addListener(eventName: 'connectionChanged', listenerFunc: (data: ConnectionData) => void): Promise<PluginListenerHandle>;
|
|
201
|
+
/**
|
|
202
|
+
* Remove all registered listeners for this plugin.
|
|
203
|
+
*/
|
|
204
|
+
removeAllListeners(): Promise<void>;
|
|
205
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\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 type TextAlign = 'left' | 'center' | 'right';\nexport type FontType = 'A' | 'B' | 'C';\nexport type FontStyle = 'default' | 'bold' | 'underline' | 'underline2' | 'reversed';\n\n/**\n * Shared print configuration. All fields are optional; sensible defaults are applied natively\n * (`lineFeed: 0`, `formFeed: true`, `autoConnect: true`, `toastMessage: true`, `codePage: 16`).\n */\nexport interface BixolonSettings {\n /**\n * Number of empty lines to feed after printing (used when `formFeed` is `false`).\n */\n lineFeed?: number;\n /**\n * Whether to perform a form feed after printing instead of a line feed.\n */\n formFeed?: boolean;\n /**\n * Android only. When `true`, connect to the first paired printer automatically; otherwise show\n * a picker dialog.\n */\n autoConnect?: boolean;\n /**\n * Android only. Whether the underlying SDK is allowed to show toast messages.\n */\n toastMessage?: boolean;\n /**\n * Single-byte code page used for text printing.\n */\n codePage?: number;\n}\n\n/**\n * A single line of text to print. Prefix `text` with `[hr]<char>` (e.g. `\"[hr]=\"`) to draw a\n * horizontal rule filling the paper width.\n */\nexport interface TextLine {\n text: string;\n textAlign?: TextAlign;\n /**\n * Horizontal text size, 0-7.\n */\n textWidth?: number;\n /**\n * Vertical text size, 0-7.\n */\n textHeight?: number;\n fontType?: FontType;\n fontStyle?: FontStyle;\n}\n\nexport interface BarCodeData {\n text: string;\n alignment?: TextAlign;\n width?: number;\n height?: number;\n /**\n * Bar-code symbology (e.g. `73` for CODE128). See `BarCodeSystem` in the README.\n */\n barcodeSystem: number;\n /**\n * Position of the human-readable characters (0 = none, 1 = above, 2 = below, 3 = both).\n */\n characterPosition?: number;\n}\n\nexport interface QRCodeData {\n text: string;\n alignment?: TextAlign;\n /**\n * QR module size, 1-8.\n */\n size?: number;\n /**\n * QR model (`49` = model 1, `50` = model 2).\n */\n model?: number;\n}\n\nexport interface BixolonDeviceStatus {\n printerName?: string;\n printerAddress?: string;\n cover?: string;\n paper?: string;\n battery?: string;\n firmwareVersion?: string;\n manufacturer?: string;\n printerModel?: string;\n codePage?: string;\n}\n\nexport interface MsrData {\n msrTrack1: string;\n msrTrack2: string;\n msrTrack3: string;\n}\n\nexport interface ConnectionData {\n isConnected: boolean;\n message: string | null;\n}\n\nexport interface BixolonSdkPrinterPlugin {\n /**\n * Check the current Bluetooth permission status.\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request the Bluetooth permissions required to connect to printers.\n */\n requestPermissions(): Promise<PermissionStatus>;\n\n /**\n * Print a list of text lines. Connects to the printer, prints, cuts the paper and disconnects.\n */\n printText(options: { lines: TextLine[]; config?: BixolonSettings }): Promise<{ message: string }>;\n\n /**\n * Print a 1D bar code.\n */\n printBarCode(options: { data: BarCodeData; config?: BixolonSettings }): Promise<{ message: string }>;\n\n /**\n * Print a QR code.\n */\n printQRCode(options: { data: QRCodeData; config?: BixolonSettings }): Promise<{ message: string }>;\n\n /**\n * Print a Base64-encoded bitmap image.\n *\n * @param options.alignment Image alignment (`-11` as-is, `-1` left, `-2` center, `-3` right).\n */\n printBitmap(options: {\n base64Image: string;\n width?: number;\n brightness?: number;\n alignment?: number;\n }): Promise<{ message: string }>;\n\n /**\n * Feed/form-feed and cut the paper.\n */\n cutPaper(options?: { config?: BixolonSettings }): Promise<{ message: string }>;\n\n /**\n * Return the connected printer status. When `printStatus` is `true` the status is also printed.\n */\n getStatus(options?: { printStatus?: boolean; config?: BixolonSettings }): Promise<BixolonDeviceStatus>;\n\n /**\n * Reconnect to the (first paired) printer.\n */\n reconnect(): Promise<{ message: string }>;\n\n /**\n * Disconnect from the currently connected printer.\n */\n disconnect(): Promise<void>;\n\n /**\n * Start listening for magnetic-stripe-reader (MSR) data. Emits `msrData` events.\n */\n startMsrReaderListener(): Promise<void>;\n\n /**\n * Stop listening for MSR data.\n */\n stopMsrReaderListener(): Promise<void>;\n\n /**\n * Start listening for connection-state changes. Emits `connectionChanged` events.\n */\n startConnectionListener(): Promise<void>;\n\n /**\n * Stop listening for connection-state changes.\n */\n stopConnectionListener(): Promise<void>;\n\n /**\n * Listen for MSR (magnetic stripe reader) track data.\n */\n addListener(eventName: 'msrData', listenerFunc: (data: MsrData) => void): Promise<PluginListenerHandle>;\n\n /**\n * Listen for printer connection-state changes.\n */\n addListener(\n eventName: 'connectionChanged',\n listenerFunc: (data: ConnectionData) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Remove all registered listeners for this plugin.\n */\n removeAllListeners(): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const BixolonSdkPrinter = registerPlugin('BixolonSdkPrinter', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.BixolonSdkPrinterWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { BixolonSdkPrinter };
|
|
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,iBAAiB,GAAG,cAAc,CAA0B,mBAAmB,EAAE;IACrF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { BixolonSdkPrinterPlugin } from './definitions';\n\nconst BixolonSdkPrinter = registerPlugin<BixolonSdkPrinterPlugin>('BixolonSdkPrinter', {\n web: () => import('./web').then((m) => new m.BixolonSdkPrinterWeb()),\n});\n\nexport * from './definitions';\nexport { BixolonSdkPrinter };\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { BarCodeData, BixolonDeviceStatus, BixolonSdkPrinterPlugin, BixolonSettings, PermissionStatus, QRCodeData, TextLine } from './definitions';
|
|
3
|
+
export declare class BixolonSdkPrinterWeb extends WebPlugin implements BixolonSdkPrinterPlugin {
|
|
4
|
+
checkPermissions(): Promise<PermissionStatus>;
|
|
5
|
+
requestPermissions(): Promise<PermissionStatus>;
|
|
6
|
+
printText(options: {
|
|
7
|
+
lines: TextLine[];
|
|
8
|
+
config?: BixolonSettings;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
message: string;
|
|
11
|
+
}>;
|
|
12
|
+
printBarCode(options: {
|
|
13
|
+
data: BarCodeData;
|
|
14
|
+
config?: BixolonSettings;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
message: string;
|
|
17
|
+
}>;
|
|
18
|
+
printQRCode(options: {
|
|
19
|
+
data: QRCodeData;
|
|
20
|
+
config?: BixolonSettings;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
message: string;
|
|
23
|
+
}>;
|
|
24
|
+
printBitmap(options: {
|
|
25
|
+
base64Image: string;
|
|
26
|
+
width?: number;
|
|
27
|
+
brightness?: number;
|
|
28
|
+
alignment?: number;
|
|
29
|
+
}): Promise<{
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
cutPaper(options?: {
|
|
33
|
+
config?: BixolonSettings;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
message: string;
|
|
36
|
+
}>;
|
|
37
|
+
getStatus(options?: {
|
|
38
|
+
printStatus?: boolean;
|
|
39
|
+
config?: BixolonSettings;
|
|
40
|
+
}): Promise<BixolonDeviceStatus>;
|
|
41
|
+
reconnect(): Promise<{
|
|
42
|
+
message: string;
|
|
43
|
+
}>;
|
|
44
|
+
disconnect(): Promise<void>;
|
|
45
|
+
startMsrReaderListener(): Promise<void>;
|
|
46
|
+
stopMsrReaderListener(): Promise<void>;
|
|
47
|
+
startConnectionListener(): Promise<void>;
|
|
48
|
+
stopConnectionListener(): Promise<void>;
|
|
49
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
export class BixolonSdkPrinterWeb extends WebPlugin {
|
|
3
|
+
async checkPermissions() {
|
|
4
|
+
return { bluetooth: 'denied' };
|
|
5
|
+
}
|
|
6
|
+
async requestPermissions() {
|
|
7
|
+
return { bluetooth: 'denied' };
|
|
8
|
+
}
|
|
9
|
+
async printText(options) {
|
|
10
|
+
console.log('NOT IMPLEMENTED', options.lines, options.config);
|
|
11
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
12
|
+
}
|
|
13
|
+
async printBarCode(options) {
|
|
14
|
+
console.log('NOT IMPLEMENTED', options.data, options.config);
|
|
15
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
16
|
+
}
|
|
17
|
+
async printQRCode(options) {
|
|
18
|
+
console.log('NOT IMPLEMENTED', options.data, options.config);
|
|
19
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
20
|
+
}
|
|
21
|
+
async printBitmap(options) {
|
|
22
|
+
console.log('NOT IMPLEMENTED', options.base64Image, options.width, options.brightness, options.alignment);
|
|
23
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
24
|
+
}
|
|
25
|
+
async cutPaper(options) {
|
|
26
|
+
console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.config);
|
|
27
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
28
|
+
}
|
|
29
|
+
async getStatus(options) {
|
|
30
|
+
console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.printStatus, options === null || options === void 0 ? void 0 : options.config);
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
async reconnect() {
|
|
34
|
+
console.log('NOT IMPLEMENTED');
|
|
35
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
36
|
+
}
|
|
37
|
+
async disconnect() {
|
|
38
|
+
console.log('NOT IMPLEMENTED');
|
|
39
|
+
}
|
|
40
|
+
async startMsrReaderListener() {
|
|
41
|
+
console.log('NOT IMPLEMENTED');
|
|
42
|
+
}
|
|
43
|
+
async stopMsrReaderListener() {
|
|
44
|
+
console.log('NOT IMPLEMENTED');
|
|
45
|
+
}
|
|
46
|
+
async startConnectionListener() {
|
|
47
|
+
console.log('NOT IMPLEMENTED');
|
|
48
|
+
}
|
|
49
|
+
async stopConnectionListener() {
|
|
50
|
+
console.log('NOT IMPLEMENTED');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# 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;AAY5C,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IACjD,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,SAAS,CAAC,OAAwD;QACtE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAwD;QACzE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7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C;IAED,KAAK,CAAC,qBAAqB;QACzB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACjC,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n BarCodeData,\n BixolonDeviceStatus,\n BixolonSdkPrinterPlugin,\n BixolonSettings,\n PermissionStatus,\n QRCodeData,\n TextLine,\n} from './definitions';\n\nexport class BixolonSdkPrinterWeb extends WebPlugin implements BixolonSdkPrinterPlugin {\n async checkPermissions(): Promise<PermissionStatus> {\n return { bluetooth: 'denied' };\n }\n\n async requestPermissions(): Promise<PermissionStatus> {\n return { bluetooth: 'denied' };\n }\n\n async printText(options: { lines: TextLine[]; config?: BixolonSettings }): Promise<{ message: string }> {\n console.log('NOT IMPLEMENTED', options.lines, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n\n async printBarCode(options: { data: BarCodeData; config?: BixolonSettings }): Promise<{ message: string }> {\n console.log('NOT IMPLEMENTED', options.data, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n\n async printQRCode(options: { data: QRCodeData; config?: BixolonSettings }): Promise<{ message: string }> {\n console.log('NOT IMPLEMENTED', options.data, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n\n async printBitmap(options: {\n base64Image: string;\n width?: number;\n brightness?: number;\n alignment?: number;\n }): Promise<{ message: string }> {\n console.log('NOT IMPLEMENTED', options.base64Image, options.width, options.brightness, options.alignment);\n return { message: 'NOT IMPLEMENTED' };\n }\n\n async cutPaper(options?: { config?: BixolonSettings }): Promise<{ message: string }> {\n console.log('NOT IMPLEMENTED', options?.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n\n async getStatus(options?: { printStatus?: boolean; config?: BixolonSettings }): Promise<BixolonDeviceStatus> {\n console.log('NOT IMPLEMENTED', options?.printStatus, options?.config);\n return {};\n }\n\n async reconnect(): Promise<{ message: string }> {\n console.log('NOT IMPLEMENTED');\n return { message: 'NOT IMPLEMENTED' };\n }\n\n async disconnect(): Promise<void> {\n console.log('NOT IMPLEMENTED');\n }\n\n async startMsrReaderListener(): Promise<void> {\n console.log('NOT IMPLEMENTED');\n }\n\n async stopMsrReaderListener(): Promise<void> {\n console.log('NOT IMPLEMENTED');\n }\n\n async startConnectionListener(): Promise<void> {\n console.log('NOT IMPLEMENTED');\n }\n\n async stopConnectionListener(): Promise<void> {\n console.log('NOT IMPLEMENTED');\n }\n}\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@capacitor/core');
|
|
4
|
+
|
|
5
|
+
const BixolonSdkPrinter = core.registerPlugin('BixolonSdkPrinter', {
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.BixolonSdkPrinterWeb()),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
class BixolonSdkPrinterWeb extends core.WebPlugin {
|
|
10
|
+
async checkPermissions() {
|
|
11
|
+
return { bluetooth: 'denied' };
|
|
12
|
+
}
|
|
13
|
+
async requestPermissions() {
|
|
14
|
+
return { bluetooth: 'denied' };
|
|
15
|
+
}
|
|
16
|
+
async printText(options) {
|
|
17
|
+
console.log('NOT IMPLEMENTED', options.lines, options.config);
|
|
18
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
19
|
+
}
|
|
20
|
+
async printBarCode(options) {
|
|
21
|
+
console.log('NOT IMPLEMENTED', options.data, options.config);
|
|
22
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
23
|
+
}
|
|
24
|
+
async printQRCode(options) {
|
|
25
|
+
console.log('NOT IMPLEMENTED', options.data, options.config);
|
|
26
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
27
|
+
}
|
|
28
|
+
async printBitmap(options) {
|
|
29
|
+
console.log('NOT IMPLEMENTED', options.base64Image, options.width, options.brightness, options.alignment);
|
|
30
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
31
|
+
}
|
|
32
|
+
async cutPaper(options) {
|
|
33
|
+
console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.config);
|
|
34
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
35
|
+
}
|
|
36
|
+
async getStatus(options) {
|
|
37
|
+
console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.printStatus, options === null || options === void 0 ? void 0 : options.config);
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
async reconnect() {
|
|
41
|
+
console.log('NOT IMPLEMENTED');
|
|
42
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
43
|
+
}
|
|
44
|
+
async disconnect() {
|
|
45
|
+
console.log('NOT IMPLEMENTED');
|
|
46
|
+
}
|
|
47
|
+
async startMsrReaderListener() {
|
|
48
|
+
console.log('NOT IMPLEMENTED');
|
|
49
|
+
}
|
|
50
|
+
async stopMsrReaderListener() {
|
|
51
|
+
console.log('NOT IMPLEMENTED');
|
|
52
|
+
}
|
|
53
|
+
async startConnectionListener() {
|
|
54
|
+
console.log('NOT IMPLEMENTED');
|
|
55
|
+
}
|
|
56
|
+
async stopConnectionListener() {
|
|
57
|
+
console.log('NOT IMPLEMENTED');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
62
|
+
__proto__: null,
|
|
63
|
+
BixolonSdkPrinterWeb: BixolonSdkPrinterWeb
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
exports.BixolonSdkPrinter = BixolonSdkPrinter;
|
|
67
|
+
//# 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 BixolonSdkPrinter = registerPlugin('BixolonSdkPrinter', {\n web: () => import('./web').then((m) => new m.BixolonSdkPrinterWeb()),\n});\nexport * from './definitions';\nexport { BixolonSdkPrinter };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BixolonSdkPrinterWeb extends WebPlugin {\n async checkPermissions() {\n return { bluetooth: 'denied' };\n }\n async requestPermissions() {\n return { bluetooth: 'denied' };\n }\n async printText(options) {\n console.log('NOT IMPLEMENTED', options.lines, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n async printBarCode(options) {\n console.log('NOT IMPLEMENTED', options.data, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n async printQRCode(options) {\n console.log('NOT IMPLEMENTED', options.data, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n async printBitmap(options) {\n console.log('NOT IMPLEMENTED', options.base64Image, options.width, options.brightness, options.alignment);\n return { message: 'NOT IMPLEMENTED' };\n }\n async cutPaper(options) {\n console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n async getStatus(options) {\n console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.printStatus, options === null || options === void 0 ? void 0 : options.config);\n return {};\n }\n async reconnect() {\n console.log('NOT IMPLEMENTED');\n return { message: 'NOT IMPLEMENTED' };\n }\n async disconnect() {\n console.log('NOT IMPLEMENTED');\n }\n async startMsrReaderListener() {\n console.log('NOT IMPLEMENTED');\n }\n async stopMsrReaderListener() {\n console.log('NOT IMPLEMENTED');\n }\n async startConnectionListener() {\n console.log('NOT IMPLEMENTED');\n }\n async stopConnectionListener() {\n console.log('NOT IMPLEMENTED');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE;AAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe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Printer = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const BixolonSdkPrinter = core.registerPlugin('BixolonSdkPrinter', {
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.BixolonSdkPrinterWeb()),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
class BixolonSdkPrinterWeb extends core.WebPlugin {
|
|
9
|
+
async checkPermissions() {
|
|
10
|
+
return { bluetooth: 'denied' };
|
|
11
|
+
}
|
|
12
|
+
async requestPermissions() {
|
|
13
|
+
return { bluetooth: 'denied' };
|
|
14
|
+
}
|
|
15
|
+
async printText(options) {
|
|
16
|
+
console.log('NOT IMPLEMENTED', options.lines, options.config);
|
|
17
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
18
|
+
}
|
|
19
|
+
async printBarCode(options) {
|
|
20
|
+
console.log('NOT IMPLEMENTED', options.data, options.config);
|
|
21
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
22
|
+
}
|
|
23
|
+
async printQRCode(options) {
|
|
24
|
+
console.log('NOT IMPLEMENTED', options.data, options.config);
|
|
25
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
26
|
+
}
|
|
27
|
+
async printBitmap(options) {
|
|
28
|
+
console.log('NOT IMPLEMENTED', options.base64Image, options.width, options.brightness, options.alignment);
|
|
29
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
30
|
+
}
|
|
31
|
+
async cutPaper(options) {
|
|
32
|
+
console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.config);
|
|
33
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
34
|
+
}
|
|
35
|
+
async getStatus(options) {
|
|
36
|
+
console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.printStatus, options === null || options === void 0 ? void 0 : options.config);
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
async reconnect() {
|
|
40
|
+
console.log('NOT IMPLEMENTED');
|
|
41
|
+
return { message: 'NOT IMPLEMENTED' };
|
|
42
|
+
}
|
|
43
|
+
async disconnect() {
|
|
44
|
+
console.log('NOT IMPLEMENTED');
|
|
45
|
+
}
|
|
46
|
+
async startMsrReaderListener() {
|
|
47
|
+
console.log('NOT IMPLEMENTED');
|
|
48
|
+
}
|
|
49
|
+
async stopMsrReaderListener() {
|
|
50
|
+
console.log('NOT IMPLEMENTED');
|
|
51
|
+
}
|
|
52
|
+
async startConnectionListener() {
|
|
53
|
+
console.log('NOT IMPLEMENTED');
|
|
54
|
+
}
|
|
55
|
+
async stopConnectionListener() {
|
|
56
|
+
console.log('NOT IMPLEMENTED');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
61
|
+
__proto__: null,
|
|
62
|
+
BixolonSdkPrinterWeb: BixolonSdkPrinterWeb
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
exports.BixolonSdkPrinter = BixolonSdkPrinter;
|
|
66
|
+
|
|
67
|
+
return exports;
|
|
68
|
+
|
|
69
|
+
})({}, capacitorExports);
|
|
70
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst BixolonSdkPrinter = registerPlugin('BixolonSdkPrinter', {\n web: () => import('./web').then((m) => new m.BixolonSdkPrinterWeb()),\n});\nexport * from './definitions';\nexport { BixolonSdkPrinter };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BixolonSdkPrinterWeb extends WebPlugin {\n async checkPermissions() {\n return { bluetooth: 'denied' };\n }\n async requestPermissions() {\n return { bluetooth: 'denied' };\n }\n async printText(options) {\n console.log('NOT IMPLEMENTED', options.lines, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n async printBarCode(options) {\n console.log('NOT IMPLEMENTED', options.data, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n async printQRCode(options) {\n console.log('NOT IMPLEMENTED', options.data, options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n async printBitmap(options) {\n console.log('NOT IMPLEMENTED', options.base64Image, options.width, options.brightness, options.alignment);\n return { message: 'NOT IMPLEMENTED' };\n }\n async cutPaper(options) {\n console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.config);\n return { message: 'NOT IMPLEMENTED' };\n }\n async getStatus(options) {\n console.log('NOT IMPLEMENTED', options === null || options === void 0 ? void 0 : options.printStatus, options === null || options === void 0 ? void 0 : options.config);\n return {};\n }\n async reconnect() {\n console.log('NOT IMPLEMENTED');\n return { message: 'NOT IMPLEMENTED' };\n }\n async disconnect() {\n console.log('NOT IMPLEMENTED');\n }\n async startMsrReaderListener() {\n console.log('NOT IMPLEMENTED');\n }\n async stopMsrReaderListener() {\n console.log('NOT IMPLEMENTED');\n }\n async startConnectionListener() {\n console.log('NOT IMPLEMENTED');\n }\n async stopConnectionListener() {\n console.log('NOT IMPLEMENTED');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE;IAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;IACxE,CAAC;;ICFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;IACpD,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;IACtC,IAAI;IACJ,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;IACtC,IAAI;IACJ,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC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K,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/K,QAAQ,OAAO,EAAE;IACjB,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,QAAQ,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE;IAC7C,IAAI;IACJ,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,IAAI;IACJ,IAAI,MAAM,sBAAsB,GAAG;IACnC,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,IAAI;IACJ,IAAI,MAAM,qBAAqB,GAAG;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,IAAI;IACJ,IAAI,MAAM,uBAAuB,GAAG;IACpC,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,IAAI;IACJ,IAAI,MAAM,sBAAsB,GAAG;IACnC,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Bixolon printer plugin (official Bixolon SDK).
|
|
6
|
+
*
|
|
7
|
+
* This is an Android-only plugin. On iOS every method rejects with `unimplemented`.
|
|
8
|
+
* Please read the Capacitor iOS Plugin Development Guide
|
|
9
|
+
* here: https://capacitorjs.com/docs/plugins/ios
|
|
10
|
+
*/
|
|
11
|
+
@objc(BixolonSdkPrinterPlugin)
|
|
12
|
+
public class BixolonSdkPrinterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
13
|
+
public let identifier = "BixolonSdkPrinterPlugin"
|
|
14
|
+
public let jsName = "BixolonSdkPrinter"
|
|
15
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
16
|
+
CAPPluginMethod(name: "printText", returnType: CAPPluginReturnPromise),
|
|
17
|
+
CAPPluginMethod(name: "printBarCode", returnType: CAPPluginReturnPromise),
|
|
18
|
+
CAPPluginMethod(name: "printQRCode", returnType: CAPPluginReturnPromise),
|
|
19
|
+
CAPPluginMethod(name: "printBitmap", returnType: CAPPluginReturnPromise),
|
|
20
|
+
CAPPluginMethod(name: "cutPaper", returnType: CAPPluginReturnPromise),
|
|
21
|
+
CAPPluginMethod(name: "getStatus", returnType: CAPPluginReturnPromise),
|
|
22
|
+
CAPPluginMethod(name: "reconnect", returnType: CAPPluginReturnPromise),
|
|
23
|
+
CAPPluginMethod(name: "disconnect", returnType: CAPPluginReturnPromise),
|
|
24
|
+
CAPPluginMethod(name: "startMsrReaderListener", returnType: CAPPluginReturnPromise),
|
|
25
|
+
CAPPluginMethod(name: "stopMsrReaderListener", returnType: CAPPluginReturnPromise),
|
|
26
|
+
CAPPluginMethod(name: "startConnectionListener", returnType: CAPPluginReturnPromise),
|
|
27
|
+
CAPPluginMethod(name: "stopConnectionListener", returnType: CAPPluginReturnPromise)
|
|
28
|
+
]
|
|
29
|
+
private let implementation = BixolonSdkPrinter()
|
|
30
|
+
|
|
31
|
+
@objc func printText(_ call: CAPPluginCall) {
|
|
32
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@objc func printBarCode(_ call: CAPPluginCall) {
|
|
36
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@objc func printQRCode(_ call: CAPPluginCall) {
|
|
40
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@objc func printBitmap(_ call: CAPPluginCall) {
|
|
44
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@objc func cutPaper(_ call: CAPPluginCall) {
|
|
48
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@objc func getStatus(_ call: CAPPluginCall) {
|
|
52
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@objc func reconnect(_ call: CAPPluginCall) {
|
|
56
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@objc func disconnect(_ call: CAPPluginCall) {
|
|
60
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@objc func startMsrReaderListener(_ call: CAPPluginCall) {
|
|
64
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@objc func stopMsrReaderListener(_ call: CAPPluginCall) {
|
|
68
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@objc func startConnectionListener(_ call: CAPPluginCall) {
|
|
72
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@objc func stopConnectionListener(_ call: CAPPluginCall) {
|
|
76
|
+
call.unimplemented("BixolonSdkPrinter is Android-only.")
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import XCTest
|
|
2
|
+
@testable import BixolonSdkPrinterPlugin
|
|
3
|
+
|
|
4
|
+
class BixolonSdkPrinterTests: XCTestCase {
|
|
5
|
+
override func setUp() {
|
|
6
|
+
super.setUp()
|
|
7
|
+
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
override func tearDown() {
|
|
11
|
+
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
12
|
+
super.tearDown()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
func testEcho() {
|
|
16
|
+
// This is an example of a functional test case for a plugin.
|
|
17
|
+
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
18
|
+
|
|
19
|
+
let implementation = BixolonSdkPrinter()
|
|
20
|
+
let value = "Hello, World!"
|
|
21
|
+
let result = implementation.echo(value)
|
|
22
|
+
|
|
23
|
+
XCTAssertEqual(value, result)
|
|
24
|
+
}
|
|
25
|
+
}
|