forked from MaxOhn/rosu-pp-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
191 lines (164 loc) · 4.25 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
export class Beatmap {
constructor(options?: BeatmapOptions)
fromPath(path: string): Beatmap
fromContent(content: string | Uint8Array): Beatmap
fromBytes(bytes: Uint8Array): Beatmap
ar(ar: number): Beatmap
cs(cs: number): Beatmap
hp(hp: number): Beatmap
od(od: number): Beatmap
}
export interface BeatmapOptions {
path?: string
content?: string | Uint8Array
bytes?: Uint8Array
ar?: number
cs?: number
hp?: number
od?: number
}
export class Calculator {
constructor(score?: Score)
mapAttributes(map: Beatmap): MapAttributes
difficulty(map: Beatmap): DifficultyAttributes
performance(map: Beatmap): PerformanceAttributes
strains(map: Beatmap): Strains
mode(mode: GameMode): Calculator
mods(mods: number): Calculator
acc(acc: number): Calculator
nGeki(nGeki: number): Calculator
nKatu(nKatu: number): Calculator
n300(n300: number): Calculator
n100(n100: number): Calculator
n50(n50: number): Calculator
nMisses(nMisses: number): Calculator
combo(combo: number): Calculator
passedObjects(passedObjects: number): Calculator
clockRate(clockRate: number): Calculator
}
export interface Score {
mode?: GameMode
mods?: number
acc?: number
nGeki?: number
nKatu?: number
n300?: number
n100?: number
n50?: number
nMisses?: number
combo?: number
passedObjects?: number
clockRate?: number
}
export interface MapAttributes {
mode: GameMode
version: number
nCircles: number
nSliders: number
nSpinners: number
ar: number
cs: number
hp: number
od: number
arHitWindow: number
odHitWindow: number
clockRate: number
bpm: number
}
export const enum GameMode {
Osu = 0,
Taiko = 1,
Catch = 2,
Mania = 3
}
export interface AnyDifficultyAttributes {
stars: number
maxCombo: number
}
export interface OsuDifficultyAttributes extends AnyDifficultyAttributes {
mode: GameMode.Osu
aim: number
speed: number
flashlight: number
sliderFactor: number
speedNoteCount: number
ar: number
od: number
nCircles: number
nSliders: number
nSpinners: number
}
export interface TaikoDifficultyAttributes extends AnyDifficultyAttributes {
mode: GameMode.Taiko
stamina: number
rhythm: number
color: number
peak: number
hitWindow: number
}
export interface CatchDifficultyAttributes extends AnyDifficultyAttributes {
mode: GameMode.Catch
ar: number
nFruits: number
nDroplets: number
nTinyDroplets: number
}
export interface ManiaDifficultyAttributes extends AnyDifficultyAttributes {
mode: GameMode.Mania
hitWindow: number
}
export type DifficultyAttributes = OsuDifficultyAttributes | TaikoDifficultyAttributes | CatchDifficultyAttributes | ManiaDifficultyAttributes
export interface AnyPerformanceAttributes {
pp: number
}
export interface OsuPerformanceAttributes extends AnyPerformanceAttributes {
mode: GameMode.Osu
difficulty: OsuDifficultyAttributes
ppAcc: number
ppAim: number
ppFlashlight: number
ppSpeed: number
effectiveMissCount: number
}
export interface TaikoPerformanceAttributes extends AnyPerformanceAttributes {
mode: GameMode.Taiko
difficulty: TaikoDifficultyAttributes
ppAcc: number
ppDifficulty: number
effectiveMissCount: number
}
export interface CatchPerformanceAttributes extends AnyPerformanceAttributes {
mode: GameMode.Catch
difficulty: CatchDifficultyAttributes
ppDifficulty: number
}
export interface ManiaPerformanceAttributes extends AnyPerformanceAttributes {
mode: GameMode.Mania
difficulty: ManiaDifficultyAttributes
}
export type PerformanceAttributes = OsuPerformanceAttributes | TaikoPerformanceAttributes | CatchPerformanceAttributes | ManiaPerformanceAttributes
export interface AnyStrains {
sectionLength: number
}
export interface OsuStrains extends AnyStrains {
mode: GameMode.Osu
aim: Array<number>
aimNoSliders: Array<number>
speed: Array<number>
flashlight: Array<number>
}
export interface TaikoStrains extends AnyStrains {
mode: GameMode.Taiko
color: Array<number>
rhythm: Array<number>
stamina: Array<number>
}
export interface CatchStrains extends AnyStrains {
mode: GameMode.Catch
movement: Array<number>
}
export interface ManiaStrains extends AnyStrains {
mode: GameMode.Mania
strains: Array<number>
}
export type Strains = OsuStrains | TaikoStrains | CatchStrains | ManiaStrains