aix 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +161 -72
  2. package/ios/HybridAix.swift +74 -6
  3. package/ios/HybridAixComposer.swift +63 -24
  4. package/lib/commonjs/aix.js +6 -2
  5. package/lib/commonjs/aix.js.map +1 -1
  6. package/lib/module/aix.js +6 -2
  7. package/lib/module/aix.js.map +1 -1
  8. package/lib/typescript/src/aix.d.ts +235 -11
  9. package/lib/typescript/src/aix.d.ts.map +1 -1
  10. package/lib/typescript/src/views/aix.nitro.d.ts +14 -0
  11. package/lib/typescript/src/views/aix.nitro.d.ts.map +1 -1
  12. package/nitrogen/generated/android/AixOnLoad.cpp +2 -0
  13. package/nitrogen/generated/android/c++/JAixStickToKeyboard.hpp +63 -0
  14. package/nitrogen/generated/android/c++/JAixStickToKeyboardOffset.hpp +61 -0
  15. package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
  16. package/nitrogen/generated/android/c++/JHybridAixComposerSpec.cpp +18 -3
  17. package/nitrogen/generated/android/c++/JHybridAixComposerSpec.hpp +2 -1
  18. package/nitrogen/generated/android/c++/JHybridAixSpec.cpp +18 -0
  19. package/nitrogen/generated/android/c++/JHybridAixSpec.hpp +2 -0
  20. package/nitrogen/generated/android/c++/views/JHybridAixComposerStateUpdater.cpp +4 -1
  21. package/nitrogen/generated/android/c++/views/JHybridAixStateUpdater.cpp +4 -0
  22. package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixStickToKeyboard.kt +41 -0
  23. package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixStickToKeyboardOffset.kt +41 -0
  24. package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/Func_void_bool.kt +80 -0
  25. package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixComposerSpec.kt +5 -1
  26. package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixSpec.kt +14 -0
  27. package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.cpp +8 -0
  28. package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.hpp +73 -0
  29. package/nitrogen/generated/ios/Aix-Swift-Cxx-Umbrella.hpp +6 -0
  30. package/nitrogen/generated/ios/c++/HybridAixComposerSpecSwift.hpp +14 -3
  31. package/nitrogen/generated/ios/c++/HybridAixSpecSwift.hpp +7 -0
  32. package/nitrogen/generated/ios/c++/views/HybridAixComponent.mm +5 -0
  33. package/nitrogen/generated/ios/c++/views/HybridAixComposerComponent.mm +5 -1
  34. package/nitrogen/generated/ios/swift/AixStickToKeyboard.swift +59 -0
  35. package/nitrogen/generated/ios/swift/AixStickToKeyboardOffset.swift +47 -0
  36. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  37. package/nitrogen/generated/ios/swift/HybridAixComposerSpec.swift +1 -1
  38. package/nitrogen/generated/ios/swift/HybridAixComposerSpec_cxx.swift +16 -1
  39. package/nitrogen/generated/ios/swift/HybridAixSpec.swift +1 -0
  40. package/nitrogen/generated/ios/swift/HybridAixSpec_cxx.swift +32 -0
  41. package/nitrogen/generated/shared/c++/AixStickToKeyboard.hpp +81 -0
  42. package/nitrogen/generated/shared/c++/AixStickToKeyboardOffset.hpp +79 -0
  43. package/nitrogen/generated/shared/c++/HybridAixComposerSpec.cpp +2 -1
  44. package/nitrogen/generated/shared/c++/HybridAixComposerSpec.hpp +6 -3
  45. package/nitrogen/generated/shared/c++/HybridAixSpec.cpp +2 -0
  46. package/nitrogen/generated/shared/c++/HybridAixSpec.hpp +2 -0
  47. package/nitrogen/generated/shared/c++/views/HybridAixComponent.cpp +12 -0
  48. package/nitrogen/generated/shared/c++/views/HybridAixComponent.hpp +1 -0
  49. package/nitrogen/generated/shared/c++/views/HybridAixComposerComponent.cpp +12 -0
  50. package/nitrogen/generated/shared/c++/views/HybridAixComposerComponent.hpp +3 -1
  51. package/nitrogen/generated/shared/json/AixComposerConfig.json +1 -0
  52. package/nitrogen/generated/shared/json/AixConfig.json +1 -0
  53. package/package.json +6 -6
  54. package/src/aix.tsx +8 -1
  55. package/src/views/aix.nitro.ts +18 -1
