frontend client for gemstone. decentralised workplace app
at main 345 B view raw
1/** 2 * If given an object's `typeof`, turns it into an enum-like type. 3 * e.g. 4 *```typescript 5 * const LogLevel = { 6 * DEBUG: "DEBUG", 7 * WARNING: "WARNING", 8 * ERROR: "ERROR", 9 * } 10 * type LogLevel = Enumify<typeof LogLevel>; 11 * ``` 12 * Which is a better way (imo) of declaring a typescript enum. 13 */ 14export type Enumify<T> = T[keyof T];