If I have two types defined in TypeScript:
interface Foo {
bar: string;
}
interface Baz {
foo: Foo;
}
Is it possible to flatten the Baz
type in TypeScript (e.g. type FlatBaz = Flatten<Baz>
), so that the signature appears similar to this?
interface FlatBaz {
"foo.bar": string;
}