@@ -0,0 +1,63 @@
1
+ ///
2
+ /// JAixStickToKeyboard.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "AixStickToKeyboard.hpp"
12
+
13
+ #include "AixStickToKeyboardOffset.hpp"
14
+ #include "JAixStickToKeyboardOffset.hpp"
15
+ #include <optional>
16
+
17
+ namespace margelo::nitro::aix {
18
+
19
+ using namespace facebook;
20
+
21
+ /**
22
+ * The C++ JNI bridge between the C++ struct "AixStickToKeyboard" and the the Kotlin data class "AixStickToKeyboard".
23
+ */
24
+ struct JAixStickToKeyboard final: public jni::JavaClass<JAixStickToKeyboard> {
25
+ public:
26
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/AixStickToKeyboard;";
27
+
28
+ public:
29
+ /**
30
+ * Convert this Java/Kotlin-based struct to the C++ struct AixStickToKeyboard by copying all values to C++.
31
+ */
32
+ [[maybe_unused]]
33
+ [[nodiscard]]
34
+ AixStickToKeyboard toCpp() const {
35
+ static const auto clazz = javaClassStatic();
36
+ static const auto fieldEnabled = clazz->getField<jboolean>("enabled");
37
+ jboolean enabled = this->getFieldValue(fieldEnabled);
38
+ static const auto fieldOffset = clazz->getField<JAixStickToKeyboardOffset>("offset");
39
+ jni::local_ref<JAixStickToKeyboardOffset> offset = this->getFieldValue(fieldOffset);
40
+ return AixStickToKeyboard(
41
+ static_cast<bool>(enabled),
42
+ offset != nullptr ? std::make_optional(offset->toCpp()) : std::nullopt
43
+ );
44
+ }
45
+
46
+ public:
47
+ /**
48
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
49
+ */
50
+ [[maybe_unused]]
51
+ static jni::local_ref<JAixStickToKeyboard::javaobject> fromCpp(const AixStickToKeyboard& value) {
52
+ using JSignature = JAixStickToKeyboard(jboolean, jni::alias_ref<JAixStickToKeyboardOffset>);
53
+ static const auto clazz = javaClassStatic();
54
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
55
+ return create(
56
+ clazz,
57
+ value.enabled,
58
+ value.offset.has_value() ? JAixStickToKeyboardOffset::fromCpp(value.offset.value()) : nullptr
59
+ );
60
+ }
61
+ };
62
+
63
+ } // namespace margelo::nitro::aix
@@ -0,0 +1,61 @@
1
+ ///
2
+ /// JAixStickToKeyboardOffset.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "AixStickToKeyboardOffset.hpp"
12
+
13
+
14
+
15
+ namespace margelo::nitro::aix {
16
+
17
+ using namespace facebook;
18
+
19
+ /**
20
+ * The C++ JNI bridge between the C++ struct "AixStickToKeyboardOffset" and the the Kotlin data class "AixStickToKeyboardOffset".
21
+ */
22
+ struct JAixStickToKeyboardOffset final: public jni::JavaClass<JAixStickToKeyboardOffset> {
23
+ public:
24
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/AixStickToKeyboardOffset;";
25
+
26
+ public:
27
+ /**
28
+ * Convert this Java/Kotlin-based struct to the C++ struct AixStickToKeyboardOffset by copying all values to C++.
29
+ */
30
+ [[maybe_unused]]
31
+ [[nodiscard]]
32
+ AixStickToKeyboardOffset toCpp() const {
33
+ static const auto clazz = javaClassStatic();
34
+ static const auto fieldWhenKeyboardOpen = clazz->getField<double>("whenKeyboardOpen");
35
+ double whenKeyboardOpen = this->getFieldValue(fieldWhenKeyboardOpen);
36
+ static const auto fieldWhenKeyboardClosed = clazz->getField<double>("whenKeyboardClosed");
37
+ double whenKeyboardClosed = this->getFieldValue(fieldWhenKeyboardClosed);
38
+ return AixStickToKeyboardOffset(
39
+ whenKeyboardOpen,
40
+ whenKeyboardClosed
41
+ );
42
+ }
43
+
44
+ public:
45
+ /**
46
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
47
+ */
48
+ [[maybe_unused]]
49
+ static jni::local_ref<JAixStickToKeyboardOffset::javaobject> fromCpp(const AixStickToKeyboardOffset& value) {
50
+ using JSignature = JAixStickToKeyboardOffset(double, double);
51
+ static const auto clazz = javaClassStatic();
52
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
53
+ return create(
54
+ clazz,
55
+ value.whenKeyboardOpen,
56
+ value.whenKeyboardClosed
57
+ );
58
+ }
59
+ };
60
+
61
+ } // namespace margelo::nitro::aix
@@ -0,0 +1,75 @@
1
+ ///
2
+ /// JFunc_void_bool.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include <functional>
12
+
13
+ #include <functional>
14
+ #include <NitroModules/JNICallable.hpp>
15
+
16
+ namespace margelo::nitro::aix {
17
+
18
+ using namespace facebook;
19
+
20
+ /**
21
+ * Represents the Java/Kotlin callback `(isNearEnd: Boolean) -> Unit`.
22
+ * This can be passed around between C++ and Java/Kotlin.
23
+ */
24
+ struct JFunc_void_bool: public jni::JavaClass<JFunc_void_bool> {
25
+ public:
26
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/Func_void_bool;";
27
+
28
+ public:
29
+ /**
30
+ * Invokes the function this `JFunc_void_bool` instance holds through JNI.
31
+ */
32
+ void invoke(bool isNearEnd) const {
33
+ static const auto method = javaClassStatic()->getMethod<void(jboolean /* isNearEnd */)>("invoke");
34
+ method(self(), isNearEnd);
35
+ }
36
+ };
37
+
38
+ /**
39
+ * An implementation of Func_void_bool that is backed by a C++ implementation (using `std::function<...>`)
40
+ */
41
+ class JFunc_void_bool_cxx final: public jni::HybridClass<JFunc_void_bool_cxx, JFunc_void_bool> {
42
+ public:
43
+ static jni::local_ref<JFunc_void_bool::javaobject> fromCpp(const std::function<void(bool /* isNearEnd */)>& func) {
44
+ return JFunc_void_bool_cxx::newObjectCxxArgs(func);
45
+ }
46
+
47
+ public:
48
+ /**
49
+ * Invokes the C++ `std::function<...>` this `JFunc_void_bool_cxx` instance holds.
50
+ */
51
+ void invoke_cxx(jboolean isNearEnd) {
52
+ _func(static_cast<bool>(isNearEnd));
53
+ }
54
+
55
+ public:
56
+ [[nodiscard]]
57
+ inline const std::function<void(bool /* isNearEnd */)>& getFunction() const {
58
+ return _func;
59
+ }
60
+
61
+ public:
62
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/Func_void_bool_cxx;";
63
+ static void registerNatives() {
64
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_bool_cxx::invoke_cxx)});
65
+ }
66
+
67
+ private:
68
+ explicit JFunc_void_bool_cxx(const std::function<void(bool /* isNearEnd */)>& func): _func(func) { }
69
+
70
+ private:
71
+ friend HybridBase;
72
+ std::function<void(bool /* isNearEnd */)> _func;
73
+ };
74
+
75
+ } // namespace margelo::nitro::aix
@@ -7,9 +7,16 @@
7
7
 
