import { ApiClient, HelixAdSchedule, HelixBitsLeaderboardEntry, HelixBitsLeaderboardPeriod, HelixChannel, HelixChannelFollower, HelixChannelUpdate, HelixChatChatter, HelixCheermoteList, HelixClip, HelixGoal, HelixHypeTrain, HelixModerator, HelixPoll, HelixPrediction, HelixStream, HelixTeam, HelixUser, HelixUserEmote, HelixUserRelation, HelixVideo, UserIdResolvable, } from "@twurple/api"; type TwitchCategory = { id: string; name: string; boxArtUrl: string; }; type ImageSet = { ur11x: string; ur12x: string; ur14x: string; }; type CustomReward = { broadcasterId: string; broadcasterLogin: string; broadcasterName: string; id: string; title: string; prompt: string; cost: number; image?: ImageSet; defaultImage: ImageSet; backgroundColor: string; isEnabled: boolean; isUserInputRequired: boolean; maxPerStreamSetting: { isEnabled: boolean; maxPerStream: number; }; maxPerUserPerStreamSetting: { isEnabled: boolean; maxPerUserPerStream: number; }; globalCooldownSetting: { isEnabled: boolean; globalCooldownSeconds: number; }; isPaused: boolean; isInStock: boolean; shouldRedemptionsSkipRequestQueue: boolean; redemptionsRedeemedCurrentStream: number; cooldownExpiresAt?: string; }; type RewardRedemption = { id: string; rewardId: string; redemptionDate: Date; userId: string; userName: string; userDisplayName: string; rewardMessage?: string; }; type RewardRedemptionsApprovalRequest = { rewardId: string; redemptionIds?: string[]; approve?: boolean; }; type ResultWithError = { success: boolean; result?: TResult; error?: TError; }; export type TwitchApi = { getClient(): ApiClient; bits: { getChannelBitsLeaderboard( count?: number, period?: HelixBitsLeaderboardPeriod, startDate?: Date, userId?: string ): Promise; getChannelBitsTopCheerers( count?: number, period?: HelixBitsLeaderboardPeriod, startDate?: Date ): Promise; getChannelCheermotes(): Promise; }; categories: { getCategoryById( id: string, size?: string ): Promise; searchCategories(query: string): Promise; }; channelRewards: { getCustomChannelRewards( onlyManageable?: boolean ): Promise; getCustomChannelReward(rewardId: string): Promise; getManageableCustomChannelRewards(): Promise; getUnmanageableCustomChannelRewards(): Promise; getTotalChannelRewardCount(): Promise; createCustomChannelReward(reward: CustomReward): Promise; updateCustomChannelReward(reward: CustomReward): Promise; deleteCustomChannelReward(rewardId: string): Promise; getOpenChannelRewardRedemptions(): Promise< Record >; approveOrRejectChannelRewardRedemption( request: RewardRedemptionsApprovalRequest ): Promise; approveOrRejectAllRedemptionsForChannelRewards( rewardIds: string[], approve?: boolean ): Promise; }; channels: { getChannelInformation(broadcasterId: string): Promise; getOnlineStatus(username: string): Promise; updateChannelInformation(data: HelixChannelUpdate): Promise; getChannelInformationByUsername( username: string ): Promise; getAdSchedule(): Promise; triggerAdBreak(adLength?: number): Promise; snoozeAdBreak(): Promise; raidChannel(targetUserId: string): Promise; cancelRaid(): Promise; getVips(): Promise; }; charity: { getCurrentCharityFundraiserTotal(): Promise; getCurrentCharityFundraiserGoal(): Promise; }; chat: { /** * Sends a chat message to the streamer's chat. * * @param message Chat message to send. * @param replyToMessageId The ID of the message this should be replying to. If not replying to a message, use `null`. * @param sendAsBot If the chat message should be sent as the bot or not. * If this is set to `false` or the bot account is not logged in, the chat message will be sent as the streamer. * Default is `false`. * @returns `true` if sending the chat message was successful or `false` if it failed */ sendChatMessage( message: string, replyToMessageId?: string, sendAsBot?: boolean ): Promise; getAllChatters(): Promise; sendShoutout( targetUserId: string ): Promise>; deleteChatMessage(messageId: string): Promise; clearChat(): Promise; setEmoteOnlyMode(enable?: boolean): Promise; setFollowerOnlyMode( enable?: boolean, duration?: number ): Promise; setSubscriberOnlyMode(enable?: boolean): Promise; setSlowMode(enable?: boolean, duration?: number): Promise; setUniqueMode(enable?: boolean): Promise; getColorForUser(targetUserId: string): Promise; getAllUserEmotes( account?: "streamer" | "bot" ): Promise; }; clips: { createClip(): Promise; getClipFromClipUrl(url: string): Promise; getRandomClipForUserById( userId: UserIdResolvable, limit?: number, isFeatured?: boolean, startDate?: Date, endDate?: Date ): Promise; getRandomClipForUserByName( username: string, limit?: number, isFeatured?: boolean, startDate?: Date, endDate?: Date ): Promise; getLatestClipForUserById( userId: UserIdResolvable, isFeatured?: boolean ): Promise; getLatestClipForUserByName( username: string, isFeatured?: boolean ): Promise; }; goals: { getCurrentChannelGoals(): Promise; }; hypeTrain: { getCurrentHypeTrain(): Promise; }; moderation: { isUserTimedOut(userId: UserIdResolvable): Promise; timeoutUser( userId: UserIdResolvable, duration: number, reason?: string ): Promise; isUserBanned(userId: UserIdResolvable): Promise; banUser(userId: UserIdResolvable, reason?: string): Promise; unbanUser(userId: UserIdResolvable): Promise; getModerators(): Promise; addChannelModerator(userId: UserIdResolvable): Promise; removeChannelModerator(userId: UserIdResolvable): Promise; addChannelVip(userId: UserIdResolvable): Promise; removeChannelVip(userId: UserIdResolvable): Promise; }; polls: { createPoll( title: string, choices: string[], duration: number, channelPointsPerVote?: number ): Promise; endPoll(pollId: string, showResult?: boolean): Promise; getMostRecentPoll(): Promise; }; predictions: { createPrediction( title: string, outcomes: string[], duration: number ): Promise; lockPrediciton(predictionId: string): Promise; cancelPrediction(predictionId: string): Promise; resolvePrediction( predictionId: string, outcomeId: string ): Promise; getMostRecentPrediction(): Promise; }; streams: { createStreamMarker(description?: string): Promise; getStreamersCurrentStream(): Promise; getStreamUptime(): Promise; }; subscriptions: { getSubscriberCount(): Promise; getSubPointCount(): Promise; }; teams: { getTeams(broadcasterId: string): Promise; getMatchingTeams(userId: string): Promise; getMatchingTeamsByName(username: string): Promise; getMatchingTeamsById(userId: string): Promise; getStreamerTeams(): Promise; }; users: { getUserById(userId: string): Promise; getUsersByIds(userIds: string[]): Promise; getUserByName(username: string): Promise; getUsersByNames(usernames: string[]): Promise; getFollowDateForUser(username: string): Promise; getUserChannelFollow( username: string, channelName: string ): Promise; doesUserFollowChannel( username: string, channelName: string ): Promise; blockUser( userId: UserIdResolvable, reason?: "spam" | "harassment" | "other" ): Promise; unblockUser(userId: UserIdResolvable): Promise; }; videos: { /** * Gets the VOD object for the specified stream * @param streamId ID of the stream * @returns A {@linkcode HelixVideo} object representing the VOD */ getVodByStreamId(streamId: string): Promise; }; whispers: { sendWhisper( recipientUserId: UserIdResolvable, message: string, sendAsBot?: boolean ): Promise; }; };