osu-api-extended
Version:
Advanced osu! api wrapper for v1 and v2, with extra stuff
26 lines (25 loc) • 1.15 kB
TypeScript
import { BeatmapsLookupAttributes } from "../../types/v2/beatmaps_lookup_attributes";
import { BeatmapsLookupDifficulty } from "../../types/v2/beatmaps_lookup_difficulty";
import { BeatmapsLookupSet } from "../../types/v2/beatmaps_lookup_set";
import { IDefaultParams, IError, Modes_names } from "../../types";
import { BeatmapsLookupDifficultiesResponse } from "../../types/v2/beatmaps_lookup_difficulties";
type params = ({
type: 'difficulty';
id: number;
checksum: string;
filename: string;
} | {
type: 'set';
id: number;
} | {
type: 'attributes';
id: number;
mods: number;
mode: Modes_names;
} | {
type: 'difficulties';
ids: number[];
});
type Response<T extends params['type']> = T extends 'difficulty' ? BeatmapsLookupDifficulty & IError : T extends 'set' ? BeatmapsLookupSet & IError : T extends 'attributes' ? BeatmapsLookupAttributes & IError : T extends 'difficulties' ? BeatmapsLookupDifficultiesResponse[] & IError : IError;
export declare const beatmaps_lookup: <T extends params>(params: T, addons?: IDefaultParams) => Promise<Response<T["type"]>>;
export {};