//You can simply create a new type, say, DeepPartial, which basically references itself:
type DeepPartial<T> = {
[P in keyof T]?: DeepPartial<T[P]>;
};
//Then, you can use it as such:
const foobar: DeepPartial<Foobar> = {
foo: 1,
bar: { baz: true }
};
type DeepPartial<T> = {
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
};