mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 13:44:12 +00:00
create universal Subscription
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { TimerLifeCycle, OscSubscription } from 'ontime-types';
|
||||
import { TimerLifeCycle, Subscription } from 'ontime-types';
|
||||
|
||||
export type TimerLifeCycleKey = keyof typeof TimerLifeCycle;
|
||||
|
||||
export default interface IIntegration {
|
||||
subscriptions: OscSubscription;
|
||||
subscriptions: Subscription;
|
||||
init: (config: unknown) => OperationReturn;
|
||||
dispatch: (action: TimerLifeCycleKey, state?: object) => OperationReturn;
|
||||
emit: (...args: unknown[]) => unknown;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ArgumentType, Client, Message } from 'node-osc';
|
||||
import { OSCSettings, OscSubscription } from 'ontime-types';
|
||||
import { OSCSettings, Subscription } from 'ontime-types';
|
||||
|
||||
import IIntegration, { TimerLifeCycleKey } from './IIntegration.js';
|
||||
import { parseTemplateNested } from './integrationUtils.js';
|
||||
@@ -15,7 +15,7 @@ type Action = TimerLifeCycleKey | string;
|
||||
*/
|
||||
export class OscIntegration implements IIntegration {
|
||||
protected oscClient: null | Client;
|
||||
subscriptions: OscSubscription;
|
||||
subscriptions: Subscription;
|
||||
|
||||
constructor() {
|
||||
this.oscClient = null;
|
||||
@@ -57,7 +57,7 @@ export class OscIntegration implements IIntegration {
|
||||
}
|
||||
}
|
||||
|
||||
initSubscriptions(subscriptionOptions: OscSubscription) {
|
||||
initSubscriptions(subscriptionOptions: Subscription) {
|
||||
if (validateOscObject(subscriptionOptions)) {
|
||||
this.subscriptions = { ...subscriptionOptions };
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
EndAction,
|
||||
OntimeRundown,
|
||||
OSCSettings,
|
||||
OscSubscription,
|
||||
OscSubscriptionOptions,
|
||||
Subscription,
|
||||
SubscriptionOptions,
|
||||
ProjectData,
|
||||
Settings,
|
||||
TimerLifeCycle,
|
||||
|
||||
Reference in New Issue
Block a user