react-native-mesmart 2.1.2 → 3.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 (33) hide show
  1. package/README.md +364 -103
  2. package/android/build.gradle +20 -6
  3. package/android/gradle.properties +2 -2
  4. package/android/src/main/java/com/gertec/GertecImpl.kt +2 -2
  5. package/android/src/main/java/com/mesmart/Packages.kt +3 -1
  6. package/android/src/main/java/com/mesmart/Utils.kt +6 -1
  7. package/android/src/main/java/com/paystore/PaystoreImpl.kt +1 -1
  8. package/android/src/main/java/com/tectoy/TectoyImpl.kt +93 -0
  9. package/android/src/main/java/com/tectoy/TectoyModule.kt +112 -0
  10. package/android/src/main/java/com/tectoy/utils/MifareT8.kt +84 -0
  11. package/android/src/main/java/com/tectoy/utils/PrinterT8.kt +141 -0
  12. package/lib/commonjs/@types/index.js +11 -0
  13. package/lib/commonjs/@types/index.js.map +1 -1
  14. package/lib/commonjs/@types/tectoy.js +6 -0
  15. package/lib/commonjs/@types/tectoy.js.map +1 -0
  16. package/lib/commonjs/index.js +14 -2
  17. package/lib/commonjs/index.js.map +1 -1
  18. package/lib/module/@types/index.js +1 -0
  19. package/lib/module/@types/index.js.map +1 -1
  20. package/lib/module/@types/tectoy.js +2 -0
  21. package/lib/module/@types/tectoy.js.map +1 -0
  22. package/lib/module/index.js +12 -1
  23. package/lib/module/index.js.map +1 -1
  24. package/lib/typescript/src/@types/index.d.ts +1 -0
  25. package/lib/typescript/src/@types/index.d.ts.map +1 -1
  26. package/lib/typescript/src/@types/tectoy.d.ts +7 -0
  27. package/lib/typescript/src/@types/tectoy.d.ts.map +1 -0
  28. package/lib/typescript/src/index.d.ts +11 -1
  29. package/lib/typescript/src/index.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/src/@types/index.ts +1 -0
  32. package/src/@types/tectoy.ts +7 -0
  33. package/src/index.ts +18 -1
@@ -0,0 +1,7 @@
1
+ import type { SunmiAPI } from './sunmi';
2
+
3
+ export interface TectoyAPI extends Omit<SunmiAPI, 'cancelScan'> {
4
+ cancelScan: () => Promise<true>;
5
+ /** Imprime tudo que foi acumulado desde o ultimo commit num job so. */
6
+ commitPrint: () => Promise<true>;
7
+ }
package/src/index.ts CHANGED
@@ -67,6 +67,23 @@ const Gertec = {
67
67
  scrollPrinterPaper: NativeModules.Gertec.scrollPrinterPaper,
68
68
  printHtml: (html: string) => NativeModules.Gertec.printHtml(html),
69
69
  };
70
+ // Mesmas primitivas da Sunmi; a T8 acumula o cupom e so imprime em commitPrint().
71
+ const Tectoy = {
72
+ scanRfid: NativeModules.Tectoy.scanRfid,
73
+ cancelScan: NativeModules.Tectoy.cancelScan,
74
+ printText: (
75
+ str: string,
76
+ fontSize: number = 24,
77
+ isBold: boolean = false,
78
+ isUnderline: boolean = false
79
+ ) => NativeModules.Tectoy.printText(str, fontSize, isBold, isUnderline),
80
+ printEmptyLine: NativeModules.Tectoy.printEmptyLine,
81
+ printBitmap: (bitmapStr: string, width: number = 200, height: number = 200) =>
82
+ NativeModules.Tectoy.printBitmap(bitmapStr, width, height),
83
+ printBpLogo: NativeModules.Tectoy.printBpLogo,
84
+ setPrinterAlign: NativeModules.Tectoy.setPrinterAlign,
85
+ commitPrint: NativeModules.Tectoy.commitPrint,
86
+ };
70
87
 
71
- export { Plugpag, Sunmi, Pax, Paystore, Stone, Gertec };
88
+ export { Plugpag, Sunmi, Pax, Paystore, Stone, Gertec, Tectoy };
72
89
  export * from './@types';