Skip to content

Instantly share code, notes, and snippets.

@MauricioRobayo
Last active December 16, 2022 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MauricioRobayo/434bcc71f19a8737e134fb1a88f707d3 to your computer and use it in GitHub Desktop.
Save MauricioRobayo/434bcc71f19a8737e134fb1a88f707d3 to your computer and use it in GitHub Desktop.
const Direction = {
Up: 0,
Down: 1,
Left: 2,
Right: 3,
} as const;
type Direction = typeof Direction[keyof typeof Direction];
function run(dir: Direction) {}
run(Direction.Right);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment