Skip to content
Merged
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
23 changes: 11 additions & 12 deletions packages/timeline-state-resolver-tools/bin/schema-types.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ for (const dir of dirs) {

const dirId = capitalise(dir)

let output = ''
let output = "import type { DeviceType } from './device-options.js'\n"

// compile options from file
try {
Expand Down Expand Up @@ -401,14 +401,6 @@ ${actionDefinitions
}"\n` + output
}

output += `
export interface ${dirId}DeviceTypes {
Options: ${dirId}Options
Mappings: SomeMapping${dirId}
Actions: ${actionDefinitions.length > 0 ? `${dirId}ActionMethods` : 'null'}
}
`

let deviceTypeId = toConstantCase(dir)
// Special case handling for some devices, for backwards compatibility
if (
Expand All @@ -422,10 +414,17 @@ export interface ${dirId}DeviceTypes {
}
deviceTypeEnum.push(deviceTypeId)

output += `
export interface ${dirId}DeviceTypes {
Type: DeviceType.${deviceTypeId},
Options: ${dirId}Options
Mappings: SomeMapping${dirId}
Actions: ${actionDefinitions.length > 0 ? `${dirId}ActionMethods` : 'null'}
}
`

deviceOptionsFile += `import type { ${dirId}Options } from './${dir}'
export interface DeviceOptions${dirId} extends DeviceOptionsBase<${dirId}Options> {
type: DeviceType.${deviceTypeId}
}\n\n`
export type DeviceOptions${dirId} = DeviceOptionsBase<DeviceType.${deviceTypeId}, ${dirId}Options>\n\n`
deviceOptionsTypes.push(`DeviceOptions${dirId}`)

manifestFileSubdevices += `\t\t[DeviceType.${deviceTypeId}]: {
Expand Down
6 changes: 3 additions & 3 deletions packages/timeline-state-resolver-types/src/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export interface DeviceStatus {
active: boolean
}

export interface DeviceOptionsBase<T> extends SlowReportOptions, DeviceCommonOptions {
type: DeviceType
export interface DeviceOptionsBase<TType extends DeviceType, TOptions> extends SlowReportOptions, DeviceCommonOptions {
type: TType
isMultiThreaded?: boolean
reportAllCommands?: boolean
options?: T
options?: TOptions
}

export interface SlowReportOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { ActionExecutionResult } from "../actions"
import type { DeviceType } from './device-options.js'

export interface AbstractOptions {}

Expand All @@ -18,6 +19,7 @@ export interface AbstractActionMethods {
}

export interface AbstractDeviceTypes {
Type: DeviceType.ABSTRACT,
Options: AbstractOptions
Mappings: SomeMappingAbstract
Actions: AbstractActionMethods
Expand Down
2 changes: 2 additions & 0 deletions packages/timeline-state-resolver-types/src/generated/atem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { ActionExecutionResult } from "../actions"
import type { DeviceType } from './device-options.js'

export interface AtemOptions {
host: string
Expand Down Expand Up @@ -113,6 +114,7 @@ export interface AtemActionMethods {
}

export interface AtemDeviceTypes {
Type: DeviceType.ATEM,
Options: AtemOptions
Mappings: SomeMappingAtem
Actions: AtemActionMethods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { ActionExecutionResult } from "../actions"
import type { DeviceType } from './device-options.js'

export interface CasparCGOptions {
/**
Expand Down Expand Up @@ -66,6 +67,7 @@ export interface CasparCGActionMethods {
}

export interface CasparCGDeviceTypes {
Type: DeviceType.CASPARCG,
Options: CasparCGOptions
Mappings: SomeMappingCasparCG
Actions: CasparCGActionMethods
Expand Down
100 changes: 25 additions & 75 deletions packages/timeline-state-resolver-types/src/generated/device-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,129 +7,79 @@

import type { DeviceOptionsBase } from '../device'
import type { AbstractOptions } from './abstract'
export interface DeviceOptionsAbstract extends DeviceOptionsBase<AbstractOptions> {
type: DeviceType.ABSTRACT
}
export type DeviceOptionsAbstract = DeviceOptionsBase<DeviceType.ABSTRACT, AbstractOptions>

import type { AtemOptions } from './atem'
export interface DeviceOptionsAtem extends DeviceOptionsBase<AtemOptions> {
type: DeviceType.ATEM
}
export type DeviceOptionsAtem = DeviceOptionsBase<DeviceType.ATEM, AtemOptions>

import type { CasparCGOptions } from './casparCG'
export interface DeviceOptionsCasparCG extends DeviceOptionsBase<CasparCGOptions> {
type: DeviceType.CASPARCG
}
export type DeviceOptionsCasparCG = DeviceOptionsBase<DeviceType.CASPARCG, CasparCGOptions>

import type { HttpSendOptions } from './httpSend'
export interface DeviceOptionsHttpSend extends DeviceOptionsBase<HttpSendOptions> {
type: DeviceType.HTTPSEND
}
export type DeviceOptionsHttpSend = DeviceOptionsBase<DeviceType.HTTPSEND, HttpSendOptions>

import type { HttpWatcherOptions } from './httpWatcher'
export interface DeviceOptionsHttpWatcher extends DeviceOptionsBase<HttpWatcherOptions> {
type: DeviceType.HTTPWATCHER
}
export type DeviceOptionsHttpWatcher = DeviceOptionsBase<DeviceType.HTTPWATCHER, HttpWatcherOptions>

import type { HyperdeckOptions } from './hyperdeck'
export interface DeviceOptionsHyperdeck extends DeviceOptionsBase<HyperdeckOptions> {
type: DeviceType.HYPERDECK
}
export type DeviceOptionsHyperdeck = DeviceOptionsBase<DeviceType.HYPERDECK, HyperdeckOptions>

import type { KairosOptions } from './kairos'
export interface DeviceOptionsKairos extends DeviceOptionsBase<KairosOptions> {
type: DeviceType.KAIROS
}
export type DeviceOptionsKairos = DeviceOptionsBase<DeviceType.KAIROS, KairosOptions>

import type { LawoOptions } from './lawo'
export interface DeviceOptionsLawo extends DeviceOptionsBase<LawoOptions> {
type: DeviceType.LAWO
}
export type DeviceOptionsLawo = DeviceOptionsBase<DeviceType.LAWO, LawoOptions>

import type { MultiOscOptions } from './multiOsc'
export interface DeviceOptionsMultiOsc extends DeviceOptionsBase<MultiOscOptions> {
type: DeviceType.MULTI_OSC
}
export type DeviceOptionsMultiOsc = DeviceOptionsBase<DeviceType.MULTI_OSC, MultiOscOptions>

import type { ObsOptions } from './obs'
export interface DeviceOptionsObs extends DeviceOptionsBase<ObsOptions> {
type: DeviceType.OBS
}
export type DeviceOptionsObs = DeviceOptionsBase<DeviceType.OBS, ObsOptions>

import type { OscOptions } from './osc'
export interface DeviceOptionsOsc extends DeviceOptionsBase<OscOptions> {
type: DeviceType.OSC
}
export type DeviceOptionsOsc = DeviceOptionsBase<DeviceType.OSC, OscOptions>

import type { PanasonicPTZOptions } from './panasonicPTZ'
export interface DeviceOptionsPanasonicPTZ extends DeviceOptionsBase<PanasonicPTZOptions> {
type: DeviceType.PANASONIC_PTZ
}
export type DeviceOptionsPanasonicPTZ = DeviceOptionsBase<DeviceType.PANASONIC_PTZ, PanasonicPTZOptions>

import type { PharosOptions } from './pharos'
export interface DeviceOptionsPharos extends DeviceOptionsBase<PharosOptions> {
type: DeviceType.PHAROS
}
export type DeviceOptionsPharos = DeviceOptionsBase<DeviceType.PHAROS, PharosOptions>

import type { QuantelOptions } from './quantel'
export interface DeviceOptionsQuantel extends DeviceOptionsBase<QuantelOptions> {
type: DeviceType.QUANTEL
}
export type DeviceOptionsQuantel = DeviceOptionsBase<DeviceType.QUANTEL, QuantelOptions>

import type { ShotokuOptions } from './shotoku'
export interface DeviceOptionsShotoku extends DeviceOptionsBase<ShotokuOptions> {
type: DeviceType.SHOTOKU
}
export type DeviceOptionsShotoku = DeviceOptionsBase<DeviceType.SHOTOKU, ShotokuOptions>

import type { SingularLiveOptions } from './singularLive'
export interface DeviceOptionsSingularLive extends DeviceOptionsBase<SingularLiveOptions> {
type: DeviceType.SINGULAR_LIVE
}
export type DeviceOptionsSingularLive = DeviceOptionsBase<DeviceType.SINGULAR_LIVE, SingularLiveOptions>

import type { SisyfosOptions } from './sisyfos'
export interface DeviceOptionsSisyfos extends DeviceOptionsBase<SisyfosOptions> {
type: DeviceType.SISYFOS
}
export type DeviceOptionsSisyfos = DeviceOptionsBase<DeviceType.SISYFOS, SisyfosOptions>

import type { SofieChefOptions } from './sofieChef'
export interface DeviceOptionsSofieChef extends DeviceOptionsBase<SofieChefOptions> {
type: DeviceType.SOFIE_CHEF
}
export type DeviceOptionsSofieChef = DeviceOptionsBase<DeviceType.SOFIE_CHEF, SofieChefOptions>

import type { TcpSendOptions } from './tcpSend'
export interface DeviceOptionsTcpSend extends DeviceOptionsBase<TcpSendOptions> {
type: DeviceType.TCPSEND
}
export type DeviceOptionsTcpSend = DeviceOptionsBase<DeviceType.TCPSEND, TcpSendOptions>

import type { TelemetricsOptions } from './telemetrics'
export interface DeviceOptionsTelemetrics extends DeviceOptionsBase<TelemetricsOptions> {
type: DeviceType.TELEMETRICS
}
export type DeviceOptionsTelemetrics = DeviceOptionsBase<DeviceType.TELEMETRICS, TelemetricsOptions>

import type { TricasterOptions } from './tricaster'
export interface DeviceOptionsTricaster extends DeviceOptionsBase<TricasterOptions> {
type: DeviceType.TRICASTER
}
export type DeviceOptionsTricaster = DeviceOptionsBase<DeviceType.TRICASTER, TricasterOptions>

import type { ViscaOverIPOptions } from './viscaOverIP'
export interface DeviceOptionsViscaOverIP extends DeviceOptionsBase<ViscaOverIPOptions> {
type: DeviceType.VISCA_OVER_IP
}
export type DeviceOptionsViscaOverIP = DeviceOptionsBase<DeviceType.VISCA_OVER_IP, ViscaOverIPOptions>

import type { VizMSEOptions } from './vizMSE'
export interface DeviceOptionsVizMSE extends DeviceOptionsBase<VizMSEOptions> {
type: DeviceType.VIZMSE
}
export type DeviceOptionsVizMSE = DeviceOptionsBase<DeviceType.VIZMSE, VizMSEOptions>

import type { VmixOptions } from './vmix'
export interface DeviceOptionsVmix extends DeviceOptionsBase<VmixOptions> {
type: DeviceType.VMIX
}
export type DeviceOptionsVmix = DeviceOptionsBase<DeviceType.VMIX, VmixOptions>

import type { WebsocketClientOptions } from './websocketClient'
export interface DeviceOptionsWebsocketClient extends DeviceOptionsBase<WebsocketClientOptions> {
type: DeviceType.WEBSOCKET_CLIENT
}
export type DeviceOptionsWebsocketClient = DeviceOptionsBase<DeviceType.WEBSOCKET_CLIENT, WebsocketClientOptions>

export type DeviceOptionsAny =
| DeviceOptionsAbstract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { ActionExecutionResult } from "../actions"
import type { DeviceType } from './device-options.js'

export interface HttpSendOptions {
/**
Expand Down Expand Up @@ -79,6 +80,7 @@ export interface HttpSendActionMethods {
}

export interface HttpSendDeviceTypes {
Type: DeviceType.HTTPSEND,
Options: HttpSendOptions
Mappings: SomeMappingHttpSend
Actions: HttpSendActionMethods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { DeviceType } from './device-options.js'

export interface HttpWatcherOptions {
uri: string
Expand All @@ -26,6 +27,7 @@ export enum HttpMethod {
export type SomeMappingHttpWatcher = Record<string, never>

export interface HttpWatcherDeviceTypes {
Type: DeviceType.HTTPWATCHER,
Options: HttpWatcherOptions
Mappings: SomeMappingHttpWatcher
Actions: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { ActionExecutionResult } from "../actions"
import type { DeviceType } from './device-options.js'

export interface HyperdeckOptions {
host: string
Expand Down Expand Up @@ -36,6 +37,7 @@ export interface HyperdeckActionMethods {
}

export interface HyperdeckDeviceTypes {
Type: DeviceType.HYPERDECK,
Options: HyperdeckOptions
Mappings: SomeMappingHyperdeck
Actions: HyperdeckActionMethods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { ActionExecutionResult } from "../actions"
import type { DeviceType } from './device-options.js'

export interface KairosOptions {
/**
Expand Down Expand Up @@ -377,6 +378,7 @@ export interface KairosActionMethods {
}

export interface KairosDeviceTypes {
Type: DeviceType.KAIROS,
Options: KairosOptions
Mappings: SomeMappingKairos
Actions: KairosActionMethods
Expand Down
2 changes: 2 additions & 0 deletions packages/timeline-state-resolver-types/src/generated/lawo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { DeviceType } from './device-options.js'

export interface LawoOptions {
host: string
Expand Down Expand Up @@ -78,6 +79,7 @@ export enum MappingLawoType {
export type SomeMappingLawo = MappingLawoSource | MappingLawoSources | MappingLawoFullpath | MappingLawoTriggerValue

export interface LawoDeviceTypes {
Type: DeviceType.LAWO,
Options: LawoOptions
Mappings: SomeMappingLawo
Actions: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { DeviceType } from './device-options.js'

export interface MultiOscOptions {
connections: {
Expand Down Expand Up @@ -32,6 +33,7 @@ export enum MappingMultiOscType {
export type SomeMappingMultiOsc = MappingMultiOscLayer

export interface MultiOscDeviceTypes {
Type: DeviceType.MULTI_OSC,
Options: MultiOscOptions
Mappings: SomeMappingMultiOsc
Actions: null
Expand Down
2 changes: 2 additions & 0 deletions packages/timeline-state-resolver-types/src/generated/obs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { DeviceType } from './device-options.js'

export interface ObsOptions {
host: string
Expand Down Expand Up @@ -77,6 +78,7 @@ export enum MappingObsType {
export type SomeMappingObs = MappingObsCurrentScene | MappingObsCurrentTransition | MappingObsRecording | MappingObsStreaming | MappingObsSceneItem | MappingObsInputAudio | MappingObsInputSettings | MappingObsInputMedia

export interface ObsDeviceTypes {
Type: DeviceType.OBS,
Options: ObsOptions
Mappings: SomeMappingObs
Actions: null
Expand Down
2 changes: 2 additions & 0 deletions packages/timeline-state-resolver-types/src/generated/osc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and re-run the "tsr-schema-types" tool to regenerate this file.
*/
import type { DeviceType } from './device-options.js'

export interface OscOptions {
host: string
Expand All @@ -19,6 +20,7 @@ export enum OSCDeviceType {
export type SomeMappingOsc = Record<string, never>

export interface OscDeviceTypes {
Type: DeviceType.OSC,
Options: OscOptions
Mappings: SomeMappingOsc
Actions: null
Expand Down
Loading
Loading