mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 11:23:50 +00:00
fix: add event (#499)
* refactor: remove guards on event creation * style: minimum safe block size * fix: insert after finds previous valid cue
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
import { OntimeRundownEntry } from '../definitions/core/Rundown.type.js';
|
||||
import { OntimeBlock, OntimeDelay, OntimeEvent, SupportedEvent } from '../definitions/core/OntimeEvent.type.js';
|
||||
|
||||
export function isOntimeEvent(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeEvent {
|
||||
type MaybeEvent = OntimeRundownEntry | null | undefined;
|
||||
|
||||
export function isOntimeEvent(event: MaybeEvent): event is OntimeEvent {
|
||||
return event?.type === SupportedEvent.Event;
|
||||
}
|
||||
|
||||
export function isOntimeDelay(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeDelay {
|
||||
export function isOntimeDelay(event: MaybeEvent): event is OntimeDelay {
|
||||
return event?.type === SupportedEvent.Delay;
|
||||
}
|
||||
|
||||
export function isOntimeBlock(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeBlock {
|
||||
export function isOntimeBlock(event: MaybeEvent): event is OntimeBlock {
|
||||
return event?.type === SupportedEvent.Block;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user