How do I populate a typed array where the type being populated has a function (getReadableSchedule)? If I remove the function this works. Is this failing because of the way i'm assigning the the array elements?
ERROR in src/app/mock-extracts.ts(3,14): error TS2322: Property 'getReadableSchedule' is missing in type '{ id: number; name: string; description: string; client: string; vendor: string; extractType: str...'.
export class Extract {
id: number;
name: string;
description: string;
client: string;
vendor: string;
extractType: string;
path: string;
sentDate: string;
sentTo: string;
lastRun: string;
nextRun: string;
schedule: string;
getReadableSchedule(): string {
return "<return readable cronjob schedule>";
}
}
import { Extract } from "./extract";
export const EXTRACTS: Extract[] = [
{
id: 1,
name: "Find Barb",
description: "Find Barb in the unspide down.",
client: "Tower, Inc",
vendor: "Vendy",
extractType: "Normal",
sentDate: "Today",
path: "//outside",
sentTo: "",
lastRun: "",
nextRun: "",
schedule: ""
},
{
id: 2,
name: "Rescue Will",
description: "Give Will a hair cut.",
client: "Tower, Inc",
vendor: "Vendy",
extractType: "Normal",
sentDate: "Today",
path: "//outside",
sentTo: "",
lastRun: "",
nextRun: "",
schedule: ""
},
{
id: 3,
name: "Sooth Harry's Scar",
description: "Put Robitussin on Harry's scar.",
client: "Tower, Inc",
vendor: "Turkish Barn, LLC",
extractType: "Normal",
sentDate: "Today",
path: "//outside",
sentTo: "",
lastRun: "",
nextRun: "",
schedule: ""
}
];