使用类型别名自定义类型,

    1. type Feature = {
    2. id: number;
    3. name: string;
    4. };
    5. const features: Feature[] = [
    6. { id: 1, name: "foo" },
    7. { id: 2, name: "bar" },
    8. ];