Created
January 23, 2024 14:34
-
-
Save shiftgeist/6812791f74cb374851fff8339b4ed509 to your computer and use it in GitHub Desktop.
Enum with Const + Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Permission = { | |
Read: 'r', | |
Write: 'w', | |
Execute: 'x' | |
} as const; | |
type Permission = typeof Permission[keyof typeof Permission]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment