@@ -26,6 +26,7 @@ import { split } from 'lodash';
2626import katex from 'katex' ;
2727import { AllHtmlEntities } from 'html-entities' ;
2828import { IContent } from 'matrix-js-sdk/src/models/event' ;
29+ import { Optional } from 'matrix-events-sdk' ;
2930
3031import {
3132 _linkifyElement ,
@@ -456,9 +457,9 @@ function formatEmojis(message: string, isHtmlMessage: boolean): (JSX.Element | s
456457 * opts.forComposerQuote: optional param to lessen the url rewriting done by sanitization, for quoting into composer
457458 * opts.ref: React ref to attach to any React components returned (not compatible with opts.returnString)
458459 */
459- export function bodyToHtml ( content : IContent , highlights : string [ ] , opts : IOptsReturnString ) : string ;
460- export function bodyToHtml ( content : IContent , highlights : string [ ] , opts : IOptsReturnNode ) : ReactNode ;
461- export function bodyToHtml ( content : IContent , highlights : string [ ] , opts : IOpts = { } ) {
460+ export function bodyToHtml ( content : IContent , highlights : Optional < string [ ] > , opts : IOptsReturnString ) : string ;
461+ export function bodyToHtml ( content : IContent , highlights : Optional < string [ ] > , opts : IOptsReturnNode ) : ReactNode ;
462+ export function bodyToHtml ( content : IContent , highlights : Optional < string [ ] > , opts : IOpts = { } ) {
462463 const isFormattedBody = content . format === "org.matrix.custom.html" && content . formatted_body ;
463464 let bodyHasEmoji = false ;
464465 let isHtmlMessage = false ;
0 commit comments