@simplymobile/capacitor-bixolon-printer 8.0.0 → 9.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 CHANGED
@@ -1,28 +1,27 @@
1
- // swift-tools-version: 5.9
2
- import PackageDescription
3
-
4
- let package = Package(
5
- name: "SimplymobileCapacitorBixolonPrinter",
6
- platforms: [.iOS(.v15)],
7
- products: [
8
- .library(
9
- name: "SimplymobileCapacitorBixolonPrinter",
10
- targets: ["BixolonPrinterPlugin"])
11
- ],
12
- dependencies: [
13
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
14
- ],
15
- targets: [
16
- .target(
17
- name: "BixolonPrinterPlugin",
18
- dependencies: [
19
- .product(name: "Capacitor", package: "capacitor-swift-pm"),
20
- .product(name: "Cordova", package: "capacitor-swift-pm")
21
- ],
22
- path: "ios/Sources/BixolonPrinterPlugin"),
23
- .testTarget(
24
- name: "BixolonPrinterPluginTests",
25
- dependencies: ["BixolonPrinterPlugin"],
26
- path: "ios/Tests/BixolonPrinterPluginTests")
27
- ]
28
- )
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "SimplymobileCapacitorBixolonPrinter",
6
+ platforms: [.iOS(.v16)],
7
+ products: [
8
+ .library(
9
+ name: "SimplymobileCapacitorBixolonPrinter",
10
+ targets: ["BixolonPrinterPlugin"])
11
+ ],
12
+ dependencies: [
13
+ .package(url: "https://github.com/ionic-team/capacitor.git", from: "9.0.0")
14
+ ],
15
+ targets: [
16
+ .target(
17
+ name: "BixolonPrinterPlugin",
18
+ dependencies: [
19
+ .product(name: "Capacitor", package: "capacitor")
20
+ ],
21
+ path: "ios/Sources/BixolonPrinterPlugin"),
22
+ .testTarget(
23
+ name: "BixolonPrinterPluginTests",
24
+ dependencies: ["BixolonPrinterPlugin"],
25
+ path: "ios/Tests/BixolonPrinterPluginTests")
26
+ ]
27
+ )
@@ -1,17 +1,17 @@
1
- require 'json'
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
-
5
- Pod::Spec.new do |s|
6
- s.name = 'SimplymobileCapacitorBixolonPrinter'
7
- s.version = package['version']
8
- s.summary = package['description']
9
- s.license = package['license']
10
- s.homepage = package['repository']['url']
11
- s.author = package['author']
12
- s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
- s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '15.0'
15
- s.dependency 'Capacitor'
16
- s.swift_version = '5.1'
17
- end
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'SimplymobileCapacitorBixolonPrinter'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.license = package['license']
10
+ s.homepage = package['repository']['url']
11
+ s.author = package['author']
12
+ s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
+ s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
+ s.ios.deployment_target = '16.0'
15
+ s.dependency 'Capacitor'
16
+ s.swift_version = '5.1'
17
+ end
@@ -1,58 +1,58 @@
1
- ext {
2
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
6
- }
7
-
8
- buildscript {
9
- repositories {
10
- google()
11
- mavenCentral()
12
- }
13
- dependencies {
14
- classpath 'com.android.tools.build:gradle:8.13.0'
15
- }
16
- }
17
-
18
- apply plugin: 'com.android.library'
19
-
20
- android {
21
- namespace = "pl.simplymobile.plugins.bixolonprinter"
22
- compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
23
- defaultConfig {
24
- minSdkVersion = project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
25
- targetSdkVersion = project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
26
- versionCode 1
27
- versionName "1.0"
28
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29
- }
30
- buildTypes {
31
- release {
32
- minifyEnabled false
33
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
34
- }
35
- }
36
- lintOptions {
37
- abortOnError = false
38
- }
39
- compileOptions {
1
+ ext {
2
+ junitVersion = rootProject.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxAppCompatVersion = rootProject.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.8.0'
4
+ androidxJunitVersion = rootProject.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
5
+ androidxEspressoCoreVersion = rootProject.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
6
+ }
7
+
8
+ buildscript {
9
+ repositories {
10
+ google()
11
+ mavenCentral()
12
+ }
13
+ dependencies {
14
+ classpath 'com.android.tools.build:gradle:9.4.1'
15
+ }
16
+ }
17
+
18
+ apply plugin: 'com.android.library'
19
+
20
+ android {
21
+ namespace = "pl.simplymobile.plugins.bixolonprinter"
22
+ compileSdk = rootProject.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 37
23
+ defaultConfig {
24
+ consumerProguardFiles "proguard-rules.pro"
25
+ minSdkVersion = rootProject.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 26
26
+ versionCode 1
27
+ versionName "1.0"
28
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29
+ }
30
+ buildTypes {
31
+ release {
32
+ minifyEnabled false
33
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
34
+ }
35
+ }
36
+ lintOptions {
37
+ abortOnError = false
38
+ }
39
+ compileOptions {
40
40
  sourceCompatibility JavaVersion.VERSION_21
41
41
  targetCompatibility JavaVersion.VERSION_21
42
- }
43
- }
44
-
45
- repositories {
46
- google()
47
- mavenCentral()
48
- }
49
-
50
-
51
- dependencies {
52
- implementation fileTree(dir: 'libs', include: ['*.jar'])
53
- implementation project(':capacitor-android')
54
- implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
55
- testImplementation "junit:junit:$junitVersion"
56
- androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
57
- androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
58
- }
42
+ }
43
+ }
44
+
45
+ repositories {
46
+ google()
47
+ mavenCentral()
48
+ }
49
+
50
+
51
+ dependencies {
52
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
53
+ implementation project(':capacitor-android')
54
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
55
+ testImplementation "junit:junit:$junitVersion"
56
+ androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
57
+ androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
58
+ }
@@ -0,0 +1,21 @@
1
+ # Add project specific ProGuard rules here.
2
+ # You can control the set of applied configuration files using the
3
+ # proguardFiles setting in build.gradle.
4
+ #
5
+ # For more details, see
6
+ # http://developer.android.com/guide/developing/tools/proguard.html
7
+
8
+ # If your project uses WebView with JS, uncomment the following
9
+ # and specify the fully qualified class name to the JavaScript interface
10
+ # class:
11
+ #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12
+ # public *;
13
+ #}
14
+
15
+ # Uncomment this to preserve the line number information for
16
+ # debugging stack traces.
17
+ #-keepattributes SourceFile,LineNumberTable
18
+
19
+ # If you keep the line number information, uncomment this to
20
+ # hide the original source file name.
21
+ #-renamesourcefileattribute SourceFile
@@ -50,12 +50,6 @@ public class BixolonPrinterPlugin extends Plugin {
50
50
  private BluetoothDevice mmDevice;
51
51
 
52
52
  private OutputStream mmOutputStream;
53
- private InputStream mmInputStream;
54
-
55
- private Thread workerThread;
56
- private byte[] readBuffer;
57
- private int readBufferPosition;
58
- private volatile boolean stopWorker;
59
53
 
60
54
  private static final byte[] ESC_ALIGN_LEFT = { 0x1B, 0x61, 0x00 };
61
55
  private static final byte[] ESC_ALIGN_RIGHT = { 0x1B, 0x61, 0x02 };
@@ -185,11 +179,11 @@ public class BixolonPrinterPlugin extends Plugin {
185
179
 
186
180
  // Standard SerialPortService ID
187
181
  UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");
182
+ closeSocketQuietly();
188
183
  mmSocket = mmDevice.createRfcommSocketToServiceRecord(uuid);
189
184
  mmSocket.connect();
190
185
  mmOutputStream = mmSocket.getOutputStream();
191
- mmInputStream = mmSocket.getInputStream();
192
- beginListenForData();
186
+ drainInput(mmSocket.getInputStream());
193
187
 
194
188
  Log.d(LOG_TAG, "BLUETOOTH OPENED: " + mmDevice.getName());
195
189
  JSObject ret = new JSObject();
@@ -197,25 +191,33 @@ public class BixolonPrinterPlugin extends Plugin {
197
191
  call.resolve(ret);
198
192
  } catch (Exception e) {
199
193
  Log.e(LOG_TAG, "connect failed", e);
194
+ closeSocketQuietly();
200
195
  call.reject(e.getMessage(), e);
201
196
  }
202
197
  }
203
198
 
199
+ private void closeSocketQuietly() {
200
+ if (mmSocket != null) {
201
+ try {
202
+ mmSocket.close();
203
+ } catch (IOException ignored) {
204
+ // już zamknięte
205
+ }
206
+ }
207
+ mmSocket = null;
208
+ mmOutputStream = null;
209
+ }
210
+
204
211
  @PluginMethod
205
212
  public void disconnect(PluginCall call) {
206
213
  try {
207
- stopWorker = true;
208
214
  if (mmOutputStream != null) {
209
215
  mmOutputStream.close();
210
216
  }
211
- if (mmInputStream != null) {
212
- mmInputStream.close();
213
- }
214
217
  if (mmSocket != null) {
215
218
  mmSocket.close();
216
219
  }
217
220
  mmOutputStream = null;
218
- mmInputStream = null;
219
221
  mmSocket = null;
220
222
  call.resolve();
221
223
  } catch (Exception e) {
@@ -415,41 +417,21 @@ public class BixolonPrinterPlugin extends Plugin {
415
417
  return false;
416
418
  }
417
419
 
418
- // After opening a connection to the bluetooth printer device,
419
- // we have to listen and check if data was sent back.
420
- private void beginListenForData() {
421
- try {
422
- final byte delimiter = 10; // ASCII newline
423
- stopWorker = false;
424
- readBufferPosition = 0;
425
- readBuffer = new byte[1024];
426
- workerThread = new Thread(() -> {
427
- while (!Thread.currentThread().isInterrupted() && !stopWorker) {
428
- try {
429
- int bytesAvailable = mmInputStream.available();
430
- if (bytesAvailable > 0) {
431
- byte[] packetBytes = new byte[bytesAvailable];
432
- mmInputStream.read(packetBytes);
433
- for (int i = 0; i < bytesAvailable; i++) {
434
- byte b = packetBytes[i];
435
- if (b == delimiter) {
436
- byte[] encodedBytes = new byte[readBufferPosition];
437
- System.arraycopy(readBuffer, 0, encodedBytes, 0, encodedBytes.length);
438
- readBufferPosition = 0;
439
- } else {
440
- readBuffer[readBufferPosition++] = b;
441
- }
442
- }
443
- }
444
- } catch (IOException ex) {
445
- stopWorker = true;
446
- }
420
+ // Odpowiedzi drukarki nie są używane, ale ktoś musi je czytać, żeby bufor RFCOMM się nie zapchał.
421
+ // Blokujący read kończy się wyjątkiem albo -1, gdy disconnect zamknie gniazdo.
422
+ private static void drainInput(InputStream in) {
423
+ Thread drainer = new Thread(() -> {
424
+ byte[] buffer = new byte[1024];
425
+ try {
426
+ while (in.read(buffer) != -1) {
427
+ // dane odrzucane
447
428
  }
448
- });
449
- workerThread.start();
450
- } catch (Exception e) {
451
- Log.e(LOG_TAG, "beginListenForData failed", e);
452
- }
429
+ } catch (IOException ignored) {
430
+ // gniazdo zamknięte
431
+ }
432
+ }, "bixolon-drain");
433
+ drainer.setDaemon(true);
434
+ drainer.start();
453
435
  }
454
436
 
455
437
  // align text
@@ -1 +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,CAAC,iBAAiB,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,iBAAiB,SAASC,cAAS,CAAC;AACjD,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAA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C;AACvD,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,CAAC;AACpD,IAAI;AACJ,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;AACtC,IAAI;AACJ,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,CAAC;AACrD,IAAI;AACJ;;;;;;;;;"}
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('N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CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,CAAC;AACrD,IAAI;AACJ,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC;AAClE,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,OAAO,CAAC;AACvD,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,CAAC;AACpD,IAAI;AACJ,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;AACtC,IAAI;AACJ,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,CAAC;AACrD,IAAI;AACJ;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.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,UAAC,cAAc,GAAGA,mBAAc,CAAC,gBAAgB,EAAE;IACxD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,iBAAiB,SAASC,cAAS,CAAC;IACjD,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,IAAI,GAAG;IACjB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9B,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE;IACnD,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE;IAC3B,QA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itor/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,UAAC,cAAc,GAAGA,mBAAc,CAAC,gBAAgB,EAAE;IACxD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,iBAAiB,SAASC,cAAS,CAAC;IACjD,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,EAA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BAAiB,EAAE,OAAO,CAAC,IAAI,CAAC;IACpD,IAAI;IACJ,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtC,IAAI;IACJ,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;IAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,CAAC;IACrD,IAAI;IACJ;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplymobile/capacitor-bixolon-printer",
3
- "version": "8.0.0",
3
+ "version": "9.0.0",
4
4
  "description": "Capacitor Bixolon Bluetooth printer plugin",
5
5
  "author": "SimplyMobile",
6
6
  "license": "Apache-2.0",
@@ -15,7 +15,8 @@
15
15
  "ios/Sources",
16
16
  "ios/Tests",
17
17
  "Package.swift",
18
- "SimplymobileCapacitorBixolonPrinter.podspec"
18
+ "SimplymobileCapacitorBixolonPrinter.podspec",
19
+ "android/proguard-rules.pro"
19
20
  ],
20
21
  "keywords": [
21
22
  "capacitor",
@@ -32,7 +33,7 @@
32
33
  "verify:web": "npm run build",
33
34
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
34
35
  "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
35
- "eslint": "eslint . --ext ts",
36
+ "eslint": "eslint .",
36
37
  "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
37
38
  "swiftlint": "node-swiftlint",
38
39
  "docgen": "docgen --api BixolonPrinterPlugin --output-readme README.md --output-json dist/docs.json",
@@ -42,14 +43,14 @@
42
43
  "prepublishOnly": "npm run build"
43
44
  },
44
45
  "devDependencies": {
45
- "@capacitor/android": "^8.0.0",
46
- "@capacitor/core": "^8.0.0",
46
+ "@capacitor/android": "^9.0.0",
47
+ "@capacitor/core": "^9.0.0",
47
48
  "@capacitor/docgen": "^0.3.1",
48
- "@capacitor/ios": "^8.0.0",
49
- "@ionic/eslint-config": "^0.4.0",
49
+ "@capacitor/ios": "^9.0.0",
50
+ "@ionic/eslint-config": "^0.5.0",
50
51
  "@ionic/prettier-config": "^4.0.0",
51
52
  "@ionic/swiftlint-config": "^2.0.0",
52
- "eslint": "^8.57.1",
53
+ "eslint": "^10.0.0",
53
54
  "prettier": "^3.6.2",
54
55
  "prettier-plugin-java": "^2.7.7",
55
56
  "rimraf": "^6.1.0",
@@ -58,10 +59,7 @@
58
59
  "typescript": "^5.9.3"
59
60
  },
60
61
  "peerDependencies": {
61
- "@capacitor/core": ">=8.0.0"
62
- },
63
- "eslintConfig": {
64
- "extends": "@ionic/eslint-config/recommended"
62
+ "@capacitor/core": ">=9.0.0"
65
63
  },
66
64
  "prettier": "@ionic/prettier-config",
67
65
  "swiftlint": "@ionic/swiftlint-config",