UNPKG

fnbr

Version:

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

165 lines (164 loc) 6.26 kB
import ClientPartyMemberMeta from './ClientPartyMemberMeta'; import PartyMember from './PartyMember'; import type { CosmeticEnlightment, Cosmetics, CosmeticVariant, PartyMemberData, PartyMemberSchema } from '../../../resources/structs'; import type Party from './Party'; /** * Represents the client's party member */ declare class ClientPartyMember extends PartyMember { /** * The patch queue */ private patchQueue; /** * The member's meta */ meta: ClientPartyMemberMeta; /** * @param party The party this member belongs to * @param data The member data */ constructor(party: Party, data: PartyMemberData); /** * Sends a meta patch to Epicgames's servers * @param updated The updated schema * @throws {EpicgamesAPIError} */ sendPatch(updated: PartyMemberSchema): Promise<void>; /** * Updates the client party member's readiness * @param ready Whether the client party member is ready * @throws {EpicgamesAPIError} */ setReadiness(ready: boolean): Promise<void>; /** * Updates the client party member's sitting out state * @param sittingOut Whether the client party member is sitting out * @throws {EpicgamesAPIError} */ setSittingOut(sittingOut: boolean): Promise<void>; /** * Updates the client party member's level * @param level The new level * @throws {EpicgamesAPIError} */ setLevel(level: number): Promise<void>; /** * Updates the client party member's battle pass info * @param isPurchased Whether the battle pass is purchased * @param level The battle pass level * @param selfBoost The battle pass self boost percentage * @param friendBoost The battle pass friend boost percentage * @throws {EpicgamesAPIError} */ setBattlePass(isPurchased: boolean, level: number, selfBoost: number, friendBoost: number): Promise<void>; /** * Updates the client party member's banner * @param bannerId The new banner's id * @param color The new banner's color * @throws {EpicgamesAPIError} */ setBanner(bannerId: string, color: string): Promise<void>; /** * Updates multiple cosmetics for the client party member. * If a cosmetic is set to `undefined` or any falsy value, it will be cleared, if possible. * If a cosmetic is not provided, it will remain unchanged. * @param cosmetics An object specifying the cosmetics to update, including outfit, backpack, pickaxe and shoes. * @throws {EpicgamesAPIError} */ setCosmetics(cosmetics?: Cosmetics): Promise<void>; /** * Updates the client party member's outfit * @param id The outfit's ID * @param variants The outfit's variants * @param enlightment The outfit's enlightment * @throws {EpicgamesAPIError} */ setOutfit(id: string, variants?: CosmeticVariant[], enlightment?: CosmeticEnlightment): Promise<void>; /** * Updates the client party member's backpack * @param id The backpack's ID * @param variants The backpack's variants * @param path The backpack's path in the game files * @throws {EpicgamesAPIError} */ setBackpack(id: string, variants?: CosmeticVariant[], path?: string): Promise<void>; /** * Updates the client party member's pet * @param id The pet's ID * @param variants The pet's variants * @param path The pet's path in the game files */ setPet(id: string, variants?: CosmeticVariant[], path?: string): Promise<void>; /** * Updates the client party member's pickaxe * @param id The pickaxe's ID * @param variants The pickaxe's variants * @param path The pickaxe's path in the game files * @throws {EpicgamesAPIError} */ setPickaxe(id: string, variants?: CosmeticVariant[], path?: string): Promise<void>; /** * Updates the client party member's shoes * @param id The shoes's ID * @param path The shoes' path in the game files * @throws {EpicgamesAPIError} */ setShoes(id: string, path?: string): Promise<void>; /** * Updates the client party member's emote * @param id The emote's ID * @param path The emote's path in the game files * @throws {EpicgamesAPIError} */ setEmote(id: string, path?: string): Promise<void>; /** * Updates the client party member's emoji * @param id The emoji's ID * @param path The emoji's path in the game files * @throws {EpicgamesAPIError} */ setEmoji(id: string, path?: string): Promise<void>; /** * Clears the client party member's emote and emoji * @throws {EpicgamesAPIError} */ clearEmote(): Promise<void>; /** * Clears the client party member's backpack * @throws {EpicgamesAPIError} */ clearBackpack(): Promise<void>; /** * Clears the client party member's shoes * @throws {EpicgamesAPIError} */ clearShoes(): Promise<void>; /** * Updates the client party member's match state. * NOTE: This is visually, the client will not actually join a match * @param isPlaying Whether the client is in a match * @param playerCount The match player count (must be between 0 and 255) * @param startedAt The start date of the match * @throws {EpicgamesAPIError} */ setPlaying(isPlaying?: boolean, playerCount?: number, startedAt?: Date): Promise<void>; /** * Updates the client party member's pre lobby map marker. * [0, 0] would be the center of the map * @param isSet Whether the marker is set * @param locationX The marker x location * @param locationY The marker y location * @throws {EpicgamesAPIError} */ setMarker(isSet: boolean, locationX?: number, locationY?: number): Promise<void>; /** * Updates the client party member's cosmetic stats. * Crowns are shown when using the EID_Coronet emote * @param crowns The amount of crowns / "Royal Royales" * @param rankedProgression The ranked progression * @throws {EpicgamesAPIError} */ setCosmeticStats(crowns: number, rankedProgression: number): Promise<void>; } export default ClientPartyMember;