Skip to content

Instantly share code, notes, and snippets.

@ar90n
Last active October 14, 2023 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ar90n/c9bb1631f28265a65955e60f29bbb7c1 to your computer and use it in GitHub Desktop.
Save ar90n/c9bb1631f28265a65955e60f29bbb7c1 to your computer and use it in GitHub Desktop.
K extends keyof T in TS
# Typescriptにおける`K extends keyof T`の考え方
`keyof T`は`T`に含まれるキー名のリテラル型のUnionnいなる。
なので、そのUnionに含まれる各リテラル型の値は`extends keyof T`を満たす
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment