@@ -26,6 +26,7 @@ import { split } from 'lodash';
26
26
import katex from 'katex' ;
27
27
import { AllHtmlEntities } from 'html-entities' ;
28
28
import { IContent } from 'matrix-js-sdk/src/models/event' ;
29
+ import { Optional } from 'matrix-events-sdk' ;
29
30
30
31
import {
31
32
_linkifyElement ,
@@ -456,9 +457,9 @@ function formatEmojis(message: string, isHtmlMessage: boolean): (JSX.Element | s
456
457
* opts.forComposerQuote: optional param to lessen the url rewriting done by sanitization, for quoting into composer
457
458
* opts.ref: React ref to attach to any React components returned (not compatible with opts.returnString)
458
459
*/
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 = { } ) {
462
463
const isFormattedBody = content . format === "org.matrix.custom.html" && content . formatted_body ;
463
464
let bodyHasEmoji = false ;
464
465
let isHtmlMessage = false ;
0 commit comments