@utiliread/primitives 1.0.0-144 → 1.0.0-146

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.
Files changed (121) hide show
  1. package/dist/csv.d.ts +3 -3
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs.map +1 -1
  4. package/package.json +1 -1
  5. package/src/aggregate-id.ts +9 -9
  6. package/src/breakdown-rule.spec.ts +61 -61
  7. package/src/breakdown-rule.ts +58 -58
  8. package/src/csv.spec.ts +42 -34
  9. package/src/csv.ts +9 -9
  10. package/src/cursor-navigation-state.spec.ts +194 -194
  11. package/src/cursor-navigation-state.ts +168 -168
  12. package/src/index.ts +61 -61
  13. package/src/measure-id.ts +17 -17
  14. package/src/measures/duration.ts +11 -11
  15. package/src/measures/energy.ts +13 -13
  16. package/src/measures/humidity.ts +3 -3
  17. package/src/measures/infocode.ts +3 -3
  18. package/src/measures/mass-flow.ts +19 -19
  19. package/src/measures/mass.ts +10 -10
  20. package/src/measures/noise.ts +5 -5
  21. package/src/measures/power.ts +23 -23
  22. package/src/measures/pressure.ts +9 -9
  23. package/src/measures/reactive-energy.ts +7 -7
  24. package/src/measures/reactive-power.ts +3 -3
  25. package/src/measures/temperature.ts +9 -9
  26. package/src/measures/time.ts +3 -3
  27. package/src/measures/volume-flow.ts +25 -25
  28. package/src/measures/volume.ts +3 -3
  29. package/src/medium.spec.ts +12 -12
  30. package/src/medium.ts +47 -47
  31. package/src/number-formatter.spec.ts +549 -549
  32. package/src/number-formatter.ts +118 -118
  33. package/src/optional.ts +1 -1
  34. package/src/precision-number.spec.ts +251 -251
  35. package/src/precision-number.ts +123 -123
  36. package/src/register-convention.spec.ts +52 -52
  37. package/src/register-convention.ts +70 -70
  38. package/src/register-definition.ts +23 -23
  39. package/src/register-id.ts +288 -288
  40. package/src/register-library.spec.ts +41 -41
  41. package/src/register-library.ts +64 -64
  42. package/src/register-pack.ts +5 -5
  43. package/src/register-utils.ts +6 -6
  44. package/src/registers/acoustic-noise.ts +52 -52
  45. package/src/registers/ambient-temperature.ts +52 -52
  46. package/src/registers/axioma-infocode.ts +16 -16
  47. package/src/registers/consumer.ts +17 -17
  48. package/src/registers/cooling-energy-inlet.ts +23 -23
  49. package/src/registers/cooling-energy-outlet.ts +23 -23
  50. package/src/registers/cooling-energy.ts +23 -23
  51. package/src/registers/cooling.ts +113 -113
  52. package/src/registers/device-addresses-kamdraft.ts +14 -14
  53. package/src/registers/device-addresses-msisdn.ts +14 -14
  54. package/src/registers/device-addresses-tchlr.ts +14 -14
  55. package/src/registers/device-addresses-wmbus.ts +17 -17
  56. package/src/registers/device-date-time.ts +9 -9
  57. package/src/registers/device-date.ts +9 -9
  58. package/src/registers/device-nominal-diameter.ts +9 -9
  59. package/src/registers/device-permanent-volume-flow.ts +9 -9
  60. package/src/registers/device-registers.ts +9 -9
  61. package/src/registers/device-samples.ts +37 -37
  62. package/src/registers/device-software-version.ts +8 -8
  63. package/src/registers/device-time.ts +9 -9
  64. package/src/registers/device.ts +16 -16
  65. package/src/registers/diehl-infocode.ts +44 -44
  66. package/src/registers/electrical-energy.ts +23 -23
  67. package/src/registers/energy-inlet.ts +23 -23
  68. package/src/registers/energy-outlet.ts +23 -23
  69. package/src/registers/error-operating-time.ts +23 -23
  70. package/src/registers/flow-temperature-aux.ts +52 -52
  71. package/src/registers/flow-temperature-inlet.ts +52 -52
  72. package/src/registers/flow-temperature-outlet.ts +52 -52
  73. package/src/registers/flow-temperature.ts +52 -52
  74. package/src/registers/heat-energy-inlet.ts +65 -65
  75. package/src/registers/heat-energy-outlet.ts +65 -65
  76. package/src/registers/heat-energy.ts +65 -65
  77. package/src/registers/index.ts +71 -71
  78. package/src/registers/infocode.ts +70 -70
  79. package/src/registers/kamstrup-module-type.ts +8 -8
  80. package/src/registers/kamstrup-multical-infocode.ts +58 -58
  81. package/src/registers/landis-gyr-infocode.ts +23 -23
  82. package/src/registers/landis-gyr-mbus-status.ts +23 -23
  83. package/src/registers/mass-flow-inlet.ts +52 -52
  84. package/src/registers/mass-flow-outlet.ts +52 -52
  85. package/src/registers/mass-flow.ts +52 -52
  86. package/src/registers/mass-inlet.ts +23 -23
  87. package/src/registers/mass-outlet.ts +23 -23
  88. package/src/registers/mass.ts +23 -23
  89. package/src/registers/mbus-format-string-signature.ts +8 -8
  90. package/src/registers/none.ts +8 -8
  91. package/src/registers/operating-time.ts +23 -23
  92. package/src/registers/place.ts +31 -31
  93. package/src/registers/power-inlet.ts +52 -52
  94. package/src/registers/power-outlet.ts +52 -52
  95. package/src/registers/power.ts +52 -52
  96. package/src/registers/pressure-inlet.ts +52 -52
  97. package/src/registers/pressure-outlet.ts +52 -52
  98. package/src/registers/pressure.ts +52 -52
  99. package/src/registers/radiator-temperature.ts +52 -52
  100. package/src/registers/reactive-energy.ts +23 -23
  101. package/src/registers/relative-humidity.ts +8 -8
  102. package/src/registers/remaining-battery-time.ts +23 -23
  103. package/src/registers/time-last-exact-overhearing-arrived.ts +19 -19
  104. package/src/registers/time-last-installation-mounted.ts +19 -19
  105. package/src/registers/time-last-possible-candidate-overhearing-arrived.ts +21 -21
  106. package/src/registers/time-last-sampled.ts +19 -19
  107. package/src/registers/time.ts +45 -45
  108. package/src/registers/volume-flow-inlet.ts +52 -52
  109. package/src/registers/volume-flow-outlet.ts +52 -52
  110. package/src/registers/volume-flow.ts +52 -52
  111. package/src/registers/volume-inlet.ts +23 -23
  112. package/src/registers/volume-outlet.ts +23 -23
  113. package/src/registers/volume-pulse-input-a.ts +23 -23
  114. package/src/registers/volume-pulse-input-b.ts +23 -23
  115. package/src/registers/volume.ts +23 -23
  116. package/src/repository.spec.ts +30 -30
  117. package/src/repository.ts +26 -26
  118. package/src/step.spec.ts +37 -37
  119. package/src/step.ts +45 -45
  120. package/src/time-or-rule.ts +42 -42
  121. package/src/unit-id.ts +108 -108
