uom-types 3.0.1 → 3.1.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,4 +1,4 @@
1
- import { E as Exactify, i as UnitClass, j as Exponent, d as AbstractUnitFrom, e as UnitSubvalues, f as UnitMeta, g as UnknownUnitMeta, h as UnitFrom } from './_index.cjs';
1
+ import { w as Exactify, b as UnitClass, E as Exponent, a as AbstractUnitFrom, g as UnitSubvalues, f as UnitMeta, k as UnknownUnitMeta, e as UnitFrom } from './_units.cjs';
2
2
 
3
3
  type SiUnitKeys = "Second" | "Metre" | "Kilogram" | "Mole" | "Ampere" | "Candela" | "Kelvin" | "Radian";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { E as Exactify, i as UnitClass, j as Exponent, d as AbstractUnitFrom, e as UnitSubvalues, f as UnitMeta, g as UnknownUnitMeta, h as UnitFrom } from './_index.mjs';
1
+ import { w as Exactify, b as UnitClass, E as Exponent, a as AbstractUnitFrom, g as UnitSubvalues, f as UnitMeta, k as UnknownUnitMeta, e as UnitFrom } from './_units.mjs';
2
2
 
3
3
  type SiUnitKeys = "Second" | "Metre" | "Kilogram" | "Mole" | "Ampere" | "Candela" | "Kelvin" | "Radian";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { d as AbstractUnitFrom, e as UnitSubvalues, f as UnitMeta, g as UnknownUnitMeta, h as UnitFrom } from './_index.cjs';
1
+ import { a as AbstractUnitFrom, g as UnitSubvalues, f as UnitMeta, k as UnknownUnitMeta, e as UnitFrom } from './_units.cjs';
2
2
  import { B as BaseUnitClass } from './_angle-plane.cjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { d as AbstractUnitFrom, e as UnitSubvalues, f as UnitMeta, g as UnknownUnitMeta, h as UnitFrom } from './_index.mjs';
1
+ import { a as AbstractUnitFrom, g as UnitSubvalues, f as UnitMeta, k as UnknownUnitMeta, e as UnitFrom } from './_units.mjs';
2
2
  import { B as BaseUnitClass } from './_angle-plane.mjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { b as UnknownAbstractUnit, U as UnknownUnit, l as MultiplyUnitExponents, I as Inverse, m as UnknownUnitClass, i as UnitClass, n as InverseUnitSubvalues, e as UnitSubvalues, f as UnitMeta, g as UnknownUnitMeta, h as UnitFrom, d as AbstractUnitFrom } from './_index.cjs';
1
+ import { h as UnknownAbstractUnit, i as UnknownUnit, P as Pow, I as Inverse, j as UnknownUnitClass, b as UnitClass, r as InverseUnitSubvalues, g as UnitSubvalues, f as UnitMeta, k as UnknownUnitMeta, e as UnitFrom, a as AbstractUnitFrom } from './_units.cjs';
2
2
  import { B as BaseUnitClass } from './_angle-plane.cjs';
3
3
 
4
4
  /**
@@ -6,19 +6,19 @@ import { B as BaseUnitClass } from './_angle-plane.cjs';
6
6
  *
7
7
  * @group Modifiers
8
8
  * @category General
9
- * @see {@link MultiplyUnitExponents}
9
+ * @see {@link Pow}
10
10
  * @see {@link Cubic}
11
11
  */
12
- type Square<T extends UnknownAbstractUnit | UnknownUnit> = MultiplyUnitExponents<T, 2>;
12
+ type Square<T extends UnknownAbstractUnit | UnknownUnit> = Pow<T, 2>;
13
13
  /**
14
14
  * Put the given {@link Unit} to the power of 3.
15
15
  *
16
16
  * @group Modifiers
17
17
  * @category General
18
- * @see {@link MultiplyUnitExponents}
18
+ * @see {@link Pow}
19
19
  * @see {@link Square}
20
20
  */
21
- type Cubic<T extends UnknownAbstractUnit | UnknownUnit> = MultiplyUnitExponents<T, 3>;
21
+ type Cubic<T extends UnknownAbstractUnit | UnknownUnit> = Pow<T, 3>;
22
22
 
23
23
  /**
24
24
  * Invert the {@link Unit}.
@@ -479,4 +479,4 @@ type Year = DurationUnit<{
479
479
  scalarDayInYear: 1;
480
480
  }>;
481
481
 
482
- export { VolumeUnit as $, Are as A, LengthUnitClass as B, Celsius as C, Day as D, EnergyUnitClass as E, FrequencyUnitClass as F, Gram as G, Hectare as H, Length as I, Joule as J, Kelvin as K, Litre as L, Metre as M, LengthUnit as N, LengthUnitFrom as O, PerMinute as P, MassUnitClass as Q, ReciprocalUnitClass as R, Square as S, Tonne as T, Mass as U, MassUnit as V, Week as W, MassUnitFrom as X, Year as Y, VolumeUnitClass as Z, Volume as _, Second as a, VolumeUnitFrom as a0, TemperatureUnit as a1, TemperatureUnitFrom as a2, DurationUnitClass as a3, Duration as a4, DurationUnit as a5, DurationUnitFrom as a6, Minute as b, Hour as c, WattMinute as d, WattHour as e, Hertz as f, PerHour as g, PerDay as h, PerWeek as i, PerYear as j, Cubic as k, Reciprocal as l, Energy as m, EnergyUnit as n, EnergyUnitFrom as o, TemperatureUnitClass as p, Temperature as q, Frequency as r, FrequencyUnit as s, FrequencyUnitFrom as t, PerSecond as u, AreaUnitClass as v, Area as w, AreaUnit as x, AreaUnitFrom as y, WattSecond as z };
482
+ export { Second as $, AreaUnitClass as A, MassUnitFrom as B, Tonne as C, Volume as D, EnergyUnitClass as E, FrequencyUnitClass as F, Gram as G, Hertz as H, VolumeUnit as I, Joule as J, VolumeUnitFrom as K, LengthUnitClass as L, Metre as M, Litre as N, TemperatureUnit as O, PerSecond as P, TemperatureUnitFrom as Q, ReciprocalUnitClass as R, Kelvin as S, TemperatureUnitClass as T, Celsius as U, VolumeUnitClass as V, WattSecond as W, DurationUnitClass as X, Duration as Y, DurationUnit as Z, DurationUnitFrom as _, Reciprocal as a, Minute as a0, Hour as a1, Day as a2, Week as a3, Year as a4, Square as a5, Cubic as a6, Energy as b, EnergyUnit as c, EnergyUnitFrom as d, Temperature as e, Frequency as f, FrequencyUnit as g, FrequencyUnitFrom as h, PerMinute as i, PerHour as j, PerDay as k, PerWeek as l, PerYear as m, Area as n, AreaUnit as o, AreaUnitFrom as p, Are as q, Hectare as r, WattMinute as s, WattHour as t, Length as u, LengthUnit as v, LengthUnitFrom as w, MassUnitClass as x, Mass as y, MassUnit as z };
@@ -1,4 +1,4 @@
1
- import { b as UnknownAbstractUnit, U as UnknownUnit, l as MultiplyUnitExponents, I as Inverse, m as UnknownUnitClass, i as UnitClass, n as InverseUnitSubvalues, e as UnitSubvalues, f as UnitMeta, g as UnknownUnitMeta, h as UnitFrom, d as AbstractUnitFrom } from './_index.mjs';
1
+ import { h as UnknownAbstractUnit, i as UnknownUnit, P as Pow, I as Inverse, j as UnknownUnitClass, b as UnitClass, r as InverseUnitSubvalues, g as UnitSubvalues, f as UnitMeta, k as UnknownUnitMeta, e as UnitFrom, a as AbstractUnitFrom } from './_units.mjs';
2
2
  import { B as BaseUnitClass } from './_angle-plane.mjs';
3
3
 
4
4
  /**
@@ -6,19 +6,19 @@ import { B as BaseUnitClass } from './_angle-plane.mjs';
6
6
  *
7
7
  * @group Modifiers
8
8
  * @category General
9
- * @see {@link MultiplyUnitExponents}
9
+ * @see {@link Pow}
10
10
  * @see {@link Cubic}
11
11
  */
