Looking to create a versatile base interface or type that can adapt its properties based on the generic object it receives. It might look something like this:
interface BaseObject<Extension extends object = {}>{
a: string;
b: string;
{...Extension} <<< This syntax works in regular objects, but not in this context
}
const sample:BaseObject<{x: number}> = {
a: '123',
b: '123',
x: 123 <<<< Enforcing a type check here
}
Any ideas on how to implement this?