Files
webrtc-real-time-ip-phone/frontend-web-vanilla/src/interfaces/ISignalingClient.ts
2025-11-28 14:35:23 -05:00

29 lines
793 B
TypeScript

import type {IMessage} from '../messaging/IMessage';
import {MessageKind} from '../messaging/MessageKind';
/**
* Interface for signaling client operations
* Follows Interface Segregation Principle - focused interface for signaling
*/
export interface ISignalingClient {
/**
* Register a callback for a specific message type
*/
on<T>(kind: MessageKind, callback: (message: IMessage<T>) => Promise<void>): void;
/**
* Send an offer to the signaling server
*/
sendOffer(offer: RTCSessionDescriptionInit): Promise<void>;
/**
* Send an answer to the signaling server
*/
sendAnswer(answer: RTCSessionDescriptionInit): Promise<void>;
/**
* Send an ICE candidate to the signaling server
*/
sendCandidate(candidate: RTCIceCandidateInit): Promise<void>;
}