as const turns a list into a type
When a list of strings is also the set of allowed values, write it once with as const and derive the type from it. At runtime the array is data, and at compile time it's a union.
export const UI_ICON_KEYS = ["blog", "tips", "rss"] as const;
export type UiIconKey = (typeof UI_ICON_KEYS)[number];Add an entry and every switch missing a case for it stops compiling, which is exactly what you want.
typescript