12
- type Square<T extends UnknownAbstractUnit | UnknownUnit> = MultiplyUnitExponents<T, 2>;
12
+ type Square<T extends UnknownAbstractUnit | UnknownUnit> = Pow<T, 2>;
13
13
  /**
14
14
  * Put the given {@link Unit} to the power of 3.
15
15
  *
16
16
  * @group Modifiers
17
17
  * @category General
18
- * @see {@link MultiplyUnitExponents}
18
+ * @see {@link Pow}
19
19
  * @see {@link Square}
20
20
  */
21
- type Cubic<T extends UnknownAbstractUnit | UnknownUnit> = MultiplyUnitExponents<T, 3>;
21
+ type Cubic<T extends UnknownAbstractUnit | UnknownUnit> = Pow<T, 3>;
22
22
 
23
23
  /**
24
24
  * Invert the {@link Unit}.
@@ -479,4 +479,4 @@ type Year = DurationUnit<{
479
479
  scalarDayInYear: 1;
480
480
  }>;
481
481
 
482
- export { VolumeUnit as $, Are as A, LengthUnitClass as B, Celsius as C, Day as D, EnergyUnitClass as E, FrequencyUnitClass as F, Gram as G, Hectare as H, Length as I, Joule as J, Kelvin as K, Litre as L, Metre as M, LengthUnit as N, LengthUnitFrom as O, PerMinute as P, MassUnitClass as Q, ReciprocalUnitClass as R, Square as S, Tonne as T, Mass as U, MassUnit as V, Week as W, MassUnitFrom as X, Year as Y, VolumeUnitClass as Z, Volume as _, Second as a, VolumeUnitFrom as a0, TemperatureUnit as a1, TemperatureUnitFrom as a2, DurationUnitClass as a3, Duration as a4, DurationUnit as a5, DurationUnitFrom as a6, Minute as b, Hour as c, WattMinute as d, WattHour as e, Hertz as f, PerHour as g, PerDay as h, PerWeek as i, PerYear as j, Cubic as k, Reciprocal as l, Energy as m, EnergyUnit as n, EnergyUnitFrom as o, TemperatureUnitClass as p, Temperature as q, Frequency as r, FrequencyUnit as s, FrequencyUnitFrom as t, PerSecond as u, AreaUnitClass as v, Area as w, AreaUnit as x, AreaUnitFrom as y, WattSecond as z };
482
+ export { Second as $, AreaUnitClass as A, MassUnitFrom as B, Tonne as C, Volume as D, EnergyUnitClass as E, FrequencyUnitClass as F, Gram as G, Hertz as H, VolumeUnit as I, Joule as J, VolumeUnitFrom as K, LengthUnitClass as L, Metre as M, Litre as N, TemperatureUnit as O, PerSecond as P, TemperatureUnitFrom as Q, ReciprocalUnitClass as R, Kelvin as S, TemperatureUnitClass as T, Celsius as U, VolumeUnitClass as V, WattSecond as W, DurationUnitClass as X, Duration as Y, DurationUnit as Z, DurationUnitFrom as _, Reciprocal as a, Minute as a0, Hour as a1, Day as a2, Week as a3, Year as a4, Square as a5, Cubic as a6, Energy as b, EnergyUnit as c, EnergyUnitFrom as d, Temperature as e, Frequency as f, FrequencyUnit as g, FrequencyUnitFrom as h, PerMinute as i, PerHour as j, PerDay as k, PerWeek as l, PerYear as m, Area as n, AreaUnit as o, AreaUnitFrom as p, Are as q, Hectare as r, WattMinute as s, WattHour as t, Length as u, LengthUnit as v, LengthUnitFrom as w, MassUnitClass as x, Mass as y, MassUnit as z };
@@ -1,16 +1,32 @@
1
1
  /**
2
2
  * @file Autogenerated File - Don't manually edit.
3
3
  */
4
+ /**
5
+ * All the supported positive exponent values.
6
+ *
7
+ * @group Unit Components
8
+ */
9
+ type PosExponent = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
+ /**
11
+ * All the supported negative exponent values.
12
+ *
13
+ * @group Unit Components
14
+ */
15
+ type NegExponent = -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8 | -9 | -10 | -11 | -12;
4
16
  /**
5
17
  * All the supported exponent values.
6
18
  *
7
19
  * @group Unit Components
8
20
  */
9
- type Exponent = 0 | 1 | -1 | 2 | -2 | 3 | -3 | 4 | -4 | 5 | -5 | 6 | -6 | 7 | -7 | 8 | -8 | 9 | -9 | 10 | -10 | 11 | -11 | 12 | -12;
21
+ type Exponent = 0 | PosExponent | NegExponent;
10
22
  /**
11
23
  * @group Exponent Functions
12
24
  */
13
- type NegativeExponent<T extends Exponent> = T extends 0 ? 0 : T extends 1 ? -1 : T extends -1 ? 1 : T extends 2 ? -2 : T extends -2 ? 2 : T extends 3 ? -3 : T extends -3 ? 3 : T extends 4 ? -4 : T extends -4 ? 4 : T extends 5 ? -5 : T extends -5 ? 5 : T extends 6 ? -6 : T extends -6 ? 6 : T extends 7 ? -7 : T extends -7 ? 7 : T extends 8 ? -8 : T extends -8 ? 8 : T extends 9 ? -9 : T extends -9 ? 9 : T extends 10 ? -10 : T extends -10 ? 10 : T extends 11 ? -11 : T extends -11 ? 11 : T extends 12 ? -12 : T extends -12 ? 12 : never;
25
+ type NegateExponent<T extends Exponent> = MultiplyExponents<T, -1>;
26
+ /**
27
+ * @depreated Use {@link NegateExponent} instead.
28
+ */
29
+ type NegativeExponent<T extends Exponent> = NegateExponent<T>;
14
30
  /**
15
31
  * @group Exponent Functions
16
32
  */
