mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
This is a second attempt to add protobuf to Nestri, after the first one failed --------- Co-authored-by: Philipp Neumann <3daquawolf@gmail.com> Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
38 lines
703 B
TypeScript
38 lines
703 B
TypeScript
import {LatencyTracker} from "./latency";
|
|
|
|
export interface MessageBase {
|
|
payload_type: string;
|
|
latency?: LatencyTracker;
|
|
}
|
|
|
|
export interface MessageICE extends MessageBase {
|
|
payload_type: "ice";
|
|
candidate: RTCIceCandidateInit;
|
|
}
|
|
|
|
export interface MessageSDP extends MessageBase {
|
|
payload_type: "sdp";
|
|
sdp: RTCSessionDescriptionInit;
|
|
}
|
|
|
|
export enum JoinerType {
|
|
JoinerNode = 0,
|
|
JoinerClient = 1,
|
|
}
|
|
|
|
export interface MessageJoin extends MessageBase {
|
|
payload_type: "join";
|
|
joiner_type: JoinerType;
|
|
}
|
|
|
|
export enum AnswerType {
|
|
AnswerOffline = 0,
|
|
AnswerInUse,
|
|
AnswerOK
|
|
}
|
|
|
|
export interface MessageAnswer extends MessageBase {
|
|
payload_type: "answer";
|
|
answer_type: AnswerType;
|
|
}
|