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