osu-api-extended
Version:
Advanced osu! api wrapper cover all V2 and V1 endpoints, and provide useful tools
34 lines (33 loc) • 1.48 kB
TypeScript
import { IDefaultParams, IError, Modes_names } from "../../types";
import { RankingListChartsResponse } from "../../types/v2/ranking_list_charts";
import { RankingListCountryResponse } from "../../types/v2/ranking_list_country";
import { RankingListPerformanceResponse } from "../../types/v2/ranking_list_performance";
import { RankingListKudosuResponse } from "../../types/v2/ranking_list_kudosu";
import { RankingListScoreResponse } from "../../types/v2/ranking_list_score";
type params = {
page?: number;
} & ({
type: 'charts';
spotlight_id?: string;
filter?: 'all' | 'friends';
mode?: Modes_names;
} | {
type: 'country';
filter?: 'all' | 'friends';
mode?: Modes_names;
} | {
type: 'performance';
filter?: 'all' | 'friends';
country_code?: string;
mode?: Modes_names;
variant?: '4k' | '7k';
} | {
type: 'score';
filter?: 'all' | 'friends';
mode?: Modes_names;
} | {
type: 'kudosu';
});
type Response<T extends params['type']> = T extends 'charts' ? RankingListChartsResponse & IError : T extends 'country' ? RankingListCountryResponse & IError : T extends 'performance' ? RankingListPerformanceResponse & IError : T extends 'score' ? RankingListScoreResponse & IError : T extends 'kudosu' ? RankingListKudosuResponse[] & IError : IError;
export declare const ranking_list: <T extends params>(params: T, addons?: IDefaultParams) => Promise<Response<T["type"]>>;
export {};