@zikeji/hypixel
Version:
With IntelliSense support & test coverage, this is an unopinionated async/await API wrapper for Hypixel's Public API. It is developed in TypeScript complete with documentation, typed interfaces for all API responses, built-in rate-limit handling, flexible
48 lines (47 loc) • 1.96 kB
TypeScript
/**
* This portion of code was ported from the [hypixel-php](https://github.com/Plancke/hypixel-php) library.
*
* Copyright (c) 2021 Zikeji
* Copyright (c) 2017 Aäron Plancke
*
* For the original full copyright and license information, please view the LICENSE-HYPIXEL-PHP.md that was distributed with this source code.
*/
import type { PlayerResponse } from "../types/AugmentedTypes";
import { SkyWarsPrestige } from "./SkyWarsPrestige";
/**
* Interface describing the results from the {@link getSkyWarsLevelInfo} function.
*/
export interface SkyWarsLevelInfo {
level: number;
preciseLevel: number;
currentExp: number;
expToLevel: number;
expToNextLevel: number;
remainingExpToNextLevel: number;
}
/**
* This interface is returned by {@link getSkyWarsLevelInfo} if you passed true as the second parameter.
*/
export interface SkyWarsLevelInfoAndPrestige extends SkyWarsLevelInfo {
prestige: SkyWarsPrestige;
expToPrestige: number;
nextPrestige?: SkyWarsPrestige;
expToNextPrestige?: number;
remainingExpToNextPrestige?: number;
progressToNextPrestige?: number;
}
/**
* Returns the total amount of exp it takes to get to a certain level.
* @param level The level of the player.
* @category Helper
*/
export declare function totalExpToSkyWarsLevel(level: number): number;
/**
* Get SkyWars level information from a player object or raw experience value.
* @param data A player object or the raw experience value.
* @param includePrestige Whether or not to return the {@link SkyWarsPrestige} object.
* @category Helper
*/
export declare function getSkyWarsLevelInfo(data: PlayerResponse["player"] | number): SkyWarsLevelInfo;
export declare function getSkyWarsLevelInfo(data: PlayerResponse["player"] | number, includePrestige: true): SkyWarsLevelInfoAndPrestige;
export declare function getSkyWarsLevelInfo(data: PlayerResponse["player"] | number, includePrestige: false): SkyWarsLevelInfo;