forked from oppia/oppia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmathjs-defs-9.0.0.d.ts
56 lines (47 loc) · 976 Bytes
/
mathjs-defs-9.0.0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Code - https://github.com/josdejong/mathjs
// This definition can be removed once the issue here:
// https://github.com/josdejong/mathjs/issues/2286 is resolved.
import {MathJsStatic, Unit} from 'mathjs';
interface UnitComponent {
power: number;
prefix: UnitPrefix;
unit: {
name: string;
base: {
dimensions: number[];
key: string;
};
prefixes: Record<string, UnitPrefix>;
value: number;
offset: number;
dimensions: number[];
};
}
interface UnitPrefix {
name: string;
value: number;
scientific: boolean;
}
interface Prefix {
name: string;
value: number;
scientific: boolean;
}
interface PrefixSet {
[key: string]: Prefix;
}
interface Prefixes {
[key: string]: PrefixSet;
}
interface IUnit extends Unit {
isValuelessUnit: (unit: string) => boolean;
PREFIXES: Prefixes;
}
declare module 'mathjs' {
interface MathJsStatic {
Unit: IUnit;
}
interface Unit {
units: UnitComponent[];
}
}