TypeScript: Mapped types

PHOTO EMBED

Tue Feb 01 2022 11:40:13 GMT+0000 (UTC)

Saved by @avivdaniel

type Keys = "option1" | "option2";
type Flags = { [K in Keys]: boolean };
content_copyCOPY

https://www.typescriptlang.org/docs/handbook/advanced-types.html#mapped-types