@dgpholdings/greatoak-shared 1.1.59 → 1.1.61
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/dist/types/TApiRecord.d.ts +50 -32
- package/dist/types/TApiTemplateData.d.ts +2 -2
- package/dist/types/TApiUserData.d.ts +16 -16
- package/dist/types/commonTypes.d.ts +5 -5
- package/dist/utils/index.d.ts +1 -6
- package/dist/utils/index.js +2 -7
- package/dist/utils/record.utils.d.ts +33 -28
- package/dist/utils/record.utils.js +142 -43
- package/dist/utils/scoring.utils.d.ts +12 -36
- package/dist/utils/scoring.utils.js +252 -475
- package/dist/utils/workoutSummary.util.js +362 -294
- package/package.json +1 -1
|
@@ -1,43 +1,61 @@
|
|
|
1
|
-
export type TRecord =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
export type TRecord =
|
|
2
|
+
| {
|
|
3
|
+
type: "weight-reps";
|
|
4
|
+
kg: string;
|
|
5
|
+
reps: string;
|
|
6
|
+
}
|
|
7
|
+
| {
|
|
8
|
+
type: "duration";
|
|
9
|
+
durationMmSs: string;
|
|
10
|
+
goalDuration: string;
|
|
11
|
+
}
|
|
12
|
+
| {
|
|
13
|
+
type: "reps-only";
|
|
14
|
+
reps: string;
|
|
15
|
+
};
|
|
13
16
|
export type TRecordForm = TRecord & {
|
|
14
|
-
|
|
17
|
+
isDone: boolean;
|
|
15
18
|
};
|
|
16
|
-
export type TRecordDuration = Extract<
|
|
19
|
+
export type TRecordDuration = Extract<
|
|
20
|
+
TRecord,
|
|
21
|
+
{
|
|
17
22
|
type: "duration";
|
|
18
|
-
}
|
|
19
|
-
|
|
23
|
+
}
|
|
24
|
+
>;
|
|
25
|
+
export type TRecordWeight = Extract<
|
|
26
|
+
TRecord,
|
|
27
|
+
{
|
|
20
28
|
type: "weight-reps";
|
|
21
|
-
}
|
|
22
|
-
|
|
29
|
+
}
|
|
30
|
+
>;
|
|
31
|
+
export type TRecordBodyWeight = Extract<
|
|
32
|
+
TRecord,
|
|
33
|
+
{
|
|
23
34
|
type: "reps-only";
|
|
24
|
-
}
|
|
35
|
+
}
|
|
36
|
+
>;
|
|
25
37
|
export type TExerciseRecord<T extends TRecord["type"]> = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
exerciseId: string;
|
|
39
|
+
userId: string;
|
|
40
|
+
recordType: T;
|
|
41
|
+
records: {
|
|
42
|
+
isoDate: string;
|
|
43
|
+
records: Omit<
|
|
44
|
+
Extract<
|
|
45
|
+
TRecord,
|
|
46
|
+
{
|
|
47
|
+
type: T;
|
|
48
|
+
}
|
|
49
|
+
>,
|
|
50
|
+
"type"
|
|
51
|
+
>[];
|
|
52
|
+
}[];
|
|
35
53
|
};
|
|
36
54
|
export type TApiExerciseRecordUpdateReq = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
55
|
+
exerciseId: string;
|
|
56
|
+
recordType: TRecord["type"];
|
|
57
|
+
records: TExerciseRecord<TRecord["type"]>["records"][number]["records"];
|
|
40
58
|
};
|
|
41
59
|
export type TApiExerciseRecordUpdateRes = {
|
|
42
|
-
|
|
60
|
+
status: 201 | 400;
|
|
43
61
|
};
|
|
@@ -57,13 +57,13 @@ export type TExerciseLatestRecord = {
|
|
|
57
57
|
records: {
|
|
58
58
|
kg?: string;
|
|
59
59
|
reps?: string;
|
|
60
|
-
|
|
60
|
+
durationMmSs?: string;
|
|
61
61
|
auxWeightKg?: string;
|
|
62
62
|
isDone: boolean;
|
|
63
63
|
rpe?: string;
|
|
64
64
|
rir?: string;
|
|
65
65
|
setNote?: string;
|
|
66
|
-
|
|
66
|
+
distance?: string;
|
|
67
67
|
isStrictMode: boolean;
|
|
68
68
|
workDurationSecs?: number;
|
|
69
69
|
restDurationSecs?: number;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { TExercise } from "./TApiExercise";
|
|
2
2
|
import { TTemplate } from "./TApiTemplate";
|
|
3
3
|
type TExerciseRecord = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
recordDate: Date;
|
|
5
|
+
exerciseNote?: string;
|
|
6
|
+
score: number;
|
|
7
|
+
records: {
|
|
8
|
+
kg?: number;
|
|
9
|
+
reps?: number;
|
|
10
|
+
durationMmSs?: string;
|
|
11
|
+
goalDuration?: string;
|
|
12
|
+
}[];
|
|
13
13
|
};
|
|
14
14
|
type TTemplateData = Omit<TTemplate, "exerciseIds"> & {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
exercises: {
|
|
16
|
+
exercise: TExercise;
|
|
17
|
+
latestRecord: TExerciseRecord;
|
|
18
|
+
}[];
|
|
19
19
|
};
|
|
20
20
|
export type TApiUserDataRes = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
status: number;
|
|
22
|
+
templates: TTemplateData[];
|
|
23
|
+
msg?: string;
|
|
24
24
|
};
|
|
25
25
|
export type TApiUserDataReq = {};
|
|
26
26
|
export {};
|
|
@@ -12,7 +12,7 @@ export type TRecord = {
|
|
|
12
12
|
rir?: string;
|
|
13
13
|
} | {
|
|
14
14
|
type: "duration";
|
|
15
|
-
|
|
15
|
+
durationMmSs: string;
|
|
16
16
|
auxWeightKg: string;
|
|
17
17
|
} | {
|
|
18
18
|
type: "reps-only";
|
|
@@ -23,12 +23,12 @@ export type TRecord = {
|
|
|
23
23
|
type: "cardio-machine";
|
|
24
24
|
speedMin: string;
|
|
25
25
|
speedMax: string;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
durationMmSs: string;
|
|
27
|
+
distance?: string;
|
|
28
28
|
} | {
|
|
29
29
|
type: "cardio-free";
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
distance: string;
|
|
31
|
+
durationMmSs: string;
|
|
32
32
|
});
|
|
33
33
|
export type TRecordDuration = Extract<TRecord, {
|
|
34
34
|
type: "duration";
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export { toNumber } from "./number.util";
|
|
2
2
|
export { mmssToSecs, isUserAllowedToUpdate, getDaysAndHoursDifference, } from "./time.util";
|
|
3
3
|
export { countryToCurrencyCode } from "./billing.utils";
|
|
4
|
-
export {
|
|
4
|
+
export { calculateExerciseScore } from "./scoring.utils";
|
|
5
5
|
export { isDefined, isDefinedNumber } from "./isDefined.utils";
|
|
6
|
-
export { refineRecordEntry } from "./record.utils";
|
|
7
|
-
export { generateWorkoutSummaryText, calculateWorkoutSummary, } from "./workoutSummary.util";
|
|
8
|
-
export type { TRefinedRecord, TRefinedBodyWeightRecord, TRefinedDurationRecord, TRefinedWeightRecord, } from "./record.utils";
|
|
9
|
-
export type { TUserProfile, TScoreBreakdown } from "./scoring.utils";
|
|
10
|
-
export type { TWorkoutSummary, TExerciseSummary, TSetSummary, TMuscleRecoveryMap, } from "./workoutSummary.util";
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isDefinedNumber = exports.isDefined = exports.calculateExerciseScore = exports.countryToCurrencyCode = exports.getDaysAndHoursDifference = exports.isUserAllowedToUpdate = exports.mmssToSecs = exports.toNumber = void 0;
|
|
4
4
|
var number_util_1 = require("./number.util");
|
|
5
5
|
Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return number_util_1.toNumber; } });
|
|
6
6
|
var time_util_1 = require("./time.util");
|
|
@@ -10,12 +10,7 @@ Object.defineProperty(exports, "getDaysAndHoursDifference", { enumerable: true,
|
|
|
10
10
|
var billing_utils_1 = require("./billing.utils");
|
|
11
11
|
Object.defineProperty(exports, "countryToCurrencyCode", { enumerable: true, get: function () { return billing_utils_1.countryToCurrencyCode; } });
|
|
12
12
|
var scoring_utils_1 = require("./scoring.utils");
|
|
13
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "calculateExerciseScore", { enumerable: true, get: function () { return scoring_utils_1.calculateExerciseScore; } });
|
|
14
14
|
var isDefined_utils_1 = require("./isDefined.utils");
|
|
15
15
|
Object.defineProperty(exports, "isDefined", { enumerable: true, get: function () { return isDefined_utils_1.isDefined; } });
|
|
16
16
|
Object.defineProperty(exports, "isDefinedNumber", { enumerable: true, get: function () { return isDefined_utils_1.isDefinedNumber; } });
|
|
17
|
-
var record_utils_1 = require("./record.utils");
|
|
18
|
-
Object.defineProperty(exports, "refineRecordEntry", { enumerable: true, get: function () { return record_utils_1.refineRecordEntry; } });
|
|
19
|
-
var workoutSummary_util_1 = require("./workoutSummary.util");
|
|
20
|
-
Object.defineProperty(exports, "generateWorkoutSummaryText", { enumerable: true, get: function () { return workoutSummary_util_1.generateWorkoutSummaryText; } });
|
|
21
|
-
Object.defineProperty(exports, "calculateWorkoutSummary", { enumerable: true, get: function () { return workoutSummary_util_1.calculateWorkoutSummary; } });
|
|
@@ -1,43 +1,48 @@
|
|
|
1
1
|
import { TRecord } from "../types";
|
|
2
2
|
type RefinedBase = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
isDone: boolean;
|
|
4
|
+
rpe?: number;
|
|
5
|
+
workDurationSecs?: number;
|
|
6
|
+
restDurationSecs?: number;
|
|
7
|
+
setNote?: string;
|
|
8
|
+
isStrictMode: boolean;
|
|
9
9
|
};
|
|
10
10
|
export type TRefinedWeightRecord = RefinedBase & {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
type: "weight-reps";
|
|
12
|
+
kg: number;
|
|
13
|
+
reps: number;
|
|
14
|
+
rir?: number;
|
|
15
15
|
};
|
|
16
16
|
export type TRefinedDurationRecord = RefinedBase & {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
type: "duration";
|
|
18
|
+
durationMmSs: number;
|
|
19
|
+
auxWeightKg: number;
|
|
20
20
|
};
|
|
21
21
|
export type TRefinedBodyWeightRecord = RefinedBase & {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
type: "reps-only";
|
|
23
|
+
reps: number;
|
|
24
|
+
auxWeightKg: number;
|
|
25
|
+
rir?: number;
|
|
26
26
|
};
|
|
27
27
|
export type TRefinedCardioMachineRecord = RefinedBase & {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
type: "cardio-machine";
|
|
29
|
+
speed: number;
|
|
30
|
+
durationMmSs: number;
|
|
31
|
+
distance: number;
|
|
32
|
+
intensityScore?: number;
|
|
33
33
|
};
|
|
34
34
|
export type TRefinedCardioFreeRecord = RefinedBase & {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
type: "cardio-free";
|
|
36
|
+
distance: number;
|
|
37
|
+
durationMmSs: number;
|
|
38
|
+
avgPaceSecsPerKm?: number;
|
|
39
|
+
avgSpeedKmh?: number;
|
|
40
40
|
};
|
|
41
|
-
export type TRefinedRecord =
|
|
41
|
+
export type TRefinedRecord =
|
|
42
|
+
| TRefinedWeightRecord
|
|
43
|
+
| TRefinedDurationRecord
|
|
44
|
+
| TRefinedBodyWeightRecord
|
|
45
|
+
| TRefinedCardioMachineRecord
|
|
46
|
+
| TRefinedCardioFreeRecord;
|
|
42
47
|
export declare const refineRecordEntry: (entry: TRecord) => TRefinedRecord;
|
|
43
48
|
export {};
|
|
@@ -5,50 +5,149 @@ const isDefined_utils_1 = require("./isDefined.utils");
|
|
|
5
5
|
const number_util_1 = require("./number.util");
|
|
6
6
|
const time_util_1 = require("./time.util");
|
|
7
7
|
const refineRecordEntry = (entry) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
9
|
+
const base = Object.assign(
|
|
10
|
+
Object.assign(
|
|
11
|
+
Object.assign(
|
|
12
|
+
Object.assign(
|
|
13
|
+
{ isDone: entry.isDone, isStrictMode: entry.isStrictMode },
|
|
14
|
+
(0, isDefined_utils_1.isDefinedNumber)(
|
|
15
|
+
(0, number_util_1.toNumber)(entry.rpe)
|
|
16
|
+
) && { rpe: (0, number_util_1.toNumber)(entry.rpe) }
|
|
17
|
+
),
|
|
18
|
+
(0, isDefined_utils_1.isDefinedNumber)(entry.workDurationSecs) && {
|
|
19
|
+
workDurationSecs: entry.workDurationSecs,
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
(0, isDefined_utils_1.isDefinedNumber)(entry.restDurationSecs) && {
|
|
12
23
|
restDurationSecs: entry.restDurationSecs,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
: undefined });
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
(0, isDefined_utils_1.isDefined)(entry.setNote) && {
|
|
27
|
+
setNote: entry.setNote,
|
|
18
28
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
29
|
+
);
|
|
30
|
+
if (entry.type === "weight-reps") {
|
|
31
|
+
return Object.assign(Object.assign({}, base), {
|
|
32
|
+
type: "weight-reps",
|
|
33
|
+
kg:
|
|
34
|
+
(_a = (0, number_util_1.toNumber)(entry.kg)) !== null && _a !== void 0
|
|
35
|
+
? _a
|
|
36
|
+
: 0,
|
|
37
|
+
reps:
|
|
38
|
+
(_b = (0, number_util_1.toNumber)(entry.reps)) !== null && _b !== void 0
|
|
39
|
+
? _b
|
|
40
|
+
: 0,
|
|
41
|
+
rir: (0, isDefined_utils_1.isDefinedNumber)(
|
|
42
|
+
(0, number_util_1.toNumber)(entry.rir)
|
|
43
|
+
)
|
|
44
|
+
? (0, number_util_1.toNumber)(entry.rir)
|
|
45
|
+
: undefined,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (entry.type === "duration") {
|
|
49
|
+
return Object.assign(Object.assign({}, base), {
|
|
50
|
+
type: "duration",
|
|
51
|
+
durationMmSs:
|
|
52
|
+
(_c = (0, number_util_1.toNumber)(entry.durationMmSs)) !== null &&
|
|
53
|
+
_c !== void 0
|
|
54
|
+
? _c
|
|
55
|
+
: 0,
|
|
56
|
+
auxWeightKg:
|
|
57
|
+
(_d = (0, number_util_1.toNumber)(entry.auxWeightKg)) !== null &&
|
|
58
|
+
_d !== void 0
|
|
59
|
+
? _d
|
|
60
|
+
: 0,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (entry.type === "reps-only") {
|
|
64
|
+
return Object.assign(Object.assign({}, base), {
|
|
65
|
+
type: "reps-only",
|
|
66
|
+
reps:
|
|
67
|
+
(_e = (0, number_util_1.toNumber)(entry.reps)) !== null && _e !== void 0
|
|
68
|
+
? _e
|
|
69
|
+
: 0,
|
|
70
|
+
auxWeightKg:
|
|
71
|
+
(_f = (0, number_util_1.toNumber)(entry.auxWeightKg)) !== null &&
|
|
72
|
+
_f !== void 0
|
|
73
|
+
? _f
|
|
74
|
+
: 0,
|
|
75
|
+
rir: (0, isDefined_utils_1.isDefinedNumber)(
|
|
76
|
+
(0, number_util_1.toNumber)(entry.rir)
|
|
77
|
+
)
|
|
78
|
+
? (0, number_util_1.toNumber)(entry.rir)
|
|
79
|
+
: undefined,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (entry.type === "cardio-machine") {
|
|
83
|
+
const speed =
|
|
84
|
+
(_g = (0, number_util_1.toNumber)(entry.speedMax)) !== null &&
|
|
85
|
+
_g !== void 0
|
|
86
|
+
? _g
|
|
87
|
+
: 1;
|
|
88
|
+
const resistance =
|
|
89
|
+
(_h = (0, number_util_1.toNumber)(entry.rpe)) !== null && _h !== void 0
|
|
90
|
+
? _h
|
|
91
|
+
: 1;
|
|
92
|
+
const durationMmSs =
|
|
93
|
+
(_j = (0, number_util_1.toNumber)(
|
|
94
|
+
(0, time_util_1.mmssToSecs)(entry.durationMmSs)
|
|
95
|
+
)) !== null && _j !== void 0
|
|
96
|
+
? _j
|
|
97
|
+
: 0; // entry.durationMmSs comes as mm:ss value naming issue
|
|
98
|
+
const distance =
|
|
99
|
+
(_k = (0, number_util_1.toNumber)(entry.distance)) !== null &&
|
|
100
|
+
_k !== void 0
|
|
101
|
+
? _k
|
|
102
|
+
: 1;
|
|
103
|
+
// Calculate intensity score for progress tracking
|
|
104
|
+
const intensityScore =
|
|
105
|
+
speed > 0 && resistance > 0 ? speed * resistance : undefined;
|
|
106
|
+
return Object.assign(
|
|
107
|
+
Object.assign(Object.assign({}, base), {
|
|
108
|
+
type: "cardio-machine",
|
|
109
|
+
speed,
|
|
110
|
+
distance,
|
|
111
|
+
durationMmSs,
|
|
112
|
+
}),
|
|
113
|
+
(0, isDefined_utils_1.isDefinedNumber)(intensityScore) && {
|
|
114
|
+
intensityScore,
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
if (entry.type === "cardio-free") {
|
|
119
|
+
const distance =
|
|
120
|
+
(_l = (0, number_util_1.toNumber)(entry.distance)) !== null &&
|
|
121
|
+
_l !== void 0
|
|
122
|
+
? _l
|
|
123
|
+
: 0;
|
|
124
|
+
const durationMmSs =
|
|
125
|
+
(_m = (0, number_util_1.toNumber)(entry.durationMmSs)) !== null &&
|
|
126
|
+
_m !== void 0
|
|
127
|
+
? _m
|
|
128
|
+
: 0;
|
|
129
|
+
// Calculate pace (seconds per km)
|
|
130
|
+
const avgPaceSecsPerKm =
|
|
131
|
+
distance > 0 && durationMmSs > 0 ? durationMmSs / distance : undefined;
|
|
132
|
+
// Calculate average speed (km/h)
|
|
133
|
+
const avgSpeedKmh =
|
|
134
|
+
distance > 0 && durationMmSs > 0
|
|
135
|
+
? distance / (durationMmSs / 3600)
|
|
136
|
+
: undefined;
|
|
137
|
+
return Object.assign(
|
|
138
|
+
Object.assign(
|
|
139
|
+
Object.assign(Object.assign({}, base), {
|
|
140
|
+
type: "cardio-free",
|
|
141
|
+
distance,
|
|
142
|
+
durationMmSs,
|
|
143
|
+
}),
|
|
144
|
+
(0, isDefined_utils_1.isDefinedNumber)(avgPaceSecsPerKm) && {
|
|
145
|
+
avgPaceSecsPerKm,
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
(0, isDefined_utils_1.isDefinedNumber)(avgSpeedKmh) && { avgSpeedKmh }
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
throw new Error(`Unknown record type: ${entry.type}`);
|
|
53
152
|
};
|
|
54
153
|
exports.refineRecordEntry = refineRecordEntry;
|
|
@@ -1,38 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
fitnessLevel?: TUserMetric["fitnessLevel"];
|
|
10
|
-
fitnessGoal?: TFitnessGoal;
|
|
11
|
-
};
|
|
12
|
-
export type TScoreBreakdown = {
|
|
13
|
-
baseScore: number;
|
|
14
|
-
plus: {
|
|
15
|
-
[reason: string]: number;
|
|
16
|
-
}[];
|
|
17
|
-
minus: {
|
|
18
|
-
[reason: string]: number;
|
|
19
|
-
}[];
|
|
20
|
-
finalScore: number;
|
|
21
|
-
caloriesBurned: number;
|
|
22
|
-
metValue: number;
|
|
23
|
-
epocCalories: number;
|
|
24
|
-
};
|
|
25
|
-
type TParams = {
|
|
26
|
-
record: TRefinedRecord;
|
|
1
|
+
import { TExercise, TRecord, TUserMetric } from "../types";
|
|
2
|
+
interface IScoreResult {
|
|
3
|
+
score: number;
|
|
4
|
+
muscleScores: {
|
|
5
|
+
[muscleGroup: string]: number;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare const calculateExerciseScore: (param: {
|
|
27
9
|
exercise: TExercise;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Enhanced training stress score computation using metabolic data and timing guardrails
|
|
34
|
-
* This is for scoring a SINGLE record of an exercise. Ref: TRecord, TRefinedRecord.
|
|
35
|
-
* To calculate complete scoring/summary of workout use: calculateWorkoutSummary(...) function
|
|
36
|
-
*/
|
|
37
|
-
export declare const computeScoreFromRecord: ({ avgRestDurationSecs, record, exercise, userProfile, isTimeIntervalModeEnabled, }: TParams) => TScoreBreakdown;
|
|
10
|
+
record: TRecord[];
|
|
11
|
+
user: TUserMetric;
|
|
12
|
+
isStrictTimingModeScoring: boolean;
|
|
13
|
+
}) => IScoreResult;
|
|
38
14
|
export {};
|