From 3fb449e39a30595871cff946f4e369ca002444e4 Mon Sep 17 00:00:00 2001 From: Fahmi Akbar Wildana Date: Fri, 18 May 2018 09:22:00 +0700 Subject: [PATCH 1/3] [@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 { From 5f58da50b39a59509b4d87515f8000048c0a40e6 Mon Sep 17 00:00:00 2001 From: Fahmi Akbar Wildana Date: Fri, 18 May 2018 09:34:13 +0700 Subject: [PATCH 2/3] [avoid common mistake] change to ReadonlyArray --- types/mathjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index f0694feb99..7141fa077c 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1323,7 +1323,7 @@ declare namespace math { // tslint:disable-line strict-export-declare-modifiers format(options: FormatOptions): string; fromJSON(json: MathJSON): Unit; toJSON(): MathJSON; - splitUnit(parts: string[]): Unit[]; + splitUnit(parts: ReadonlyArray): Unit[]; toNumeric(unit: string): number | Fraction | BigNumber; toSI(): Unit; toString(): string; From 023a89ede6e2f1c642ed0384a9a6d148d67e9bb2 Mon Sep 17 00:00:00 2001 From: Fahmi Akbar Wildana Date: Fri, 18 May 2018 09:41:12 +0700 Subject: [PATCH 3/3] increase version number --- types/mathjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index 7141fa077c..cdecc3e1b4 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for mathjs 3.20 +// Type definitions for mathjs 3.21 // Project: http://mathjs.org/ // Definitions by: Ilya Shestakov , // Andy Patterson