8
8
  #include "JHybridAixComposerSpec.hpp"
9
9
 
10
+ // Forward declaration of `AixStickToKeyboard` to properly resolve imports.
11
+ namespace margelo::nitro::aix { struct AixStickToKeyboard; }
12
+ // Forward declaration of `AixStickToKeyboardOffset` to properly resolve imports.
13
+ namespace margelo::nitro::aix { struct AixStickToKeyboardOffset; }
10
14
 
11
-
12
-
15
+ #include "AixStickToKeyboard.hpp"
16
+ #include <optional>
17
+ #include "JAixStickToKeyboard.hpp"
18
+ #include "AixStickToKeyboardOffset.hpp"
19
+ #include "JAixStickToKeyboardOffset.hpp"
13
20
 
14
21
  namespace margelo::nitro::aix {
15
22
 
@@ -40,7 +47,15 @@ namespace margelo::nitro::aix {
40
47
  }
41
48
 
42
49
  // Properties
43
-
50
+ std::optional<AixStickToKeyboard> JHybridAixComposerSpec::getStickToKeyboard() {
51
+ static const auto method = javaClassStatic()->getMethod<jni::local_ref<JAixStickToKeyboard>()>("getStickToKeyboard");
52
+ auto __result = method(_javaPart);
53
+ return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
54
+ }
55
+ void JHybridAixComposerSpec::setStickToKeyboard(const std::optional<AixStickToKeyboard>& stickToKeyboard) {
56
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JAixStickToKeyboard> /* stickToKeyboard */)>("setStickToKeyboard");
57
+ method(_javaPart, stickToKeyboard.has_value() ? JAixStickToKeyboard::fromCpp(stickToKeyboard.value()) : nullptr);
58
+ }
44
59
 
