UNPKG

convert

Version:

The smallest & fastest library for really easy, totally type-safe unit conversions in TypeScript & JavaScript

314 lines (281 loc) 24.3 kB
/** * Valid angle units. * @public */ export declare type Angle = UnitsByMeasure<MeasureKind.Angle>; /** * Valid area units. * @public */ export declare type Area = UnitsByMeasure<MeasureKind.Area>; /** * The return value from converting a unit to `'best'`. * @public */ export declare type BestConversion<Q extends number | bigint, U extends BestUnits> = { /** * The quantity of the unit. */ quantity: _LiteralToPrimitive<Q>; /** The unit. */ unit: U; /** * Join the quantity and the unit together in a string. * This method is automatically called when casting this object to a string, meaning you can safely do things like concatenate the object with a string. * * @param toFixed - The number of decimal places to include in the string. * The result will be padded with zeros if necessary. * Providing `undefined` will use the original number of decimal places. * Providing `0` will round the number to the nearest integer. * This option is ignored when converting `bigint`s. */ toString(toFixed?: number): `${_LiteralToPrimitive<Q>} ${U}`; }; /** * The kinds of best units to use. * @public */ export declare type BestKind = 'metric' | 'imperial'; /** * All possible best units for a given {@link BestKind | kind}. * @public */ export declare type BestUnits<T extends BestKind = BestKind> = BestUnits_2[T]; declare type BestUnits_2 = { imperial: 'deg' | 'sq in' | 'sq ft' | 'ac' | 'sq mi' | 'bits' | 'B' | 'KiB' | 'MiB' | 'GiB' | 'TiB' | 'PiB' | 'J' | 'Wh' | 'kWh' | 'MWh' | 'GWh' | 'lbf' | 'in' | 'ft' | 'yd' | 'mi' | 'oz' | 'lb' | 'W' | 'kW' | 'MW' | 'GW' | 'TW' | 'PW' | 'psi' | 'F' | 'fs' | 'ps' | 'ns' | 'µs' | 'ms' | 's' | 'min' | 'h' | 'd' | 'y' | 'tsp' | 'tbsp' | 'fl oz' | 'cup' | 'pt' | 'qt' | 'gal'; metric: 'deg' | 'mm2' | 'cm2' | 'm2' | 'km2' | 'bits' | 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB' | 'J' | 'Wh' | 'kWh' | 'MWh' | 'GWh' | 'N' | 'mm' | 'cm' | 'm' | 'km' | 'mg' | 'g' | 'kg' | 'W' | 'kW' | 'MW' | 'GW' | 'TW' | 'PW' | 'Pa' | 'C' | 'fs' | 'ps' | 'ns' | 'µs' | 'ms' | 's' | 'min' | 'h' | 'd' | 'y' | 'mL' | 'L'; }; /** * Get the best units for a given measure. * @public */ export declare type BestUnitsForMeasure<M extends MeasureKind, K extends BestKind = BestKind> = BestUnitsForUnit<UnitsByMeasure<M>, K>; /** * Get the best units for a given unit. * @public */ export declare type BestUnitsForUnit<U extends Unit, K extends BestKind = BestKind> = (Time | Length extends U ? Exclude<U, Time> : Time | 'm' extends U ? Exclude<U, 'm'> : U) & BestUnits<K>; /** * Convert a given quantity of a unit into another unit. * * @param quantity - The quantity of the `from` unit you want to convert * @param from - The unit you are converting from * * @returns An object you can use to convert the provided quantity * * @public */ declare function convert<Q extends number | bigint, U extends Unit>(quantity: Q, from: U): Converter<Q, MeasuresByUnit<U>>; export { convert } export default convert; /** * The return value from calling a conversion function. * @public */ export declare type Converter<Q extends number | bigint, U extends Unit> = { /** * Convert a quantity of one unit into a new unit * * @param to - The unit you want to convert to * * @returns The converted value */ to(to: U): _LiteralToPrimitive<Q>; /** * Convert a measurement to the best unit for display. * * @param to - The string `best` * @param kind - The set of units to use (defaults to `'metric'`) * * @returns An object with a `quantity` property of the `unit` unit, which can be casted to a string using the `toString()` method */ to<K extends BestKind = BestKind>(to: 'best', kind?: K | undefined): BestConversion<Q, BestUnitsForUnit<U, K>>; }; /** * Convert several values in a string into a single unit. * * @example * ```ts * convertMany('1d 12h').to('hours') === 36; * ``` * * @param value - The string to parse as values * * @public */ export declare function convertMany(value: string): Converter<number, Unit>; /** * Valid data units. * @public */ export declare type Data = UnitsByMeasure<MeasureKind.Data>; /** * Valid energy units. * @public */ export declare type Energy = UnitsByMeasure<MeasureKind.Energy>; /** * Valid force units. * @public */ export declare type Force = UnitsByMeasure<MeasureKind.Force>; /** * Get the {@link MeasureKind} associated with a unit. * * @example * ```ts * getMeasure('m'); // MeasureKind.Length * ``` * @example * ```ts * getMeasure('invalid'); // undefined * ``` * * @param unit - The unit you want to get the measure kind of * @returns The {@link MeasureKind} corresponding to this unit of measure, or `undefined` if the unit is invalid * * @public */ export declare function getMeasureKind<U extends Unit>(unit: U): _MeasureKindByUnit<U>; /** * Get the {@link MeasureKind} associated with a unit. * * @example * ```ts * getMeasure('m'); // MeasureKind.Length * ``` * @example * ```ts * getMeasure('invalid'); // undefined * ``` * * @param unit - The unit you want to get the measure kind of * @returns The {@link MeasureKind} corresponding to this unit of measure, or `undefined` if the unit is invalid * * @public */ export declare function getMeasureKind(unit: string): MeasureKind | undefined; /** * Valid length units. * @public */ export declare type Length = UnitsByMeasure<MeasureKind.Length>; /** @internal */ export declare type _LiteralToPrimitive<T> = T extends number ? number : T extends bigint ? bigint : T extends string ? string : T extends boolean ? boolean : T extends symbol ? symbol : T extends null ? null : T extends undefined ? undefined : never; /** * Valid mass units. * @public */ export declare type Mass = UnitsByMeasure<MeasureKind.Mass>; /** * The internal ID mapping used for each of the possible measures to convert. * @public */ export declare enum MeasureKind { Angle = 0, Area = 1, Data = 2, Energy = 3, Force = 4, Length = 5, Mass = 6, Power = 7, Pressure = 8, Temperature = 9, Time = 10, Volume = 11 } /** @public */ export declare type _MeasureKindByUnit<T extends Unit> = { [K in MeasureKind]: T extends _UnitsByMeasureRaw[K] ? K : never; }[MeasureKind]; /** * A type that gives all the units compatible with the same measure as a given unit. * @public */ export declare type MeasuresByUnit<T extends Unit> = UnitsByMeasure<_MeasureKindByUnit<T>> | (T extends 'm' ? Time : never) | (T extends Time ? 'm' : never); /** * Convert a given duration of milliseconds to a string that best represents it. * * If you are very concerned about performance you should use the {@link convertMany} function directly. * * @example * ```ts * ms(-3 * 60000); // '-3min' * ``` * * @param quantity - Duration of milliseconds to convert * * @returns A duration string * * @public */ export declare function ms<Q extends number | bigint>(quantity: Q): `${_LiteralToPrimitive<Q>}${BestUnitsForMeasure<MeasureKind.Time>}`; /** * Convert a duration string to a duration in milliseconds. * * If you are very concerned about performance you should use the {@link convertMany} function directly. * * @example * ```ts * ms('1d 2h 30min'); // 95400000 * ``` * * @param value - Duration string to convert * * @returns A duration in milliseconds * * @public */ export declare function ms(value: string): number; /** * Valid power units. * @public */ export declare type Power = UnitsByMeasure<MeasureKind.Power>; /** * Valid pressure units. * @public */ export declare type Pressure = UnitsByMeasure<MeasureKind.Pressure>; /** * Valid temperature units. * @public */ export declare type Temperature = UnitsByMeasure<MeasureKind.Temperature>; /** * Valid time units. * @public */ export declare type Time = UnitsByMeasure<MeasureKind.Time>; /** * A supported unit you can convert. * @public */ export declare type Unit = UnitsByMeasure<MeasureKind>; /** * Get the units for a given measure. * @public */ export declare type UnitsByMeasure<T extends MeasureKind> = T extends keyof _UnitsByMeasureRaw ? _UnitsByMeasureRaw[T] : never; /** @internal */ export declare type _UnitsByMeasureRaw = { 0: 'radian' | 'radians' | 'rad' | 'rads' | 'r' | 'turn' | 'turns' | 'degree' | 'degrees' | 'deg' | 'degs' | '°' | 'gradian' | 'gradians' | 'gon' | 'gons' | 'grad' | 'grads' | 'grade' | 'grades' | 'arcminute' | 'arcminutes' | 'minutes of arc' | 'arcmin' | 'arcmins' | 'arcsecond' | 'arcseconds' | 'seconds of arc' | 'arcsec' | 'arcsecs'; 1: 'square meter' | 'square meters' | 'square metre' | 'square metres' | 'm²' | 'm2' | 'square petameter' | 'square petametre' | 'square petameters' | 'square petametres' | 'Pm²' | 'Pm2' | 'square terameter' | 'square terametre' | 'square terameters' | 'square terametres' | 'Tm²' | 'Tm2' | 'square gigameter' | 'square gigametre' | 'square gigameters' | 'square gigametres' | 'Gm²' | 'Gm2' | 'square megameter' | 'square megametre' | 'square megameters' | 'square megametres' | 'Mm²' | 'Mm2' | 'square kilometer' | 'square kilometre' | 'square kilometers' | 'square kilometres' | 'km²' | 'km2' | 'square hectometer' | 'square hectometre' | 'square hectometers' | 'square hectometres' | 'hm²' | 'hm2' | 'square decameter' | 'square decametre' | 'square decameters' | 'square decametres' | 'dam²' | 'dam2' | 'square decimeter' | 'square decimetre' | 'square decimeters' | 'square decimetres' | 'dm²' | 'dm2' | 'square centimeter' | 'square centimetre' | 'square centimeters' | 'square centimetres' | 'cm²' | 'cm2' | 'square millimeter' | 'square millimetre' | 'square millimeters' | 'square millimetres' | 'mm²' | 'mm2' | 'square micrometer' | 'square micrometre' | 'square micrometers' | 'square micrometres' | 'μm²' | 'µm²' | 'μm2' | 'µm2' | 'square nanometer' | 'square nanometre' | 'square nanometers' | 'square nanometres' | 'nm²' | 'nm2' | 'square picometer' | 'square picometre' | 'square picometers' | 'square picometres' | 'pm²' | 'pm2' | 'square femtometer' | 'square femtometre' | 'square femtometers' | 'square femtometres' | 'fm²' | 'fm2' | 'acre' | 'acres' | 'ac' | 'centiare' | 'centiares' | 'ca' | 'deciare' | 'deciares' | 'da' | 'are' | 'ares' | 'decare' | 'decares' | 'daa' | 'hectare' | 'hectares' | 'ha' | 'square foot' | 'square feet' | 'sq ft' | 'ft²' | 'ft2' | 'square inch' | 'square inches' | 'sq in' | 'in²' | 'in2' | 'square yard' | 'square yards' | 'sq yd' | 'yd²' | 'yd2' | 'square mile' | 'square miles' | 'sq mi' | 'mi²' | 'mi2' | 'mǔ' | 'mu'; 2: 'bit' | 'bits' | 'b' | 'pebibit' | 'pebibits' | 'Pib' | 'tebibit' | 'tebibits' | 'Tib' | 'gibibit' | 'gibibits' | 'Gib' | 'mebibit' | 'mebibits' | 'Mib' | 'kibibit' | 'kibibits' | 'Kib' | 'Kb' | 'KB' | 'petabit' | 'petabits' | 'Pb' | 'terabit' | 'terabits' | 'Tb' | 'gigabit' | 'gigabits' | 'Gb' | 'megabit' | 'megabits' | 'Mb' | 'kilobit' | 'kilobits' | 'kb' | 'hectobit' | 'hectobits' | 'hb' | 'decabit' | 'decabits' | 'dab' | 'decibit' | 'decibits' | 'db' | 'centibit' | 'centibits' | 'cb' | 'millibit' | 'millibits' | 'mb' | 'microbit' | 'microbits' | 'μb' | 'µb' | 'nanobit' | 'nanobits' | 'nb' | 'picobit' | 'picobits' | 'pb' | 'femtobit' | 'femtobits' | 'fb' | 'nibble' | 'nibbles' | 'semioctet' | 'semioctets' | 'halfbyte' | 'halfbytes' | 'byte' | 'bytes' | 'octect' | 'octects' | 'B' | 'pebibyte' | 'pebibytes' | 'PiB' | 'tebibyte' | 'tebibytes' | 'TiB' | 'gibibyte' | 'gibibytes' | 'GiB' | 'mebibyte' | 'mebibytes' | 'MiB' | 'kibibyte' | 'kibibytes' | 'KiB' | 'petabyte' | 'petabytes' | 'PB' | 'terabyte' | 'terabytes' | 'TB' | 'gigabyte' | 'gigabytes' | 'GB' | 'megabyte' | 'megabytes' | 'MB' | 'kilobyte' | 'kilobytes' | 'kB' | 'hectobyte' | 'hectobytes' | 'hB' | 'decabyte' | 'decabytes' | 'daB' | 'decibyte' | 'decibytes' | 'dB' | 'centibyte' | 'centibytes' | 'cB' | 'millibyte' | 'millibytes' | 'mB' | 'microbyte' | 'microbytes' | 'μB' | 'µB' | 'nanobyte' | 'nanobytes' | 'nB' | 'picobyte' | 'picobytes' | 'pB' | 'femtobyte' | 'femtobytes' | 'fB' | 'hextet' | 'hextets'; 3: 'joule' | 'joules' | 'J' | 'petajoule' | 'petajoules' | 'PJ' | 'terajoule' | 'terajoules' | 'TJ' | 'gigajoule' | 'gigajoules' | 'GJ' | 'megajoule' | 'megajoules' | 'MJ' | 'kilojoule' | 'kilojoules' | 'kJ' | 'hectojoule' | 'hectojoules' | 'hJ' | 'decajoule' | 'decajoules' | 'daJ' | 'decijoule' | 'decijoules' | 'dJ' | 'centijoule' | 'centijoules' | 'cJ' | 'millijoule' | 'millijoules' | 'mJ' | 'microjoule' | 'microjoules' | 'μJ' | 'µJ' | 'nanojoule' | 'nanojoules' | 'nJ' | 'picojoule' | 'picojoules' | 'pJ' | 'femtojoule' | 'femtojoules' | 'fJ' | 'watt-hour' | 'W⋅h' | 'W h' | 'Wh' | 'petawatt-hour' | 'petawatt-hours' | 'PW⋅h' | 'PW h' | 'PWh' | 'terawatt-hour' | 'terawatt-hours' | 'TW⋅h' | 'TW h' | 'TWh' | 'gigawatt-hour' | 'gigawatt-hours' | 'GW⋅h' | 'GW h' | 'GWh' | 'megawatt-hour' | 'megawatt-hours' | 'MW⋅h' | 'MW h' | 'MWh' | 'kilowatt-hour' | 'kilowatt-hours' | 'kW⋅h' | 'kW h' | 'kWh' | 'hectowatt-hour' | 'hectowatt-hours' | 'hW⋅h' | 'hW h' | 'hWh' | 'decawatt-hour' | 'decawatt-hours' | 'daW⋅h' | 'daW h' | 'daWh' | 'deciwatt-hour' | 'deciwatt-hours' | 'dW⋅h' | 'dW h' | 'dWh' | 'centiwatt-hour' | 'centiwatt-hours' | 'cW⋅h' | 'cW h' | 'cWh' | 'milliwatt-hour' | 'milliwatt-hours' | 'mW⋅h' | 'mW h' | 'mWh' | 'microwatt-hour' | 'microwatt-hours' | 'μW⋅h' | 'µW⋅h' | 'μW h' | 'µW h' | 'μWh' | 'µWh' | 'nanowatt-hour' | 'nanowatt-hours' | 'nW⋅h' | 'nW h' | 'nWh' | 'picowatt-hour' | 'picowatt-hours' | 'pW⋅h' | 'pW h' | 'pWh' | 'femtowatt-hour' | 'femtowatt-hours' | 'fW⋅h' | 'fW h' | 'fWh'; 4: 'newton' | 'newtons' | 'N' | 'petanewton' | 'petanewtons' | 'PN' | 'teranewton' | 'teranewtons' | 'TN' | 'giganewton' | 'giganewtons' | 'GN' | 'meganewton' | 'meganewtons' | 'MN' | 'kilonewton' | 'kilonewtons' | 'kN' | 'hectonewton' | 'hectonewtons' | 'hN' | 'decanewton' | 'decanewtons' | 'daN' | 'decinewton' | 'decinewtons' | 'dN' | 'centinewton' | 'centinewtons' | 'cN' | 'millinewton' | 'millinewtons' | 'mN' | 'micronewton' | 'micronewtons' | 'μN' | 'µN' | 'nanonewton' | 'nanonewtons' | 'nN' | 'piconewton' | 'piconewtons' | 'pN' | 'femtonewton' | 'femtonewtons' | 'fN' | 'dyne' | 'dynes' | 'dyn' | 'pound of force' | 'pound-force' | 'lbf' | 'kip' | 'klb' | 'kipf' | 'klbf' | 'poundal' | 'poundals' | 'pdl' | 'kilogram-force' | 'kilopond' | 'kiloponds' | 'kgf' | 'kp' | 'tonne-force' | 'metric ton-force' | 'megagram-force' | 'megapond' | 'tf' | 'Mp'; 5: 'meter' | 'meters' | 'metre' | 'metres' | 'm' | 'petameter' | 'petametre' | 'petameters' | 'petametres' | 'Pm' | 'terameter' | 'terametre' | 'terameters' | 'terametres' | 'Tm' | 'gigameter' | 'gigametre' | 'gigameters' | 'gigametres' | 'Gm' | 'megameter' | 'megametre' | 'megameters' | 'megametres' | 'Mm' | 'kilometer' | 'kilometre' | 'kilometers' | 'kilometres' | 'km' | 'hectometer' | 'hectometre' | 'hectometers' | 'hectometres' | 'hm' | 'decameter' | 'decametre' | 'decameters' | 'decametres' | 'dam' | 'decimeter' | 'decimetre' | 'decimeters' | 'decimetres' | 'dm' | 'centimeter' | 'centimetre' | 'centimeters' | 'centimetres' | 'cm' | 'millimeter' | 'millimetre' | 'millimeters' | 'millimetres' | 'mm' | 'micrometer' | 'micrometre' | 'micrometers' | 'micrometres' | 'μm' | 'µm' | 'nanometer' | 'nanometre' | 'nanometers' | 'nanometres' | 'nm' | 'picometer' | 'picometre' | 'picometers' | 'picometres' | 'pm' | 'femtometer' | 'femtometre' | 'femtometers' | 'femtometres' | 'fm' | 'foot' | 'feet' | 'ft' | '\'' | 'US survey foot' | 'US survey feet' | 'U.S. survey foot' | 'U.S. survey feet' | 'inch' | 'inches' | 'in' | '\"' | 'yard' | 'yards' | 'yd' | 'mile' | 'miles' | 'mi' | 'nautical mile' | 'nautical miles' | 'M' | 'NM' | 'nmi' | 'light-year' | 'light-years' | 'ly' | 'pica' | 'picas' | 'pc' | 'point' | 'points'; 6: 'gram' | 'grams' | 'g' | 'petagram' | 'petagrams' | 'Pg' | 'teragram' | 'teragrams' | 'Tg' | 'gigagram' | 'gigagrams' | 'Gg' | 'megagram' | 'megagrams' | 'Mg' | 'kilogram' | 'kilograms' | 'kg' | 'hectogram' | 'hectograms' | 'hg' | 'decagram' | 'decagrams' | 'dag' | 'decigram' | 'decigrams' | 'dg' | 'centigram' | 'centigrams' | 'cg' | 'milligram' | 'milligrams' | 'mg' | 'microgram' | 'micrograms' | 'μg' | 'µg' | 'nanogram' | 'nanograms' | 'ng' | 'picogram' | 'picograms' | 'pg' | 'femtogram' | 'femtograms' | 'fg' | 'mcg' | 'tonne' | 'tonnes' | 'metric ton' | 'metric tons' | 't' | 'kilotonne' | 'kilotonnes' | 'kt' | 'megatonne' | 'megatonnes' | 'Mt' | 'gigatonne' | 'gigatonnes' | 'Gt' | 'pound' | 'pounds' | 'lb' | 'lbs' | 'grain' | 'grains' | 'gr' | 'stone' | 'stones' | 'st' | 'ounce' | 'ounces' | 'oz' | 'short hundredweight' | 'cental' | 'long hundredweight' | 'imperial hundredweight' | 'cwt' | 'short ton' | 'short tons' | 'US ton' | 'US tons' | 'long ton' | 'long tons' | 'imperial ton' | 'imperial tons' | 'displacement ton' | 'displacement tons' | 'troy ounce' | 'oz t' | 'toz'; 7: 'watt' | 'watts' | 'W' | 'petawatt' | 'petawatts' | 'PW' | 'terawatt' | 'terawatts' | 'TW' | 'gigawatt' | 'gigawatts' | 'GW' | 'megawatt' | 'megawatts' | 'MW' | 'kilowatt' | 'kilowatts' | 'kW' | 'hectowatt' | 'hectowatts' | 'hW' | 'decawatt' | 'decawatts' | 'daW' | 'deciwatt' | 'deciwatts' | 'dW' | 'centiwatt' | 'centiwatts' | 'cW' | 'milliwatt' | 'milliwatts' | 'mW' | 'microwatt' | 'microwatts' | 'μW' | 'µW' | 'nanowatt' | 'nanowatts' | 'nW' | 'picowatt' | 'picowatts' | 'pW' | 'femtowatt' | 'femtowatts' | 'fW' | 'horsepower' | 'mechanical horsepower' | 'hp'; 8: 'pascal' | 'pascals' | 'Pa' | 'petapascal' | 'petapascals' | 'PPa' | 'terapascal' | 'terapascals' | 'TPa' | 'gigapascal' | 'gigapascals' | 'GPa' | 'megapascal' | 'megapascals' | 'MPa' | 'kilopascal' | 'kilopascals' | 'kPa' | 'hectopascal' | 'hectopascals' | 'hPa' | 'decapascal' | 'decapascals' | 'daPa' | 'decipascal' | 'decipascals' | 'dPa' | 'centipascal' | 'centipascals' | 'cPa' | 'millipascal' | 'millipascals' | 'mPa' | 'micropascal' | 'micropascals' | 'μPa' | 'µPa' | 'nanopascal' | 'nanopascals' | 'nPa' | 'picopascal' | 'picopascals' | 'pPa' | 'femtopascal' | 'femtopascals' | 'fPa' | 'bar' | 'bars' | 'petabar' | 'petabars' | 'Pbar' | 'terabar' | 'terabars' | 'Tbar' | 'gigabar' | 'gigabars' | 'Gbar' | 'megabar' | 'megabars' | 'Mbar' | 'kilobar' | 'kilobars' | 'kbar' | 'hectobar' | 'hectobars' | 'hbar' | 'decabar' | 'decabars' | 'dabar' | 'decibar' | 'decibars' | 'dbar' | 'centibar' | 'centibars' | 'cbar' | 'millibar' | 'millibars' | 'mbar' | 'microbar' | 'microbars' | 'μbar' | 'µbar' | 'nanobar' | 'nanobars' | 'nbar' | 'picobar' | 'picobars' | 'pbar' | 'femtobar' | 'femtobars' | 'fbar' | 'torr' | 'torrs' | 'Torr' | 'millitorr' | 'mTorr' | 'atmosphere' | 'atmospheres' | 'atm' | 'pound per square inch' | 'pounds per square inch' | 'psi' | 'lbf/in2' | 'lbf/in²' | 'inch of water' | 'inches of water' | 'inAq' | 'Aq' | 'inch of mercury' | 'inches of mercury' | 'inHg' | 'Hg'; 9: 'kelvin' | 'kelvins' | 'K' | 'petakelvin' | 'petakelvins' | 'PK' | 'terakelvin' | 'terakelvins' | 'TK' | 'gigakelvin' | 'gigakelvins' | 'GK' | 'megakelvin' | 'megakelvins' | 'MK' | 'kilokelvin' | 'kilokelvins' | 'kK' | 'hectokelvin' | 'hectokelvins' | 'hK' | 'decakelvin' | 'decakelvins' | 'daK' | 'decikelvin' | 'decikelvins' | 'dK' | 'centikelvin' | 'centikelvins' | 'cK' | 'millikelvin' | 'millikelvins' | 'mK' | 'microkelvin' | 'microkelvins' | 'μK' | 'µK' | 'nanokelvin' | 'nanokelvins' | 'nK' | 'picokelvin' | 'picokelvins' | 'pK' | 'femtokelvin' | 'femtokelvins' | 'fK' | 'fahrenheit' | 'F' | 'celsius' | 'C' | '°C' | 'rankine' | 'R'; 10: 'second' | 'seconds' | 's' | 'petasecond' | 'petaseconds' | 'Ps' | 'terasecond' | 'teraseconds' | 'Ts' | 'gigasecond' | 'gigaseconds' | 'Gs' | 'megasecond' | 'megaseconds' | 'Ms' | 'kilosecond' | 'kiloseconds' | 'ks' | 'hectosecond' | 'hectoseconds' | 'hs' | 'decasecond' | 'decaseconds' | 'das' | 'decisecond' | 'deciseconds' | 'ds' | 'centisecond' | 'centiseconds' | 'cs' | 'millisecond' | 'milliseconds' | 'ms' | 'microsecond' | 'microseconds' | 'μs' | 'µs' | 'nanosecond' | 'nanoseconds' | 'ns' | 'picosecond' | 'picoseconds' | 'ps' | 'femtosecond' | 'femtoseconds' | 'fs' | 'minute' | 'minutes' | 'min' | 'hour' | 'hours' | 'h' | 'milliday' | 'millidays' | 'md' | 'day' | 'days' | 'd' | 'week' | 'weeks' | 'wk' | 'fortnight' | 'fortnights' | 'fn' | 'month' | 'months' | 'mo' | 'year' | 'years' | 'a' | 'y' | 'yr' | 'decade' | 'decades' | 'dec' | 'century' | 'centuries' | 'millennium' | 'millennia' | 'moment' | 'moments' | 'shake' | 'shakes' | 'time unit' | 'TU' | 'svedberg' | 'svedbergs' | 'S'; 11: 'cubic meter' | 'cubic meters' | 'cubic metre' | 'cubic metres' | 'stere' | 'steres' | 'm³' | 'm3' | 'cubic petameter' | 'cubic petameters' | 'Pm3' | 'Pm³' | 'cubic terameter' | 'cubic terameters' | 'Tm3' | 'Tm³' | 'cubic gigameter' | 'cubic gigameters' | 'Gm3' | 'Gm³' | 'cubic megameter' | 'cubic megameters' | 'Mm3' | 'Mm³' | 'cubic kilometer' | 'cubic kilometers' | 'km3' | 'km³' | 'cubic hectometer' | 'cubic hectometers' | 'hm3' | 'hm³' | 'cubic decameter' | 'cubic decameters' | 'dam3' | 'dam³' | 'cubic decimeter' | 'cubic decimeters' | 'dm3' | 'dm³' | 'cubic centimeter' | 'cubic centimeters' | 'cm3' | 'cm³' | 'cubic millimeter' | 'cubic millimeters' | 'mm3' | 'mm³' | 'cubic micrometer' | 'cubic micrometers' | 'μm3' | 'µm3' | 'μm³' | 'µm³' | 'cubic nanometer' | 'cubic nanometers' | 'nm3' | 'nm³' | 'cubic picometer' | 'cubic picometers' | 'pm3' | 'pm³' | 'cubic femtometer' | 'cubic femtometers' | 'fm3' | 'fm³' | 'liter' | 'liters' | 'litre' | 'litres' | 'l' | 'L' | 'petaliter' | 'petaliters' | 'petalitre' | 'petalitres' | 'Pl' | 'PL' | 'teraliter' | 'teraliters' | 'teralitre' | 'teralitres' | 'Tl' | 'TL' | 'gigaliter' | 'gigaliters' | 'gigalitre' | 'gigalitres' | 'Gl' | 'GL' | 'megaliter' | 'megaliters' | 'megalitre' | 'megalitres' | 'Ml' | 'ML' | 'kiloliter' | 'kiloliters' | 'kilolitre' | 'kilolitres' | 'kl' | 'kL' | 'hectoliter' | 'hectoliters' | 'hectolitre' | 'hectolitres' | 'hl' | 'hL' | 'decaliter' | 'decaliters' | 'decalitre' | 'decalitres' | 'dal' | 'daL' | 'deciliter' | 'deciliters' | 'decilitre' | 'decilitres' | 'dl' | 'dL' | 'centiliter' | 'centiliters' | 'centilitre' | 'centilitres' | 'cl' | 'cL' | 'milliliter' | 'milliliters' | 'millilitre' | 'millilitres' | 'ml' | 'mL' | 'microliter' | 'microliters' | 'microlitre' | 'microlitres' | 'μl' | 'µl' | 'μL' | 'µL' | 'nanoliter' | 'nanoliters' | 'nanolitre' | 'nanolitres' | 'nl' | 'nL' | 'picoliter' | 'picoliters' | 'picolitre' | 'picolitres' | 'pl' | 'pL' | 'femtoliter' | 'femtoliters' | 'femtolitre' | 'femtolitres' | 'fl' | 'fL' | 'cubic mile' | 'cubic miles' | 'cu mi' | 'mi3' | 'mi³' | 'acre-foot' | 'acre-feet' | 'ac⋅ft' | 'ac ft' | 'cubic yard' | 'cubic yards' | 'cu yd' | 'yd3' | 'yd³' | 'cubic foot' | 'cubic feet' | 'cu ft' | 'ft3' | 'ft³' | 'board foot' | 'board feet' | 'cubic inch' | 'cubic inches' | 'cu in' | 'in3' | 'in³' | 'measurement ton' | 'measurement tons' | 'MTON' | 'imperial barrel' | 'imperial barrels' | 'imp bbl' | 'imperial bushel' | 'imperial bushels' | 'imp bsh' | 'imp bu' | 'imperial peck' | 'imperial pecks' | 'pk' | 'imp pk' | 'imperial gallon' | 'imperial gallons' | 'imp gal' | 'imperial quart' | 'imperial quarts' | 'imp qt' | 'imperial pint' | 'imperial pints' | 'imp pt' | 'imperial fluid ounce' | 'imperial fluid ounces' | 'imp fl oz' | 'teaspoon' | 'teaspoons' | 'US teaspoon' | 'US teaspoons' | 'tsp' | 'tablespoon' | 'tablespoons' | 'US tablespoon' | 'US tablespoons' | 'tbsp' | 'US fluid ounce' | 'US fluid ounces' | 'fl oz' | 'fl. oz.' | 'oz. fl.' | 'cup' | 'cups' | 'c' | 'US legal cup' | 'US legal cups' | 'US lc' | 'pint' | 'pints' | 'US liquid pint' | 'US liquid pints' | 'pt' | 'p' | 'quart' | 'quarts' | 'US liquid quart' | 'US liquid quarts' | 'qt' | 'gallon' | 'gallons' | 'US liquid gallon' | 'US liquid gallons' | 'gal' | 'US bushel' | 'US bushels' | 'US bsh' | 'US bu' | 'US peck' | 'US pk' | 'US dry gallon' | 'US dry gal' | 'US dry barrel' | 'US dry barrels' | 'US dry bbl' | 'US dry quart' | 'US dry qt' | 'US dry pint' | 'US dry pt'; }; /** * Valid volume units. * @public */ export declare type Volume = UnitsByMeasure<MeasureKind.Volume>; export { }