29 lines
793 B
TypeScript
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>;
|
|
}
|