🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

rbx-enum

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rbx-enum

Raw Enum access support for roblox-ts. This gives you access to things like the `Value` property on EnumItems and the `GetEnumItems` function of Enums.

1.0.0
latest
Source
npm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

rbx-enum

Raw Enum access support for roblox-ts. This gives you access to things like the Value property on EnumItems and the GetEnumItems function of Enums.

The module exports three functions:

getEnumItem

Accepts a roblox-ts enum value and results in the raw EnumItem object which is typed as:

interface RbxEnumItem {
  Name: string
  Value: number
  EnumType: RbxEnum
}

Note: This function accepts a number because TypeScript sees enums as numbers. Attempting to pass a member of a non-Roblox enum or a number will result in a runtime error.

Example

print(getEnumItem(Enum.RenderPriority.Camera).Value) // 200

getEnumItems

Accepts a roblox-ts enum and results in an array of EnumItems (RbxEnumItem[] internally).

Example

getEnumItems(Enum.KeyCode).forEach(e => print(e.Name))

getEnums

Returns an array of all Roblox Enums (RbxEnum[] internally). RbxEnum is typed as:

type RbxEnum = { [index: string]: RbxEnumItem }

You can also call tostring on RbxEnum objects to get their human-readable name.

Keywords

roblox-ts

FAQs

Package last updated on 18 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts