matrix-react-sdk
Version:
SDK for matrix.org using React
55 lines (54 loc) • 2.49 kB
TypeScript
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
import { IndicatorIcon } from "@vector-im/compound-web";
import { NotificationLevel } from "../stores/notifications/NotificationLevel";
/**
* Unstable identifier for the marked_unread event, per MSC2867
*/
export declare const MARKED_UNREAD_TYPE_UNSTABLE = "com.famedly.marked_unread";
/**
* Stable identifier for the marked_unread event
*/
export declare const MARKED_UNREAD_TYPE_STABLE = "m.marked_unread";
export declare const deviceNotificationSettingsKeys: string[];
export declare function getLocalNotificationAccountDataEventType(deviceId: string | null): string;
export declare function createLocalNotificationSettingsIfNeeded(cli: MatrixClient): Promise<void>;
export declare function localNotificationsAreSilenced(cli: MatrixClient): boolean;
/**
* Mark a room as read
* @param room
* @param client
* @returns a promise that resolves when the room has been marked as read
*/
export declare function clearRoomNotification(room: Room, client: MatrixClient): Promise<{} | undefined>;
/**
* Marks all rooms with an unread counter as read
* @param client The matrix client
* @returns a promise that resolves when all rooms have been marked as read
*/
export declare function clearAllNotifications(client: MatrixClient): Promise<Array<{} | undefined>>;
/**
* Gives the marked_unread state of the given room
* @param room The room to check
* @returns - The marked_unread state of the room, or undefined if no explicit state is set.
*/
export declare function getMarkedUnreadState(room: Room): boolean | undefined;
/**
* Sets the marked_unread state of the given room. This sets some room account data that indicates to
* clients that the user considers this room to be 'unread', but without any actual notifications.
*
* @param room The room to set
* @param client MatrixClient object to use
* @param unread The new marked_unread state of the room
*/
export declare function setMarkedUnreadState(room: Room, client: MatrixClient, unread: boolean): Promise<void>;
/**
* A helper to transform a notification color to the what the Compound Icon Button
* expects
*/
export declare function notificationLevelToIndicator(level: NotificationLevel): React.ComponentPropsWithRef<typeof IndicatorIcon>["indicator"];
/**
* Return the thread notification level for a room
* @param room
* @returns {NotificationLevel}
*/
export declare function getThreadNotificationLevel(room: Room): NotificationLevel;