enums.d.ts 490 B

12345678910111213141516
  1. /*
  2. * @Author: wjc
  3. * @Date: 2025-04-09 10:19:11
  4. * @LastEditors: wjc
  5. * @LastEditTime: 2026-01-16 14:39:39
  6. * @Description: 从联合类型中找到想要的某一类型,并提取相应属性 label 的值
  7. */
  8. // 从联合类型中找到想要的某一类型,并提取相应属性 label 的值
  9. export type ExtractValue<T, K> = T extends { label: infer R; value: K } ? R : never
  10. export namespace CommonEnums {
  11. export interface ICommonEnums {
  12. label: string
  13. value: string
  14. }
  15. }