diff --git a/packages/timeline-state-resolver-types/src/device.ts b/packages/timeline-state-resolver-types/src/device.ts index d3c9d710d2..b7ca9dfc90 100644 --- a/packages/timeline-state-resolver-types/src/device.ts +++ b/packages/timeline-state-resolver-types/src/device.ts @@ -20,6 +20,20 @@ import { } from '.' import { ShotokuOptions } from './shotoku' +export enum StatusCode { + UNKNOWN = 0, // Status unknown + GOOD = 1, // All good and green + WARNING_MINOR = 2, // Everything is not OK, operation is not affected + WARNING_MAJOR = 3, // Everything is not OK, operation might be affected + BAD = 4, // Operation affected, possible to recover + FATAL = 5, // Operation affected, not possible to recover without manual interference +} +export interface DeviceStatus { + statusCode: StatusCode + messages?: Array + active: boolean +} + export interface DeviceOptionsBase extends SlowReportOptions { type: DeviceType isMultiThreaded?: boolean diff --git a/packages/timeline-state-resolver/src/__tests__/__snapshots__/index.spec.ts.snap b/packages/timeline-state-resolver/src/__tests__/__snapshots__/index.spec.ts.snap index 22a0f95610..d5776c325b 100644 --- a/packages/timeline-state-resolver/src/__tests__/__snapshots__/index.spec.ts.snap +++ b/packages/timeline-state-resolver/src/__tests__/__snapshots__/index.spec.ts.snap @@ -39,6 +39,7 @@ Array [ "ShotokuTransitionType", "SlotId", "SlotStatus", + "StatusCode", "Timeline", "TimelineContentTypeAtem", "TimelineContentTypeCasparCg", diff --git a/packages/timeline-state-resolver/src/devices/device.ts b/packages/timeline-state-resolver/src/devices/device.ts index 7d13731ed5..b563dd160d 100644 --- a/packages/timeline-state-resolver/src/devices/device.ts +++ b/packages/timeline-state-resolver/src/devices/device.ts @@ -1,6 +1,13 @@ import * as _ from 'underscore' import { TimelineState } from 'superfly-timeline' -import { Mappings, DeviceType, MediaObject, DeviceOptionsBase } from 'timeline-state-resolver-types' +import { + Mappings, + DeviceType, + MediaObject, + DeviceOptionsBase, + DeviceStatus, + StatusCode, +} from 'timeline-state-resolver-types' import { EventEmitter } from 'eventemitter3' import { CommandReport, DoOnTime, SlowFulfilledCommandInfo, SlowSentCommandInfo } from '../doOnTime' import { ExpectedPlayoutItem } from '../expectedPlayoutItems' @@ -26,24 +33,13 @@ export interface CommandWithContext { timelineObjId: string command: any } -export enum StatusCode { - UNKNOWN = 0, // Status unknown - GOOD = 1, // All good and green - WARNING_MINOR = 2, // Everything is not OK, operation is not affected - WARNING_MAJOR = 3, // Everything is not OK, operation might be affected - BAD = 4, // Operation affected, possible to recover - FATAL = 5, // Operation affected, not possible to recover without manual interference -} -export interface DeviceStatus { - statusCode: StatusCode - messages?: Array - active: boolean -} export function literal(o: T) { return o } +export { DeviceStatus, StatusCode } + export type DeviceEvents = { info: [info: string] warning: [warning: string]