I have something similar to this I'm trying to find a better way without making manual interfaces below.
type Type = 'a' | 'b'
interface Block<T extends Type> {
content: typeof someObject[T]['childObj']
type: T
}
interface AType extends Block<'a'> {}
interface BType extends Block<'b'> {}
Here's a much more accurate example of what I'm trying to do if anybody could help. Ignore the syntax warning, i just did a quick repro, in my code the error doesn't exist
https://codesandbox.io/embed/lingering-pine-imt3bs?file=/src/App.tsx&codemirror=1