从 Person 接口声明一个对象 kindPerson,其中所有属性都是必需的。
interface Person {
age: number;
firstName: string;
lastName?: string;
}
let @(10): @(16) = {
age: 1800,
firstName: "Santa",
lastName: "Claus"
};
interface Person {
age: number;
firstName: string;
lastName?: string;
}
let kindPerson: Required<Person> = {
age: 1800,
firstName: "Santa",
lastName: "Claus"
};