import React, { LegacyRef, ReactNode } from "react";
import { IContent } from "matrix-js-sdk/src/matrix";
import { Optional } from "matrix-events-sdk";
export { Linkify, linkifyElement, linkifyAndSanitizeHtml } from "./Linkify";
export declare const EMOJI_REGEX: RegExp;
/**
 * Returns the shortcode for an emoji character.
 *
 * @param {String} char The emoji character
 * @return {String} The shortcode (such as :thumbup:)
 */
export declare function unicodeToShortcode(char: string): string;
export declare function sanitizedHtmlNode(insaneHtml: string): ReactNode;
export declare function getHtmlText(insaneHtml: string): string;
/**
 * Tests if a URL from an untrusted source may be safely put into the DOM
 * The biggest threat here is javascript: URIs.
 * Note that the HTML sanitiser library has its own internal logic for
 * doing this, to which we pass the same list of schemes. This is used in
 * other places we need to sanitise URLs.
 * @return true if permitted, otherwise false
 */
export declare function isUrlPermitted(inputUrl: string): boolean;
/**
 * Wraps emojis in <span> to style them separately from the rest of message. Consecutive emojis (and modifiers) are wrapped
 * in the same <span>.
 * @param {string} message the text to format
 * @param {boolean} isHtmlMessage whether the message contains HTML
 * @returns if isHtmlMessage is true, returns an array of strings, otherwise return an array of React Elements for emojis
 * and plain text for everything else
 */
export declare function formatEmojis(message: string | undefined, isHtmlMessage?: false): JSX.Element[];
export declare function formatEmojis(message: string | undefined, isHtmlMessage: true): string[];
export interface EventRenderOpts {
    highlightLink?: string;
    disableBigEmoji?: boolean;
    stripReplyFallback?: boolean;
    forComposerQuote?: boolean;
}
export declare function bodyToDiv(content: IContent, highlights: Optional<string[]>, opts?: EventRenderOpts, ref?: React.Ref<HTMLDivElement>): ReactNode;
export declare function bodyToSpan(content: IContent, highlights: Optional<string[]>, opts?: EventRenderOpts, ref?: React.Ref<HTMLSpanElement>, includeDir?: boolean): ReactNode;
/**
 * Turn a matrix event body into html
 *
 * content: 'content' of the MatrixEvent
 *
 * highlights: optional list of words to highlight, ordered by longest word first
 *
 * opts.highlightLink: optional href to add to highlighted words
 * opts.disableBigEmoji: optional argument to disable the big emoji class.
 * opts.stripReplyFallback: optional argument specifying the event is a reply and so fallback needs removing
 * opts.forComposerQuote: optional param to lessen the url rewriting done by sanitization, for quoting into composer
 * opts.ref: React ref to attach to any React components returned (not compatible with opts.returnString)
 */
export declare function bodyToHtml(content: IContent, highlights: Optional<string[]>, opts?: EventRenderOpts): string;
/**
 * Turn a room topic into html
 * @param topic plain text topic
 * @param htmlTopic optional html topic
 * @param ref React ref to attach to any React components returned
 * @param allowExtendedHtml whether to allow extended HTML tags such as headings and lists
 * @return The HTML-ified node.
 */
export declare function topicToHtml(topic?: string, htmlTopic?: string, ref?: LegacyRef<HTMLSpanElement>, allowExtendedHtml?: boolean): ReactNode;
/**
 * Returns if a node is a block element or not.
 * Only takes html nodes into account that are allowed in matrix messages.
 *
 * @param {Node} node
 * @returns {bool}
 */
export declare function checkBlockNode(node: Node): boolean;
