I have two interfaces as follows:
interface Foo {
foo: string;
}
interface Bar {
prop1: string;
prop2: string;
}
My goal is to create a type that combines these two interface keys with underline between them, something like this:
type MergeKeys<A,B> = {
[P in keyof A + '_' + P2 in keyof B]: string;
};
type Result = MergeKeys<Foo,Bar>;
So that the result would be:
interface Result {
foo_prop1: string;
foo_prop2: string;
}
Is this even possible?