Currently, I have defined 2 interfaces:
interface BattleSkills {
strength: number;
armor: number;
magic_resistance: number;
health: number;
mana: number;
intelligence: number;
accuracy: number;
agility: number;
critical_damage: number;
}
and
interface Item {
id: string;
name: string;
price: number;
stats: BattleSkills;
}
Right now, Item['stats']
mandates all fields from BattleSkills
. How can I modify this so that the stats
field remains required, but each of its subfields become optional? It would be better if the fields within BattleSkills
remain mandatory themselves.