react-native-nitro-pose-exercises 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/LICENSE +20 -0
  2. package/NitroPoseExercises.podspec +32 -0
  3. package/README.md +538 -0
  4. package/android/CMakeLists.txt +31 -0
  5. package/android/build.gradle +121 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/cpp/cpp-adapter.cpp +11 -0
  8. package/android/src/main/java/com/margelo/nitro/nitroposeexercises/NitroPoseExercises.kt +535 -0
  9. package/android/src/main/java/com/margelo/nitro/nitroposeexercises/NitroPoseExercisesPackage.kt +22 -0
  10. package/ios/NitroPoseExercises.swift +527 -0
  11. package/lib/module/NitroPoseExercises.nitro.js +17 -0
  12. package/lib/module/NitroPoseExercises.nitro.js.map +1 -0
  13. package/lib/module/config/pushup.js +71 -0
  14. package/lib/module/config/pushup.js.map +1 -0
  15. package/lib/module/index.js +7 -0
  16. package/lib/module/index.js.map +1 -0
  17. package/lib/module/package.json +1 -0
  18. package/lib/typescript/package.json +1 -0
  19. package/lib/typescript/src/NitroPoseExercises.nitro.d.ts +97 -0
  20. package/lib/typescript/src/NitroPoseExercises.nitro.d.ts.map +1 -0
  21. package/lib/typescript/src/config/pushup.d.ts +3 -0
  22. package/lib/typescript/src/config/pushup.d.ts.map +1 -0
  23. package/lib/typescript/src/index.d.ts +6 -0
  24. package/lib/typescript/src/index.d.ts.map +1 -0
  25. package/nitro.json +23 -0
  26. package/nitrogen/generated/android/c++/JAngleDefinition.hpp +69 -0
  27. package/nitrogen/generated/android/c++/JAngleSnapshot.hpp +61 -0
  28. package/nitrogen/generated/android/c++/JExerciseConfig.hpp +166 -0
  29. package/nitrogen/generated/android/c++/JExercisePhase.hpp +67 -0
  30. package/nitrogen/generated/android/c++/JExerciseType.hpp +61 -0
  31. package/nitrogen/generated/android/c++/JFormFeedback.hpp +67 -0
  32. package/nitrogen/generated/android/c++/JFormRule.hpp +79 -0
  33. package/nitrogen/generated/android/c++/JFormSeverity.hpp +61 -0
  34. package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
  35. package/nitrogen/generated/android/c++/JFunc_void_ExercisePhase.hpp +77 -0
  36. package/nitrogen/generated/android/c++/JFunc_void_FormFeedback.hpp +80 -0
  37. package/nitrogen/generated/android/c++/JFunc_void_HoldProgress.hpp +77 -0
  38. package/nitrogen/generated/android/c++/JFunc_void_RepData.hpp +81 -0
  39. package/nitrogen/generated/android/c++/JFunc_void_SessionResult.hpp +85 -0
  40. package/nitrogen/generated/android/c++/JHoldProgress.hpp +65 -0
  41. package/nitrogen/generated/android/c++/JHybridNitroPoseExercisesSpec.cpp +311 -0
  42. package/nitrogen/generated/android/c++/JHybridNitroPoseExercisesSpec.hpp +87 -0
  43. package/nitrogen/generated/android/c++/JLandmark.hpp +69 -0
  44. package/nitrogen/generated/android/c++/JPhaseThreshold.hpp +71 -0
  45. package/nitrogen/generated/android/c++/JRepData.hpp +90 -0
  46. package/nitrogen/generated/android/c++/JSessionResult.hpp +120 -0
  47. package/nitrogen/generated/android/c++/JSessionStatus.hpp +67 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/AngleDefinition.kt +66 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/AngleSnapshot.kt +56 -0
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/ExerciseConfig.kt +81 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/ExercisePhase.kt +26 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/ExerciseType.kt +24 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/FormFeedback.kt +61 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/FormRule.kt +76 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/FormSeverity.kt +24 -0
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void.kt +80 -0
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_ExercisePhase.kt +80 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_FormFeedback.kt +80 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_HoldProgress.kt +80 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_RepData.kt +80 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_SessionResult.kt +80 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/HoldProgress.kt +61 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/HybridNitroPoseExercisesSpec.kt +196 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Landmark.kt +66 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/PhaseThreshold.kt +66 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/RepData.kt +66 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/SessionResult.kt +76 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/SessionStatus.kt +26 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/nitroposeexercisesOnLoad.kt +35 -0
  70. package/nitrogen/generated/android/nitroposeexercises+autolinking.cmake +81 -0
  71. package/nitrogen/generated/android/nitroposeexercises+autolinking.gradle +27 -0
  72. package/nitrogen/generated/android/nitroposeexercisesOnLoad.cpp +66 -0
  73. package/nitrogen/generated/android/nitroposeexercisesOnLoad.hpp +34 -0
  74. package/nitrogen/generated/ios/NitroPoseExercises+autolinking.rb +62 -0
  75. package/nitrogen/generated/ios/NitroPoseExercises-Swift-Cxx-Bridge.cpp +100 -0
  76. package/nitrogen/generated/ios/NitroPoseExercises-Swift-Cxx-Bridge.hpp +449 -0
  77. package/nitrogen/generated/ios/NitroPoseExercises-Swift-Cxx-Umbrella.hpp +95 -0
  78. package/nitrogen/generated/ios/NitroPoseExercisesAutolinking.mm +33 -0
  79. package/nitrogen/generated/ios/NitroPoseExercisesAutolinking.swift +26 -0
  80. package/nitrogen/generated/ios/c++/HybridNitroPoseExercisesSpecSwift.cpp +11 -0
  81. package/nitrogen/generated/ios/c++/HybridNitroPoseExercisesSpecSwift.hpp +236 -0
  82. package/nitrogen/generated/ios/swift/AngleDefinition.swift +44 -0
  83. package/nitrogen/generated/ios/swift/AngleSnapshot.swift +34 -0
  84. package/nitrogen/generated/ios/swift/ExerciseConfig.swift +83 -0
  85. package/nitrogen/generated/ios/swift/ExercisePhase.swift +52 -0
  86. package/nitrogen/generated/ios/swift/ExerciseType.swift +44 -0
  87. package/nitrogen/generated/ios/swift/FormFeedback.swift +39 -0
  88. package/nitrogen/generated/ios/swift/FormRule.swift +54 -0
  89. package/nitrogen/generated/ios/swift/FormSeverity.swift +44 -0
  90. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  91. package/nitrogen/generated/ios/swift/Func_void_ExercisePhase.swift +46 -0
  92. package/nitrogen/generated/ios/swift/Func_void_FormFeedback.swift +46 -0
  93. package/nitrogen/generated/ios/swift/Func_void_HoldProgress.swift +46 -0
  94. package/nitrogen/generated/ios/swift/Func_void_RepData.swift +46 -0
  95. package/nitrogen/generated/ios/swift/Func_void_SessionResult.swift +46 -0
  96. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  97. package/nitrogen/generated/ios/swift/HoldProgress.swift +39 -0
  98. package/nitrogen/generated/ios/swift/HybridNitroPoseExercisesSpec.swift +73 -0
  99. package/nitrogen/generated/ios/swift/HybridNitroPoseExercisesSpec_cxx.swift +483 -0
  100. package/nitrogen/generated/ios/swift/Landmark.swift +44 -0
  101. package/nitrogen/generated/ios/swift/PhaseThreshold.swift +44 -0
  102. package/nitrogen/generated/ios/swift/RepData.swift +50 -0
  103. package/nitrogen/generated/ios/swift/SessionResult.swift +66 -0
  104. package/nitrogen/generated/ios/swift/SessionStatus.swift +52 -0
  105. package/nitrogen/generated/shared/c++/AngleDefinition.hpp +95 -0
  106. package/nitrogen/generated/shared/c++/AngleSnapshot.hpp +87 -0
  107. package/nitrogen/generated/shared/c++/ExerciseConfig.hpp +122 -0
  108. package/nitrogen/generated/shared/c++/ExercisePhase.hpp +88 -0
  109. package/nitrogen/generated/shared/c++/ExerciseType.hpp +80 -0
  110. package/nitrogen/generated/shared/c++/FormFeedback.hpp +93 -0
  111. package/nitrogen/generated/shared/c++/FormRule.hpp +105 -0
  112. package/nitrogen/generated/shared/c++/FormSeverity.hpp +80 -0
  113. package/nitrogen/generated/shared/c++/HoldProgress.hpp +91 -0
  114. package/nitrogen/generated/shared/c++/HybridNitroPoseExercisesSpec.cpp +46 -0
  115. package/nitrogen/generated/shared/c++/HybridNitroPoseExercisesSpec.hpp +117 -0
  116. package/nitrogen/generated/shared/c++/Landmark.hpp +95 -0
  117. package/nitrogen/generated/shared/c++/PhaseThreshold.hpp +97 -0
  118. package/nitrogen/generated/shared/c++/RepData.hpp +97 -0
  119. package/nitrogen/generated/shared/c++/SessionResult.hpp +108 -0
  120. package/nitrogen/generated/shared/c++/SessionStatus.hpp +88 -0
  121. package/package.json +187 -0
  122. package/src/NitroPoseExercises.nitro.ts +155 -0
  123. package/src/config/pushup.ts +62 -0
  124. package/src/index.tsx +28 -0
