@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
33 lines (32 loc) • 1.18 kB
TypeScript
/**
* This portion of code was ported from the [hypixel-php](https://github.com/Plancke/hypixel-php) library.
*
* Copyright (c) 2020 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";
/**
* Describes the results from a {@link getNetworkLevel} function call.
*/
export interface NetworkLevel {
level: number;
preciseLevel: number;
currentExp: number;
expToLevel: number;
expToNextLevel: number;
remainingExpToNextLevel: number;
}
/**
* Calculates the total EXP required for a specific network level.
* @param level Level you're getting the EXP required for. Can be a float or an integer.
* @category Helper
*/
export declare function getExpFromNetworkLevel(level: number): number;
/**
* Calculates the network level and returns a {@link NetworkLevel} interface.
* @param data The player object or the raw EXP number.
* @category Helper
*/
export declare function getNetworkLevel(data: PlayerResponse["player"] | number): NetworkLevel;