@plus45/types 1.1.44 → 1.1.46

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/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "./types/exercise/exercise";
2
- import ExerciseType from "./types/exercise/exercise_types";
2
+ import { ExerciseType } from "./types/exercise/exercise_types";
3
3
  import { AccessToken } from "./types/user/access_token";
4
4
  import { User } from "./types/user/user";
5
5
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plus45/types",
3
- "version": "1.1.44",
3
+ "version": "1.1.46",
4
4
  "main": "index.ts",
5
5
  "types": "index.ts"
6
6
  }
@@ -1,3 +1,4 @@
1
- export enum AuthType {
2
- PASSWORD_CHANGE = "PASSWORD_CHANGE"
3
- }
1
+ export const AuthType = {
2
+ PASSWORD_CHANGE: "PASSWORD_CHANGE"
3
+ } as const;
4
+ export type AuthType = typeof AuthType[keyof typeof AuthType];
@@ -1,26 +1,27 @@
1
+
1
2
  /**
2
- * Enum for different types of exercises.
3
+ * Object for different types of exercises.
3
4
  */
4
- enum ExerciseType {
5
+ export const ExerciseType = {
5
6
  /**
6
7
  * Sets-Reps based exercise (e.g. 3x10)
7
8
  */
8
- STRENGTH = "STRENGTH",
9
+ STRENGTH: "STRENGTH",
9
10
 
10
11
  /**
11
12
  * Time based exercise (e.g. 3x30s)
12
13
  */
13
- TIME = "TIME",
14
+ TIME: "TIME",
14
15
 
15
16
  /**
16
17
  * Distance based exercise (e.g. 3x400m)
17
18
  */
18
- DISTANCE = "DISTANCE",
19
+ DISTANCE: "DISTANCE",
19
20
 
20
21
  /**
21
22
  * Custom exercise (uses string as data)
22
23
  */
23
- CUSTOM = "CUSTOM"
24
- }
24
+ CUSTOM: "CUSTOM"
25
+ } as const;
25
26
 
26
- export default ExerciseType;
27
+ export type ExerciseType = typeof ExerciseType[keyof typeof ExerciseType];
@@ -1,24 +1,23 @@
1
- export enum ExerciseUnit {
1
+ export const ExerciseUnit = {
2
2
  // Time
3
- seconds = "SECONDS",
4
- minutes = "MINUTES",
3
+ seconds: "SECONDS",
4
+ minutes: "MINUTES",
5
5
 
6
6
  // Weight
7
- pounds = "POUNDS",
8
- kilograms = "KILOGRAMS",
7
+ pounds: "POUNDS",
8
+ kilograms: "KILOGRAMS",
9
9
 
10
10
  // Distance
11
- miles = "MILES",
12
- kilometers = "KILOMETERS",
13
- yards = "YARDS",
14
- feet = "FEET",
15
- meters = "METERS"
16
- }
11
+ miles: "MILES",
12
+ kilometers: "KILOMETERS",
13
+ yards: "YARDS",
14
+ feet: "FEET",
15
+ meters: "METERS"
16
+ } as const;
17
+ export type ExerciseUnit = (typeof ExerciseUnit)[keyof typeof ExerciseUnit];
17
18
 
18
19
  export const WeightUnits = [ExerciseUnit.pounds, ExerciseUnit.kilograms];
19
-
20
20
  export const TimeUnits = [ExerciseUnit.seconds, ExerciseUnit.minutes];
21
-
22
21
  export const DistanceUnits = [
23
22
  ExerciseUnit.miles,
24
23
  ExerciseUnit.kilometers,
@@ -1,9 +1,10 @@
1
- export enum ScheduleDay {
2
- "SUNDAY" = 0,
3
- "MONDAY" = 1,
4
- "TUESDAY" = 2,
5
- "WEDNESDAY" = 3,
6
- "THURSDAY" = 4,
7
- "FRIDAY" = 5,
8
- "SATURDAY" = 6
9
- }
1
+ export const ScheduleDay = {
2
+ SUNDAY: 0,
3
+ MONDAY: 1,
4
+ TUESDAY: 2,
5
+ WEDNESDAY: 3,
6
+ THURSDAY: 4,
7
+ FRIDAY: 5,
8
+ SATURDAY: 6
9
+ } as const;
10
+ export type ScheduleDay = (typeof ScheduleDay)[keyof typeof ScheduleDay];
@@ -1,4 +1,6 @@
1
- export enum ScheduleRecurrence {
2
- Weekly = "WEEKLY",
3
- BIWEEKLY = "BIWEEKLY"
4
- }
1
+ export const ScheduleRecurrence = {
2
+ WEEKLY: "WEEKLY",
3
+ BIWEEKLY: "BIWEEKLY"
4
+ } as const;
5
+ export type ScheduleRecurrence =
6
+ (typeof ScheduleRecurrence)[keyof typeof ScheduleRecurrence];