matrix-react-sdk
Version:
SDK for matrix.org using React
34 lines (33 loc) • 2.3 kB
TypeScript
import React, { ComponentProps } from "react";
import { ISendEventResponse } from "matrix-js-sdk/src/matrix";
import { SendMessageParams } from "./utils/message";
declare const SendComposer: React.LazyExoticComponent<typeof import("./SendWysiwygComposer").default>;
declare const EditComposer: React.LazyExoticComponent<typeof import("./EditWysiwygComposer").default>;
export declare const dynamicImportSendMessage: (message: string, isHTML: boolean, params: SendMessageParams) => Promise<ISendEventResponse | undefined>;
export declare const dynamicImportConversionFunctions: () => Promise<{
/**
* Creates a rust model from rich text input (html) and uses it to generate the plain text equivalent (which may
* contain markdown). The return value must be used to set `.innerHTML` (rather than `.innerText`) to
* ensure that HTML entities are correctly interpreted, and to prevent newline characters being turned into `<br>`.
*
* @param rich - html to convert
* @param inMessageFormat - `true` to format the return value for use as a message `formatted_body`.
* `false` to format it for writing to an editor element.
* @returns a string of plain text that may contain markdown
*/
richToPlain(rich: string, inMessageFormat: boolean): Promise<string>;
/**
* Creates a rust model from plain text input (interpreted as markdown) and uses it to generate the rich text
* equivalent. Output can be formatted for display in the composer or for sending in a Matrix message.
*
* @param plain - plain text to convert. Note: when reading the plain text from the editor element, be sure to
* use `.innerHTML` (rather than `.innerText`) to ensure that punctuation characters are correctly HTML-encoded.
* @param inMessageFormat - `true` to format the return value for use as a message `formatted_body`.
* `false` to format it for writing to an editor element.
* @returns a string of html
*/
plainToRich(plain: string, inMessageFormat: boolean): Promise<string>;
}>;
export declare function DynamicImportSendWysiwygComposer(props: ComponentProps<typeof SendComposer>): JSX.Element;
export declare function DynamicImportEditWysiwygComposer(props: ComponentProps<typeof EditComposer>): JSX.Element;
export {};