45
60
  // Methods
46
61
 
@@ -50,7 +50,8 @@ namespace margelo::nitro::aix {
50
50
 
51
51
  public:
52
52
  // Properties
53
-
53
+ std::optional<AixStickToKeyboard> getStickToKeyboard() override;
54
+ void setStickToKeyboard(const std::optional<AixStickToKeyboard>& stickToKeyboard) override;
54
55
 
55
56
  public:
56
57
  // Methods
@@ -37,6 +37,7 @@ namespace margelo::nitro::aix { struct AixContentInsets; }
37
37
  #include "JFunc_void_AixContentInsets.hpp"
38
38
  #include <NitroModules/JNICallable.hpp>
39
39
  #include "JAixContentInsets.hpp"
40
+ #include "JFunc_void_bool.hpp"
40
41
 
41
42
  namespace margelo::nitro::aix {
42
43
 
@@ -156,6 +157,23 @@ namespace margelo::nitro::aix {
156
157
  static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_AixContentInsets::javaobject> /* onWillApplyContentInsets */)>("setOnWillApplyContentInsets_cxx");
157
158
  method(_javaPart, onWillApplyContentInsets.has_value() ? JFunc_void_AixContentInsets_cxx::fromCpp(onWillApplyContentInsets.value()) : nullptr);
158
159
  }
160
+ std::optional<std::function<void(bool /* isNearEnd */)>> JHybridAixSpec::getOnScrolledNearEndChange() {
161
+ static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_bool::javaobject>()>("getOnScrolledNearEndChange_cxx");
162
+ auto __result = method(_javaPart);
163
+ return __result != nullptr ? std::make_optional([&]() -> std::function<void(bool /* isNearEnd */)> {
164
+ if (__result->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] {
165
+ auto downcast = jni::static_ref_cast<JFunc_void_bool_cxx::javaobject>(__result);
166
+ return downcast->cthis()->getFunction();
167
+ } else {
168
+ auto __resultRef = jni::make_global(__result);
169
+ return JNICallable<JFunc_void_bool, void(bool)>(std::move(__resultRef));
170
+ }
171
+ }()) : std::nullopt;
172
+ }
173
+ void JHybridAixSpec::setOnScrolledNearEndChange(const std::optional<std::function<void(bool /* isNearEnd */)>>& onScrolledNearEndChange) {
174
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_bool::javaobject> /* onScrolledNearEndChange */)>("setOnScrolledNearEndChange_cxx");
175
+ method(_javaPart, onScrolledNearEndChange.has_value() ? JFunc_void_bool_cxx::fromCpp(onScrolledNearEndChange.value()) : nullptr);
176
+ }
159
177
 
160
178
  // Methods
