百度已收录

测试

interface Person {
    readonly id: number; // 只读
    name: string;
    age?: number // ?表示可选属性
}

let viking: Person = {
    id: 1,
    name: 'viking',
    age: 20
}