mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 12:23:51 +00:00
chore: rename blocks to groups
This commit is contained in:
committed by
Carlos Valente
parent
486d89ecf4
commit
e5d2457717
@@ -5,7 +5,7 @@ export type EntryId = string;
|
||||
export enum SupportedEntry {
|
||||
Event = 'event',
|
||||
Delay = 'delay',
|
||||
Block = 'block',
|
||||
Group = 'group',
|
||||
Milestone = 'milestone',
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ export type OntimeMilestone = OntimeBaseEvent & {
|
||||
revision: number;
|
||||
};
|
||||
|
||||
export type OntimeBlock = OntimeBaseEvent & {
|
||||
type: SupportedEntry.Block;
|
||||
export type OntimeGroup = OntimeBaseEvent & {
|
||||
type: SupportedEntry.Group;
|
||||
title: string;
|
||||
note: string;
|
||||
entries: EntryId[];
|
||||
@@ -78,7 +78,7 @@ export type OntimeEvent = OntimeBaseEvent & {
|
||||
|
||||
export type PlayableEvent = OntimeEvent & { skip: false };
|
||||
export type TimeField = 'timeStart' | 'timeEnd' | 'duration';
|
||||
export type OntimeEntry = OntimeDelay | OntimeBlock | OntimeEvent | OntimeMilestone;
|
||||
export type OntimeEntry = OntimeDelay | OntimeGroup | OntimeEvent | OntimeMilestone;
|
||||
|
||||
// we need to create a manual union type since keys cannot be used in type unions
|
||||
export type OntimeEntryCommonKeys = keyof OntimeEvent | keyof OntimeDelay | keyof OntimeBlock | keyof OntimeMilestone;
|
||||
export type OntimeEntryCommonKeys = keyof OntimeEvent | keyof OntimeDelay | keyof OntimeGroup | keyof OntimeMilestone;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import type { MaybeNumber } from '../../utils/utils.type.js';
|
||||
import type { EntryId } from '../core/OntimeEntry.js';
|
||||
|
||||
export type CurrentBlockState = {
|
||||
export type CurrentGroupState = {
|
||||
id: EntryId;
|
||||
startedAt: MaybeNumber;
|
||||
expectedEnd: MaybeNumber;
|
||||
@@ -38,8 +38,8 @@ export const runtimeStorePlaceholder: Readonly<RuntimeStore> = {
|
||||
expectedEnd: null, // changes with runtime, based on offset, overflows over dayInMs
|
||||
offsetMode: OffsetMode.Absolute,
|
||||
},
|
||||
blockNow: null,
|
||||
blockNext: null,
|
||||
groupNow: null,
|
||||
groupNext: null,
|
||||
nextFlag: null,
|
||||
eventNow: null,
|
||||
eventNext: null,
|
||||
|
||||
@@ -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 { CurrentBlockState, EntryMetaData } from './CurrentBlockState.type.js';
|
||||
import type { CurrentGroupState, EntryMetaData } from './CurrentGroupState.type.js';
|
||||
import type { MessageState } from './MessageControl.type.js';
|
||||
import type { Runtime } from './Runtime.type.js';
|
||||
import type { TimerState } from './TimerState.type.js';
|
||||
@@ -19,8 +19,8 @@ export type RuntimeStore = {
|
||||
eventNow: OntimeEvent | null;
|
||||
eventNext: OntimeEvent | null;
|
||||
|
||||
blockNow: CurrentBlockState | null;
|
||||
blockNext: MaybeString;
|
||||
groupNow: CurrentGroupState | null;
|
||||
groupNext: MaybeString;
|
||||
nextFlag: EntryMetaData | null;
|
||||
|
||||
// extra timers
|
||||
|
||||
@@ -7,7 +7,7 @@ export {
|
||||
type EntryId,
|
||||
type OntimeBaseEvent,
|
||||
type OntimeDelay,
|
||||
type OntimeBlock,
|
||||
type OntimeGroup,
|
||||
type OntimeEntryCommonKeys,
|
||||
type OntimeEntry,
|
||||
type OntimeMilestone,
|
||||
@@ -101,7 +101,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 { CurrentBlockState, UpcomingEntry, EntryMetaData } from './definitions/runtime/CurrentBlockState.type.js';
|
||||
export type { CurrentGroupState, UpcomingEntry, EntryMetaData } from './definitions/runtime/CurrentGroupState.type.js';
|
||||
|
||||
// ---> Extra Timer
|
||||
export { type SimpleTimerState, SimplePlayback, SimpleDirection } from './definitions/runtime/AuxTimer.type.js';
|
||||
@@ -111,7 +111,7 @@ export type { Client, ClientList, ClientType } from './definitions/Clients.type.
|
||||
|
||||
// TYPE UTILITIES
|
||||
export {
|
||||
isOntimeBlock,
|
||||
isOntimeGroup,
|
||||
isOntimeDelay,
|
||||
isOntimeEvent,
|
||||
isOntimeMilestone,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { AutomationOutput, HTTPOutput, OntimeAction, OSCOutput } from '../definitions/core/Automation.type.js';
|
||||
import type {
|
||||
OntimeBlock,
|
||||
OntimeDelay,
|
||||
OntimeEntry,
|
||||
OntimeEvent,
|
||||
OntimeGroup,
|
||||
OntimeMilestone,
|
||||
PlayableEvent,
|
||||
} from '../definitions/core/OntimeEntry.js';
|
||||
@@ -24,8 +24,8 @@ export function isOntimeDelay(event: MaybeEvent): event is OntimeDelay {
|
||||
return event?.type === SupportedEntry.Delay;
|
||||
}
|
||||
|
||||
export function isOntimeBlock(event: MaybeEvent): event is OntimeBlock {
|
||||
return event?.type === SupportedEntry.Block;
|
||||
export function isOntimeGroup(event: MaybeEvent): event is OntimeGroup {
|
||||
return event?.type === SupportedEntry.Group;
|
||||
}
|
||||
|
||||
export function isOntimeMilestone(event: MaybeEvent): event is OntimeMilestone {
|
||||
|
||||
Reference in New Issue
Block a user