I want to dynamically create a type based on another one or on readonly array. Example:
const lines = ['one', 'two', 'three'] as const;
const linesWithA = lines.map(line => `${line}-A`);
Now I need a way to have a type for linesWithA. It can be for example a union type 'one-A' | 'two-A' | 'three-A', but it needs to be generated dynamically. So when I will manualy add an element to lines, then I don't have to remember to change it for linesWithA type.
Is it possible?