mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-11-03 14:59:04 +01:00
[feature] add interfaces for classes
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { IAuthSenderPayload, IChannel, IClient, IConnection } from "interfaces/teamspeak";
|
||||
import { IAuthSenderPayload, IChannel, IClient, IConnection, ITS5Connection } from "interfaces/teamspeak";
|
||||
import { TS5DataHandler } from "./dataHandler";
|
||||
import { TS5MessageHandler } from "./messageHandler";
|
||||
|
||||
|
||||
// Establish connection to TS5 client
|
||||
// Main class
|
||||
export class TS5Connection {
|
||||
export class TS5Connection implements ITS5Connection {
|
||||
ws: WebSocket; // Websocket connection to TS5 client
|
||||
authenticated = false; // Is the connection authenticated?
|
||||
remoteAppPort: number; // Port of TS5 client
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { IConnection, IChannel, IClient } from "interfaces/teamspeak";
|
||||
import { IConnection, IChannel, IClient, ITS5DataHandler } from "interfaces/teamspeak";
|
||||
|
||||
|
||||
/**
|
||||
* Handles data received from TS5 client (list of connections, channels and clients)
|
||||
* Updates the states of App.tsx
|
||||
*/
|
||||
export class TS5DataHandler {
|
||||
export class TS5DataHandler implements ITS5DataHandler {
|
||||
// Local lists of connections, channels and clients
|
||||
// These lists are used to keep track of the data, independent of the App.tsx state
|
||||
localConnections: IConnection[];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { IChannelInfos, IConnection, IChannel, IAuthMessage, IClientInfo, IClientMovedMessage, IClient, IClientPropertiesUpdatedMessage, ITalkStatusChangedMessage, IClientSelfPropertyUpdatedMessage, IServerPropertiesUpdatedMessage, IConnectStatusChangedMessage, IChannelsMessage } from "interfaces/teamspeak";
|
||||
import { IChannelInfos, IConnection, IChannel, IAuthMessage, IClientInfo, IClientMovedMessage, IClient, IClientPropertiesUpdatedMessage, ITalkStatusChangedMessage, IClientSelfPropertyUpdatedMessage, IServerPropertiesUpdatedMessage, IConnectStatusChangedMessage, IChannelsMessage, ITS5MessageHandler } from "interfaces/teamspeak";
|
||||
import { TS5DataHandler } from "./dataHandler";
|
||||
|
||||
// Handle incoming messages from TS5 client
|
||||
export class TS5MessageHandler {
|
||||
export class TS5MessageHandler implements ITS5MessageHandler {
|
||||
ws: WebSocket;
|
||||
dataHandler: TS5DataHandler;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user