refactor: subscription types and form register

This commit is contained in:
Carlos Valente
2023-11-30 22:28:55 +01:00
parent 52a61777ed
commit f720c56345
13 changed files with 205 additions and 113 deletions
@@ -1,5 +1,9 @@
import { Subscription } from './Subscription.type.js';
type HttpSubscriptionOptions = { message: string; enabled: boolean };
export type HttpSubscription = Subscription<HttpSubscriptionOptions>;
export interface HTTPSettings {
enabledOut: boolean;
subscriptions: Subscription;
subscriptions: HttpSubscription;
}
@@ -1,10 +1,13 @@
import { Subscription } from './Subscription.type.js';
type OscSubscriptionOptions = { message: string; enabled: boolean };
export type OscSubscription = Subscription<OscSubscriptionOptions>;
export interface OSCSettings {
portIn: number;
portOut: number;
targetIP: string;
enabledIn: boolean;
enabledOut: boolean;
subscriptions: Subscription;
subscriptions: OscSubscription;
}
@@ -1,4 +1,3 @@
import { TimerLifeCycleKey } from './TimerLifecycle.type.js';
export type SubscriptionOptions = { message: string; enabled: boolean };
export type Subscription = { [key in TimerLifeCycleKey]: SubscriptionOptions[] };
export type Subscription<T> = { [key in TimerLifeCycleKey]: T[] };
+4 -3
View File
@@ -29,11 +29,12 @@ export type { Alias } from './definitions/core/Alias.type.js';
export type { UserFields } from './definitions/core/UserFields.type.js';
// ---> Integration, Subscription
export type { Subscription, SubscriptionOptions } from './definitions/core/Subscription.type.js';
export type { Subscription } from './definitions/core/Subscription.type.js';
// ---> OSC
export type { OSCSettings } from './definitions/core/OscSettings.type.js';
export type { OSCSettings, OscSubscription } from './definitions/core/OscSettings.type.js';
// ---> HTTP
export type { HTTPSettings } from './definitions/core/HttpSettings.type.js';
export type { HTTPSettings, HttpSubscription } from './definitions/core/HttpSettings.type.js';
// SERVER RESPONSES
export type { NetworkInterface, GetInfo } from './api/ontime-controller/BackendResponse.type.js';