import type { UserIdResolvable } from 'twitch-common'; import { BaseApi } from '../../BaseApi'; import type { CommercialLength } from '../../Shared/CommercialLength'; import { Team } from '../Team/Team'; import { User } from '../User/User'; import { Channel } from './Channel'; import { ChannelFollow } from './ChannelFollow'; import { ChannelSubscription } from './ChannelSubscription'; import { PrivilegedChannel } from './PrivilegedChannel'; /** * Channel data to update using {@ChannelApi#updateChannel}. */ export interface ChannelUpdateData { /** * The status/title of the channel. */ status?: string; /** * The currently played game. */ game?: string; /** * The desired delay of the stream. */ delay?: number; /** * Whether or not to show the channel feed. */ channel_feed_enabled?: boolean; } /** * The API methods that deal with channels. * * Can be accessed using `client.kraken.channels` on an {@ApiClient} instance. * * ## Example * ```ts * const api = new ApiClient(new StaticAuthProvider(clientId, accessToken)); * const channel = await api.kraken.channels.getMyChannel(); * ``` */ export declare class ChannelApi extends BaseApi { /** * Gets the channel the client is logged in to. */ getMyChannel(): Promise; /** * Retrieves the channel for the given user. * * @param user The user you want to retrieve the channel for. */ getChannel(user: UserIdResolvable): Promise; /** * Updates the given channel with the given data. * * @param channel The channel you want to update. * @param data The updated channel data. */ updateChannel(channel: UserIdResolvable, data: ChannelUpdateData): Promise; /** * Retrieves the list of users that have editor rights to the given channel. * * @param channel The channel you want to retrieve the list of editors for. */ getChannelEditors(channel: UserIdResolvable): Promise; /** * Retrieves the list of followers of the given channel. * * @param channel The channel you want to retrieve the list of followers of. * @param page The result page you want to retrieve. * @param limit The number of results you want to retrieve. * @param orderDirection The direction to order in - ascending or descending. */ getChannelFollowers(channel: UserIdResolvable, page?: number, limit?: number, orderDirection?: 'asc' | 'desc'): Promise; /** * Retrieves the list of subscribers of the given channel. * * @param channel The channel you want to retrieve the list of subscribers of. * @param page The result page you want to retrieve. * @param limit The number of results you want to retrieve. * @param orderDirection The direction to order in - ascending or descending. */ getChannelSubscriptions(channel: UserIdResolvable, page?: number, limit?: number, orderDirection?: 'asc' | 'desc'): Promise; /** * Retrieves the total number of subscribers for the given channel. * * @param channel The channel you want to retrieve the number of subscribers for. */ getChannelSubscriptionCount(channel: UserIdResolvable): Promise; /** * Retrieves the subscription data for the given user to a given channel. * * Throws if the channel doesn't have a subscription program or the user is not subscribed to it. * * This method requires access to the channel. If you only have access to the user, * use {@UserApi#getSubscriptionData} instead. * * @param channel The channel to check the subscription to. * @param byUser The user to check the subscription for. */ getChannelSubscriptionByUser(channel: UserIdResolvable, byUser: UserIdResolvable): Promise; /** * Retrieves a list of teams of the given channel. * * @param channel The channel you want to retrieve the list of teams of. */ getChannelTeams(channel: UserIdResolvable): Promise; /** * Starts a commercial in the given channel. * * @param channel The channel to start the commercial in. * @param length The length of the commercial. */ startChannelCommercial(channel: UserIdResolvable, length: CommercialLength): Promise; /** * Resets the given channel's stream key. * * @param channel The channel to reset the stream key for. */ resetChannelStreamKey(channel: UserIdResolvable): Promise; private _getChannelSubscriptions; }