UNPKG

osu-api-extended

Version:

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

39 lines (38 loc) 1.48 kB
import { IDefaultParams, IError } from "../../types"; import { ChatActionsNewResponse } from "../../types/v2/chat_actions_new"; import { ChatActionsKeepaliveResponse } from "../../types/v2/chat_actions_keepalive"; import { chatActionsSendResponse } from "../../types/v2/chat_actions_send"; import { chatActionsJoinResponse } from "../../types/v2/chat_actions_join"; type params = ({ 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; user_id: number; } | { type: 'read'; channel_id: number; message_id: number; } | { type: 'keepalive'; history_since?: number; since?: number; }); type Response<T extends params['type']> = T extends 'new' ? ChatActionsNewResponse & IError : T extends 'send' ? chatActionsSendResponse & IError : T extends 'join' ? chatActionsJoinResponse & IError : T extends 'leave' ? "" & IError : T extends 'read' ? "" & IError : T extends 'keepalive' ? ChatActionsKeepaliveResponse[] & IError : IError; export declare const chat_actions: <T extends params>(params: T, addons?: IDefaultParams) => Promise<Response<T["type"]>>; export {};