I am currently working with two interfaces:
interface A {
foo: string;
bar: string;
baz: string;
}
and:
interface B {
field: keyof A;
}
With interface B, I can set the field as 'foo' like this:
const b: B = {
field: 'foo'
}
Now, I am trying to figure out a way to change the type of field in interface B so that I can set values that are combinations of any two keys joined with a dot, such as:
const c: B = {
field: 'foo.bar'
}
I have been experimenting with different approaches but haven't found a viable solution yet. Any help or suggestions would be greatly appreciated. Thank you!