import { API, Beatmapset, Miscellaneous, Mod, Ruleset, Score, User } from "../index.js"; export interface Beatmap { beatmapset_id: Beatmapset["id"]; /** Better known as Star Rating (SR) https://osu.ppy.sh/wiki/en/Beatmap/Star_rating */ difficulty_rating: number; id: number; mode: keyof typeof Ruleset; status: Lowercase; /** In seconds */ total_length: number; user_id: User["id"]; /** The name of the difficulty, maybe something like "Someone's Insane" */ version: string; } export declare namespace Beatmap { /** * An interface to tell the API what kind of scores should be in an array returned by a function * @group Parameter Object Interfaces * @remarks Please note that some properties will be ignored by certain functions, check this in case of doubt: https://osu.ppy.sh/docs/index.html#beatmaps */ interface Config { /** The Ruleset used to make the score, useful if it was made on a convert */ ruleset?: Ruleset; /** The Mods used to make the score, you can simply use `["NM"]` to filter out scores with mods (defaults to **any mods**, no scores filtered) */ mods?: string[]; /** * The type of score ranking to retrieve (defaults to **global**) * @remarks This does **NOT** bypass the requirement for an osu!supporter tag to use `country`/`friend` (https://osu.ppy.sh/home/support) * and will throw (HTTP 422) if the requirement is not met */ type?: "global" | "country" | "friend" | "team"; /** Exclude lazer scores? (defaults to **false**) */ legacy_only?: boolean; } interface WithBeatmapset extends Beatmap { beatmapset: Beatmapset; } interface WithChecksum extends Beatmap { checksum: string; } interface WithBeatmapsetChecksumMaxcombo extends WithBeatmapset, WithChecksum { /** * @privateRemarks I had a single instance of this being null, on beatmap 2124608, specifically on the dev server (it's okay on osu server) * For the sake of convenience, I cross my fingers that I won't regret not marking this as potentially null */ max_combo: number; } interface Extended extends WithChecksum { /** * Also known as Overall Difficulty https://osu.ppy.sh/wiki/en/Beatmap/Overall_difficulty * @remarks Not to be confused with a Score's accuracy https://osu.ppy.sh/wiki/en/Gameplay/Accuracy */ accuracy: number; ar: number; bpm: number; convert: boolean; count_circles: number; count_sliders: number; count_spinners: number; cs: number; deleted_at: Date | null; /** Drain length/time is how long the beatmap is if you remove the intro and breaks (in seconds) */ drain: number; hit_length: number; is_scoreable: boolean; last_updated: Date; mode_int: Ruleset; passcount: number; playcount: number; ranked: Beatmapset.RankStatus; /** In the following format: `https://osu.ppy.sh/beatmaps/` */ url: string; } namespace Extended { interface WithFailtimesOwners extends Extended { failtimes: { exit: number[]; fail: number[]; }; owners: Array<{ id: User["id"]; /** @remarks Users that are no longer visible will have the username set to `[deleted user]` */ username: User["username"]; }>; } interface WithMaxcombo extends Extended { max_combo: number; } /** @remarks Nowadays, it only exists to be extended and it itself is not used */ interface WithFailtimesOwnersMaxcombo extends WithFailtimesOwners, WithMaxcombo { } /** * @obtainableFrom * {@link API.getBeatmap} / * {@link API.lookupBeatmap} / * {@link API.getBeatmaps} */ interface WithFailtimesOwnersMaxcomboBeatmapset extends WithFailtimesOwnersMaxcombo { beatmapset: Beatmapset.Extended; } /** * @obtainableFrom * {@link API.getBeatmapset} / * {@link API.lookupBeatmapset} */ interface WithFailtimesOwnersMaxcomboToptagids extends WithFailtimesOwnersMaxcombo { /** Objects with the ids of the tags that have been voted by users for this Beatmap! */ top_tag_ids: { tag_id: UserTag["id"]; count: number; }[]; /** * How many times has the authenticated user played this Beatmap? * @remarks Unusually, if there is no authenticated user, this is simply 0 (it exists and is not `null`) */ current_user_playcount: number; /** * The ids of the tags that have been voted by the authenticated user for this Beatmap! * @remarks Unusually, if there is no authenticated user, this is an empty array (it exists and is not `null`) */ current_user_tag_ids: UserTag["id"][]; } } /** @obtainableFrom {@link API.getUserMostPlayed} */ interface Playcount { beatmap_id: Beatmap["id"]; /** Playcount */ count: number; beatmap: Beatmap; beatmapset: Beatmapset; } /** @obtainableFrom {@link API.getBeatmapUserTags} */ interface UserTag { id: number; name: string; ruleset_id: Ruleset | null; description: string; } namespace UserTag { /** * @obtainableFrom * {@link API.getBeatmapset} / * {@link API.lookupBeatmapset} */ interface WithDates extends UserTag { created_at: Date | null; updated_at: Date | null; } /** * Get all the UserTags that currently exist in the game! * @returns An Array of UserTags */ function getAll(this: API): Promise; } /** @obtainableFrom {@link API.getBeatmapPacks} */ interface Pack { author: User["username"]; date: Date; name: string; /** Are difficulty reduction mods unable to be used to clear this pack? (is `false` if you can use such mods) */ no_diff_reduction: boolean; ruleset_id: Ruleset | null; tag: string; /** Download page; going there with a web browser should start the download of a zip file automatically */ url: string; /** Not there if the application doesn't act as a specific user */ user_completion_data?: { /** IDs of beatmapsets completed by the user (according to the requirements of the pack) */ beatmapset_ids: Beatmapset["id"][]; /** Whether all beatmapsets are completed by the user or not */ completed: boolean; }; } namespace Pack { /** @obtainableFrom {@link API.getBeatmapPack} */ interface WithBeatmapset extends Pack { beatmapsets: Beatmapset.Extended[]; } /** * Get data about a Beatmap.Pack using its tag! * @param pack The Pack or the pack tag of the Pack you're trying to get * @param legacy_only Should lazer scores be excluded from the pack's `user_completion_data`? (defaults to **false**) * @remarks Currently in https://osu.ppy.sh/beatmaps/packs, when hovering a pack, its URL with its tag should be preview by your browser */ function getOne(this: API, pack: Pack["tag"] | Pack, legacy_only?: boolean): Promise; /** * Get an Array of up to 100 Beatmap.Packs of a specific type! * @param type The type of the BeatmapPacks (defaults to **standard**) * @param cursor_string Use a response's `cursor_string` with the same parameters to get the next "page" of results! */ function getMultiple(this: API, type?: "standard" | "featured" | "tournament" | "loved" | "chart" | "theme" | "artist", cursor_string?: Miscellaneous.CursorString): Promise<{ beatmap_packs: Pack[]; cursor_string: Miscellaneous.CursorString | null; }>; } /** @obtainableFrom {@link API.getBeatmapDifficultyAttributes} */ interface DifficultyAttributes { star_rating: number; max_combo: number; } namespace DifficultyAttributes { /** @obtainableFrom {@link API.getBeatmapDifficultyAttributesOsu} */ interface Osu extends DifficultyAttributes { aim_difficulty: number; aim_difficult_slider_count: number; speed_difficulty: number; speed_note_count: number; slider_factor: number; aim_difficult_strain_count: number; speed_difficult_strain_count: number; } /** @obtainableFrom {@link API.getBeatmapDifficultyAttributesTaiko} */ interface Taiko extends DifficultyAttributes { mono_stamina_factor: number; } /** * @obtainableFrom {@link API.getBeatmapDifficultyAttributesFruits} * @remarks Since the pp update of 2025-03-06, no property exclusive to this Ruleset exists */ interface Fruits extends DifficultyAttributes { } /** * @obtainableFrom {@link API.getBeatmapDifficultyAttributesMania} * @remarks Since the pp update of 2025-03-06, no property exclusive to this Ruleset exists */ interface Mania extends DifficultyAttributes { /** @remarks This seems to be about the max_combo with **Classic mod or Stable (non-lazer) client** */ max_combo: number; } type Any = Osu | Taiko | Fruits | Mania; /** * Get various data about the difficulty of a beatmap! * @param beatmap The Beatmap in question * @param mods Can be a bitset of mods, an array of mod acronyms, or an array of Mods (ignores mod settings) (defaults to **No Mod**) * @param ruleset Useful to specify if the beatmap is a convert (defaults to **the ruleset the beatmap was intended for**) * @remarks You may want to use {@link API.getBeatmapDifficultyAttributesOsu} (or Taiko or whatever) instead for better type safety */ function get(this: API, beatmap: Beatmap["id"] | Beatmap, mods?: Mod[] | string[] | number, ruleset?: Ruleset): Promise; /** * Get various data about the difficulty of an osu! beatmap! * @param beatmap The Beatmap in question * @param mods Can be a bitset of mods, an array of mod acronyms, or an array of Mods (ignores mod settings) (defaults to **No Mod**) */ function getOsu(this: API, beatmap: Beatmap["id"] | Beatmap, mods?: Mod[] | string[] | number): Promise; /** * Get various data about the difficulty of a taiko beatmap! * @param beatmap The Beatmap in question * @param mods Can be a bitset of mods, an array of mod acronyms, or an array of Mods (ignores mod settings) (defaults to **No Mod**) */ function getTaiko(this: API, beatmap: Beatmap["id"] | Beatmap, mods?: Mod[] | string[] | number): Promise; /** * Get various data about the difficulty of a ctb beatmap! * @param beatmap The Beatmap in question * @param mods Can be a bitset of mods, an array of mod acronyms, or an array of Mods (ignores mod settings) (defaults to **No Mod**) * @remarks Since the pp update of 2025-03-06, no property exclusive to this Ruleset exists */ function getFruits(this: API, beatmap: Beatmap["id"] | Beatmap, mods?: Mod[] | string[] | number): Promise; /** * Get various data about the difficulty of a mania beatmap! * @param beatmap The Beatmap in question * @param mods Can be a bitset of mods, an array of mod acronyms, or an array of Mods (ignores mod settings) (defaults to **No Mod**) * @remarks Since the pp update of 2025-03-06, no property exclusive to this Ruleset exists */ function getMania(this: API, beatmap: Beatmap["id"] | Beatmap, mods?: Mod[] | string[] | number): Promise; } /** * Get the score on a beatmap made by a specific user (with specific mods and on a specific ruleset if needed) * @param beatmap The Beatmap the score was made on * @param user The User who made the score * @param config Specify the score's ruleset, the score's mods, prevent a lazer score from being returned * @returns An Object with the position of the score according to the specified Mods and Ruleset, and with the score itself */ function getUserScore(this: API, beatmap: Beatmap["id"] | Beatmap, user: User["id"] | User, config?: Pick): Promise<{ /** Value depends on the requested mode and mods! */ position: number; score: Score.WithUserBeatmap; }>; /** * Get the scores on a beatmap made by a specific user (with the possibility to specify if the scores are on a convert) * @param beatmap The Beatmap the scores were made on * @param user The User who made the scores * @param config Specify the score's ruleset, prevent a lazer score from being returned */ function getUserScores(this: API, beatmap: Beatmap["id"] | Beatmap, user: User["id"] | User, config?: Pick): Promise; /** * Get extensive beatmap data about whichever beatmap you want! * @param query What to specify in order to find the right beatmap */ function lookup(this: API, query: { checksum?: Beatmap.WithChecksum["checksum"]; filename?: string; id?: Beatmap["id"]; }): Promise; /** * Get extensive beatmap data about whichever beatmap you want! * @param beatmap The beatmap or the id of the beatmap you're trying to get */ function getOne(this: API, beatmap: Beatmap["id"] | Beatmap): Promise; /** * Get extensive beatmap data for up to 50 beatmaps at once! * @param beatmaps An array of beatmaps or of objects that have the id of the beatmaps you're trying to get */ function getMultiple(this: API, beatmaps: Array): Promise; /** * Get the top scores of a beatmap! * @param beatmap The Beatmap in question * @param config Specify the score's ruleset, mods, type, prevent a lazer score from being returned */ function getScores(this: API, beatmap: Beatmap["id"] | Beatmap, config?: Config): Promise; }