@krampa/common 0.3.2 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +29 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -20,20 +20,43 @@ npm install @krampa/common
20
20
  import { GOAL_TYPES, GOAL_TYPE_VALUES, GoalType } from "@krampa/common";
21
21
 
22
22
  // Use constants
23
- const goalType = GOAL_TYPES.FREQUENCY_CARDIO; // "frequency/cardio"
23
+ const goalType = GOAL_TYPES.WORKOUT_CARDIO; // "workout/cardio"
24
24
 
25
25
  // Use in TypeScript types
26
26
  const myGoal: GoalType = "weight/loss";
27
27
 
28
28
  // Use for database enum
29
29
  const dbEnum = GOAL_TYPE_VALUES; // Array of all valid goal types
30
+ ```
31
+
32
+ ### Challenge Status
33
+
34
+ ```typescript
35
+ import { CHALLENGE_STATUSES, CHALLENGE_STATUS_VALUES, ChallengeStatus } from "@krampa/common";
36
+
37
+ // Use constants
38
+ const status = CHALLENGE_STATUSES.ONGOING; // "ONGOING"
39
+
40
+ // Use in TypeScript types
41
+ const challengeStatus: ChallengeStatus = "PENDING";
42
+
43
+ // Use for database enum
44
+ const dbEnum = CHALLENGE_STATUS_VALUES; // Array of all valid challenge statuses
45
+ ```
30
46
 
31
- // Type guards
32
- import { isCardioGoal, isWeightGoal } from "@krampa/common";
47
+ ### Invite Status
33
48
 
34
- if (isCardioGoal(goal.type)) {
35
- // Handle cardio-specific logic
36
- }
49
+ ```typescript
50
+ import { INVITE_STATUSES, INVITE_STATUS_VALUES, InviteStatus } from "@krampa/common";
51
+
52
+ // Use constants
53
+ const status = INVITE_STATUSES.ACCEPTED; // "ACCEPTED"
54
+
55
+ // Use in TypeScript types
56
+ const inviteStatus: InviteStatus = "PENDING";
57
+
58
+ // Use for database enum
59
+ const dbEnum = INVITE_STATUS_VALUES; // Array of all valid invite statuses
37
60
  ```
38
61
 
39
62
  ## Development
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krampa/common",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
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",