Skip to content

Commit

Permalink
feat: add energy and power units
Browse files Browse the repository at this point in the history
Closes #391
  • Loading branch information
jonahsnider committed Jan 25, 2022
1 parent 9e271fa commit 828c322
Show file tree
Hide file tree
Showing 14 changed files with 2,027 additions and 1,359 deletions.
30 changes: 23 additions & 7 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,23 @@ export const enum _ConversionFamilyId {
// (undocumented)
Data = 2,
// (undocumented)
Force = 3,
Energy = 3,
// (undocumented)
Length = 4,
Force = 4,
// (undocumented)
Mass = 5,
Length = 5,
// (undocumented)
Pressure = 6,
Mass = 6,
// (undocumented)
Temperature = 7,
Power = 7,
// (undocumented)
Time = 8,
Pressure = 8,
// (undocumented)
Volume = 9
Temperature = 9,
// (undocumented)
Time = 10,
// (undocumented)
Volume = 11
}

// @public
Expand All @@ -66,6 +70,9 @@ function convert<Q extends number | bigint>(quantity: Q, from: Area): Converter<
// @public
function convert<Q extends number | bigint>(quantity: Q, from: Data): Converter<Q, Data>;

// @public
function convert<Q extends number | bigint>(quantity: Q, from: Energy): Converter<Q, Energy>;

// @public
function convert<Q extends number | bigint>(quantity: Q, from: Force): Converter<Q, Force>;

Expand All @@ -75,6 +82,9 @@ function convert<Q extends number | bigint>(length: Q, from: Length): Converter<
// @public
function convert<Q extends number | bigint>(quantity: Q, from: Mass): Converter<Q, Mass>;

// @public
function convert<Q extends number | bigint>(quantity: Q, from: Power): Converter<Q, Power>;

// @public
function convert<Q extends number | bigint>(quantity: Q, from: Pressure): Converter<Q, Pressure>;

Expand Down Expand Up @@ -104,6 +114,9 @@ export function convertMany(value: string): Converter<number, Unit>;
// @public
export type Data = GetAliases<_ConversionFamilyId.Data>;

// @public
export type Energy = GetAliases<_ConversionFamilyId.Energy>;

// @public
export type Force = GetAliases<_ConversionFamilyId.Force>;

Expand All @@ -127,6 +140,9 @@ export function ms<Q extends number | bigint>(quantity: Q): `${SimplifyQuantity<
// @public
export function ms(value: string): number;

// @public
export type Power = GetAliases<_ConversionFamilyId.Power>;

// @public
export type Pressure = GetAliases<_ConversionFamilyId.Pressure>;

Expand Down
Loading

0 comments on commit 828c322

Please sign in to comment.