UNPKG

fnbr

Version:

A library to interact with Epic Games' Fortnite HTTP and XMPP services

99 lines (98 loc) 3.5 kB
import Base from '../../Base'; import type { BRAccountLevel, ExternalAuths, UserData } from '../../../resources/structs'; import type Avatar from '../Avatar'; import type GlobalProfile from '../GlobalProfile'; import type EventTokens from '../EventTokens'; import type Client from '../../Client'; /** * Represents a user */ declare class User extends Base { /** * The user's display name (Might be undefined) */ private _displayName?; /** * The user's id */ id: string; /** * The user's external auths (Linked platforms) */ externalAuths: ExternalAuths; /** * @param client The main client * @param data The user's data */ constructor(client: Client, data: UserData); /** * The user's display name (In case its undefined, use {@link User#fetch}) */ get displayName(): string | undefined; /** * Whether the user is headless (the account is not actually an epicgames account) */ get isHeadless(): boolean; /** * Sends a friendship request to this user or accepts an existing one * @throws {UserNotFoundError} The user wasn't found * @throws {DuplicateFriendshipError} The user is already friends with the client * @throws {FriendshipRequestAlreadySentError} A friendship request has already been sent to the user * @throws {InviterFriendshipsLimitExceededError} The client's friendship limit is reached * @throws {InviteeFriendshipsLimitExceededError} The user's friendship limit is reached * @throws {InviteeFriendshipSettingsError} The user disabled friend requests * @throws {InviteeFriendshipRequestLimitExceededError} The user's incoming friend request limit is reached * @throws {EpicgamesAPIError} */ addFriend(): Promise<void>; /** * Blocks this user * @throws {UserNotFoundError} The user wasn't found * @throws {EpicgamesAPIError} */ block(): Promise<void>; /** * Updates this user's display name and external auths * @throws {UserNotFoundError} The user wasn't found */ fetch(): Promise<void>; /** * Fetches battle royale v2 stats for this user * @throws {UserNotFoundError} The user wasn't found * @throws {StatsPrivacyError} The user set their stats to private * @throws {EpicgamesAPIError} */ getBRStats(startTime?: number, endTime?: number): Promise<import("../Stats").default>; /** * Fetches the battle royale account level for this user * @param seasonNumber The season number (eg. 16, 17, 18) */ getBRAccountLevel(seasonNumber: number): Promise<BRAccountLevel | undefined>; /** * Fetches the avatar for this user * @throws {EpicgamesAPIError} */ getAvatar(): Promise<Avatar | undefined>; /** * Fetches the global profile for this user * @throws {EpicgamesAPIError} */ getGlobalProfile(): Promise<GlobalProfile | undefined>; /** * Fetches the event tokens for an account. * This can be used to check if a user is eligible to play a certain tournament window * or to check a user's arena division in any season * @throws {EpicgamesAPIError} */ getEventTokens(): Promise<EventTokens | undefined>; /** * Updates this user with the given data * @param data The updated user data */ update(data: UserData): void; /** * The raw user data */ toObject(): UserData; } export default User;