osu-api-extended
Version:
Advanced osu! api wrapper cover all V2 and V1 endpoints, and provide useful tools
32 lines (31 loc) • 1.35 kB
TypeScript
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 {};