UNPKG

matrix-react-sdk

Version:
45 lines (44 loc) 1.5 kB
import * as React from "react"; import { Room, RoomMember, MatrixEvent, User } from "matrix-js-sdk/src/matrix"; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { XOR } from "../../../@types/common"; interface BaseProps { /** * A function that is called when the dialog is dismissed */ onFinished(): void; /** * An optional string to use as the dialog title. * If not provided, an appropriate title for the target type will be used. */ customTitle?: string; /** * An optional string to use as the dialog subtitle */ subtitle?: string; } interface Props extends BaseProps { /** * The target to link to. * This can be a Room, User, RoomMember, or MatrixEvent or an already computed URL. * A <u>matrix.to</u> link will be generated out of it if it's not already a url. */ target: Room | User | RoomMember | URL; permalinkCreator?: RoomPermalinkCreator; } interface EventProps extends BaseProps { target: MatrixEvent; permalinkCreator: RoomPermalinkCreator; } interface IState { linkSpecificEvent: boolean; permalinkCreator: RoomPermalinkCreator | null; } export default class ShareDialog extends React.PureComponent<XOR<Props, EventProps>, IState> { constructor(props: XOR<Props, EventProps>); static onLinkClick(e: React.MouseEvent): void; private onLinkSpecificEventCheckboxClick; private getUrl; render(): React.ReactNode; } export {};