{"id":"arythmitical/typedenum","name":"typedenum","scope":"arythmitical","platform":"roblox","description":"Construct custom enums at runtime, with proper autocompletion and typechecking.","version":"1.0.4","latest":"1.0.4","versions":["1.0.0","1.0.3","1.0.4"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"f8ed43c2e03ab782ffede3d8b9fa5528793957a472edec72a64b05f12e59bde7","likes":0,"downloads":0,"install":"forest install arythmitical/typedenum","url":"https://forest.dev/p/roblox/arythmitical/typedenum","files":"https://api.forest.dev/ai/package/roblox/arythmitical/typedenum/files","readme":"# TypedEnum\n\nConstruct custom enums at runtime, with proper autocompletion and typechecking.\n\n- **[Documentation](https://arythmitical.github.io/TypedEnum)**\n- **[Wally](https://wally.run/package/arythmitical/typedenum)**\n- **[Creator Store](https://create.roblox.com/store/asset/119312214340373)**\n\n---\n\n```lua\nlocal PlayerLocation = TypedEnum.new(function(add)\n    return {\n        MainMenu = add(\"MainMenu\", 1),\n        InRound = add(\"InRound\", 2),\n        Shop = add(\"Shop\", 3),\n    }\nend)\n\nexport type PlayerLocation = TypedEnum.TypedEnumItem<number, typeof(PlayerLocation)>\n\nlocal location: PlayerLocation = PlayerLocation.MainMenu\n\nOnLocationChanged.OnClientEvent:Connect(function(id)\n    local newLocation: PlayerLocation? = TypedEnum.fromValue(PlayerLocation, id)\n\n    if newLocation then\n        location = newLocation\n    end\nend)\n```\n","readmeTruncated":false}