import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { ChannelActivityConfirmationTime } from "../channel/channel_activity_confirmation_time"; import { ChannelManagementEvent } from "../channel/channel_management_event"; import { ChannelProducePermissions } from "../channel/channel_produce_permissions"; import { ChannelState } from "../channel/channel_state"; import { ChannelStateShort } from "../channel/channel_state_short"; import { Peer } from "../peer/peer"; export declare const protobufPackage = "channel_message"; export declare enum ChannelEventType { CHANNEL_EVENT_TYPE_UNSPECIFIED = 0, /** * CHANNEL_EVENT_TYPE_CHANNEL_STATE - Event is sent as asynchronous response for `channel.triggerStateEvent` request. * Event payload will contain full information about all session peers. * Event is bound to request by corresponding `messageId` value. */ CHANNEL_EVENT_TYPE_CHANNEL_STATE = 1, /** * CHANNEL_EVENT_TYPE_CHANNEL_STATE_SHORT - Event is sent periodically every N seconds and contains short information about all session peers. * Short state allows to check state consistency between client and media server, * and is not intended for state synchronization. */ CHANNEL_EVENT_TYPE_CHANNEL_STATE_SHORT = 2, /** * CHANNEL_EVENT_TYPE_CHANNEL_ACTIVITY_CONFIRMATION_REQUIRED - This event is sent by media server as a request to check if channel still has any alive clients. * Event contains timeout value, after which channel will be considered inactive and server will * drop (disconnect) all hunging clients. * Clients should confirm user's activity to server according to it's internal logic (e.g. wait for user click a button). */ CHANNEL_EVENT_TYPE_CHANNEL_ACTIVITY_CONFIRMATION_REQUIRED = 3, /** * CHANNEL_EVENT_TYPE_CHANNEL_ACTIVITY_CONFIRMATION_EXPIRED - This event is sent by server after activity timeout is expired. After this event * all clients should leave channel (or they will be disconnected from server side). * Clients should not reconnect without user action to the channel after this event. */ CHANNEL_EVENT_TYPE_CHANNEL_ACTIVITY_CONFIRMATION_EXPIRED = 4, /** * CHANNEL_EVENT_TYPE_CHANNEL_ACTIVITY_CONFIRMATION_ACQUIRED - This event is sent by server as a confirmation that channel still has some alive clients. * After having this event, client does not longer need to confirm user activity or send confirmation to server. */ CHANNEL_EVENT_TYPE_CHANNEL_ACTIVITY_CONFIRMATION_ACQUIRED = 5, /** * CHANNEL_EVENT_TYPE_CHANNEL_PRODUCE_PERMISSIONS_CHANGED - This event is sent each time server or moderator changes produce permissions for a whole channel group. * Event contains up-to-date set of allowed produce permissions and list of permissions that were * changed since previous state. * For example, if permissions were changed from `[microphone, camera]` to `[microphone, screen-video]`. * * producePermissions: `[microphone, screen-video]` * * changedProducePermissions: `[camera, screen-video]` */ CHANNEL_EVENT_TYPE_CHANNEL_PRODUCE_PERMISSIONS_CHANGED = 6, /** * CHANNEL_EVENT_TYPE_CHANNEL_PRODUCE_PERMISSIONS_DELETED - This event is sent each time server or moderator changes produce permissions for a whole channel group. * Event contains list of produce permissions that were removed since previous state. * For example, if permissions were changed from `[microphone, camera]` to `[microphone]`. * * producePermissions: `[camera]` */ CHANNEL_EVENT_TYPE_CHANNEL_PRODUCE_PERMISSIONS_DELETED = 7, /** * CHANNEL_EVENT_TYPE_CHANNEL_MANAGEMENT_EVENT - / This event can be used as a transport for application-specific events. * / Client SDK should not interpret this kind of events and should pass event payload to the app level as-is. */ CHANNEL_EVENT_TYPE_CHANNEL_MANAGEMENT_EVENT = 8, /** CHANNEL_EVENT_TYPE_PEER_JOINED - This event is sent when a new peer joins the channel. Contains full peer state. */ CHANNEL_EVENT_TYPE_PEER_JOINED = 14, /** * CHANNEL_EVENT_TYPE_PEER_LEFT - This event is sent when a peer leaves channel (disconnects). * Peer that has left channel never comes back. * In case of a reconnect, he will be considered a new peer. */ CHANNEL_EVENT_TYPE_PEER_LEFT = 15, /** * CHANNEL_EVENT_TYPE_PEER_PRODUCE_PERMISSIONS_CHANGED - This event is sent each time server or moderator changes someone's produce permissions. * Event contains up-to-date set of allowed produce permissions for given peer. */ CHANNEL_EVENT_TYPE_PEER_PRODUCE_PERMISSIONS_CHANGED = 16, /** * CHANNEL_EVENT_TYPE_PEER_APP_DATA_CHANGED - This event is sent each time peer's AppData is changed by peer himsef, by moderator or by server. * Contains full up-to-date AppData for given peer. */ CHANNEL_EVENT_TYPE_PEER_APP_DATA_CHANGED = 17, /** CHANNEL_EVENT_TYPE_PEER_GROUP_CHANGED - This event sets new channel groups assignment for given peer. */ CHANNEL_EVENT_TYPE_PEER_GROUP_CHANGED = 18, UNRECOGNIZED = -1 } export declare function channelEventTypeFromJSON(object: any): ChannelEventType; export declare function channelEventTypeToJSON(object: ChannelEventType): string; export interface ChannelEvent { eventType: ChannelEventType; channelState?: ChannelState | undefined; channelStateShort?: ChannelStateShort | undefined; channelActivityConfirmationTime?: ChannelActivityConfirmationTime | undefined; channelManagementEvent?: ChannelManagementEvent | undefined; channelProducePermissions?: ChannelProducePermissions | undefined; peer?: Peer | undefined; } export declare const ChannelEvent: MessageFns; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact; } & { [K in Exclude>]: never; }; export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create, I>>(base?: I): T; fromPartial, I>>(object: I): T; } export {};