mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 06:04:05 +00:00
feat: time to next flag
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import type { MaybeNumber } from '../../utils/utils.type.js';
|
||||
import type { EntryId } from '../core/OntimeEntry.js';
|
||||
|
||||
export type BlockState = {
|
||||
export type CurrentBlockState = {
|
||||
id: EntryId;
|
||||
startedAt: MaybeNumber;
|
||||
expectedEnd: MaybeNumber;
|
||||
};
|
||||
|
||||
export type UpcomingEntry = {
|
||||
id: EntryId;
|
||||
start: number;
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@ export enum OffsetMode {
|
||||
}
|
||||
|
||||
export type Runtime = {
|
||||
numEvents: number;
|
||||
selectedEventIndex: MaybeNumber;
|
||||
numEvents: number;
|
||||
offset: number;
|
||||
relativeOffset: number;
|
||||
plannedStart: MaybeNumber;
|
||||
|
||||
@@ -42,6 +42,7 @@ export const runtimeStorePlaceholder: Readonly<RuntimeStore> = {
|
||||
},
|
||||
blockNow: null,
|
||||
blockNext: null,
|
||||
nextFlag: null,
|
||||
eventNow: null,
|
||||
eventNext: null,
|
||||
auxtimer1: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { MaybeString } from '../../utils/utils.type.js';
|
||||
import type { OntimeEvent } from '../core/OntimeEntry.js';
|
||||
import type { SimpleTimerState } from './AuxTimer.type.js';
|
||||
import type { BlockState } from './CurrentBlockState.type.js';
|
||||
import type { CurrentBlockState, UpcomingEntry } from './CurrentBlockState.type.js';
|
||||
import type { MessageState } from './MessageControl.type.js';
|
||||
import type { Runtime } from './Runtime.type.js';
|
||||
import type { TimerState } from './TimerState.type.js';
|
||||
@@ -20,8 +20,9 @@ export type RuntimeStore = {
|
||||
eventNow: OntimeEvent | null;
|
||||
eventNext: OntimeEvent | null;
|
||||
|
||||
blockNow: BlockState | null;
|
||||
blockNow: CurrentBlockState | null;
|
||||
blockNext: MaybeString;
|
||||
nextFlag: UpcomingEntry | null;
|
||||
|
||||
// extra timers
|
||||
auxtimer1: SimpleTimerState;
|
||||
|
||||
@@ -100,7 +100,7 @@ export { OffsetMode } from './definitions/runtime/Runtime.type.js';
|
||||
export type { RuntimeStore } from './definitions/runtime/RuntimeStore.type.js';
|
||||
export { runtimeStorePlaceholder } from './definitions/runtime/RuntimeStore.js';
|
||||
export { type TimerState, TimerPhase } from './definitions/runtime/TimerState.type.js';
|
||||
export type { BlockState } from './definitions/runtime/CurrentBlockState.type.js';
|
||||
export type { CurrentBlockState, UpcomingEntry } from './definitions/runtime/CurrentBlockState.type.js';
|
||||
|
||||
// ---> Extra Timer
|
||||
export { type SimpleTimerState, SimplePlayback, SimpleDirection } from './definitions/runtime/AuxTimer.type.js';
|
||||
|
||||
@@ -2,13 +2,14 @@ import type { ImportMap } from '../spreadsheetImport';
|
||||
import { isImportMap } from '../spreadsheetImport';
|
||||
|
||||
describe('isImportMap()', () => {
|
||||
it('validates a v3 default import map', () => {
|
||||
const v3ImportMap: ImportMap = {
|
||||
it('validates a v4 default import map', () => {
|
||||
const importMap: ImportMap = {
|
||||
worksheet: 'event schedule',
|
||||
timeStart: 'time start',
|
||||
linkStart: 'link start',
|
||||
timeEnd: 'time end',
|
||||
duration: 'duration',
|
||||
flag: 'flag',
|
||||
cue: 'cue',
|
||||
title: 'title',
|
||||
countToEnd: 'count to end',
|
||||
@@ -23,7 +24,7 @@ describe('isImportMap()', () => {
|
||||
entryId: 'id',
|
||||
};
|
||||
|
||||
expect(isImportMap(v3ImportMap)).toBe(true);
|
||||
expect(isImportMap(importMap)).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects map missing keys', () => {
|
||||
@@ -50,12 +51,13 @@ describe('isImportMap()', () => {
|
||||
});
|
||||
|
||||
it('handles custom properties', () => {
|
||||
const v3ImportMap: ImportMap = {
|
||||
const importMap: ImportMap = {
|
||||
worksheet: 'event schedule',
|
||||
timeStart: 'time start',
|
||||
linkStart: 'link start',
|
||||
timeEnd: 'time end',
|
||||
duration: 'duration',
|
||||
flag: 'flag',
|
||||
cue: 'cue',
|
||||
title: 'title',
|
||||
countToEnd: 'count to end',
|
||||
@@ -73,6 +75,6 @@ describe('isImportMap()', () => {
|
||||
entryId: 'id',
|
||||
};
|
||||
|
||||
expect(isImportMap(v3ImportMap)).toBe(true);
|
||||
expect(isImportMap(importMap)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user