@hedia/types 2.10.0 → 2.11.1

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.
@@ -4,18 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ActivityReductionIntervals = exports.ActivityIntensity = exports.ActivityEnum = void 0;
7
- /** Type that represents the user’s settings related to physical activity. */
8
- /** Represents a set of insulin reduction fraction settings that can vary by the duration of the activity. */
9
- /**
10
- * Represents whether the reduction fraction is a number or it is null.
11
- * Only for the settings of hard physical activities over 45 minutes the value is null.
12
- * A null value represents that it is not supported by HDA.
13
- */
14
7
  /** Enum that represents a set of insulin reduction fraction settings that can vary by the duration of the activity */
15
8
  let ActivityReductionIntervals = exports.ActivityReductionIntervals = /*#__PURE__*/function (ActivityReductionIntervals) {
16
9
  ActivityReductionIntervals["fromZero"] = "fromZero";
17
10
  ActivityReductionIntervals["fromThirty"] = "fromThirty";
18
11
  ActivityReductionIntervals["fromFortysix"] = "fromFortysix";
12
+ ActivityReductionIntervals["fromSixtyone"] = "fromSixtyone";
19
13
  return ActivityReductionIntervals;
20
14
  }({});
21
15
  /** Enum used to indicate the category or intensity of a physical activity. */
@@ -32,6 +26,15 @@ let ActivityEnum = exports.ActivityEnum = /*#__PURE__*/function (ActivityEnum) {
32
26
  ActivityEnum["Cycling"] = "Cycling";
33
27
  ActivityEnum["Swim"] = "Swim";
34
28
  ActivityEnum["Other"] = "Other";
29
+ ActivityEnum["Sport"] = "Sport";
30
+ ActivityEnum["Workout"] = "Workout";
35
31
  return ActivityEnum;
36
32
  }({});
33
+ /**
34
+ * Represents whether the reduction fraction is a number or it is null.
35
+ * For the settings of hard physical activities over 45 minutes the value is null.
36
+ * For physical activities over 60 minutes the value is also null
37
+ * A null value represents that it is not supported by HDA but users can still set it.
38
+ */
39
+ /** Type that represents the user’s settings related to physical activity. */
37
40
  //# sourceMappingURL=activity.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ActivityReductionIntervals","exports","ActivityIntensity","ActivityEnum"],"sourceRoot":"../../../src","sources":["activity/activity.ts"],"mappings":";;;;;;AAYA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAyBA;AAAA,IACYA,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAMtC;AAAA,IACYE,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAM7B;AAAA,IACYC,YAAY,GAAAF,OAAA,CAAAE,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["ActivityReductionIntervals","exports","ActivityIntensity","ActivityEnum"],"sourceRoot":"../../../src","sources":["activity/activity.ts"],"mappings":";;;;;;AAYA;AAAA,IACYA,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAOtC;AAAA,IACYE,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAM7B;AAAA,IACYC,YAAY,GAAAF,OAAA,CAAAE,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAUxB;AACA;AACA;AACA;AACA;AACA;AA+BA","ignoreList":[]}
@@ -9,37 +9,12 @@ export interface IActivityEntry {
9
9
  uuidOld?: IActivityEntry["uuid"];
10
10
  overwrittenByUUID?: IActivityEntry["uuid"];
11
11
  }
12
- /** Type that represents the user’s settings related to physical activity. */
13
- export type ActivitySettings = ActivityReductionSettings & ActivityTarget;
14
- /** Represents a set of insulin reduction fraction settings that can vary by the duration of the activity. */
15
- export type ActivityReductionIntervalsType = ActivityReductionSettings[keyof ActivityReductionSettings];
16
- /**
17
- * Represents whether the reduction fraction is a number or it is null.
18
- * Only for the settings of hard physical activities over 45 minutes the value is null.
19
- * A null value represents that it is not supported by HDA.
20
- */
21
- export type ReductionType = ActivityReductionIntervals[keyof ActivityReductionIntervals];
22
- type ActivityIntensityKeys = keyof typeof ActivityIntensity;
23
- type ActivityReductionKeys = keyof typeof ActivityReductionIntervals;
24
- type ActivityReductionSettings = ActivityPostReduction & {
25
- [key in ActivityIntensityKeys]: ActivityReductionSettingsIntervals<key, "hard", "fromFortysix">;
26
- };
27
- type ActivityPostReduction = {
28
- post: {
29
- [key in ActivityReductionKeys]: number;
30
- };
31
- };
32
- type ActivityTarget = {
33
- target: number;
34
- };
35
- type ActivityReductionSettingsIntervals<K extends ActivityIntensityKeys, T extends ActivityIntensityKeys, U extends ActivityReductionKeys> = {
36
- [key in ActivityReductionKeys]: K extends T ? (key extends U ? null | number : number) : number;
37
- };
38
12
  /** Enum that represents a set of insulin reduction fraction settings that can vary by the duration of the activity */
