@krampa/common 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/goal-types.d.ts +2 -1
- package/dist/goal-types.js +3 -0
- package/dist/goal-value-types.d.ts +4 -8
- package/package.json +1 -1
package/dist/goal-types.d.ts
CHANGED
|
@@ -9,10 +9,11 @@ export declare const GOAL_TYPES: {
|
|
|
9
9
|
readonly WORKOUT_STRENGTH: "workout/strength";
|
|
10
10
|
readonly WORKOUT_CARDIO: "workout/cardio";
|
|
11
11
|
readonly WORKOUT_OTHER: "workout/other";
|
|
12
|
+
readonly WORKOUT: "workout";
|
|
12
13
|
readonly ACHIEVEMENT_PR: "achievement/pr";
|
|
13
14
|
readonly STEPS_DAILY: "steps/daily";
|
|
14
15
|
readonly MEASUREMENT_BODY: "measurement/body";
|
|
15
16
|
readonly CUSTOM_OTHER: "custom/other";
|
|
16
17
|
};
|
|
17
|
-
export declare const GOAL_TYPE_VALUES: readonly ["weight/loss", "weight/gain", "weight/maintain", "workout/strength", "workout/cardio", "workout/other", "achievement/pr", "steps/daily", "measurement/body", "custom/other"];
|
|
18
|
+
export declare const GOAL_TYPE_VALUES: readonly ["weight/loss", "weight/gain", "weight/maintain", "workout/strength", "workout/cardio", "workout/other", "workout", "achievement/pr", "steps/daily", "measurement/body", "custom/other"];
|
|
18
19
|
export type GoalType = (typeof GOAL_TYPE_VALUES)[number];
|
package/dist/goal-types.js
CHANGED
|
@@ -15,6 +15,8 @@ exports.GOAL_TYPES = {
|
|
|
15
15
|
WORKOUT_STRENGTH: "workout/strength",
|
|
16
16
|
WORKOUT_CARDIO: "workout/cardio",
|
|
17
17
|
WORKOUT_OTHER: "workout/other",
|
|
18
|
+
// New workout type
|
|
19
|
+
WORKOUT: "workout",
|
|
18
20
|
// Achievement goals
|
|
19
21
|
ACHIEVEMENT_PR: "achievement/pr",
|
|
20
22
|
STEPS_DAILY: "steps/daily",
|
|
@@ -30,6 +32,7 @@ exports.GOAL_TYPE_VALUES = [
|
|
|
30
32
|
exports.GOAL_TYPES.WORKOUT_STRENGTH,
|
|
31
33
|
exports.GOAL_TYPES.WORKOUT_CARDIO,
|
|
32
34
|
exports.GOAL_TYPES.WORKOUT_OTHER,
|
|
35
|
+
exports.GOAL_TYPES.WORKOUT,
|
|
33
36
|
exports.GOAL_TYPES.ACHIEVEMENT_PR,
|
|
34
37
|
exports.GOAL_TYPES.STEPS_DAILY,
|
|
35
38
|
exports.GOAL_TYPES.MEASUREMENT_BODY,
|
|
@@ -3,13 +3,9 @@
|
|
|
3
3
|
* Shared between frontend and backend for type safety
|
|
4
4
|
*/
|
|
5
5
|
import { GOAL_TYPES } from "./goal-types";
|
|
6
|
-
export type
|
|
7
|
-
startWeight: number;
|
|
6
|
+
export type WeightValue = {
|
|
8
7
|
targetWeight: number;
|
|
9
8
|
};
|
|
10
|
-
export type WeightMaintain = {
|
|
11
|
-
maintenanceWeight: number;
|
|
12
|
-
};
|
|
13
9
|
export type WorkoutCardioValue = {
|
|
14
10
|
activityName: string;
|
|
15
11
|
weeklyTarget: number;
|
|
@@ -31,15 +27,15 @@ export type StepsGoalValue = {
|
|
|
31
27
|
type BaseGoal = {};
|
|
32
28
|
export type WeightLossGoal = BaseGoal & {
|
|
33
29
|
type: typeof GOAL_TYPES.WEIGHT_LOSS;
|
|
34
|
-
value:
|
|
30
|
+
value: WeightValue;
|
|
35
31
|
};
|
|
36
32
|
export type WeightGainGoal = BaseGoal & {
|
|
37
33
|
type: typeof GOAL_TYPES.WEIGHT_GAIN;
|
|
38
|
-
value:
|
|
34
|
+
value: WeightValue;
|
|
39
35
|
};
|
|
40
36
|
export type WeightMaintainGoal = BaseGoal & {
|
|
41
37
|
type: typeof GOAL_TYPES.WEIGHT_MAINTAIN;
|
|
42
|
-
value:
|
|
38
|
+
value: WeightValue;
|
|
43
39
|
};
|
|
44
40
|
export type WorkoutStrengthGoal = BaseGoal & {
|
|
45
41
|
type: typeof GOAL_TYPES.WORKOUT_STRENGTH;
|