UNPKG

@ssv/core

Version:

Core utilities, components and services for browser and node

25 lines (24 loc) 882 B
/** * Typing constraint for Enums (non `const`). */ export interface Enum { [key: number]: string; } /** * Gets all names of the enum as an array. * @param e enum to get data of. * @returns enum definition names as a string array e.g. `["Elite", "Boss", "Normal", "RaidBoss"]`. */ export declare function getNames(e: Enum): string[]; /** * Gets all names of the enum as an array with values kebab'ed cased characters e.g. `"raid-boss"` * @param e enum to get data of. * @returns enum definition names as a string array with kebab case e.g. `["elite", "boss", "normal", "raid-boss"]`. */ export declare function getNamesKebab(e: Enum): string[]; /** * Gets all values of the enum as an array. * @param e enum to get data of. * @returns enum values as number array e.g. `[1, 2, 3, 4]` */ export declare function getValues(e: Enum): number[];