Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Add comments to dynamic imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Alun Turner committed Jul 10, 2023
1 parent a793310 commit a4bc3ee
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,23 @@ export const dynamicImportSendMessage = async (
};

export const dynamicImportConversionFunctions = async (): 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` for consistency in handling linebreaks.
*
* @param rich - html to convert
* @returns a string of plain text that may contain markdown
*/
richToPlain(rich: string): 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, read as innerHTML
* @param inMessageFormat - whether or not the return should be formatted for use as a message formatted_body
* @returns a string of html
*/
plainToRich(plain: string, inMessageFormat: boolean): Promise<string>;
}> => {
const { richToPlain, plainToRich } = await retry(() => import("@matrix-org/matrix-wysiwyg"), RETRY_COUNT);
Expand Down

0 comments on commit a4bc3ee

Please sign in to comment.