@@ -0,0 +1,120 @@
1
+ ///
2
+ /// JSessionResult.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "SessionResult.hpp"
12
+
13
+ #include "AngleSnapshot.hpp"
14
+ #include "FormFeedback.hpp"
15
+ #include "FormSeverity.hpp"
16
+ #include "JAngleSnapshot.hpp"
17
+ #include "JFormFeedback.hpp"
18
+ #include "JFormSeverity.hpp"
19
+ #include <string>
20
+ #include <vector>
21
+
22
+ namespace margelo::nitro::nitroposeexercises {
23
+
24
+ using namespace facebook;
25
+
26
+ /**
27
+ * The C++ JNI bridge between the C++ struct "SessionResult" and the the Kotlin data class "SessionResult".
28
+ */
29
+ struct JSessionResult final: public jni::JavaClass<JSessionResult> {
30
+ public:
31
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroposeexercises/SessionResult;";
32
+
33
+ public:
34
+ /**
35
+ * Convert this Java/Kotlin-based struct to the C++ struct SessionResult by copying all values to C++.
36
+ */
37
+ [[maybe_unused]]
38
+ [[nodiscard]]
39
+ SessionResult toCpp() const {
40
+ static const auto clazz = javaClassStatic();
41
+ static const auto fieldTotalReps = clazz->getField<double>("totalReps");
42
+ double totalReps = this->getFieldValue(fieldTotalReps);
43
+ static const auto fieldTotalDurationMs = clazz->getField<double>("totalDurationMs");
44
+ double totalDurationMs = this->getFieldValue(fieldTotalDurationMs);
45
+ static const auto fieldAverageRepDurationMs = clazz->getField<double>("averageRepDurationMs");
46
+ double averageRepDurationMs = this->getFieldValue(fieldAverageRepDurationMs);
47
+ static const auto fieldAverageFormScore = clazz->getField<double>("averageFormScore");
48
+ double averageFormScore = this->getFieldValue(fieldAverageFormScore);
49
+ static const auto fieldFormViolations = clazz->getField<jni::JArrayClass<JFormFeedback>>("formViolations");
50
+ jni::local_ref<jni::JArrayClass<JFormFeedback>> formViolations = this->getFieldValue(fieldFormViolations);
51
+ static const auto fieldAngleHistory = clazz->getField<jni::JArrayClass<JAngleSnapshot>>("angleHistory");
52
+ jni::local_ref<jni::JArrayClass<JAngleSnapshot>> angleHistory = this->getFieldValue(fieldAngleHistory);
53
+ return SessionResult(
54
+ totalReps,
55
+ totalDurationMs,
56
+ averageRepDurationMs,
57
+ averageFormScore,
58
+ [&](auto&& __input) {
59
+ size_t __size = __input->size();
60
+ std::vector<FormFeedback> __vector;
61
+ __vector.reserve(__size);
62
+ for (size_t __i = 0; __i < __size; __i++) {
63
+ auto __element = __input->getElement(__i);
64
+ __vector.push_back(__element->toCpp());
65
+ }
66
+ return __vector;
67
+ }(formViolations),
68
+ [&](auto&& __input) {
69
+ size_t __size = __input->size();
70
+ std::vector<AngleSnapshot> __vector;
71
+ __vector.reserve(__size);
72
+ for (size_t __i = 0; __i < __size; __i++) {
73
+ auto __element = __input->getElement(__i);
74
+ __vector.push_back(__element->toCpp());
75
+ }
76
+ return __vector;
77
+ }(angleHistory)
78
+ );
79
+ }
80
+
81
+ public:
82
+ /**
83
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
84
+ */
85
+ [[maybe_unused]]
86
+ static jni::local_ref<JSessionResult::javaobject> fromCpp(const SessionResult& value) {
87
+ using JSignature = JSessionResult(double, double, double, double, jni::alias_ref<jni::JArrayClass<JFormFeedback>>, jni::alias_ref<jni::JArrayClass<JAngleSnapshot>>);
88
+ static const auto clazz = javaClassStatic();
89
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
90
+ return create(
91
+ clazz,
92
+ value.totalReps,
93
+ value.totalDurationMs,
94
+ value.averageRepDurationMs,
95
+ value.averageFormScore,
96
+ [&](auto&& __input) {
97
+ size_t __size = __input.size();
98
+ jni::local_ref<jni::JArrayClass<JFormFeedback>> __array = jni::JArrayClass<JFormFeedback>::newArray(__size);
99
+ for (size_t __i = 0; __i < __size; __i++) {
100
+ const auto& __element = __input[__i];
101
+ auto __elementJni = JFormFeedback::fromCpp(__element);
102
+ __array->setElement(__i, *__elementJni);
103
+ }
104
+ return __array;
105
+ }(value.formViolations),
106
+ [&](auto&& __input) {
107
+ size_t __size = __input.size();
108
+ jni::local_ref<jni::JArrayClass<JAngleSnapshot>> __array = jni::JArrayClass<JAngleSnapshot>::newArray(__size);
109
+ for (size_t __i = 0; __i < __size; __i++) {
110
+ const auto& __element = __input[__i];
111
+ auto __elementJni = JAngleSnapshot::fromCpp(__element);
112
+ __array->setElement(__i, *__elementJni);
113
+ }
114
+ return __array;
115
+ }(value.angleHistory)
116
+ );
117
+ }
118
+ };
119
+
120
+ } // namespace margelo::nitro::nitroposeexercises
@@ -0,0 +1,67 @@
1
+ ///
2
+ /// JSessionStatus.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "SessionStatus.hpp"
12
+
13
+ namespace margelo::nitro::nitroposeexercises {
14
+
15
+ using namespace facebook;
16
+
17
+ /**
18
+ * The C++ JNI bridge between the C++ enum "SessionStatus" and the the Kotlin enum "SessionStatus".
19
+ */
20
+ struct JSessionStatus final: public jni::JavaClass<JSessionStatus> {
21
+ public:
22
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroposeexercises/SessionStatus;";
23
+
24
+ public:
25
+ /**
26
+ * Convert this Java/Kotlin-based enum to the C++ enum SessionStatus.
27
+ */
28
+ [[maybe_unused]]
29
+ [[nodiscard]]
30
+ SessionStatus toCpp() const {
31
+ static const auto clazz = javaClassStatic();
32
+ static const auto fieldOrdinal = clazz->getField<int>("value");
33
+ int ordinal = this->getFieldValue(fieldOrdinal);
34
+ return static_cast<SessionStatus>(ordinal);
35
+ }
36
+
37
+ public:
38
+ /**
39
+ * Create a Java/Kotlin-based enum with the given C++ enum's value.
40
+ */
41
+ [[maybe_unused]]
42
+ static jni::alias_ref<JSessionStatus> fromCpp(SessionStatus value) {
43
+ static const auto clazz = javaClassStatic();
44
+ switch (value) {
45
+ case SessionStatus::IDLE:
46
+ static const auto fieldIDLE = clazz->getStaticField<JSessionStatus>("IDLE");
47
+ return clazz->getStaticFieldValue(fieldIDLE);
48
+ case SessionStatus::COUNTDOWN:
49
+ static const auto fieldCOUNTDOWN = clazz->getStaticField<JSessionStatus>("COUNTDOWN");
50
+ return clazz->getStaticFieldValue(fieldCOUNTDOWN);
51
+ case SessionStatus::ACTIVE:
52
+ static const auto fieldACTIVE = clazz->getStaticField<JSessionStatus>("ACTIVE");
53
+ return clazz->getStaticFieldValue(fieldACTIVE);
54
+ case SessionStatus::PAUSED:
55
+ static const auto fieldPAUSED = clazz->getStaticField<JSessionStatus>("PAUSED");
56
+ return clazz->getStaticFieldValue(fieldPAUSED);
57
+ case SessionStatus::COMPLETED:
58
+ static const auto fieldCOMPLETED = clazz->getStaticField<JSessionStatus>("COMPLETED");
59
+ return clazz->getStaticFieldValue(fieldCOMPLETED);
60
+ default:
61
+ std::string stringValue = std::to_string(static_cast<int>(value));
62
+ throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
63
+ }
64
+ }
65
+ };
66
+
67
+ } // namespace margelo::nitro::nitroposeexercises
@@ -0,0 +1,66 @@
1
+ ///
2
+ /// AngleDefinition.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.nitroposeexercises
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 "AngleDefinition".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class AngleDefinition(
21
+ @DoNotStrip
22
+ @Keep
23
+ val name: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val landmarkA: Double,
27
+ @DoNotStrip
28
+ @Keep
29
+ val landmarkB: Double,
30
+ @DoNotStrip
31
+ @Keep
32
+ val landmarkC: Double
33
+ ) {
34
+ /* primary constructor */
35
+
36
+ override fun equals(other: Any?): Boolean {
37
+ if (this === other) return true
38
+ if (other !is AngleDefinition) return false
39
+ return Objects.deepEquals(this.name, other.name)
40
+ && Objects.deepEquals(this.landmarkA, other.landmarkA)
41
+ && Objects.deepEquals(this.landmarkB, other.landmarkB)
42
+ && Objects.deepEquals(this.landmarkC, other.landmarkC)
43
+ }
44
+
45
+ override fun hashCode(): Int {
46
+ return arrayOf<Any?>(
47
+ name,
48
+ landmarkA,
49
+ landmarkB,
50
+ landmarkC
51
+ ).contentDeepHashCode()
52
+ }
53
+
54
+ companion object {
55
+ /**
56
+ * Constructor called from C++
57
+ */
58
+ @DoNotStrip
59
+ @Keep
60
+ @Suppress("unused")
61
+ @JvmStatic
62
+ private fun fromCpp(name: String, landmarkA: Double, landmarkB: Double, landmarkC: Double): AngleDefinition {
63
+ return AngleDefinition(name, landmarkA, landmarkB, landmarkC)
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,56 @@
1
+ ///
2
+ /// AngleSnapshot.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.nitroposeexercises
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 "AngleSnapshot".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class AngleSnapshot(
21
+ @DoNotStrip
22
+ @Keep
23
+ val name: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val value: Double
27
+ ) {
28
+ /* primary constructor */
29
+
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is AngleSnapshot) return false
33
+ return Objects.deepEquals(this.name, other.name)
34
+ && Objects.deepEquals(this.value, other.value)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ name,
40
+ value
41
+ ).contentDeepHashCode()
42
+ }
43
+
44
+ companion object {
45
+ /**
46
+ * Constructor called from C++
47
+ */
48
+ @DoNotStrip
49
+ @Keep
50
+ @Suppress("unused")
51
+ @JvmStatic
52
+ private fun fromCpp(name: String, value: Double): AngleSnapshot {
53
+ return AngleSnapshot(name, value)
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// ExerciseConfig.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.nitroposeexercises
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 "ExerciseConfig".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class ExerciseConfig(
21
+ @DoNotStrip
22
+ @Keep
23
+ val name: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val type: ExerciseType,
27
+ @DoNotStrip
28
+ @Keep
29
+ val angles: Array<AngleDefinition>,
30
+ @DoNotStrip
31
+ @Keep
32
+ val phases: Array<PhaseThreshold>,
33
+ @DoNotStrip
34
+ @Keep
35
+ val repSequence: Array<ExercisePhase>,
36
+ @DoNotStrip
37
+ @Keep
38
+ val formRules: Array<FormRule>,
39
+ @DoNotStrip
40
+ @Keep
41
+ val holdDurationMs: Double
42
+ ) {
43
+ /* primary constructor */
44
+
45
+ override fun equals(other: Any?): Boolean {
46
+ if (this === other) return true
47
+ if (other !is ExerciseConfig) return false
48
+ return Objects.deepEquals(this.name, other.name)
49
+ && Objects.deepEquals(this.type, other.type)
50
+ && Objects.deepEquals(this.angles, other.angles)
51
+ && Objects.deepEquals(this.phases, other.phases)
52
+ && Objects.deepEquals(this.repSequence, other.repSequence)
53
+ && Objects.deepEquals(this.formRules, other.formRules)
54
+ && Objects.deepEquals(this.holdDurationMs, other.holdDurationMs)
55
+ }
56
+
57
+ override fun hashCode(): Int {
58
+ return arrayOf<Any?>(
59
+ name,
60
+ type,
61
+ angles,
62
+ phases,
63
+ repSequence,
64
+ formRules,
65
+ holdDurationMs
66
+ ).contentDeepHashCode()
67
+ }
68
+
69
+ companion object {
70
+ /**
71
+ * Constructor called from C++
72
+ */
73
+ @DoNotStrip
74
+ @Keep
75
+ @Suppress("unused")
76
+ @JvmStatic
77
+ private fun fromCpp(name: String, type: ExerciseType, angles: Array<AngleDefinition>, phases: Array<PhaseThreshold>, repSequence: Array<ExercisePhase>, formRules: Array<FormRule>, holdDurationMs: Double): ExerciseConfig {
78
+ return ExerciseConfig(name, type, angles, phases, repSequence, formRules, holdDurationMs)
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,26 @@
1
+ ///
2
+ /// ExercisePhase.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.nitroposeexercises
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "ExercisePhase".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class ExercisePhase(@DoNotStrip @Keep val value: Int) {
19
+ HOLD(0),
20
+ UP(1),
21
+ DOWN(2),
22
+ TRANSITION(3),
23
+ UNKNOWN(4);
24
+
25
+ companion object
26
+ }
@@ -0,0 +1,24 @@
1
+ ///
2
+ /// ExerciseType.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.nitroposeexercises
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "ExerciseType".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class ExerciseType(@DoNotStrip @Keep val value: Int) {
19
+ REP(0),
20
+ HOLD(1),
21
+ FLOW(2);
22
+
23
+ companion object
24
+ }
@@ -0,0 +1,61 @@
1
+ ///
2
+ /// FormFeedback.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.nitroposeexercises
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 "FormFeedback".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class FormFeedback(
21
+ @DoNotStrip
22
+ @Keep
23
+ val ruleName: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val message: String,
27
+ @DoNotStrip
28
+ @Keep
29
+ val severity: FormSeverity
30
+ ) {
31
+ /* primary constructor */
32
+
33
+ override fun equals(other: Any?): Boolean {
34
+ if (this === other) return true
35
+ if (other !is FormFeedback) return false
36
+ return Objects.deepEquals(this.ruleName, other.ruleName)
37
+ && Objects.deepEquals(this.message, other.message)
38
+ && Objects.deepEquals(this.severity, other.severity)
39
+ }
40
+
41
+ override fun hashCode(): Int {
42
+ return arrayOf<Any?>(
43
+ ruleName,
44
+ message,
45
+ severity
46
+ ).contentDeepHashCode()
47
+ }
48
+
49
+ companion object {
50
+ /**
51
+ * Constructor called from C++
52
+ */
53
+ @DoNotStrip
54
+ @Keep
55
+ @Suppress("unused")
56
+ @JvmStatic
57
+ private fun fromCpp(ruleName: String, message: String, severity: FormSeverity): FormFeedback {
58
+ return FormFeedback(ruleName, message, severity)
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// FormRule.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.nitroposeexercises
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 "FormRule".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class FormRule(
21
+ @DoNotStrip
22
+ @Keep
23
+ val name: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val message: String,
27
+ @DoNotStrip
28
+ @Keep
29
+ val severity: FormSeverity,
30
+ @DoNotStrip
31
+ @Keep
32
+ val angleName: String,
33
+ @DoNotStrip
34
+ @Keep
35
+ val minAngle: Double,
36
+ @DoNotStrip
37
+ @Keep
38
+ val maxAngle: Double
39
+ ) {
40
+ /* primary constructor */
41
+
42
+ override fun equals(other: Any?): Boolean {
43
+ if (this === other) return true
44
+ if (other !is FormRule) return false
45
+ return Objects.deepEquals(this.name, other.name)
46
+ && Objects.deepEquals(this.message, other.message)
47
+ && Objects.deepEquals(this.severity, other.severity)
48
+ && Objects.deepEquals(this.angleName, other.angleName)
49
+ && Objects.deepEquals(this.minAngle, other.minAngle)
50
+ && Objects.deepEquals(this.maxAngle, other.maxAngle)
51
+ }
52
+
53
+ override fun hashCode(): Int {
54
+ return arrayOf<Any?>(
55
+ name,
56
+ message,
57
+ severity,
58
+ angleName,
59
+ minAngle,
60
+ maxAngle
61
+ ).contentDeepHashCode()
62
+ }
63
+
64
+ companion object {
65
+ /**
66
+ * Constructor called from C++
67
+ */
68
+ @DoNotStrip
69
+ @Keep
70
+ @Suppress("unused")
71
+ @JvmStatic
72
+ private fun fromCpp(name: String, message: String, severity: FormSeverity, angleName: String, minAngle: Double, maxAngle: Double): FormRule {
73
+ return FormRule(name, message, severity, angleName, minAngle, maxAngle)
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,24 @@
1
+ ///
2
+ /// FormSeverity.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.nitroposeexercises
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "FormSeverity".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class FormSeverity(@DoNotStrip @Keep val value: Int) {
19
+ INFO(0),
20
+ WARNING(1),
21
+ ERROR(2);
22
+
23
+ companion object
24
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void.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.nitroposeexercises
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 `() => 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: () -> 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(): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `() => 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_cxx: Func_void {
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(): Unit
60
+ = invoke_cxx()
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `() => void`.
68
+ * This is implemented in Java/Kotlin, via a `() -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_java(private val function: () -> Unit): Func_void {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(): Unit {
78
+ return this.function()
79
+ }
80
+ }