react-native-carrot-quest 0.1.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/CarrotQuest.podspec +34 -0
- package/LICENSE +20 -0
- package/README.md +457 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +136 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +11 -0
- package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuest.kt +585 -0
- package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuestPackage.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuestSetup.kt +472 -0
- package/ios/CarrotQuest.swift +588 -0
- package/ios/CarrotQuestSetup.swift +333 -0
- package/lib/module/CarrotQuest.nitro.js +4 -0
- package/lib/module/CarrotQuest.nitro.js.map +1 -0
- package/lib/module/carrot-quest.js +136 -0
- package/lib/module/carrot-quest.js.map +1 -0
- package/lib/module/carrot-quest.native.js +155 -0
- package/lib/module/carrot-quest.native.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/subscriptions.js +76 -0
- package/lib/module/subscriptions.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/CarrotQuest.nitro.d.ts +394 -0
- package/lib/typescript/src/CarrotQuest.nitro.d.ts.map +1 -0
- package/lib/typescript/src/carrot-quest.d.ts +37 -0
- package/lib/typescript/src/carrot-quest.d.ts.map +1 -0
- package/lib/typescript/src/carrot-quest.native.d.ts +37 -0
- package/lib/typescript/src/carrot-quest.native.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/subscriptions.d.ts +32 -0
- package/lib/typescript/src/subscriptions.d.ts.map +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/android/c++/JCarrotQuestEventValue.cpp +30 -0
- package/nitrogen/generated/android/c++/JCarrotQuestEventValue.hpp +83 -0
- package/nitrogen/generated/android/c++/JCarrotQuestLogCategory.hpp +76 -0
- package/nitrogen/generated/android/c++/JCarrotQuestLogEntry.hpp +100 -0
- package/nitrogen/generated/android/c++/JCarrotQuestLogLevel.hpp +70 -0
- package/nitrogen/generated/android/c++/JCarrotQuestProperty.hpp +74 -0
- package/nitrogen/generated/android/c++/JCarrotQuestPropertyKind.hpp +61 -0
- package/nitrogen/generated/android/c++/JCarrotQuestPropertyOperation.hpp +73 -0
- package/nitrogen/generated/android/c++/JCarrotQuestSetupOptions.hpp +94 -0
- package/nitrogen/generated/android/c++/JCarrotQuestTheme.hpp +64 -0
- package/nitrogen/generated/android/c++/JCarrotQuestUrlSource.hpp +64 -0
- package/nitrogen/generated/android/c++/JCarrotQuestUserProperties.hpp +84 -0
- package/nitrogen/generated/android/c++/JFunc_void_CarrotQuestLogEntry.hpp +84 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridCarrotQuestSpec.cpp +388 -0
- package/nitrogen/generated/android/c++/JHybridCarrotQuestSpec.hpp +96 -0
- package/nitrogen/generated/android/carrotquest+autolinking.cmake +82 -0
- package/nitrogen/generated/android/carrotquest+autolinking.gradle +27 -0
- package/nitrogen/generated/android/carrotquestOnLoad.cpp +62 -0
- package/nitrogen/generated/android/carrotquestOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestEventValue.kt +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogCategory.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogEntry.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogLevel.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestProperty.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestPropertyKind.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestPropertyOperation.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestSetupOptions.kt +91 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestTheme.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestUrlSource.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestUserProperties.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_CarrotQuestLogEntry.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_bool.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/HybridCarrotQuestSpec.kt +209 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/carrotquestOnLoad.kt +35 -0
- package/nitrogen/generated/ios/CarrotQuest+autolinking.rb +62 -0
- package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Bridge.cpp +97 -0
- package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Bridge.hpp +637 -0
- package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Umbrella.hpp +80 -0
- package/nitrogen/generated/ios/CarrotQuestAutolinking.mm +33 -0
- package/nitrogen/generated/ios/CarrotQuestAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridCarrotQuestSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCarrotQuestSpecSwift.hpp +344 -0
- package/nitrogen/generated/ios/swift/CarrotQuestEventValue.swift +32 -0
- package/nitrogen/generated/ios/swift/CarrotQuestLogCategory.swift +64 -0
- package/nitrogen/generated/ios/swift/CarrotQuestLogEntry.swift +86 -0
- package/nitrogen/generated/ios/swift/CarrotQuestLogLevel.swift +56 -0
- package/nitrogen/generated/ios/swift/CarrotQuestProperty.swift +56 -0
- package/nitrogen/generated/ios/swift/CarrotQuestPropertyKind.swift +44 -0
- package/nitrogen/generated/ios/swift/CarrotQuestPropertyOperation.swift +60 -0
- package/nitrogen/generated/ios/swift/CarrotQuestSetupOptions.swift +172 -0
- package/nitrogen/generated/ios/swift/CarrotQuestTheme.swift +48 -0
- package/nitrogen/generated/ios/swift/CarrotQuestUrlSource.swift +48 -0
- package/nitrogen/generated/ios/swift/CarrotQuestUserProperties.swift +110 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_CarrotQuestLogEntry.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_double_.swift +53 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +53 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridCarrotQuestSpec.swift +88 -0
- package/nitrogen/generated/ios/swift/HybridCarrotQuestSpec_cxx.swift +674 -0
- package/nitrogen/generated/shared/c++/CarrotQuestLogCategory.hpp +100 -0
- package/nitrogen/generated/shared/c++/CarrotQuestLogEntry.hpp +114 -0
- package/nitrogen/generated/shared/c++/CarrotQuestLogLevel.hpp +92 -0
- package/nitrogen/generated/shared/c++/CarrotQuestProperty.hpp +101 -0
- package/nitrogen/generated/shared/c++/CarrotQuestPropertyKind.hpp +80 -0
- package/nitrogen/generated/shared/c++/CarrotQuestPropertyOperation.hpp +96 -0
- package/nitrogen/generated/shared/c++/CarrotQuestSetupOptions.hpp +121 -0
- package/nitrogen/generated/shared/c++/CarrotQuestTheme.hpp +84 -0
- package/nitrogen/generated/shared/c++/CarrotQuestUrlSource.hpp +84 -0
- package/nitrogen/generated/shared/c++/CarrotQuestUserProperties.hpp +97 -0
- package/nitrogen/generated/shared/c++/HybridCarrotQuestSpec.cpp +55 -0
- package/nitrogen/generated/shared/c++/HybridCarrotQuestSpec.hpp +118 -0
- package/package.json +140 -0
- package/src/CarrotQuest.nitro.ts +493 -0
- package/src/carrot-quest.native.tsx +241 -0
- package/src/carrot-quest.tsx +207 -0
- package/src/index.tsx +57 -0
- package/src/subscriptions.ts +83 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CarrotQuestLogLevel.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
|
+
/**
|
|
9
|
+
* Represents the JS union `CarrotQuestLogLevel`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias CarrotQuestLogLevel = margelo.nitro.carrotquest.CarrotQuestLogLevel
|
|
12
|
+
|
|
13
|
+
public extension CarrotQuestLogLevel {
|
|
14
|
+
/**
|
|
15
|
+
* Get a CarrotQuestLogLevel for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "none":
|
|
21
|
+
self = .none
|
|
22
|
+
case "error":
|
|
23
|
+
self = .error
|
|
24
|
+
case "warn":
|
|
25
|
+
self = .warn
|
|
26
|
+
case "info":
|
|
27
|
+
self = .info
|
|
28
|
+
case "debugging":
|
|
29
|
+
self = .debugging
|
|
30
|
+
case "verbose":
|
|
31
|
+
self = .verbose
|
|
32
|
+
default:
|
|
33
|
+
return nil
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get the String value this CarrotQuestLogLevel represents.
|
|
39
|
+
*/
|
|
40
|
+
var stringValue: String {
|
|
41
|
+
switch self {
|
|
42
|
+
case .none:
|
|
43
|
+
return "none"
|
|
44
|
+
case .error:
|
|
45
|
+
return "error"
|
|
46
|
+
case .warn:
|
|
47
|
+
return "warn"
|
|
48
|
+
case .info:
|
|
49
|
+
return "info"
|
|
50
|
+
case .debugging:
|
|
51
|
+
return "debugging"
|
|
52
|
+
case .verbose:
|
|
53
|
+
return "verbose"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CarrotQuestProperty.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
|
+
/**
|
|
11
|
+
* Represents an instance of `CarrotQuestProperty`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias CarrotQuestProperty = margelo.nitro.carrotquest.CarrotQuestProperty
|
|
14
|
+
|
|
15
|
+
public extension CarrotQuestProperty {
|
|
16
|
+
private typealias bridge = margelo.nitro.carrotquest.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `CarrotQuestProperty`.
|
|
20
|
+
*/
|
|
21
|
+
init(key: String, value: String, operation: CarrotQuestPropertyOperation?, kind: CarrotQuestPropertyKind?) {
|
|
22
|
+
self.init(std.string(key), std.string(value), { () -> bridge.std__optional_CarrotQuestPropertyOperation_ in
|
|
23
|
+
if let __unwrappedValue = operation {
|
|
24
|
+
return bridge.create_std__optional_CarrotQuestPropertyOperation_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_CarrotQuestPropertyKind_ in
|
|
29
|
+
if let __unwrappedValue = kind {
|
|
30
|
+
return bridge.create_std__optional_CarrotQuestPropertyKind_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}())
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@inline(__always)
|
|
38
|
+
var key: String {
|
|
39
|
+
return String(self.__key)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@inline(__always)
|
|
43
|
+
var value: String {
|
|
44
|
+
return String(self.__value)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@inline(__always)
|
|
48
|
+
var operation: CarrotQuestPropertyOperation? {
|
|
49
|
+
return self.__operation.value
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@inline(__always)
|
|
53
|
+
var kind: CarrotQuestPropertyKind? {
|
|
54
|
+
return self.__kind.value
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CarrotQuestPropertyKind.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
|
+
/**
|
|
9
|
+
* Represents the JS union `CarrotQuestPropertyKind`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias CarrotQuestPropertyKind = margelo.nitro.carrotquest.CarrotQuestPropertyKind
|
|
12
|
+
|
|
13
|
+
public extension CarrotQuestPropertyKind {
|
|
14
|
+
/**
|
|
15
|
+
* Get a CarrotQuestPropertyKind for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "custom":
|
|
21
|
+
self = .custom
|
|
22
|
+
case "system":
|
|
23
|
+
self = .system
|
|
24
|
+
case "ecommerce":
|
|
25
|
+
self = .ecommerce
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this CarrotQuestPropertyKind represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .custom:
|
|
37
|
+
return "custom"
|
|
38
|
+
case .system:
|
|
39
|
+
return "system"
|
|
40
|
+
case .ecommerce:
|
|
41
|
+
return "ecommerce"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CarrotQuestPropertyOperation.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
|
+
/**
|
|
9
|
+
* Represents the JS union `CarrotQuestPropertyOperation`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias CarrotQuestPropertyOperation = margelo.nitro.carrotquest.CarrotQuestPropertyOperation
|
|
12
|
+
|
|
13
|
+
public extension CarrotQuestPropertyOperation {
|
|
14
|
+
/**
|
|
15
|
+
* Get a CarrotQuestPropertyOperation for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "updateOrCreate":
|
|
21
|
+
self = .updateorcreate
|
|
22
|
+
case "setOnce":
|
|
23
|
+
self = .setonce
|
|
24
|
+
case "add":
|
|
25
|
+
self = .add
|
|
26
|
+
case "delete":
|
|
27
|
+
self = .delete
|
|
28
|
+
case "append":
|
|
29
|
+
self = .append
|
|
30
|
+
case "union":
|
|
31
|
+
self = .union
|
|
32
|
+
case "exclude":
|
|
33
|
+
self = .exclude
|
|
34
|
+
default:
|
|
35
|
+
return nil
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the String value this CarrotQuestPropertyOperation represents.
|
|
41
|
+
*/
|
|
42
|
+
var stringValue: String {
|
|
43
|
+
switch self {
|
|
44
|
+
case .updateorcreate:
|
|
45
|
+
return "updateOrCreate"
|
|
46
|
+
case .setonce:
|
|
47
|
+
return "setOnce"
|
|
48
|
+
case .add:
|
|
49
|
+
return "add"
|
|
50
|
+
case .delete:
|
|
51
|
+
return "delete"
|
|
52
|
+
case .append:
|
|
53
|
+
return "append"
|
|
54
|
+
case .union:
|
|
55
|
+
return "union"
|
|
56
|
+
case .exclude:
|
|
57
|
+
return "exclude"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CarrotQuestSetupOptions.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
|
+
/**
|
|
11
|
+
* Represents an instance of `CarrotQuestSetupOptions`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias CarrotQuestSetupOptions = margelo.nitro.carrotquest.CarrotQuestSetupOptions
|
|
14
|
+
|
|
15
|
+
public extension CarrotQuestSetupOptions {
|
|
16
|
+
private typealias bridge = margelo.nitro.carrotquest.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `CarrotQuestSetupOptions`.
|
|
20
|
+
*/
|
|
21
|
+
init(locale: String?, theme: CarrotQuestTheme?, useEuServer: Bool?, appGroup: String?, isServiceMode: Bool?, parentActivityClassName: String?, notificationIconResourceName: String?, logLevel: CarrotQuestLogLevel?, logIncludeSensitive: Bool?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = locale {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_CarrotQuestTheme_ in
|
|
29
|
+
if let __unwrappedValue = theme {
|
|
30
|
+
return bridge.create_std__optional_CarrotQuestTheme_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
35
|
+
if let __unwrappedValue = useEuServer {
|
|
36
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
41
|
+
if let __unwrappedValue = appGroup {
|
|
42
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
47
|
+
if let __unwrappedValue = isServiceMode {
|
|
48
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
53
|
+
if let __unwrappedValue = parentActivityClassName {
|
|
54
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
59
|
+
if let __unwrappedValue = notificationIconResourceName {
|
|
60
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_CarrotQuestLogLevel_ in
|
|
65
|
+
if let __unwrappedValue = logLevel {
|
|
66
|
+
return bridge.create_std__optional_CarrotQuestLogLevel_(__unwrappedValue)
|
|
67
|
+
} else {
|
|
68
|
+
return .init()
|
|
69
|
+
}
|
|
70
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
71
|
+
if let __unwrappedValue = logIncludeSensitive {
|
|
72
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
73
|
+
} else {
|
|
74
|
+
return .init()
|
|
75
|
+
}
|
|
76
|
+
}())
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@inline(__always)
|
|
80
|
+
var locale: String? {
|
|
81
|
+
return { () -> String? in
|
|
82
|
+
if bridge.has_value_std__optional_std__string_(self.__locale) {
|
|
83
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__locale)
|
|
84
|
+
return String(__unwrapped)
|
|
85
|
+
} else {
|
|
86
|
+
return nil
|
|
87
|
+
}
|
|
88
|
+
}()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@inline(__always)
|
|
92
|
+
var theme: CarrotQuestTheme? {
|
|
93
|
+
return self.__theme.value
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@inline(__always)
|
|
97
|
+
var useEuServer: Bool? {
|
|
98
|
+
return { () -> Bool? in
|
|
99
|
+
if bridge.has_value_std__optional_bool_(self.__useEuServer) {
|
|
100
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__useEuServer)
|
|
101
|
+
return __unwrapped
|
|
102
|
+
} else {
|
|
103
|
+
return nil
|
|
104
|
+
}
|
|
105
|
+
}()
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@inline(__always)
|
|
109
|
+
var appGroup: String? {
|
|
110
|
+
return { () -> String? in
|
|
111
|
+
if bridge.has_value_std__optional_std__string_(self.__appGroup) {
|
|
112
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__appGroup)
|
|
113
|
+
return String(__unwrapped)
|
|
114
|
+
} else {
|
|
115
|
+
return nil
|
|
116
|
+
}
|
|
117
|
+
}()
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@inline(__always)
|
|
121
|
+
var isServiceMode: Bool? {
|
|
122
|
+
return { () -> Bool? in
|
|
123
|
+
if bridge.has_value_std__optional_bool_(self.__isServiceMode) {
|
|
124
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__isServiceMode)
|
|
125
|
+
return __unwrapped
|
|
126
|
+
} else {
|
|
127
|
+
return nil
|
|
128
|
+
}
|
|
129
|
+
}()
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@inline(__always)
|
|
133
|
+
var parentActivityClassName: String? {
|
|
134
|
+
return { () -> String? in
|
|
135
|
+
if bridge.has_value_std__optional_std__string_(self.__parentActivityClassName) {
|
|
136
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__parentActivityClassName)
|
|
137
|
+
return String(__unwrapped)
|
|
138
|
+
} else {
|
|
139
|
+
return nil
|
|
140
|
+
}
|
|
141
|
+
}()
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@inline(__always)
|
|
145
|
+
var notificationIconResourceName: String? {
|
|
146
|
+
return { () -> String? in
|
|
147
|
+
if bridge.has_value_std__optional_std__string_(self.__notificationIconResourceName) {
|
|
148
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__notificationIconResourceName)
|
|
149
|
+
return String(__unwrapped)
|
|
150
|
+
} else {
|
|
151
|
+
return nil
|
|
152
|
+
}
|
|
153
|
+
}()
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@inline(__always)
|
|
157
|
+
var logLevel: CarrotQuestLogLevel? {
|
|
158
|
+
return self.__logLevel.value
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@inline(__always)
|
|
162
|
+
var logIncludeSensitive: Bool? {
|
|
163
|
+
return { () -> Bool? in
|
|
164
|
+
if bridge.has_value_std__optional_bool_(self.__logIncludeSensitive) {
|
|
165
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__logIncludeSensitive)
|
|
166
|
+
return __unwrapped
|
|
167
|
+
} else {
|
|
168
|
+
return nil
|
|
169
|
+
}
|
|
170
|
+
}()
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CarrotQuestTheme.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
|
+
/**
|
|
9
|
+
* Represents the JS union `CarrotQuestTheme`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias CarrotQuestTheme = margelo.nitro.carrotquest.CarrotQuestTheme
|
|
12
|
+
|
|
13
|
+
public extension CarrotQuestTheme {
|
|
14
|
+
/**
|
|
15
|
+
* Get a CarrotQuestTheme for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "light":
|
|
21
|
+
self = .light
|
|
22
|
+
case "dark":
|
|
23
|
+
self = .dark
|
|
24
|
+
case "fromDevice":
|
|
25
|
+
self = .fromdevice
|
|
26
|
+
case "fromWeb":
|
|
27
|
+
self = .fromweb
|
|
28
|
+
default:
|
|
29
|
+
return nil
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the String value this CarrotQuestTheme represents.
|
|
35
|
+
*/
|
|
36
|
+
var stringValue: String {
|
|
37
|
+
switch self {
|
|
38
|
+
case .light:
|
|
39
|
+
return "light"
|
|
40
|
+
case .dark:
|
|
41
|
+
return "dark"
|
|
42
|
+
case .fromdevice:
|
|
43
|
+
return "fromDevice"
|
|
44
|
+
case .fromweb:
|
|
45
|
+
return "fromWeb"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CarrotQuestUrlSource.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
|
+
/**
|
|
9
|
+
* Represents the JS union `CarrotQuestUrlSource`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias CarrotQuestUrlSource = margelo.nitro.carrotquest.CarrotQuestUrlSource
|
|
12
|
+
|
|
13
|
+
public extension CarrotQuestUrlSource {
|
|
14
|
+
/**
|
|
15
|
+
* Get a CarrotQuestUrlSource for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "push":
|
|
21
|
+
self = .push
|
|
22
|
+
case "chat":
|
|
23
|
+
self = .chat
|
|
24
|
+
case "popup":
|
|
25
|
+
self = .popup
|
|
26
|
+
case "all":
|
|
27
|
+
self = .all
|
|
28
|
+
default:
|
|
29
|
+
return nil
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the String value this CarrotQuestUrlSource represents.
|
|
35
|
+
*/
|
|
36
|
+
var stringValue: String {
|
|
37
|
+
switch self {
|
|
38
|
+
case .push:
|
|
39
|
+
return "push"
|
|
40
|
+
case .chat:
|
|
41
|
+
return "chat"
|
|
42
|
+
case .popup:
|
|
43
|
+
return "popup"
|
|
44
|
+
case .all:
|
|
45
|
+
return "all"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CarrotQuestUserProperties.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
|
+
/**
|
|
11
|
+
* Represents an instance of `CarrotQuestUserProperties`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias CarrotQuestUserProperties = margelo.nitro.carrotquest.CarrotQuestUserProperties
|
|
14
|
+
|
|
15
|
+
public extension CarrotQuestUserProperties {
|
|
16
|
+
private typealias bridge = margelo.nitro.carrotquest.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `CarrotQuestUserProperties`.
|
|
20
|
+
*/
|
|
21
|
+
init(name: String?, phone: String?, email: String?, custom: Dictionary<String, String>?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = name {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
29
|
+
if let __unwrappedValue = phone {
|
|
30
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
35
|
+
if let __unwrappedValue = email {
|
|
36
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_std__unordered_map_std__string__std__string__ in
|
|
41
|
+
if let __unwrappedValue = custom {
|
|
42
|
+
return bridge.create_std__optional_std__unordered_map_std__string__std__string__({ () -> bridge.std__unordered_map_std__string__std__string_ in
|
|
43
|
+
var __map = bridge.create_std__unordered_map_std__string__std__string_(__unwrappedValue.count)
|
|
44
|
+
for (__k, __v) in __unwrappedValue {
|
|
45
|
+
bridge.emplace_std__unordered_map_std__string__std__string_(&__map, std.string(__k), std.string(__v))
|
|
46
|
+
}
|
|
47
|
+
return __map
|
|
48
|
+
}())
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}())
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@inline(__always)
|
|
56
|
+
var name: String? {
|
|
57
|
+
return { () -> String? in
|
|
58
|
+
if bridge.has_value_std__optional_std__string_(self.__name) {
|
|
59
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__name)
|
|
60
|
+
return String(__unwrapped)
|
|
61
|
+
} else {
|
|
62
|
+
return nil
|
|
63
|
+
}
|
|
64
|
+
}()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@inline(__always)
|
|
68
|
+
var phone: String? {
|
|
69
|
+
return { () -> String? in
|
|
70
|
+
if bridge.has_value_std__optional_std__string_(self.__phone) {
|
|
71
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__phone)
|
|
72
|
+
return String(__unwrapped)
|
|
73
|
+
} else {
|
|
74
|
+
return nil
|
|
75
|
+
}
|
|
76
|
+
}()
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@inline(__always)
|
|
80
|
+
var email: String? {
|
|
81
|
+
return { () -> String? in
|
|
82
|
+
if bridge.has_value_std__optional_std__string_(self.__email) {
|
|
83
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__email)
|
|
84
|
+
return String(__unwrapped)
|
|
85
|
+
} else {
|
|
86
|
+
return nil
|
|
87
|
+
}
|
|
88
|
+
}()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@inline(__always)
|
|
92
|
+
var custom: Dictionary<String, String>? {
|
|
93
|
+
return { () -> Dictionary<String, String>? in
|
|
94
|
+
if bridge.has_value_std__optional_std__unordered_map_std__string__std__string__(self.__custom) {
|
|
95
|
+
let __unwrapped = bridge.get_std__optional_std__unordered_map_std__string__std__string__(self.__custom)
|
|
96
|
+
return { () -> Dictionary<String, String> in
|
|
97
|
+
var __dictionary = Dictionary<String, String>(minimumCapacity: __unwrapped.size())
|
|
98
|
+
let __keys = bridge.get_std__unordered_map_std__string__std__string__keys(__unwrapped)
|
|
99
|
+
for __key in __keys {
|
|
100
|
+
let __value = bridge.get_std__unordered_map_std__string__std__string__value(__unwrapped, __key)
|
|
101
|
+
__dictionary[String(__key)] = String(__value)
|
|
102
|
+
}
|
|
103
|
+
return __dictionary
|
|
104
|
+
}()
|
|
105
|
+
} else {
|
|
106
|
+
return nil
|
|
107
|
+
}
|
|
108
|
+
}()
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void.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
|
+
/**
|
|
11
|
+
* Wraps a Swift `() -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void {
|
|
15
|
+
public typealias bridge = margelo.nitro.carrotquest.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: () -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping () -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call() -> Void {
|
|
25
|
+
self.closure()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
|
|
44
|
+
return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_CarrotQuestLogEntry.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
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ entry: CarrotQuestLogEntry) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_CarrotQuestLogEntry {
|
|
15
|
+
public typealias bridge = margelo.nitro.carrotquest.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ entry: CarrotQuestLogEntry) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ entry: CarrotQuestLogEntry) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(entry: CarrotQuestLogEntry) -> Void {
|
|
25
|
+
self.closure(entry)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_CarrotQuestLogEntry`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_CarrotQuestLogEntry>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_CarrotQuestLogEntry {
|
|
44
|
+
return Unmanaged<Func_void_CarrotQuestLogEntry>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|