feat: many timers (#706)

* wip: create simple timer class

* refactor: service to manage extra timers

* wip:ui for controlling the extra timer

---------

Co-authored-by: arc-alex <ac@omnivox.dk>
This commit is contained in:
Carlos Valente
2024-01-25 16:51:20 +01:00
committed by GitHub
parent 74e1ae609c
commit 2df3d376ad
17 changed files with 465 additions and 7 deletions
@@ -0,0 +1,17 @@
export enum SimplePlayback {
Start = 'start',
Pause = 'pause',
Stop = 'stop',
}
export enum SimpleDirection {
CountUp = 'count-up',
CountDown = 'count-down',
}
export type SimpleTimerState = {
duration: number;
current: number;
playback: SimplePlayback;
direction: SimpleDirection;
};
@@ -2,6 +2,7 @@ import { MessageState } from './MessageControl.type.js';
import { TimerState } from './TimerState.type.js';
import { Runtime } from './Runtime.type.js';
import { OntimeEvent } from '../core/OntimeEvent.type.js';
import { SimpleTimerState } from './ExtraTimer.type.js';
export type RuntimeStore = {
// timer data
@@ -18,4 +19,7 @@ export type RuntimeStore = {
publicEventNow: OntimeEvent | null;
eventNext: OntimeEvent | null;
publicEventNext: OntimeEvent | null;
// extra timers
timer1: SimpleTimerState;
};
+3
View File
@@ -59,6 +59,9 @@ export type { Runtime } from './definitions/runtime/Runtime.type.js';
export type { RuntimeStore } from './definitions/runtime/RuntimeStore.type.js';
export type { TimerState } from './definitions/runtime/TimerState.type.js';
// ---> Extra Timer
export { type SimpleTimerState, SimplePlayback, SimpleDirection } from './definitions/runtime/ExtraTimer.type.js';
// CLIENT
// TYPE UTILITIES