@sency/react-native-smkit-ui 0.2.1 → 0.2.3
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/android/build.gradle +1 -1
- package/android/src/main/java/com/smkituilibrary/SmkitUiLibraryModule.kt +32 -6
- package/android/src/main/java/com/smkituilibrary/mapper/SMMapper.kt +5 -3
- package/android/src/main/java/com/smkituilibrary/model/SMKitExercise.kt +6 -0
- package/android/src/main/java/com/smkituilibrary/model/SMUserData.kt +17 -0
- package/lib/commonjs/SMWorkout.js +110 -0
- package/lib/commonjs/SMWorkout.js.map +1 -1
- package/lib/commonjs/index.js +40 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/SMWorkout.js +117 -0
- package/lib/module/SMWorkout.js.map +1 -1
- package/lib/module/index.js +40 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/example/src/App.d.ts +4 -0
- package/lib/typescript/example/src/App.d.ts.map +1 -0
- package/lib/typescript/src/SMWorkout.d.ts +99 -0
- package/lib/typescript/src/SMWorkout.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +35 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/SMWorkout.tsx +100 -0
- package/src/index.tsx +38 -1
package/android/build.gradle
CHANGED
|
@@ -93,7 +93,7 @@ dependencies {
|
|
|
93
93
|
implementation "com.facebook.react:react-native:+"
|
|
94
94
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
95
95
|
|
|
96
|
-
implementation("com.sency.smkitui:smkitui:0.1
|
|
96
|
+
implementation("com.sency.smkitui:smkitui:0.2.1") {
|
|
97
97
|
exclude group: 'com.facebook.fbjni', module: 'fbjni-java-only'
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -9,7 +9,6 @@ import com.sency.smkitui.SMKitUI
|
|
|
9
9
|
import com.sency.smkitui.listener.SMKitUIConfigurationListener
|
|
10
10
|
import com.sency.smkitui.listener.SMKitUIWorkoutListener
|
|
11
11
|
import com.sency.smkitui.model.ExerciseData
|
|
12
|
-
import com.sency.smkitui.model.SMWorkout
|
|
13
12
|
import com.sency.smkitui.model.WorkoutSummaryData
|
|
14
13
|
import com.sency.smkitui.model.smkitui.Body360
|
|
15
14
|
import com.sency.smkitui.model.smkitui.Custom
|
|
@@ -18,6 +17,8 @@ import com.smkituilibrary.mapper.toSMWorkout
|
|
|
18
17
|
import com.smkituilibrary.mapper.toWorkoutConfig
|
|
19
18
|
import com.smkituilibrary.model.SMKitWorkout
|
|
20
19
|
import com.smkituilibrary.model.SMKitWorkoutConfig
|
|
20
|
+
import com.smkituilibrary.model.SMUserData
|
|
21
|
+
import com.smkituilibrary.model.toUserData
|
|
21
22
|
import com.squareup.moshi.Moshi
|
|
22
23
|
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
|
23
24
|
|
|
@@ -66,15 +67,31 @@ class SmkitUiLibraryModule(reactContext: ReactApplicationContext) :
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
@ReactMethod
|
|
69
|
-
fun startAssessment(
|
|
70
|
+
fun startAssessment(
|
|
71
|
+
type: String,
|
|
72
|
+
showSummary: Boolean,
|
|
73
|
+
userData: String?,
|
|
74
|
+
forceShowUserDataScreen: Boolean,
|
|
75
|
+
customAssessmentId: String,
|
|
76
|
+
promise: Promise,
|
|
77
|
+
) {
|
|
70
78
|
this.resultPromise = promise
|
|
79
|
+
|
|
71
80
|
try {
|
|
72
81
|
val assessmentType = when (type) {
|
|
73
82
|
"fitness" -> Fitness
|
|
74
83
|
"body360" -> Body360
|
|
75
84
|
else -> Custom(customAssessmentId)
|
|
76
85
|
}
|
|
77
|
-
|
|
86
|
+
val user = if(userData == null) null else if (forceShowUserDataScreen) null else {
|
|
87
|
+
serializeUserData(userData)
|
|
88
|
+
}
|
|
89
|
+
smKitUI?.startAssessment(
|
|
90
|
+
listener = listener,
|
|
91
|
+
assessmentType = assessmentType,
|
|
92
|
+
userData = user,
|
|
93
|
+
showSummary = showSummary
|
|
94
|
+
)
|
|
78
95
|
} catch (e: Exception) {
|
|
79
96
|
promise.reject("Starting Assessment Failed", e)
|
|
80
97
|
}
|
|
@@ -92,10 +109,16 @@ class SmkitUiLibraryModule(reactContext: ReactApplicationContext) :
|
|
|
92
109
|
}
|
|
93
110
|
|
|
94
111
|
@ReactMethod
|
|
95
|
-
fun startCustomAssessment(
|
|
112
|
+
fun startCustomAssessment(
|
|
113
|
+
assessmentJson: String,
|
|
114
|
+
userDataJson: String?,
|
|
115
|
+
forceShowUserDataScreen: Boolean,
|
|
116
|
+
showSummary: Boolean,
|
|
117
|
+
promise: Promise
|
|
118
|
+
) {
|
|
96
119
|
try {
|
|
97
|
-
serializeWorkout(
|
|
98
|
-
smKitUI?.startCustomizedAssessment(workout = it, listener = listener)
|
|
120
|
+
serializeWorkout(assessmentJson)?.let {
|
|
121
|
+
smKitUI?.startCustomizedAssessment(workout = it, showSummary = showSummary, listener = listener)
|
|
99
122
|
}
|
|
100
123
|
} catch (e: Exception) {
|
|
101
124
|
promise.reject("Starting Custom Assessment Failed", e)
|
|
@@ -105,6 +128,9 @@ class SmkitUiLibraryModule(reactContext: ReactApplicationContext) :
|
|
|
105
128
|
private fun serializeWorkout(jsonArguments: String) =
|
|
106
129
|
moshi.adapter(SMKitWorkout::class.java).fromJson(jsonArguments)?.toSMWorkout()
|
|
107
130
|
|
|
131
|
+
private fun serializeUserData(jsonArguments: String) =
|
|
132
|
+
moshi.adapter(SMUserData::class.java).fromJson(jsonArguments)?.toUserData()
|
|
133
|
+
|
|
108
134
|
|
|
109
135
|
@ReactMethod
|
|
110
136
|
fun startWorkoutProgram(jsonArguments: String, promise: Promise) {
|
|
@@ -44,9 +44,11 @@ private fun SMKitExercise.toSMExercise(): SMExercise = SMExercise(
|
|
|
44
44
|
repBased = repBased ?: false,
|
|
45
45
|
exerciseClosure = exerciseClosure ?: "",
|
|
46
46
|
scoringParams = scoringParams?.toParams(),
|
|
47
|
-
summaryTitle = "",
|
|
48
|
-
summarySubTitle = "",
|
|
49
|
-
summaryTitleMainMetric = ""
|
|
47
|
+
summaryTitle = summaryTitle ?: "",
|
|
48
|
+
summarySubTitle = summarySubTitle ?: "",
|
|
49
|
+
summaryTitleMainMetric = summaryTitleMainMetric ?: "",
|
|
50
|
+
summarySubTitleMainMetric = summarySubTitleMainMetric ?: "",
|
|
51
|
+
side = side
|
|
50
52
|
)
|
|
51
53
|
|
|
52
54
|
private fun SMKitScoringParams.toParams(): ScoringParams {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.smkituilibrary.model
|
|
2
2
|
|
|
3
3
|
import androidx.annotation.Keep
|
|
4
|
+
import com.sency.smkitui.data.entity.ScoringParams
|
|
4
5
|
import com.sency.smkitui.data.entity.UiElement
|
|
5
6
|
|
|
6
7
|
@Keep
|
|
@@ -15,6 +16,11 @@ internal data class SMKitExercise(
|
|
|
15
16
|
val prettyName: String? = null,
|
|
16
17
|
val exerciseIntro: String? = null,
|
|
17
18
|
val exerciseClosure: String? = null,
|
|
19
|
+
val summaryTitle: String? = null,
|
|
20
|
+
val summarySubTitle: String? = null,
|
|
21
|
+
val summaryTitleMainMetric: String? = null,
|
|
22
|
+
val summarySubTitleMainMetric: String? = null,
|
|
23
|
+
val side: String? = null,
|
|
18
24
|
)
|
|
19
25
|
|
|
20
26
|
@Keep
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.smkituilibrary.model
|
|
2
|
+
|
|
3
|
+
import com.sency.smkitui.model.Gender
|
|
4
|
+
import com.sency.smkitui.model.UserData
|
|
5
|
+
|
|
6
|
+
data class SMUserData(
|
|
7
|
+
val gender: String,
|
|
8
|
+
val age: Int,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
fun SMUserData.toUserData() : UserData {
|
|
12
|
+
val g = when(gender) {
|
|
13
|
+
"Female" -> Gender.Female
|
|
14
|
+
else -> Gender.Male
|
|
15
|
+
}
|
|
16
|
+
return UserData(age, g)
|
|
17
|
+
}
|
|
@@ -4,48 +4,90 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.WorkoutDuration = exports.WorkoutDifficulty = exports.WorkoutConfig = exports.UserData = exports.UIElement = exports.ScoringType = exports.SMWorkout = exports.SMScoringParams = exports.SMExercise = exports.SMAssessmentExercise = exports.Gender = exports.BodyZone = exports.AssessmentTypes = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enum representing assessment types.
|
|
9
|
+
* @enum {string}
|
|
10
|
+
*/
|
|
7
11
|
let AssessmentTypes = exports.AssessmentTypes = /*#__PURE__*/function (AssessmentTypes) {
|
|
8
12
|
AssessmentTypes["Fitness"] = "fitness";
|
|
9
13
|
AssessmentTypes["Custom"] = "custom";
|
|
10
14
|
AssessmentTypes["Body360"] = "body360";
|
|
11
15
|
return AssessmentTypes;
|
|
12
16
|
}({});
|
|
17
|
+
/**
|
|
18
|
+
* Enum representing UI elements that can be displayed during workouts.
|
|
19
|
+
* @enum {string}
|
|
20
|
+
*/
|
|
13
21
|
let UIElement = exports.UIElement = /*#__PURE__*/function (UIElement) {
|
|
14
22
|
UIElement["RepsCounter"] = "repsCounter";
|
|
15
23
|
UIElement["Timer"] = "timer";
|
|
16
24
|
UIElement["GaugeOfMotion"] = "gaugeOfMotion";
|
|
17
25
|
return UIElement;
|
|
18
26
|
}({});
|
|
27
|
+
/**
|
|
28
|
+
* Enum representing body zones targeted in workouts.
|
|
29
|
+
* @enum {string}
|
|
30
|
+
*/
|
|
19
31
|
let BodyZone = exports.BodyZone = /*#__PURE__*/function (BodyZone) {
|
|
20
32
|
BodyZone["UpperBody"] = "UpperBody";
|
|
21
33
|
BodyZone["LowerBody"] = "LowerBody";
|
|
22
34
|
BodyZone["FullBody"] = "FullBody";
|
|
23
35
|
return BodyZone;
|
|
24
36
|
}({});
|
|
37
|
+
/**
|
|
38
|
+
* Enum representing workout difficulty levels.
|
|
39
|
+
* @enum {string}
|
|
40
|
+
*/
|
|
25
41
|
let WorkoutDifficulty = exports.WorkoutDifficulty = /*#__PURE__*/function (WorkoutDifficulty) {
|
|
26
42
|
WorkoutDifficulty["LowDifficulty"] = "LowDifficulty";
|
|
27
43
|
WorkoutDifficulty["MidDifficulty"] = "MidDifficulty";
|
|
28
44
|
WorkoutDifficulty["HighDifficulty"] = "HighDifficulty";
|
|
29
45
|
return WorkoutDifficulty;
|
|
30
46
|
}({});
|
|
47
|
+
/**
|
|
48
|
+
* Enum representing workout durations.
|
|
49
|
+
* @enum {string}
|
|
50
|
+
*/
|
|
31
51
|
let WorkoutDuration = exports.WorkoutDuration = /*#__PURE__*/function (WorkoutDuration) {
|
|
32
52
|
WorkoutDuration["Short"] = "Short";
|
|
33
53
|
WorkoutDuration["Long"] = "Long";
|
|
34
54
|
return WorkoutDuration;
|
|
35
55
|
}({});
|
|
56
|
+
/**
|
|
57
|
+
* Enum representing different types of scoring methods.
|
|
58
|
+
* @enum {string}
|
|
59
|
+
*/
|
|
36
60
|
let ScoringType = exports.ScoringType = /*#__PURE__*/function (ScoringType) {
|
|
37
61
|
ScoringType["Rom"] = "rom";
|
|
38
62
|
ScoringType["Time"] = "time";
|
|
39
63
|
ScoringType["Reps"] = "reps";
|
|
40
64
|
return ScoringType;
|
|
41
65
|
}({});
|
|
66
|
+
/**
|
|
67
|
+
* Enum representing gender options for user data.
|
|
68
|
+
* @enum {string}
|
|
69
|
+
*/
|
|
42
70
|
let Gender = exports.Gender = /*#__PURE__*/function (Gender) {
|
|
43
71
|
Gender["Female"] = "Female";
|
|
44
72
|
Gender["Male"] = "Male";
|
|
45
73
|
Gender["Other"] = "Rather not say";
|
|
46
74
|
return Gender;
|
|
47
75
|
}({});
|
|
76
|
+
/**
|
|
77
|
+
* Class representing a workout.
|
|
78
|
+
*/
|
|
48
79
|
class SMWorkout {
|
|
80
|
+
/**
|
|
81
|
+
* @param {string | null} id - Unique identifier for the workout.
|
|
82
|
+
* @param {string | null} name - Name of the workout.
|
|
83
|
+
* @param {string | null} workoutIntro - URL for workout intro sound.
|
|
84
|
+
* @param {string | null} soundtrack - URL for soundtrack.
|
|
85
|
+
* @param {SMExercise[]} exercises - List of exercises included in the workout.
|
|
86
|
+
* @param {string | null} getInFrame - URL for body cal get in frame sound.
|
|
87
|
+
* @param {string | null} bodycalFinished - URL for body cal finished sound.
|
|
88
|
+
* @param {string | null} workoutClosure - URL for workout closure sound.
|
|
89
|
+
*/
|
|
90
|
+
|
|
49
91
|
constructor(id, name, workoutIntro, soundtrack, exercises, getInFrame, bodycalFinished, workoutClosure) {
|
|
50
92
|
this.id = id || null;
|
|
51
93
|
this.name = name || null;
|
|
@@ -69,8 +111,23 @@ class SMWorkout {
|
|
|
69
111
|
});
|
|
70
112
|
}
|
|
71
113
|
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Class representing an exercise in a workout.
|
|
117
|
+
*/
|
|
72
118
|
exports.SMWorkout = SMWorkout;
|
|
73
119
|
class SMExercise {
|
|
120
|
+
/**
|
|
121
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
122
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
123
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
124
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
125
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
126
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
127
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
128
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
129
|
+
*/
|
|
130
|
+
|
|
74
131
|
constructor(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams) {
|
|
75
132
|
this.prettyName = prettyName || null;
|
|
76
133
|
this.totalSeconds = totalSeconds || null;
|
|
@@ -82,8 +139,27 @@ class SMExercise {
|
|
|
82
139
|
this.scoringParams = scoringParams || null;
|
|
83
140
|
}
|
|
84
141
|
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Class representing an exercise in an assessment.
|
|
145
|
+
*/
|
|
85
146
|
exports.SMExercise = SMExercise;
|
|
86
147
|
class SMAssessmentExercise extends SMExercise {
|
|
148
|
+
/**
|
|
149
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
150
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
151
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
152
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
153
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
154
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
155
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
156
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
157
|
+
* @param {string | null} summaryTitle - Title for the exercise summary.
|
|
158
|
+
* @param {string | null} summarySubTitle - Subtitle for the exercise summary.
|
|
159
|
+
* @param {string | null} summaryMainMetricTitle - Main metric title in the summary.
|
|
160
|
+
* @param {string | null} summaryMainMetricSubTitle - Main metric subtitle in the summary.
|
|
161
|
+
*/
|
|
162
|
+
|
|
87
163
|
constructor(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams, summaryTitle, summarySubTitle, summaryMainMetricTitle, summaryMainMetricSubTitle) {
|
|
88
164
|
// Call the constructor of the parent class (SMExercise)
|
|
89
165
|
super(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams);
|
|
@@ -95,8 +171,21 @@ class SMAssessmentExercise extends SMExercise {
|
|
|
95
171
|
this.summaryMainMetricSubTitle = summaryMainMetricSubTitle || null;
|
|
96
172
|
}
|
|
97
173
|
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Class representing scoring parameters for an exercise.
|
|
177
|
+
*/
|
|
98
178
|
exports.SMAssessmentExercise = SMAssessmentExercise;
|
|
99
179
|
class SMScoringParams {
|
|
180
|
+
/**
|
|
181
|
+
* @param {ScoringType | null} type - Type of scoring (e.g., ROM, time, reps).
|
|
182
|
+
* @param {number | null} scoreFactor - Factor to adjust the score.
|
|
183
|
+
* @param {number | null} targetTime - Target time for time-based scoring.
|
|
184
|
+
* @param {number | null} targetReps - Target reps for rep-based scoring.
|
|
185
|
+
* @param {string | null} targetRom - Range of motion target for ROM-based scoring.
|
|
186
|
+
* @param {string[] | null} passCriteria - List of criteria required to pass.
|
|
187
|
+
*/
|
|
188
|
+
|
|
100
189
|
constructor(type, scoreFactor, targetTime, targetReps, targetRom, passCriteria) {
|
|
101
190
|
this.type = type || null;
|
|
102
191
|
this.scoreFactor = scoreFactor || null;
|
|
@@ -106,8 +195,20 @@ class SMScoringParams {
|
|
|
106
195
|
this.passCriteria = passCriteria || null;
|
|
107
196
|
}
|
|
108
197
|
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Class representing the configuration for a workout program.
|
|
201
|
+
*/
|
|
109
202
|
exports.SMScoringParams = SMScoringParams;
|
|
110
203
|
class WorkoutConfig {
|
|
204
|
+
/**
|
|
205
|
+
* @param {number} week - Week number in the program.
|
|
206
|
+
* @param {BodyZone} bodyZone - Targeted body zone for the workout.
|
|
207
|
+
* @param {WorkoutDifficulty} difficultyLevel - Difficulty level of the workout.
|
|
208
|
+
* @param {WorkoutDuration} workoutDuration - Duration of the workout.
|
|
209
|
+
* @param {string} programID - Unique identifier for the workout program.
|
|
210
|
+
*/
|
|
211
|
+
|
|
111
212
|
constructor(week, bodyZone, difficultyLevel, workoutDuration, programID) {
|
|
112
213
|
this.week = week;
|
|
113
214
|
this.bodyZone = bodyZone;
|
|
@@ -125,8 +226,17 @@ class WorkoutConfig {
|
|
|
125
226
|
});
|
|
126
227
|
}
|
|
127
228
|
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Class representing user data.
|
|
232
|
+
*/
|
|
128
233
|
exports.WorkoutConfig = WorkoutConfig;
|
|
129
234
|
class UserData {
|
|
235
|
+
/**
|
|
236
|
+
* @param {Gender} gender - User's gender.
|
|
237
|
+
* @param {number} age - User's age.
|
|
238
|
+
*/
|
|
239
|
+
|
|
130
240
|
constructor(gender, age) {
|
|
131
241
|
this.gender = gender;
|
|
132
242
|
this.age = age;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AssessmentTypes","exports","UIElement","BodyZone","WorkoutDifficulty","WorkoutDuration","ScoringType","Gender","SMWorkout","constructor","id","name","workoutIntro","soundtrack","exercises","getInFrame","bodycalFinished","workoutClosure","toJson","JSON","stringify","SMExercise","prettyName","totalSeconds","videoInstruction","exerciseIntro","uiElements","detector","exerciseClosure","scoringParams","SMAssessmentExercise","summaryTitle","summarySubTitle","summaryMainMetricTitle","summaryMainMetricSubTitle","SMScoringParams","type","scoreFactor","targetTime","targetReps","targetRom","passCriteria","WorkoutConfig","week","bodyZone","difficultyLevel","workoutDuration","programID","UserData","gender","age"],"sourceRoot":"../../src","sources":["SMWorkout.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["AssessmentTypes","exports","UIElement","BodyZone","WorkoutDifficulty","WorkoutDuration","ScoringType","Gender","SMWorkout","constructor","id","name","workoutIntro","soundtrack","exercises","getInFrame","bodycalFinished","workoutClosure","toJson","JSON","stringify","SMExercise","prettyName","totalSeconds","videoInstruction","exerciseIntro","uiElements","detector","exerciseClosure","scoringParams","SMAssessmentExercise","summaryTitle","summarySubTitle","summaryMainMetricTitle","summaryMainMetricSubTitle","SMScoringParams","type","scoreFactor","targetTime","targetReps","targetRom","passCriteria","WorkoutConfig","week","bodyZone","difficultyLevel","workoutDuration","programID","UserData","gender","age"],"sourceRoot":"../../src","sources":["SMWorkout.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAHA,IAIYA,eAAe,GAAAC,OAAA,CAAAD,eAAA,0BAAfA,eA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C,GAAG,EAAE,IAAI,CAACA;IACZ,CAAC,CAAC;EACJ;AACF;AAACjD,OAAA,CAAA+C,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -18,18 +18,58 @@ const SMKitUIManager = _reactNative.NativeModules.SMKitUIManager ? _reactNative.
|
|
|
18
18
|
throw new Error(LINKING_ERROR);
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This function will configure the sdk
|
|
24
|
+
* @param {string} key - your auth key
|
|
25
|
+
*/
|
|
21
26
|
function configure(key) {
|
|
22
27
|
return SMKitUIManager.configure(key);
|
|
23
28
|
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* start an assessment session.
|
|
32
|
+
*
|
|
33
|
+
* @param {SMWorkoutLibrary.AssessmentTypes} type - The type of assessment to start.
|
|
34
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
35
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment session, or `null` if no user data is provided.
|
|
36
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
37
|
+
* @param {string} customAssessmentID - A unique identifier for a custom assessment session.
|
|
38
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating whether the assessment finished.
|
|
39
|
+
*/
|
|
24
40
|
function startAssessment(type, showSummary = true, userData, forceShowUserDataScreen = false, customAssessmentID) {
|
|
25
41
|
return SMKitUIManager.startAssessment(type, showSummary, userData?.toJson(), forceShowUserDataScreen, customAssessmentID);
|
|
26
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Starts a custom workout session.
|
|
46
|
+
*
|
|
47
|
+
* @param {SMWorkoutLibrary.SMWorkout} workout - The custom workout configuration.
|
|
48
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout session finished.
|
|
49
|
+
*/
|
|
27
50
|
function startCustomWorkout(workout) {
|
|
28
51
|
return SMKitUIManager.startCustomWorkout(workout.toJson());
|
|
29
52
|
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Initiates a custom assessment session.
|
|
56
|
+
*
|
|
57
|
+
* @param {SMWorkoutLibrary.SMWorkout} assessment - The assessment configuration for the session.
|
|
58
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment, or `null` if no user data is provided.
|
|
59
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
60
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
61
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the assessment finished.
|
|
62
|
+
*/
|
|
30
63
|
function startCustomAssessment(assessment, userData, forceShowUserDataScreen = false, showSummary = true) {
|
|
31
64
|
return SMKitUIManager.startCustomAssessment(assessment.toJson(), userData?.toJson(), forceShowUserDataScreen, showSummary);
|
|
32
65
|
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Starts a workout program using the provided workout configuration.
|
|
69
|
+
*
|
|
70
|
+
* @param {SMWorkoutLibrary.WorkoutConfig} workoutConfig - The configuration for the workout program.
|
|
71
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout program finished.
|
|
72
|
+
*/
|
|
33
73
|
function startWorkoutProgram(workoutConfig) {
|
|
34
74
|
return SMKitUIManager.startWorkoutProgram(workoutConfig.toJson());
|
|
35
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","SMKitUIManager","NativeModules","Proxy","get","Error","configure","key","startAssessment","type","showSummary","userData","forceShowUserDataScreen","customAssessmentID","toJson","startCustomWorkout","workout","startCustomAssessment","assessment","startWorkoutProgram","workoutConfig"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,MAAMC,aAAa,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","SMKitUIManager","NativeModules","Proxy","get","Error","configure","key","startAssessment","type","showSummary","userData","forceShowUserDataScreen","customAssessmentID","toJson","startCustomWorkout","workout","startCustomAssessment","assessment","startWorkoutProgram","workoutConfig"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,MAAMC,aAAa,GACjB,gFAAgF,GAChFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,cAAc,GAAGC,0BAAa,CAACD,cAAc,GAC/CC,0BAAa,CAACD,cAAc,GAC5B,IAAIE,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAEL;AACA;AACA;AACA;AACO,SAASU,SAASA,CAACC,GAAW,EAAmB;EACtD,OAAON,cAAc,CAACK,SAAS,CAACC,GAAG,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAC7BC,IAAsC,EACtCC,WAAoB,GAAG,IAAI,EAC3BC,QAA0C,EAC1CC,uBAAgC,GAAG,KAAK,EACxCC,kBAA0B,EACwB;EAClD,OAAOZ,cAAc,CAACO,eAAe,CACnCC,IAAI,EACJC,WAAW,EACXC,QAAQ,EAAEG,MAAM,CAAC,CAAC,EAClBF,uBAAuB,EACvBC,kBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,kBAAkBA,CAChCC,OAAmC,EACe;EAClD,OAAOf,cAAc,CAACc,kBAAkB,CAACC,OAAO,CAACF,MAAM,CAAC,CAAC,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,qBAAqBA,CACnCC,UAAsC,EACtCP,QAA0C,EAC1CC,uBAAgC,GAAG,KAAK,EACxCF,WAAoB,GAAG,IAAI,EACuB;EAClD,OAAOT,cAAc,CAACgB,qBAAqB,CACzCC,UAAU,CAACJ,MAAM,CAAC,CAAC,EACnBH,QAAQ,EAAEG,MAAM,CAAC,CAAC,EAClBF,uBAAuB,EACvBF,WACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASS,mBAAmBA,CACjCC,aAA6C,EACK;EAClD,OAAOnB,cAAc,CAACkB,mBAAmB,CAACC,aAAa,CAACN,MAAM,CAAC,CAAC,CAAC;AACnE","ignoreList":[]}
|
package/lib/module/SMWorkout.js
CHANGED
|
@@ -1,45 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing assessment types.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
1
5
|
export let AssessmentTypes = /*#__PURE__*/function (AssessmentTypes) {
|
|
2
6
|
AssessmentTypes["Fitness"] = "fitness";
|
|
3
7
|
AssessmentTypes["Custom"] = "custom";
|
|
4
8
|
AssessmentTypes["Body360"] = "body360";
|
|
5
9
|
return AssessmentTypes;
|
|
6
10
|
}({});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Enum representing UI elements that can be displayed during workouts.
|
|
14
|
+
* @enum {string}
|
|
15
|
+
*/
|
|
7
16
|
export let UIElement = /*#__PURE__*/function (UIElement) {
|
|
8
17
|
UIElement["RepsCounter"] = "repsCounter";
|
|
9
18
|
UIElement["Timer"] = "timer";
|
|
10
19
|
UIElement["GaugeOfMotion"] = "gaugeOfMotion";
|
|
11
20
|
return UIElement;
|
|
12
21
|
}({});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Enum representing body zones targeted in workouts.
|
|
25
|
+
* @enum {string}
|
|
26
|
+
*/
|
|
13
27
|
export let BodyZone = /*#__PURE__*/function (BodyZone) {
|
|
14
28
|
BodyZone["UpperBody"] = "UpperBody";
|
|
15
29
|
BodyZone["LowerBody"] = "LowerBody";
|
|
16
30
|
BodyZone["FullBody"] = "FullBody";
|
|
17
31
|
return BodyZone;
|
|
18
32
|
}({});
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Enum representing workout difficulty levels.
|
|
36
|
+
* @enum {string}
|
|
37
|
+
*/
|
|
19
38
|
export let WorkoutDifficulty = /*#__PURE__*/function (WorkoutDifficulty) {
|
|
20
39
|
WorkoutDifficulty["LowDifficulty"] = "LowDifficulty";
|
|
21
40
|
WorkoutDifficulty["MidDifficulty"] = "MidDifficulty";
|
|
22
41
|
WorkoutDifficulty["HighDifficulty"] = "HighDifficulty";
|
|
23
42
|
return WorkoutDifficulty;
|
|
24
43
|
}({});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Enum representing workout durations.
|
|
47
|
+
* @enum {string}
|
|
48
|
+
*/
|
|
25
49
|
export let WorkoutDuration = /*#__PURE__*/function (WorkoutDuration) {
|
|
26
50
|
WorkoutDuration["Short"] = "Short";
|
|
27
51
|
WorkoutDuration["Long"] = "Long";
|
|
28
52
|
return WorkoutDuration;
|
|
29
53
|
}({});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Enum representing different types of scoring methods.
|
|
57
|
+
* @enum {string}
|
|
58
|
+
*/
|
|
30
59
|
export let ScoringType = /*#__PURE__*/function (ScoringType) {
|
|
31
60
|
ScoringType["Rom"] = "rom";
|
|
32
61
|
ScoringType["Time"] = "time";
|
|
33
62
|
ScoringType["Reps"] = "reps";
|
|
34
63
|
return ScoringType;
|
|
35
64
|
}({});
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Enum representing gender options for user data.
|
|
68
|
+
* @enum {string}
|
|
69
|
+
*/
|
|
36
70
|
export let Gender = /*#__PURE__*/function (Gender) {
|
|
37
71
|
Gender["Female"] = "Female";
|
|
38
72
|
Gender["Male"] = "Male";
|
|
39
73
|
Gender["Other"] = "Rather not say";
|
|
40
74
|
return Gender;
|
|
41
75
|
}({});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Class representing a workout.
|
|
79
|
+
*/
|
|
42
80
|
export class SMWorkout {
|
|
81
|
+
/**
|
|
82
|
+
* @param {string | null} id - Unique identifier for the workout.
|
|
83
|
+
* @param {string | null} name - Name of the workout.
|
|
84
|
+
* @param {string | null} workoutIntro - URL for workout intro sound.
|
|
85
|
+
* @param {string | null} soundtrack - URL for soundtrack.
|
|
86
|
+
* @param {SMExercise[]} exercises - List of exercises included in the workout.
|
|
87
|
+
* @param {string | null} getInFrame - URL for body cal get in frame sound.
|
|
88
|
+
* @param {string | null} bodycalFinished - URL for body cal finished sound.
|
|
89
|
+
* @param {string | null} workoutClosure - URL for workout closure sound.
|
|
90
|
+
*/
|
|
91
|
+
|
|
43
92
|
constructor(id, name, workoutIntro, soundtrack, exercises, getInFrame, bodycalFinished, workoutClosure) {
|
|
44
93
|
this.id = id || null;
|
|
45
94
|
this.name = name || null;
|
|
@@ -63,7 +112,22 @@ export class SMWorkout {
|
|
|
63
112
|
});
|
|
64
113
|
}
|
|
65
114
|
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Class representing an exercise in a workout.
|
|
118
|
+
*/
|
|
66
119
|
export class SMExercise {
|
|
120
|
+
/**
|
|
121
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
122
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
123
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
124
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
125
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
126
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
127
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
128
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
129
|
+
*/
|
|
130
|
+
|
|
67
131
|
constructor(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams) {
|
|
68
132
|
this.prettyName = prettyName || null;
|
|
69
133
|
this.totalSeconds = totalSeconds || null;
|
|
@@ -75,7 +139,26 @@ export class SMExercise {
|
|
|
75
139
|
this.scoringParams = scoringParams || null;
|
|
76
140
|
}
|
|
77
141
|
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Class representing an exercise in an assessment.
|
|
145
|
+
*/
|
|
78
146
|
export class SMAssessmentExercise extends SMExercise {
|
|
147
|
+
/**
|
|
148
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
149
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
150
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
151
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
152
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
153
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
154
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
155
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
156
|
+
* @param {string | null} summaryTitle - Title for the exercise summary.
|
|
157
|
+
* @param {string | null} summarySubTitle - Subtitle for the exercise summary.
|
|
158
|
+
* @param {string | null} summaryMainMetricTitle - Main metric title in the summary.
|
|
159
|
+
* @param {string | null} summaryMainMetricSubTitle - Main metric subtitle in the summary.
|
|
160
|
+
*/
|
|
161
|
+
|
|
79
162
|
constructor(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams, summaryTitle, summarySubTitle, summaryMainMetricTitle, summaryMainMetricSubTitle) {
|
|
80
163
|
// Call the constructor of the parent class (SMExercise)
|
|
81
164
|
super(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams);
|
|
@@ -87,7 +170,20 @@ export class SMAssessmentExercise extends SMExercise {
|
|
|
87
170
|
this.summaryMainMetricSubTitle = summaryMainMetricSubTitle || null;
|
|
88
171
|
}
|
|
89
172
|
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Class representing scoring parameters for an exercise.
|
|
176
|
+
*/
|
|
90
177
|
export class SMScoringParams {
|
|
178
|
+
/**
|
|
179
|
+
* @param {ScoringType | null} type - Type of scoring (e.g., ROM, time, reps).
|
|
180
|
+
* @param {number | null} scoreFactor - Factor to adjust the score.
|
|
181
|
+
* @param {number | null} targetTime - Target time for time-based scoring.
|
|
182
|
+
* @param {number | null} targetReps - Target reps for rep-based scoring.
|
|
183
|
+
* @param {string | null} targetRom - Range of motion target for ROM-based scoring.
|
|
184
|
+
* @param {string[] | null} passCriteria - List of criteria required to pass.
|
|
185
|
+
*/
|
|
186
|
+
|
|
91
187
|
constructor(type, scoreFactor, targetTime, targetReps, targetRom, passCriteria) {
|
|
92
188
|
this.type = type || null;
|
|
93
189
|
this.scoreFactor = scoreFactor || null;
|
|
@@ -97,7 +193,19 @@ export class SMScoringParams {
|
|
|
97
193
|
this.passCriteria = passCriteria || null;
|
|
98
194
|
}
|
|
99
195
|
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Class representing the configuration for a workout program.
|
|
199
|
+
*/
|
|
100
200
|
export class WorkoutConfig {
|
|
201
|
+
/**
|
|
202
|
+
* @param {number} week - Week number in the program.
|
|
203
|
+
* @param {BodyZone} bodyZone - Targeted body zone for the workout.
|
|
204
|
+
* @param {WorkoutDifficulty} difficultyLevel - Difficulty level of the workout.
|
|
205
|
+
* @param {WorkoutDuration} workoutDuration - Duration of the workout.
|
|
206
|
+
* @param {string} programID - Unique identifier for the workout program.
|
|
207
|
+
*/
|
|
208
|
+
|
|
101
209
|
constructor(week, bodyZone, difficultyLevel, workoutDuration, programID) {
|
|
102
210
|
this.week = week;
|
|
103
211
|
this.bodyZone = bodyZone;
|
|
@@ -115,7 +223,16 @@ export class WorkoutConfig {
|
|
|
115
223
|
});
|
|
116
224
|
}
|
|
117
225
|
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Class representing user data.
|
|
229
|
+
*/
|
|
118
230
|
export class UserData {
|
|
231
|
+
/**
|
|
232
|
+
* @param {Gender} gender - User's gender.
|
|
233
|
+
* @param {number} age - User's age.
|
|
234
|
+
*/
|
|
235
|
+
|
|
119
236
|
constructor(gender, age) {
|
|
120
237
|
this.gender = gender;
|
|
121
238
|
this.age = age;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AssessmentTypes","UIElement","BodyZone","WorkoutDifficulty","WorkoutDuration","ScoringType","Gender","SMWorkout","constructor","id","name","workoutIntro","soundtrack","exercises","getInFrame","bodycalFinished","workoutClosure","toJson","JSON","stringify","SMExercise","prettyName","totalSeconds","videoInstruction","exerciseIntro","uiElements","detector","exerciseClosure","scoringParams","SMAssessmentExercise","summaryTitle","summarySubTitle","summaryMainMetricTitle","summaryMainMetricSubTitle","SMScoringParams","type","scoreFactor","targetTime","targetReps","targetRom","passCriteria","WorkoutConfig","week","bodyZone","difficultyLevel","workoutDuration","programID","UserData","gender","age"],"sourceRoot":"../../src","sources":["SMWorkout.tsx"],"mappings":"AAAA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;
|
|
1
|
+
{"version":3,"names":["AssessmentTypes","UIElement","BodyZone","WorkoutDifficulty","WorkoutDuration","ScoringType","Gender","SMWorkout","constructor","id","name","workoutIntro","soundtrack","exercises","getInFrame","bodycalFinished","workoutClosure","toJson","JSON","stringify","SMExercise","prettyName","totalSeconds","videoInstruction","exerciseIntro","uiElements","detector","exerciseClosure","scoringParams","SMAssessmentExercise","summaryTitle","summarySubTitle","summaryMainMetricTitle","summaryMainMetricSubTitle","SMScoringParams","type","scoreFactor","targetTime","targetReps","targetRom","passCriteria","WorkoutConfig","week","bodyZone","difficultyLevel","workoutDuration","programID","UserData","gender","age"],"sourceRoot":"../../src","sources":["SMWorkout.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAM3B;AACA;AACA;AACA;AACA,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;;AAMrB;AACA;AACA;AACA;AACA,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;;AAMpB;AACA;AACA;AACA;AACA,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;;AAM7B;AACA;AACA;AACA;AACA,WAAYC,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAK3B;AACA;AACA;AACA;AACA,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAMvB;AACA;AACA;AACA;AACA,WAAYC,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;;AAMlB;AACA;AACA;AACA,OAAO,MAAMC,SAAS,CAAC;EACrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAUEC,WAAWA,CACTC,EAAiB,EACjBC,IAAmB,EACnBC,YAA2B,EAC3BC,UAAyB,EACzBC,SAAuB,EACvBC,UAAyB,EACzBC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+8,58 @@ const SMKitUIManager = NativeModules.SMKitUIManager ? NativeModules.SMKitUIManag
|
|
|
8
8
|
throw new Error(LINKING_ERROR);
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function will configure the sdk
|
|
14
|
+
* @param {string} key - your auth key
|
|
15
|
+
*/
|
|
11
16
|
export function configure(key) {
|
|
12
17
|
return SMKitUIManager.configure(key);
|
|
13
18
|
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* start an assessment session.
|
|
22
|
+
*
|
|
23
|
+
* @param {SMWorkoutLibrary.AssessmentTypes} type - The type of assessment to start.
|
|
24
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
25
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment session, or `null` if no user data is provided.
|
|
26
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
27
|
+
* @param {string} customAssessmentID - A unique identifier for a custom assessment session.
|
|
28
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating whether the assessment finished.
|
|
29
|
+
*/
|
|
14
30
|
export function startAssessment(type, showSummary = true, userData, forceShowUserDataScreen = false, customAssessmentID) {
|
|
15
31
|
return SMKitUIManager.startAssessment(type, showSummary, userData?.toJson(), forceShowUserDataScreen, customAssessmentID);
|
|
16
32
|
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Starts a custom workout session.
|
|
36
|
+
*
|
|
37
|
+
* @param {SMWorkoutLibrary.SMWorkout} workout - The custom workout configuration.
|
|
38
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout session finished.
|
|
39
|
+
*/
|
|
17
40
|
export function startCustomWorkout(workout) {
|
|
18
41
|
return SMKitUIManager.startCustomWorkout(workout.toJson());
|
|
19
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Initiates a custom assessment session.
|
|
46
|
+
*
|
|
47
|
+
* @param {SMWorkoutLibrary.SMWorkout} assessment - The assessment configuration for the session.
|
|
48
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment, or `null` if no user data is provided.
|
|
49
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
50
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
51
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the assessment finished.
|
|
52
|
+
*/
|
|
20
53
|
export function startCustomAssessment(assessment, userData, forceShowUserDataScreen = false, showSummary = true) {
|
|
21
54
|
return SMKitUIManager.startCustomAssessment(assessment.toJson(), userData?.toJson(), forceShowUserDataScreen, showSummary);
|
|
22
55
|
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Starts a workout program using the provided workout configuration.
|
|
59
|
+
*
|
|
60
|
+
* @param {SMWorkoutLibrary.WorkoutConfig} workoutConfig - The configuration for the workout program.
|
|
61
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout program finished.
|
|
62
|
+
*/
|
|
23
63
|
export function startWorkoutProgram(workoutConfig) {
|
|
24
64
|
return SMKitUIManager.startWorkoutProgram(workoutConfig.toJson());
|
|
25
65
|
}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","SMKitUIManager","Proxy","get","Error","configure","key","startAssessment","type","showSummary","userData","forceShowUserDataScreen","customAssessmentID","toJson","startCustomWorkout","workout","startCustomAssessment","assessment","startWorkoutProgram","workoutConfig"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAGtD,MAAMC,aAAa,
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","SMKitUIManager","Proxy","get","Error","configure","key","startAssessment","type","showSummary","userData","forceShowUserDataScreen","customAssessmentID","toJson","startCustomWorkout","workout","startCustomAssessment","assessment","startWorkoutProgram","workoutConfig"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAGtD,MAAMC,aAAa,GACjB,gFAAgF,GAChFD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,cAAc,GAAGN,aAAa,CAACM,cAAc,GAC/CN,aAAa,CAACM,cAAc,GAC5B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAEL;AACA;AACA;AACA;AACA,OAAO,SAASQ,SAASA,CAACC,GAAW,EAAmB;EACtD,OAAOL,cAAc,CAACI,SAAS,CAACC,GAAG,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,IAAsC,EACtCC,WAAoB,GAAG,IAAI,EAC3BC,QAA0C,EAC1CC,uBAAgC,GAAG,KAAK,EACxCC,kBAA0B,EACwB;EAClD,OAAOX,cAAc,CAACM,eAAe,CACnCC,IAAI,EACJC,WAAW,EACXC,QAAQ,EAAEG,MAAM,CAAC,CAAC,EAClBF,uBAAuB,EACvBC,kBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,kBAAkBA,CAChCC,OAAmC,EACe;EAClD,OAAOd,cAAc,CAACa,kBAAkB,CAACC,OAAO,CAACF,MAAM,CAAC,CAAC,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,qBAAqBA,CACnCC,UAAsC,EACtCP,QAA0C,EAC1CC,uBAAgC,GAAG,KAAK,EACxCF,WAAoB,GAAG,IAAI,EACuB;EAClD,OAAOR,cAAc,CAACe,qBAAqB,CACzCC,UAAU,CAACJ,MAAM,CAAC,CAAC,EACnBH,QAAQ,EAAEG,MAAM,CAAC,CAAC,EAClBF,uBAAuB,EACvBF,WACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,mBAAmBA,CACjCC,aAA6C,EACK;EAClD,OAAOlB,cAAc,CAACiB,mBAAmB,CAACC,aAAa,CAACN,MAAM,CAAC,CAAC,CAAC;AACnE","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../example/src/App.tsx"],"names":[],"mappings":"AAIM,OAAO,KAA8B,MAAM,OAAO,CAAC;AAgBzD,QAAA,MAAM,GAAG,yBA8NN,CAAA;AAwIH,eAAe,GAAG,CAAC"}
|
|
@@ -1,38 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing assessment types.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
1
5
|
export declare enum AssessmentTypes {
|
|
2
6
|
Fitness = "fitness",
|
|
3
7
|
Custom = "custom",
|
|
4
8
|
Body360 = "body360"
|
|
5
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Enum representing UI elements that can be displayed during workouts.
|
|
12
|
+
* @enum {string}
|
|
13
|
+
*/
|
|
6
14
|
export declare enum UIElement {
|
|
7
15
|
RepsCounter = "repsCounter",
|
|
8
16
|
Timer = "timer",
|
|
9
17
|
GaugeOfMotion = "gaugeOfMotion"
|
|
10
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Enum representing body zones targeted in workouts.
|
|
21
|
+
* @enum {string}
|
|
22
|
+
*/
|
|
11
23
|
export declare enum BodyZone {
|
|
12
24
|
UpperBody = "UpperBody",
|
|
13
25
|
LowerBody = "LowerBody",
|
|
14
26
|
FullBody = "FullBody"
|
|
15
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Enum representing workout difficulty levels.
|
|
30
|
+
* @enum {string}
|
|
31
|
+
*/
|
|
16
32
|
export declare enum WorkoutDifficulty {
|
|
17
33
|
LowDifficulty = "LowDifficulty",
|
|
18
34
|
MidDifficulty = "MidDifficulty",
|
|
19
35
|
HighDifficulty = "HighDifficulty"
|
|
20
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Enum representing workout durations.
|
|
39
|
+
* @enum {string}
|
|
40
|
+
*/
|
|
21
41
|
export declare enum WorkoutDuration {
|
|
22
42
|
Short = "Short",
|
|
23
43
|
Long = "Long"
|
|
24
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Enum representing different types of scoring methods.
|
|
47
|
+
* @enum {string}
|
|
48
|
+
*/
|
|
25
49
|
export declare enum ScoringType {
|
|
26
50
|
Rom = "rom",
|
|
27
51
|
Time = "time",
|
|
28
52
|
Reps = "reps"
|
|
29
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Enum representing gender options for user data.
|
|
56
|
+
* @enum {string}
|
|
57
|
+
*/
|
|
30
58
|
export declare enum Gender {
|
|
31
59
|
Female = "Female",
|
|
32
60
|
Male = "Male",
|
|
33
61
|
Other = "Rather not say"
|
|
34
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Class representing a workout.
|
|
65
|
+
*/
|
|
35
66
|
export declare class SMWorkout {
|
|
67
|
+
/**
|
|
68
|
+
* @param {string | null} id - Unique identifier for the workout.
|
|
69
|
+
* @param {string | null} name - Name of the workout.
|
|
70
|
+
* @param {string | null} workoutIntro - URL for workout intro sound.
|
|
71
|
+
* @param {string | null} soundtrack - URL for soundtrack.
|
|
72
|
+
* @param {SMExercise[]} exercises - List of exercises included in the workout.
|
|
73
|
+
* @param {string | null} getInFrame - URL for body cal get in frame sound.
|
|
74
|
+
* @param {string | null} bodycalFinished - URL for body cal finished sound.
|
|
75
|
+
* @param {string | null} workoutClosure - URL for workout closure sound.
|
|
76
|
+
*/
|
|
36
77
|
id: string | null;
|
|
37
78
|
name: string | null;
|
|
38
79
|
workoutIntro: string | null;
|
|
@@ -44,7 +85,20 @@ export declare class SMWorkout {
|
|
|
44
85
|
constructor(id: string | null, name: string | null, workoutIntro: string | null, soundtrack: string | null, exercises: SMExercise[], getInFrame: string | null, bodycalFinished: string | null, workoutClosure: string | null);
|
|
45
86
|
toJson(): string;
|
|
46
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Class representing an exercise in a workout.
|
|
90
|
+
*/
|
|
47
91
|
export declare class SMExercise {
|
|
92
|
+
/**
|
|
93
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
94
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
95
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
96
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
97
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
98
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
99
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
100
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
101
|
+
*/
|
|
48
102
|
detector: string;
|
|
49
103
|
uiElements: UIElement[] | null;
|
|
50
104
|
videoInstruction: string | null;
|
|
@@ -55,14 +109,42 @@ export declare class SMExercise {
|
|
|
55
109
|
scoringParams: SMScoringParams | null;
|
|
56
110
|
constructor(prettyName: string | null, totalSeconds: number | null, videoInstruction: string | null, exerciseIntro: string | null, uiElements: UIElement[] | null, detector: string, exerciseClosure: string | null, scoringParams: SMScoringParams | null);
|
|
57
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Class representing an exercise in an assessment.
|
|
114
|
+
*/
|
|
58
115
|
export declare class SMAssessmentExercise extends SMExercise {
|
|
116
|
+
/**
|
|
117
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
118
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
119
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
120
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
121
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
122
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
123
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
124
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
125
|
+
* @param {string | null} summaryTitle - Title for the exercise summary.
|
|
126
|
+
* @param {string | null} summarySubTitle - Subtitle for the exercise summary.
|
|
127
|
+
* @param {string | null} summaryMainMetricTitle - Main metric title in the summary.
|
|
128
|
+
* @param {string | null} summaryMainMetricSubTitle - Main metric subtitle in the summary.
|
|
129
|
+
*/
|
|
59
130
|
summaryTitle: string | null;
|
|
60
131
|
summarySubTitle: string | null;
|
|
61
132
|
summaryMainMetricTitle: string | null;
|
|
62
133
|
summaryMainMetricSubTitle: string | null;
|
|
63
134
|
constructor(prettyName: string | null, totalSeconds: number | null, videoInstruction: string | null, exerciseIntro: string | null, uiElements: UIElement[] | null, detector: string, exerciseClosure: string | null, scoringParams: SMScoringParams | null, summaryTitle: string | null, summarySubTitle: string | null, summaryMainMetricTitle: string | null, summaryMainMetricSubTitle: string | null);
|
|
64
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Class representing scoring parameters for an exercise.
|
|
138
|
+
*/
|
|
65
139
|
export declare class SMScoringParams {
|
|
140
|
+
/**
|
|
141
|
+
* @param {ScoringType | null} type - Type of scoring (e.g., ROM, time, reps).
|
|
142
|
+
* @param {number | null} scoreFactor - Factor to adjust the score.
|
|
143
|
+
* @param {number | null} targetTime - Target time for time-based scoring.
|
|
144
|
+
* @param {number | null} targetReps - Target reps for rep-based scoring.
|
|
145
|
+
* @param {string | null} targetRom - Range of motion target for ROM-based scoring.
|
|
146
|
+
* @param {string[] | null} passCriteria - List of criteria required to pass.
|
|
147
|
+
*/
|
|
66
148
|
type: ScoringType | null;
|
|
67
149
|
scoreFactor: number | null;
|
|
68
150
|
targetTime: number | null;
|
|
@@ -71,7 +153,17 @@ export declare class SMScoringParams {
|
|
|
71
153
|
passCriteria: string[] | null;
|
|
72
154
|
constructor(type: ScoringType | null, scoreFactor: number | null, targetTime: number | null, targetReps: number | null, targetRom: string | null, passCriteria: string[] | null);
|
|
73
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Class representing the configuration for a workout program.
|
|
158
|
+
*/
|
|
74
159
|
export declare class WorkoutConfig {
|
|
160
|
+
/**
|
|
161
|
+
* @param {number} week - Week number in the program.
|
|
162
|
+
* @param {BodyZone} bodyZone - Targeted body zone for the workout.
|
|
163
|
+
* @param {WorkoutDifficulty} difficultyLevel - Difficulty level of the workout.
|
|
164
|
+
* @param {WorkoutDuration} workoutDuration - Duration of the workout.
|
|
165
|
+
* @param {string} programID - Unique identifier for the workout program.
|
|
166
|
+
*/
|
|
75
167
|
week: number;
|
|
76
168
|
bodyZone: BodyZone;
|
|
77
169
|
difficultyLevel: WorkoutDifficulty;
|
|
@@ -80,7 +172,14 @@ export declare class WorkoutConfig {
|
|
|
80
172
|
constructor(week: number, bodyZone: BodyZone, difficultyLevel: WorkoutDifficulty, workoutDuration: WorkoutDuration, programID: string);
|
|
81
173
|
toJson(): string;
|
|
82
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Class representing user data.
|
|
177
|
+
*/
|
|
83
178
|
export declare class UserData {
|
|
179
|
+
/**
|
|
180
|
+
* @param {Gender} gender - User's gender.
|
|
181
|
+
* @param {number} age - User's age.
|
|
182
|
+
*/
|
|
84
183
|
gender: Gender;
|
|
85
184
|
age: number;
|
|
86
185
|
constructor(gender: Gender, age: number);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SMWorkout.d.ts","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1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;gBAG5B,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;CAShC;AAGD;;GAEG;AACH,qBAAa,aAAa;IACxB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,iBAAiB,CAAC;IACnC,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;gBAGhB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,iBAAiB,EAClC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,MAAM;IASnB,MAAM,IAAI,MAAM;CASjB;AAED;;GAEG;AACH,qBAAa,QAAQ;IACnB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;gBAEA,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKvC,MAAM,IAAI,MAAM;CAMjB"}
|
|
@@ -1,17 +1,52 @@
|
|
|
1
1
|
import * as SMWorkoutLibrary from '../src/SMWorkout';
|
|
2
|
+
/**
|
|
3
|
+
* This function will configure the sdk
|
|
4
|
+
* @param {string} key - your auth key
|
|
5
|
+
*/
|
|
2
6
|
export declare function configure(key: string): Promise<string>;
|
|
7
|
+
/**
|
|
8
|
+
* start an assessment session.
|
|
9
|
+
*
|
|
10
|
+
* @param {SMWorkoutLibrary.AssessmentTypes} type - The type of assessment to start.
|
|
11
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
12
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment session, or `null` if no user data is provided.
|
|
13
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
14
|
+
* @param {string} customAssessmentID - A unique identifier for a custom assessment session.
|
|
15
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating whether the assessment finished.
|
|
16
|
+
*/
|
|
3
17
|
export declare function startAssessment(type: SMWorkoutLibrary.AssessmentTypes, showSummary: boolean | undefined, userData: SMWorkoutLibrary.UserData | null, forceShowUserDataScreen: boolean | undefined, customAssessmentID: string): Promise<{
|
|
4
18
|
summary: string;
|
|
5
19
|
didFinish: boolean;
|
|
6
20
|
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Starts a custom workout session.
|
|
23
|
+
*
|
|
24
|
+
* @param {SMWorkoutLibrary.SMWorkout} workout - The custom workout configuration.
|
|
25
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout session finished.
|
|
26
|
+
*/
|
|
7
27
|
export declare function startCustomWorkout(workout: SMWorkoutLibrary.SMWorkout): Promise<{
|
|
8
28
|
summary: string;
|
|
9
29
|
didFinish: boolean;
|
|
10
30
|
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Initiates a custom assessment session.
|
|
33
|
+
*
|
|
34
|
+
* @param {SMWorkoutLibrary.SMWorkout} assessment - The assessment configuration for the session.
|
|
35
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment, or `null` if no user data is provided.
|
|
36
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
37
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
38
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the assessment finished.
|
|
39
|
+
*/
|
|
11
40
|
export declare function startCustomAssessment(assessment: SMWorkoutLibrary.SMWorkout, userData: SMWorkoutLibrary.UserData | null, forceShowUserDataScreen?: boolean, showSummary?: boolean): Promise<{
|
|
12
41
|
summary: string;
|
|
13
42
|
didFinish: boolean;
|
|
14
43
|
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Starts a workout program using the provided workout configuration.
|
|
46
|
+
*
|
|
47
|
+
* @param {SMWorkoutLibrary.WorkoutConfig} workoutConfig - The configuration for the workout program.
|
|
48
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout program finished.
|
|
49
|
+
*/
|
|
15
50
|
export declare function startWorkoutProgram(workoutConfig: SMWorkoutLibrary.WorkoutConfig): Promise<{
|
|
16
51
|
summary: string;
|
|
17
52
|
didFinish: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,kBAAkB,CAAC;AAmBrD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtD;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,gBAAgB,CAAC,eAAe,EACtC,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,kBAAkB,CAAC;AAmBrD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,gBAAgB,CAAC,eAAe,EACtC,WAAW,EAAE,OAAO,YAAO,EAC3B,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,GAAG,IAAI,EAC1C,uBAAuB,EAAE,OAAO,YAAQ,EACxC,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAQlD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,CAAC,SAAS,GAClC,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAElD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,gBAAgB,CAAC,SAAS,EACtC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,GAAG,IAAI,EAC1C,uBAAuB,GAAE,OAAe,EACxC,WAAW,GAAE,OAAc,GAC1B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAOlD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,gBAAgB,CAAC,aAAa,GAC5C,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAElD"}
|
package/package.json
CHANGED
package/src/SMWorkout.tsx
CHANGED
|
@@ -1,45 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing assessment types.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
1
5
|
export enum AssessmentTypes {
|
|
2
6
|
Fitness = 'fitness',
|
|
3
7
|
Custom = 'custom',
|
|
4
8
|
Body360 = 'body360',
|
|
5
9
|
}
|
|
6
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Enum representing UI elements that can be displayed during workouts.
|
|
13
|
+
* @enum {string}
|
|
14
|
+
*/
|
|
7
15
|
export enum UIElement {
|
|
8
16
|
RepsCounter = 'repsCounter',
|
|
9
17
|
Timer = 'timer',
|
|
10
18
|
GaugeOfMotion = 'gaugeOfMotion',
|
|
11
19
|
}
|
|
12
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Enum representing body zones targeted in workouts.
|
|
23
|
+
* @enum {string}
|
|
24
|
+
*/
|
|
13
25
|
export enum BodyZone {
|
|
14
26
|
UpperBody = 'UpperBody',
|
|
15
27
|
LowerBody = 'LowerBody',
|
|
16
28
|
FullBody = 'FullBody',
|
|
17
29
|
}
|
|
18
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Enum representing workout difficulty levels.
|
|
33
|
+
* @enum {string}
|
|
34
|
+
*/
|
|
19
35
|
export enum WorkoutDifficulty {
|
|
20
36
|
LowDifficulty = 'LowDifficulty',
|
|
21
37
|
MidDifficulty = 'MidDifficulty',
|
|
22
38
|
HighDifficulty = 'HighDifficulty',
|
|
23
39
|
}
|
|
24
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Enum representing workout durations.
|
|
43
|
+
* @enum {string}
|
|
44
|
+
*/
|
|
25
45
|
export enum WorkoutDuration {
|
|
26
46
|
Short = 'Short',
|
|
27
47
|
Long = 'Long',
|
|
28
48
|
}
|
|
29
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Enum representing different types of scoring methods.
|
|
52
|
+
* @enum {string}
|
|
53
|
+
*/
|
|
30
54
|
export enum ScoringType {
|
|
31
55
|
Rom = 'rom',
|
|
32
56
|
Time = 'time',
|
|
33
57
|
Reps = 'reps',
|
|
34
58
|
}
|
|
35
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Enum representing gender options for user data.
|
|
62
|
+
* @enum {string}
|
|
63
|
+
*/
|
|
36
64
|
export enum Gender {
|
|
37
65
|
Female = 'Female',
|
|
38
66
|
Male = 'Male',
|
|
39
67
|
Other = 'Rather not say',
|
|
40
68
|
}
|
|
41
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Class representing a workout.
|
|
72
|
+
*/
|
|
42
73
|
export class SMWorkout {
|
|
74
|
+
/**
|
|
75
|
+
* @param {string | null} id - Unique identifier for the workout.
|
|
76
|
+
* @param {string | null} name - Name of the workout.
|
|
77
|
+
* @param {string | null} workoutIntro - URL for workout intro sound.
|
|
78
|
+
* @param {string | null} soundtrack - URL for soundtrack.
|
|
79
|
+
* @param {SMExercise[]} exercises - List of exercises included in the workout.
|
|
80
|
+
* @param {string | null} getInFrame - URL for body cal get in frame sound.
|
|
81
|
+
* @param {string | null} bodycalFinished - URL for body cal finished sound.
|
|
82
|
+
* @param {string | null} workoutClosure - URL for workout closure sound.
|
|
83
|
+
*/
|
|
43
84
|
id: string | null;
|
|
44
85
|
name: string | null;
|
|
45
86
|
workoutIntro: string | null;
|
|
@@ -83,7 +124,20 @@ export class SMWorkout {
|
|
|
83
124
|
}
|
|
84
125
|
}
|
|
85
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Class representing an exercise in a workout.
|
|
129
|
+
*/
|
|
86
130
|
export class SMExercise {
|
|
131
|
+
/**
|
|
132
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
133
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
134
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
135
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
136
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
137
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
138
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
139
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
140
|
+
*/
|
|
87
141
|
detector: string;
|
|
88
142
|
uiElements: UIElement[] | null;
|
|
89
143
|
videoInstruction: string | null;
|
|
@@ -114,7 +168,24 @@ export class SMExercise {
|
|
|
114
168
|
}
|
|
115
169
|
}
|
|
116
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Class representing an exercise in an assessment.
|
|
173
|
+
*/
|
|
117
174
|
export class SMAssessmentExercise extends SMExercise {
|
|
175
|
+
/**
|
|
176
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
177
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
178
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
179
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
180
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
181
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
182
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
183
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
184
|
+
* @param {string | null} summaryTitle - Title for the exercise summary.
|
|
185
|
+
* @param {string | null} summarySubTitle - Subtitle for the exercise summary.
|
|
186
|
+
* @param {string | null} summaryMainMetricTitle - Main metric title in the summary.
|
|
187
|
+
* @param {string | null} summaryMainMetricSubTitle - Main metric subtitle in the summary.
|
|
188
|
+
*/
|
|
118
189
|
summaryTitle: string | null;
|
|
119
190
|
summarySubTitle: string | null;
|
|
120
191
|
summaryMainMetricTitle: string | null;
|
|
@@ -154,7 +225,18 @@ export class SMAssessmentExercise extends SMExercise {
|
|
|
154
225
|
}
|
|
155
226
|
}
|
|
156
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Class representing scoring parameters for an exercise.
|
|
230
|
+
*/
|
|
157
231
|
export class SMScoringParams {
|
|
232
|
+
/**
|
|
233
|
+
* @param {ScoringType | null} type - Type of scoring (e.g., ROM, time, reps).
|
|
234
|
+
* @param {number | null} scoreFactor - Factor to adjust the score.
|
|
235
|
+
* @param {number | null} targetTime - Target time for time-based scoring.
|
|
236
|
+
* @param {number | null} targetReps - Target reps for rep-based scoring.
|
|
237
|
+
* @param {string | null} targetRom - Range of motion target for ROM-based scoring.
|
|
238
|
+
* @param {string[] | null} passCriteria - List of criteria required to pass.
|
|
239
|
+
*/
|
|
158
240
|
type: ScoringType | null;
|
|
159
241
|
scoreFactor: number | null;
|
|
160
242
|
targetTime: number | null;
|
|
@@ -179,7 +261,18 @@ export class SMScoringParams {
|
|
|
179
261
|
}
|
|
180
262
|
}
|
|
181
263
|
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Class representing the configuration for a workout program.
|
|
267
|
+
*/
|
|
182
268
|
export class WorkoutConfig {
|
|
269
|
+
/**
|
|
270
|
+
* @param {number} week - Week number in the program.
|
|
271
|
+
* @param {BodyZone} bodyZone - Targeted body zone for the workout.
|
|
272
|
+
* @param {WorkoutDifficulty} difficultyLevel - Difficulty level of the workout.
|
|
273
|
+
* @param {WorkoutDuration} workoutDuration - Duration of the workout.
|
|
274
|
+
* @param {string} programID - Unique identifier for the workout program.
|
|
275
|
+
*/
|
|
183
276
|
week: number;
|
|
184
277
|
bodyZone: BodyZone;
|
|
185
278
|
difficultyLevel: WorkoutDifficulty;
|
|
@@ -211,7 +304,14 @@ export class WorkoutConfig {
|
|
|
211
304
|
}
|
|
212
305
|
}
|
|
213
306
|
|
|
307
|
+
/**
|
|
308
|
+
* Class representing user data.
|
|
309
|
+
*/
|
|
214
310
|
export class UserData {
|
|
311
|
+
/**
|
|
312
|
+
* @param {Gender} gender - User's gender.
|
|
313
|
+
* @param {number} age - User's age.
|
|
314
|
+
*/
|
|
215
315
|
gender: Gender;
|
|
216
316
|
age: number;
|
|
217
317
|
|
package/src/index.tsx
CHANGED
|
@@ -18,10 +18,24 @@ const SMKitUIManager = NativeModules.SMKitUIManager
|
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* This function will configure the sdk
|
|
23
|
+
* @param {string} key - your auth key
|
|
24
|
+
*/
|
|
21
25
|
export function configure(key: string): Promise<string> {
|
|
22
26
|
return SMKitUIManager.configure(key);
|
|
23
27
|
}
|
|
24
28
|
|
|
29
|
+
/**
|
|
30
|
+
* start an assessment session.
|
|
31
|
+
*
|
|
32
|
+
* @param {SMWorkoutLibrary.AssessmentTypes} type - The type of assessment to start.
|
|
33
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
34
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment session, or `null` if no user data is provided.
|
|
35
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
36
|
+
* @param {string} customAssessmentID - A unique identifier for a custom assessment session.
|
|
37
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating whether the assessment finished.
|
|
38
|
+
*/
|
|
25
39
|
export function startAssessment(
|
|
26
40
|
type: SMWorkoutLibrary.AssessmentTypes,
|
|
27
41
|
showSummary: boolean = true,
|
|
@@ -38,12 +52,27 @@ export function startAssessment(
|
|
|
38
52
|
);
|
|
39
53
|
}
|
|
40
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Starts a custom workout session.
|
|
57
|
+
*
|
|
58
|
+
* @param {SMWorkoutLibrary.SMWorkout} workout - The custom workout configuration.
|
|
59
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout session finished.
|
|
60
|
+
*/
|
|
41
61
|
export function startCustomWorkout(
|
|
42
62
|
workout: SMWorkoutLibrary.SMWorkout
|
|
43
63
|
): Promise<{ summary: string; didFinish: boolean }> {
|
|
44
64
|
return SMKitUIManager.startCustomWorkout(workout.toJson());
|
|
45
65
|
}
|
|
46
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Initiates a custom assessment session.
|
|
69
|
+
*
|
|
70
|
+
* @param {SMWorkoutLibrary.SMWorkout} assessment - The assessment configuration for the session.
|
|
71
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment, or `null` if no user data is provided.
|
|
72
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
73
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
74
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the assessment finished.
|
|
75
|
+
*/
|
|
47
76
|
export function startCustomAssessment(
|
|
48
77
|
assessment: SMWorkoutLibrary.SMWorkout,
|
|
49
78
|
userData: SMWorkoutLibrary.UserData | null,
|
|
@@ -58,6 +87,14 @@ export function startCustomAssessment(
|
|
|
58
87
|
);
|
|
59
88
|
}
|
|
60
89
|
|
|
61
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Starts a workout program using the provided workout configuration.
|
|
92
|
+
*
|
|
93
|
+
* @param {SMWorkoutLibrary.WorkoutConfig} workoutConfig - The configuration for the workout program.
|
|
94
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout program finished.
|
|
95
|
+
*/
|
|
96
|
+
export function startWorkoutProgram(
|
|
97
|
+
workoutConfig: SMWorkoutLibrary.WorkoutConfig
|
|
98
|
+
): Promise<{ summary: string; didFinish: boolean }> {
|
|
62
99
|
return SMKitUIManager.startWorkoutProgram(workoutConfig.toJson());
|
|
63
100
|
}
|