@salve-software/react-native-nitro-input-mask 1.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/LICENSE +21 -0
- package/NitroInputMask.podspec +31 -0
- package/README.md +181 -0
- package/android/CMakeLists.txt +32 -0
- package/android/build.gradle +148 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/java/com/nitroinputmask/NitroInputMaskContext.kt +7 -0
- package/android/src/main/java/com/nitroinputmask/NitroInputMaskModule.kt +108 -0
- package/android/src/main/java/com/nitroinputmask/NitroInputMaskPackage.kt +29 -0
- package/android/src/main/java/com/nitroinputmask/NitroInputMaskServiceModule.kt +17 -0
- package/android/src/main/java/com/nitroinputmask/NitroInputMaskTextWatcher.kt +127 -0
- package/android/src/main/java/com/nitroinputmask/engine/CursorEngine.kt +30 -0
- package/android/src/main/java/com/nitroinputmask/engine/MaskEngine.kt +261 -0
- package/android/src/main/java/com/nitroinputmask/engine/MaskEngineFactory.kt +18 -0
- package/android/src/main/java/com/nitroinputmask/engine/MaskEngineProtocol.kt +8 -0
- package/android/src/main/java/com/nitroinputmask/masks/CreditCardMaskEngine.kt +47 -0
- package/android/src/main/java/com/nitroinputmask/masks/CustomMaskEngine.kt +16 -0
- package/android/src/main/java/com/nitroinputmask/masks/DatetimeMaskEngine.kt +38 -0
- package/android/src/main/java/com/nitroinputmask/masks/MoneyMaskEngine.kt +66 -0
- package/ios/Bridge.h +8 -0
- package/ios/NitroInputMaskDelegateProxy.swift +194 -0
- package/ios/NitroInputMaskModule.swift +114 -0
- package/ios/NitroInputMaskServiceModule.swift +11 -0
- package/ios/engine/CursorEngine.swift +52 -0
- package/ios/engine/MaskEngine.swift +221 -0
- package/ios/engine/MaskEngineFactory.swift +16 -0
- package/ios/engine/MaskEngineProtocol.swift +7 -0
- package/ios/masks/CreditCardMaskEngine.swift +57 -0
- package/ios/masks/CustomMaskEngine.swift +16 -0
- package/ios/masks/DatetimeMaskEngine.swift +46 -0
- package/ios/masks/MoneyMaskEngine.swift +66 -0
- package/lib/commonjs/classes/NitroInputMaskService/NitroInputMaskService.class.js +74 -0
- package/lib/commonjs/classes/NitroInputMaskService/NitroInputMaskService.class.js.map +1 -0
- package/lib/commonjs/classes/NitroInputMaskService/index.js +13 -0
- package/lib/commonjs/classes/NitroInputMaskService/index.js.map +1 -0
- package/lib/commonjs/classes/NitroInputMaskService/types/IApplyMaskProps.js +6 -0
- package/lib/commonjs/classes/NitroInputMaskService/types/IApplyMaskProps.js.map +1 -0
- package/lib/commonjs/classes/NitroInputMaskService/types/index.js +2 -0
- package/lib/commonjs/classes/NitroInputMaskService/types/index.js.map +1 -0
- package/lib/commonjs/classes/index.js +17 -0
- package/lib/commonjs/classes/index.js.map +1 -0
- package/lib/commonjs/components/NitroInputMask/index.js +41 -0
- package/lib/commonjs/components/NitroInputMask/index.js.map +1 -0
- package/lib/commonjs/components/NitroInputMask/types/NitroInputMaskProps.js +6 -0
- package/lib/commonjs/components/NitroInputMask/types/NitroInputMaskProps.js.map +1 -0
- package/lib/commonjs/components/NitroInputMask/types/index.js +2 -0
- package/lib/commonjs/components/NitroInputMask/types/index.js.map +1 -0
- package/lib/commonjs/components/index.js +17 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/index.js +39 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/nitro-module.js +17 -0
- package/lib/commonjs/nitro-module.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/nitro-input-mask-service.nitro.js +6 -0
- package/lib/commonjs/specs/nitro-input-mask-service.nitro.js.map +1 -0
- package/lib/commonjs/specs/nitro-input-mask.nitro.js +6 -0
- package/lib/commonjs/specs/nitro-input-mask.nitro.js.map +1 -0
- package/lib/commonjs/types/CreditCardMaskOptions.js +2 -0
- package/lib/commonjs/types/CreditCardMaskOptions.js.map +1 -0
- package/lib/commonjs/types/CustomMaskOptions.js +2 -0
- package/lib/commonjs/types/CustomMaskOptions.js.map +1 -0
- package/lib/commonjs/types/DatetimeMaskOptions.js +2 -0
- package/lib/commonjs/types/DatetimeMaskOptions.js.map +1 -0
- package/lib/commonjs/types/MaskConfig.js +6 -0
- package/lib/commonjs/types/MaskConfig.js.map +1 -0
- package/lib/commonjs/types/MoneyMaskOptions.js +2 -0
- package/lib/commonjs/types/MoneyMaskOptions.js.map +1 -0
- package/lib/commonjs/types/index.js +2 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/module/classes/NitroInputMaskService/NitroInputMaskService.class.js +70 -0
- package/lib/module/classes/NitroInputMaskService/NitroInputMaskService.class.js.map +1 -0
- package/lib/module/classes/NitroInputMaskService/index.js +4 -0
- package/lib/module/classes/NitroInputMaskService/index.js.map +1 -0
- package/lib/module/classes/NitroInputMaskService/types/IApplyMaskProps.js +4 -0
- package/lib/module/classes/NitroInputMaskService/types/IApplyMaskProps.js.map +1 -0
- package/lib/module/classes/NitroInputMaskService/types/index.js +2 -0
- package/lib/module/classes/NitroInputMaskService/types/index.js.map +1 -0
- package/lib/module/classes/index.js +4 -0
- package/lib/module/classes/index.js.map +1 -0
- package/lib/module/components/NitroInputMask/index.js +35 -0
- package/lib/module/components/NitroInputMask/index.js.map +1 -0
- package/lib/module/components/NitroInputMask/types/NitroInputMaskProps.js +4 -0
- package/lib/module/components/NitroInputMask/types/NitroInputMaskProps.js.map +1 -0
- package/lib/module/components/NitroInputMask/types/index.js +2 -0
- package/lib/module/components/NitroInputMask/types/index.js.map +1 -0
- package/lib/module/components/index.js +4 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/nitro-module.js +12 -0
- package/lib/module/nitro-module.js.map +1 -0
- package/lib/module/specs/nitro-input-mask-service.nitro.js +4 -0
- package/lib/module/specs/nitro-input-mask-service.nitro.js.map +1 -0
- package/lib/module/specs/nitro-input-mask.nitro.js +4 -0
- package/lib/module/specs/nitro-input-mask.nitro.js.map +1 -0
- package/lib/module/types/CreditCardMaskOptions.js +2 -0
- package/lib/module/types/CreditCardMaskOptions.js.map +1 -0
- package/lib/module/types/CustomMaskOptions.js +2 -0
- package/lib/module/types/CustomMaskOptions.js.map +1 -0
- package/lib/module/types/DatetimeMaskOptions.js +2 -0
- package/lib/module/types/DatetimeMaskOptions.js.map +1 -0
- package/lib/module/types/MaskConfig.js +4 -0
- package/lib/module/types/MaskConfig.js.map +1 -0
- package/lib/module/types/MoneyMaskOptions.js +2 -0
- package/lib/module/types/MoneyMaskOptions.js.map +1 -0
- package/lib/module/types/index.js +2 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/typescript/src/classes/NitroInputMaskService/NitroInputMaskService.class.d.ts +50 -0
- package/lib/typescript/src/classes/NitroInputMaskService/NitroInputMaskService.class.d.ts.map +1 -0
- package/lib/typescript/src/classes/NitroInputMaskService/index.d.ts +3 -0
- package/lib/typescript/src/classes/NitroInputMaskService/index.d.ts.map +1 -0
- package/lib/typescript/src/classes/NitroInputMaskService/types/IApplyMaskProps.d.ts +5 -0
- package/lib/typescript/src/classes/NitroInputMaskService/types/IApplyMaskProps.d.ts.map +1 -0
- package/lib/typescript/src/classes/NitroInputMaskService/types/index.d.ts +2 -0
- package/lib/typescript/src/classes/NitroInputMaskService/types/index.d.ts.map +1 -0
- package/lib/typescript/src/classes/index.d.ts +2 -0
- package/lib/typescript/src/classes/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroInputMask/index.d.ts +5 -0
- package/lib/typescript/src/components/NitroInputMask/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroInputMask/types/NitroInputMaskProps.d.ts +4 -0
- package/lib/typescript/src/components/NitroInputMask/types/NitroInputMaskProps.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroInputMask/types/index.d.ts +2 -0
- package/lib/typescript/src/components/NitroInputMask/types/index.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +2 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/nitro-module.d.ts +5 -0
- package/lib/typescript/src/nitro-module.d.ts.map +1 -0
- package/lib/typescript/src/specs/nitro-input-mask-service.nitro.d.ts +9 -0
- package/lib/typescript/src/specs/nitro-input-mask-service.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/nitro-input-mask.nitro.d.ts +23 -0
- package/lib/typescript/src/specs/nitro-input-mask.nitro.d.ts.map +1 -0
- package/lib/typescript/src/types/CreditCardMaskOptions.d.ts +5 -0
- package/lib/typescript/src/types/CreditCardMaskOptions.d.ts.map +1 -0
- package/lib/typescript/src/types/CustomMaskOptions.d.ts +4 -0
- package/lib/typescript/src/types/CustomMaskOptions.d.ts.map +1 -0
- package/lib/typescript/src/types/DatetimeMaskOptions.d.ts +4 -0
- package/lib/typescript/src/types/DatetimeMaskOptions.d.ts.map +1 -0
- package/lib/typescript/src/types/MaskConfig.d.ts +18 -0
- package/lib/typescript/src/types/MaskConfig.d.ts.map +1 -0
- package/lib/typescript/src/types/MoneyMaskOptions.d.ts +9 -0
- package/lib/typescript/src/types/MoneyMaskOptions.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +6 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/nitro.json +40 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroInputMask+autolinking.cmake +83 -0
- package/nitrogen/generated/android/NitroInputMask+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroInputMaskOnLoad.cpp +70 -0
- package/nitrogen/generated/android/NitroInputMaskOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputMaskServiceSpec.cpp +57 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputMaskServiceSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputMaskSpec.cpp +68 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputMaskSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JNitroMaskOptions.hpp +94 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinputmask/HybridNitroInputMaskServiceSpec.kt +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinputmask/HybridNitroInputMaskSpec.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinputmask/NitroInputMaskOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinputmask/NitroMaskOptions.kt +96 -0
- package/nitrogen/generated/ios/NitroInputMask+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroInputMask-Swift-Cxx-Bridge.cpp +50 -0
- package/nitrogen/generated/ios/NitroInputMask-Swift-Cxx-Bridge.hpp +124 -0
- package/nitrogen/generated/ios/NitroInputMask-Swift-Cxx-Umbrella.hpp +53 -0
- package/nitrogen/generated/ios/NitroInputMaskAutolinking.mm +41 -0
- package/nitrogen/generated/ios/NitroInputMaskAutolinking.swift +38 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputMaskServiceSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputMaskServiceSpecSwift.hpp +85 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputMaskSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputMaskSpecSwift.hpp +101 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputMaskServiceSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputMaskServiceSpec_cxx.swift +138 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputMaskSpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputMaskSpec_cxx.swift +170 -0
- package/nitrogen/generated/ios/swift/NitroMaskOptions.swift +204 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputMaskServiceSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputMaskServiceSpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputMaskSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputMaskSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/NitroMaskOptions.hpp +120 -0
- package/package.json +136 -0
- package/src/classes/NitroInputMaskService/NitroInputMaskService.class.ts +70 -0
- package/src/classes/NitroInputMaskService/index.ts +2 -0
- package/src/classes/NitroInputMaskService/types/IApplyMaskProps.ts +3 -0
- package/src/classes/NitroInputMaskService/types/index.ts +1 -0
- package/src/classes/index.ts +1 -0
- package/src/components/NitroInputMask/index.tsx +41 -0
- package/src/components/NitroInputMask/types/NitroInputMaskProps.ts +4 -0
- package/src/components/NitroInputMask/types/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/index.ts +3 -0
- package/src/nitro-module.ts +14 -0
- package/src/specs/nitro-input-mask-service.nitro.ts +6 -0
- package/src/specs/nitro-input-mask.nitro.ts +25 -0
- package/src/types/CreditCardMaskOptions.ts +4 -0
- package/src/types/CustomMaskOptions.ts +3 -0
- package/src/types/DatetimeMaskOptions.ts +3 -0
- package/src/types/MaskConfig.ts +10 -0
- package/src/types/MoneyMaskOptions.ts +8 -0
- package/src/types/index.ts +5 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMaskOnLoad.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#ifndef BUILDING_NITROINPUTMASK_WITH_GENERATED_CMAKE_PROJECT
|
|
9
|
+
#error NitroInputMaskOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#include "NitroInputMaskOnLoad.hpp"
|
|
13
|
+
|
|
14
|
+
#include <jni.h>
|
|
15
|
+
#include <fbjni/fbjni.h>
|
|
16
|
+
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
|
+
|
|
18
|
+
#include "JHybridNitroInputMaskServiceSpec.hpp"
|
|
19
|
+
#include "JHybridNitroInputMaskSpec.hpp"
|
|
20
|
+
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
21
|
+
|
|
22
|
+
namespace margelo::nitro::nitroinputmask {
|
|
23
|
+
|
|
24
|
+
int initialize(JavaVM* vm) {
|
|
25
|
+
return facebook::jni::initialize(vm, []() {
|
|
26
|
+
::margelo::nitro::nitroinputmask::registerAllNatives();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
struct JHybridNitroInputMaskSpecImpl: public jni::JavaClass<JHybridNitroInputMaskSpecImpl, JHybridNitroInputMaskSpec::JavaPart> {
|
|
31
|
+
static constexpr auto kJavaDescriptor = "Lcom/nitroinputmask/HybridNitroInputMaskModule;";
|
|
32
|
+
static std::shared_ptr<JHybridNitroInputMaskSpec> create() {
|
|
33
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroInputMaskSpecImpl::javaobject()>();
|
|
34
|
+
jni::local_ref<JHybridNitroInputMaskSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
35
|
+
return javaPart->getJHybridNitroInputMaskSpec();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
struct JHybridNitroInputMaskServiceSpecImpl: public jni::JavaClass<JHybridNitroInputMaskServiceSpecImpl, JHybridNitroInputMaskServiceSpec::JavaPart> {
|
|
39
|
+
static constexpr auto kJavaDescriptor = "Lcom/nitroinputmask/HybridNitroInputMaskServiceModule;";
|
|
40
|
+
static std::shared_ptr<JHybridNitroInputMaskServiceSpec> create() {
|
|
41
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroInputMaskServiceSpecImpl::javaobject()>();
|
|
42
|
+
jni::local_ref<JHybridNitroInputMaskServiceSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
43
|
+
return javaPart->getJHybridNitroInputMaskServiceSpec();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
void registerAllNatives() {
|
|
48
|
+
using namespace margelo::nitro;
|
|
49
|
+
using namespace margelo::nitro::nitroinputmask;
|
|
50
|
+
|
|
51
|
+
// Register native JNI methods
|
|
52
|
+
margelo::nitro::nitroinputmask::JHybridNitroInputMaskServiceSpec::CxxPart::registerNatives();
|
|
53
|
+
margelo::nitro::nitroinputmask::JHybridNitroInputMaskSpec::CxxPart::registerNatives();
|
|
54
|
+
|
|
55
|
+
// Register Nitro Hybrid Objects
|
|
56
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
57
|
+
"NitroInputMask",
|
|
58
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
59
|
+
return JHybridNitroInputMaskSpecImpl::create();
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
63
|
+
"NitroInputMaskService",
|
|
64
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
65
|
+
return JHybridNitroInputMaskServiceSpecImpl::create();
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMaskOnLoad.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <jni.h>
|
|
9
|
+
#include <functional>
|
|
10
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
11
|
+
|
|
12
|
+
namespace margelo::nitro::nitroinputmask {
|
|
13
|
+
|
|
14
|
+
[[deprecated("Use registerNatives() instead.")]]
|
|
15
|
+
int initialize(JavaVM* vm);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Register the native (C++) part of NitroInputMask, and autolinks all Hybrid Objects.
|
|
19
|
+
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
|
|
20
|
+
* inside a `facebook::jni::initialize(vm, ...)` call.
|
|
21
|
+
* Example:
|
|
22
|
+
* ```cpp (cpp-adapter.cpp)
|
|
23
|
+
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
24
|
+
* return facebook::jni::initialize(vm, []() {
|
|
25
|
+
* // register all NitroInputMask HybridObjects
|
|
26
|
+
* margelo::nitro::nitroinputmask::registerNatives();
|
|
27
|
+
* // any other custom registrations go here.
|
|
28
|
+
* });
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
void registerAllNatives();
|
|
33
|
+
|
|
34
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridNitroInputMaskServiceSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridNitroInputMaskServiceSpec.hpp"
|
|
9
|
+
|
|
10
|
+
// Forward declaration of `NitroMaskOptions` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::nitroinputmask { struct NitroMaskOptions; }
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
#include "NitroMaskOptions.hpp"
|
|
15
|
+
#include "JNitroMaskOptions.hpp"
|
|
16
|
+
#include <optional>
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::nitroinputmask {
|
|
19
|
+
|
|
20
|
+
std::shared_ptr<JHybridNitroInputMaskServiceSpec> JHybridNitroInputMaskServiceSpec::JavaPart::getJHybridNitroInputMaskServiceSpec() {
|
|
21
|
+
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
22
|
+
auto castHybridObject = std::dynamic_pointer_cast<JHybridNitroInputMaskServiceSpec>(hybridObject);
|
|
23
|
+
if (castHybridObject == nullptr) [[unlikely]] {
|
|
24
|
+
throw std::runtime_error("Failed to downcast JHybridObject to JHybridNitroInputMaskServiceSpec!");
|
|
25
|
+
}
|
|
26
|
+
return castHybridObject;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
jni::local_ref<JHybridNitroInputMaskServiceSpec::CxxPart::jhybriddata> JHybridNitroInputMaskServiceSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
30
|
+
return makeCxxInstance(jThis);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
std::shared_ptr<JHybridObject> JHybridNitroInputMaskServiceSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
34
|
+
auto castJavaPart = jni::dynamic_ref_cast<JHybridNitroInputMaskServiceSpec::JavaPart>(javaPart);
|
|
35
|
+
if (castJavaPart == nullptr) [[unlikely]] {
|
|
36
|
+
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridNitroInputMaskServiceSpec::JavaPart!");
|
|
37
|
+
}
|
|
38
|
+
return std::make_shared<JHybridNitroInputMaskServiceSpec>(castJavaPart);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
void JHybridNitroInputMaskServiceSpec::CxxPart::registerNatives() {
|
|
42
|
+
registerHybrid({
|
|
43
|
+
makeNativeMethod("initHybrid", JHybridNitroInputMaskServiceSpec::CxxPart::initHybrid),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Properties
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// Methods
|
|
51
|
+
std::string JHybridNitroInputMaskServiceSpec::applyMask(const std::string& value, const std::string& maskType, const NitroMaskOptions& options) {
|
|
52
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>(jni::alias_ref<jni::JString> /* value */, jni::alias_ref<jni::JString> /* maskType */, jni::alias_ref<JNitroMaskOptions> /* options */)>("applyMask");
|
|
53
|
+
auto __result = method(_javaPart, jni::make_jstring(value), jni::make_jstring(maskType), JNitroMaskOptions::fromCpp(options));
|
|
54
|
+
return __result->toStdString();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroInputMaskServiceSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridNitroInputMaskServiceSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitroinputmask {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridNitroInputMaskServiceSpec: public virtual HybridNitroInputMaskServiceSpec, public virtual JHybridObject {
|
|
22
|
+
public:
|
|
23
|
+
struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinputmask/HybridNitroInputMaskServiceSpec;";
|
|
25
|
+
std::shared_ptr<JHybridNitroInputMaskServiceSpec> getJHybridNitroInputMaskServiceSpec();
|
|
26
|
+
};
|
|
27
|
+
struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinputmask/HybridNitroInputMaskServiceSpec$CxxPart;";
|
|
29
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
30
|
+
static void registerNatives();
|
|
31
|
+
using HybridBase::HybridBase;
|
|
32
|
+
protected:
|
|
33
|
+
std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
explicit JHybridNitroInputMaskServiceSpec(const jni::local_ref<JHybridNitroInputMaskServiceSpec::JavaPart>& javaPart):
|
|
38
|
+
HybridObject(HybridNitroInputMaskServiceSpec::TAG),
|
|
39
|
+
JHybridObject(javaPart),
|
|
40
|
+
_javaPart(jni::make_global(javaPart)) {}
|
|
41
|
+
~JHybridNitroInputMaskServiceSpec() override {
|
|
42
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
43
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridNitroInputMaskServiceSpec::JavaPart>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
// Methods
|
|
57
|
+
std::string applyMask(const std::string& value, const std::string& maskType, const NitroMaskOptions& options) override;
|
|
58
|
+
|
|
59
|
+
private:
|
|
60
|
+
jni::global_ref<JHybridNitroInputMaskServiceSpec::JavaPart> _javaPart;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridNitroInputMaskSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridNitroInputMaskSpec.hpp"
|
|
9
|
+
|
|
10
|
+
// Forward declaration of `NitroMaskOptions` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::nitroinputmask { struct NitroMaskOptions; }
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
#include "NitroMaskOptions.hpp"
|
|
15
|
+
#include "JNitroMaskOptions.hpp"
|
|
16
|
+
#include <optional>
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::nitroinputmask {
|
|
19
|
+
|
|
20
|
+
std::shared_ptr<JHybridNitroInputMaskSpec> JHybridNitroInputMaskSpec::JavaPart::getJHybridNitroInputMaskSpec() {
|
|
21
|
+
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
22
|
+
auto castHybridObject = std::dynamic_pointer_cast<JHybridNitroInputMaskSpec>(hybridObject);
|
|
23
|
+
if (castHybridObject == nullptr) [[unlikely]] {
|
|
24
|
+
throw std::runtime_error("Failed to downcast JHybridObject to JHybridNitroInputMaskSpec!");
|
|
25
|
+
}
|
|
26
|
+
return castHybridObject;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
jni::local_ref<JHybridNitroInputMaskSpec::CxxPart::jhybriddata> JHybridNitroInputMaskSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
30
|
+
return makeCxxInstance(jThis);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
std::shared_ptr<JHybridObject> JHybridNitroInputMaskSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
34
|
+
auto castJavaPart = jni::dynamic_ref_cast<JHybridNitroInputMaskSpec::JavaPart>(javaPart);
|
|
35
|
+
if (castJavaPart == nullptr) [[unlikely]] {
|
|
36
|
+
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridNitroInputMaskSpec::JavaPart!");
|
|
37
|
+
}
|
|
38
|
+
return std::make_shared<JHybridNitroInputMaskSpec>(castJavaPart);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
void JHybridNitroInputMaskSpec::CxxPart::registerNatives() {
|
|
42
|
+
registerHybrid({
|
|
43
|
+
makeNativeMethod("initHybrid", JHybridNitroInputMaskSpec::CxxPart::initHybrid),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Properties
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// Methods
|
|
51
|
+
void JHybridNitroInputMaskSpec::attach(const std::string& nativeID, const std::string& maskType, const NitroMaskOptions& options) {
|
|
52
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* nativeID */, jni::alias_ref<jni::JString> /* maskType */, jni::alias_ref<JNitroMaskOptions> /* options */)>("attach");
|
|
53
|
+
method(_javaPart, jni::make_jstring(nativeID), jni::make_jstring(maskType), JNitroMaskOptions::fromCpp(options));
|
|
54
|
+
}
|
|
55
|
+
void JHybridNitroInputMaskSpec::detach(const std::string& nativeID) {
|
|
56
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* nativeID */)>("detach");
|
|
57
|
+
method(_javaPart, jni::make_jstring(nativeID));
|
|
58
|
+
}
|
|
59
|
+
void JHybridNitroInputMaskSpec::updateMask(const std::string& nativeID, const std::string& maskType, const NitroMaskOptions& options) {
|
|
60
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* nativeID */, jni::alias_ref<jni::JString> /* maskType */, jni::alias_ref<JNitroMaskOptions> /* options */)>("updateMask");
|
|
61
|
+
method(_javaPart, jni::make_jstring(nativeID), jni::make_jstring(maskType), JNitroMaskOptions::fromCpp(options));
|
|
62
|
+
}
|
|
63
|
+
void JHybridNitroInputMaskSpec::setValue(const std::string& nativeID, const std::string& rawValue) {
|
|
64
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* nativeID */, jni::alias_ref<jni::JString> /* rawValue */)>("setValue");
|
|
65
|
+
method(_javaPart, jni::make_jstring(nativeID), jni::make_jstring(rawValue));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroInputMaskSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridNitroInputMaskSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitroinputmask {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridNitroInputMaskSpec: public virtual HybridNitroInputMaskSpec, public virtual JHybridObject {
|
|
22
|
+
public:
|
|
23
|
+
struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinputmask/HybridNitroInputMaskSpec;";
|
|
25
|
+
std::shared_ptr<JHybridNitroInputMaskSpec> getJHybridNitroInputMaskSpec();
|
|
26
|
+
};
|
|
27
|
+
struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinputmask/HybridNitroInputMaskSpec$CxxPart;";
|
|
29
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
30
|
+
static void registerNatives();
|
|
31
|
+
using HybridBase::HybridBase;
|
|
32
|
+
protected:
|
|
33
|
+
std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
explicit JHybridNitroInputMaskSpec(const jni::local_ref<JHybridNitroInputMaskSpec::JavaPart>& javaPart):
|
|
38
|
+
HybridObject(HybridNitroInputMaskSpec::TAG),
|
|
39
|
+
JHybridObject(javaPart),
|
|
40
|
+
_javaPart(jni::make_global(javaPart)) {}
|
|
41
|
+
~JHybridNitroInputMaskSpec() override {
|
|
42
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
43
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridNitroInputMaskSpec::JavaPart>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
// Methods
|
|
57
|
+
void attach(const std::string& nativeID, const std::string& maskType, const NitroMaskOptions& options) override;
|
|
58
|
+
void detach(const std::string& nativeID) override;
|
|
59
|
+
void updateMask(const std::string& nativeID, const std::string& maskType, const NitroMaskOptions& options) override;
|
|
60
|
+
void setValue(const std::string& nativeID, const std::string& rawValue) override;
|
|
61
|
+
|
|
62
|
+
private:
|
|
63
|
+
jni::global_ref<JHybridNitroInputMaskSpec::JavaPart> _javaPart;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNitroMaskOptions.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "NitroMaskOptions.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::nitroinputmask {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "NitroMaskOptions" and the the Kotlin data class "NitroMaskOptions".
|
|
22
|
+
*/
|
|
23
|
+
struct JNitroMaskOptions final: public jni::JavaClass<JNitroMaskOptions> {
|
|
24
|
+
public:
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinputmask/NitroMaskOptions;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NitroMaskOptions by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
NitroMaskOptions toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldMask = clazz->getField<jni::JString>("mask");
|
|
36
|
+
jni::local_ref<jni::JString> mask = this->getFieldValue(fieldMask);
|
|
37
|
+
static const auto fieldPrecision = clazz->getField<jni::JDouble>("precision");
|
|
38
|
+
jni::local_ref<jni::JDouble> precision = this->getFieldValue(fieldPrecision);
|
|
39
|
+
static const auto fieldSeparator = clazz->getField<jni::JString>("separator");
|
|
40
|
+
jni::local_ref<jni::JString> separator = this->getFieldValue(fieldSeparator);
|
|
41
|
+
static const auto fieldDelimiter = clazz->getField<jni::JString>("delimiter");
|
|
42
|
+
jni::local_ref<jni::JString> delimiter = this->getFieldValue(fieldDelimiter);
|
|
43
|
+
static const auto fieldUnit = clazz->getField<jni::JString>("unit");
|
|
44
|
+
jni::local_ref<jni::JString> unit = this->getFieldValue(fieldUnit);
|
|
45
|
+
static const auto fieldSuffixUnit = clazz->getField<jni::JString>("suffixUnit");
|
|
46
|
+
jni::local_ref<jni::JString> suffixUnit = this->getFieldValue(fieldSuffixUnit);
|
|
47
|
+
static const auto fieldZeroCents = clazz->getField<jni::JBoolean>("zeroCents");
|
|
48
|
+
jni::local_ref<jni::JBoolean> zeroCents = this->getFieldValue(fieldZeroCents);
|
|
49
|
+
static const auto fieldFormat = clazz->getField<jni::JString>("format");
|
|
50
|
+
jni::local_ref<jni::JString> format = this->getFieldValue(fieldFormat);
|
|
51
|
+
static const auto fieldIssuer = clazz->getField<jni::JString>("issuer");
|
|
52
|
+
jni::local_ref<jni::JString> issuer = this->getFieldValue(fieldIssuer);
|
|
53
|
+
static const auto fieldObfuscated = clazz->getField<jni::JBoolean>("obfuscated");
|
|
54
|
+
jni::local_ref<jni::JBoolean> obfuscated = this->getFieldValue(fieldObfuscated);
|
|
55
|
+
return NitroMaskOptions(
|
|
56
|
+
mask != nullptr ? std::make_optional(mask->toStdString()) : std::nullopt,
|
|
57
|
+
precision != nullptr ? std::make_optional(precision->value()) : std::nullopt,
|
|
58
|
+
separator != nullptr ? std::make_optional(separator->toStdString()) : std::nullopt,
|
|
59
|
+
delimiter != nullptr ? std::make_optional(delimiter->toStdString()) : std::nullopt,
|
|
60
|
+
unit != nullptr ? std::make_optional(unit->toStdString()) : std::nullopt,
|
|
61
|
+
suffixUnit != nullptr ? std::make_optional(suffixUnit->toStdString()) : std::nullopt,
|
|
62
|
+
zeroCents != nullptr ? std::make_optional(static_cast<bool>(zeroCents->value())) : std::nullopt,
|
|
63
|
+
format != nullptr ? std::make_optional(format->toStdString()) : std::nullopt,
|
|
64
|
+
issuer != nullptr ? std::make_optional(issuer->toStdString()) : std::nullopt,
|
|
65
|
+
obfuscated != nullptr ? std::make_optional(static_cast<bool>(obfuscated->value())) : std::nullopt
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public:
|
|
70
|
+
/**
|
|
71
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
72
|
+
*/
|
|
73
|
+
[[maybe_unused]]
|
|
74
|
+
static jni::local_ref<JNitroMaskOptions::javaobject> fromCpp(const NitroMaskOptions& value) {
|
|
75
|
+
using JSignature = JNitroMaskOptions(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>);
|
|
76
|
+
static const auto clazz = javaClassStatic();
|
|
77
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
78
|
+
return create(
|
|
79
|
+
clazz,
|
|
80
|
+
value.mask.has_value() ? jni::make_jstring(value.mask.value()) : nullptr,
|
|
81
|
+
value.precision.has_value() ? jni::JDouble::valueOf(value.precision.value()) : nullptr,
|
|
82
|
+
value.separator.has_value() ? jni::make_jstring(value.separator.value()) : nullptr,
|
|
83
|
+
value.delimiter.has_value() ? jni::make_jstring(value.delimiter.value()) : nullptr,
|
|
84
|
+
value.unit.has_value() ? jni::make_jstring(value.unit.value()) : nullptr,
|
|
85
|
+
value.suffixUnit.has_value() ? jni::make_jstring(value.suffixUnit.value()) : nullptr,
|
|
86
|
+
value.zeroCents.has_value() ? jni::JBoolean::valueOf(value.zeroCents.value()) : nullptr,
|
|
87
|
+
value.format.has_value() ? jni::make_jstring(value.format.value()) : nullptr,
|
|
88
|
+
value.issuer.has_value() ? jni::make_jstring(value.issuer.value()) : nullptr,
|
|
89
|
+
value.obfuscated.has_value() ? jni::JBoolean::valueOf(value.obfuscated.value()) : nullptr
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroInputMaskServiceSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitroinputmask
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.HybridObject
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Kotlin class representing the NitroInputMaskService HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of NitroInputMaskService.
|
|
18
|
+
*/
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
@Keep
|
|
21
|
+
@Suppress(
|
|
22
|
+
"KotlinJniMissingFunction", "unused",
|
|
23
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
+
)
|
|
26
|
+
abstract class HybridNitroInputMaskServiceSpec: HybridObject() {
|
|
27
|
+
// Properties
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Methods
|
|
31
|
+
@DoNotStrip
|
|
32
|
+
@Keep
|
|
33
|
+
abstract fun applyMask(value: String, maskType: String, options: NitroMaskOptions): String
|
|
34
|
+
|
|
35
|
+
// Default implementation of `HybridObject.toString()`
|
|
36
|
+
override fun toString(): String {
|
|
37
|
+
return "[HybridObject NitroInputMaskService]"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// C++ backing class
|
|
41
|
+
@DoNotStrip
|
|
42
|
+
@Keep
|
|
43
|
+
protected open class CxxPart(javaPart: HybridNitroInputMaskServiceSpec): HybridObject.CxxPart(javaPart) {
|
|
44
|
+
// C++ JHybridNitroInputMaskServiceSpec::CxxPart::initHybrid(...)
|
|
45
|
+
external override fun initHybrid(): HybridData
|
|
46
|
+
}
|
|
47
|
+
override fun createCxxPart(): CxxPart {
|
|
48
|
+
return CxxPart(this)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
companion object {
|
|
52
|
+
protected const val TAG = "HybridNitroInputMaskServiceSpec"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroInputMaskSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitroinputmask
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.HybridObject
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Kotlin class representing the NitroInputMask HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of NitroInputMask.
|
|
18
|
+
*/
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
@Keep
|
|
21
|
+
@Suppress(
|
|
22
|
+
"KotlinJniMissingFunction", "unused",
|
|
23
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
+
)
|
|
26
|
+
abstract class HybridNitroInputMaskSpec: HybridObject() {
|
|
27
|
+
// Properties
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Methods
|
|
31
|
+
@DoNotStrip
|
|
32
|
+
@Keep
|
|
33
|
+
abstract fun attach(nativeID: String, maskType: String, options: NitroMaskOptions): Unit
|
|
34
|
+
|
|
35
|
+
@DoNotStrip
|
|
36
|
+
@Keep
|
|
37
|
+
abstract fun detach(nativeID: String): Unit
|
|
38
|
+
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
abstract fun updateMask(nativeID: String, maskType: String, options: NitroMaskOptions): Unit
|
|
42
|
+
|
|
43
|
+
@DoNotStrip
|
|
44
|
+
@Keep
|
|
45
|
+
abstract fun setValue(nativeID: String, rawValue: String): Unit
|
|
46
|
+
|
|
47
|
+
// Default implementation of `HybridObject.toString()`
|
|
48
|
+
override fun toString(): String {
|
|
49
|
+
return "[HybridObject NitroInputMask]"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// C++ backing class
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
@Keep
|
|
55
|
+
protected open class CxxPart(javaPart: HybridNitroInputMaskSpec): HybridObject.CxxPart(javaPart) {
|
|
56
|
+
// C++ JHybridNitroInputMaskSpec::CxxPart::initHybrid(...)
|
|
57
|
+
external override fun initHybrid(): HybridData
|
|
58
|
+
}
|
|
59
|
+
override fun createCxxPart(): CxxPart {
|
|
60
|
+
return CxxPart(this)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
companion object {
|
|
64
|
+
protected const val TAG = "HybridNitroInputMaskSpec"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinputmask/NitroInputMaskOnLoad.kt
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMaskOnLoad.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitroinputmask
|
|
9
|
+
|
|
10
|
+
import android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class NitroInputMaskOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "NitroInputMaskOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "NitroInputMask".
|
|
18
|
+
* This method is idempotent and can be called more than once.
|
|
19
|
+
*/
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun initializeNative() {
|
|
22
|
+
if (didLoad) return
|
|
23
|
+
try {
|
|
24
|
+
Log.i(TAG, "Loading NitroInputMask C++ library...")
|
|
25
|
+
System.loadLibrary("NitroInputMask")
|
|
26
|
+
Log.i(TAG, "Successfully loaded NitroInputMask C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load NitroInputMask C++ library! Is it properly installed and linked? " +
|
|
30
|
+
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
+
throw e
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|