Skip to content

Commit

Permalink
Add overload for MapInfo.from return signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Oct 26, 2024
1 parent 64fe88a commit bae19d7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/osu-base/src/online/MapInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,22 @@ export class MapInfo<THasBeatmap extends boolean = boolean> {
}

/**
* Constructs a `MapInfo` from an osu! API response and (optionally) a parsed `Beatmap`.
* Constructs a `MapInfo` from an osu! API response.
*
* @param mapinfo The osu! API response.
* @returns A `MapInfo` instance representing the osu! API response.
*/
static from(mapinfo: OsuAPIResponse): MapInfo;

/**
* Constructs a `MapInfo` from an osu! API response and a parsed `Beatmap`.
*
* @param mapinfo The osu! API response.
* @param parsedBeatmap The parsed `Beatmap`.
* @returns A `MapInfo` instance representing the osu! API response and parsed `Beatmap`.
*/
static from(mapinfo: OsuAPIResponse, parsedBeatmap: Beatmap): MapInfo<true>;

static from(mapinfo: OsuAPIResponse, parsedBeatmap?: Beatmap): MapInfo {
const map = new MapInfo();

Expand Down

0 comments on commit bae19d7

Please sign in to comment.