From 3fb449e39a30595871cff946f4e369ca002444e4 Mon Sep 17 00:00:00 2001 From: Fahmi Akbar Wildana Date: Fri, 18 May 2018 09:22:00 +0700 Subject: [PATCH] [@types/mathjs] update Unit Base on current docs http://mathjs.org/docs/datatypes/units.html#api --- types/mathjs/index.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index a02729b635..f0694feb99 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -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 {