import { SessionStatus } from '../providers/VideoPluginProvider/context';
import { ChatAction, ChatState } from './chat';
import { GrantParticipationAction, InviteToParticipateAction, ParticipationPermissions, RevokeParticipationAction, RevokeVideoParticipationAction } from './participation/types';
import { PinAction, PinState } from './pin';
import { RequestHostRoleAction } from './request-host-role';
import { SessionAction } from './session-info';
import { SpeakerTurnAction, SpeakerTurnState } from './speaker-turn';

export type SharedState = {
    revision: number;
    lastUpdatedAt: number;
    chatState: ChatState;
    speakerTurnState: SpeakerTurnState;
    sessionState: {
        status: SessionStatus;
    };
    requestHostRoleState: {
        userId: number | null;
        timestamp: number;
    };
    participationPermissions: ParticipationPermissions;
    pinState: PinState;
};
export type AlertUserAction = {
    type: 'ALERT-USER';
    message: string;
    userId: number;
};
export type RequestStateAction = {
    type: 'REQUEST-SHARED-STATE';
    userId: number;
};
export type SendStateAction = {
    type: 'SEND-SHARED-STATE';
    state: SharedState;
};
export type ResetSharedStateAction = {
    type: 'RESET-SHARED-STATE';
    state: SharedState;
};
export type ClearPinnedUserAction = {
    type: 'CLEAR-PINNED-USER';
    userId: number;
};
export type RequestStateRecoveryAction = {
    type: 'REQUEST-STATE-RECOVERY';
    requesterUserId: number;
    requestId: string;
};
export type SendStateRecoveryAction = {
    type: 'SEND-STATE-RECOVERY';
    requestId: string;
    state: SharedState;
    responderUserId: number;
    responderRole: 'host' | 'manager' | 'attendee';
};
export type CommandChannelAction = AlertUserAction | RequestStateAction | SendStateAction | RequestStateRecoveryAction | SendStateRecoveryAction | SpeakerTurnAction | ChatAction | SessionAction | RequestHostRoleAction | GrantParticipationAction | RevokeParticipationAction | RevokeVideoParticipationAction | InviteToParticipateAction | PinAction;
export type SharedReducerAction = CommandChannelAction | ResetSharedStateAction | ClearPinnedUserAction;
