[@types/mathjs] update Unit

Base on current docs http://mathjs.org/docs/datatypes/units.html#api
This commit is contained in:
Fahmi Akbar Wildana
2018-05-18 09:22:00 +07:00
committed by GitHub
parent ec4a2f8c6f
commit 3fb449e39a
+17
View File
@@ -1307,9 +1307,26 @@ declare namespace math { // tslint:disable-line strict-export-declare-modifiers
phi: number;
}
interface MathJSON {
mathjs?: string;
value: number;
unit: string;
fixPrefix?: boolean;
}
interface Unit {
to(unit: string): Unit;
toNumber(unit: string): number;
clone(): Unit;
equalBase(unit: Unit): boolean;
equals(unit: Unit): boolean;
format(options: FormatOptions): string;
fromJSON(json: MathJSON): Unit;
toJSON(): MathJSON;
splitUnit(parts: string[]): Unit[];
toNumeric(unit: string): number | Fraction | BigNumber;
toSI(): Unit;
toString(): string;
}
interface CreateUnitOptions {