@@ -1,168 +1,168 @@
1
- interface CursorPage {
2
- items: unknown[];
3
- nextCursor: string | null;
4
- hasMore: boolean;
5
- totalCount?: number;
6
- }
7
-
8
- /**
9
- * Tracks client-side navigation state for cursor-based paging.
10
- *
11
- * The first page is represented by the empty-string cursor.
12
- * `futureCursor` is the server-provided cursor for the page after the current
13
- * one, while `cursors` keeps the visited cursor chain so the UI can move
14
- * backward without recomputing anything.
15
- */
16
- export class CursorNavigationState {
17
- /** Number of items requested per page. */
18
- readonly limit: number;
19
-
20
- /** Cursor for the currently displayed page. */
21
- currentCursor: string = "";
22
-
23
- /**
24
- * Cursor for the next page as reported by the server.
25
- *
26
- * `undefined` means the current page has not been loaded yet.
27
- * `null` means that all pages are exhausted.
28
- */
29
- futureCursor: string | null | undefined = undefined;
30
-
31
- /** Visited page cursor chain in navigation order. */
32
- private cursors: string[] = [];
33
- private pageItemCounts = new Map<string, number>();
34
-
35
- /** Total item count when the API provides it or when the last page is reached. */
36
- totalCount: number | null = null;
37
-
38
- /** One-based page number inferred from the visited cursor chain. */
39
- get pageNumber() {
40
- return this.cursors.indexOf(this.currentCursor) + 1;
41
- }
42
-
43
- /** Total number of pages computed from the total item count and page limit. */
44
- get pageCount() {
45
- return this.totalCount != null
46
- ? Math.ceil(this.totalCount / this.limit)
47
- : 0;
48
- }
49
-
50
- /** One-based index of the first item on the current page. */
51
- get firstItemNumber() {
52
- const index = this.cursors.indexOf(this.currentCursor);
53
- const currentPageItemCount =
54
- this.pageItemCounts.get(this.currentCursor) ?? 0;
55
- return index >= 0 && currentPageItemCount > 0
56
- ? this.cursors
57
- .slice(0, index)
58
- .reduce(
59
- (itemCount, cursor) =>
60
- itemCount + (this.pageItemCounts.get(cursor) ?? 0),
61
- 0,
62
- ) + 1
63
- : 0;
64
- }
65
-
66
- /** One-based index of the last item on the current page. */
67
- get lastItemNumber() {
68
- const currentPageItemCount =
69
- this.pageItemCounts.get(this.currentCursor) ?? 0;
70
- return currentPageItemCount > 0
71
- ? this.firstItemNumber + currentPageItemCount - 1
72
- : 0;
73
- }
74
-
75
- /**
76
- * Cursor for the next page, or the current page cursor if the current page is the last page.
77
- */
78
- get nextCursor() {
79
- const currentIndex = this.cursors.indexOf(this.currentCursor);
80
- return currentIndex >= 0 && currentIndex < this.cursors.length - 1
81
- ? this.cursors[currentIndex + 1]
82
- : (this.futureCursor ?? this.currentCursor);
83
- }
84
-
85
- /** Cursor for the previous page, or the first-page sentinel. */
86
- get previousCursor() {
87
- const currentIndex = this.cursors.indexOf(this.currentCursor);
88
- const previousCursor = this.cursors[currentIndex - 1] ?? "";
89
- return previousCursor;
90
- }
91
-
92
- /** Whether the current page is the first page. */
93
- get currentIsFirst() {
94
- return this.currentCursor === "";
95
- }
96
-
97
- /** Whether the current page is the last page. */
98
- get currentIsLast() {
99
- return (
100
- this.futureCursor === null &&
101
- (this.cursors.length === 0 ||
102
- this.cursors[this.cursors.length - 1] === this.currentCursor)
103
- );
104
- }
105
-
106
- constructor(options?: { limit?: number }) {
107
- this.limit = options?.limit ?? 20;
108
- }
109
-
110
- /**
111
- * Applies a fetched page to the navigation state.
112
- *
113
- * `cursor` is the request cursor that produced `page`.
114
- */
115
- visitPage(cursor: string, page: CursorPage) {
116
- // Determine if this page is the first in the navigation flow, and that it is the first time it it visited.
117
- const isInitialFirstPage = this.cursors.length === 0 && cursor === "";
118
- const isExpectedFuturePage =
119
- this.cursors.length > 0 && cursor === this.futureCursor;
120
-
121
- this.currentCursor = cursor;
122
-
123
- // Add the visited cursor to the chain only if it's the first or expected future page.
124
- if (isInitialFirstPage || isExpectedFuturePage) {
125
- this.cursors.push(cursor);
126
- }
127
-
128
- // Set or update the item count for the visited page.
129
- if (this.cursors.includes(cursor)) {
130
- this.pageItemCounts.set(cursor, page.items.length);
131
- }
132
-
133
- // Set or advance the future cursor if monotonically advancing.
134
- // Note that `futureCursor` is advanced even when `cursors.length === 0`.
135
- // This allows us to "start" with some intermediate cursor if the first page is not the initial page;
136
- // in that case we still track the `futureCursor` so that we can navigate forward - backward in this case is however not possible.
137
- if (
138
- this.futureCursor === undefined ||
139
- isInitialFirstPage ||
140
- cursor === this.futureCursor
141
- ) {
142
- this.futureCursor = page.nextCursor;
143
- }
144
-
145
- // Assign total count if provided
146
- if (page.totalCount != null) {
147
- this.totalCount = page.totalCount;
148
- } else if (
149
- (isInitialFirstPage || isExpectedFuturePage) &&
150
- !page.hasMore
151
- ) {
152
- this.totalCount = this.cursors.reduce(
153
- (itemCount, cursor) =>
154
- itemCount + (this.pageItemCounts.get(cursor) ?? 0),
155
- 0,
156
- );
157
- }
158
- }
159
-
160
- toString() {
161
- const hasItemNumbers = this.cursors.indexOf(this.currentCursor) >= 0;
162
- const range = hasItemNumbers
163
- ? `${this.firstItemNumber}-${this.lastItemNumber}`
164
- : "...";
165
- const total = this.totalCount ?? "?";
166
- return `${range} / ${total}`;
167
- }
168
- }
1
+ interface CursorPage {
2
+ items: unknown[];
3
+ nextCursor: string | null;
4
+ hasMore: boolean;
5
+ totalCount?: number;
6
+ }
7
+
8
+ /**
9
+ * Tracks client-side navigation state for cursor-based paging.
10
+ *
11
+ * The first page is represented by the empty-string cursor.
12
+ * `futureCursor` is the server-provided cursor for the page after the current
13
+ * one, while `cursors` keeps the visited cursor chain so the UI can move
14
+ * backward without recomputing anything.
15
+ */
16
+ export class CursorNavigationState {
17
+ /** Number of items requested per page. */
18
+ readonly limit: number;
19
+
20
+ /** Cursor for the currently displayed page. */
21
+ currentCursor: string = "";
22
+
23
+ /**
24
+ * Cursor for the next page as reported by the server.
25
+ *
26
+ * `undefined` means the current page has not been loaded yet.
27
+ * `null` means that all pages are exhausted.
28
+ */
29
+ futureCursor: string | null | undefined = undefined;
30
+
31
+ /** Visited page cursor chain in navigation order. */
32
+ private cursors: string[] = [];
33
+ private pageItemCounts = new Map<string, number>();
34
+
35
+ /** Total item count when the API provides it or when the last page is reached. */
36
+ totalCount: number | null = null;
37
+
38
+ /** One-based page number inferred from the visited cursor chain. */
39
+ get pageNumber() {
40
+ return this.cursors.indexOf(this.currentCursor) + 1;
41
+ }
42
+
43
+ /** Total number of pages computed from the total item count and page limit. */
44
+ get pageCount() {
45
+ return this.totalCount != null
46
+ ? Math.ceil(this.totalCount / this.limit)
47
+ : 0;
48
+ }
49
+
50
+ /** One-based index of the first item on the current page. */
51
+ get firstItemNumber() {
52
+ const index = this.cursors.indexOf(this.currentCursor);
53
+ const currentPageItemCount =
54
+ this.pageItemCounts.get(this.currentCursor) ?? 0;
55
+ return index >= 0 && currentPageItemCount > 0
56
+ ? this.cursors
57
+ .slice(0, index)
58
+ .reduce(
59
+ (itemCount, cursor) =>
60
+ itemCount + (this.pageItemCounts.get(cursor) ?? 0),
61
+ 0,
62
+ ) + 1
63
+ : 0;
64
+ }
65
+
66
+ /** One-based index of the last item on the current page. */
67
+ get lastItemNumber() {
68
+ const currentPageItemCount =
69
+ this.pageItemCounts.get(this.currentCursor) ?? 0;
70
+ return currentPageItemCount > 0
71
+ ? this.firstItemNumber + currentPageItemCount - 1
72
+ : 0;
73
+ }
74
+
75
+ /**
76
+ * Cursor for the next page, or the current page cursor if the current page is the last page.
77
+ */
78
+ get nextCursor() {
79
+ const currentIndex = this.cursors.indexOf(this.currentCursor);
80
+ return currentIndex >= 0 && currentIndex < this.cursors.length - 1
81
+ ? this.cursors[currentIndex + 1]
82
+ : (this.futureCursor ?? this.currentCursor);
83
+ }
84
+
85
+ /** Cursor for the previous page, or the first-page sentinel. */
86
+ get previousCursor() {
87
+ const currentIndex = this.cursors.indexOf(this.currentCursor);
88
+ const previousCursor = this.cursors[currentIndex - 1] ?? "";
89
+ return previousCursor;
90
+ }
91
+
92
+ /** Whether the current page is the first page. */
93
+ get currentIsFirst() {
94
+ return this.currentCursor === "";
95
+ }
96
+
97
+ /** Whether the current page is the last page. */
98
+ get currentIsLast() {
99
+ return (
100
+ this.futureCursor === null &&
101
+ (this.cursors.length === 0 ||
102
+ this.cursors[this.cursors.length - 1] === this.currentCursor)
103
+ );
104
+ }
105
+
106
+ constructor(options?: { limit?: number }) {
107
+ this.limit = options?.limit ?? 20;
108
+ }
109
+
110
+ /**
111
+ * Applies a fetched page to the navigation state.
112
+ *
113
+ * `cursor` is the request cursor that produced `page`.
114
+ */
115
+ visitPage(cursor: string, page: CursorPage) {
116
+ // Determine if this page is the first in the navigation flow, and that it is the first time it it visited.
117
+ const isInitialFirstPage = this.cursors.length === 0 && cursor === "";
118
+ const isExpectedFuturePage =
119
+ this.cursors.length > 0 && cursor === this.futureCursor;
120
+
121
+ this.currentCursor = cursor;
122
+
123
+ // Add the visited cursor to the chain only if it's the first or expected future page.
124
+ if (isInitialFirstPage || isExpectedFuturePage) {
125
+ this.cursors.push(cursor);
126
+ }
127
+
128
+ // Set or update the item count for the visited page.
129
+ if (this.cursors.includes(cursor)) {
130
+ this.pageItemCounts.set(cursor, page.items.length);
131
+ }
132
+
133
+ // Set or advance the future cursor if monotonically advancing.
134
+ // Note that `futureCursor` is advanced even when `cursors.length === 0`.
135
+ // This allows us to "start" with some intermediate cursor if the first page is not the initial page;
136
+ // in that case we still track the `futureCursor` so that we can navigate forward - backward in this case is however not possible.
137
+ if (
138
+ this.futureCursor === undefined ||
139
+ isInitialFirstPage ||
140
+ cursor === this.futureCursor
141
+ ) {
142
+ this.futureCursor = page.nextCursor;
143
+ }
144
+
145
+ // Assign total count if provided
146
+ if (page.totalCount != null) {
147
+ this.totalCount = page.totalCount;
148
+ } else if (
149
+ (isInitialFirstPage || isExpectedFuturePage) &&
150
+ !page.hasMore
151
+ ) {
152
+ this.totalCount = this.cursors.reduce(
153
+ (itemCount, cursor) =>
154
+ itemCount + (this.pageItemCounts.get(cursor) ?? 0),
155
+ 0,
156
+ );
157
+ }
158
+ }
159
+
160
+ toString() {
161
+ const hasItemNumbers = this.cursors.indexOf(this.currentCursor) >= 0;
162
+ const range = hasItemNumbers
163
+ ? `${this.firstItemNumber}-${this.lastItemNumber}`
164
+ : "...";
165
+ const total = this.totalCount ?? "?";
166
+ return `${range} / ${total}`;
167
+ }
168
+ }
package/src/index.ts CHANGED
@@ -1,61 +1,61 @@
1
- import * as Registers from "./registers";
2
-
3
- import type {
4
- Consumer,
5
- Device,
6
- DeviceSample,
7
- HeatMeterEvent,
8
- Infocode,
9
- KamdraftDeviceAddress,
10
- MsisdnDeviceAddress,
11
- Place,
12
- TchlrDeviceAddress,
13
- WMBusDeviceAddress,
14
- WaterMeterEvent,
15
- } from "./registers";
16
-
17
- import type { RegisterDefinition } from "./register-definition";
18
- import type { RegisterId } from "./register-id";
19
-
20
- export { DayOfWeek, Step } from "./step";
21
- export {
22
- NumberFormatter,
23
- invariantDecimalSeparator,
24
- localeDecimalSeparator,
25
- } from "./number-formatter";
26
-
27
- export type { AggregateId } from "./aggregate-id";
28
- export type { BreakdownPeriod } from "./breakdown-rule";
29
- export { BreakdownRule } from "./breakdown-rule";
30
- export { csv } from "./csv";
31
- export type { Csv } from "./csv";
32
- export type { MeasureId } from "./measure-id";
33
- export { Medium } from "./medium";
34
- export type { Optional } from "./optional";
35
- export { PrecisionNumber } from "./precision-number";
36
- export { RegisterConvention } from "./register-convention";
37
- export type { RegisterDefinition } from "./register-definition";
38
- export type { RegisterId } from "./register-id";
39
- export { RegisterLibrary } from "./register-library";
40
- export { Repository } from "./repository";
41
- export { TimeOrRule } from "./time-or-rule";
42
- export type { UnitId } from "./unit-id";
43
- export { CursorNavigationState } from "./cursor-navigation-state";
44
-
45
- export const registers: Record<RegisterId, RegisterDefinition> = Registers;
46
-
47
- export declare namespace SampleValue {
48
- export type {
49
- Consumer,
50
- Device,
51
- DeviceSample,
52
- HeatMeterEvent,
53
- Infocode,
54
- KamdraftDeviceAddress,
55
- MsisdnDeviceAddress,
56
- Place,
57
- TchlrDeviceAddress,
58
- WaterMeterEvent,
59
- WMBusDeviceAddress,
60
- };
61
- }
1
+ import * as Registers from "./registers";
2
+
3
+ import type {
4
+ Consumer,
5
+ Device,
6
+ DeviceSample,
7
+ HeatMeterEvent,
8
+ Infocode,
9
+ KamdraftDeviceAddress,
10
+ MsisdnDeviceAddress,
11
+ Place,
12
+ TchlrDeviceAddress,
13
+ WMBusDeviceAddress,
14
+ WaterMeterEvent,
15
+ } from "./registers";
16
+
17
+ import type { RegisterDefinition } from "./register-definition";
18
+ import type { RegisterId } from "./register-id";
19
+
20
+ export { DayOfWeek, Step } from "./step";
21
+ export {
22
+ NumberFormatter,
23
+ invariantDecimalSeparator,
24
+ localeDecimalSeparator,
25
+ } from "./number-formatter";
26
+
27
+ export type { AggregateId } from "./aggregate-id";
28
+ export type { BreakdownPeriod } from "./breakdown-rule";
29
+ export { BreakdownRule } from "./breakdown-rule";
30
+ export { csv } from "./csv";
31
+ export type { Csv } from "./csv";
32
+ export type { MeasureId } from "./measure-id";
33
+ export { Medium } from "./medium";
34
+ export type { Optional } from "./optional";
35
+ export { PrecisionNumber } from "./precision-number";
36
+ export { RegisterConvention } from "./register-convention";
37
+ export type { RegisterDefinition } from "./register-definition";
38
+ export type { RegisterId } from "./register-id";
39
+ export { RegisterLibrary } from "./register-library";
40
+ export { Repository } from "./repository";
41
+ export { TimeOrRule } from "./time-or-rule";
42
+ export type { UnitId } from "./unit-id";
43
+ export { CursorNavigationState } from "./cursor-navigation-state";
44
+
45
+ export const registers: Record<RegisterId, RegisterDefinition> = Registers;
46
+
47
+ export declare namespace SampleValue {
48
+ export type {
49
+ Consumer,
50
+ Device,
51
+ DeviceSample,
52
+ HeatMeterEvent,
53
+ Infocode,
54
+ KamdraftDeviceAddress,
55
+ MsisdnDeviceAddress,
56
+ Place,
57
+ TchlrDeviceAddress,
58
+ WaterMeterEvent,
59
+ WMBusDeviceAddress,
60
+ };
61
+ }
package/src/measure-id.ts CHANGED
@@ -1,17 +1,17 @@
1
- export type MeasureId =
2
- | "none"
3
- | "duration"
4
- | "energy"
5
- | "humidity"
6
- | "mass"
7
- | "massFlow"
8
- | "noise"
9
- | "power"
10
- | "pressure"
11
- | "reactiveEnergy"
12
- | "reactivePower"
13
- | "temperature"
14
- | "time"
15
- | "volume"
16
- | "volumeFlow"
17
- | "infocode";
1
+ export type MeasureId =
2
+ | "none"
3
+ | "duration"
4
+ | "energy"
5
+ | "humidity"
6
+ | "mass"
7
+ | "massFlow"
8
+ | "noise"
9
+ | "power"
10
+ | "pressure"
11
+ | "reactiveEnergy"
12
+ | "reactivePower"
13
+ | "temperature"
14
+ | "time"
15
+ | "volume"
16
+ | "volumeFlow"
17
+ | "infocode";
@@ -1,11 +1,11 @@
1
- import type { UnitId } from "../unit-id";
2
-
3
- export const units: ReadonlyArray<UnitId> = [
4
- "second",
5
- "minute",
6
- "hour",
7
- "day",
8
- "week",
9
- "month",
10
- "year",
11
- ];
1
+ import type { UnitId } from "../unit-id";
2
+
3
+ export const units: ReadonlyArray<UnitId> = [
4
+ "second",
5
+ "minute",
6
+ "hour",
7
+ "day",
8
+ "week",
9
+ "month",
10
+ "year",
11
+ ];
@@ -1,13 +1,13 @@
1
- import type { UnitId } from "../unit-id";
2
-
3
- export const units: ReadonlyArray<UnitId> = [
4
- "milliWattHour",
5
- "wattHour",
6
- "kiloWattHour",
7
- "megaWattHour",
8
- "gigaWattHour",
9
- "calorie",
10
- "kiloCalorie",
11
- "megaCalorie",
12
- "gigaCalorie",
13
- ];
1
+ import type { UnitId } from "../unit-id";
2
+
3
+ export const units: ReadonlyArray<UnitId> = [
4
+ "milliWattHour",
5
+ "wattHour",
6
+ "kiloWattHour",
7
+ "megaWattHour",
8
+ "gigaWattHour",
9
+ "calorie",
10
+ "kiloCalorie",
11
+ "megaCalorie",
12
+ "gigaCalorie",
13
+ ];
@@ -1,3 +1,3 @@
1
- import type { UnitId } from "../unit-id";
2
-
3
- export const units: ReadonlyArray<UnitId> = [];
1
+ import type { UnitId } from "../unit-id";
2
+
3
+ export const units: ReadonlyArray<UnitId> = [];
@@ -1,3 +1,3 @@
1
- import type { UnitId } from "../unit-id";
2
-
3
- export const units: ReadonlyArray<UnitId> = ["unitless", "json"];
1
+ import type { UnitId } from "../unit-id";
2
+
3
+ export const units: ReadonlyArray<UnitId> = ["unitless", "json"];
@@ -1,19 +1,19 @@
1
- import type { UnitId } from "../unit-id";
2
-
3
- export const units: ReadonlyArray<UnitId> = [
4
- "gramsPerSecond",
5
- "gramsPerMinute",
6
- "gramsPerHour",
7
- "kiloGramsPerSecond",
8
- "kiloGramsPerMinute",
9
- "kiloGramsPerHour",
10
- ];
11
-
12
- export const sqUnits: ReadonlyArray<UnitId> = [
13
- "gramsPerSecond2",
14
- "gramsPerMinute2",
15
- "gramsPerHour2",
16
- "kiloGramsPerSecond2",
17
- "kiloGramsPerMinute2",
18
- "kiloGramsPerHour2",
19
- ];
1
+ import type { UnitId } from "../unit-id";
2
+
3
+ export const units: ReadonlyArray<UnitId> = [
4
+ "gramsPerSecond",
5
+ "gramsPerMinute",
6
+ "gramsPerHour",
7
+ "kiloGramsPerSecond",
8
+ "kiloGramsPerMinute",
9
+ "kiloGramsPerHour",
10
+ ];
11
+
12
+ export const sqUnits: ReadonlyArray<UnitId> = [
13
+ "gramsPerSecond2",
14
+ "gramsPerMinute2",
15
+ "gramsPerHour2",
16
+ "kiloGramsPerSecond2",
17
+ "kiloGramsPerMinute2",
18
+ "kiloGramsPerHour2",
19
+ ];
@@ -1,10 +1,10 @@
1
- import type { UnitId } from "../unit-id";
2
-
3
- export const units: ReadonlyArray<UnitId> = [
4
- "gram",
5
- "kiloGram",
6
- "tonne",
7
- "ounce",
8
- "pound",
9
- "ton",
10
- ];
1
+ import type { UnitId } from "../unit-id";
2
+
3
+ export const units: ReadonlyArray<UnitId> = [
4
+ "gram",
5
+ "kiloGram",
6
+ "tonne",
7
+ "ounce",
8
+ "pound",
9
+ "ton",
10
+ ];
@@ -1,5 +1,5 @@
1
- import type { UnitId } from "../unit-id";
2
-
3
- export const units: ReadonlyArray<UnitId> = ["decibel"];
4
-
5
- export const sqUnits: ReadonlyArray<UnitId> = ["decibel2"];
1
+ import type { UnitId } from "../unit-id";
2
+
3
+ export const units: ReadonlyArray<UnitId> = ["decibel"];
4
+
5
+ export const sqUnits: ReadonlyArray<UnitId> = ["decibel2"];