osu-api-extended
Version:
Advanced osu! api wrapper cover all V2 and V1 endpoints, and provide useful tools
109 lines (108 loc) • 2.97 kB
TypeScript
import { IError } from "../types";
import { GamemodeEnum } from "../types/enums";
import { ConvertHitsResponse, TotalObjectsResponse } from "../types/tools";
type Hits = {
300?: any;
100?: any;
50?: any;
0?: any;
geki?: any;
katu?: any;
perfect?: any;
great?: any;
good?: any;
ok?: any;
meh?: any;
miss?: any;
count_geki?: any;
count_300?: any;
count_katu?: any;
count_100?: any;
count_50?: any;
count_miss?: any;
};
type Response = TotalObjectsResponse & IError;
/**
* Calculate total passed objects
*
*
*
* ### Parameters
* - `hits.geki` or `hits.perfect` or `hits.count_geki` - Amount of geki's
* - `hits[300]` or `hits.great` or `hits.count_300` - Amount of 300's
* - `hits.katu` or `hits.good` or `hits.count_katu` - Amount of katu's
* - `hits[100]` or `hits.ok` or `hits.count_100` - Amount of 100's
* - `hits[50]` or `hits.meh` or `hits.count_50` - Amount of 50's
* - `hits[0]` or `hits.miss` or `hits.count_miss` - Amount of misses
*
* - `mode` - Number/Name of the gamemode
*
*
*
* ### Usage Example
* ```js
* const { tools } = require('osu-api-extended');
*
* function main() {
* try {
* const hits = { 300: 123, 100: 12, 50: 1, 0: 1 };
* const result = tools.calculate_total_passed_objects(hits, 'osu');
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*/
export declare const calculate_total_passed_objects: (hits: Hits, mode: GamemodeEnum | string | number) => Response;
type ResponseConvert = ConvertHitsResponse & IError;
/**
* Calculate a play as an FC with the given hits.
*
*
*
* ### Parameters
* - `hits.geki` or `hits.perfect` or `hits.count_geki` - Amount of geki's
* - `hits[300]` or `hits.great` or `hits.count_300` - Amount of 300's
* - `hits.katu` or `hits.good` or `hits.count_katu` - Amount of katu's
* - `hits[100]` or `hits.ok` or `hits.count_100` - Amount of 100's
* - `hits[50]` or `hits.meh` or `hits.count_50` - Amount of 50's
* - `hits[0]` or `hits.miss` or `hits.count_miss` - Amount of misses
*
* - `mode` - Number/Name of the gamemode
*
*
*
* ### Usage Example
* ```js
* const { tools } = require('osu-api-extended');
*
* function main() {
* try {
* const hits = { 300: 123, 100: 12, 50: 1, 0: 1 };
* const result = tools.calculate_hits(hits, 'osu');
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*/
export declare const calculate_hits: (hits: Hits, mode: GamemodeEnum | string | number) => ResponseConvert;
export {};