type DeepPartial = { [P in keyof T]?: T[P] extends object ? DeepPartial : T[P]; }; interface UserConfig { theme: { primaryColor: string; secondaryColor?: string; }; notifications: { email: boolean; sms: boolean; }; profile: { username: string; avatarUrl: string; }; } // Example usage: const partialConfig: DeepPartial = { theme: { primaryColor: '#336699' }, notifications: { email: false } }; // console.log(partialConfig);