aboutsummaryrefslogtreecommitdiff
path: root/src/config.ts
blob: 5cd23e62bed0b683e2508c07f707fb3e41766a0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)))
}