UNPKG

osu-api-extended

Version:

Advanced osu! api wrapper for v1 and v2, with extra stuff

32 lines (31 loc) 1.36 kB
import { IDefaultParams, IError } from "../../types"; import { CommentsActionsNewResponse } from "../../types/v2/comments_actions_new"; import { CommentsActionsEditResponse } from "../../types/v2/comments_actions_edit"; import { CommentsActionsDeleteResponse } from "../../types/v2/comments_actions_delete"; import { CommentsActionsVoteResponse } from "../../types/v2/comments_actions_vote"; import { CommentsActionsUnvoteResponse } from "../../types/v2/comments_actions_unvote"; type params = ({ 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; }); type Response<T extends params['type']> = T extends 'new' ? CommentsActionsNewResponse & IError : T extends 'edit' ? CommentsActionsEditResponse & IError : T extends 'delete' ? CommentsActionsDeleteResponse & IError : T extends 'vote' ? CommentsActionsVoteResponse & IError : T extends 'unvote' ? CommentsActionsUnvoteResponse & IError : IError; export declare const comments_actions: <T extends params>(params: T, addons?: IDefaultParams) => Promise<Response<T["type"]> | { error: string; }>; export {};