aboutsummaryrefslogtreecommitdiff
path: root/src/config.ts
blob: c20bff259c1229c2e0188c11d3f91ea9ff5758f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export interface Config {
  prepare : number;
  tabatas : number;
  cycles : number;
  work : number;
  rest : number;
}

export function init(): Config {
  return {
    prepare: 10,
    tabatas: 4,
    cycles: 8,
    work: 20,
    rest: 10
  }
}

export function getDuration(c: Config): number {
  return c.tabatas * (c.prepare + (c.cycles * (c.work + c.rest)))
}