I have this interface:
export interface UserSettings
{
one: {
three: number;
four: number;
};
two: {
five: number;
six: number;
};
}
...and want to turn it into this:
export interface UserSettingsForUpdate
{
one?: {
three?: number;
four?: number;
};
two?: {
five?: number;
six?: number;
};
}
...but Partial<UserSettings>
produces this:
{
one?: {
three: number;
four: number;
};
two?: {
five: number;
six: number;
};
}
Is it possible to use mapped types to make all the properties on all depths optional, or do I have to create an interface manually for that?