matrix-react-sdk
Version:
SDK for matrix.org using React
88 lines (87 loc) • 3.08 kB
TypeScript
import { MatrixError, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { Optional } from "matrix-events-sdk";
import EventEmitter from "events";
import { ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle";
import { MatrixDispatcher } from "../dispatcher/dispatcher";
import { SdkContextClass } from "../contexts/SDKContext";
type Listener = (isActive: boolean) => void;
/**
* A class for storing application state for RoomView.
*/
export declare class RoomViewStore extends EventEmitter {
private readonly stores;
private state;
private dis?;
private dispatchToken?;
constructor(dis: MatrixDispatcher, stores: SdkContextClass);
addRoomListener(roomId: string, fn: Listener): void;
removeRoomListener(roomId: string, fn: Listener): void;
private emitForRoom;
private onCurrentBroadcastRecordingChanged;
private setState;
private doMaybeSetCurrentVoiceBroadcastPlayback;
private onRoomStateEvents;
private onDispatch;
private viewRoom;
private viewThread;
private viewRoomError;
private joinRoom;
private getInvitingUserId;
showJoinRoomError(err: MatrixError, roomId: string): void;
private joinRoomError;
reset(): void;
/**
* Reset which dispatcher should be used to listen for actions. The old dispatcher will be
* unregistered.
* @param dis The new dispatcher to use.
*/
resetDispatcher(dis: MatrixDispatcher): void;
getRoomId(): Optional<string>;
getThreadId(): Optional<string>;
getInitialEventId(): Optional<string>;
isInitialEventHighlighted(): boolean;
initialEventScrollIntoView(): boolean;
getRoomAlias(): Optional<string>;
isRoomLoading(): boolean;
getRoomLoadError(): Optional<MatrixError>;
isJoining(): boolean;
getJoinError(): Optional<Error>;
getQuotingEvent(): MatrixEvent | null;
shouldPeek(): boolean;
getWasContextSwitch(): boolean;
isViewingCall(): boolean;
skipCallLobby(): boolean | undefined;
/**
* Gets the current state of the 'promptForAskToJoin' property.
*
* @returns {boolean} The value of the 'promptForAskToJoin' property.
*/
promptAskToJoin(): boolean;
/**
* Submits a request to join a room by sending a knock request.
*
* @param {SubmitAskToJoinPayload} payload - The payload containing information to submit the request.
* @returns {void}
*/
private submitAskToJoin;
/**
* Cancels a request to join a room by sending a leave request.
*
* @param {CancelAskToJoinPayload} payload - The payload containing information to cancel the request.
* @returns {void}
*/
private cancelAskToJoin;
/**
* Gets the current state of the 'viewRoomOpts' property.
*
* @returns {ViewRoomOpts} The value of the 'viewRoomOpts' property.
*/
getViewRoomOpts(): ViewRoomOpts;
/**
* Invokes the view room lifecycle to set the view room options.
*
* @returns {void}
*/
private setViewRoomOpts;
}
export {};