@krampa/common 0.3.1 → 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.
- package/README.md +29 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- 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.
|
|
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
|
-
|
|
32
|
-
import { isCardioGoal, isWeightGoal } from "@krampa/common";
|
|
47
|
+
### Invite Status
|
|
33
48
|
|
|
34
|
-
|
|
35
|
-
|
|
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/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -19,3 +19,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
__exportStar(require("./goal-types"), exports);
|
|
22
|
+
__exportStar(require("./invite-status"), exports);
|
|
23
|
+
__exportStar(require("./challenge-status"), exports);
|