📜  从字符串枚举创建类型 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:22.546000             🧑  作者: Mango

代码示例1
const GENDERS = ["MALE", "FEMALE", "DIVERSE"] as const;
type Gender = typeof GENDERS[number];