@skywardapps/ts-united-types / Exports
▸ converter<InT
, OutT
>(inV
, inT
, outV
, outT
): UnitConversion
<InT
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends string |
OutT |
extends string |
Name | Type |
---|---|
inV |
number |
inT |
InT |
outV |
number |
outT |
OutT |
UnitConversion
<InT
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Area
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Area
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Area |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Area
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Area
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Distance
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Distance
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Distance |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Distance
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Distance
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Angle
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Angle
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Angle |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Angle
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Angle
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.ApparentPower
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.ApparentPower
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends ApparentPower |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.ApparentPower
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.ApparentPower
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Current
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Current
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Current |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Current
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Current
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Ditgital
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Ditgital
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Ditgital |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Ditgital
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Ditgital
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Energy
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Energy
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Energy |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Energy
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Energy
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Frequency
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Frequency
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Frequency |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Frequency
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Frequency
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Illuminance
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Illuminance
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Illuminance |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Illuminance
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Illuminance
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Mass
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Mass
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Mass |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Mass
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Mass
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Pace
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Pace
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Pace |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Pace
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Pace
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.PartsPer
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.PartsPer
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends PartsPer |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.PartsPer
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.PartsPer
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Power
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Power
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Power |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Power
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Power
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Pressure
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Pressure
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Pressure |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Pressure
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Pressure
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.ReactiveEnergy
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.ReactiveEnergy
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends ReactiveEnergy |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.ReactiveEnergy
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.ReactiveEnergy
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.ReactivePower
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.ReactivePower
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends ReactivePower |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.ReactivePower
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.ReactivePower
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Speed
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Speed
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Speed |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Speed
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Speed
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Temperature
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Temperature
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Temperature |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Temperature
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Temperature
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Time
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Time
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Time |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Time
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Time
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Voltage
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Voltage
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Voltage |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Voltage
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Voltage
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.Volume
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Volume
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends Volume |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.Volume
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.Volume
, OutT
>
▸ converter<InT
, OutT
>(inT
, outT
): OutT
extends autoConverter.VolumeFlowRate
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.VolumeFlowRate
, OutT
>
Create a converter between one unit and another.
There are two ways to use this via overloads:
1. Any arbitrary units: provide the values and unit types. converter(1, 'meter', 100, 'centimeters')
2. Use convert-units
to automatically generate the conversion. converter('m','cm')
; This will
only work for known units (see convert-units
for a list).
It will enforce that both units are of the same category -- eg both are AREA or both are DISTANCE, etc.
Name | Type |
---|---|
InT |
extends VolumeFlowRate |
OutT |
extends string |
Name | Type |
---|---|
inT |
InT |
outT |
OutT |
OutT
extends autoConverter.VolumeFlowRate
? UnitConversion
<InT
, OutT
> : UnitTypeError
<"Mismatched unit type for converter"
, autoConverter.VolumeFlowRate
, OutT
>
▸ ratio<InT
, OutT
>(inV
, inT
, outT
): UnitedRatio
<InT
, OutT
>
Name | Type |
---|---|
InT |
extends string |
OutT |
extends string |
Name | Type |
---|---|
inV |
number |
inT |
InT |
outT |
OutT |
UnitedRatio
<InT
, OutT
>
▸ ratio<InT
, OutT
>(inV
, inT
, outV
, outT
): UnitedRatio
<InT
, OutT
>
Name | Type |
---|---|
InT |
extends string |
OutT |
extends string |
Name | Type |
---|---|
inV |
number |
inT |
InT |
outV |
number |
outT |
OutT |
UnitedRatio
<InT
, OutT
>
▸ scalar<N
>(v
, u
): UnitedScalar
<N
>
Name | Type |
---|---|
N |
extends string |
Name | Type |
---|---|
v |
number |
u |
N |
UnitedScalar
<N
>