A readonly tuple of keys plus typeof KEYS[number] yields a union of those keys. Use it to build a Record<Key, number> and initialize counts. This ties a runtime list directly to a static type.
const KEYS = ["todo", "done"] as const;
type Key = (typeof KEYS)[number]; // 'todo' | 'done'
Initialize all counts to zero.
Create a count map from a const tuple of statuses.