5 Matching Annotations
- Nov 2021
-
-
type PaletteColors = keyof typeof palette type Palette = { [Color in PaletteColors]: string }
-
- Aug 2021
-
stackoverflow.com stackoverflow.com
-
function isKeyOfMcuParams(x: string): x is keyof McuParams { switch (x) { case 'foo': case 'bar': case 'baz': return true; default: return false; } }
-
-
dev.to dev.to
-
keyof is a keyword in TypeScript which accepts a given object type and returns a union type of its keys. These are equivalent: type StatusKey = keyof { online: string; offline: string; busy: string; dnd: string; } type StatusKey = 'online' | 'offline' | 'busy' | 'dnd'
-
- Oct 2019
-
stackoverflow.com stackoverflow.com
-
type A = keyof Person["favouriteNumbers"]; // string | number type B = keyof Person["address"]; // "street" | "postcode"
-
- Aug 2019
-
github.com github.com