UNPKG

leaderboard-table

Version:
34 lines (33 loc) 1.13 kB
import "../style/style.scss"; import { LeaderboardOptions } from "../common/options/Options"; export declare type SortableByProps = { /** * @type place is OPTIONAL - if user doesn't want to use sorters, data in leaderboard * is not going to be sorted in anyway without this type. */ place?: number; /** * @type points is OPTIONAL - points can be used for sorting of entities based on its points. */ points?: number; }; declare type LeaderboardData = { [k: string]: string | number; } & { [k in keyof SortableByProps]: number; }; declare class Leaderboard { private readonly _leaderboardData; private readonly _logger; private _rootContainer; private _phasesContext; private _parsedData; constructor(rootContainer: HTMLElement, leaderboardData: LeaderboardData[], options?: Partial<LeaderboardOptions>); init(): void; private _addCssStylesToRootContainer; private _verifyInputs; private _parseData; private _mountElements; } export { LeaderboardData }; export default Leaderboard;