react-native-esc-pos-printer-chunyinli 4.5.2
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/README.md +3 -0
- package/android/build.gradle +93 -0
- package/android/generated/java/com/escposprinter/NativeEscPosPrinterDiscoverySpec.java +125 -0
- package/android/generated/java/com/escposprinter/NativeEscPosPrinterSpec.java +364 -0
- package/android/generated/jni/CMakeLists.txt +28 -0
- package/android/generated/jni/RNEscPosPrinterSpec-generated.cpp +198 -0
- package/android/generated/jni/RNEscPosPrinterSpec.h +39 -0
- package/android/generated/jni/react/renderer/components/RNEscPosPrinterSpec/RNEscPosPrinterSpecJSI-generated.cpp +250 -0
- package/android/generated/jni/react/renderer/components/RNEscPosPrinterSpec/RNEscPosPrinterSpecJSI.h +366 -0
- package/android/gradle.properties +5 -0
- package/android/libs/ePOS2.jar +0 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/reactnativeescposprinter/EposStringHelper.java +429 -0
- package/android/src/main/java/com/reactnativeescposprinter/EscPosPrinterDiscoveryModule.java +260 -0
- package/android/src/main/java/com/reactnativeescposprinter/EscPosPrinterModule.java +430 -0
- package/android/src/main/java/com/reactnativeescposprinter/EscPosPrinterPackage.java +62 -0
- package/android/src/main/java/com/reactnativeescposprinter/ImageManager.java +48 -0
- package/android/src/main/java/com/reactnativeescposprinter/PrinterCallback.java +8 -0
- package/android/src/main/java/com/reactnativeescposprinter/PrinterDelegate.java +13 -0
- package/android/src/main/java/com/reactnativeescposprinter/ThePrinter.java +426 -0
- package/android/src/main/java/com/reactnativeescposprinter/ThePrinterManager.java +41 -0
- package/android/src/main/jniLibs/arm64-v8a/libepos2.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libepos2.so +0 -0
- package/android/src/main/jniLibs/x86/libepos2.so +0 -0
- package/android/src/main/jniLibs/x86_64/libepos2.so +0 -0
- package/android/src/oldarch/java/com/reactnativeescposprinter/NativeEscPosPrinterDiscoverySpec.java +124 -0
- package/android/src/oldarch/java/com/reactnativeescposprinter/NativeEscPosPrinterSpec.java +363 -0
- package/ios/EposStringHelper.h +13 -0
- package/ios/EposStringHelper.m +366 -0
- package/ios/EscPosPrinter.h +22 -0
- package/ios/EscPosPrinter.mm +545 -0
- package/ios/EscPosPrinter.xcodeproj/project.pbxproj +345 -0
- package/ios/EscPosPrinterDiscovery.h +17 -0
- package/ios/EscPosPrinterDiscovery.mm +134 -0
- package/ios/ImageManager.h +9 -0
- package/ios/ImageManager.m +52 -0
- package/ios/PrinterSDK/libepos2.xcframework/Headers/ePOS2.h +1808 -0
- package/ios/PrinterSDK/libepos2.xcframework/Info.plist +48 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeResources +158 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/ios-arm64/libepos2.a +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.a +0 -0
- package/ios/ThePrinter.h +151 -0
- package/ios/ThePrinter.m +578 -0
- package/ios/ThePrinterManager.h +17 -0
- package/ios/ThePrinterManager.m +70 -0
- package/ios/generated/RNEscPosPrinterSpec/RNEscPosPrinterSpec-generated.mm +255 -0
- package/ios/generated/RNEscPosPrinterSpec/RNEscPosPrinterSpec.h +1000 -0
- package/ios/generated/RNEscPosPrinterSpecJSI-generated.cpp +250 -0
- package/ios/generated/RNEscPosPrinterSpecJSI.h +366 -0
- package/lib/module/core/errors/PrinterDiscoveryError.js +15 -0
- package/lib/module/core/errors/PrinterDiscoveryError.js.map +1 -0
- package/lib/module/core/errors/PrinterError.js +15 -0
- package/lib/module/core/errors/PrinterError.js.map +1 -0
- package/lib/module/core/errors/index.js +5 -0
- package/lib/module/core/errors/index.js.map +1 -0
- package/lib/module/core/index.js +5 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/core/utils/constants.js +10 -0
- package/lib/module/core/utils/constants.js.map +1 -0
- package/lib/module/core/utils/index.js +5 -0
- package/lib/module/core/utils/index.js.map +1 -0
- package/lib/module/core/utils/permissions.js +62 -0
- package/lib/module/core/utils/permissions.js.map +1 -0
- package/lib/module/discovery/PrintersDiscovery.js +114 -0
- package/lib/module/discovery/PrintersDiscovery.js.map +1 -0
- package/lib/module/discovery/constants.js +86 -0
- package/lib/module/discovery/constants.js.map +1 -0
- package/lib/module/discovery/hooks/index.js +4 -0
- package/lib/module/discovery/hooks/index.js.map +1 -0
- package/lib/module/discovery/hooks/usePrintersDiscovery.js +56 -0
- package/lib/module/discovery/hooks/usePrintersDiscovery.js.map +1 -0
- package/lib/module/discovery/index.js +7 -0
- package/lib/module/discovery/index.js.map +1 -0
- package/lib/module/discovery/types.js +4 -0
- package/lib/module/discovery/types.js.map +1 -0
- package/lib/module/discovery/utils/errors.js +20 -0
- package/lib/module/discovery/utils/errors.js.map +1 -0
- package/lib/module/discovery/utils/index.js +4 -0
- package/lib/module/discovery/utils/index.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/printer/Printer.js +106 -0
- package/lib/module/printer/Printer.js.map +1 -0
- package/lib/module/printer/PrinterWrapper.js +316 -0
- package/lib/module/printer/PrinterWrapper.js.map +1 -0
- package/lib/module/printer/constants/enums/barcode.js +32 -0
- package/lib/module/printer/constants/enums/barcode.js.map +1 -0
- package/lib/module/printer/constants/enums/common.js +93 -0
- package/lib/module/printer/constants/enums/common.js.map +1 -0
- package/lib/module/printer/constants/enums/image.js +23 -0
- package/lib/module/printer/constants/enums/image.js.map +1 -0
- package/lib/module/printer/constants/enums/index.js +43 -0
- package/lib/module/printer/constants/enums/index.js.map +1 -0
- package/lib/module/printer/constants/enums/pulse.js +18 -0
- package/lib/module/printer/constants/enums/pulse.js.map +1 -0
- package/lib/module/printer/constants/enums/settings.js +56 -0
- package/lib/module/printer/constants/enums/settings.js.map +1 -0
- package/lib/module/printer/constants/enums/status.js +63 -0
- package/lib/module/printer/constants/enums/status.js.map +1 -0
- package/lib/module/printer/constants/enums/symbol.js +43 -0
- package/lib/module/printer/constants/enums/symbol.js.map +1 -0
- package/lib/module/printer/constants/enums/textStyle.js +19 -0
- package/lib/module/printer/constants/enums/textStyle.js.map +1 -0
- package/lib/module/printer/constants/index.js +7 -0
- package/lib/module/printer/constants/index.js.map +1 -0
- package/lib/module/printer/constants/layout.js +5 -0
- package/lib/module/printer/constants/layout.js.map +1 -0
- package/lib/module/printer/constants/valuesToKeysMappers.js +96 -0
- package/lib/module/printer/constants/valuesToKeysMappers.js.map +1 -0
- package/lib/module/printer/constants/valuesToMessagesMappers.js +200 -0
- package/lib/module/printer/constants/valuesToMessagesMappers.js.map +1 -0
- package/lib/module/printer/index.js +6 -0
- package/lib/module/printer/index.js.map +1 -0
- package/lib/module/printer/printHelpers/addTextLine.js +14 -0
- package/lib/module/printer/printHelpers/addTextLine.js.map +1 -0
- package/lib/module/printer/printHelpers/addViewShot.js +35 -0
- package/lib/module/printer/printHelpers/addViewShot.js.map +1 -0
- package/lib/module/printer/printHelpers/index.js +7 -0
- package/lib/module/printer/printHelpers/index.js.map +1 -0
- package/lib/module/printer/printHelpers/monitorPrinter.js +30 -0
- package/lib/module/printer/printHelpers/monitorPrinter.js.map +1 -0
- package/lib/module/printer/printHelpers/tryToConnectUntil.js +15 -0
- package/lib/module/printer/printHelpers/tryToConnectUntil.js.map +1 -0
- package/lib/module/printer/types.js +4 -0
- package/lib/module/printer/types.js.map +1 -0
- package/lib/module/printer/utils/BufferHelper.js +44 -0
- package/lib/module/printer/utils/BufferHelper.js.map +1 -0
- package/lib/module/printer/utils/errors.js +37 -0
- package/lib/module/printer/utils/errors.js.map +1 -0
- package/lib/module/printer/utils/index.js +7 -0
- package/lib/module/printer/utils/index.js.map +1 -0
- package/lib/module/printer/utils/layout/getFontACharsPerLine.js +97 -0
- package/lib/module/printer/utils/layout/getFontACharsPerLine.js.map +1 -0
- package/lib/module/printer/utils/layout/index.js +5 -0
- package/lib/module/printer/utils/layout/index.js.map +1 -0
- package/lib/module/printer/utils/layout/spaceBetween.js +63 -0
- package/lib/module/printer/utils/layout/spaceBetween.js.map +1 -0
- package/lib/module/printer/utils/parsers/index.js +5 -0
- package/lib/module/printer/utils/parsers/index.js.map +1 -0
- package/lib/module/printer/utils/parsers/parsePrinterSettings.js +17 -0
- package/lib/module/printer/utils/parsers/parsePrinterSettings.js.map +1 -0
- package/lib/module/printer/utils/parsers/parsePrinterStatus.js +17 -0
- package/lib/module/printer/utils/parsers/parsePrinterStatus.js.map +1 -0
- package/lib/module/specs/NativeEscPosPrinter.js +5 -0
- package/lib/module/specs/NativeEscPosPrinter.js.map +1 -0
- package/lib/module/specs/NativeEscPosPrinterDiscovery.js +5 -0
- package/lib/module/specs/NativeEscPosPrinterDiscovery.js.map +1 -0
- package/lib/module/specs/index.js +33 -0
- package/lib/module/specs/index.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/core/errors/PrinterDiscoveryError.d.ts +13 -0
- package/lib/typescript/src/core/errors/PrinterDiscoveryError.d.ts.map +1 -0
- package/lib/typescript/src/core/errors/PrinterError.d.ts +13 -0
- package/lib/typescript/src/core/errors/PrinterError.d.ts.map +1 -0
- package/lib/typescript/src/core/errors/index.d.ts +3 -0
- package/lib/typescript/src/core/errors/index.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +3 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/core/utils/constants.d.ts +2 -0
- package/lib/typescript/src/core/utils/constants.d.ts.map +1 -0
- package/lib/typescript/src/core/utils/index.d.ts +3 -0
- package/lib/typescript/src/core/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/core/utils/permissions.d.ts +3 -0
- package/lib/typescript/src/core/utils/permissions.d.ts.map +1 -0
- package/lib/typescript/src/discovery/PrintersDiscovery.d.ts +22 -0
- package/lib/typescript/src/discovery/PrintersDiscovery.d.ts.map +1 -0
- package/lib/typescript/src/discovery/constants.d.ts +90 -0
- package/lib/typescript/src/discovery/constants.d.ts.map +1 -0
- package/lib/typescript/src/discovery/hooks/index.d.ts +2 -0
- package/lib/typescript/src/discovery/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/discovery/hooks/usePrintersDiscovery.d.ts +11 -0
- package/lib/typescript/src/discovery/hooks/usePrintersDiscovery.d.ts.map +1 -0
- package/lib/typescript/src/discovery/index.d.ts +5 -0
- package/lib/typescript/src/discovery/index.d.ts.map +1 -0
- package/lib/typescript/src/discovery/types.d.ts +69 -0
- package/lib/typescript/src/discovery/types.d.ts.map +1 -0
- package/lib/typescript/src/discovery/utils/errors.d.ts +9 -0
- package/lib/typescript/src/discovery/utils/errors.d.ts.map +1 -0
- package/lib/typescript/src/discovery/utils/index.d.ts +2 -0
- package/lib/typescript/src/discovery/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/Printer.d.ts +40 -0
- package/lib/typescript/src/printer/Printer.d.ts.map +1 -0
- package/lib/typescript/src/printer/PrinterWrapper.d.ts +36 -0
- package/lib/typescript/src/printer/PrinterWrapper.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/barcode.d.ts +26 -0
- package/lib/typescript/src/printer/constants/enums/barcode.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/common.d.ts +82 -0
- package/lib/typescript/src/printer/constants/enums/common.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/image.d.ts +16 -0
- package/lib/typescript/src/printer/constants/enums/image.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/index.d.ts +190 -0
- package/lib/typescript/src/printer/constants/enums/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/pulse.d.ts +12 -0
- package/lib/typescript/src/printer/constants/enums/pulse.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/settings.d.ts +48 -0
- package/lib/typescript/src/printer/constants/enums/settings.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/status.d.ts +50 -0
- package/lib/typescript/src/printer/constants/enums/status.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/symbol.d.ts +37 -0
- package/lib/typescript/src/printer/constants/enums/symbol.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/textStyle.d.ts +13 -0
- package/lib/typescript/src/printer/constants/enums/textStyle.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/index.d.ts +5 -0
- package/lib/typescript/src/printer/constants/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/layout.d.ts +3 -0
- package/lib/typescript/src/printer/constants/layout.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/valuesToKeysMappers.d.ts +6 -0
- package/lib/typescript/src/printer/constants/valuesToKeysMappers.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/valuesToMessagesMappers.d.ts +112 -0
- package/lib/typescript/src/printer/constants/valuesToMessagesMappers.d.ts.map +1 -0
- package/lib/typescript/src/printer/index.d.ts +4 -0
- package/lib/typescript/src/printer/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/addTextLine.d.ts +4 -0
- package/lib/typescript/src/printer/printHelpers/addTextLine.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/addViewShot.d.ts +4 -0
- package/lib/typescript/src/printer/printHelpers/addViewShot.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/index.d.ts +5 -0
- package/lib/typescript/src/printer/printHelpers/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/monitorPrinter.d.ts +4 -0
- package/lib/typescript/src/printer/printHelpers/monitorPrinter.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/tryToConnectUntil.d.ts +4 -0
- package/lib/typescript/src/printer/printHelpers/tryToConnectUntil.d.ts.map +1 -0
- package/lib/typescript/src/printer/types.d.ts +97 -0
- package/lib/typescript/src/printer/types.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/BufferHelper.d.ts +14 -0
- package/lib/typescript/src/printer/utils/BufferHelper.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/errors.d.ts +10 -0
- package/lib/typescript/src/printer/utils/errors.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/index.d.ts +5 -0
- package/lib/typescript/src/printer/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/layout/getFontACharsPerLine.d.ts +14 -0
- package/lib/typescript/src/printer/utils/layout/getFontACharsPerLine.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/layout/index.d.ts +3 -0
- package/lib/typescript/src/printer/utils/layout/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/layout/spaceBetween.d.ts +3 -0
- package/lib/typescript/src/printer/utils/layout/spaceBetween.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/parsers/index.d.ts +3 -0
- package/lib/typescript/src/printer/utils/parsers/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/parsers/parsePrinterSettings.d.ts +3 -0
- package/lib/typescript/src/printer/utils/parsers/parsePrinterSettings.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/parsers/parsePrinterStatus.d.ts +3 -0
- package/lib/typescript/src/printer/utils/parsers/parsePrinterStatus.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeEscPosPrinter.d.ts +243 -0
- package/lib/typescript/src/specs/NativeEscPosPrinter.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeEscPosPrinterDiscovery.d.ts +46 -0
- package/lib/typescript/src/specs/NativeEscPosPrinterDiscovery.d.ts.map +1 -0
- package/lib/typescript/src/specs/index.d.ts +6 -0
- package/lib/typescript/src/specs/index.d.ts.map +1 -0
- package/package.json +181 -0
- package/react-native-esc-pos-printer.podspec +24 -0
- package/react-native.config.js +12 -0
- package/scripts/movelib.js +66 -0
- package/src/core/errors/PrinterDiscoveryError.ts +14 -0
- package/src/core/errors/PrinterError.ts +14 -0
- package/src/core/errors/index.ts +2 -0
- package/src/core/index.ts +2 -0
- package/src/core/utils/constants.ts +12 -0
- package/src/core/utils/index.ts +2 -0
- package/src/core/utils/permissions.ts +92 -0
- package/src/discovery/PrintersDiscovery.tsx +166 -0
- package/src/discovery/constants.ts +101 -0
- package/src/discovery/hooks/index.ts +1 -0
- package/src/discovery/hooks/usePrintersDiscovery.ts +69 -0
- package/src/discovery/index.ts +4 -0
- package/src/discovery/types.ts +79 -0
- package/src/discovery/utils/errors.ts +37 -0
- package/src/discovery/utils/index.ts +1 -0
- package/src/index.tsx +2 -0
- package/src/printer/Printer.ts +158 -0
- package/src/printer/PrinterWrapper.ts +422 -0
- package/src/printer/constants/enums/barcode.ts +30 -0
- package/src/printer/constants/enums/common.ts +90 -0
- package/src/printer/constants/enums/image.ts +21 -0
- package/src/printer/constants/enums/index.ts +104 -0
- package/src/printer/constants/enums/pulse.ts +16 -0
- package/src/printer/constants/enums/settings.ts +54 -0
- package/src/printer/constants/enums/status.ts +61 -0
- package/src/printer/constants/enums/symbol.ts +41 -0
- package/src/printer/constants/enums/textStyle.ts +17 -0
- package/src/printer/constants/index.ts +4 -0
- package/src/printer/constants/layout.ts +3 -0
- package/src/printer/constants/valuesToKeysMappers.ts +179 -0
- package/src/printer/constants/valuesToMessagesMappers.ts +277 -0
- package/src/printer/index.ts +3 -0
- package/src/printer/printHelpers/addTextLine.ts +26 -0
- package/src/printer/printHelpers/addViewShot.ts +42 -0
- package/src/printer/printHelpers/index.ts +4 -0
- package/src/printer/printHelpers/monitorPrinter.ts +41 -0
- package/src/printer/printHelpers/tryToConnectUntil.ts +20 -0
- package/src/printer/types.ts +152 -0
- package/src/printer/utils/BufferHelper.ts +52 -0
- package/src/printer/utils/errors.ts +48 -0
- package/src/printer/utils/index.ts +4 -0
- package/src/printer/utils/layout/getFontACharsPerLine.ts +119 -0
- package/src/printer/utils/layout/index.ts +2 -0
- package/src/printer/utils/layout/spaceBetween.ts +96 -0
- package/src/printer/utils/parsers/index.ts +2 -0
- package/src/printer/utils/parsers/parsePrinterSettings.ts +30 -0
- package/src/printer/utils/parsers/parsePrinterStatus.ts +20 -0
- package/src/specs/NativeEscPosPrinter.ts +284 -0
- package/src/specs/NativeEscPosPrinterDiscovery.ts +48 -0
- package/src/specs/index.ts +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['EscPosPrinter_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
def reactNativeArchitectures() {
|
|
17
|
+
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
18
|
+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
def isNewArchitectureEnabled() {
|
|
22
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
apply plugin: "com.android.library"
|
|
26
|
+
|
|
27
|
+
if (isNewArchitectureEnabled()) {
|
|
28
|
+
apply plugin: "com.facebook.react"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def getExtOrIntegerDefault(name) {
|
|
33
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["EscPosPrinter_" + name]).toInteger()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
android {
|
|
37
|
+
namespace "com.escposprinter"
|
|
38
|
+
|
|
39
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
40
|
+
|
|
41
|
+
defaultConfig {
|
|
42
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
43
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
44
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
buildTypes {
|
|
48
|
+
release {
|
|
49
|
+
minifyEnabled false
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
lintOptions {
|
|
54
|
+
disable "GradleCompatible"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
compileOptions {
|
|
58
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
59
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
sourceSets {
|
|
63
|
+
main {
|
|
64
|
+
if (isNewArchitectureEnabled()) {
|
|
65
|
+
java.srcDirs += [
|
|
66
|
+
"generated/java",
|
|
67
|
+
"generated/jni"
|
|
68
|
+
]
|
|
69
|
+
} else {
|
|
70
|
+
java.srcDirs += ['src/oldarch']
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
repositories {
|
|
77
|
+
mavenCentral()
|
|
78
|
+
google()
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
dependencies {
|
|
83
|
+
implementation "com.facebook.react:react-android"
|
|
84
|
+
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
85
|
+
implementation 'com.google.android.gms:play-services-location:21.0.1'
|
|
86
|
+
}
|
|
87
|
+
if (isNewArchitectureEnabled()) {
|
|
88
|
+
react {
|
|
89
|
+
jsRootDir = file("../src/")
|
|
90
|
+
libraryName = "RNEscPosPrinterSpec"
|
|
91
|
+
codegenJavaPackageName = "com.escposprinter"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
+
*
|
|
10
|
+
* @nolint
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
package com.escposprinter;
|
|
14
|
+
|
|
15
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
+
import com.facebook.react.bridge.Promise;
|
|
17
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
21
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
22
|
+
import com.facebook.react.common.build.ReactBuildConfig;
|
|
23
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
24
|
+
import java.util.Arrays;
|
|
25
|
+
import java.util.HashSet;
|
|
26
|
+
import java.util.Map;
|
|
27
|
+
import java.util.Set;
|
|
28
|
+
import javax.annotation.Nonnull;
|
|
29
|
+
import javax.annotation.Nullable;
|
|
30
|
+
|
|
31
|
+
public abstract class NativeEscPosPrinterDiscoverySpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
32
|
+
public static final String NAME = "EscPosPrinterDiscovery";
|
|
33
|
+
|
|
34
|
+
public NativeEscPosPrinterDiscoverySpec(ReactApplicationContext reactContext) {
|
|
35
|
+
super(reactContext);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@Override
|
|
39
|
+
public @Nonnull String getName() {
|
|
40
|
+
return NAME;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
protected final void emitOnDiscovery(ReadableArray value) {
|
|
44
|
+
mEventEmitterCallback.invoke("onDiscovery", value);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected final void emitEnableLocationSettingSuccess() {
|
|
48
|
+
mEventEmitterCallback.invoke("enableLocationSettingSuccess");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
protected final void emitEnableLocationSettingFailure() {
|
|
52
|
+
mEventEmitterCallback.invoke("enableLocationSettingFailure");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
protected abstract Map<String, Object> getTypedExportedConstants();
|
|
56
|
+
|
|
57
|
+
@Override
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
public final @Nullable Map<String, Object> getConstants() {
|
|
60
|
+
Map<String, Object> constants = getTypedExportedConstants();
|
|
61
|
+
if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
|
|
62
|
+
Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
|
|
63
|
+
"BT_ERR_CANCEL",
|
|
64
|
+
"BT_ERR_ILLEGAL_DEVICE",
|
|
65
|
+
"BT_ERR_PARAM",
|
|
66
|
+
"BT_ERR_UNSUPPORTED",
|
|
67
|
+
"ERR_FAILURE",
|
|
68
|
+
"ERR_ILLEGAL",
|
|
69
|
+
"ERR_MEMORY",
|
|
70
|
+
"ERR_PARAM",
|
|
71
|
+
"ERR_PROCESSING",
|
|
72
|
+
"FILTER_NAME",
|
|
73
|
+
"FILTER_NONE",
|
|
74
|
+
"MODEL_ALL",
|
|
75
|
+
"PORTTYPE_ALL",
|
|
76
|
+
"PORTTYPE_BLUETOOTH",
|
|
77
|
+
"PORTTYPE_BLUETOOTH_LE",
|
|
78
|
+
"PORTTYPE_TCP",
|
|
79
|
+
"PORTTYPE_USB",
|
|
80
|
+
"PRINTER_FALSE",
|
|
81
|
+
"PRINTER_TRUE",
|
|
82
|
+
"TYPE_ALL",
|
|
83
|
+
"TYPE_DISPLAY",
|
|
84
|
+
"TYPE_GFE",
|
|
85
|
+
"TYPE_HYBRID_PRINTER",
|
|
86
|
+
"TYPE_KEYBOARD",
|
|
87
|
+
"TYPE_MSR",
|
|
88
|
+
"TYPE_OTHER_PERIPHERAL",
|
|
89
|
+
"TYPE_POS_KEYBOARD",
|
|
90
|
+
"TYPE_PRINTER",
|
|
91
|
+
"TYPE_SCANNER",
|
|
92
|
+
"TYPE_SERIAL"
|
|
93
|
+
));
|
|
94
|
+
Set<String> optionalFlowConstants = new HashSet<>();
|
|
95
|
+
Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
|
|
96
|
+
undeclaredConstants.removeAll(obligatoryFlowConstants);
|
|
97
|
+
undeclaredConstants.removeAll(optionalFlowConstants);
|
|
98
|
+
if (!undeclaredConstants.isEmpty()) {
|
|
99
|
+
throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants));
|
|
100
|
+
}
|
|
101
|
+
undeclaredConstants = obligatoryFlowConstants;
|
|
102
|
+
undeclaredConstants.removeAll(constants.keySet());
|
|
103
|
+
if (!undeclaredConstants.isEmpty()) {
|
|
104
|
+
throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return constants;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@ReactMethod
|
|
111
|
+
@DoNotStrip
|
|
112
|
+
public abstract void startDiscovery(ReadableMap filterOption, Promise promise);
|
|
113
|
+
|
|
114
|
+
@ReactMethod
|
|
115
|
+
@DoNotStrip
|
|
116
|
+
public abstract void stopDiscovery(Promise promise);
|
|
117
|
+
|
|
118
|
+
@ReactMethod
|
|
119
|
+
@DoNotStrip
|
|
120
|
+
public abstract void enableLocationSetting(Promise promise);
|
|
121
|
+
|
|
122
|
+
@ReactMethod
|
|
123
|
+
@DoNotStrip
|
|
124
|
+
public abstract void pairBluetoothDevice(String macAddress, Promise promise);
|
|
125
|
+
}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
+
*
|
|
10
|
+
* @nolint
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
package com.escposprinter;
|
|
14
|
+
|
|
15
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
+
import com.facebook.react.bridge.Promise;
|
|
17
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
21
|
+
import com.facebook.react.common.build.ReactBuildConfig;
|
|
22
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
23
|
+
import java.util.Arrays;
|
|
24
|
+
import java.util.HashSet;
|
|
25
|
+
import java.util.Map;
|
|
26
|
+
import java.util.Set;
|
|
27
|
+
import javax.annotation.Nonnull;
|
|
28
|
+
import javax.annotation.Nullable;
|
|
29
|
+
|
|
30
|
+
public abstract class NativeEscPosPrinterSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
31
|
+
public static final String NAME = "EscPosPrinter";
|
|
32
|
+
|
|
33
|
+
public NativeEscPosPrinterSpec(ReactApplicationContext reactContext) {
|
|
34
|
+
super(reactContext);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Override
|
|
38
|
+
public @Nonnull String getName() {
|
|
39
|
+
return NAME;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
protected abstract Map<String, Object> getTypedExportedConstants();
|
|
43
|
+
|
|
44
|
+
@Override
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
public final @Nullable Map<String, Object> getConstants() {
|
|
47
|
+
Map<String, Object> constants = getTypedExportedConstants();
|
|
48
|
+
if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
|
|
49
|
+
Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
|
|
50
|
+
"ALIGN_CENTER",
|
|
51
|
+
"ALIGN_LEFT",
|
|
52
|
+
"ALIGN_RIGHT",
|
|
53
|
+
"AUTOCUTTER_ERR",
|
|
54
|
+
"AUTORECOVER_ERR",
|
|
55
|
+
"BARCODE_CODABAR",
|
|
56
|
+
"BARCODE_CODE128",
|
|
57
|
+
"BARCODE_CODE128_AUTO",
|
|
58
|
+
"BARCODE_CODE39",
|
|
59
|
+
"BARCODE_CODE93",
|
|
60
|
+
"BARCODE_EAN13",
|
|
61
|
+
"BARCODE_EAN8",
|
|
62
|
+
"BARCODE_GS1_128",
|
|
63
|
+
"BARCODE_GS1_DATABAR_EXPANDED",
|
|
64
|
+
"BARCODE_GS1_DATABAR_LIMITED",
|
|
65
|
+
"BARCODE_GS1_DATABAR_OMNIDIRECTIONAL",
|
|
66
|
+
"BARCODE_GS1_DATABAR_TRUNCATED",
|
|
67
|
+
"BARCODE_ITF",
|
|
68
|
+
"BARCODE_JAN13",
|
|
69
|
+
"BARCODE_JAN8",
|
|
70
|
+
"BARCODE_UPC_A",
|
|
71
|
+
"BARCODE_UPC_E",
|
|
72
|
+
"BATTERY_OVERHEAT",
|
|
73
|
+
"CODE_ERR_AUTORECOVER",
|
|
74
|
+
"CODE_ERR_BATTERY_LOW",
|
|
75
|
+
"CODE_ERR_COVER_OPEN",
|
|
76
|
+
"CODE_ERR_CUTTER",
|
|
77
|
+
"CODE_ERR_DEVICE_BUSY",
|
|
78
|
+
"CODE_ERR_EMPTY",
|
|
79
|
+
"CODE_ERR_FAILURE",
|
|
80
|
+
"CODE_ERR_ILLEGAL",
|
|
81
|
+
"CODE_ERR_JOB_NOT_FOUND",
|
|
82
|
+
"CODE_ERR_MECHANICAL",
|
|
83
|
+
"CODE_ERR_MEMORY",
|
|
84
|
+
"CODE_ERR_NOT_FOUND",
|
|
85
|
+
"CODE_ERR_PARAM",
|
|
86
|
+
"CODE_ERR_PORT",
|
|
87
|
+
"CODE_ERR_PROCESSING",
|
|
88
|
+
"CODE_ERR_REQUEST_ENTITY_TOO_LARGE",
|
|
89
|
+
"CODE_ERR_SPOOLER",
|
|
90
|
+
"CODE_ERR_SYSTEM",
|
|
91
|
+
"CODE_ERR_TIMEOUT",
|
|
92
|
+
"CODE_ERR_TOO_MANY_REQUESTS",
|
|
93
|
+
"CODE_ERR_UNRECOVERABLE",
|
|
94
|
+
"CODE_ERR_WAIT_REMOVAL",
|
|
95
|
+
"CODE_PRINTING",
|
|
96
|
+
"COLOR_1",
|
|
97
|
+
"COLOR_2",
|
|
98
|
+
"COLOR_3",
|
|
99
|
+
"COLOR_4",
|
|
100
|
+
"COLOR_NONE",
|
|
101
|
+
"COMPRESS_AUTO",
|
|
102
|
+
"COMPRESS_DEFLATE",
|
|
103
|
+
"COMPRESS_NONE",
|
|
104
|
+
"COVER_OPEN",
|
|
105
|
+
"CUT_FEED",
|
|
106
|
+
"CUT_NO_FEED",
|
|
107
|
+
"CUT_RESERVE",
|
|
108
|
+
"DRAWER_2PIN",
|
|
109
|
+
"DRAWER_5PIN",
|
|
110
|
+
"DRAWER_HIGH",
|
|
111
|
+
"DRAWER_LOW",
|
|
112
|
+
"EPOS2_BATTERY_LEVEL_0",
|
|
113
|
+
"EPOS2_BATTERY_LEVEL_1",
|
|
114
|
+
"EPOS2_BATTERY_LEVEL_2",
|
|
115
|
+
"EPOS2_BATTERY_LEVEL_3",
|
|
116
|
+
"EPOS2_BATTERY_LEVEL_4",
|
|
117
|
+
"EPOS2_BATTERY_LEVEL_5",
|
|
118
|
+
"EPOS2_BATTERY_LEVEL_6",
|
|
119
|
+
"ERR_CONNECT",
|
|
120
|
+
"ERR_DISCONNECT",
|
|
121
|
+
"ERR_FAILURE",
|
|
122
|
+
"ERR_ILLEGAL",
|
|
123
|
+
"ERR_INIT",
|
|
124
|
+
"ERR_IN_USE",
|
|
125
|
+
"ERR_MEMORY",
|
|
126
|
+
"ERR_NOT_FOUND",
|
|
127
|
+
"ERR_PARAM",
|
|
128
|
+
"ERR_PROCESSING",
|
|
129
|
+
"ERR_RECOVERY_FAILURE",
|
|
130
|
+
"ERR_TIMEOUT",
|
|
131
|
+
"ERR_TYPE_INVALID",
|
|
132
|
+
"ERR_UNSUPPORTED",
|
|
133
|
+
"FONT_A",
|
|
134
|
+
"FONT_B",
|
|
135
|
+
"FONT_C",
|
|
136
|
+
"FONT_D",
|
|
137
|
+
"FONT_E",
|
|
138
|
+
"FULL_CUT_FEED",
|
|
139
|
+
"FULL_CUT_NO_FEED",
|
|
140
|
+
"FULL_CUT_RESERVE",
|
|
141
|
+
"HALFTONE_DITHER",
|
|
142
|
+
"HALFTONE_ERROR_DIFFUSION",
|
|
143
|
+
"HALFTONE_THRESHOLD",
|
|
144
|
+
"HEAD_OVERHEAT",
|
|
145
|
+
"HIGH_VOLTAGE_ERR",
|
|
146
|
+
"HRI_ABOVE",
|
|
147
|
+
"HRI_BELOW",
|
|
148
|
+
"HRI_BOTH",
|
|
149
|
+
"HRI_NONE",
|
|
150
|
+
"LANG_EN",
|
|
151
|
+
"LANG_JA",
|
|
152
|
+
"LANG_KO",
|
|
153
|
+
"LANG_MULTI",
|
|
154
|
+
"LANG_TH",
|
|
155
|
+
"LANG_VI",
|
|
156
|
+
"LANG_ZH_CN",
|
|
157
|
+
"LANG_ZH_TW",
|
|
158
|
+
"LEVEL_0",
|
|
159
|
+
"LEVEL_1",
|
|
160
|
+
"LEVEL_2",
|
|
161
|
+
"LEVEL_3",
|
|
162
|
+
"LEVEL_4",
|
|
163
|
+
"LEVEL_5",
|
|
164
|
+
"LEVEL_6",
|
|
165
|
+
"LEVEL_7",
|
|
166
|
+
"LEVEL_8",
|
|
167
|
+
"LEVEL_H",
|
|
168
|
+
"LEVEL_L",
|
|
169
|
+
"LEVEL_M",
|
|
170
|
+
"LEVEL_Q",
|
|
171
|
+
"LOW_VOLTAGE_ERR",
|
|
172
|
+
"MECHANICAL_ERR",
|
|
173
|
+
"MODEL_ANK",
|
|
174
|
+
"MODEL_CHINESE",
|
|
175
|
+
"MODEL_KOREAN",
|
|
176
|
+
"MODEL_SOUTHASIA",
|
|
177
|
+
"MODEL_TAIWAN",
|
|
178
|
+
"MODEL_THAI",
|
|
179
|
+
"MODE_GRAY16",
|
|
180
|
+
"MODE_MONO",
|
|
181
|
+
"MODE_MONO_HIGH_DENSITY",
|
|
182
|
+
"MOTOR_OVERHEAT",
|
|
183
|
+
"NO_ERR",
|
|
184
|
+
"PAPER_EMPTY",
|
|
185
|
+
"PAPER_NEAR_END",
|
|
186
|
+
"PAPER_OK",
|
|
187
|
+
"PARAM_DEFAULT",
|
|
188
|
+
"PARAM_UNSPECIFIED",
|
|
189
|
+
"PRINTER_FALSE",
|
|
190
|
+
"PRINTER_SETTING_PAPERWIDTH",
|
|
191
|
+
"PRINTER_SETTING_PAPERWIDTH58_0",
|
|
192
|
+
"PRINTER_SETTING_PAPERWIDTH60_0",
|
|
193
|
+
"PRINTER_SETTING_PAPERWIDTH70_0",
|
|
194
|
+
"PRINTER_SETTING_PAPERWIDTH76_0",
|
|
195
|
+
"PRINTER_SETTING_PAPERWIDTH80_0",
|
|
196
|
+
"PRINTER_SETTING_PRINTDENSITY",
|
|
197
|
+
"PRINTER_SETTING_PRINTDENSITY100",
|
|
198
|
+
"PRINTER_SETTING_PRINTDENSITY105",
|
|
199
|
+
"PRINTER_SETTING_PRINTDENSITY110",
|
|
200
|
+
"PRINTER_SETTING_PRINTDENSITY115",
|
|
201
|
+
"PRINTER_SETTING_PRINTDENSITY120",
|
|
202
|
+
"PRINTER_SETTING_PRINTDENSITY125",
|
|
203
|
+
"PRINTER_SETTING_PRINTDENSITY130",
|
|
204
|
+
"PRINTER_SETTING_PRINTDENSITY70",
|
|
205
|
+
"PRINTER_SETTING_PRINTDENSITY75",
|
|
206
|
+
"PRINTER_SETTING_PRINTDENSITY80",
|
|
207
|
+
"PRINTER_SETTING_PRINTDENSITY85",
|
|
208
|
+
"PRINTER_SETTING_PRINTDENSITY90",
|
|
209
|
+
"PRINTER_SETTING_PRINTDENSITY95",
|
|
210
|
+
"PRINTER_SETTING_PRINTDENSITYDIP",
|
|
211
|
+
"PRINTER_SETTING_PRINTSPEED",
|
|
212
|
+
"PRINTER_SETTING_PRINTSPEED1",
|
|
213
|
+
"PRINTER_SETTING_PRINTSPEED10",
|
|
214
|
+
"PRINTER_SETTING_PRINTSPEED11",
|
|
215
|
+
"PRINTER_SETTING_PRINTSPEED12",
|
|
216
|
+
"PRINTER_SETTING_PRINTSPEED13",
|
|
217
|
+
"PRINTER_SETTING_PRINTSPEED14",
|
|
218
|
+
"PRINTER_SETTING_PRINTSPEED15",
|
|
219
|
+
"PRINTER_SETTING_PRINTSPEED16",
|
|
220
|
+
"PRINTER_SETTING_PRINTSPEED17",
|
|
221
|
+
"PRINTER_SETTING_PRINTSPEED2",
|
|
222
|
+
"PRINTER_SETTING_PRINTSPEED3",
|
|
223
|
+
"PRINTER_SETTING_PRINTSPEED4",
|
|
224
|
+
"PRINTER_SETTING_PRINTSPEED5",
|
|
225
|
+
"PRINTER_SETTING_PRINTSPEED6",
|
|
226
|
+
"PRINTER_SETTING_PRINTSPEED7",
|
|
227
|
+
"PRINTER_SETTING_PRINTSPEED8",
|
|
228
|
+
"PRINTER_SETTING_PRINTSPEED9",
|
|
229
|
+
"PRINTER_TRUE",
|
|
230
|
+
"PULSE_100",
|
|
231
|
+
"PULSE_200",
|
|
232
|
+
"PULSE_300",
|
|
233
|
+
"PULSE_400",
|
|
234
|
+
"PULSE_500",
|
|
235
|
+
"REMOVAL_DETECT_PAPER",
|
|
236
|
+
"REMOVAL_DETECT_PAPER_NONE",
|
|
237
|
+
"REMOVAL_DETECT_UNKNOWN",
|
|
238
|
+
"REMOVAL_WAIT_NONE",
|
|
239
|
+
"REMOVAL_WAIT_PAPER",
|
|
240
|
+
"SWITCH_OFF",
|
|
241
|
+
"SWITCH_ON",
|
|
242
|
+
"SYMBOL_AZTECCODE_COMPACT",
|
|
243
|
+
"SYMBOL_AZTECCODE_FULLRANGE",
|
|
244
|
+
"SYMBOL_DATAMATRIX_RECTANGLE_12",
|
|
245
|
+
"SYMBOL_DATAMATRIX_RECTANGLE_16",
|
|
246
|
+
"SYMBOL_DATAMATRIX_RECTANGLE_8",
|
|
247
|
+
"SYMBOL_DATAMATRIX_SQUARE",
|
|
248
|
+
"SYMBOL_GS1_DATABAR_EXPANDED_STACKED",
|
|
249
|
+
"SYMBOL_GS1_DATABAR_STACKED",
|
|
250
|
+
"SYMBOL_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",
|
|
251
|
+
"SYMBOL_MAXICODE_MODE_2",
|
|
252
|
+
"SYMBOL_MAXICODE_MODE_3",
|
|
253
|
+
"SYMBOL_MAXICODE_MODE_4",
|
|
254
|
+
"SYMBOL_MAXICODE_MODE_5",
|
|
255
|
+
"SYMBOL_MAXICODE_MODE_6",
|
|
256
|
+
"SYMBOL_PDF417_STANDARD",
|
|
257
|
+
"SYMBOL_PDF417_TRUNCATED",
|
|
258
|
+
"SYMBOL_QRCODE_MICRO",
|
|
259
|
+
"SYMBOL_QRCODE_MODEL_1",
|
|
260
|
+
"SYMBOL_QRCODE_MODEL_2",
|
|
261
|
+
"UNKNOWN",
|
|
262
|
+
"UNRECOVER_ERR",
|
|
263
|
+
"WRONG_PAPER"
|
|
264
|
+
));
|
|
265
|
+
Set<String> optionalFlowConstants = new HashSet<>();
|
|
266
|
+
Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
|
|
267
|
+
undeclaredConstants.removeAll(obligatoryFlowConstants);
|
|
268
|
+
undeclaredConstants.removeAll(optionalFlowConstants);
|
|
269
|
+
if (!undeclaredConstants.isEmpty()) {
|
|
270
|
+
throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants));
|
|
271
|
+
}
|
|
272
|
+
undeclaredConstants = obligatoryFlowConstants;
|
|
273
|
+
undeclaredConstants.removeAll(constants.keySet());
|
|
274
|
+
if (!undeclaredConstants.isEmpty()) {
|
|
275
|
+
throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return constants;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@ReactMethod
|
|
282
|
+
@DoNotStrip
|
|
283
|
+
public abstract void initWithPrinterDeviceName(String target, String deviceName, double lang, Promise promise);
|
|
284
|
+
|
|
285
|
+
@ReactMethod
|
|
286
|
+
@DoNotStrip
|
|
287
|
+
public abstract void connect(String target, double timeout, Promise promise);
|
|
288
|
+
|
|
289
|
+
@ReactMethod
|
|
290
|
+
@DoNotStrip
|
|
291
|
+
public abstract void disconnect(String target, Promise promise);
|
|
292
|
+
|
|
293
|
+
@ReactMethod
|
|
294
|
+
@DoNotStrip
|
|
295
|
+
public abstract void clearCommandBuffer(String target, Promise promise);
|
|
296
|
+
|
|
297
|
+
@ReactMethod
|
|
298
|
+
@DoNotStrip
|
|
299
|
+
public abstract void addText(String target, String data, Promise promise);
|
|
300
|
+
|
|
301
|
+
@ReactMethod
|
|
302
|
+
@DoNotStrip
|
|
303
|
+
public abstract void addTextLang(String target, double lang, Promise promise);
|
|
304
|
+
|
|
305
|
+
@ReactMethod
|
|
306
|
+
@DoNotStrip
|
|
307
|
+
public abstract void addFeedLine(String target, double line, Promise promise);
|
|
308
|
+
|
|
309
|
+
@ReactMethod
|
|
310
|
+
@DoNotStrip
|
|
311
|
+
public abstract void addLineSpace(String target, double linespc, Promise promise);
|
|
312
|
+
|
|
313
|
+
@ReactMethod
|
|
314
|
+
@DoNotStrip
|
|
315
|
+
public abstract void addCut(String target, double type, Promise promise);
|
|
316
|
+
|
|
317
|
+
@ReactMethod
|
|
318
|
+
@DoNotStrip
|
|
319
|
+
public abstract void sendData(String target, double timeout, Promise promise);
|
|
320
|
+
|
|
321
|
+
@ReactMethod
|
|
322
|
+
@DoNotStrip
|
|
323
|
+
public abstract void getPrinterSetting(String target, double timeout, double type, Promise promise);
|
|
324
|
+
|
|
325
|
+
@ReactMethod
|
|
326
|
+
@DoNotStrip
|
|
327
|
+
public abstract void getStatus(String target, Promise promise);
|
|
328
|
+
|
|
329
|
+
@ReactMethod
|
|
330
|
+
@DoNotStrip
|
|
331
|
+
public abstract void addImage(String target, ReadableMap source, double width, double color, double mode, double halftone, double brightness, double compress, Promise promise);
|
|
332
|
+
|
|
333
|
+
@ReactMethod
|
|
334
|
+
@DoNotStrip
|
|
335
|
+
public abstract void addBarcode(String target, String data, double type, double hri, double font, double width, double height, Promise promise);
|
|
336
|
+
|
|
337
|
+
@ReactMethod
|
|
338
|
+
@DoNotStrip
|
|
339
|
+
public abstract void addSymbol(String target, String data, double type, double level, double width, double height, double size, Promise promise);
|
|
340
|
+
|
|
341
|
+
@ReactMethod
|
|
342
|
+
@DoNotStrip
|
|
343
|
+
public abstract void addCommand(String target, String data, Promise promise);
|
|
344
|
+
|
|
345
|
+
@ReactMethod
|
|
346
|
+
@DoNotStrip
|
|
347
|
+
public abstract void addPulse(String target, double drawer, double time, Promise promise);
|
|
348
|
+
|
|
349
|
+
@ReactMethod
|
|
350
|
+
@DoNotStrip
|
|
351
|
+
public abstract void addTextAlign(String target, double align, Promise promise);
|
|
352
|
+
|
|
353
|
+
@ReactMethod
|
|
354
|
+
@DoNotStrip
|
|
355
|
+
public abstract void addTextSize(String target, double width, double height, Promise promise);
|
|
356
|
+
|
|
357
|
+
@ReactMethod
|
|
358
|
+
@DoNotStrip
|
|
359
|
+
public abstract void addTextSmooth(String target, double smooth, Promise promise);
|
|
360
|
+
|
|
361
|
+
@ReactMethod
|
|
362
|
+
@DoNotStrip
|
|
363
|
+
public abstract void addTextStyle(String target, double reverse, double ul, double em, double color, Promise promise);
|
|
364
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
cmake_minimum_required(VERSION 3.13)
|
|
7
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
+
|
|
9
|
+
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNEscPosPrinterSpec/*.cpp)
|
|
10
|
+
|
|
11
|
+
add_library(
|
|
12
|
+
react_codegen_RNEscPosPrinterSpec
|
|
13
|
+
OBJECT
|
|
14
|
+
${react_codegen_SRCS}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
target_include_directories(react_codegen_RNEscPosPrinterSpec PUBLIC . react/renderer/components/RNEscPosPrinterSpec)
|
|
18
|
+
|
|
19
|
+
target_link_libraries(
|
|
20
|
+
react_codegen_RNEscPosPrinterSpec
|
|
21
|
+
fbjni
|
|
22
|
+
jsi
|
|
23
|
+
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
+
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
+
reactnative
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
target_compile_reactnative_options(react_codegen_RNEscPosPrinterSpec PRIVATE)
|