

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Interfaces
incomplete
2: Extending Interfaces
incomplete
3: Extending Multiple Interfaces
incomplete
4: Overriding Interface Properties
incomplete
5: Declaration Merging
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
You can extend multiple interfaces at once:
type Character = {
name: string;
level: number;
};
interface Magical {
mana: number;
castSpell(spell: string): void;
}
interface Physical {
strength: number;
attack(): void;
}
interface BattleMage extends Character, Magical, Physical {
combineAttacks(): void;
}
BattleMage now has all 7 properties and methods:
namelevelmanacastSpellstrengthattackcombineAttacksWe want our support bots to be both conversational and autonomous. Combine the existing interfaces into one powerful bot interface.
name: stringstatus: a value union of "online", "offline", or "starting"shutdown: a method with no parameters that returns a string