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. The array is data at runtime and a union at compile time.
export const UI_ICON_KEYS = ["blog", "tips", "rss"] as const;
export type UiIconKey = (typeof UI_ICON_KEYS)[number];Add an entry and every switch that is missing a case fails to compile, which is what you want.
typescript