Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection of stuff #1406

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/types/src/definitions/core/OntimeEvent.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ export type OntimeEvent = OntimeBaseEvent & {
skip: boolean;
colour: string;
revision: number;
delay?: number; // calculated at runtime
delay: number; // calculated at runtime
timeWarning: number;
timeDanger: number;
custom: EventCustomFields;
};

export type DatabaseOntimeEvent = Omit<OntimeEvent, 'delay'>;

export type PlayableEvent = OntimeEvent & { skip: false };
export type TimeField = 'timeStart' | 'timeEnd' | 'duration';
4 changes: 3 additions & 1 deletion packages/types/src/definitions/core/Rundown.type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { OntimeBlock, OntimeDelay, OntimeEvent } from './OntimeEvent.type.js';
import type { DatabaseOntimeEvent, OntimeBlock, OntimeDelay, OntimeEvent } from './OntimeEvent.type.js';

export type OntimeRundownEntry = OntimeDelay | OntimeBlock | OntimeEvent;
export type DatabaseOntimeRundownEntry = OntimeDelay | OntimeBlock | DatabaseOntimeEvent;
export type OntimeRundown = OntimeRundownEntry[];
export type DatabaseOntimeRundown = DatabaseOntimeRundownEntry[];

// 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;
9 changes: 8 additions & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ export type { DatabaseModel } from './definitions/DataModel.type.js';
export { EndAction } from './definitions/EndAction.type.js';
export {
type OntimeBaseEvent,
type DatabaseOntimeEvent,
type OntimeDelay,
type OntimeBlock,
type OntimeEvent,
type PlayableEvent,
type TimeField,
SupportedEvent,
} from './definitions/core/OntimeEvent.type.js';
export type { OntimeEntryCommonKeys, OntimeRundown, OntimeRundownEntry } from './definitions/core/Rundown.type.js';
export type {
OntimeEntryCommonKeys,
OntimeRundown,
OntimeRundownEntry,
DatabaseOntimeRundownEntry,
DatabaseOntimeRundown,
} from './definitions/core/Rundown.type.js';
export { TimeStrategy } from './definitions/TimeStrategy.type.js';
export { TimerType } from './definitions/TimerType.type.js';

Expand Down
Loading