39
13
  export declare enum ActivityReductionIntervals {
40
14
  fromZero = "fromZero",
41
15
  fromThirty = "fromThirty",
42
- fromFortysix = "fromFortysix"
16
+ fromFortysix = "fromFortysix",
17
+ fromSixtyone = "fromSixtyone"
43
18
  }
44
19
  /** Enum used to indicate the category or intensity of a physical activity. */
45
20
  export declare enum ActivityIntensity {
@@ -53,7 +28,33 @@ export declare enum ActivityEnum {
53
28
  Walk = "Walk",
54
29
  Cycling = "Cycling",
55
30
  Swim = "Swim",
56
- Other = "Other"
31
+ Other = "Other",
32
+ Sport = "Sport",
33
+ Workout = "Workout"
57
34
  }
35
+ /**
36
+ * Represents whether the reduction fraction is a number or it is null.
37
+ * For the settings of hard physical activities over 45 minutes the value is null.
38
+ * For physical activities over 60 minutes the value is also null
39
+ * A null value represents that it is not supported by HDA but users can still set it.
40
+ */
41
+ type ReductionValue<Intensity extends ActivityIntensity, Interval extends ActivityReductionIntervals> = Interval extends ActivityReductionIntervals.fromSixtyone ? number | null : Intensity extends ActivityIntensity.hard ? Interval extends ActivityReductionIntervals.fromFortysix ? number | null : number : number;
42
+ type ActivityReductionMatrix = {
43
+ [I in ActivityIntensity]: {
44
+ [J in ActivityReductionIntervals]: ReductionValue<I, J>;
45
+ };
46
+ };
47
+ type PostReductionValue<Interval extends ActivityReductionIntervals> = Interval extends ActivityReductionIntervals.fromSixtyone ? number | null : number;
48
+ type ActivityPostReduction = {
49
+ post: {
50
+ [Interval in ActivityReductionIntervals]: PostReductionValue<Interval>;
51
+ };
52
+ };
53
+ type ActivityTarget = {
54
+ target: number;
55
+ };
56
+ type ActivityReductionSettings = ActivityPostReduction & ActivityReductionMatrix;
57
+ /** Type that represents the user’s settings related to physical activity. */
58
+ export type ActivitySettings = ActivityReductionSettings & ActivityTarget;
58
59
  export {};
59
60
  //# sourceMappingURL=activity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../src/activity/activity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,cAAc,CAA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AAEX,KAAK,uBAAuB,GAAG;KAC7B,CAAC,IAAI,iBAAiB,GAAG;SACxB,CAAC,IAAI,0BAA0B,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;KACvD;CACD,CAAC;AAEF,KAAK,kBAAkB,CAAC,QAAQ,SAAS,0BAA0B,IAClE,QAAQ,SAAS,0BAA0B,CAAC,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;AAEnF,KAAK,qBAAqB,GAAG;IAC5B,IAAI,EAAE;SAAG,QAAQ,IAAI,0BAA0B,GAAG,kBAAkB,CAAC,QAAQ,CAAC;KAAE,CAAC;CACjF,CAAC;AAEF,KAAK,cAAc,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,yBAAyB,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AAEjF,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,GAAG,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedia/types",
3
- "version": "2.10.0",
3
+ "version": "2.11.1",
4
4
  "description": "Enums, interfaces, and other common types for use in Hedia's software.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/index.d.ts",