aboutsummaryrefslogtreecommitdiff
path: root/src/config.ts
diff options
context:
space:
mode:
authorJoris2021-05-13 14:50:51 +0200
committerJoris2021-05-13 14:58:26 +0200
commit221b6451fb4f8559a10e7fefebd13ce125ef29d0 (patch)
tree3ab337b7b2d40e8235f887046a580b0850540f11 /src/config.ts
parent5c636f11cdfed82634ee572645d765b704941b68 (diff)
downloadtabata-221b6451fb4f8559a10e7fefebd13ce125ef29d0.tar.gz
tabata-221b6451fb4f8559a10e7fefebd13ce125ef29d0.tar.bz2
tabata-221b6451fb4f8559a10e7fefebd13ce125ef29d0.zip
Rewrite in TypeScript
BuckleScript is no longer maintained. Choose a widely used techno that will still be maintained in the following years.
Diffstat (limited to 'src/config.ts')
-rw-r--r--src/config.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/config.ts b/src/config.ts
new file mode 100644
index 0000000..c20bff2
--- /dev/null
+++ b/src/config.ts
@@ -0,0 +1,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)))
+}