@krampa/common 0.5.0 → 0.7.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.
@@ -2,12 +2,13 @@
2
2
  * Goal value type definitions
3
3
  * Shared between frontend and backend for type safety
4
4
  */
5
+ import { GOAL_TYPES } from "./goal-types";
5
6
  export type WeightChange = {
6
7
  startWeight: number;
7
8
  targetWeight: number;
8
9
  };
9
10
  export type WeightMaintain = {
10
- targetWeight: number;
11
+ maintenanceWeight: number;
11
12
  };
12
13
  export type WorkoutCardioValue = {
13
14
  activityName: string;
@@ -29,31 +30,31 @@ export type StepsGoalValue = {
29
30
  };
30
31
  type BaseGoal = {};
31
32
  export type WeightLossGoal = BaseGoal & {
32
- type: "weight/loss";
33
+ type: typeof GOAL_TYPES.WEIGHT_LOSS;
33
34
  value: WeightChange;
34
35
  };
35
36
  export type WeightGainGoal = BaseGoal & {
36
- type: "weight/gain";
37
+ type: typeof GOAL_TYPES.WEIGHT_GAIN;
37
38
  value: WeightChange;
38
39
  };
39
40
  export type WeightMaintainGoal = BaseGoal & {
40
- type: "weight/maintain";
41
+ type: typeof GOAL_TYPES.WEIGHT_MAINTAIN;
41
42
  value: WeightMaintain;
42
43
  };
43
44
  export type WorkoutStrengthGoal = BaseGoal & {
44
- type: "workout/strength";
45
+ type: typeof GOAL_TYPES.WORKOUT_STRENGTH;
45
46
  value: WorkoutStrengthValue;
46
47
  };
47
48
  export type WorkoutCardioGoal = BaseGoal & {
48
- type: "workout/cardio";
49
+ type: typeof GOAL_TYPES.WORKOUT_CARDIO;
49
50
  value: WorkoutCardioValue;
50
51
  };
51
52
  export type WorkoutOtherGoal = BaseGoal & {
52
- type: "workout/other";
53
+ type: typeof GOAL_TYPES.WORKOUT_OTHER;
53
54
  value: WorkoutOtherValue;
54
55
  };
55
56
  export type StepsGoal = BaseGoal & {
56
- type: "steps/daily";
57
+ type: typeof GOAL_TYPES.STEPS_DAILY;
57
58
  value: StepsGoalValue;
58
59
  };
59
60
  export type Goal = WeightLossGoal | WeightGainGoal | WeightMaintainGoal | WorkoutStrengthGoal | WorkoutCardioGoal | WorkoutOtherGoal | StepsGoal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krampa/common",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Shared types and constants for Krampa fitness challenge app",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",