matrix-react-sdk
Version:
SDK for matrix.org using React
31 lines (30 loc) • 1.49 kB
TypeScript
import React, { ReactElement } from "react";
import _Linkify from "linkify-react";
import { IExtendedSanitizeOptions } from "./@types/sanitize-html";
export declare const transformTags: NonNullable<IExtendedSanitizeOptions["transformTags"]>;
export declare const sanitizeHtmlParams: IExtendedSanitizeOptions;
export declare function Linkify({ as, options, children }: React.ComponentProps<typeof _Linkify>): ReactElement;
/**
* Linkifies the given string. This is a wrapper around 'linkifyjs/string'.
*
* @param {string} str string to linkify
* @param {object} [options] Options for linkifyString. Default: linkifyMatrixOptions
* @returns {string} Linkified string
*/
export declare function linkifyString(str: string, options?: import("linkifyjs").Opts): string;
/**
* Linkifies the given DOM element. This is a wrapper around 'linkifyjs/element'.
*
* @param {object} element DOM element to linkify
* @param {object} [options] Options for linkifyElement. Default: linkifyMatrixOptions
* @returns {object}
*/
export declare function linkifyElement(element: HTMLElement, options?: import("linkifyjs").Opts): HTMLElement;
/**
* Linkify the given string and sanitize the HTML afterwards.
*
* @param {string} dirtyHtml The HTML string to sanitize and linkify
* @param {object} [options] Options for linkifyString. Default: linkifyMatrixOptions
* @returns {string}
*/
export declare function linkifyAndSanitizeHtml(dirtyHtml: string, options?: import("linkifyjs").Opts): string;