mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-31 11:07:32 +08:00
Merge pull request #25860 from DrSensor/patch-1
[@types/mathjs] add missing Unit object functions
This commit is contained in:
19
types/mathjs/index.d.ts
vendored
19
types/mathjs/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for mathjs 3.20
|
||||
// Type definitions for mathjs 3.21
|
||||
// Project: http://mathjs.org/
|
||||
// Definitions by: Ilya Shestakov <https://github.com/siavol>,
|
||||
// Andy Patterson <https://github.com/andnp>
|
||||
@@ -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: ReadonlyArray<string>): Unit[];
|
||||
toNumeric(unit: string): number | Fraction | BigNumber;
|
||||
toSI(): Unit;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface CreateUnitOptions {
|
||||
|
||||
Reference in New Issue
Block a user