export const signal = ['red', 'green', 'blue'] as const;
export type Signal = typeof signal[number];
export const color = { red: 0, green: 1, blue: 2 } as const;
export type Color = typeof color[keyof typeof color];
Last active
April 16, 2021 00:30
-
-
Save y-takagi/8e9f7657522f2add53f898ec4b586c2c to your computer and use it in GitHub Desktop.
Typescript Cookbook
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment