export interface Config { warmup: number; prepare : number; tabatas : string[]; cycles : number; work : number; rest : number; } export function init(): Config { return { warmup: 180, tabatas: [], prepare: 10, cycles: 8, work: 20, rest: 10 } } export function getDuration(c: Config): number { return c.warmup + c.tabatas.length * (c.prepare + (c.cycles * (c.work + c.rest))) }