import type { UserIdResolvable, UserIdResolvableType, UserNameResolveableType } from 'twitch-common'; import type { ApiClient } from '../../../ApiClient'; import type { Channel } from '../Channel/Channel'; import { ChannelPlaceholder } from '../Channel/ChannelPlaceholder'; import type { EmoteSetList } from '../Channel/EmoteSetList'; import type { Stream } from '../Stream/Stream'; import type { UserFollow } from './UserFollow'; import type { UserSubscription } from './UserSubscription'; /** @private */ export interface UserData { _id: string; bio: string; created_at: string; name: string; display_name: string; logo: string; type: string; updated_at: string; } /** * A Twitch user. */ export declare class User implements UserIdResolvableType, UserNameResolveableType { /** @private */ protected readonly _data: UserData; /** @private */ protected readonly _client: ApiClient; constructor(data: UserData, client: ApiClient); /** @private */ get cacheKey(): string; /** * The ID of the user. */ get id(): string; /** * The bio of the user. */ get bio(): string; /** * The date when the user was created, i.e. when they registered on Twitch. */ get creationDate(): Date; /** * The last date when the user changed anything in their profile, e.g. their description or their profile picture. */ get updateDate(): Date; /** * The name of the user. */ get name(): string; /** * The display name of the user. */ get displayName(): string; /** * The URL to the profile picture of the user. */ get logoUrl(): string; /** * The type of the user. */ get type(): string; /** * Retrieves the channel data of the user. */ getChannel(): Promise; /** * Gets a channel placeholder object for the user, which can do anything you can do to a channel with just the ID. */ getChannelPlaceholder(): ChannelPlaceholder; /** * Retrieves the currently running stream of the user. */ getStream(): Promise; /** * Retrieves the subscription data for the user to the 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 user. If you only have access to the channel, * use {@ChannelPlaceholder#getSubscriptionBy} instead. * * @param channel The channel you want to get the subscription data for. */ getSubscriptionTo(channel: UserIdResolvable): Promise; /** * Checks whether the user is subscribed to the given channel. * * @param channel The channel you want to check the subscription for. */ isSubscribedTo(channel: UserIdResolvable): Promise; /** * Retrieves a list of channels followed by the user. * * @param page The result page you want to retrieve. * @param limit The number of results you want to retrieve. * @param orderBy The field to order by. * @param orderDirection The direction to order in - ascending or descending. */ getFollows(page?: number, limit?: number, orderBy?: 'created_at' | 'last_broadcast' | 'login', orderDirection?: 'asc' | 'desc'): Promise; /** * Retrieves the follow data of the user to a given channel. * * @param channel The channel to retrieve the follow data for. */ getFollowTo(channel: UserIdResolvable): Promise; /** * Checks whether the user is following the given channel. * * @param channel The channel to check for the user's follow. */ follows(channel: UserIdResolvable): Promise; /** * Follows the channel with the authenticated user. */ follow(): Promise; /** * Unfollows the channel with the authenticated user. */ unfollow(): Promise; /** * Retrieves the emotes the user can use. */ getEmotes(): Promise; }