uom-types 2.0.0 → 3.0.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.
@@ -0,0 +1,370 @@
1
+ import { R as Radian, D as Degree, G as Gradian, T as Turn } from './_angle-plane.cjs';
2
+ import { S as Square, M as Metre, A as Are, H as Hectare, a as Second, b as Minute, c as Hour, D as Day, W as Week, Y as Year, J as Joule, d as WattMinute, e as WattHour, f as Hertz, P as PerMinute, g as PerHour, h as PerDay, i as PerWeek, j as PerYear, G as Gram, T as Tonne, C as Celsius, K as Kelvin, k as Cubic, L as Litre } from './_time-duration.cjs';
3
+ import { U as UnknownUnit, M as Multiply, k as UnitConversionRate, a as Unit } from './_index.cjs';
4
+
5
+ /**
6
+ * Convert {@link Radian} to {@link Degree}.
7
+ */
8
+ declare function radiansToDegrees(angle: Radian): Degree;
9
+ /**
10
+ * Convert {@link Radian} to {@link Gradian}.
11
+ */
12
+ declare function radiansToGradians(angle: Radian): Gradian;
13
+ /**
14
+ * Convert {@link Radian} to {@link Turn}.
15
+ */
16
+ declare function radiansToTurns(angle: Radian): Turn;
17
+ /**
18
+ * Convert {@link Degree} to {@link Radian}.
19
+ */
20
+ declare function degreesToRadians(angle: Degree): Radian;
21
+ /**
22
+ * Convert {@link Degree} to {@link Gradian}.
23
+ */
24
+ declare function degreesToGradians(angle: Degree): Gradian;
25
+ /**
26
+ * Convert {@link Degree} to {@link Turn}.
27
+ */
28
+ declare function degreesToTurns(angle: Degree): Turn;
29
+ /**
30
+ * Convert {@link Gradian} to {@link Radian}.
31
+ */
32
+ declare function gradiansToRadians(angle: Gradian): Radian;
33
+ /**
34
+ * Convert {@link Gradian} to {@link Degree}.
35
+ */
36
+ declare function gradiansToDegrees(angle: Gradian): Degree;
37
+ /**
38
+ * Convert {@link Gradian} to {@link Turn}.
39
+ */
40
+ declare function gradiansToTurns(angle: Gradian): Turn;
41
+ /**
42
+ * Convert {@link Turn} to {@link Radian}.
43
+ */
44
+ declare function turnsToRadians(angle: Turn): Radian;
45
+ /**
46
+ * Convert {@link Turn} to {@link Degree}.
47
+ */
48
+ declare function turnsToDegrees(angle: Turn): Degree;
49
+ /**
50
+ * Convert {@link Turn} to {@link Gradian}.
51
+ */
52
+ declare function turnsToGradians(angle: Turn): Gradian;
53
+
54
+ /**
55
+ * Convert {@link Square}<{@link Metre}> to {@link Are}.
56
+ */
57
+ declare function squareMetresToAres(area: Square<Metre>): Are;
58
+ /**
59
+ * Convert {@link Square}<{@link Metre}> to {@link Hectare}.
60
+ */
61
+ declare function squareMetresToHectares(area: Square<Metre>): Hectare;
62
+ /**
63
+ * Convert {@link Are} to {@link Square}<{@link Metre}>.
64
+ */
65
+ declare function aresToSquareMetres(area: Are): Square<Metre>;
66
+ /**
67
+ * Convert {@link Are} to {@link Hectare}.
68
+ */
69
+ declare function aresToHectares(area: Are): Hectare;
70
+ /**
71
+ * Convert {@link Hectare} to {@link Square}<{@link Metre}>.
72
+ */
73
+ declare function hectaresToSquareMetres(area: Hectare): Square<Metre>;
74
+ /**
75
+ * Convert {@link Hectare} to {@link Are}.
76
+ */
77
+ declare function hectaresToAres(area: Hectare): Are;
78
+
79
+ /**
80
+ * Convert {@link Second} to {@link Minute}.
81
+ */
82
+ declare function secondsToMinutes(duration: Second): Minute;
83
+ /**
84
+ * Convert {@link Second} to {@link Hour}.
85
+ */
86
+ declare function secondsToHours(duration: Second): Hour;
87
+ /**
88
+ * Convert {@link Minute} to {@link Second}.
89
+ */
90
+ declare function minutesToSeconds(duration: Minute): Second;
91
+ /**
92
+ * Convert {@link Minute} to {@link Hour}.
93
+ */
94
+ declare function minutesToHours(duration: Minute): Hour;
95
+ /**
96
+ * Convert {@link Hour} to {@link Second}.
97
+ */
98
+ declare function hoursToSeconds(duration: Hour): Second;
99
+ /**
100
+ * Convert {@link Hour} to {@link Minute}.
101
+ */
102
+ declare function hoursToMinutes(duration: Hour): Minute;
103
+ /**
104
+ * Convert {@link Hour} to {@link Day}.
105
+ */
106
+ declare function hoursToDays(duration: Hour): Day;
107
+ /**
108
+ * Convert {@link Day} to {@link Hour}.
109
+ */
110
+ declare function daysToHours(duration: Day): Hour;
111
+ /**
112
+ * Convert {@link Day} to {@link Week}.
113
+ */
114
+ declare function daysToWeeks(duration: Day): Week;
115
+ /**
116
+ * Convert {@link Day} to {@link Year}.
117
+ *
118
+ * This function assume that one year is equal to 365.25 Day.
119
+ * Use an actual date/time library if you need more control.
120
+ */
121
+ declare function daysToYears(duration: Day): Year;
122
+ /**
123
+ * Convert {@link Week} to {@link Day}.
124
+ */
125
+ declare function weeksToDays(duration: Week): Day;
126
+ /**
127
+ * Convert {@link Week} to {@link Year}.
128
+ */
129
+ declare function weeksToYears(duration: Week): Year;
130
+ /**
131
+ * Convert {@link Year} to {@link Day}.
132
+ *
133
+ * This function assume that one year is equal to 365.25 Day.
134
+ * Use an actual date/time library if you need more control.
135
+ */
136
+ declare function yearsToDays(duration: Year): Day;
137
+ /**
138
+ * Convert {@link Year} to {@link Week}.
139
+ */
140
+ declare function yearsToWeeks(duration: Year): Week;
141
+
142
+ /**
143
+ * Convert {@link Joule} to {@link WattMinute}.
144
+ */
145
+ declare function joulesToWattMinutes(energy: Joule): WattMinute;
146
+ /**
147
+ * Convert {@link Joule} to {@link WattHour}.
148
+ */
149
+ declare function joulesToWattHours(energy: Joule): WattHour;
150
+ /**
151
+ * Convert {@link WattMinute} to {@link Joule}.
152
+ */
153
+ declare function wattMinutesToJoules(energy: WattMinute): Joule;
154
+ /**
155
+ * Convert {@link WattHour} to {@link Joule}.
156
+ */
157
+ declare function wattHoursToJoules(energy: WattHour): Joule;
158
+
159
+ /**
160
+ * Convert {@link Hertz} to {@link PerMinute}.
161
+ */
162
+ declare function hertzToPerMinute(frequency: Hertz): PerMinute;
163
+ /**
164
+ * Convert {@link Hertz} to {@link PerHour}.
165
+ */
166
+ declare function hertzToPerHour(frequency: Hertz): PerHour;
167
+ /**
168
+ * Convert {@link PerMinute} to {@link Hertz}.
169
+ */
170
+ declare function perMinuteToHertz(frequency: PerMinute): Hertz;
171
+ /**
172
+ * Convert {@link PerMinute} to {@link PerHour}.
173
+ */
174
+ declare function perMinuteToPerHour(frequency: PerMinute): PerHour;
175
+ /**
176
+ * Convert {@link PerHour} to {@link Hertz}.
177
+ */
178
+ declare function perHourToHertz(frequency: PerHour): Hertz;
179
+ /**
180
+ * Convert {@link PerHour} to {@link PerMinute}.
181
+ */
182
+ declare function perHourToPerMinute(frequency: PerHour): PerMinute;
183
+ /**
184
+ * Convert {@link PerHour} to {@link PerDay}.
185
+ */
186
+ declare function perHourToPerDay(frequency: PerHour): PerDay;
187
+ /**
188
+ * Convert {@link PerDay} to {@link PerHour}.
189
+ */
190
+ declare function perDayToPerHour(frequency: PerDay): PerHour;
191
+ /**
192
+ * Convert {@link PerDay} to {@link PerWeek}.
193
+ */
194
+ declare function perDayToPerWeek(frequency: PerDay): PerWeek;
195
+ /**
196
+ * Convert {@link PerDay} to {@link PerYear}.
197
+ *
198
+ * This function assume that one year is equal to 365.25 Day.
199
+ * Use an actual date/time library if you need more control.
200
+ */
201
+ declare function perDayToPerYear(frequency: PerDay): PerYear;
202
+ /**
203
+ * Convert {@link PerWeek} to {@link PerDay}.
204
+ */
205
+ declare function perWeekToPerDay(frequency: PerWeek): PerDay;
206
+ /**
207
+ * Convert {@link PerWeek} to {@link PerYear}.
208
+ */
209
+ declare function perWeekToPerYear(frequency: PerWeek): PerYear;
210
+ /**
211
+ * Convert {@link PerYear} to {@link PerDay}.
212
+ *
213
+ * This function assume that one year is equal to 365.25 Day.
214
+ * Use an actual date/time library if you need more control.
215
+ */
216
+ declare function perYearToPerDay(frequency: PerYear): PerDay;
217
+ /**
218
+ * Convert {@link PerYear} to {@link PerWeek}.
219
+ */
220
+ declare function perYearToPerWeek(frequency: PerYear): PerWeek;
221
+
222
+ /**
223
+ * Convert {@link Gram} to {@link Tonne}.
224
+ */
225
+ declare function gramsToTonnes(mass: Gram): Tonne;
226
+ /**
227
+ * Convert {@link Tonne} to {@link Gram}.
228
+ */
229
+ declare function tonnesToGrams(mass: Tonne): Gram;
230
+
231
+ /**
232
+ * Convert `X` to `dekaX`.
233
+ */
234
+ declare function toDeka<T extends UnknownUnit>(value: T): Multiply<T, UnitConversionRate<{
235
+ scalar10: -1;
236
+ }>>;
237
+ /**
238
+ * Convert `dekaX` to `X`.
239
+ */
240
+ declare const fromDeka: typeof toDeci;
241
+ /**
242
+ * Convert `X` to `deciX`.
243
+ */
244
+ declare function toDeci<T extends UnknownUnit>(value: T): Multiply<T, Unit<{}, {
245
+ scalar10: 1;
246
+ }>>;
247
+ /**
248
+ * Convert `deciX` to `X`.
249
+ */
250
+ declare const fromDeci: typeof toDeka;
251
+ /**
252
+ * Convert `X` to `hectoX`.
253
+ */
254
+ declare function toHecto<T extends UnknownUnit>(value: T): Multiply<T, UnitConversionRate<{
255
+ scalar10: -2;
256
+ }>>;
257
+ /**
258
+ * Convert `hectoX` to `X`.
259
+ */
260
+ declare const fromHecto: typeof toCenti;
261
+ /**
262
+ * Convert `X` to `centiX`.
263
+ */
264
+ declare function toCenti<T extends UnknownUnit>(value: T): Multiply<T, Unit<{}, {
265
+ scalar10: 2;
266
+ }>>;
267
+ /**
268
+ * Convert `centiX` to `X`.
269
+ */
270
+ declare const fromCenti: typeof toHecto;
271
+ /**
272
+ * Convert `X` to `kiloX`.
273
+ */
274
+ declare function toKilo<T extends UnknownUnit>(value: T): Multiply<T, UnitConversionRate<{
275
+ scalar10: -3;
276
+ }>>;
277
+ /**
278
+ * Convert `kiloX` to `X`.
279
+ */
280
+ declare const fromKilo: typeof toMilli;
281
+ /**
282
+ * Convert `X` to `milliX`.
283
+ */
284
+ declare function toMilli<T extends UnknownUnit>(value: T): Multiply<T, Unit<{}, {
285
+ scalar10: 3;
286
+ }>>;
287
+ /**
288
+ * Convert `milliX` to `X`.
289
+ */
290
+ declare const fromMilli: typeof toKilo;
291
+ /**
292
+ * Convert `X` to `megaX`.
293
+ */
294
+ declare function toMega<T extends UnknownUnit>(value: T): Multiply<T, UnitConversionRate<{
295
+ scalar10: -6;
296
+ }>>;
297
+ /**
298
+ * Convert `megaX` to `X`.
299
+ */
300
+ declare const fromMega: typeof toMicro;
301
+ /**
302
+ * Convert `X` to `microX`.
303
+ */
304
+ declare function toMicro<T extends UnknownUnit>(value: T): Multiply<T, Unit<{}, {
305
+ scalar10: 6;
306
+ }>>;
307
+ /**
308
+ * Convert `microX` to `X`.
309
+ */
310
+ declare const fromMicro: typeof toMega;
311
+ /**
312
+ * Convert `X` to `gigaX`.
313
+ */
314
+ declare function toGiga<T extends UnknownUnit>(value: T): Multiply<T, UnitConversionRate<{
315
+ scalar10: -9;
316
+ }>>;
317
+ /**
318
+ * Convert `gigaX` to `X`.
319
+ */
320
+ declare const fromGiga: typeof toNano;
321
+ /**
322
+ * Convert `X` to `nanoX`.
323
+ */
324
+ declare function toNano<T extends UnknownUnit>(value: T): Multiply<T, Unit<{}, {
325
+ scalar10: 9;
326
+ }>>;
327
+ /**
328
+ * Convert `nanoX` to `X`.
329
+ */
330
+ declare const fromNano: typeof toGiga;
331
+ /**
332
+ * Convert `X` to `teraX`.
333
+ */
334
+ declare function toTera<T extends UnknownUnit>(value: T): Multiply<T, UnitConversionRate<{
335
+ scalar10: -12;
336
+ }>>;
337
+ /**
338
+ * Convert `teraX` to `X`.
339
+ */
340
+ declare const fromTera: typeof toPico;
341
+ /**
342
+ * Convert `X` to `picoX`.
343
+ */
344
+ declare function toPico<T extends UnknownUnit>(value: T): Multiply<T, Unit<{}, {
345
+ scalar10: 12;
346
+ }>>;
347
+ /**
348
+ * Convert `picoX` to `X`.
349
+ */
350
+ declare const fromPico: typeof toTera;
351
+
352
+ /**
353
+ * Convert {@link Celsius} to {@link Kelvin}.
354
+ */
355
+ declare function celsiusToKelvin(temperature: Celsius): Kelvin;
356
+ /**
357
+ * Convert {@link Kelvin} to {@link Celsius}.
358
+ */
359
+ declare function kelvinToCelsius(temperature: Kelvin): Celsius;
360
+
361
+ /**
362
+ * Convert {@link Cubic}<{@link Metre}> to {@link Litre}.
363
+ */
364
+ declare function cubicMetresToLitres(volume: Cubic<Metre>): Litre;
365
+ /**
366
+ * Convert {@link Litre} to {@link Cubic}<{@link Metre}>.
367
+ */
368
+ declare function litresToCubicMetres(volume: Litre): Cubic<Metre>;
369
+
370
+ export { aresToHectares, aresToSquareMetres, celsiusToKelvin, cubicMetresToLitres, daysToHours, daysToWeeks, daysToYears, degreesToGradians, degreesToRadians, degreesToTurns, fromCenti, fromDeci, fromDeka, fromGiga, fromHecto, fromKilo, fromMega, fromMicro, fromMilli, fromNano, fromPico, fromTera, gradiansToDegrees, gradiansToRadians, gradiansToTurns, gramsToTonnes, hectaresToAres, hectaresToSquareMetres, hertzToPerHour, hertzToPerMinute, hoursToDays, hoursToMinutes, hoursToSeconds, joulesToWattHours, joulesToWattMinutes, kelvinToCelsius, litresToCubicMetres, minutesToHours, minutesToSeconds, perDayToPerHour, perDayToPerWeek, perDayToPerYear, perHourToHertz, perHourToPerDay, perHourToPerMinute, perMinuteToHertz, perMinuteToPerHour, perWeekToPerDay, perWeekToPerYear, perYearToPerDay, perYearToPerWeek, radiansToDegrees, radiansToGradians, radiansToTurns, secondsToHours, secondsToMinutes, squareMetresToAres, squareMetresToHectares, toCenti, toDeci, toDeka, toGiga, toHecto, toKilo, toMega, toMicro, toMilli, toNano, toPico, toTera, tonnesToGrams, turnsToDegrees, turnsToGradians, turnsToRadians, wattHoursToJoules, wattMinutesToJoules, weeksToDays, weeksToYears, yearsToDays, yearsToWeeks };