@hedia/types 1.2.4 → 1.2.5
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/dist/index.d.ts +2 -2
- package/dist/index.js +14 -14
- package/dist/types/activity/activity.d.ts +42 -31
- package/dist/types/activity/activity.js +29 -22
- package/dist/types/activity/activity.js.map +1 -1
- package/dist/types/boluscalculator/boluscalculator.d.ts +42 -42
- package/dist/types/boluscalculator/boluscalculator.js +22 -22
- package/dist/types/enums.d.ts +417 -417
- package/dist/types/enums.js +434 -434
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +16 -16
- package/dist/types/userdetails/userdetails.d.ts +13 -13
- package/dist/types/userdetails/userdetails.js +2 -2
- package/dist/types/usersettings/usersettings.d.ts +99 -99
- package/dist/types/usersettings/usersettings.js +49 -49
- package/package.json +1 -1
- package/types/activity/activity.ts +20 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./types/enums";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./types/enums";
|
|
2
|
+
export * from "./types";
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./types/enums"), exports);
|
|
14
|
-
__exportStar(require("./types"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./types/enums"), exports);
|
|
14
|
+
__exportStar(require("./types"), exports);
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,31 +1,42 @@
|
|
|
1
|
-
export declare namespace Activity {
|
|
2
|
-
namespace Types {
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
enum
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
export declare namespace Activity {
|
|
2
|
+
namespace Types {
|
|
3
|
+
export type ActivitySettings = ActivityReductionSettings & ActivityTarget;
|
|
4
|
+
export type ActivityReductionIntervals = ActivityReductionSettings[keyof ActivityReductionSettings];
|
|
5
|
+
type ActivityIntensityKeys = keyof typeof Enums.ActivityIntensity;
|
|
6
|
+
type ActivityReductionKeys = keyof typeof Enums.ActivityReductionIntervals;
|
|
7
|
+
type ActivityReductionSettings = ActivityPostReduction & {
|
|
8
|
+
[key in ActivityIntensityKeys]: ActivityReductionSettingsIntervals<key, `hard`, `fromFortysix`>;
|
|
9
|
+
};
|
|
10
|
+
type ActivityPostReduction = {
|
|
11
|
+
post: {
|
|
12
|
+
[key in ActivityReductionKeys]: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
type ActivityTarget = {
|
|
16
|
+
target: number;
|
|
17
|
+
};
|
|
18
|
+
type ActivityReductionSettingsIntervals<K extends ActivityIntensityKeys, T extends ActivityIntensityKeys, U extends ActivityReductionKeys> = {
|
|
19
|
+
[key in ActivityReductionKeys]: K extends T ? (key extends U ? null | number : number) : number;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
22
|
+
}
|
|
23
|
+
namespace Enums {
|
|
24
|
+
enum ActivityReductionIntervals {
|
|
25
|
+
fromZero = "fromZero",
|
|
26
|
+
fromThirty = "fromThirty",
|
|
27
|
+
fromFortysix = "fromFortysix"
|
|
28
|
+
}
|
|
29
|
+
enum ActivityIntensity {
|
|
30
|
+
light = "light",
|
|
31
|
+
moderate = "moderate",
|
|
32
|
+
hard = "hard"
|
|
33
|
+
}
|
|
34
|
+
enum ActivityEnum {
|
|
35
|
+
Run = "Run",
|
|
36
|
+
Walk = "Walk",
|
|
37
|
+
Cycling = "Cycling",
|
|
38
|
+
Swim = "Swim",
|
|
39
|
+
Other = "Other"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Activity = void 0;
|
|
4
|
-
var Activity;
|
|
5
|
-
(function (Activity) {
|
|
6
|
-
let Enums;
|
|
7
|
-
(function (Enums) {
|
|
8
|
-
let ActivityReductionIntervals;
|
|
9
|
-
(function (ActivityReductionIntervals) {
|
|
10
|
-
ActivityReductionIntervals["fromZero"] = "fromZero";
|
|
11
|
-
ActivityReductionIntervals["fromThirty"] = "fromThirty";
|
|
12
|
-
ActivityReductionIntervals["fromFortysix"] = "fromFortysix";
|
|
13
|
-
})(ActivityReductionIntervals = Enums.ActivityReductionIntervals || (Enums.ActivityReductionIntervals = {}));
|
|
14
|
-
let ActivityIntensity;
|
|
15
|
-
(function (ActivityIntensity) {
|
|
16
|
-
ActivityIntensity["light"] = "light";
|
|
17
|
-
ActivityIntensity["moderate"] = "moderate";
|
|
18
|
-
ActivityIntensity["hard"] = "hard";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Activity = void 0;
|
|
4
|
+
var Activity;
|
|
5
|
+
(function (Activity) {
|
|
6
|
+
let Enums;
|
|
7
|
+
(function (Enums) {
|
|
8
|
+
let ActivityReductionIntervals;
|
|
9
|
+
(function (ActivityReductionIntervals) {
|
|
10
|
+
ActivityReductionIntervals["fromZero"] = "fromZero";
|
|
11
|
+
ActivityReductionIntervals["fromThirty"] = "fromThirty";
|
|
12
|
+
ActivityReductionIntervals["fromFortysix"] = "fromFortysix";
|
|
13
|
+
})(ActivityReductionIntervals = Enums.ActivityReductionIntervals || (Enums.ActivityReductionIntervals = {}));
|
|
14
|
+
let ActivityIntensity;
|
|
15
|
+
(function (ActivityIntensity) {
|
|
16
|
+
ActivityIntensity["light"] = "light";
|
|
17
|
+
ActivityIntensity["moderate"] = "moderate";
|
|
18
|
+
ActivityIntensity["hard"] = "hard";
|
|
19
|
+
})(ActivityIntensity = Enums.ActivityIntensity || (Enums.ActivityIntensity = {}));
|
|
20
|
+
let ActivityEnum;
|
|
21
|
+
(function (ActivityEnum) {
|
|
22
|
+
ActivityEnum["Run"] = "Run";
|
|
23
|
+
ActivityEnum["Walk"] = "Walk";
|
|
24
|
+
ActivityEnum["Cycling"] = "Cycling";
|
|
25
|
+
ActivityEnum["Swim"] = "Swim";
|
|
26
|
+
ActivityEnum["Other"] = "Other";
|
|
27
|
+
})(ActivityEnum = Enums.ActivityEnum || (Enums.ActivityEnum = {}));
|
|
28
|
+
})(Enums = Activity.Enums || (Activity.Enums = {}));
|
|
29
|
+
})(Activity = exports.Activity || (exports.Activity = {}));
|
|
23
30
|
//# sourceMappingURL=activity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../types/activity/activity.ts"],"names":[],"mappings":";;;AAAA,IAAiB,QAAQ,
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../types/activity/activity.ts"],"names":[],"mappings":";;;AAAA,IAAiB,QAAQ,CAkDxB;AAlDD,WAAiB,QAAQ;IA6BxB,IAAiB,KAAK,CAoBrB;IApBD,WAAiB,KAAK;QACrB,IAAY,0BAIX;QAJD,WAAY,0BAA0B;YACrC,mDAAqB,CAAA;YACrB,uDAAyB,CAAA;YACzB,2DAA6B,CAAA;QAC9B,CAAC,EAJW,0BAA0B,GAA1B,gCAA0B,KAA1B,gCAA0B,QAIrC;QAED,IAAY,iBAIX;QAJD,WAAY,iBAAiB;YAC5B,oCAAe,CAAA;YACf,0CAAqB,CAAA;YACrB,kCAAa,CAAA;QACd,CAAC,EAJW,iBAAiB,GAAjB,uBAAiB,KAAjB,uBAAiB,QAI5B;QAED,IAAY,YAMX;QAND,WAAY,YAAY;YACvB,2BAAW,CAAA;YACX,6BAAa,CAAA;YACb,mCAAmB,CAAA;YACnB,6BAAa,CAAA;YACb,+BAAe,CAAA;QAChB,CAAC,EANW,YAAY,GAAZ,kBAAY,KAAZ,kBAAY,QAMvB;IACF,CAAC,EApBgB,KAAK,GAAL,cAAK,KAAL,cAAK,QAoBrB;AACF,CAAC,EAlDgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAkDxB"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { Activity } from "../activity/activity";
|
|
2
|
-
export declare namespace BolusCalculator {
|
|
3
|
-
namespace Constants {
|
|
4
|
-
const SAFETY_INSULIN_LIMIT = 50;
|
|
5
|
-
const SAFETY_ACTIVITY_LIMIT = 60;
|
|
6
|
-
const REDUCTION_MAX = 1;
|
|
7
|
-
const REDUCTION_MIN = 0;
|
|
8
|
-
}
|
|
9
|
-
namespace Types {
|
|
10
|
-
interface IRecentBolus {
|
|
11
|
-
secondsPassed: number;
|
|
12
|
-
insulinDose: number;
|
|
13
|
-
}
|
|
14
|
-
enum ActivityErrors {
|
|
15
|
-
OutOfRange = "Out of range",
|
|
16
|
-
InvalidInterval = "Invalid activity settings interval",
|
|
17
|
-
InvalidReduction = "Invalid activity Reduction"
|
|
18
|
-
}
|
|
19
|
-
interface IActivityParams {
|
|
20
|
-
activityDuration: number;
|
|
21
|
-
activityIntensity: Activity.Enums.ActivityIntensity;
|
|
22
|
-
activitySettings: Activity.Types.ActivitySettings;
|
|
23
|
-
activityDate: Date;
|
|
24
|
-
}
|
|
25
|
-
interface IRecommendationParams {
|
|
26
|
-
currentBGL: number;
|
|
27
|
-
targetBGL: number;
|
|
28
|
-
insulinSensitivity: number;
|
|
29
|
-
carbohydrates: number;
|
|
30
|
-
carbohydrateRatio: number;
|
|
31
|
-
recentBoluses: Array<IRecentBolus>;
|
|
32
|
-
activity: IActivityParams | null;
|
|
33
|
-
}
|
|
34
|
-
interface IRecommendationResult {
|
|
35
|
-
bolus: number;
|
|
36
|
-
wasLimited: boolean;
|
|
37
|
-
carbRecommendation: number;
|
|
38
|
-
activityReduction: number | null;
|
|
39
|
-
activeInsulin: number;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
import { Activity } from "../activity/activity";
|
|
2
|
+
export declare namespace BolusCalculator {
|
|
3
|
+
namespace Constants {
|
|
4
|
+
const SAFETY_INSULIN_LIMIT = 50;
|
|
5
|
+
const SAFETY_ACTIVITY_LIMIT = 60;
|
|
6
|
+
const REDUCTION_MAX = 1;
|
|
7
|
+
const REDUCTION_MIN = 0;
|
|
8
|
+
}
|
|
9
|
+
namespace Types {
|
|
10
|
+
interface IRecentBolus {
|
|
11
|
+
secondsPassed: number;
|
|
12
|
+
insulinDose: number;
|
|
13
|
+
}
|
|
14
|
+
enum ActivityErrors {
|
|
15
|
+
OutOfRange = "Out of range",
|
|
16
|
+
InvalidInterval = "Invalid activity settings interval",
|
|
17
|
+
InvalidReduction = "Invalid activity Reduction"
|
|
18
|
+
}
|
|
19
|
+
interface IActivityParams {
|
|
20
|
+
activityDuration: number;
|
|
21
|
+
activityIntensity: Activity.Enums.ActivityIntensity;
|
|
22
|
+
activitySettings: Activity.Types.ActivitySettings;
|
|
23
|
+
activityDate: Date;
|
|
24
|
+
}
|
|
25
|
+
interface IRecommendationParams {
|
|
26
|
+
currentBGL: number;
|
|
27
|
+
targetBGL: number;
|
|
28
|
+
insulinSensitivity: number;
|
|
29
|
+
carbohydrates: number;
|
|
30
|
+
carbohydrateRatio: number;
|
|
31
|
+
recentBoluses: Array<IRecentBolus>;
|
|
32
|
+
activity: IActivityParams | null;
|
|
33
|
+
}
|
|
34
|
+
interface IRecommendationResult {
|
|
35
|
+
bolus: number;
|
|
36
|
+
wasLimited: boolean;
|
|
37
|
+
carbRecommendation: number;
|
|
38
|
+
activityReduction: number | null;
|
|
39
|
+
activeInsulin: number;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BolusCalculator = void 0;
|
|
4
|
-
var BolusCalculator;
|
|
5
|
-
(function (BolusCalculator) {
|
|
6
|
-
let Constants;
|
|
7
|
-
(function (Constants) {
|
|
8
|
-
Constants.SAFETY_INSULIN_LIMIT = 50;
|
|
9
|
-
Constants.SAFETY_ACTIVITY_LIMIT = 60;
|
|
10
|
-
Constants.REDUCTION_MAX = 1;
|
|
11
|
-
Constants.REDUCTION_MIN = 0;
|
|
12
|
-
})(Constants = BolusCalculator.Constants || (BolusCalculator.Constants = {}));
|
|
13
|
-
let Types;
|
|
14
|
-
(function (Types) {
|
|
15
|
-
let ActivityErrors;
|
|
16
|
-
(function (ActivityErrors) {
|
|
17
|
-
ActivityErrors["OutOfRange"] = "Out of range";
|
|
18
|
-
ActivityErrors["InvalidInterval"] = "Invalid activity settings interval";
|
|
19
|
-
ActivityErrors["InvalidReduction"] = "Invalid activity Reduction";
|
|
20
|
-
})(ActivityErrors = Types.ActivityErrors || (Types.ActivityErrors = {}));
|
|
21
|
-
})(Types = BolusCalculator.Types || (BolusCalculator.Types = {}));
|
|
22
|
-
})(BolusCalculator = exports.BolusCalculator || (exports.BolusCalculator = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BolusCalculator = void 0;
|
|
4
|
+
var BolusCalculator;
|
|
5
|
+
(function (BolusCalculator) {
|
|
6
|
+
let Constants;
|
|
7
|
+
(function (Constants) {
|
|
8
|
+
Constants.SAFETY_INSULIN_LIMIT = 50;
|
|
9
|
+
Constants.SAFETY_ACTIVITY_LIMIT = 60;
|
|
10
|
+
Constants.REDUCTION_MAX = 1;
|
|
11
|
+
Constants.REDUCTION_MIN = 0;
|
|
12
|
+
})(Constants = BolusCalculator.Constants || (BolusCalculator.Constants = {}));
|
|
13
|
+
let Types;
|
|
14
|
+
(function (Types) {
|
|
15
|
+
let ActivityErrors;
|
|
16
|
+
(function (ActivityErrors) {
|
|
17
|
+
ActivityErrors["OutOfRange"] = "Out of range";
|
|
18
|
+
ActivityErrors["InvalidInterval"] = "Invalid activity settings interval";
|
|
19
|
+
ActivityErrors["InvalidReduction"] = "Invalid activity Reduction";
|
|
20
|
+
})(ActivityErrors = Types.ActivityErrors || (Types.ActivityErrors = {}));
|
|
21
|
+
})(Types = BolusCalculator.Types || (BolusCalculator.Types = {}));
|
|
22
|
+
})(BolusCalculator = exports.BolusCalculator || (exports.BolusCalculator = {}));
|
|
23
23
|
//# sourceMappingURL=boluscalculator.js.map
|