UNPKG

osu-api-extended

Version:

Advanced osu! api wrapper cover all V2 and V1 endpoints, and provide useful tools

38 lines (37 loc) 1.55 kB
import { IDefaultParams, IError } from "../../types"; import { ForumsTopicsActionsCreateResponse } from "../../types/v2/forums_topics_actions_create"; import { ForumsTopicsActionsReplyResponse } from "../../types/v2/forums_topics_actions_reply"; import { ForumsTopicsActionsEditTopicResponse } from "../../types/v2/forums_topics_actions_edit_topic"; import { ForumsTopicsActionsEditPostResponse } from "../../types/v2/forums_topics_actions_edit_post"; type params = ({ 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; }); type Response<T extends params['type']> = T extends 'create' ? ForumsTopicsActionsCreateResponse & IError : T extends 'reply' ? ForumsTopicsActionsReplyResponse & IError : T extends 'edit_post' ? ForumsTopicsActionsEditPostResponse & IError : T extends 'edit_topic' ? ForumsTopicsActionsEditTopicResponse & IError : IError; export declare const forums_topics_actions: <T extends params>(params: T, addons?: IDefaultParams) => Promise<Response<T["type"]>>; export {};