@hedia/types 2.1.56 → 2.1.57-alpha.0

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.
@@ -1,5 +1,5 @@
1
1
  export declare namespace Cgm {
2
- namespace Enums {
2
+ export namespace Enums {
3
3
  enum Manufacturers {
4
4
  MENARINI = "menarini"
5
5
  }
@@ -7,14 +7,19 @@ export declare namespace Cgm {
7
7
  GLUCOMEN_DAY = "glucomen_day"
8
8
  }
9
9
  }
10
- namespace Types {
11
- interface ICgmReading {
10
+ interface IManufacturersToModels extends Record<Enums.Manufacturers, Enums.Models> {
11
+ [Enums.Manufacturers.MENARINI]: Enums.Models.GLUCOMEN_DAY;
12
+ }
13
+ export namespace Types {
14
+ interface ICgmReading<T extends Enums.Manufacturers> {
12
15
  userId: number;
13
16
  timestamp: Date;
14
17
  retrievalTimestamp: Date;
15
- glucoseValueMillimolar: number;
16
- manufacturer: Enums.Manufacturers;
17
- model: Enums.Models;
18
+ glucoseMmol: number;
19
+ manufacturer: T;
20
+ model: IManufacturersToModels[T];
21
+ version?: string;
18
22
  }
19
23
  }
24
+ export {};
20
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cgm.js","sourceRoot":"","sources":["../../../types/cgm/cgm.ts"],"names":[],"mappings":";;;AAAA,IAAiB,GAAG,CAqBnB;AArBD,WAAiB,GAAG;IACnB,IAAiB,KAAK,CAQrB;IARD,WAAiB,KAAK;QACrB,IAAY,aAEX;QAFD,WAAY,aAAa;YACxB,sCAAqB,CAAA;QACtB,CAAC,EAFW,aAAa,GAAb,mBAAa,KAAb,mBAAa,QAExB;QAED,IAAY,MAEX;QAFD,WAAY,MAAM;YACjB,uCAA6B,CAAA;QAC9B,CAAC,EAFW,MAAM,GAAN,YAAM,KAAN,YAAM,QAEjB;IACF,CAAC,EARgB,KAAK,GAAL,SAAK,KAAL,SAAK,QAQrB;AAYF,CAAC,EArBgB,GAAG,GAAH,WAAG,KAAH,WAAG,QAqBnB"}
1
+ {"version":3,"file":"cgm.js","sourceRoot":"","sources":["../../../types/cgm/cgm.ts"],"names":[],"mappings":";;;AAAA,IAAiB,GAAG,CA0BnB;AA1BD,WAAiB,GAAG;IACnB,IAAiB,KAAK,CAQrB;IARD,WAAiB,KAAK;QACrB,IAAY,aAEX;QAFD,WAAY,aAAa;YACxB,sCAAqB,CAAA;QACtB,CAAC,EAFW,aAAa,GAAb,mBAAa,KAAb,mBAAa,QAExB;QAED,IAAY,MAEX;QAFD,WAAY,MAAM;YACjB,uCAA6B,CAAA;QAC9B,CAAC,EAFW,MAAM,GAAN,YAAM,KAAN,YAAM,QAEjB;IACF,CAAC,EARgB,KAAK,GAAL,SAAK,KAAL,SAAK,QAQrB;AAiBF,CAAC,EA1BgB,GAAG,GAAH,WAAG,KAAH,WAAG,QA0BnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedia/types",
3
- "version": "2.1.56",
3
+ "version": "2.1.57-alpha.0",
4
4
  "description": "Enums, interfaces, and other common types for use in Hedia's software.",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
package/types/cgm/cgm.ts CHANGED
@@ -9,14 +9,19 @@ export namespace Cgm {
9
9
  }
10
10
  }
11
11
 
12
+ interface IManufacturersToModels extends Record<Enums.Manufacturers, Enums.Models> {
13
+ [Enums.Manufacturers.MENARINI]: Enums.Models.GLUCOMEN_DAY;
14
+ }
15
+
12
16
  export namespace Types {
13
- export interface ICgmReading {
17
+ export interface ICgmReading<T extends Enums.Manufacturers> {
14
18
  userId: number;
15
19
  timestamp: Date;
16
20
  retrievalTimestamp: Date;
17
- glucoseValueMillimolar: number;
18
- manufacturer: Enums.Manufacturers;
19
- model: Enums.Models;
21
+ glucoseMmol: number;
22
+ manufacturer: T;
23
+ model: IManufacturersToModels[T];
24
+ version?: string;
20
25
  }
21
26
  }
22
27
  }