I would like to do something like this:
interface Apple {
type: string;
color: string;
}
type RealApple = WithConcat<Apple, 'type', 'color'>;
So that the resulting type of RealApple
is:
type RealApple = {
type: string;
color: string;
'type#color': string;
}
Is this possible? How could I implement WithConcat
? The reason is to handle types when talking to the database, where a composite sort key is created from two other fields which don't really have that composite on the schema.