osu-api-extended
Version:
Advanced osu! api wrapper cover all V2 and V1 endpoints, and provide useful tools
3,670 lines • 130 kB
TypeScript
/**
* ##### Description
* Object containing methods for retrieving beatmaps data.
*/
export declare const beatmaps: {
/**
* ##### Description
* Covers API Endpoints regarding beatmap packs.
*
*/
packs: {
/**
* ### `GET` [/v2/beatmaps/packs](https://osu.ppy.sh/docs/index.html#get-beatmap-packs)
* `async` Retrieves a list of all available beatmap packs.
*
*
*
* ## Parameters
* - `params.type` - Type of the beatmap pack.
* - `params.cusor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.packs.list({
* type: 'loved'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.packs.list_v3) | [Check return types](../types/v2/beatmaps_packs_list.ts)
*/
list: (params: {
type: import("..").IBeatmapPackType;
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/beatmaps_packs_list").BeatmapsPacksListResponse & import("..").IError>;
/**
* ### `GET` [/v2/beatmaps/packs/{pack_tag}](https://osu.ppy.sh/docs/index.html#get-beatmap-pack)
* `async` Retrieves a beatmap pack by given ID.
*
*
*
* ### Parameters
* - `pack_tag` - ID of the beatmap pack to retrieve.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.packs.details('ST265');
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.packs.details_v3) | [Check return types](../types/v2/beatmaps_packs_details.ts)
*/
details: (pack_tag: string, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/beatmaps_packs_details").beatmaps_packs_details_response & import("..").IError>;
};
/**
* ### `GET` [/v2/beatmaps/lookup](https://osu.ppy.sh/docs/index.html#lookup-beatmap)
* ### `GET` [/v2/beatmapsets/lookup](https://osu.ppy.sh/docs/index.html#get-apiv2beatmapsetslookup)
* ### `POST` [/v2/beatmaps/{beatmap}/attributes](https://osu.ppy.sh/docs/index.html#get-beatmap-attributes)
* ### `GET` [/v2/beatmaps](https://osu.ppy.sh/docs/index.html#get-beatmaps)
* `async` Lookup for a beatmap by given parameters.
*
*
*
* ### Global Parameters
* - `params.type` - Type of lookup.
*
* &
*
* ### Parameters for `params.type:'difficulty'`
* - `params.id` - ID of the difficulty to lookup for.
* - `params.checksum` - Checksum of the difficulty to lookup.
* - `params.filename` - Filename of the difficulty to lookup.
*
*
*
* ### Parameters for `params.type:'set'`
* - `params.id` - ID of the beatmap set to lookup for.
*
*
*
* ### Parameters for `params.type:'attribute'`
* - `params.id` - ID of the beatmap to lookup for.
* - `params.mods` - Mod combination of the beatmap to lookup for.
* - `params.mode` - Mode of the beatmap to lookup for.
*
*
*
* ### Parameters for `params.type:'difficulties'`
* - `params.ids` - IDs of the difficulties to lookup for.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.lookup({
* type: 'attributes',
* id: 3798013,
* });
* // or
* const result = await v2.beatmaps.lookup({
* type: 'difficulties',
* ids: [4233769, 3798013]
* });
* // or
* const result = await v2.beatmaps.lookup({
* type: 'difficulty',
* id: 4233769,
* });
* // or
* const result = await v2.beatmaps.lookup({
* type: 'set',
* id: 2246377,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.lookup_v3) | [Check return types](../types/v2/beatmaps_lookup.ts)
*/
lookup: <T extends {
type: "difficulty";
id?: number;
checksum?: string;
filename?: string;
} | {
type: "set";
/**
* ##### Description
* Object containing methods for retrieving beatmaps data.
*/
id: number;
} | {
type: "attributes";
id: number;
mods?: number;
mode?: import("..").Modes_names;
} | {
type: "difficulties";
ids: number[];
}>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "difficulty" ? import("../types/v2/beatmaps_lookup_difficulty").beatmaps_lookup_difficulty_response & import("..").IError : T_1 extends "set" ? import("../types/v2/beatmaps_lookup_set").beatmaps_lookup_set_response & import("..").IError : T_1 extends "attributes" ? import("../types/v2/beatmaps_lookup_attributes").BeatmapsLookupAttributes & import("..").IError : T_1 extends "difficulties" ? import("../types/v2/beatmaps_lookup_difficulties").beatmaps_lookup_difficulties_response[] & import("..").IError : import("..").IError : never : never>;
/**
* ### `GET` [v2/beatmaps/{beatmap}](https://osu.ppy.sh/docs/index.html#get-beatmap)
* ### `GET` [v2/beatmapsets/{beatmapset}](https://osu.ppy.sh/docs/index.html#get-apiv2beatmapsetsbeatmapset)
* `async` Retrieves a beatmap or beatmap set by given ID.
*
*
*
* ##### Parameters
* - `params.type` - 'difficulty' or 'set'.
* - `params.id` - The ID to search for.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.details({
* type: 'set',
* id: 2182218
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.details_v3) | [Check return types](../types/v2/beatmaps_details_set.ts)
*/
details: <T_2 extends {
type: "difficulty";
id: number;
} | {
type: "set";
id: number;
}>(params: T_2, addons?: import("..").IDefaultParams) => Promise<T_2["type"] extends infer T_3 ? T_3 extends T_2["type"] ? T_3 extends "difficulty" ? import("../types/v2/beatmaps_details_difficulty").beatmaps_details_difficulty_response & import("..").IError : T_3 extends "set" ? import("../types/v2/beatmaps_details_set").beatmaps_details_set_response & import("..").IError : import("..").IError : never : never>;
/**
* ##### Description
* Covers API Endpoints regarding beatmap set events.
*/
events: {
/**
* ### `GET` [v2/beatmapsets/{beatmapset}/events](https://osu.ppy.sh/docs/index.html#get-apiv2beatmapsetsevents)
* `async` Retrieves a list of beatmap set events.
*
*
*
* ### Parameters
* - `obj.user` - Filter by author of the event.
* - `obj.types` - Filter by type of the event.
* - `obj.min_date` - Filter by minimum date of the event.
* - `obj.max_date` - Filter by maximum date of the event.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.events.list({ types: ['approve'] });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.events.list_v3) | [Check return types](../types/v2/beatmaps_events_list.ts)
*/
list: (obj: {
user: string | number;
types: import("..").beatmap_events_types[];
min_date: string;
max_date: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/beatmaps_events_list").BeatmapsEvents & import("..").IError>;
};
/**
* `async` Downloads a beatmap or beatmap set by given ID. (Supports different hosts)
*
*
*
* ### Available hosts
* - For `type:'difficulty'`: osu, osu_direct_mirror, catboy
* - For `type:'set'`: osu, beatconnect, nerinyan, osu_direct_mirror, sayobot, gatari, ripple, catboy
*
*
*
* ### Global Parameters
* - `params.type` - Type of the beatmap.
* - `params.id` - ID of the beatmap or beatmap set.
* - `params.host` - Host of the download source.
* - `params.file_path` - Path to the save location.
* - `params.overwrite` - Whether to overwrite the file if it already exists.
*
*
*
* ### Parameters for `params.type:'set'`
* - `params.no_video?` - Whether to include video in the download.
* - `params.progress_log_fn?` - Callback function to send progress.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* // only for downloading sets from osu host
* await auth.login({
* type: 'lazer',
* login: login,
* password: password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
*
* const progress_update = (...args) => {
* console.log(args);
* };
* const set_id = 320118;
*
*
* const result = await v2.beatmaps.download({
* type: 'set',
* host: 'gatari',
* id: set_id,
* file_path: `./cache/${set_id}.osz`,
* progress_log_fn: progress_update
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.download_v3)
*/
download: <T_4 extends {
type: "difficulty";
id: number;
host: "osu" | "osu_direct_mirror" | "catboy";
file_path: string;
overwrite?: boolean;
progress_log_fn?: (host: string, progress: number) => void;
} | {
type: "set";
id: number;
host: "osu" | "osu_direct_mirror" | "catboy" | "beatconnect" | "nerinyan" | "sayobot" | "gatari" | "ripple" | "mino" | "akatsuki";
file_path: string;
no_video?: boolean;
overwrite?: boolean;
progress_log_fn?: (host: string, progress: number) => void;
}>(params: T_4, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/beatmaps_download").BeatmapsDownloadResponse>;
/**
* ##### Description
* Covers API Endpoints regarding beatmap discussions.
*/
discussions: {
/**
* ### `GET` [/v2/beatmapsets/discussions](https://osu.ppy.sh/docs/index.html#get-beatmapset-discussions)
* `async` Retrieves a list of beatmap set discussions.
*
*
*
* ### Parameters
* - `params.only_unresolved?` - Filter by unresolved discussions.
* - `params.user?` - Filter by author of the discussion.
* - `params.beatmap_id?` - Filter by beatmap ID.
* - `params.beatmapset_id?` - Filter by beatmap set ID.
* - `params.beatmapset_status?` - Filter by beatmap set status.
* - `params.message_type?` - Filter by message type.
* - `params.limit?` - Maximum number of discussions to return.
* - `params.sort?` - Sort order of the discussions.
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.discussions.list({ beatmapset_id: 2084849 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.discussions.list_v3) | [Check return types](../types/v2/beatmaps_discussions_list.ts)
*/
list: (params: {
only_unresolved?: boolean;
user?: number;
beatmap_id?: number;
beatmapset_id?: number;
beatmapset_status?: "ranked" | "qualified" | "loved" | "all" | "disqualified" | "never_qualified";
message_types?: ("all" | "suggestion" | "problem" | "mapper_note" | "praise" | "hype" | "review")[];
limit?: number;
sort?: "id_desc" | "id_asc";
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/beatmaps_discussions_list").BeatmapsDiscussionsListResponse & import("..").IError>;
/**
* ### `GET` [/v2/beatmapsets/discussions/posts](https://osu.ppy.sh/docs/index.html#beatmapset-discussions)
* `async` Retrieves the posts of a beatmap set discussion.
*
*
*
* ### Parameters
* - `params.discussion_id?` - ID of the beatmap set discussion to retrieve.
* - `params.sort?` - Sort order of the posts.
* - `params.type?` - Filter by type of the post.
* - `params.limit?` - Maximum number of posts to return.
* - `params.user?` - Filter by author of the post.
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.discussions.posts();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.discussions.posts_v3) | [Check return types](../types/v2/beatmaps_discussions_posts.ts)
*/
posts: (params: {
discussion_id?: number;
sort?: "id_desc" | "id_asc";
types?: ("first" | "reply" | "system")[];
user?: number;
limit?: number;
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/beatmaps_discussions_posts").BeatmapsDiscussionsPostsResponse & import("..").IError>;
/**
* ### `GET` [/v2/beatmapsets/discussions/votes](https://osu.ppy.sh/docs/index.html#get-beatmapset-discussion-votes)
* `async` Retrieves the votes given to beatmap set discussions.
*
*
*
* ### Parameters
* - `params.discussion_id?` - ID of the beatmap set discussion to retrieve.
* - `params.sort?` - Sort order of the votes.
* - `params.score?` - Filter by score of the vote.
* - `params.user?` - Filter by author of the vote.
* - `params.receiver?` - Filter by receiver of the vote.
* - `params.limit?` - Maximum number of votes to return.
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.discussions.votes({ discussion_id: 4533908 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.discussions.votes_v3) | [Check return types](../types/v2/beatmaps_discussions_votes.ts)
*/
votes: (params: {
discussion_id?: number;
sort?: "id_desc" | "id_asc";
score?: "1" | "-1";
user?: number;
receiver?: number;
limit?: number;
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/beatmaps_discussions_votes").BeatmapsDiscussionsVotesResponse & import("..").IError>;
};
/**
* Currently broken.
*/
actions: <T_5 extends {
type: "favourite";
id: number;
status: boolean;
} | {
type: "tag";
id: number;
name: string;
status: boolean;
}>(params: T_5, addons?: import("..").IDefaultParams) => Promise<T_5["type"] extends infer T_6 ? T_6 extends T_5["type"] ? T_6 extends "favourite" ? string & import("..").IError : T_6 extends "tag" ? string & import("..").IError : import("..").IError : never : never>;
};
/**
* ##### Description
* Covers API Endpoints regarding changelogs.
*/
export declare const changelogs: {
/**
* ### `GET` [/v2/changelogs](https://osu.ppy.sh/docs/index.html#get-changelog-listing)
* ### `GET` [/v2/changelogs/{changelog}](https://osu.ppy.sh/docs/index.html#lookup-changelog-build)
* `async` Retrieves a list of all available changelogs.
*
*
*
* ### Global Parameters
* - `params.type` - Fetch type.
* - `params.message_formats` - Return format.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Parameters for `type:'all'`
* - `params.from_build?` - Minimum build version.
* - `params.to_build?` - Maximum build version.
* - `params.stream_name?` - Stream name to return builds from.
* - `params.max_id?` - Maximum build ID.
*
*
*
* ### Parameters for `type:'lookup'`
* - `params.changelog` - Build version, update stream name, or build ID.
* - `params.key` - Unset to query by build version or stream name, or id to query by build ID.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* const result = await v2.changelogs.list({
* type: 'all',
* stream_name: 'web',
* });
* // or
* const result = await v2.changelogs.list({
* type: 'lookup',
* changelog: 'lazer'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.changelogs.list_v3) | [Check return types](../types/v2/changelogs_list_all.ts)
*/
list: <T extends {
type: "all";
from_build?: string;
to_build?: string;
stream_name?: "lazer" | "stable40" | "beta40" | "cuttingedge" | "web";
max_id?: string;
message_formats?: ("html" | "markdown")[];
} | {
type: "lookup";
message_formats: ("html" | "markdown")[];
changelog: "lazer" | "stable40" | "beta40" | "cuttingedge" | "web";
key: string;
}>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "all" ? import("../types/v2/changelogs_list_all").ChangelogsListAllResponse & import("..").IError : T_1 extends "lookup" ? import("../types/v2/changelogs_list_lookup").ChangelogsListLookupResponse & import("..").IError : import("..").IError : never : never>;
/**
* ### `GET` [/v2/changelog/{stream}/{build}](https://osu.ppy.sh/docs/index.html#get-changelog-build)
* `async` Retrieves details of the specified build.
*
*
*
* ### Parameters
* - `params.stream_name` - Update stream name.
* - `params.build_version` - Build version.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* const result = await v2.changelogs.details({
* stream_name: 'web',
* build_version: '2024.930.0'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.changelogs.details_v3) | [Check return types](../types/v2/changelogs_details.ts)
*/
details: (params: {
stream_name: "lazer" | "stable40" | "beta40" | "cuttingedge" | "web";
build_version: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/changelogs_details").changelogsDetailsResponse[] & import("..").IError>;
};
/**
* ##### Description
* Covers API Endpoints regarding comments.
*/
export declare const comments: {
/**
* ### `GET` [/v2/comments](https://osu.ppy.sh/api/v2/comments)
* `async` Retrieves a list of all comments by given parameters.
*
*
*
* ### Parameters
* - `params.type?` - Type of the resource to get comments from.
* - `params.id?` - ID of the resource to get comments from.
* - `params.parent_id?` - ID of the parent comment.
* - `params.after_id?` - ID of the comment after which the comments will be returned.
* - `params.cursor?.id`- The ID of the cursor.
* - `params.cursor?.created_at` - The timestamp of the cursor.
* - `params.sort?` - Sort order of the comments.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* const result = await v2.comments.list({
* type: 'news_post',
* id: 1430,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.comments.list_v3) | [Check return types](../types/v2/comments_list.ts)
*/
list: (params: {
type?: "news_post" | "beatmapset" | "Build";
id?: string;
parent_id?: string;
after_id?: string;
cursor?: {
id: number;
created_at: string;
};
sort?: "new" | "old" | "top";
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/comments_list").CommentsListResponse & import("..").IError>;
/**
* ### `GET` [/v2/comments/{comment}](https://osu.ppy.sh/docs/index.html#get-a-comment)
* `async` Retrieves a comment by given parameters.
*
*
*
* ### Parameters
* - `params.comment_id` - ID of the comment to retrieve.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* const result = await v2.comments.details(3035523);
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.comments.details_v3) | [Check return types](../types/v2/comments_details.ts)
*/
details: (comment_id: string, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/comments_details").CommentsDetailsResponse & import("..").IError>;
/**
* ### `POST` [/v2/comments](https://osu.ppy.sh/docs/index.html#post-a-new-comment)
* ### `PUT` [/v2/comments/{comment}](https://osu.ppy.sh/docs/index.html#edit-comment)
* ### `PATCH` [/v2/comments/{comment}](https://osu.ppy.sh/docs/index.html#edit-comment)
* ### `DELETE` [/v2/comments/{comment}](https://osu.ppy.sh/docs/index.html#delete-comment)
* ### `POST` [/v2/comments/{comment}/vote](https://osu.ppy.sh/docs/index.html#add-comment-vote)
* ### `DELETE` [/v2/comments/{comment}/vote](https://osu.ppy.sh/docs/index.html#remove-comment-vote)
* `async` Perform comment actions via endpoint.
*
*
*
* ### Global Parameters
* - `params.id?` - ID of the comment to perform the action on.
* - `params.type` - Type of the action to perform.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Parameters for `params.type:'new'`
* - `params.message?` - The message of the comment.
* - `params.parent_id?` - The id of the comment to reply to.
* - `params.commentable_type?` - Resource type the comment thread is attached to.
*
*
*
* ### Parameters for `params.type:'edit'`
* - `params.message?` - The message of the comment.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login: login,
* password: password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.comments.actions({
* type: 'new',
*
* commentable_type: 'beatmapset',
* id: 1378401,
* message: 'hello from api'
* });
* // or
* const result = await v2.comments.actions({
* type: 'edit',
*
* id: 3058002,
* message: 'hello from api (edited)'
* });
* // or
* const result = await v2.comments.actions({
* type: 'vote',
* id: 3058002,
* });
* // or
* const result = await v2.comments.actions({
* type: 'unvote',
* id: 3058002,
* });
* // or
* const result = await v2.comments.actions({
* type: 'delete',
* id: 3058002,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.comments.actions_v3) | [Check return types](../types/v2/comments_actions.ts)
*/
actions: <T extends {
type: "new";
commentable_type: "news_post" | "beatmapset";
id: number;
parent_id?: string;
message: string;
} | {
type: "edit";
id: number;
message: string;
} | {
type: "delete";
id: number;
} | {
type: "vote";
id: number;
} | {
type: "unvote";
id: number;
}>(params: T, addons?: import("..").IDefaultParams) => Promise<(T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "new" ? import("../types/v2/comments_actions_new").CommentsActionsNewResponse & import("..").IError : T_1 extends "edit" ? import("../types/v2/comments_actions_edit").CommentsActionsEditResponse & import("..").IError : T_1 extends "delete" ? import("../types/v2/comments_actions_delete").CommentsActionsDeleteResponse & import("..").IError : T_1 extends "vote" ? import("../types/v2/comments_actions_vote").CommentsActionsVoteResponse & import("..").IError : T_1 extends "unvote" ? import("../types/v2/comments_actions_unvote").CommentsActionsUnvoteResponse & import("..").IError : import("..").IError : never : never) | {
error: string;
}>;
};
/**
* ##### Description
* Covers API Endpoints regarding users.
*/
export declare const users: {
/**
* ### `GET` [/v2/users](https://osu.ppy.sh/docs/index.html#get-users)
* `async` Retrieves a list of users by given parameters.
*
*
*
* ### Parameters
* - `params.ids` - List of user ids to retrieve.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.users.list({
* ids: [2, 8928855, 7562902, 10083439],
* include_variants: true
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.users.list_v3) | [Check return types](../types/v2/users_list.ts)
*/
list: (params: {
ids: number[];
include_variants?: boolean;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/users_list").UsersLisResponse[] & import("..").IError>;
/**
* ### `GET` [/v2/users/lookup](https://osu.ppy.sh/docs/index.html#get-apiv2userslookup)
* `async` Retrieves a list of users by their id or name.
*
*
*
* ### Parameters
* - `params.ids` - List of user ids or names to retrieve.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.users.lookup({
* ids: [2, 8928855, 7562902, 'mrekk', 'whitecat'],
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.users.lookup_v3) | [Check return types](../types/v2/users_list.ts)
*/
lookup: (params: {
ids: (string | number)[];
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/users_lookup").UsersLookupResponse[] & import("..").IError>;
/**
* ### `GET` [/v2/users/{user}/kudosu](https://osu.ppy.sh/docs/index.html#get-user-kudosu)
* `async` Retrieves the kudosu history of a given user.
*
*
*
* ### Parameters
* - `params.id` - ID of the user to retrieve.
* - `params.limit?` - Maximum number of results to return.
* - `params.offset?` - Result offset for pagination.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.users.kudosu({ id: 4830261 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.users.kudosu_v3) | [Check return types](../types/v2/users_kudosu.ts)
*/
kudosu: (params: {
id: number;
limit?: number;
offset?: number;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/users_kudosu").UsersKudosuResponse[] & import("..").IError>;
/**
* ### `GET` [/v2/events](https://osu.ppy.sh/docs/index.html#get-events)
* `async` Retrieves a list of user events by given parameters.
*
*
*
* ### Parameters
* - `params.type?` - Filter by type of event.
* - `params.sort?` - Sort order of the events by id.
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.users.events()
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.users.events_v3) | [Check return types](../types/v2/users_events.ts)
*/
events: ({ sort, cursor_string, type }?: {
type?: ("rank" | "achievement" | "beatmapsetApprove" | "beatmapsetDelete" | "beatmapsetRevive" | "beatmapsetUpdate" | "beatmapsetUpload" | "rankLost" | "userSupportAgain" | "userSupportFirst" | "userSupportGift" | "usernameChange")[];
sort?: "id_desc" | "id_asc";
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/users_events").UsersEventsResponse & import("..").IError>;
/**
* ### `GET` [/v2/users/{user}/{mode?}](https://osu.ppy.sh/docs/index.html#get-user)
* `async` Retrieves a user by given parameters.
*
*
*
* ### Parameters
* - `params.id` - ID or username of the user to retrieve.
* - `params.mode?` - Retrieve data for a specific gamemode.
* - `params.key?` - Type of the `params.id` parameter.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.users.details({ user: 9893708, mode: 'osu', key: 'id' });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.users.details_v3) | [Check return types](../types/v2/users_details.ts)
*/
details: (params: {
user?: string | number;
mode?: import("..").Modes_names;
key?: "id" | "username" | "@";
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/users_details").UsersDetailsResponse & import("..").IError>;
/**
* ### `GET` [/v2/users/{user}/beatmapsets/{type}](https://osu.ppy.sh/docs/index.html#get-user-beatmaps)
* `async` Retrieves a list of user's beatmaps sets by given parameters.
*
*
*
* ### Parameters
* - `params.type` - Filter by type of beatmap set.
* - `params.id` - ID of the user to retrieve.
* - `params.limit?` - Maximum number of beatmap sets to return.
* - `params.offset?` - Result offset for pagination.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.users.beatmaps({ type: 'ranked', id: 4378277 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.users.beatmaps_v3) | [Check return types](../types/v2/users_beatmaps.ts)
*/
beatmaps: (params: {
type: "ranked" | "loved" | "pending" | "graveyard" | "favourite" | "guest" | "most_played" | "nominated";
id: number;
limit?: number;
offset?: number;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/users_beatmaps").UsersBeatmapsResponse[] & import("..").IError>;
/**
* ### `GET` [/v2/users/{user}/recent_activity](https://osu.ppy.sh/docs/index.html#get-user-recent-activity)
* `async` Retrieves a list of user's recent activities by given parameters.
*
*
*
* ### Parameters
* - `params.id` - ID of the user to retrieve.
* - `params.limit?` - Maximum number of activities to return.
* - `params.offset?` - Result offset for pagination.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.users.activity({ id: 11367222 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.users.activity_v3) | [Check return types](../types/v2/users_activity.ts)
*/
activity: (params: {
id: number;
limit?: number;
offset?: number;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/users_activity").UsersActivityResponse[] & import("..").IError>;
};
/**
* ##### Description
* Covers API Endpoints regarding scores.
*/
export declare const scores: {
/**
* ### `GET` [/v2/beatmaps/{beatmap}/scores](https://osu.ppy.sh/docs/index.html#get-beatmap-scores)
* ### `GET` [/v2/beatmaps/{beatmap}/scores/users/{user}](https://osu.ppy.sh/docs/index.html#get-a-user-beatmap-score)
* ### `GET` [/v2/beatmaps/{beatmap}/scores/users/{user}/all](https://osu.ppy.sh/docs/index.html#get-a-user-beatmap-scores)
* ### `GET` [/v2/beatmaps/{beatmap}/solo-scores](https://osu.ppy.sh/docs/index.html#get-beatmap-scores-non-legacy)
* ### `GET` /v2/scores
* `async` Retrieves a list of scores by given parameters.
*
*
*
* ### Global Parameters
* - `params.mode?` - Retrieve data for a specific gamemode.
* - `params.type` - Type of scores to retrieve.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Parameters for `params.type: 'leaderboard' | 'solo_scores'`
* - `params.leaderboard_type?: Type of leaderboard to retrieve.`
* - `params.beatmap_id` - ID of the beatmap to retrieve data from.
* - `params.mods?` - Retrieve scores for specific mods.
*
*
*
* ### Parameters for `params.type: 'user_beatmap_best'`
* - `params.beatmap_id` - ID of the beatmap.
* - `params.user_id` - ID of the user.
* - `params.mods?` - Retrieve scores for specific mods.
*
*
*
* ### Parameters for `params.type: 'user_beatmap_all'`
* - `params.beatmap_id` - ID of the beatmap.
* - `params.user_id` - ID of the user.
*
*
*
* ### Parameters for `params.type:'user_best' | 'user_firsts' | 'user_recent' | 'user_pinned'`
* - `params.user_id` - ID of the user to retrieve data from.
* - `params.include_fails?` - Include failed scores.
* - `params.limit?` - Maximum number of scores to return.
* - `params.offset?` - Result offset for pagination.
*
*
*
* ### Parameters for `params.type:'latest_ranked'`
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.scores.list({
* type: 'user_beatmap_all',
* // or
* type: 'user_beatmap_best',
* beatmap_id: 1141858,
* user_id: 7562902
* });
* // or
* const result = await v2.scores.list({
* type: 'leaderboard',
* beatmap_id: 1141858
* });
* // or
* const result = await v2.scores.list({
* type: 'user_best',
* // or
* type: 'user_firsts',
* // or
* type: 'user_pinned',
* // or
* type: 'user_recent',
* user_id: 7562902,
* });
* // or
* const result = await v2.scores.list({
* type: 'latest_ranked',
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.scores.list_v3) | [Check return types](../types/v2/scores_list_user_recent.ts)
*
*/
list: <T extends {
mode?: import("..").Modes_names;
} & ({
type: "leaderboard" | "solo_scores";
leaderboard_type?: "country" | "global" | "friend";
beatmap_id: number;
mods?: string[];
} | {
type: "user_beatmap_best";
beatmap_id: number;
user_id: number;
mods?: string[];
} | {
type: "user_beatmap_all";
beatmap_id: number;
user_id: number;
} | {
type: "user_best" | "user_firsts" | "user_recent" | "user_pinned";
user_id: number;
include_fails?: boolean;
offset?: number;
limit?: number;
} | {
type: "latest_ranked";
mode: import("..").Modes_names;
cursor_string?: string;
})>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "leaderboard" ? import("../types/v2/scores_list_leaderboard").scores_list_leaderboard_response[] & import("..").IError : T_1 extends "solo_scores" ? import("../types/v2/scores_list_solo_scores").scores_list_solo_scores_response[] & import("..").IError : T_1 extends "beatmap_best" ? import("../types/v2/scores_list_user_beatmap_best").scores_list_user_beatmap_best_response[] & import("..").IError : T_1 extends "beatmap_all" ? import("../types/v2/scores_list_user_beatmap_all").scores_list_user_beatmap_all_response[] & import("..").IError : T_1 extends "user_best" ? import("../types/v2/scores_list_user_best").scores_list_user_user_best_response[] & import("..").IError : T_1 extends "user_firsts" ? import("../types/v2/scores_list_user_firsts").scores_list_user_user_firsts_response[] & import("..").IError : T_1 extends "user_recent" ? import("../types/v2/scores_list_user_recent").scores_list_user_recent_response[] & import("..").IError : T_1 extends "user_pinned" ? import("../types/v2/scores_list_user_pinned").scores_list_user_user_pinned_response[] & import("..").IError : T_1 extends "latest_ranked" ? import("../types/v2/scores_list_latest_ranked").scores_list_latest_ranked_response & import("..").IError : import("..").IError : never : never>;
/**
* ### `GET` [/v2/scores/{rulesetOrScore}/{score?}](https://osu.ppy.sh/docs/index.html#get-apiv2scoresrulesetorscorescore)
* `async` Retrieves a score by given parameters.
*
*
*
* ### Parameters
* - `params.id` - ID of the score to retrieve.
* - `params.mode?` - Gamemode of the score.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.scores.details({
* id: 3321956713,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.scores.details_v3) | [Check return types](../types/v2/scores_details.ts)
*
*/
details: (params: {
id: number;
mode?: import("..").Modes_names;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/scores_details").scores_details_response & import("..").IError>;
/**
* ### `GET` [/v2/scores/{rulesetOrScore}/{score}/download](https://osu.ppy.sh/docs/index.html#get-apiv2scoresrulesetorscorescoredownload)
* `async` Downloads a score by given parameters.
*
*
*
* ### Parameters
* - `params.id` - ID of the score to download.
* - `params.mode?` - Gamemode of the score.
* - `params.file_path?` - Where to save the file.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login: login,
* password: password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.scores.download({
* id: 3427873257,
* file_path: './cache/replay.osr'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.scores.download_v3) | [Check return types](../types/v2/scores_download.ts)
*/
download: (params: {
id: number;
mode?: import("..").Modes_names;
file_path: string;
}) => Promise<import("../types/v2/scores_download").ScoresDownloadResponse & import("..").IError>;
};
import { forums_list } from '../api/v2/forums_list';
import { forums_details } from '../api/v2/forums_details';
/**
* ##### Description
* Covers API Endpoints regarding forums.
*/
export declare const forums: {
/**
* ##### Description
* Covers API Endpoints regarding forum topics.
*/
topics: {
/**
* ### `GET` [/v2//forums/topics](https://osu.ppy.sh/docs/index.html#get-topic-listing)
* `async` Retrieves a list of topics.
*
*
*
* ### Parameters
* - `params.id` - ID of the forum/subforum to retrieve.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
*
* const result = await v2.forums.topics.list({ id: 15, sort: 'new' });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.forums.topics.list_v3) | [Check return types](../types/v2/forums_topics_list.ts)
*/
list: (params: {
id: number;
sort?: "new" | "old";
limit?: number;
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/forums_topics_list").forums_topics_list_response & import("..").IError>;
/**
* ### `GET` [/v2/forums/topics](https://osu.ppy.sh/docs/index.html#get-topic-and-posts)
* `async` Retrieves a information about topic with list of posts by given parameters.
*
*
*
* ### Parameters
* - `params.id` - ID of the topic to retrieve.
* - `params.start_id?` - ID of the topic after which the topics will be returned.
* - `params.end_id?` - ID of the topic before which the topics will be returned.
* - `params.limit?` - Maximum number of topics to return.
* - `params.sort?` - Sort order of the topics.
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.forums.topics.details({
* id: 881367
* });
*
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.forums.topics.details_v3) | [Check return types](../types/v2/forums_topics_details.ts)
*/
details: (params: {
id: number;
start_id?: string;
end_id?: string;
limit?: number;
sort?: "id_desc" | "id_asc";
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/forums_topics_details").ForumsTopicsDetailsResponse & import("..").IError>;
/**
* ### `POST` [/v2/forums/topics](https://osu.ppy.sh/docs/index.html#create-topic)
* ### `POST` [/v2/forums/topics/{topic}/reply](https://osu.ppy.sh/docs/index.html#reply-topic)
* ### `PUT/PATCH` [/v2/forums/posts/{post}](https://osu.ppy.sh/docs/index.html#edit-post)
* ### `PUT/PATCH` [/v2/forums/topics/{topic}](https://osu.ppy.sh/docs/index.html#edit-topic)
* `async` Perform actions on forum topics via API.
*
*
*
* ### Global Parameters
* - `params.type` - Type of action to perform.
* - `addons?` - Additional parameters to include in the request.
*
* ### Parameters for `params.type:'create'`
* - `params.forum_id` - ID of the forum to create the topic in.
* - `params.title` - Title of the topic.
* - `params.message` - Message of the topic.
* - `params.enable_poll` - Whether to enable the poll.
* - `params.poll.allow_vote_change?` - Whether to allow users to change their vote.
* - `params.poll.hide_results?` - Whether to hide the results of the poll.
* - `params.poll.title` - Title of the poll.
* - `params.poll.options` - Options of the poll.
* - `params.poll.max_votes_per_user?` - Maximum number of votes per user.
* - `params.poll.duration_days?` - Duration of the poll.
*
*
*
* ### Parameters for `params.type:'reply'`
* - `params.post_id` - ID of the post to reply to.
* - `params.message` - Message of the reply.
*
*
*
* ### Parameters for `params.type:'edit_post'`
* - `params.post_id` - ID of the post to edit.
* - `params.message` - Message of the edit.
*
*
*
* ### Parameters for `params.type:'edit_topic'`
* - `params.topic_id?` - ID of the topic to edit.
* - `params.post_id?` - ID of the post to edit.
* - `params.title?` - New title of the topic.
* - `params.message` - New message of the topic.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login: login,
* password: password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.forums.topics.actions({
* type: 'create',
*
* forum_id: 52,
*
* title: 'hi',
* message: 'test',
* });
* // or
* const result = await v2.forums.topics.actions({
* type: 'reply',
* topic_id: 1888959,
* message: 'test'
* });
* //or
* const result = await v2.forums.topics.actions({
* type: 'edit_topic',
*
* topic_id: 986201,
* title: 'New title',
*
* post_id: 7270325,
* message: 'edited body/message',
* });
* // or
* const result = await v2.forums.topics.actions({
* type: 'edit_post',
*
* post_id: 9500788,
* message: 'asdsadsada',
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.forums.topics.actions_v3) | [Check return types](../types/v2/forums_topics_actions_reply.ts)
*/
actions: <T extends {
type: "create";
forum_id: number;
title: string;
message: string;
enable_poll: boolean;
poll?: {
allow_vote_change?: boolean;
hide_results?: boolean;
title: string;
options: string[];
max_votes_per_user?: number;
duration_days?: number;
};
} | {
type: "reply";
post_id: number;
message: string;
} | {
type: "edit_post";
post_id: number;
message: string;
} | {
type: "edit_topic";
topic_id?: number;
post_id?: number;
title?: string;
message?: string;
}>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "create" ? import("../types/v2/forums_topics_actions_create").ForumsTopicsActionsCreateResponse & import("..").IError : T_1 extends "reply" ? import("../types/v2/forums_topics_actions_reply").ForumsTopicsActionsReplyResponse & import("..").IError : T_1 extends "edit_post" ? import("../types/v2/forums_topics_actions_edit_post").ForumsTopicsActionsEditPostResponse & import("..").IError : T_1 extends "edit_topic" ? import("../types/v2/forums_topics_actions_edit_topic").ForumsTopicsActionsEditTopicResponse & import("..").IError : import("..").IError : never : never>;
};
/**
* ### `GET` [/v2/forums](https://osu.ppy.sh/docs/index.html#get-forum-listing)
* `async` Retrieves a list of forums and subforums.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
*
* const result = await v2.forums.list();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.forums.list_v3) | [Check return types](../types/v2/forums_list.ts)
*/
list: typeof forums_list;
/**
* ### `GET` [/v2/forums/{id}](https://osu.ppy.sh/docs/index.html#get-forum-and-topics)
* `async` Retrieves information about forum with subforums and list of recent, pinned topics.
*
*
*
* ### Parameters
* - `params.id` - ID of the forum/subforum to retrieve.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
*
* const result = await v2.forums.details({ id: 15 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.forums.details_v3) | [Check return types](../types/v2/forums_details.ts)
*/
details: typeof forums_details;
};
/**
* ### `GET` [/v2/search](https://osu.ppy.sh/docs/index.html#search)
* `async` Search for users and wiki pages.
*
*
*
* ### Global Parameters
* - `params.type` - Type of search.
* - `params.query?` - Query to search for.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Parameters for `params.type:'site'`
* - `params.location?` - Page to search on.
* - `params.page?` - Page number of the search results.
*
*
*
* ### Parameters for `params.type:'beatmaps'`
* - `params.mode?` - Gamemode to search for.
* - `params._played?` - Unknown parameter description.
* - `params._nsfw?` - Whether to include NSFW beatmaps.
* - `params.status?` - Filter by status.
* - `params.category?` - Filter by category.
* - `params.genre?` - Filter by genre.
* - `params.language?` - Filter by language.
* - `params.achieved_rank?` - Filter by achieved rank.
* - `params.extra?` - Filter by extra features.
* - `params.sort?` - Sort the results.
* - `params.cursor_string?` - Cursor string.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.search({
* type: 'site',
* mode: 'all',
* query: 'mrekk'
* });
* // or
* const result = await v2.search({
* type: 'beatmaps',
* query: 'hyikrwa'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.search_v3) | [Check return types](../types/v2/search_all.ts)
*
*/
export declare const search: <T extends {
type: "site";
location?: "all" | "user" | "wiki_page";
query?: string;
page?: number;
} | {
_played?: boolean;
_nsfw?: boolean;
type: "beatmaps";
query?: string;
mode?: number | import("..").Modes_names;
status?: import("..").beatmap_statuses;
category?: import("..").beatmap_category[];
genre?: number | import("..").beatmap_genres;
language?: number | import("..").beatmap_languages;
achieved_rank?: import("..").beatmap_ranks[];
extra?: import("..").beatmap_extra[];
sort?: import("..").beatmap_sorting;
cursor_string?: string;
}>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "site" ? import("../types/v2/search_all").SearchWiki & import("..").IError : T_1 extends "beatmaps" ? import("../types/v2/search_all").SearchBeatmaps & import("..").IError : import("..").IError : never : never>;
/**
* ##### Description
* Retrieve data from the assets API.
*/
export declare const assets: {
/**
* ### `GET` [/v2/seasonal-backgrounds](https://osu.ppy.sh/docs/index.html#get-apiv2seasonal-backgrounds)
* `async` Retrieves seasonal or beatmap backgrounds.
*
*
*
* ### Global Parameters
* - `params.type` - Source of the background.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Parameters for `params.type:'beatmapset'`
* - `params.set_id` - ID of the beatmapset.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* const result = await v2.assets.backgrounds({
* type: 'seasonal'
* });
* // or
* const result = v2.assets.backgrounds({
* type: 'beatmapset',
* set_id: 2130552,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.assets.backgrounds_v3) | [Check return types](../types/v2/assets_backgrounds.ts)
*/
backgrounds: <T extends {
type: "seasonal";
} | {
type: "beatmapset";
set_id: number;
}>(params: T, addons?: import("..").IDefaultParams) => T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "seasonal" ? Promise<import("../types/v2/assets_backgrounds").SeasonalBackgrounds & import("..").IError> : T_1 extends "beatmapset" ? import("../types/v2/assets_backgrounds").BeatmapsetBackground & import("..").IError : import("..").IError : never : never;
/**
* ### `GET` `https://data.ppy.sh/`
* `async` Retrieves all urls from the data API.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.assets.dataFiles();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.assets.datafiles_v3) | [Check return types](../types/v2/assets_datafiles.ts)
*/
dataFiles: () => Promise<import("../types/v2/assets_datafiles").AssetsDatafilesResponse & import("..").IError>;
};
/**
* ##### Description
* Retrieve data from the news API.
*/
export declare const news: {
/**
* ### `GET` [/v2/news](https://osu.ppy.sh/docs/index.html#get-news-listing)
* `async` Get a list of all the news based on certain criteria.
*
*
*
* ### Parameters
* - `params.from_year?` - Year to return posts from.
* - `params.limit?` - Maximum number of posts to return.
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.news.list();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.news.list_v3) | [Check return types](../types/v2/news_list.ts)
*/
list: (params?: {
from_year?: string;
limit?: string;
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/news_list").NewsListResponse & import("..").IError>;
/**
* ### `GET` [/v2/news/{news}](https://osu.ppy.sh/docs/index.html#get-news-post)
* `async` Retrieves a single news post based on given parameters.
*
*
*
* ### Parameters
* - `params.query` - ID or slug of the news post.
* - `params.key` - Type of the query.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.news.details({
* news_id: 1440,
* key: 'id'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.news.details_v3) | [Check return types](../types/v2/news_details.ts)
*/
details: (params: {
news_id: string;
key: "id" | "slug";
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/news_details").NewsDetailsResponse & import("..").IError>;
};
/**
* ##### Description
* Retrieve data from the notifications API.
*/
export declare const notifications: {
/**
* ### `GET` [/v2/notifications](https://osu.ppy.sh/docs/index.html#get-notifications)
* `async` Retrieves a list of the user's unread notifications.
*
*
*
* ### Parameters
* - `params.max_id` - Maximum id fetched.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login: login,
* password: password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.notifications.list();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.notifications.list_v3) | [Check return types](../types/v2/notifications_list.ts)
*/
list: (params: {
max_id: string;
unread_only: boolean;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/notifications_list").NotificationsListResponse & import("..").IError>;
/**
* ### `POST` [/v2/notifications/mark-read](https://osu.ppy.sh/docs/index.html#mark-notifications-as-read)
* `async` Perform certain actions via the notifications API.
*
*
*
* ### Global Parameters
* - `params.type` - Type of the action.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Parameters for `params.type:'mark_as_read'`
* - `params.identities[].category?` - Category of the identity.
* - `params.identities[].object_id?` Id of the object that triggered the notification.
* - `params.identities[].object_type?` Type of the object that triggered the notification.
* - `params.notifications[].category?` - Category of the notification.
* - `params.notifications[].object_id?` Id of the object that triggered the notification.
* - `params.notifications[].object_type?` Type of the object that triggered the notification.
*
*
*
* ### Usage Example
* ```js
* not working atm
* ```
*
*
*
* [See documentation](https://osu.ppy.sh/docs/index.html#mark-notifications-as-read)
*/
actions: <T extends {
type: "mark_as_read";
identities?: {
category?: string;
object_id?: string;
object_type?: string;
}[];
notifications?: {
category?: string;
id?: number;
object_id?: string;
object_type?: string;
}[];
}>(params: T, addons?: import("..").IDefaultParams) => Promise<any>;
};
/**
* ##### Description
* Retrieve data from the ranking API.
*/
export declare const ranking: {
/**
* ### `GET` [/v2/rankings/{mode}/{type}](https://osu.ppy.sh/docs/index.html#get-ranking)
* ### `GET` [/v2/rankings/kudosu](https://osu.ppy.sh/docs/index.html#get-kudosu-ranking)
* `async` Retrieves a ranking list based on given parameters.
*
*
*
* ### Global Parameters
* - `params.type` - Type of ranking search.
* - `params.page?` - Page number of the search results.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Parameters for `params.type:'charts'`
* - `params.spotlight_id?` - ID of the spotlight.
* - `params.mode?` - Gamemode to search for.
* - `params.filter?` - Filter by type.
*
*
*
* ### Parameters for `params.type:'country'`
* - `params.mode?` - Gamemode to search for.
* - `params.filter?` - Filter by type.
*
*
*
* #### Parameters for `params.type:'performance'`
* - `params.mode?` - Gamemode to search for.
* - `params.filter?` - Filter by type.
* - `params.country_code?` - Country code to search for.
* - `params.variant?` - Filter by mania variant.
*
*
*
* ### Parameters for `params.type:'score'`
* - `params.mode?` - Gamemode to search for.
* - `params.filter?` - Filter by type.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.ranking.list({
* type: 'performance',
* // or
* type: 'charts',
* // or
* type: 'country',
* // or
* type: 'score',
* mode: 'osu'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.ranking.list_v3) | [Check return types](../types/v2/ranking_list_performance.ts)
*/
list: <T extends {
page?: number;
} & ({
type: "charts";
spotlight_id?: string;
filter?: "all" | "friends";
mode?: import("..").Modes_names;
} | {
type: "country";
filter?: "all" | "friends";
mode?: import("..").Modes_names;
} | {
type: "performance";
filter?: "all" | "friends";
country_code?: string;
mode?: import("..").Modes_names;
variant?: "4k" | "7k";
} | {
type: "score";
filter?: "all" | "friends";
mode?: import("..").Modes_names;
} | {
type: "kudosu";
})>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "charts" ? import("../types/v2/ranking_list_charts").RankingListChartsResponse & import("..").IError : T_1 extends "country" ? import("../types/v2/ranking_list_country").RankingListCountryResponse & import("..").IError : T_1 extends "performance" ? import("../types/v2/ranking_list_performance").RankingListPerformanceResponse & import("..").IError : T_1 extends "score" ? import("../types/v2/ranking_list_score").RankingListScoreResponse & import("..").IError : T_1 extends "kudosu" ? import("../types/v2/ranking_list_kudosu").RankingListKudosuResponse[] & import("..").IError : import("..").IError : never : never>;
};
/**
* ##### Description
* Retrieve data from the spotlights API.
*/
export declare const spotlights: {
/**
* ### `GET` [/v2/spotlights](https://osu.ppy.sh/docs/index.html#get-spotlights)
* `async` Retrieve a list of spotlights.
*
*
*
* ### Parameters
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.spotlights.list();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.spotlights.list_v3) | [Check return types](../types/v2/spotlights_list.ts)
*/
list: (addons?: import("..").IDefaultParams) => Promise<import("../types/v2/spotlights_list").SpotlightsListResponse[] & import("..").IError>;
};
/**
* ##### Description
* Retrieve data from the wiki API.
*/
export declare const wiki: {
/**
* ### `GET` [/v2/wiki/{locale}/{path}](https://osu.ppy.sh/docs/index.html#get-wiki-page)
* `async` Retrieve a wiki page or image data.
*
*
*
* ### Parameters
* - `params.locale` - Two-letter language code of the wiki page.
* - `params.path_name` - Path of the wiki page.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* #### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* const result = await v2.wiki.details({
* locale: 'EN',
* path_name: 'Main_page'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.wiki.details_v3) | [Check return types](../types/v2/wiki_details.ts)
*/
details: (params: {
locale: string;
path_name: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/wiki_details").WikiDetailsResponse & import("..").IError>;
};
/**
* ##### Description
* Retrieve data from the me API.
*/
export declare const me: {
/**
* ### `GET` [/v2/me/download-quota-check](https://osu.ppy.sh/docs/index.html#get-apiv2medownload-quota-check)
* `async` Get your download quota. (requires lazer authentication)
*
*
*
* ### Parameters
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.me.download_quota();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.me.download_quota_v3) | [Check return types](../types/v2/me_download_quota.ts)
*/
download_quota: (addons?: import("..").IDefaultParams) => Promise<import("../types/v2/me_download_quota").MedownloadquotaResponse & import("..").IError>;
/**
* ### `GET` [/v2/friends](https://osu.ppy.sh/docs/index.html#get-apiv2friends)
* `async` Get a list of your friends. (requires lazer authentication)
*
*
*
* ### Parameters
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.me.friends();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.me.friends_v3) | [Check return types](../types/v2/me_friends.ts)
*/
friends: (addons?: import("..").IDefaultParams) => Promise<import("../types/v2/me_friends").MeFriendsResponse[] & import("..").IError>;
/**
* ### `GET` [/v2/me/{mode?}](https://osu.ppy.sh/docs/index.html#get-own-data)
* `async` Get your own data. (requires lazer authentication)
*
*
*
* ### Parameters
* - `params.mode?` - Gamemode to search for.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.me.details();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.me.details_v3) | [Check return types](../types/v2/me_details.ts)
*/
details: (params?: {
mode?: import("..").Modes_names;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/me_details").MeDetailsResponse & import("..").IError>;
};
/**
* ##### Description
* Retrieve data from the matches API.
*/
export declare const matches: {
/**
* ### `GET` [/v2/matches](https://osu.ppy.sh/docs/index.html#get-apiv2matches)
* `async` Get a list of matches.
*
*
*
* ### Parameters
* - `params.after_id` - ID of the match after which the matches will be returned.
* - `params.limit?` - Maximum number of matches to return.
* - `params.sort?` - Sort order of the matches.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.matches.list({
* limit: 10,
* sort: 'id_asc'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.matches.list_v3) | [Check return types](../types/v2/matches_list.ts)
*/
list: (params: {
limit?: number;
sort?: "id_desc" | "id_asc";
after_id: number;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/matches_list").MatchesListResponse & import("..").IError>;
/**
* ### `GET` [/v2/matches/{match}](https://osu.ppy.sh/docs/index.html#get-apiv2matchesmatch)
* `async` Get a match by certain criteria.
*
*
*
* ### Parameters
* - `params.match_id` - ID of the match.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* await v2.matches.details({ match_id: 16155689 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.matches.details_v3) | [Check return types](../types/v2/matches_details.ts)
*/
details: (params: {
match_id: number;
before?: number;
after?: number;
limit?: number;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/matches_detaIls").MatchesDetailsResponse & import("..").IError>;
};
/**
* ##### Description
* Retrieve data from the chat API.
*/
export declare const chat: {
/**
* ##### Description
* Covers API endpoints related to chat channels.
*/
channels: {
/**
* ### `GET` [/v2/chat/channels](https://osu.ppy.sh/docs/index.html#get-channel-list)
* `async` Retrieves a list of all joinable public channels. (Requires lazer authentication)
*
*
*
* ### Parameters
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.chat.channels.list();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.chat.channels.list_v3) | [Check return types](../types/v2/chat_channels_list.ts)
*/
list: (addons?: import("..").IDefaultParams) => Promise<import("../types/v2/chat_channels_list").chatChannelsListResponse[] & import("..").IError>;
};
/**
* ### `GET [/v2/chat/channels/{channel}/messages](https://osu.ppy.sh/docs/index.html#get-channel-messages)
* `async` Get a list of messages in a channel. (Requires lazer authentication)
*
*
*
* ### Parameters
* - `params.channel_id` - The ID of the channel.
* - `params.limit?` - Maximum number of messages to return.
* - `params.since?` - Message id to start returning messages from.
* - `params.until?` - Message id to end returning messages from.
* - `params.return_object?` - Whether to return object.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.chat.messages({ id: 24594482 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.chat.messages_v3) | [Check return types](../types/v2/chat_messages.ts)
*/
messages: (params: {
channel_id: number;
limit?: number;
since?: number;
until?: number;
return_object?: boolean;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/chat_messages").ChatMessagesResponse[] & import("..").IError>;
/**
* ### `GET` [/v2/chat/updates](https://osu.ppy.sh/docs/index.html#get-updates)
* `async` Retrieves the list of channels the current User is in. (Requires lazer authentication)
*
*
*
* ### Parameters
* - `params.after_id` - ID of the channel after which the channels will be returned.
* - `params.includes` - List of fields to include in the response.
* - `params.history_since` - Silence history since this id.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.chat.updates({
* after_id: 3641891943,
* includes: ['presence', 'silences']
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.chat.updates_v3) | [Check return types](../types/v2/chat_updates.ts)
*/
updates: (params: {
after_id: number;
includes?: ("presence" | "silences" | "messages")[];
history_since?: number;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/chat_updates").ChatUpdatesResponse & import("..").IError>;
/**
* ### `GET` [/v2/chat/channels/{channel}](https://osu.ppy.sh/docs/index.html#get-channel)
* `async` Get a specific channel. (Requires lazer authentication)
*
*
*
* ### Parameters
* - `params.channel_id` - The ID of the channel.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.chat.details({ channel_id: 24594482 });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.chat.details_v3) | [Check return types](../types/v2/chat_details.ts)
*/
details: (params: {
channel_id: number;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/chat_details").ChatDetailsResponse & import("..").IError>;
/**
* ### `POST` [/v2/chat/new](https://osu.ppy.sh/docs/index.html#create-new-pm)
* ### `POST` [/v2/chat/ack](https://osu.ppy.sh/docs/index.html#chat-keepalive)
* ### `POST` [/v2/chat/channels](https://osu.ppy.sh/docs/index.html#create-channel)
* ### `POST` [/v2/chat/channels/{channel}/messages](https://osu.ppy.sh/docs/index.html#send-message-to-channel)
* ### `PUT` [/v2/chat/channels/{channel}/users/{user}](https://osu.ppy.sh/docs/index.html#join-channel)
* ### `DELETE` [/v2/chat/channels/{channel}/users/{user}](https://osu.ppy.sh/docs/index.html#leave-channel)
* ### `PUT` [/v2/chat/channels/{channel}/mark-as-read/{message}](https://osu.ppy.sh/docs/index.html#mark-channel-as-read)
* `async` Performs a set of actions on channels pr PM's. (Requires lazer or cli authentication)
*
*
*
* ### Global Parameters
* - `params.type` - Type of action to perform.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Parameters for `params.type: 'send_pm'`
* - `params.is_action` - Whether the message is an action
* - `params.user_id` - The ID of the user.
* - `params.message` - The message to send.
* - `params.uuid` - client-side message identifier which will be sent back in response and websocket json.
*
*
*
* ### Parameters for `params.type: 'send_channel'`
* - `params.id` - The IDs of the channel to send to.
* - `params.message` - The message to send.
* - `params.is_action` - Whether the message is an action.
*
*
*
* ### Parameters for `params.type: 'send_announce'`
* - `params.users_ids[]` - The IDs of the users.
* - `params.message` - The message to send.
* - `params.channel_name` - Channel name.
* - `params.channel_description` - Description of the channel.
*
*
*
* ### Parameters for `params.type: 'join' | 'leave'`
* - `params.id` - The ID of the channel.
* - `params.user_id` - The ID of the user.
*
*
*
* ### Parameters for `params.type: 'read'`
* - `params.channel_id` - The ID of the channel.
* - `params.message_id` - The ID of the user.
*
*
*
* ### Parameters for `params.type: 'keepalive'`
* - `params.history_since` - The ID of the message to return `UserSilences`.
* - `params.since` - The ID of the message to return `UserSilences`.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login: login,
* password: password,
* cachedTokenPath: './lazer.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
* // or
* await auth.login({
* type: 'cli',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* redirect_url: REDIRECT_URL,
* scopes: ['public', 'chat.read', 'chat.write', 'chat.write_manage'],
* cachedTokenPath: './cli.json' // path to a file where will be stored auth token to prevent spam auth to osu
* });
*
*
* const result = await v2.chat.actions({
* type: 'send_pm',
* is_action: false,
* user_id: 2070907,
* message: '/np',
* });
* // or
* const result = await v2.chat.actions({
* type: 'send_channel',
*
* is_action: false,
* channel_id: 24594482,
* message: '.'
* });
* // or
* const result = await v2.chat.actions({
* type: 'send_announce',
*
* ids: [17063658],
* channel_name: 'test api',
* channel_description: 'a description for test',
* message: 'hello, testing api lib'
* });
* // or
* const result = await v2.chat.actions({
* type: 'join',
*
* channel_id: 55,
* user_id: 9893708,
* });
* // or
* const result = await v2.chat.actions({
* type: 'leave',
*
* channel_id: 55,
* user_id: 9893708,
* });
* // or
* const result = await v2.chat.actions({
* type: 'read',
* channel_id: 56888139,
* });
* // or
* const result = await v2.chat.actions({
* type: 'keepalive',
* since: 3769165698,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.chat.channels.actions_v3)
*/
actions: <T extends {
type: "send_pm";
is_action: boolean;
user_id: number;
message: string;
uuid?: string;
} | {
type: "send_channel";
is_action: boolean;
channel_id: number;
message: string;
} | {
type: "send_announce";
users_ids: number[];
message: string;
channel_name: string;
channel_description: string;
} | {
type: "join" | "leave";
channel_id: number; /**
* ### `GET` [/v2/beatmaps/packs](https://osu.ppy.sh/docs/index.html#get-beatmap-packs)
* `async` Retrieves a list of all available beatmap packs.
*
*
*
* ## Parameters
* - `params.type` - Type of the beatmap pack.
* - `params.cusor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'v2',
* client_id: CLIENT_ID,
* client_secret: CLIENT_SECRET,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.beatmaps.packs.list({
* type: 'loved'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.beatmaps.packs.list_v3) | [Check return types](../types/v2/beatmaps_packs_list.ts)
*/
user_id: number;
} | {
type: "read";
channel_id: number;
message_id: number;
} | {
type: "keepalive";
history_since?: number;
since?: number;
}>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "new" ? import("../types/v2/chat_actions_new").ChatActionsNewResponse & import("..").IError : T_1 extends "send" ? import("../types/v2/chat_actions_send").chatActionsSendResponse & import("..").IError : T_1 extends "join" ? import("../types/v2/chat_actions_join").chatActionsJoinResponse & import("..").IError : T_1 extends "leave" ? "" & import("..").IError : T_1 extends "read" ? "" & import("..").IError : T_1 extends "keepalive" ? import("../types/v2/chat_actions_keepalive").ChatActionsKeepaliveResponse[] & import("..").IError : import("..").IError : never : never>;
};
/**
* ##### Description
* Retrieve data from the session API.
*/
export declare const session: {
/**
* ### `POST` [/v2/session/verify](https://osu.ppy.sh/docs/index.html#post-apiv2sessionverify)
* ### `POST` [/v2/session/verify/reissue](https://osu.ppy.sh/docs/index.html#post-apiv2sessionverifyreissue)
* ### `DELETE` [/v2/oauth/tokens/current](https://osu.ppy.sh/docs/index.html#revoke-current-token)
* `async` Perform session actions via endpoint.
*
*
*
* ### Parameters
* - `params.type` - Type of the action to perform.
* - `params.code` - verification code from email (only for `params.type: verify`)
* - `addons` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.session.actions({
* type: 'verify',
* code: '7aah1f7e'
* });
* // or
* const result = await v2.session.actions({
* type: 'reissue',
* });
* // or
* const result = await v2.session.actions({
* type: 'delete',
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.session.actions_v3)
*/
actions: <T extends {
type: "verify";
code: string;
} | {
type: "reissue";
} | {
type: "delete";
}>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "verify" ? "" & import("..").IError : T_1 extends "reissue" ? {
message: string;
} & import("..").IError : T_1 extends "delete" ? "" & import("..").IError : import("..").IError : never : never>;
};
/**
* ##### Description
* Retrieve data from the rooms API.
*/
export declare const rooms: {
/**
* ### `GET` [/v2/rooms](https://osu.ppy.sh/docs/index.html#get-multiplayer-rooms)
* `async` Retrieve a list of multiplayer rooms.
*
*
*
* ### Parameters
* - `params.type?` - Type of rooms to retrieve.
* - `params.status?` - Status of the rooms to retrieve.
* - `params.query?` - Query to search for.
* - `params.limit?` - Number of rooms to return.
* - `params.sort?` - Sort order of the rooms.
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.rooms.list({
* type: 'realtime',
* query: 'te',
* });
* // or
* const result = await v2.rooms.list({
* type: 'playlists',
* query: 'te',
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.rooms.list_v3) | [Check return types](../types/v2/rooms_list.ts)
*/
list: (params: {
type?: "playlists" | "realtime";
status?: "all" | "active" | "ended" | "participated" | "owned";
query?: string;
limit?: number;
sort?: "ended" | "created";
cursor_string?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/rooms_list").RoomsListResponse & import("..").IError>;
/**
* ### `GET` [/v2/rooms/{room}/playlist/{playlist}/scores](https://osu.ppy.sh/docs/index.html#get-scores)
* ### `GET` [/v2/rooms/{room}/playlist/{playlist}/scores/{score}](https://osu.ppy.sh/docs/index.html#get-a-score)
* ### `GET` [/v2/rooms/{room}/playlist/{playlist}/scores/users/{user}](https://osu.ppy.sh/docs/index.html#get-user-high-score)
* `async` Retrieve a list of scores from playlists.
*
*
*
* ### Global Parameters
* - `params.type` - Type of retrieval.
* - `params.id` - ID of the room.
* - `params.playlist_id` - ID of the playlist.
*
* ### Parameters for `params.type: 'all'`
* - `params.limit?` - Maximum number of scores to return.
* - `params.sort?` - Sort order of the scores.
* - `params.cursor_string?` - [Cursor string for pagination.](https://osu.ppy.sh/docs/index.html#cursorstring)
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.rooms.scores({
* type: 'all',
*
* id: 582709,
* playlist_id: 5302678,
* });
* // or
* const result = await v2.rooms.scores({
* type: 'single',
*
* id: 582709,
* playlist_id: 5302678,
* score_id: 2414452489,
* });
* // or
* const result = await v2.rooms.scores({
* type: 'user_highest',
*
* id: 582709,
* playlist_id: 5302678,
* user_id: 35015585,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.rooms.scores_v3) | [Check return types](../types/v2/rooms_scores_all.ts)
*/
scores: <T extends {
type: "all";
id: number;
playlist_id: number;
limit?: number;
sort?: "score_asc" | "score_desc";
cursor_string?: string;
} | {
type: "single";
id: number;
playlist_id: number;
score_id: number;
} | {
/**
* ##### Description
* Object containing methods for retrieving beatmaps data.
*/
type: "user_highest";
id: number;
playlist_id: number;
user_id: number;
}>(params: T, addons?: import("..").IDefaultParams) => Promise<T["type"] extends infer T_1 ? T_1 extends T["type"] ? T_1 extends "all" ? import("../types/v2/rooms_scores_all").RoomsScoresAllResponse & import("..").IError : T_1 extends "single" ? import("../types/v2/rooms_scores_single").RoomsScoresSingleResponse & import("..").IError : T_1 extends "user_highest" ? import("../types/v2/rooms_scores_user_highest").RoomScoresUserHighestResponse & import("..").IError : import("..").IError : never : never>;
/**
* ### `GET` [/v2/rooms/{room}](https://osu.ppy.sh/docs/index.html#get-apiv2roomsroom)
* `async` Retrieve a room by given parameters.
*
*
*
* ### Parameters
* - `params.id` - ID of the room to retrieve.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.rooms.details({
* id: 582709,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.rooms.details_v3) | [Check return types](../types/v2/rooms_details.ts)
*/
details: (params: {
id: number | "latest";
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/rooms_details").RoomsDetailsResponse & import("..").IError>;
/**
* ### `GET` [/v2/rooms/{room}/leaderboard](https://osu.ppy.sh/docs/index.html#get-apiv2roomsroomleaderboard)
* `async` Retrieve a leaderboard from a room.
*
*
*
* ### Parameters
* - `params.id` - ID of the room.
* - `params.limit?` - Maximum number of scores to return.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { auth, v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* await auth.login({
* type: 'lazer',
* login,
* password,
* cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
* });
*
* const result = await v2.rooms.leaderboard({
* id: 582265,
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.rooms.leaderboard_v3) | [Check return types](../types/v2/rooms_leaderboard.ts)
*/
leaderboard: (params: {
id: number;
limit?: number;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/rooms_leaderboard").RoomsLeaderboardResponse & import("..").IError>;
};
/**
* ##### Description
* Retrieve data from the groups API.
*/
export declare const groups: {
/**
* ### `GET` /groups/{id}
* `async` Retrieves a list of users by given group id.
*
*
*
* ### Parameters
* - `params.id` - Group id.
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* const result = await v2.groups.details({
* id: '32'
* });
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.groups.details_v3) | [Check return types](../types/v2/groups_details.ts)
*/
details: (params: {
id: "4" | "16" | "32" | "7" | "11" | "22" | "28" | "31";
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/groups_details").GroupsDetailsResponse & import("..").IError>;
/**
* ### `GET` /groups/history
* `async` Retrieves a groups history
*
*
*
* ### Parameters
* - `params.user?` - User id or name
* - `params.group?` - Group indentifier
* - `params.sort?` - id_asc or id_desc
* - `params.max_date?` - Max date in ISOString format
* - `params.min_date?` - Min date in ISOString format
* - `addons?` - Additional parameters to include in the request.
*
*
*
* ### Usage Example
* ```js
* const { v2 } = require('osu-api-extended');
*
* async function main() {
* try {
* const result = await v2.groups.history();
* if (result.error != null) {
* console.log(result.error);
* return;
* };
*
* console.log(result);
* } catch (error) {
* console.log(error);
* };
* };
*
* main();
* ```
*
*
*
* [See documentation](https://github.com/cyperdark/osu-api-extended/wiki/v2.groups.history_v3) | [Check return types](../types/v2/groups_history.ts)
*/
history: (params: {
user?: string | number;
group?: "loved" | "gmt" | "nat" | "dev" | "alumni" | "support" | "bng" | "bng_limited";
sort?: "id_desc" | "id_asc";
max_date?: string;
min_date?: string;
}, addons?: import("..").IDefaultParams) => Promise<import("../types/v2/groups_history").GroupsHistoryResponse & import("..").IError>;
};