@hedia/types 1.1.1 → 1.1.2
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 +3 -3
- package/dist/index.js +15 -15
- package/dist/types/enums.d.ts +450 -450
- package/dist/types/enums.js +468 -468
- package/dist/types/measurements.d.ts +8 -8
- package/dist/types/measurements.js +18 -18
- package/dist/types/types.d.ts +79 -76
- package/dist/types/types.js +2 -2
- package/package.json +1 -1
- package/types/types.ts +12 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare enum BloodGlucoseUnit {
|
|
2
|
-
MMOL_L = "mmol/l",
|
|
3
|
-
MG_DL = "mg/dl"
|
|
4
|
-
}
|
|
5
|
-
export declare enum BloodKetonesUnit {
|
|
6
|
-
MMOL_L = "mmol/l",
|
|
7
|
-
MG_DL = "mg/dl"
|
|
8
|
-
}
|
|
1
|
+
export declare enum BloodGlucoseUnit {
|
|
2
|
+
MMOL_L = "mmol/l",
|
|
3
|
+
MG_DL = "mg/dl"
|
|
4
|
+
}
|
|
5
|
+
export declare enum BloodKetonesUnit {
|
|
6
|
+
MMOL_L = "mmol/l",
|
|
7
|
+
MG_DL = "mg/dl"
|
|
8
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BloodKetonesUnit = exports.BloodGlucoseUnit = void 0;
|
|
4
|
-
var Units;
|
|
5
|
-
(function (Units) {
|
|
6
|
-
Units["MMOL_L"] = "mmol/l";
|
|
7
|
-
Units["MG_DL"] = "mg/dl";
|
|
8
|
-
})(Units || (Units = {}));
|
|
9
|
-
var BloodGlucoseUnit;
|
|
10
|
-
(function (BloodGlucoseUnit) {
|
|
11
|
-
BloodGlucoseUnit["MMOL_L"] = "mmol/l";
|
|
12
|
-
BloodGlucoseUnit["MG_DL"] = "mg/dl";
|
|
13
|
-
})(BloodGlucoseUnit = exports.BloodGlucoseUnit || (exports.BloodGlucoseUnit = {}));
|
|
14
|
-
var BloodKetonesUnit;
|
|
15
|
-
(function (BloodKetonesUnit) {
|
|
16
|
-
BloodKetonesUnit["MMOL_L"] = "mmol/l";
|
|
17
|
-
BloodKetonesUnit["MG_DL"] = "mg/dl";
|
|
18
|
-
})(BloodKetonesUnit = exports.BloodKetonesUnit || (exports.BloodKetonesUnit = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BloodKetonesUnit = exports.BloodGlucoseUnit = void 0;
|
|
4
|
+
var Units;
|
|
5
|
+
(function (Units) {
|
|
6
|
+
Units["MMOL_L"] = "mmol/l";
|
|
7
|
+
Units["MG_DL"] = "mg/dl";
|
|
8
|
+
})(Units || (Units = {}));
|
|
9
|
+
var BloodGlucoseUnit;
|
|
10
|
+
(function (BloodGlucoseUnit) {
|
|
11
|
+
BloodGlucoseUnit["MMOL_L"] = "mmol/l";
|
|
12
|
+
BloodGlucoseUnit["MG_DL"] = "mg/dl";
|
|
13
|
+
})(BloodGlucoseUnit = exports.BloodGlucoseUnit || (exports.BloodGlucoseUnit = {}));
|
|
14
|
+
var BloodKetonesUnit;
|
|
15
|
+
(function (BloodKetonesUnit) {
|
|
16
|
+
BloodKetonesUnit["MMOL_L"] = "mmol/l";
|
|
17
|
+
BloodKetonesUnit["MG_DL"] = "mg/dl";
|
|
18
|
+
})(BloodKetonesUnit = exports.BloodKetonesUnit || (exports.BloodKetonesUnit = {}));
|
|
19
19
|
//# sourceMappingURL=measurements.js.map
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,76 +1,79 @@
|
|
|
1
|
-
import { DiabetesType, InjectionMethod, Gender, Usage, ActivityReduction, ActivityReductionIntervals, Languages } from "./enums";
|
|
2
|
-
import { BloodGlucoseUnit, BloodKetonesUnit } from "./measurements";
|
|
3
|
-
export interface IUserSettings {
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
diabetesType?: DiabetesType;
|
|
6
|
-
insulinDependent?: boolean;
|
|
7
|
-
gender?: Gender;
|
|
8
|
-
height?: number;
|
|
9
|
-
email?: string;
|
|
10
|
-
weight?: number;
|
|
11
|
-
birthday?: string;
|
|
12
|
-
treatmentType?: InjectionMethod;
|
|
13
|
-
bloodGlucoseUnits?: BloodGlucoseUnit;
|
|
14
|
-
bloodKetonesUnit?: BloodKetonesUnit;
|
|
15
|
-
parameters?: IParameters;
|
|
16
|
-
glucoseLevelTargets?: IBGLTargets;
|
|
17
|
-
fastActingInsulin?: string | null;
|
|
18
|
-
longActingInsulin?: string | null;
|
|
19
|
-
uuidOld?: string;
|
|
20
|
-
uuid?: string;
|
|
21
|
-
created?: string;
|
|
22
|
-
activity?: ActivitySettings;
|
|
23
|
-
notifications?: IUSerSettingsNotifications;
|
|
24
|
-
}
|
|
25
|
-
export declare type ActivitySettings = ActivityReductionSettings & {
|
|
26
|
-
target: number;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
1
|
+
import { DiabetesType, InjectionMethod, Gender, Usage, ActivityReduction, ActivityReductionIntervals, Languages } from "./enums";
|
|
2
|
+
import { BloodGlucoseUnit, BloodKetonesUnit } from "./measurements";
|
|
3
|
+
export interface IUserSettings {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
diabetesType?: DiabetesType;
|
|
6
|
+
insulinDependent?: boolean;
|
|
7
|
+
gender?: Gender;
|
|
8
|
+
height?: number;
|
|
9
|
+
email?: string;
|
|
10
|
+
weight?: number;
|
|
11
|
+
birthday?: string;
|
|
12
|
+
treatmentType?: InjectionMethod;
|
|
13
|
+
bloodGlucoseUnits?: BloodGlucoseUnit;
|
|
14
|
+
bloodKetonesUnit?: BloodKetonesUnit;
|
|
15
|
+
parameters?: IParameters;
|
|
16
|
+
glucoseLevelTargets?: IBGLTargets;
|
|
17
|
+
fastActingInsulin?: string | null;
|
|
18
|
+
longActingInsulin?: string | null;
|
|
19
|
+
uuidOld?: string;
|
|
20
|
+
uuid?: string;
|
|
21
|
+
created?: string;
|
|
22
|
+
activity?: ActivitySettings;
|
|
23
|
+
notifications?: IUSerSettingsNotifications;
|
|
24
|
+
}
|
|
25
|
+
export declare type ActivitySettings = ActivityReductionSettings & {
|
|
26
|
+
target: number;
|
|
27
|
+
};
|
|
28
|
+
declare type ActivityReductionKey = keyof typeof ActivityReduction;
|
|
29
|
+
declare type ActivityReductionIntervalsKey = keyof typeof ActivityReductionIntervals;
|
|
30
|
+
export declare type ActivityReductionSettings = {
|
|
31
|
+
[key in ActivityReductionKey]: ActivityReductionIntervalSettings<key, "hard", "fromFortysix">;
|
|
32
|
+
};
|
|
33
|
+
export declare type ActivityReductionIntervalSettings<K extends ActivityReductionKey, T extends ActivityReductionKey, U extends ActivityReductionIntervalsKey> = {
|
|
34
|
+
[key in ActivityReductionIntervalsKey]: K extends T ? (key extends U ? null | number : number) : number;
|
|
35
|
+
};
|
|
36
|
+
export interface IUSerSettingsNotifications {
|
|
37
|
+
medicineNotification: IMedicineNotification;
|
|
38
|
+
remeasurementNotification: IRemeasurementNotification;
|
|
39
|
+
}
|
|
40
|
+
export interface INotifications {
|
|
41
|
+
toggle: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface IMedicineNotification extends INotifications {
|
|
44
|
+
dailyReminderTime: string;
|
|
45
|
+
}
|
|
46
|
+
export interface IRemeasurementNotification extends INotifications {
|
|
47
|
+
remeasurement: number;
|
|
48
|
+
}
|
|
49
|
+
export interface IUserDetails {
|
|
50
|
+
name?: string;
|
|
51
|
+
email?: string;
|
|
52
|
+
research_consent?: Date | boolean;
|
|
53
|
+
newsletter_consent?: Date | boolean;
|
|
54
|
+
country?: string;
|
|
55
|
+
language?: keyof typeof Languages;
|
|
56
|
+
}
|
|
57
|
+
export interface IInterval {
|
|
58
|
+
startTime?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface IParameters {
|
|
61
|
+
parameterIntervals: Array<IParameterInterval>;
|
|
62
|
+
overallParameters: IParameterInterval;
|
|
63
|
+
use?: Usage;
|
|
64
|
+
}
|
|
65
|
+
export interface IParameterInterval extends IInterval {
|
|
66
|
+
insulinSensitivity?: number;
|
|
67
|
+
carbohydrateRatio?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface IBGLTargets {
|
|
70
|
+
targetBGLIntervals?: Array<IBGLInterval>;
|
|
71
|
+
overallTargetBGL?: IBGLInterval;
|
|
72
|
+
use?: Usage;
|
|
73
|
+
}
|
|
74
|
+
export interface IBGLInterval extends IInterval {
|
|
75
|
+
low: number;
|
|
76
|
+
target: number;
|
|
77
|
+
high: number;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
package/dist/types/types.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=types.js.map
|
package/package.json
CHANGED
package/types/types.ts
CHANGED
|
@@ -33,11 +33,20 @@ export interface IUserSettings {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export type ActivitySettings = ActivityReductionSettings & { target: number };
|
|
36
|
+
|
|
37
|
+
type ActivityReductionKey = keyof typeof ActivityReduction;
|
|
38
|
+
type ActivityReductionIntervalsKey = keyof typeof ActivityReductionIntervals;
|
|
39
|
+
|
|
36
40
|
export type ActivityReductionSettings = {
|
|
37
|
-
|
|
41
|
+
// support for nulling multiple keys, with "hard" | "light" and variants with "fromFortysix" | "fromThirty"
|
|
42
|
+
[key in ActivityReductionKey]: ActivityReductionIntervalSettings<key, "hard", "fromFortysix">;
|
|
38
43
|
};
|
|
39
|
-
export type ActivityReductionIntervalSettings
|
|
40
|
-
|
|
44
|
+
export type ActivityReductionIntervalSettings<
|
|
45
|
+
K extends ActivityReductionKey,
|
|
46
|
+
T extends ActivityReductionKey,
|
|
47
|
+
U extends ActivityReductionIntervalsKey
|
|
48
|
+
> = {
|
|
49
|
+
[key in ActivityReductionIntervalsKey]: K extends T ? (key extends U ? null | number : number) : number;
|
|
41
50
|
};
|
|
42
51
|
|
|
43
52
|
export interface IUSerSettingsNotifications {
|