Complete the code to declare an interface named Person with a name property.
interface Person [1] {
name: string;
}The correct syntax to declare an interface body is with curly braces {}.
Complete the code to declare a type alias named Point with x and y as numbers.
type Point = [1] {
x: number;
y: number;
};Type aliases use an equals sign followed by an object type enclosed in curly braces {}.
Fix the error in extending an interface named Animal with a new interface Dog.
interface Dog [1] Animal {
breed: string;
}Interfaces extend other interfaces using the extends keyword.
Fill both blanks to create a type alias named ID that can be a string or a number.
type ID = [1] | [2];
The type alias uses a union type with string or number separated by a pipe |.
Complete the code to declare an interface named Vehicle with optional wheels and readonly brand properties.
interface Vehicle {
wheels?: number;
[1] brand: string;
drive(): void;
}The wheels property is optional using ? without extra keywords. The brand property is readonly using the readonly keyword. The drive method has no modifier.