This is my dictionary:
type Words = 'man' | 'sun' | 'person'
type Dictionary = Record<Words,string>
And Dictionary
equals to this type:
type Dictionary = {
man: string;
sun: string;
person: string;
}
The goal is that other programmers know witch words should be added to the dictionary using IDE autocompletion. But it restrict them adding other optional words. I tried this but the result does not include words at all:
type Words = 'man' | 'sun' | 'person' | string
type Dictionary = Record<Words,string>
// Equals to
type Dictionary = {
[x: string]: string;
}
How can I have autocomplete with words but can have optional words too?