-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
95 lines (83 loc) · 2.61 KB
/
index.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
export var common: Common;
export var descriptive: Descriptive;
export var frequency: Frequency;
export var distribution: Distribution;
export interface Common {
round(value: number, decimalPlaces?: number): number;
toArray(dataset: number[] | {}): number[];
max(data: number[] | {}): number;
min(data: number[] | {}): number;
range(data: number[] | {}): RangeResult;
validateArray(data: number[]): number[];
sum(data: number[] | {}): number;
round(value: number, decimalPlaces?: number): number;
isNumber(value: any): boolean;
curry: Curry;
compose<T>(...functions: Array<ComposeFunction<T>>): ComposeFunction<T>;
isEven(value: number): boolean;
sortAsc(data: number[] | {}): number[];
sortDesc(data: number[] | {}): number[];
isWhole(value: number): boolean;
factorial(n: number): number;
}
export interface Descriptive {
box(data: number[] | {}): BoxData;
mean(data: number[] | {}): number;
median(data: number[] | {}): number;
mode(data: number[] | {}): number[];
stdDev(data: number[] | {}): number;
variance(data: number | {}): number;
zScore(data: number[] | {}, value: number): number;
firstQuartile(data: number[] | {}): number;
thirdQuartile(data: number[] | {}): number;
interQuartileRange(data: number[] | {}): number;
}
export interface Distribution {
chiSquare(observedFreq: number, expectedFreq: number): number;
poisson(x: number, avgSuccessRate: number): number;
binomial: Binomial;
}
export interface Binomial {
table(events: number): Dataset;
coefficient(events: number, x: number): number;
}
export interface BoxData {
mean: number;
mode: number[];
median: number;
range: RangeResult;
upperQuartile: number;
lowerQuartile: number;
}
export interface Set {
distinct(data: number[] | {}): number[];
intersect(left: number[] | {}, right: number[] | {}): number[];
union(left: number[] | {}, right: number[] | {}): number[]
}
export interface RangeResult {
minimum: number;
maximum: number;
difference: number;
}
export interface Frequency {
table(data: number[] | {}): Dataset;
histogram(data: number[] | {}, binSettings?: BinSettings): Dataset;
relative(data: number[] | {}): Dataset;
}
export interface BinSettings {
binCount?: number;
binSize?: number;
minimum?: number;
maximum?: number;
difference?: number;
}
export interface Dataset {
[index: string]: number;
}
export interface Curry {
(fn: Function, ...fnArgs: any[]): (...args: any[]) => any;
gap: any;
}
export interface ComposeFunction<T> {
(...args: any[]): T;
}