import { RoomEvent } from '../types'; /** * Defines a relation to another event. */ export type RelatesTo = { /** * The event id of the other event. */ event_id: string; /** * The relation to the other event. */ rel_type: RelationType; }; /** * Content of a room event that relates to another event. */ export type EventWithRelatesTo = RoomEvent<{ /** * A reference to the event that it relates to. */ 'm.relates_to': RelatesTo; }>; /** * Content of a room event that replaces an existing event with * the "m.replace" relation, which means that the content of the * previous event is fully replaced. */ export type NewContentRelatesTo = EventWithRelatesTo<'m.replace'>['content'] & { /** * The new content of the event. */ 'm.new_content': T; }; /** * A room event that either contains the content directly or contains an * "m.new_content" object. */ export type RoomEventOrNewContent = RoomEvent>; /** * Get the original event id, or the event id of the current event if it * doesn't relates to another event. * @param event - The room event. * @returns The event id of the original event, or the current event id. */ export declare function getOriginalEventId(event: RoomEventOrNewContent): string; /** * Get the content of the event, independent from whether it contains the * content directly or contains a "m.new_content" key. * @param event - The room event. * @returns Only the content of the room event. */ export declare function getContent(event: RoomEventOrNewContent): T; /** * Validates that `event` has a valid structure for a * {@link EventWithRelatesTo}. * @param event - The event to validate. * @returns True, if the event is valid. */ export declare function isValidEventWithRelatesTo(event: RoomEvent): event is EventWithRelatesTo;