161
179
  void JHybridAixSpec::scrollToEnd(std::optional<bool> animated) {
@@ -68,6 +68,8 @@ namespace margelo::nitro::aix {
68
68
  void setShouldApplyContentInsets(std::optional<bool> shouldApplyContentInsets) override;
69
69
  std::optional<std::function<void(const AixContentInsets& /* insets */)>> getOnWillApplyContentInsets() override;
70
70
  void setOnWillApplyContentInsets(const std::optional<std::function<void(const AixContentInsets& /* insets */)>>& onWillApplyContentInsets) override;
71
+ std::optional<std::function<void(bool /* isNearEnd */)>> getOnScrolledNearEndChange() override;
72
+ void setOnScrolledNearEndChange(const std::optional<std::function<void(bool /* isNearEnd */)>>& onScrolledNearEndChange) override;
71
73
 
72
74
  public:
73
75
  // Methods
@@ -36,7 +36,10 @@ void JHybridAixComposerStateUpdater::updateViewProps(jni::alias_ref<jni::JClass>
36
36
  throw std::runtime_error("HybridAixComposerState's data doesn't contain any props!");
37
37
  }
38
38
  const HybridAixComposerProps& props = maybeProps.value();
39
-
39
+ if (props.stickToKeyboard.isDirty) {
40
+ view->setStickToKeyboard(props.stickToKeyboard.value);
41
+ // TODO: Set isDirty = false
42
+ }
40
43
 
41
44
  // Update hybridRef if it changed
42
45
  if (props.hybridRef.isDirty) {
@@ -72,6 +72,10 @@ void JHybridAixStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* clas
72
72
  view->setOnWillApplyContentInsets(props.onWillApplyContentInsets.value);
73
73
  // TODO: Set isDirty = false
74
74
  }
75
+ if (props.onScrolledNearEndChange.isDirty) {
76
+ view->setOnScrolledNearEndChange(props.onScrolledNearEndChange.value);
77
+ // TODO: Set isDirty = false
78
+ }
75
79
 
76
80
  // Update hybridRef if it changed
77
81
  if (props.hybridRef.isDirty) {
@@ -0,0 +1,41 @@
1
+ ///
2
+ /// AixStickToKeyboard.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.aix
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "AixStickToKeyboard".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class AixStickToKeyboard(
20
+ @DoNotStrip
21
+ @Keep
22
+ val enabled: Boolean,
23
+ @DoNotStrip
24
+ @Keep
25
+ val offset: AixStickToKeyboardOffset?
26
+ ) {
27
+ /* primary constructor */
28
+
29
+ private companion object {
30
+ /**
31
+ * Constructor called from C++
32
+ */
33
+ @DoNotStrip
34
+ @Keep
35
+ @Suppress("unused")
36
+ @JvmStatic
37
+ private fun fromCpp(enabled: Boolean, offset: AixStickToKeyboardOffset?): AixStickToKeyboard {
38
+ return AixStickToKeyboard(enabled, offset)
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,41 @@
1
+ ///
2
+ /// AixStickToKeyboardOffset.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.aix
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "AixStickToKeyboardOffset".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class AixStickToKeyboardOffset(
20
+ @DoNotStrip
21
+ @Keep
22
+ val whenKeyboardOpen: Double,
23
+ @DoNotStrip
24
+ @Keep
25
+ val whenKeyboardClosed: Double
26
+ ) {
27
+ /* primary constructor */
28
+
29
+ private companion object {
30
+ /**
31
+ * Constructor called from C++
32
+ */
33
+ @DoNotStrip
34
+ @Keep
35
+ @Suppress("unused")
36
+ @JvmStatic
37
+ private fun fromCpp(whenKeyboardOpen: Double, whenKeyboardClosed: Double): AixStickToKeyboardOffset {
38
+ return AixStickToKeyboardOffset(whenKeyboardOpen, whenKeyboardClosed)
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void_bool.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.aix
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
14
+
15
+
16
+ /**
17
+ * Represents the JavaScript callback `(isNearEnd: boolean) => void`.
18
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
19
+ * or in Kotlin/Java (in which case it is a native callback).
20
+ */
21
+ @DoNotStrip
22
+ @Keep
23
+ @Suppress("ClassName", "RedundantUnitReturnType")
24
+ fun interface Func_void_bool: (Boolean) -> Unit {
25
+ /**
26
+ * Call the given JS callback.
27
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
28
+ */
29
+ @DoNotStrip
30
+ @Keep
31
+ override fun invoke(isNearEnd: Boolean): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `(isNearEnd: boolean) => void`.
36
+ * This is implemented in C++, via a `std::function<...>`.
37
+ * The callback might be coming from JS.
38
+ */
39
+ @DoNotStrip
40
+ @Keep
41
+ @Suppress(
42
+ "KotlinJniMissingFunction", "unused",
43
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
44
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
45
+ )
46
+ class Func_void_bool_cxx: Func_void_bool {
47
+ @DoNotStrip
48
+ @Keep
49
+ private val mHybridData: HybridData
50
+
51
+ @DoNotStrip
52
+ @Keep
53
+ private constructor(hybridData: HybridData) {
54
+ mHybridData = hybridData
55
+ }
56
+
57
+ @DoNotStrip
58
+ @Keep
59
+ override fun invoke(isNearEnd: Boolean): Unit
60
+ = invoke_cxx(isNearEnd)
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(isNearEnd: Boolean): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `(isNearEnd: boolean) => void`.
68
+ * This is implemented in Java/Kotlin, via a `(Boolean) -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_bool_java(private val function: (Boolean) -> Unit): Func_void_bool {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(isNearEnd: Boolean): Unit {
78
+ return this.function(isNearEnd)
79
+ }
80
+ }
@@ -42,7 +42,11 @@ abstract class HybridAixComposerSpec: HybridView() {
42
42
  }
43
43
 
44
44
  // Properties
45
-
45
+ @get:DoNotStrip
46
+ @get:Keep
47
+ @set:DoNotStrip
48
+ @set:Keep
49
+ abstract var stickToKeyboard: AixStickToKeyboard?
46
50
 
47
51
  // Methods
48
52
 
@@ -103,6 +103,20 @@ abstract class HybridAixSpec: HybridView() {
103
103
  set(value) {
104
104
  onWillApplyContentInsets = value?.let { it }
105
105
  }
106
+
107
+ abstract var onScrolledNearEndChange: ((isNearEnd: Boolean) -> Unit)?
108
+
109
+ private var onScrolledNearEndChange_cxx: Func_void_bool?
110
+ @Keep
111
+ @DoNotStrip
112
+ get() {
113
+ return onScrolledNearEndChange?.let { Func_void_bool_java(it) }
114
+ }
115
+ @Keep
116
+ @DoNotStrip
117
+ set(value) {
118
+ onScrolledNearEndChange = value?.let { it }
119
+ }
106
120
 
107
121
  // Methods
108
122
  @DoNotStrip
@@ -24,6 +24,14 @@ namespace margelo::nitro::aix::bridge::swift {
24
24
  };
25
25
  }
26
26
 
27
+ // pragma MARK: std::function<void(bool /* isNearEnd */)>
28
+ Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept {
29
+ auto swiftClosure = Aix::Func_void_bool::fromUnsafe(swiftClosureWrapper);
30
+ return [swiftClosure = std::move(swiftClosure)](bool isNearEnd) mutable -> void {
31
+ swiftClosure.call(isNearEnd);
32
+ };
33
+ }
34
+
27
35
  // pragma MARK: std::shared_ptr<HybridAixSpec>
28
36
  std::shared_ptr<HybridAixSpec> create_std__shared_ptr_HybridAixSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
29
37
  Aix::HybridAixSpec_cxx swiftPart = Aix::HybridAixSpec_cxx::fromUnsafe(swiftUnsafePointer);
@@ -20,6 +20,10 @@ namespace margelo::nitro::aix { struct AixScrollIndicatorInsetValue; }
20
20
  namespace margelo::nitro::aix { struct AixScrollIndicatorInsets; }
21
21
  // Forward declaration of `AixScrollOnFooterSizeUpdate` to properly resolve imports.
22
22
  namespace margelo::nitro::aix { struct AixScrollOnFooterSizeUpdate; }
23
+ // Forward declaration of `AixStickToKeyboardOffset` to properly resolve imports.
24
+ namespace margelo::nitro::aix { struct AixStickToKeyboardOffset; }
25
+ // Forward declaration of `AixStickToKeyboard` to properly resolve imports.
26
+ namespace margelo::nitro::aix { struct AixStickToKeyboard; }
23
27
  // Forward declaration of `HybridAixCellViewSpec` to properly resolve imports.
24
28
  namespace margelo::nitro::aix { class HybridAixCellViewSpec; }
25
29
  // Forward declaration of `HybridAixComposerSpec` to properly resolve imports.
@@ -42,6 +46,8 @@ namespace Aix { class HybridAixSpec_cxx; }
42
46
  #include "AixScrollIndicatorInsetValue.hpp"
43
47
  #include "AixScrollIndicatorInsets.hpp"
44
48
  #include "AixScrollOnFooterSizeUpdate.hpp"
49
+ #include "AixStickToKeyboard.hpp"
50
+ #include "AixStickToKeyboardOffset.hpp"
45
51
  #include "HybridAixCellViewSpec.hpp"
46
52
  #include "HybridAixComposerSpec.hpp"
47
53
  #include "HybridAixSpec.hpp"
@@ -215,6 +221,43 @@ namespace margelo::nitro::aix::bridge::swift {
215
221
  return *optional;
216
222
  }
217
223
 
224
+ // pragma MARK: std::function<void(bool /* isNearEnd */)>
225
+ /**
226
+ * Specialized version of `std::function<void(bool)>`.
227
+ */
228
+ using Func_void_bool = std::function<void(bool /* isNearEnd */)>;
229
+ /**
230
+ * Wrapper class for a `std::function<void(bool / * isNearEnd * /)>`, this can be used from Swift.
231
+ */
232
+ class Func_void_bool_Wrapper final {
233
+ public:
234
+ explicit Func_void_bool_Wrapper(std::function<void(bool /* isNearEnd */)>&& func): _function(std::make_unique<std::function<void(bool /* isNearEnd */)>>(std::move(func))) {}
235
+ inline void call(bool isNearEnd) const noexcept {
236
+ _function->operator()(isNearEnd);
237
+ }
238
+ private:
239
+ std::unique_ptr<std::function<void(bool /* isNearEnd */)>> _function;
240
+ } SWIFT_NONCOPYABLE;
241
+ Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept;
242
+ inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept {
243
+ return Func_void_bool_Wrapper(std::move(value));
244
+ }
245
+
246
+ // pragma MARK: std::optional<std::function<void(bool /* isNearEnd */)>>
247
+ /**
248
+ * Specialized version of `std::optional<std::function<void(bool / * isNearEnd * /)>>`.
249
+ */
250
+ using std__optional_std__function_void_bool____isNearEnd______ = std::optional<std::function<void(bool /* isNearEnd */)>>;
251
+ inline std::optional<std::function<void(bool /* isNearEnd */)>> create_std__optional_std__function_void_bool____isNearEnd______(const std::function<void(bool /* isNearEnd */)>& value) noexcept {
252
+ return std::optional<std::function<void(bool /* isNearEnd */)>>(value);
253
+ }
254
+ inline bool has_value_std__optional_std__function_void_bool____isNearEnd______(const std::optional<std::function<void(bool /* isNearEnd */)>>& optional) noexcept {
255
+ return optional.has_value();
256
+ }
257
+ inline std::function<void(bool /* isNearEnd */)> get_std__optional_std__function_void_bool____isNearEnd______(const std::optional<std::function<void(bool /* isNearEnd */)>>& optional) noexcept {
258
+ return *optional;
259
+ }
260
+
218
261
  // pragma MARK: std::shared_ptr<HybridAixSpec>
219
262
  /**
220
263
  * Specialized version of `std::shared_ptr<HybridAixSpec>`.
@@ -248,6 +291,36 @@ namespace margelo::nitro::aix::bridge::swift {
248
291
  using std__weak_ptr_HybridAixCellViewSpec_ = std::weak_ptr<HybridAixCellViewSpec>;
249
292
  inline std__weak_ptr_HybridAixCellViewSpec_ weakify_std__shared_ptr_HybridAixCellViewSpec_(const std::shared_ptr<HybridAixCellViewSpec>& strong) noexcept { return strong; }
250
293
 
294
+ // pragma MARK: std::optional<AixStickToKeyboardOffset>
295
+ /**
296
+ * Specialized version of `std::optional<AixStickToKeyboardOffset>`.
297
+ */
298
+ using std__optional_AixStickToKeyboardOffset_ = std::optional<AixStickToKeyboardOffset>;
299
+ inline std::optional<AixStickToKeyboardOffset> create_std__optional_AixStickToKeyboardOffset_(const AixStickToKeyboardOffset& value) noexcept {
300
+ return std::optional<AixStickToKeyboardOffset>(value);
301
+ }
302
+ inline bool has_value_std__optional_AixStickToKeyboardOffset_(const std::optional<AixStickToKeyboardOffset>& optional) noexcept {
303
+ return optional.has_value();
304
+ }
305
+ inline AixStickToKeyboardOffset get_std__optional_AixStickToKeyboardOffset_(const std::optional<AixStickToKeyboardOffset>& optional) noexcept {
306
+ return *optional;
307
+ }
308
+
309
+ // pragma MARK: std::optional<AixStickToKeyboard>
310
+ /**
311
+ * Specialized version of `std::optional<AixStickToKeyboard>`.
312
+ */
313
+ using std__optional_AixStickToKeyboard_ = std::optional<AixStickToKeyboard>;
314
+ inline std::optional<AixStickToKeyboard> create_std__optional_AixStickToKeyboard_(const AixStickToKeyboard& value) noexcept {
315
+ return std::optional<AixStickToKeyboard>(value);
316
+ }
317
+ inline bool has_value_std__optional_AixStickToKeyboard_(const std::optional<AixStickToKeyboard>& optional) noexcept {
318
+ return optional.has_value();
319
+ }
320
+ inline AixStickToKeyboard get_std__optional_AixStickToKeyboard_(const std::optional<AixStickToKeyboard>& optional) noexcept {
321
+ return *optional;
322
+ }
323
+
251
324
  // pragma MARK: std::shared_ptr<HybridAixComposerSpec>
252
325
  /**
253
326
  * Specialized version of `std::shared_ptr<HybridAixComposerSpec>`.
@@ -20,6 +20,10 @@ namespace margelo::nitro::aix { struct AixScrollIndicatorInsetValue; }
20
20
  namespace margelo::nitro::aix { struct AixScrollIndicatorInsets; }
21
21
  // Forward declaration of `AixScrollOnFooterSizeUpdate` to properly resolve imports.
22
22
  namespace margelo::nitro::aix { struct AixScrollOnFooterSizeUpdate; }
23
+ // Forward declaration of `AixStickToKeyboardOffset` to properly resolve imports.
24
+ namespace margelo::nitro::aix { struct AixStickToKeyboardOffset; }
25
+ // Forward declaration of `AixStickToKeyboard` to properly resolve imports.
26
+ namespace margelo::nitro::aix { struct AixStickToKeyboard; }
23
27
  // Forward declaration of `HybridAixCellViewSpec` to properly resolve imports.
24
28
  namespace margelo::nitro::aix { class HybridAixCellViewSpec; }
25
29
  // Forward declaration of `HybridAixComposerSpec` to properly resolve imports.
@@ -34,6 +38,8 @@ namespace margelo::nitro::aix { class HybridAixSpec; }
34
38
  #include "AixScrollIndicatorInsetValue.hpp"
35
39
  #include "AixScrollIndicatorInsets.hpp"
36
40
  #include "AixScrollOnFooterSizeUpdate.hpp"
41
+ #include "AixStickToKeyboard.hpp"
42
+ #include "AixStickToKeyboardOffset.hpp"
37
43
  #include "HybridAixCellViewSpec.hpp"
38
44
  #include "HybridAixComposerSpec.hpp"
39
45
  #include "HybridAixSpec.hpp"