matrix-react-sdk
Version:
SDK for matrix.org using React
17 lines (16 loc) • 822 B
TypeScript
import { Room } from "matrix-js-sdk/src/matrix";
import { PillType } from "../components/views/elements/Pill";
import { PermalinkParts } from "../utils/permalinks/PermalinkConstructor";
/**
* Hook to get the permalink target room:
*
* @param type - Permalink type
* @param parseResult - Permalink parse result
* @param permalinkRoom - Room in which the permalink is rendered
* @returns Returns the target room:
* - The permalinkRoom for an @room or user mention
* - The room of the parse result for a room mention
* - The room of the event for an event permalink
* - Null in other cases or if the room cannot be found
*/
export declare const usePermalinkTargetRoom: (type: PillType | null, parseResult: PermalinkParts | null, permalinkRoom: Room | undefined) => Room | null;