[Proposal] Improve `IconName` type definition for autocomplete

The current definition of IconName is just type IconName = string. This makes it impossible to use autocomplete in our IDEs.

I’d like to suggest the following definition instead:

type IconName = 
| 'lucide-chevron-left' 
| 'lucide-chevron-right' 
| 'lucide-chevron-up' 
| 'lucide-chevron-down' 
// more Lucide icons...
| 'links-coming-in'
| 'links-going-out'
// more Obsidian-specific icons...
| (string & {});

This way, we can take advantage of our IDE’s autocomplete while allowing custom icons defined by addIcon.

Related thread

1 Like