{"id":"raphtalia/enum","name":"enum","scope":"raphtalia","platform":"roblox","description":"Roblox custom Enum library","version":"1.0.0","latest":"1.0.0","versions":["1.0.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"cf14e1701526a58adfdadf60091bae0d221a5bc3112c757fe1d937938f7e9aa2","likes":0,"downloads":0,"install":"forest install raphtalia/enum","url":"https://forest.dev/p/roblox/raphtalia/enum","files":"https://api.forest.dev/ai/package/roblox/raphtalia/enum/files","readme":"# Enum\n\nRoblox Lua Enum library for supporting custom Enum types. Much of the API is\nbased off of [EnumExtender](https://github.com/buildthomas/EnumExtender). The\nkey difference between this library and ExumExtender is values of EnumItems\ncan be assigned to anything rather than being limited to numbers.\n\nEnums created under the same name will overwrite previous Enums. Custom Enums\ntake priority over Roblox Enums.\n\n------\n\n## API\n\n* Enums\n  * Enums.new(enumName: `string`, enumItems: `List|Dictionary`): `Enum`\n  * Enums:GetStandardEnums(): `Enums`\n  * Enums:FromValue(enumName: `string`, enumValue: `any`): `EnumItem`\n  * Enums:Find(enumName: `string`): `Enum`\n* Enum\n  * Enums:GetEnumItems(): `{EnumItem}`\n* EnumItem\n  * `string`Name\n  * `any`Value\n  * `Enum`EnumType\n\n## Examples\n\n```lua\nlocal Enum = require(script.Parent.Enum)\n\nprint(Enum) --> Enums\nprint(Enum.KeyCode) --> KeyCode\nprint(Enum.KeyCode.W) --> Enum.KeyCode.W\nprint(Enum.KeyCode.W.Name) --> W\nprint(Enum.KeyCode.W.Value) --> 119\nprint(Enum.KeyCode.W.EnumType) --> KeyCode\n\nlocal TestEnum = Enum.new(\n    \"TestEnum\",\n    {\n        Foo = 0,\n        Bar = 1,\n    }\n)\nprint(Enum.TestEnum == TestEnum) --> true\n\nprint(Enum.TestEnum) --> TestEnum\nprint(Enum.TestEnum.Foo) --> Enum.TestEnum.Foo\nprint(Enum.TestEnum.Foo.Name) --> Foo\nprint(Enum.TestEnum.Foo.Value) --> 0 \nprint(Enum.TestEnum.Foo.EnumType) --> TestEnum\n\nprint(Enum.TestEnum.Bar) --> Enum.TestEnum.Bar\nprint(Enum.TestEnum.Bar.Name) --> Bar\nprint(Enum.TestEnum.Bar.Value) --> 1\nprint(Enum.TestEnum.Bar.EnumType) --> TestEnum\n\nprint(Enum.TestEnum:GetEnumItems())\n```\n\nThis style of defining arguments is supported for compatability with\nEnumExtender.\n\n```lua\nlocal TestEnum = Enum.new(\n    \"TestEnum\",\n    {\n        [0] = Foo,\n        [1] = Bar,\n    }\n)\n```\n","readmeTruncated":false}