@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
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinputmask/NitroMaskOptions.kt
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroMaskOptions.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.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "NitroMaskOptions".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class NitroMaskOptions(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val mask: String?,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val precision: Double?,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val separator: String?,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val delimiter: String?,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val unit: String?,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val suffixUnit: String?,
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
val zeroCents: Boolean?,
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
@Keep
|
|
44
|
+
val format: String?,
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
@Keep
|
|
47
|
+
val issuer: String?,
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
val obfuscated: Boolean?
|
|
51
|
+
) {
|
|
52
|
+
/* primary constructor */
|
|
53
|
+
|
|
54
|
+
override fun equals(other: Any?): Boolean {
|
|
55
|
+
if (this === other) return true
|
|
56
|
+
if (other !is NitroMaskOptions) return false
|
|
57
|
+
return Objects.deepEquals(this.mask, other.mask)
|
|
58
|
+
&& Objects.deepEquals(this.precision, other.precision)
|
|
59
|
+
&& Objects.deepEquals(this.separator, other.separator)
|
|
60
|
+
&& Objects.deepEquals(this.delimiter, other.delimiter)
|
|
61
|
+
&& Objects.deepEquals(this.unit, other.unit)
|
|
62
|
+
&& Objects.deepEquals(this.suffixUnit, other.suffixUnit)
|
|
63
|
+
&& Objects.deepEquals(this.zeroCents, other.zeroCents)
|
|
64
|
+
&& Objects.deepEquals(this.format, other.format)
|
|
65
|
+
&& Objects.deepEquals(this.issuer, other.issuer)
|
|
66
|
+
&& Objects.deepEquals(this.obfuscated, other.obfuscated)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
override fun hashCode(): Int {
|
|
70
|
+
return arrayOf(
|
|
71
|
+
mask,
|
|
72
|
+
precision,
|
|
73
|
+
separator,
|
|
74
|
+
delimiter,
|
|
75
|
+
unit,
|
|
76
|
+
suffixUnit,
|
|
77
|
+
zeroCents,
|
|
78
|
+
format,
|
|
79
|
+
issuer,
|
|
80
|
+
obfuscated
|
|
81
|
+
).contentDeepHashCode()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
companion object {
|
|
85
|
+
/**
|
|
86
|
+
* Constructor called from C++
|
|
87
|
+
*/
|
|
88
|
+
@DoNotStrip
|
|
89
|
+
@Keep
|
|
90
|
+
@Suppress("unused")
|
|
91
|
+
@JvmStatic
|
|
92
|
+
private fun fromCpp(mask: String?, precision: Double?, separator: String?, delimiter: String?, unit: String?, suffixUnit: String?, zeroCents: Boolean?, format: String?, issuer: String?, obfuscated: Boolean?): NitroMaskOptions {
|
|
93
|
+
return NitroMaskOptions(mask, precision, separator, delimiter, unit, suffixUnit, zeroCents, format, issuer, obfuscated)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NitroInputMask+autolinking.rb
|
|
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
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/NitroInputMask+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 NitroInputMask is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/NitroInputMask-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
# Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
|
|
60
|
+
"SWIFT_INSTALL_OBJC_HEADER" => "NO",
|
|
61
|
+
})
|
|
62
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMask-Swift-Cxx-Bridge.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 "NitroInputMask-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridNitroInputMaskServiceSpecSwift.hpp"
|
|
12
|
+
#include "HybridNitroInputMaskSpecSwift.hpp"
|
|
13
|
+
#include "NitroInputMask-Swift-Cxx-Umbrella.hpp"
|
|
14
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::nitroinputmask::bridge::swift {
|
|
17
|
+
|
|
18
|
+
// pragma MARK: std::shared_ptr<HybridNitroInputMaskServiceSpec>
|
|
19
|
+
std::shared_ptr<HybridNitroInputMaskServiceSpec> create_std__shared_ptr_HybridNitroInputMaskServiceSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
20
|
+
NitroInputMask::HybridNitroInputMaskServiceSpec_cxx swiftPart = NitroInputMask::HybridNitroInputMaskServiceSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
21
|
+
return std::make_shared<margelo::nitro::nitroinputmask::HybridNitroInputMaskServiceSpecSwift>(swiftPart);
|
|
22
|
+
}
|
|
23
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroInputMaskServiceSpec_(std__shared_ptr_HybridNitroInputMaskServiceSpec_ cppType) {
|
|
24
|
+
std::shared_ptr<margelo::nitro::nitroinputmask::HybridNitroInputMaskServiceSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitroinputmask::HybridNitroInputMaskServiceSpecSwift>(cppType);
|
|
25
|
+
#ifdef NITRO_DEBUG
|
|
26
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
27
|
+
throw std::runtime_error("Class \"HybridNitroInputMaskServiceSpec\" is not implemented in Swift!");
|
|
28
|
+
}
|
|
29
|
+
#endif
|
|
30
|
+
NitroInputMask::HybridNitroInputMaskServiceSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
31
|
+
return swiftPart.toUnsafe();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// pragma MARK: std::shared_ptr<HybridNitroInputMaskSpec>
|
|
35
|
+
std::shared_ptr<HybridNitroInputMaskSpec> create_std__shared_ptr_HybridNitroInputMaskSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
36
|
+
NitroInputMask::HybridNitroInputMaskSpec_cxx swiftPart = NitroInputMask::HybridNitroInputMaskSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
37
|
+
return std::make_shared<margelo::nitro::nitroinputmask::HybridNitroInputMaskSpecSwift>(swiftPart);
|
|
38
|
+
}
|
|
39
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroInputMaskSpec_(std__shared_ptr_HybridNitroInputMaskSpec_ cppType) {
|
|
40
|
+
std::shared_ptr<margelo::nitro::nitroinputmask::HybridNitroInputMaskSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitroinputmask::HybridNitroInputMaskSpecSwift>(cppType);
|
|
41
|
+
#ifdef NITRO_DEBUG
|
|
42
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
43
|
+
throw std::runtime_error("Class \"HybridNitroInputMaskSpec\" is not implemented in Swift!");
|
|
44
|
+
}
|
|
45
|
+
#endif
|
|
46
|
+
NitroInputMask::HybridNitroInputMaskSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
47
|
+
return swiftPart.toUnsafe();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
} // namespace margelo::nitro::nitroinputmask::bridge::swift
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMask-Swift-Cxx-Bridge.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
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridNitroInputMaskServiceSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::nitroinputmask { class HybridNitroInputMaskServiceSpec; }
|
|
13
|
+
// Forward declaration of `HybridNitroInputMaskSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitroinputmask { class HybridNitroInputMaskSpec; }
|
|
15
|
+
|
|
16
|
+
// Forward declarations of Swift defined types
|
|
17
|
+
// Forward declaration of `HybridNitroInputMaskServiceSpec_cxx` to properly resolve imports.
|
|
18
|
+
namespace NitroInputMask { class HybridNitroInputMaskServiceSpec_cxx; }
|
|
19
|
+
// Forward declaration of `HybridNitroInputMaskSpec_cxx` to properly resolve imports.
|
|
20
|
+
namespace NitroInputMask { class HybridNitroInputMaskSpec_cxx; }
|
|
21
|
+
|
|
22
|
+
// Include C++ defined types
|
|
23
|
+
#include "HybridNitroInputMaskServiceSpec.hpp"
|
|
24
|
+
#include "HybridNitroInputMaskSpec.hpp"
|
|
25
|
+
#include <NitroModules/Result.hpp>
|
|
26
|
+
#include <exception>
|
|
27
|
+
#include <memory>
|
|
28
|
+
#include <optional>
|
|
29
|
+
#include <string>
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
33
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
34
|
+
*/
|
|
35
|
+
namespace margelo::nitro::nitroinputmask::bridge::swift {
|
|
36
|
+
|
|
37
|
+
// pragma MARK: std::optional<std::string>
|
|
38
|
+
/**
|
|
39
|
+
* Specialized version of `std::optional<std::string>`.
|
|
40
|
+
*/
|
|
41
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
42
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
43
|
+
return std::optional<std::string>(value);
|
|
44
|
+
}
|
|
45
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
46
|
+
return optional.has_value();
|
|
47
|
+
}
|
|
48
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
49
|
+
return optional.value();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// pragma MARK: std::optional<double>
|
|
53
|
+
/**
|
|
54
|
+
* Specialized version of `std::optional<double>`.
|
|
55
|
+
*/
|
|
56
|
+
using std__optional_double_ = std::optional<double>;
|
|
57
|
+
inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
|
|
58
|
+
return std::optional<double>(value);
|
|
59
|
+
}
|
|
60
|
+
inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
61
|
+
return optional.has_value();
|
|
62
|
+
}
|
|
63
|
+
inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
64
|
+
return optional.value();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// pragma MARK: std::optional<bool>
|
|
68
|
+
/**
|
|
69
|
+
* Specialized version of `std::optional<bool>`.
|
|
70
|
+
*/
|
|
71
|
+
using std__optional_bool_ = std::optional<bool>;
|
|
72
|
+
inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
|
|
73
|
+
return std::optional<bool>(value);
|
|
74
|
+
}
|
|
75
|
+
inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
76
|
+
return optional.has_value();
|
|
77
|
+
}
|
|
78
|
+
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
79
|
+
return optional.value();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// pragma MARK: std::shared_ptr<HybridNitroInputMaskServiceSpec>
|
|
83
|
+
/**
|
|
84
|
+
* Specialized version of `std::shared_ptr<HybridNitroInputMaskServiceSpec>`.
|
|
85
|
+
*/
|
|
86
|
+
using std__shared_ptr_HybridNitroInputMaskServiceSpec_ = std::shared_ptr<HybridNitroInputMaskServiceSpec>;
|
|
87
|
+
std::shared_ptr<HybridNitroInputMaskServiceSpec> create_std__shared_ptr_HybridNitroInputMaskServiceSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
88
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroInputMaskServiceSpec_(std__shared_ptr_HybridNitroInputMaskServiceSpec_ cppType);
|
|
89
|
+
|
|
90
|
+
// pragma MARK: std::weak_ptr<HybridNitroInputMaskServiceSpec>
|
|
91
|
+
using std__weak_ptr_HybridNitroInputMaskServiceSpec_ = std::weak_ptr<HybridNitroInputMaskServiceSpec>;
|
|
92
|
+
inline std__weak_ptr_HybridNitroInputMaskServiceSpec_ weakify_std__shared_ptr_HybridNitroInputMaskServiceSpec_(const std::shared_ptr<HybridNitroInputMaskServiceSpec>& strong) noexcept { return strong; }
|
|
93
|
+
|
|
94
|
+
// pragma MARK: Result<std::string>
|
|
95
|
+
using Result_std__string_ = Result<std::string>;
|
|
96
|
+
inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept {
|
|
97
|
+
return Result<std::string>::withValue(value);
|
|
98
|
+
}
|
|
99
|
+
inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept {
|
|
100
|
+
return Result<std::string>::withError(error);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// pragma MARK: std::shared_ptr<HybridNitroInputMaskSpec>
|
|
104
|
+
/**
|
|
105
|
+
* Specialized version of `std::shared_ptr<HybridNitroInputMaskSpec>`.
|
|
106
|
+
*/
|
|
107
|
+
using std__shared_ptr_HybridNitroInputMaskSpec_ = std::shared_ptr<HybridNitroInputMaskSpec>;
|
|
108
|
+
std::shared_ptr<HybridNitroInputMaskSpec> create_std__shared_ptr_HybridNitroInputMaskSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
109
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroInputMaskSpec_(std__shared_ptr_HybridNitroInputMaskSpec_ cppType);
|
|
110
|
+
|
|
111
|
+
// pragma MARK: std::weak_ptr<HybridNitroInputMaskSpec>
|
|
112
|
+
using std__weak_ptr_HybridNitroInputMaskSpec_ = std::weak_ptr<HybridNitroInputMaskSpec>;
|
|
113
|
+
inline std__weak_ptr_HybridNitroInputMaskSpec_ weakify_std__shared_ptr_HybridNitroInputMaskSpec_(const std::shared_ptr<HybridNitroInputMaskSpec>& strong) noexcept { return strong; }
|
|
114
|
+
|
|
115
|
+
// pragma MARK: Result<void>
|
|
116
|
+
using Result_void_ = Result<void>;
|
|
117
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
118
|
+
return Result<void>::withValue();
|
|
119
|
+
}
|
|
120
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
121
|
+
return Result<void>::withError(error);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
} // namespace margelo::nitro::nitroinputmask::bridge::swift
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMask-Swift-Cxx-Umbrella.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
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridNitroInputMaskServiceSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::nitroinputmask { class HybridNitroInputMaskServiceSpec; }
|
|
13
|
+
// Forward declaration of `HybridNitroInputMaskSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitroinputmask { class HybridNitroInputMaskSpec; }
|
|
15
|
+
// Forward declaration of `NitroMaskOptions` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::nitroinputmask { struct NitroMaskOptions; }
|
|
17
|
+
|
|
18
|
+
// Include C++ defined types
|
|
19
|
+
#include "HybridNitroInputMaskServiceSpec.hpp"
|
|
20
|
+
#include "HybridNitroInputMaskSpec.hpp"
|
|
21
|
+
#include "NitroMaskOptions.hpp"
|
|
22
|
+
#include <NitroModules/Result.hpp>
|
|
23
|
+
#include <exception>
|
|
24
|
+
#include <memory>
|
|
25
|
+
#include <optional>
|
|
26
|
+
#include <string>
|
|
27
|
+
|
|
28
|
+
// C++ helpers for Swift
|
|
29
|
+
#include "NitroInputMask-Swift-Cxx-Bridge.hpp"
|
|
30
|
+
|
|
31
|
+
// Common C++ types used in Swift
|
|
32
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
33
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
34
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
35
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
36
|
+
|
|
37
|
+
// Forward declarations of Swift defined types
|
|
38
|
+
// Forward declaration of `HybridNitroInputMaskServiceSpec_cxx` to properly resolve imports.
|
|
39
|
+
namespace NitroInputMask { class HybridNitroInputMaskServiceSpec_cxx; }
|
|
40
|
+
// Forward declaration of `HybridNitroInputMaskSpec_cxx` to properly resolve imports.
|
|
41
|
+
namespace NitroInputMask { class HybridNitroInputMaskSpec_cxx; }
|
|
42
|
+
|
|
43
|
+
// Include Swift defined types
|
|
44
|
+
#if __has_include("NitroInputMask-Swift.h")
|
|
45
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
46
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "NitroInputMask".
|
|
47
|
+
#include "NitroInputMask-Swift.h"
|
|
48
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
49
|
+
#elif __has_include(<NitroInputMask/NitroInputMask-Swift.h>)
|
|
50
|
+
#include <NitroInputMask/NitroInputMask-Swift.h>
|
|
51
|
+
#else
|
|
52
|
+
#error NitroInputMask's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "NitroInputMask", and try building the app first.
|
|
53
|
+
#endif
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMaskAutolinking.mm
|
|
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
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "NitroInputMask-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridNitroInputMaskSpecSwift.hpp"
|
|
14
|
+
#include "HybridNitroInputMaskServiceSpecSwift.hpp"
|
|
15
|
+
|
|
16
|
+
@interface NitroInputMaskAutolinking : NSObject
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@implementation NitroInputMaskAutolinking
|
|
20
|
+
|
|
21
|
+
+ (void) load {
|
|
22
|
+
using namespace margelo::nitro;
|
|
23
|
+
using namespace margelo::nitro::nitroinputmask;
|
|
24
|
+
|
|
25
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
26
|
+
"NitroInputMask",
|
|
27
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
28
|
+
std::shared_ptr<HybridNitroInputMaskSpec> hybridObject = NitroInputMask::NitroInputMaskAutolinking::createNitroInputMask();
|
|
29
|
+
return hybridObject;
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
33
|
+
"NitroInputMaskService",
|
|
34
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
35
|
+
std::shared_ptr<HybridNitroInputMaskServiceSpec> hybridObject = NitroInputMask::NitroInputMaskAutolinking::createNitroInputMaskService();
|
|
36
|
+
return hybridObject;
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroInputMaskAutolinking.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
+
public final class NitroInputMaskAutolinking {
|
|
13
|
+
public typealias bridge = margelo.nitro.nitroinputmask.bridge.swift
|
|
14
|
+
|
|
15
|
+
public static func createNitroInputMask() -> bridge.std__shared_ptr_HybridNitroInputMaskSpec_ {
|
|
16
|
+
let hybridObject = HybridNitroInputMaskModule()
|
|
17
|
+
return { () -> bridge.std__shared_ptr_HybridNitroInputMaskSpec_ in
|
|
18
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
+
return __cxxWrapped.getCxxPart()
|
|
20
|
+
}()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static func isNitroInputMaskRecyclable() -> Bool {
|
|
24
|
+
return HybridNitroInputMaskModule.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public static func createNitroInputMaskService() -> bridge.std__shared_ptr_HybridNitroInputMaskServiceSpec_ {
|
|
28
|
+
let hybridObject = HybridNitroInputMaskServiceModule()
|
|
29
|
+
return { () -> bridge.std__shared_ptr_HybridNitroInputMaskServiceSpec_ in
|
|
30
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
31
|
+
return __cxxWrapped.getCxxPart()
|
|
32
|
+
}()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public static func isNitroInputMaskServiceRecyclable() -> Bool {
|
|
36
|
+
return HybridNitroInputMaskServiceModule.self is any RecyclableView.Type
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroInputMaskServiceSpecSwift.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 "HybridNitroInputMaskServiceSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::nitroinputmask {
|
|
11
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroInputMaskServiceSpecSwift.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 "HybridNitroInputMaskServiceSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridNitroInputMaskServiceSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroInputMask { class HybridNitroInputMaskServiceSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `NitroMaskOptions` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::nitroinputmask { struct NitroMaskOptions; }
|
|
17
|
+
|
|
18
|
+
#include <string>
|
|
19
|
+
#include "NitroMaskOptions.hpp"
|
|
20
|
+
#include <optional>
|
|
21
|
+
|
|
22
|
+
#include "NitroInputMask-Swift-Cxx-Umbrella.hpp"
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::nitroinputmask {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The C++ part of HybridNitroInputMaskServiceSpec_cxx.swift.
|
|
28
|
+
*
|
|
29
|
+
* HybridNitroInputMaskServiceSpecSwift (C++) accesses HybridNitroInputMaskServiceSpec_cxx (Swift), and might
|
|
30
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
31
|
+
*
|
|
32
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
33
|
+
* the future, HybridNitroInputMaskServiceSpec_cxx can directly inherit from the C++ class HybridNitroInputMaskServiceSpec
|
|
34
|
+
* to simplify the whole structure and memory management.
|
|
35
|
+
*/
|
|
36
|
+
class HybridNitroInputMaskServiceSpecSwift: public virtual HybridNitroInputMaskServiceSpec {
|
|
37
|
+
public:
|
|
38
|
+
// Constructor from a Swift instance
|
|
39
|
+
explicit HybridNitroInputMaskServiceSpecSwift(const NitroInputMask::HybridNitroInputMaskServiceSpec_cxx& swiftPart):
|
|
40
|
+
HybridObject(HybridNitroInputMaskServiceSpec::TAG),
|
|
41
|
+
_swiftPart(swiftPart) { }
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
// Get the Swift part
|
|
45
|
+
inline NitroInputMask::HybridNitroInputMaskServiceSpec_cxx& getSwiftPart() noexcept {
|
|
46
|
+
return _swiftPart;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
51
|
+
return _swiftPart.getMemorySize();
|
|
52
|
+
}
|
|
53
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
54
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNitroInputMaskServiceSpecSwift>(other)) {
|
|
55
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
void dispose() noexcept override {
|
|
60
|
+
_swiftPart.dispose();
|
|
61
|
+
}
|
|
62
|
+
std::string toString() override {
|
|
63
|
+
return _swiftPart.toString();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
// Properties
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
public:
|
|
71
|
+
// Methods
|
|
72
|
+
inline std::string applyMask(const std::string& value, const std::string& maskType, const NitroMaskOptions& options) override {
|
|
73
|
+
auto __result = _swiftPart.applyMask(value, maskType, std::forward<decltype(options)>(options));
|
|
74
|
+
if (__result.hasError()) [[unlikely]] {
|
|
75
|
+
std::rethrow_exception(__result.error());
|
|
76
|
+
}
|
|
77
|
+
auto __value = std::move(__result.value());
|
|
78
|
+
return __value;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private:
|
|
82
|
+
NitroInputMask::HybridNitroInputMaskServiceSpec_cxx _swiftPart;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroInputMaskSpecSwift.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 "HybridNitroInputMaskSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::nitroinputmask {
|
|
11
|
+
} // namespace margelo::nitro::nitroinputmask
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroInputMaskSpecSwift.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 "HybridNitroInputMaskSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridNitroInputMaskSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroInputMask { class HybridNitroInputMaskSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `NitroMaskOptions` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::nitroinputmask { struct NitroMaskOptions; }
|
|
17
|
+
|
|
18
|
+
#include <string>
|
|
19
|
+
#include "NitroMaskOptions.hpp"
|
|
20
|
+
#include <optional>
|
|
21
|
+
|
|
22
|
+
#include "NitroInputMask-Swift-Cxx-Umbrella.hpp"
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::nitroinputmask {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The C++ part of HybridNitroInputMaskSpec_cxx.swift.
|
|
28
|
+
*
|
|
29
|
+
* HybridNitroInputMaskSpecSwift (C++) accesses HybridNitroInputMaskSpec_cxx (Swift), and might
|
|
30
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
31
|
+
*
|
|
32
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
33
|
+
* the future, HybridNitroInputMaskSpec_cxx can directly inherit from the C++ class HybridNitroInputMaskSpec
|
|
34
|
+
* to simplify the whole structure and memory management.
|
|
35
|
+
*/
|
|
36
|
+
class HybridNitroInputMaskSpecSwift: public virtual HybridNitroInputMaskSpec {
|
|
37
|
+
public:
|
|
38
|
+
// Constructor from a Swift instance
|
|
39
|
+
explicit HybridNitroInputMaskSpecSwift(const NitroInputMask::HybridNitroInputMaskSpec_cxx& swiftPart):
|
|
40
|
+
HybridObject(HybridNitroInputMaskSpec::TAG),
|
|
41
|
+
_swiftPart(swiftPart) { }
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
// Get the Swift part
|
|
45
|
+
inline NitroInputMask::HybridNitroInputMaskSpec_cxx& getSwiftPart() noexcept {
|
|
46
|
+
return _swiftPart;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
51
|
+
return _swiftPart.getMemorySize();
|
|
52
|
+
}
|
|
53
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
54
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNitroInputMaskSpecSwift>(other)) {
|
|
55
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
void dispose() noexcept override {
|
|
60
|
+
_swiftPart.dispose();
|
|
61
|
+
}
|
|
62
|
+
std::string toString() override {
|
|
63
|
+
return _swiftPart.toString();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
// Properties
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
public:
|
|
71
|
+
// Methods
|
|
72
|
+
inline void attach(const std::string& nativeID, const std::string& maskType, const NitroMaskOptions& options) override {
|
|
73
|
+
auto __result = _swiftPart.attach(nativeID, maskType, std::forward<decltype(options)>(options));
|
|
74
|
+
if (__result.hasError()) [[unlikely]] {
|
|
75
|
+
std::rethrow_exception(__result.error());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
inline void detach(const std::string& nativeID) override {
|
|
79
|
+
auto __result = _swiftPart.detach(nativeID);
|
|
80
|
+
if (__result.hasError()) [[unlikely]] {
|
|
81
|
+
std::rethrow_exception(__result.error());
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
inline void updateMask(const std::string& nativeID, const std::string& maskType, const NitroMaskOptions& options) override {
|
|
85
|
+
auto __result = _swiftPart.updateMask(nativeID, maskType, std::forward<decltype(options)>(options));
|
|
86
|
+
if (__result.hasError()) [[unlikely]] {
|
|
87
|
+
std::rethrow_exception(__result.error());
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
inline void setValue(const std::string& nativeID, const std::string& rawValue) override {
|
|
91
|
+
auto __result = _swiftPart.setValue(nativeID, rawValue);
|
|
92
|
+
if (__result.hasError()) [[unlikely]] {
|
|
93
|
+
std::rethrow_exception(__result.error());
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
private:
|
|
98
|
+
NitroInputMask::HybridNitroInputMaskSpec_cxx _swiftPart;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
} // namespace margelo::nitro::nitroinputmask
|