[@types/mathjs] fill out BigNumber and Fraction interfaces

This commit is contained in:
andy.patterson
2018-03-30 13:15:05 -04:00
parent c895c48502
commit 0801530e9d
2 changed files with 16 additions and 9 deletions

View File

@@ -1,9 +1,12 @@
import { Decimal } from 'decimal.js';
// Type definitions for mathjs
// Project: http://mathjs.org/
// Definitions by: Ilya Shestakov <https://github.com/siavol>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var math: mathjs.IMathJsStatic;
export as namespace math;
export = math;
declare namespace mathjs {
@@ -304,7 +307,7 @@ declare namespace mathjs {
* @param x The base
* @param y The exponent
*/
pow(x: number|BigNumber|Complex|MathArray|Matrix, y: number|BigNumber|Complex): number|BigNumber|Complex|MathArray|Matrix;
pow(x: MathType, y: number|BigNumber|Complex): MathType;
/**
* Round a value towards the nearest integer. For matrices, the function is evaluated element wise.
@@ -1333,12 +1336,14 @@ declare namespace mathjs {
swapRows(i: number, j: number): Matrix;
}
export interface BigNumber {
export interface BigNumber extends Decimal {
}
export interface Fraction {
s: number;
n: number;
d: number;
}
export interface Complex {
@@ -1349,9 +1354,9 @@ declare namespace mathjs {
}
export interface IPolarCoordinates {
r: number;
r: number;
phi: number;
}
}
export interface Unit {
to(unit: string): Unit;
@@ -2309,7 +2314,3 @@ declare namespace mathjs {
toString(): string;
}
}
declare module 'mathjs'{
export = math;
}

View File

@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"decimal.js": "^10.0.0"
}
}