@@ -169,40 +185,19 @@ type UnknownUnitKeyValues = {
169
185
  */
170
186
  type UnitSubvalues = Record<string, Exponent>;
171
187
 
172
- /**
173
- * Multiple the exponent values of a unit by a number.
174
- *
175
- * @group Unit Functions
176
- */
177
- type MultiplyUnitExponents<T extends number, E extends Exponent> = T extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<MultiplyUnitSubvaluesExponents<Config, E>>, FlatternAlias<MultiplyUnitSubvaluesExponents<Meta, E>>> : T extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<MultiplyUnitSubvaluesExponents<Config, E>>> : number;
178
- type MultiplyUnitSubvaluesExponents<T extends UnitSubvalues, E extends Exponent> = {
179
- [S in keyof T]: MultiplyExponents<GetExponent<T, S>, E>;
180
- };
181
- /**
182
- * Divide the exponent values of a unit by a number.
183
- *
184
- * @group Unit Functions
185
- */
186
- type DivideUnitExponents<T extends number, E extends Exponent> = T extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<DivideUnitSubvaluesExponents<Config, E>>, FlatternAlias<DivideUnitSubvaluesExponents<Meta, E>>> : T extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<DivideUnitSubvaluesExponents<Config, E>>> : number;
187
- type DivideUnitSubvaluesExponents<T extends UnitSubvalues, E extends Exponent> = {
188
- [S in keyof T]: DivideExponents<GetExponent<T, S>, E>;
189
- };
190
-
191
188
  /**
192
189
  * Take the inverse of a unit.
193
190
  *
194
191
  * @group Unit Functions
195
192
  * @returns `1/X`.
196
193
  */
197
- type Inverse<X extends number> = X extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<InverseUnitSubvalues<Config>>, FlatternAlias<InverseUnitSubvalues<Meta>>> : X extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<InverseUnitSubvalues<Config>>> : number;
194
+ type Inverse<X extends number> = Pow<X, -1>;
198
195
  /**
199
196
  * Inverses each of the subvalues.
200
197
  *
201
198
  * @group Unit Subvalue Functions
202
199
  */
203
- type InverseUnitSubvalues<T extends UnitSubvalues> = {
204
- [E in keyof T]: NegativeExponent<T[E]>;
205
- };
200
+ type InverseUnitSubvalues<T extends UnitSubvalues> = PowUnitSubvalues<T, -1>;
206
201
  /**
207
202
  * Multiply a unit by another unit.
208
203
  *
@@ -231,5 +226,33 @@ type Divide<A extends number, B extends number> = Multiply<A, Inverse<B>>;
231
226
  * @group Unit Subvalue Functions
232
227
  */
233
228
  type DivideUnitSubvalues<A extends UnitSubvalues, B extends UnitSubvalues> = MultiplyUnitSubvalues<A, InverseUnitSubvalues<B>>;
229
+ /**
230
+ * Put a unit to the power of an exponent.
231
+ *
232
+ * @group Unit Functions
233
+ */
234
+ type Pow<T extends number, N extends Exponent> = T extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<PowUnitSubvalues<Config, N>>, FlatternAlias<PowUnitSubvalues<Meta, N>>> : T extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<PowUnitSubvalues<Config, N>>> : number;
235
+ /**
236
+ * Put each subvalue of a unit to the power of an exponent.
237
+ *
238
+ * @group Unit Subvalue Functions
239
+ */
240
+ type PowUnitSubvalues<T extends UnitSubvalues, E extends Exponent> = ExcludeUnitZeroSubvalues<{
241
+ [S in keyof T]: MultiplyExponents<GetExponent<T, S>, E>;
242
+ }>;
243
+ /**
244
+ * Take the nth root of a unit.
245
+ *
246
+ * @group Unit Functions
247
+ */
248
+ type Root<T extends number, N extends Exponent> = T extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<RootUnitSubvalues<Config, N>>, FlatternAlias<RootUnitSubvalues<Meta, N>>> : T extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<RootUnitSubvalues<Config, N>>> : number;
249
+ /**
250
+ * Take the nth root of each subvalue of a unit.
251
+ *
252
+ * @group Unit Subvalue Functions
253
+ */
254
+ type RootUnitSubvalues<T extends UnitSubvalues, E extends Exponent> = ExcludeUnitZeroSubvalues<{
255
+ [S in keyof T]: DivideExponents<GetExponent<T, S>, E>;
256
+ }>;
234
257
 
235
- export { AbstractUnit as A, Divide as D, Exactify as E, Inverse as I, Multiply as M, NegativeExponent as N, SubExponents as S, UnknownUnit as U, Unit as a, UnknownAbstractUnit as b, DivideUnitExponents as c, AbstractUnitFrom as d, UnitSubvalues as e, UnitMeta as f, UnknownUnitMeta as g, UnitFrom as h, UnitClass as i, Exponent as j, UnitConversionRate as k, MultiplyUnitExponents as l, UnknownUnitClass as m, InverseUnitSubvalues as n, UnitConversionRateFrom as o, DivideExponents as p, MultiplyExponents as q, SumExponents as r, DivideUnitSubvalues as s, MultiplyUnitSubvalues as t };
258
+ export { AbstractUnit as A, DivideExponents as D, Exponent as E, Inverse as I, MultiplyExponents as M, NegateExponent as N, Pow as P, Root as R, SubExponents as S, Unit as U, AbstractUnitFrom as a, UnitClass as b, UnitConversionRate as c, UnitConversionRateFrom as d, UnitFrom as e, UnitMeta as f, UnitSubvalues as g, UnknownAbstractUnit as h, UnknownUnit as i, UnknownUnitClass as j, UnknownUnitMeta as k, NegativeExponent as l, NegExponent as m, PosExponent as n, SumExponents as o, Divide as p, DivideUnitSubvalues as q, InverseUnitSubvalues as r, Multiply as s, MultiplyUnitSubvalues as t, PowUnitSubvalues as u, RootUnitSubvalues as v, Exactify as w };
@@ -1,16 +1,32 @@
1
1
  /**
2
2
  * @file Autogenerated File - Don't manually edit.
3
3
  */
4
+ /**
5
+ * All the supported positive exponent values.
6
+ *
7
+ * @group Unit Components
8
+ */
9
+ type PosExponent = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
+ /**
11
+ * All the supported negative exponent values.
12
+ *
13
+ * @group Unit Components
14
+ */
15
+ type NegExponent = -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8 | -9 | -10 | -11 | -12;
4
16
  /**
5
17
  * All the supported exponent values.
6
18
  *
7
19
  * @group Unit Components
8
20
  */
9
- type Exponent = 0 | 1 | -1 | 2 | -2 | 3 | -3 | 4 | -4 | 5 | -5 | 6 | -6 | 7 | -7 | 8 | -8 | 9 | -9 | 10 | -10 | 11 | -11 | 12 | -12;
21
+ type Exponent = 0 | PosExponent | NegExponent;
10
22
  /**
11
23
  * @group Exponent Functions
12
24
  */
13
- type NegativeExponent<T extends Exponent> = T extends 0 ? 0 : T extends 1 ? -1 : T extends -1 ? 1 : T extends 2 ? -2 : T extends -2 ? 2 : T extends 3 ? -3 : T extends -3 ? 3 : T extends 4 ? -4 : T extends -4 ? 4 : T extends 5 ? -5 : T extends -5 ? 5 : T extends 6 ? -6 : T extends -6 ? 6 : T extends 7 ? -7 : T extends -7 ? 7 : T extends 8 ? -8 : T extends -8 ? 8 : T extends 9 ? -9 : T extends -9 ? 9 : T extends 10 ? -10 : T extends -10 ? 10 : T extends 11 ? -11 : T extends -11 ? 11 : T extends 12 ? -12 : T extends -12 ? 12 : never;
25
+ type NegateExponent<T extends Exponent> = MultiplyExponents<T, -1>;
26
+ /**
27
+ * @depreated Use {@link NegateExponent} instead.
28
+ */
29
+ type NegativeExponent<T extends Exponent> = NegateExponent<T>;
14
30
  /**
15
31
  * @group Exponent Functions
16
32
  */
@@ -169,40 +185,19 @@ type UnknownUnitKeyValues = {
169
185
  */
170
186
  type UnitSubvalues = Record<string, Exponent>;
171
187
 
172
- /**
173
- * Multiple the exponent values of a unit by a number.
174
- *
175
- * @group Unit Functions
176
- */
177
- type MultiplyUnitExponents<T extends number, E extends Exponent> = T extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<MultiplyUnitSubvaluesExponents<Config, E>>, FlatternAlias<MultiplyUnitSubvaluesExponents<Meta, E>>> : T extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<MultiplyUnitSubvaluesExponents<Config, E>>> : number;
178
- type MultiplyUnitSubvaluesExponents<T extends UnitSubvalues, E extends Exponent> = {
179
- [S in keyof T]: MultiplyExponents<GetExponent<T, S>, E>;
180
- };
181
- /**
182
- * Divide the exponent values of a unit by a number.
183
- *
184
- * @group Unit Functions
185
- */
186
- type DivideUnitExponents<T extends number, E extends Exponent> = T extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<DivideUnitSubvaluesExponents<Config, E>>, FlatternAlias<DivideUnitSubvaluesExponents<Meta, E>>> : T extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<DivideUnitSubvaluesExponents<Config, E>>> : number;
187
- type DivideUnitSubvaluesExponents<T extends UnitSubvalues, E extends Exponent> = {
188
- [S in keyof T]: DivideExponents<GetExponent<T, S>, E>;
189
- };
190
-
191
188
  /**
192
189
  * Take the inverse of a unit.
193
190
  *
194
191
  * @group Unit Functions
195
192
  * @returns `1/X`.
196
193
  */
197
- type Inverse<X extends number> = X extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<InverseUnitSubvalues<Config>>, FlatternAlias<InverseUnitSubvalues<Meta>>> : X extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<InverseUnitSubvalues<Config>>> : number;
194
+ type Inverse<X extends number> = Pow<X, -1>;
198
195
  /**
199
196
  * Inverses each of the subvalues.
200
197
  *
201
198
  * @group Unit Subvalue Functions
202
199
  */
203
- type InverseUnitSubvalues<T extends UnitSubvalues> = {
204
- [E in keyof T]: NegativeExponent<T[E]>;
205
- };
200
+ type InverseUnitSubvalues<T extends UnitSubvalues> = PowUnitSubvalues<T, -1>;
206
201
  /**
207
202
  * Multiply a unit by another unit.
208
203
  *
@@ -231,5 +226,33 @@ type Divide<A extends number, B extends number> = Multiply<A, Inverse<B>>;
231
226
  * @group Unit Subvalue Functions
232
227
  */
233
228
  type DivideUnitSubvalues<A extends UnitSubvalues, B extends UnitSubvalues> = MultiplyUnitSubvalues<A, InverseUnitSubvalues<B>>;
229
+ /**
230
+ * Put a unit to the power of an exponent.
231
+ *
232
+ * @group Unit Functions
233
+ */
234
+ type Pow<T extends number, N extends Exponent> = T extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<PowUnitSubvalues<Config, N>>, FlatternAlias<PowUnitSubvalues<Meta, N>>> : T extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<PowUnitSubvalues<Config, N>>> : number;
235
+ /**
236
+ * Put each subvalue of a unit to the power of an exponent.
237
+ *
238
+ * @group Unit Subvalue Functions
239
+ */
240
+ type PowUnitSubvalues<T extends UnitSubvalues, E extends Exponent> = ExcludeUnitZeroSubvalues<{
241
+ [S in keyof T]: MultiplyExponents<GetExponent<T, S>, E>;
242
+ }>;
243
+ /**
244
+ * Take the nth root of a unit.
245
+ *
246
+ * @group Unit Functions
247
+ */
248
+ type Root<T extends number, N extends Exponent> = T extends Unit<infer Config, infer Meta> ? Unit<FlatternAlias<RootUnitSubvalues<Config, N>>, FlatternAlias<RootUnitSubvalues<Meta, N>>> : T extends AbstractUnit<infer Config> ? AbstractUnit<FlatternAlias<RootUnitSubvalues<Config, N>>> : number;
249
+ /**
250
+ * Take the nth root of each subvalue of a unit.
251
+ *
252
+ * @group Unit Subvalue Functions
253
+ */
254
+ type RootUnitSubvalues<T extends UnitSubvalues, E extends Exponent> = ExcludeUnitZeroSubvalues<{
255
+ [S in keyof T]: DivideExponents<GetExponent<T, S>, E>;
256
+ }>;
234
257
 
235
- export { AbstractUnit as A, Divide as D, Exactify as E, Inverse as I, Multiply as M, NegativeExponent as N, SubExponents as S, UnknownUnit as U, Unit as a, UnknownAbstractUnit as b, DivideUnitExponents as c, AbstractUnitFrom as d, UnitSubvalues as e, UnitMeta as f, UnknownUnitMeta as g, UnitFrom as h, UnitClass as i, Exponent as j, UnitConversionRate as k, MultiplyUnitExponents as l, UnknownUnitClass as m, InverseUnitSubvalues as n, UnitConversionRateFrom as o, DivideExponents as p, MultiplyExponents as q, SumExponents as r, DivideUnitSubvalues as s, MultiplyUnitSubvalues as t };
258
+ export { AbstractUnit as A, DivideExponents as D, Exponent as E, Inverse as I, MultiplyExponents as M, NegateExponent as N, Pow as P, Root as R, SubExponents as S, Unit as U, AbstractUnitFrom as a, UnitClass as b, UnitConversionRate as c, UnitConversionRateFrom as d, UnitFrom as e, UnitMeta as f, UnitSubvalues as g, UnknownAbstractUnit as h, UnknownUnit as i, UnknownUnitClass as j, UnknownUnitMeta as k, NegativeExponent as l, NegExponent as m, PosExponent as n, SumExponents as o, Divide as p, DivideUnitSubvalues as q, InverseUnitSubvalues as r, Multiply as s, MultiplyUnitSubvalues as t, PowUnitSubvalues as u, RootUnitSubvalues as v, Exactify as w };
@@ -61,6 +61,14 @@ function modSafe(a) {
61
61
  function pow(exponent) {
62
62
  return (base) => (base ** exponent);
63
63
  }
64
+ /**
65
+ * Take the nth root of a number.
66
+ *
67
+ * @category Math
68
+ */
69
+ function root(exponent) {
70
+ return (base) => (base ** (1 / exponent));
71
+ }
64
72
  /**
65
73
  * Equal: Compare if a value is equal to the given value.
66
74
  *
@@ -113,4 +121,5 @@ exports.mod = mod;
113
121
  exports.modSafe = modSafe;
114
122
  exports.mul = mul;
115
123
  exports.pow = pow;
124
+ exports.root = root;
116
125
  exports.sub = sub;
@@ -1,4 +1,4 @@
1
- import { M as Multiply, D as Divide, U as UnknownUnit, b as UnknownAbstractUnit, I as Inverse, a as Unit, A as AbstractUnit, c as DivideUnitExponents } from './_index.cjs';
1
+ import { s as Multiply, p as Divide, i as UnknownUnit, h as UnknownAbstractUnit, E as Exponent, P as Pow, R as Root, n as PosExponent } from './_units.cjs';
2
2
 
3
3
  /**
4
4
  * @module uom-types/functions/higher-order
@@ -43,13 +43,20 @@ declare function mod<T extends number>(a: OperationIO<T>): (b: OperationIO<T>) =
43
43
  * @category Math
44
44
  */
45
45
  declare function modSafe<T extends number>(a: OperationIO<T>): (b: OperationIO<T>) => OperationIO<T>;
46
- type PowFunction<E extends number, B extends number> = E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E extends -1 ? (b: B) => Inverse<B> : E extends 0 ? (b: B) => B extends UnknownUnit ? Unit<{}> : B extends UnknownAbstractUnit ? AbstractUnit<{}> : 1 : E extends 0.5 ? (b: B) => DivideUnitExponents<B, 2> : E extends 1 ? (b: B) => B : E extends 2 ? (b: B) => Multiply<B, B> : E extends 3 ? (b: B) => Multiply<B, Multiply<B, B>> : E extends 4 ? (b: B) => Multiply<B, Multiply<B, Multiply<B, B>>> : (b: B) => number;
46
+ type PowFunction<E extends number, B extends number> = E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E extends Exponent ? (b: B) => Pow<B, E> : E extends 0.5 ? (b: B) => Root<B, 2> : (b: B) => number;
47
47
  /**
48
48
  * Put a number to the power of the given value.
49
49
  *
50
50
  * @category Math
51
51
  */
52
52
  declare function pow<E extends number>(exponent: E): <B extends number>(base: Parameters<PowFunction<E, B>>[0]) => ReturnType<PowFunction<E, B>>;
53
+ type RootFunction<E extends number, B extends number> = E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E extends PosExponent ? (b: B) => Root<B, E> : (b: B) => number;
54
+ /**
55
+ * Take the nth root of a number.
56
+ *
57
+ * @category Math
58
+ */
59
+ declare function root<N extends number>(exponent: N): <B extends number>(base: Parameters<RootFunction<N, B>>[0]) => ReturnType<RootFunction<N, B>>;
53
60
  /**
54
61
  * Equal: Compare if a value is equal to the given value.
55
62
  *
@@ -81,4 +88,4 @@ declare function lt<T extends number>(a: OperationIO<T>): (b: OperationIO<T>) =>
81
88
  */
82
89
  declare function lte<T extends number>(a: OperationIO<T>): (b: OperationIO<T>) => boolean;
83
90
 
84
- export { add, div, eq, gt, gte, lt, lte, mod, modSafe, mul, pow, sub };
91
+ export { add, div, eq, gt, gte, lt, lte, mod, modSafe, mul, pow, root, sub };
@@ -1,4 +1,4 @@
1
- import { M as Multiply, D as Divide, U as UnknownUnit, b as UnknownAbstractUnit, I as Inverse, a as Unit, A as AbstractUnit, c as DivideUnitExponents } from './_index.mjs';
1
+ import { s as Multiply, p as Divide, i as UnknownUnit, h as UnknownAbstractUnit, E as Exponent, P as Pow, R as Root, n as PosExponent } from './_units.mjs';
2
2
 
3
3
  /**
4
4
  * @module uom-types/functions/higher-order
@@ -43,13 +43,20 @@ declare function mod<T extends number>(a: OperationIO<T>): (b: OperationIO<T>) =
43
43
  * @category Math
44
44
  */
45
45
  declare function modSafe<T extends number>(a: OperationIO<T>): (b: OperationIO<T>) => OperationIO<T>;
46
- type PowFunction<E extends number, B extends number> = E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E extends -1 ? (b: B) => Inverse<B> : E extends 0 ? (b: B) => B extends UnknownUnit ? Unit<{}> : B extends UnknownAbstractUnit ? AbstractUnit<{}> : 1 : E extends 0.5 ? (b: B) => DivideUnitExponents<B, 2> : E extends 1 ? (b: B) => B : E extends 2 ? (b: B) => Multiply<B, B> : E extends 3 ? (b: B) => Multiply<B, Multiply<B, B>> : E extends 4 ? (b: B) => Multiply<B, Multiply<B, Multiply<B, B>>> : (b: B) => number;
46
+ type PowFunction<E extends number, B extends number> = E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E extends Exponent ? (b: B) => Pow<B, E> : E extends 0.5 ? (b: B) => Root<B, 2> : (b: B) => number;
47
47
  /**
48
48
  * Put a number to the power of the given value.
49
49
  *
50
50
  * @category Math
51
51
  */
52
52
  declare function pow<E extends number>(exponent: E): <B extends number>(base: Parameters<PowFunction<E, B>>[0]) => ReturnType<PowFunction<E, B>>;
53
+ type RootFunction<E extends number, B extends number> = E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E extends PosExponent ? (b: B) => Root<B, E> : (b: B) => number;
54
+ /**
55
+ * Take the nth root of a number.
56
+ *
57
+ * @category Math
58
+ */
59
+ declare function root<N extends number>(exponent: N): <B extends number>(base: Parameters<RootFunction<N, B>>[0]) => ReturnType<RootFunction<N, B>>;
53
60
  /**
54
61
  * Equal: Compare if a value is equal to the given value.
55
62
  *
@@ -81,4 +88,4 @@ declare function lt<T extends number>(a: OperationIO<T>): (b: OperationIO<T>) =>
81
88
  */
82
89
  declare function lte<T extends number>(a: OperationIO<T>): (b: OperationIO<T>) => boolean;
83
90
 
84
- export { add, div, eq, gt, gte, lt, lte, mod, modSafe, mul, pow, sub };
91
+ export { add, div, eq, gt, gte, lt, lte, mod, modSafe, mul, pow, root, sub };
@@ -59,6 +59,14 @@ function modSafe(a) {
59
59
  function pow(exponent) {
60
60
  return (base) => (base ** exponent);
61
61
  }
62
+ /**
63
+ * Take the nth root of a number.
64
+ *
65
+ * @category Math
66
+ */
67
+ function root(exponent) {
68
+ return (base) => (base ** (1 / exponent));
69
+ }
62
70
  /**
63
71
  * Equal: Compare if a value is equal to the given value.
64
72
  *
@@ -100,4 +108,4 @@ function lte(a) {
100
108
  return (b) => b <= a;
101
109
  }
102
110
 
103
- export { add, div, eq, gt, gte, lt, lte, mod, modSafe, mul, pow, sub };
111
+ export { add, div, eq, gt, gte, lt, lte, mod, modSafe, mul, pow, root, sub };
@@ -60,13 +60,21 @@ function modSafe(a, b) {
60
60
  function pow(base, exponent) {
61
61
  return base ** exponent;
62
62
  }
63
+ /**
64
+ * Take the nth root of a number.
65
+ *
66
+ * @category Math
67
+ */
68
+ function root(base, exponent) {
69
+ return (base ** (1 / exponent));
70
+ }
63
71
  /**
64
72
  * Take the square root of the given value.
65
73
  *
66
74
  * @category Math
67
75
  */
68
76
  function sqrt(value) {
69
- return pow(value, 0.5);
77
+ return root(value, 2);
70
78
  }
71
79
  /**
72
80
  * Inverse the given value.
@@ -314,6 +322,7 @@ exports.modSafe = modSafe;
314
322
  exports.mul = mul;
315
323
  exports.negate = negate;
316
324
  exports.pow = pow;
325
+ exports.root = root;
317
326
  exports.round = round;
318
327
  exports.sin = sin;
319
328
  exports.sinh = sinh;
@@ -1,4 +1,4 @@
1
- import { M as Multiply, D as Divide, I as Inverse, U as UnknownUnit, a as Unit, b as UnknownAbstractUnit, A as AbstractUnit, c as DivideUnitExponents } from './_index.cjs';
1
+ import { s as Multiply, p as Divide, i as UnknownUnit, h as UnknownAbstractUnit, E as Exponent, P as Pow, R as Root, n as PosExponent, I as Inverse } from './_units.cjs';
2
2
  import { R as Radian } from './_angle-plane.cjs';
3
3
  import { U as Unitless } from './_identity.cjs';
4
4
 
@@ -52,59 +52,29 @@ declare function mod<T extends number>(a: OperationIO<T>, b: OperationIO<T>): Op
52
52
  */
53
53
  declare function modSafe<T extends number>(a: OperationIO<T>, b: OperationIO<T>): OperationIO<T>;
54
54
  /**
55
- * Put a number to the power of -1.
55
+ * Raise a number to the power of another.
56
56
  *
57
57
  * @category Math
58
58
  */
59
- declare function pow<B extends number>(base: B, exponent: -1): Inverse<B>;
60
- /**
61
- * Put a number to the power of 0.
62
- *
63
- * @category Math
64
- */
65
- declare function pow<B extends number>(base: B, exponent: 0): B extends UnknownUnit ? Unit<{}> : B extends UnknownAbstractUnit ? AbstractUnit<{}> : 1;
59
+ declare function pow<B extends number, E extends number>(base: B, exponent: E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E): E extends Exponent ? Pow<B, E> : number;
66
60
  /**
67
61
  * Put a number to the power of 1/2.
68
62
  *
69
63
  * @category Math
70
64
  */
71
- declare function pow<B extends number>(base: B, exponent: 0.5): DivideUnitExponents<B, 2>;
72
- /**
73
- * Put a number to the power of 1.
74
- *
75
- * @category Math
76
- */
77
- declare function pow<E extends number>(base: E, exponent: 1): E;
78
- /**
79
- * Put a number to the power of 2.
80
- *
81
- * @category Math
82
- */
83
- declare function pow<B extends number>(base: B, exponent: 2): Multiply<B, B>;
84
- /**
85
- * Put a number to the power of 3.
86
- *
87
- * @category Math
88
- */
89
- declare function pow<B extends number>(base: B, exponent: 3): Multiply<B, Multiply<B, B>>;
90
- /**
91
- * Put a number to the power of 4.
92
- *
93
- * @category Math
94
- */
95
- declare function pow<B extends number>(base: B, exponent: 4): Multiply<B, Multiply<B, Multiply<B, B>>>;
65
+ declare function pow<B extends number>(base: B, exponent: 0.5): Root<B, 2>;
96
66
  /**
97
- * Put one number to the power of the other.
67
+ * Take the nth root of a number.
98
68
  *
99
69
  * @category Math
100
70
  */
101
- declare function pow<B extends number, E extends number>(base: B, exponent: E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E): number;
71
+ declare function root<B extends number, N extends number>(base: B, exponent: N extends UnknownUnit ? never : N extends UnknownAbstractUnit ? never : N): N extends PosExponent ? Root<B, N> : number;
102
72
  /**
103
73
  * Take the square root of the given value.
104
74
  *
105
75
  * @category Math
106
76
  */
107
- declare function sqrt<T extends number>(value: T): DivideUnitExponents<T, 2>;
77
+ declare function sqrt<T extends number>(value: T): Root<T, 2>;
108
78
  /**
109
79
  * Inverse the given value.
110
80
  *
@@ -270,4 +240,4 @@ declare function acosh(value: Unitless): Radian;
270
240
  */
271
241
  declare function atanh(value: Unitless): Radian;
272
242
 
273
- export { abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, round, sin, sinh, sqrt, sub, sum, tan, tanh };
243
+ export { abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, root, round, sin, sinh, sqrt, sub, sum, tan, tanh };
@@ -1,4 +1,4 @@
1
- import { M as Multiply, D as Divide, I as Inverse, U as UnknownUnit, a as Unit, b as UnknownAbstractUnit, A as AbstractUnit, c as DivideUnitExponents } from './_index.mjs';
1
+ import { s as Multiply, p as Divide, i as UnknownUnit, h as UnknownAbstractUnit, E as Exponent, P as Pow, R as Root, n as PosExponent, I as Inverse } from './_units.mjs';
2
2
  import { R as Radian } from './_angle-plane.mjs';
3
3
  import { U as Unitless } from './_identity.mjs';
4
4
 
@@ -52,59 +52,29 @@ declare function mod<T extends number>(a: OperationIO<T>, b: OperationIO<T>): Op
52
52
  */
53
53
  declare function modSafe<T extends number>(a: OperationIO<T>, b: OperationIO<T>): OperationIO<T>;
54
54
  /**
55
- * Put a number to the power of -1.
55
+ * Raise a number to the power of another.
56
56
  *
57
57
  * @category Math
58
58
  */
59
- declare function pow<B extends number>(base: B, exponent: -1): Inverse<B>;
60
- /**
61
- * Put a number to the power of 0.
62
- *
63
- * @category Math
64
- */
65
- declare function pow<B extends number>(base: B, exponent: 0): B extends UnknownUnit ? Unit<{}> : B extends UnknownAbstractUnit ? AbstractUnit<{}> : 1;
59
+ declare function pow<B extends number, E extends number>(base: B, exponent: E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E): E extends Exponent ? Pow<B, E> : number;
66
60
  /**
67
61
  * Put a number to the power of 1/2.
68
62
  *
69
63
  * @category Math
70
64
  */
71
- declare function pow<B extends number>(base: B, exponent: 0.5): DivideUnitExponents<B, 2>;
72
- /**
73
- * Put a number to the power of 1.
74
- *
75
- * @category Math
76
- */
77
- declare function pow<E extends number>(base: E, exponent: 1): E;
78
- /**
79
- * Put a number to the power of 2.
80
- *
81
- * @category Math
82
- */
83
- declare function pow<B extends number>(base: B, exponent: 2): Multiply<B, B>;
84
- /**
85
- * Put a number to the power of 3.
86
- *
87
- * @category Math
88
- */
89
- declare function pow<B extends number>(base: B, exponent: 3): Multiply<B, Multiply<B, B>>;
90
- /**
91
- * Put a number to the power of 4.
92
- *
93
- * @category Math
94
- */
95
- declare function pow<B extends number>(base: B, exponent: 4): Multiply<B, Multiply<B, Multiply<B, B>>>;
65
+ declare function pow<B extends number>(base: B, exponent: 0.5): Root<B, 2>;
96
66
  /**
97
- * Put one number to the power of the other.
67
+ * Take the nth root of a number.
98
68
  *
99
69
  * @category Math
100
70
  */
101
- declare function pow<B extends number, E extends number>(base: B, exponent: E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E): number;
71
+ declare function root<B extends number, N extends number>(base: B, exponent: N extends UnknownUnit ? never : N extends UnknownAbstractUnit ? never : N): N extends PosExponent ? Root<B, N> : number;
102
72
  /**
103
73
  * Take the square root of the given value.
104
74
  *
105
75
  * @category Math
106
76
  */
107
- declare function sqrt<T extends number>(value: T): DivideUnitExponents<T, 2>;
77
+ declare function sqrt<T extends number>(value: T): Root<T, 2>;
108
78
  /**
109
79
  * Inverse the given value.
110
80
  *
@@ -270,4 +240,4 @@ declare function acosh(value: Unitless): Radian;
270
240
  */
271
241
  declare function atanh(value: Unitless): Radian;
272
242
 
273
- export { abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, round, sin, sinh, sqrt, sub, sum, tan, tanh };
243
+ export { abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, root, round, sin, sinh, sqrt, sub, sum, tan, tanh };
@@ -58,13 +58,21 @@ function modSafe(a, b) {
58
58
  function pow(base, exponent) {
59
59
  return base ** exponent;
60
60
  }
61
+ /**
62
+ * Take the nth root of a number.
63
+ *
64
+ * @category Math
65
+ */
66
+ function root(base, exponent) {
67
+ return (base ** (1 / exponent));
68
+ }
61
69
  /**
62
70
  * Take the square root of the given value.
63
71
  *
64
72
  * @category Math
65
73
  */
66
74
  function sqrt(value) {
67
- return pow(value, 0.5);
75
+ return root(value, 2);
68
76
  }
69
77
  /**
70
78
  * Inverse the given value.
@@ -285,4 +293,4 @@ function atanh(value) {
285
293
  return Math.atanh(value);
286
294
  }
287
295
 
288
- export { abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, round, sin, sinh, sqrt, sub, sum, tan, tanh };
296
+ export { abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, root, round, sin, sinh, sqrt, sub, sum, tan, tanh };
package/dist/index.d.cts CHANGED
@@ -1 +1,17 @@
1
- export { A as AbstractUnit, d as AbstractUnitFrom, D as Divide, p as DivideExponents, c as DivideUnitExponents, s as DivideUnitSubvalues, j as Exponent, I as Inverse, n as InverseUnitSubvalues, M as Multiply, q as MultiplyExponents, l as MultiplyUnitExponents, t as MultiplyUnitSubvalues, N as NegativeExponent, S as SubExponents, r as SumExponents, a as Unit, i as UnitClass, k as UnitConversionRate, o as UnitConversionRateFrom, h as UnitFrom, f as UnitMeta, e as UnitSubvalues, b as UnknownAbstractUnit, U as UnknownUnit, m as UnknownUnitClass, g as UnknownUnitMeta } from './_index.cjs';
1
+ import { E as Exponent, P as Pow, R as Root } from './_units.cjs';
2
+ export { A as AbstractUnit, a as AbstractUnitFrom, p as Divide, D as DivideExponents, q as DivideUnitSubvalues, I as Inverse, r as InverseUnitSubvalues, s as Multiply, M as MultiplyExponents, t as MultiplyUnitSubvalues, m as NegExponent, N as NegateExponent, l as NegativeExponent, n as PosExponent, u as PowUnitSubvalues, v as RootUnitSubvalues, S as SubExponents, o as SumExponents, U as Unit, b as UnitClass, c as UnitConversionRate, d as UnitConversionRateFrom, e as UnitFrom, f as UnitMeta, g as UnitSubvalues, h as UnknownAbstractUnit, i as UnknownUnit, j as UnknownUnitClass, k as UnknownUnitMeta } from './_units.cjs';
3
+
4
+ /**
5
+ * Multiple the exponent values of a unit by a number.
6
+ *
7
+ * @deprecated Use {@link Pow} instead.
8
+ */
9
+ type MultiplyUnitExponents<T extends number, E extends Exponent> = Pow<T, E>;
10
+ /**
11
+ * Divide the exponent values of a unit by a number.
12
+ *
13
+ * @deprecated Use {@link Root} instead.
14
+ */
15
+ type DivideUnitExponents<T extends number, E extends Exponent> = Root<T, E>;
16
+
17
+ export { DivideUnitExponents, Exponent, MultiplyUnitExponents, Pow, Root };
package/dist/index.d.mts CHANGED
@@ -1 +1,17 @@
1
- export { A as AbstractUnit, d as AbstractUnitFrom, D as Divide, p as DivideExponents, c as DivideUnitExponents, s as DivideUnitSubvalues, j as Exponent, I as Inverse, n as InverseUnitSubvalues, M as Multiply, q as MultiplyExponents, l as MultiplyUnitExponents, t as MultiplyUnitSubvalues, N as NegativeExponent, S as SubExponents, r as SumExponents, a as Unit, i as UnitClass, k as UnitConversionRate, o as UnitConversionRateFrom, h as UnitFrom, f as UnitMeta, e as UnitSubvalues, b as UnknownAbstractUnit, U as UnknownUnit, m as UnknownUnitClass, g as UnknownUnitMeta } from './_index.mjs';
1
+ import { E as Exponent, P as Pow, R as Root } from './_units.mjs';
2
+ export { A as AbstractUnit, a as AbstractUnitFrom, p as Divide, D as DivideExponents, q as DivideUnitSubvalues, I as Inverse, r as InverseUnitSubvalues, s as Multiply, M as MultiplyExponents, t as MultiplyUnitSubvalues, m as NegExponent, N as NegateExponent, l as NegativeExponent, n as PosExponent, u as PowUnitSubvalues, v as RootUnitSubvalues, S as SubExponents, o as SumExponents, U as Unit, b as UnitClass, c as UnitConversionRate, d as UnitConversionRateFrom, e as UnitFrom, f as UnitMeta, g as UnitSubvalues, h as UnknownAbstractUnit, i as UnknownUnit, j as UnknownUnitClass, k as UnknownUnitMeta } from './_units.mjs';
3
+
4
+ /**
5
+ * Multiple the exponent values of a unit by a number.
6
+ *
7
+ * @deprecated Use {@link Pow} instead.
8
+ */
9
+ type MultiplyUnitExponents<T extends number, E extends Exponent> = Pow<T, E>;
10
+ /**
11
+ * Divide the exponent values of a unit by a number.
12
+ *
13
+ * @deprecated Use {@link Root} instead.
14
+ */
15
+ type DivideUnitExponents<T extends number, E extends Exponent> = Root<T, E>;
16
+
17
+ export { DivideUnitExponents, Exponent, MultiplyUnitExponents, Pow, Root };
@@ -1,6 +1,6 @@
1
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';
2
+ import { a5 as Square, M as Metre, q as Are, r as Hectare, $ as Second, a0 as Minute, a1 as Hour, a2 as Day, a3 as Week, a4 as Year, J as Joule, s as WattMinute, t as WattHour, H as Hertz, i as PerMinute, j as PerHour, k as PerDay, l as PerWeek, m as PerYear, G as Gram, C as Tonne, U as Celsius, S as Kelvin, a6 as Cubic, N as Litre } from './_time-duration.cjs';
3
+ import { i as UnknownUnit, s as Multiply, c as UnitConversionRate, U as Unit } from './_units.cjs';
4
4
 
5
5
  /**
6
6
  * Convert {@link Radian} to {@link Degree}.
@@ -1,6 +1,6 @@
1
1
  import { R as Radian, D as Degree, G as Gradian, T as Turn } from './_angle-plane.mjs';
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.mjs';
3
- import { U as UnknownUnit, M as Multiply, k as UnitConversionRate, a as Unit } from './_index.mjs';
2
+ import { a5 as Square, M as Metre, q as Are, r as Hectare, $ as Second, a0 as Minute, a1 as Hour, a2 as Day, a3 as Week, a4 as Year, J as Joule, s as WattMinute, t as WattHour, H as Hertz, i as PerMinute, j as PerHour, k as PerDay, l as PerWeek, m as PerYear, G as Gram, C as Tonne, U as Celsius, S as Kelvin, a6 as Cubic, N as Litre } from './_time-duration.mjs';
3
+ import { i as UnknownUnit, s as Multiply, c as UnitConversionRate, U as Unit } from './_units.mjs';
4
4
 
5
5
  /**
6
6
  * Convert {@link Radian} to {@link Degree}.
package/dist/units.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { B as BaseUnitClass } from './_angle-plane.cjs';
2
2
  export { D as Degree, G as Gradian, a as PlaneAngle, b as PlaneAngleUnit, P as PlaneAngleUnitClass, c as PlaneAngleUnitFrom, R as Radian, T as Turn } from './_angle-plane.cjs';
3
- import { d as AbstractUnitFrom, e as UnitSubvalues, f as UnitMeta, g as UnknownUnitMeta, h as UnitFrom, U as UnknownUnit, M as Multiply, a as Unit } from './_index.cjs';
4
- import { R as ReciprocalUnitClass, l as Reciprocal, E as EnergyUnitClass, m as Energy, n as EnergyUnit, o as EnergyUnitFrom, J as Joule, p as TemperatureUnitClass, q as Temperature } from './_time-duration.cjs';
5
- export { A as Are, w as Area, x as AreaUnit, v as AreaUnitClass, y as AreaUnitFrom, C as Celsius, k as Cubic, D as Day, a4 as Duration, a5 as DurationUnit, a3 as DurationUnitClass, a6 as DurationUnitFrom, r as Frequency, s as FrequencyUnit, F as FrequencyUnitClass, t as FrequencyUnitFrom, G as Gram, H as Hectare, f as Hertz, c as Hour, K as Kelvin, I as Length, N as LengthUnit, B as LengthUnitClass, O as LengthUnitFrom, L as Litre, U as Mass, V as MassUnit, Q as MassUnitClass, X as MassUnitFrom, M as Metre, b as Minute, h as PerDay, g as PerHour, P as PerMinute, u as PerSecond, i as PerWeek, j as PerYear, a as Second, S as Square, a1 as TemperatureUnit, a2 as TemperatureUnitFrom, T as Tonne, _ as Volume, $ as VolumeUnit, Z as VolumeUnitClass, a0 as VolumeUnitFrom, e as WattHour, d as WattMinute, z as WattSecond, W as Week, Y as Year } from './_time-duration.cjs';
3
+ import { a as AbstractUnitFrom, g as UnitSubvalues, f as UnitMeta, k as UnknownUnitMeta, e as UnitFrom, i as UnknownUnit, s as Multiply, U as Unit } from './_units.cjs';
4
+ import { R as ReciprocalUnitClass, a as Reciprocal, E as EnergyUnitClass, b as Energy, c as EnergyUnit, d as EnergyUnitFrom, J as Joule, T as TemperatureUnitClass, e as Temperature } from './_time-duration.cjs';
5
+ export { q as Are, n as Area, o as AreaUnit, A as AreaUnitClass, p as AreaUnitFrom, U as Celsius, a6 as Cubic, a2 as Day, Y as Duration, Z as DurationUnit, X as DurationUnitClass, _ as DurationUnitFrom, f as Frequency, g as FrequencyUnit, F as FrequencyUnitClass, h as FrequencyUnitFrom, G as Gram, r as Hectare, H as Hertz, a1 as Hour, S as Kelvin, u as Length, v as LengthUnit, L as LengthUnitClass, w as LengthUnitFrom, N as Litre, y as Mass, z as MassUnit, x as MassUnitClass, B as MassUnitFrom, M as Metre, a0 as Minute, k as PerDay, j as PerHour, i as PerMinute, P as PerSecond, l as PerWeek, m as PerYear, $ as Second, a5 as Square, O as TemperatureUnit, Q as TemperatureUnitFrom, C as Tonne, D as Volume, I as VolumeUnit, V as VolumeUnitClass, K as VolumeUnitFrom, t as WattHour, s as WattMinute, W as WattSecond, a3 as Week, a4 as Year } from './_time-duration.cjs';
6
6
  export { a as Identity, b as IdentityUnit, I as IdentityUnitClass, c as IdentityUnitFrom, U as Unitless } from './_identity.cjs';
7
7
 
8
8
  /**
package/dist/units.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { B as BaseUnitClass } from './_angle-plane.mjs';
2
2
  export { D as Degree, G as Gradian, a as PlaneAngle, b as PlaneAngleUnit, P as PlaneAngleUnitClass, c as PlaneAngleUnitFrom, R as Radian, T as Turn } from './_angle-plane.mjs';
3
- import { d as AbstractUnitFrom, e as UnitSubvalues, f as UnitMeta, g as UnknownUnitMeta, h as UnitFrom, U as UnknownUnit, M as Multiply, a as Unit } from './_index.mjs';
4
- import { R as ReciprocalUnitClass, l as Reciprocal, E as EnergyUnitClass, m as Energy, n as EnergyUnit, o as EnergyUnitFrom, J as Joule, p as TemperatureUnitClass, q as Temperature } from './_time-duration.mjs';
5
- export { A as Are, w as Area, x as AreaUnit, v as AreaUnitClass, y as AreaUnitFrom, C as Celsius, k as Cubic, D as Day, a4 as Duration, a5 as DurationUnit, a3 as DurationUnitClass, a6 as DurationUnitFrom, r as Frequency, s as FrequencyUnit, F as FrequencyUnitClass, t as FrequencyUnitFrom, G as Gram, H as Hectare, f as Hertz, c as Hour, K as Kelvin, I as Length, N as LengthUnit, B as LengthUnitClass, O as LengthUnitFrom, L as Litre, U as Mass, V as MassUnit, Q as MassUnitClass, X as MassUnitFrom, M as Metre, b as Minute, h as PerDay, g as PerHour, P as PerMinute, u as PerSecond, i as PerWeek, j as PerYear, a as Second, S as Square, a1 as TemperatureUnit, a2 as TemperatureUnitFrom, T as Tonne, _ as Volume, $ as VolumeUnit, Z as VolumeUnitClass, a0 as VolumeUnitFrom, e as WattHour, d as WattMinute, z as WattSecond, W as Week, Y as Year } from './_time-duration.mjs';
3
+ import { a as AbstractUnitFrom, g as UnitSubvalues, f as UnitMeta, k as UnknownUnitMeta, e as UnitFrom, i as UnknownUnit, s as Multiply, U as Unit } from './_units.mjs';
4
+ import { R as ReciprocalUnitClass, a as Reciprocal, E as EnergyUnitClass, b as Energy, c as EnergyUnit, d as EnergyUnitFrom, J as Joule, T as TemperatureUnitClass, e as Temperature } from './_time-duration.mjs';
5
+ export { q as Are, n as Area, o as AreaUnit, A as AreaUnitClass, p as AreaUnitFrom, U as Celsius, a6 as Cubic, a2 as Day, Y as Duration, Z as DurationUnit, X as DurationUnitClass, _ as DurationUnitFrom, f as Frequency, g as FrequencyUnit, F as FrequencyUnitClass, h as FrequencyUnitFrom, G as Gram, r as Hectare, H as Hertz, a1 as Hour, S as Kelvin, u as Length, v as LengthUnit, L as LengthUnitClass, w as LengthUnitFrom, N as Litre, y as Mass, z as MassUnit, x as MassUnitClass, B as MassUnitFrom, M as Metre, a0 as Minute, k as PerDay, j as PerHour, i as PerMinute, P as PerSecond, l as PerWeek, m as PerYear, $ as Second, a5 as Square, O as TemperatureUnit, Q as TemperatureUnitFrom, C as Tonne, D as Volume, I as VolumeUnit, V as VolumeUnitClass, K as VolumeUnitFrom, t as WattHour, s as WattMinute, W as WattSecond, a3 as Week, a4 as Year } from './_time-duration.mjs';
6
6
  export { a as Identity, b as IdentityUnit, I as IdentityUnitClass, c as IdentityUnitFrom, U as Unitless } from './_identity.mjs';
7
7
 
8
8
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uom-types",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Typesafe units with no runtime overhead.",
5
5
  "keywords": [
6
6
  "uom",
@@ -130,7 +130,7 @@
130
130
  "eslint-plugin-vitest": "0.2.8",
131
131
  "http-serve": "1.0.1",
132
132
  "husky": "8.0.3",
133
- "knip": "2.19.0",
133
+ "knip": "2.19.1",
134
134
  "lint-staged": "13.2.3",
135
135
  "markdownlint-cli": "0.35.0",
136
136
  "prettier": "3.0.1",
@@ -144,7 +144,6 @@
144
144
  "ts-paths-esm-loader": "1.4.3",
145
145
  "ts-plugin-type-coverage": "2.26.0",
146
146
  "tsafe": "1.6.4",
147
- "tsconfig-paths": "4.2.0",
148
147
  "tsd": "0.28.1",
149
148
  "type-coverage": "2.26.0",
150
149
  "typedoc": "0.24.8",