Live Note

Remain optimistic

  • Home
  • Tags58
  • Categories18
  • Archives199
  • Album
  • Algorithm
  • Battery
  • Frontend
  • Notes
  • Stm32
  • ZiWei
  • Reciprocal Links
  • Search
  • Table of Contents
  • Overview
Edward

Edward

Nothing to describe.
199 posts
18 categories
58 tags
Creative Commons
0%

Typescript Enum取key&value

Posted on 2021-06-16 In TypeScript
1
2
3
4
5
6
7
8
9
10
const enum Foo {
AA = "aa",
BB = "bb",
}

type B = keyof typeof Foo // 'AA' | 'BB'

// Template Literal Types
type C = `${keyof { [x in Foo]: string }}`
// 'aa' | 'bb'
TypeScript
Ubuntu折腾笔记--音频
parseInt()的奇幻现象
© 2016 – 2025 Edward Wang
Powered by Hexo & NexT.Gemini