Skip to main content

Class: RichTextNamespace

Hierarchy

  • NamespaceBase

    RichTextNamespace

Accessors

audio

get audio(): (url: string) => RichTextBuilder

Returns

fn

▸ (url): RichTextBuilder

Parameters
NameType
urlstring
Returns

RichTextBuilder


code

get code(): (text: string, language: string) => RichTextBuilder

Returns

fn

▸ (text, language): RichTextBuilder

Parameters
NameType
textstring
languagestring
Returns

RichTextBuilder


image

get image(): (url: string, width?: number, height?: number) => RichTextBuilder

Returns

fn

▸ (url, width?, height?): RichTextBuilder

Parameters
NameType
urlstring
width?number
height?number
Returns

RichTextBuilder


latex

get latex(): (text: string, block: boolean) => RichTextBuilder

Returns

fn

▸ (text, block?): RichTextBuilder

Parameters
NameTypeDefault value
textstringundefined
blockbooleanfalse
Returns

RichTextBuilder


newline

get newline(): () => RichTextBuilder

Returns

fn

▸ (): RichTextBuilder

Returns

RichTextBuilder


rem

get rem(): (rem: string | Rem) => RichTextBuilder

Returns

fn

▸ (rem): RichTextBuilder

Parameters
NameType
remstring | Rem
Returns

RichTextBuilder


text

get text(): (text: string, formats: ("bold" | "italic" | "underline" | "Red" | "Orange" | "Yellow" | "Green" | "Blue" | "Purple" | "quote" | "Gray" | "Brown" | "Pink")[]) => RichTextBuilder

Returns

fn

▸ (text, formats?): RichTextBuilder

Parameters
NameTypeDefault value
textstringundefined
formats("bold" | "italic" | "underline" | "Red" | "Orange" | "Yellow" | "Green" | "Blue" | "Purple" | "quote" | "Gray" | "Brown" | "Pink")[][]
Returns

RichTextBuilder


video

get video(): (url: string) => RichTextBuilder

Returns

fn

▸ (url): RichTextBuilder

Parameters
NameType
urlstring
Returns

RichTextBuilder

Methods

applyTextFormatToRange

applyTextFormatToRange(text, start, end, format): Promise<RichTextInterface>

Parameters

NameType
textRichTextInterface
startnumber
endnumber
formatRichTextFormatName

Returns

Promise<RichTextInterface>


charAt

charAt(richText, index): Promise<null | string>

Parameters

NameType
richTextRichTextInterface
indexnumber

Returns

Promise<null | string>


deepGetRemAndAliasIdsFromRichText

deepGetRemAndAliasIdsFromRichText(richText): Promise<string[]>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<string[]>


deepGetRemIdsFromRichText

deepGetRemIdsFromRichText(richText): Promise<string[]>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<string[]>


empty

empty(richText, allowSpaces?): Promise<boolean>

Parameters

NameType
richTextRichTextInterface
allowSpaces?boolean

Returns

Promise<boolean>


equals

equals(richText1, richText2): Promise<boolean>

Parameters

NameType
richText1RichTextInterface
richText2RichTextInterface

Returns

Promise<boolean>


findAllExternalURLs

findAllExternalURLs(richText): Promise<string[]>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<string[]>


getRemAndAliasIdsFromRichText

getRemAndAliasIdsFromRichText(richText): Promise<string[]>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<string[]>


getRemIdsFromRichText

getRemIdsFromRichText(richText): Promise<string[]>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<string[]>


indexOf

indexOf(richText, character, startChar?): Promise<number>

Parameters

NameType
richTextRichTextInterface
characterstring
startChar?number

Returns

Promise<number>


indexOfElementAt

indexOfElementAt(richText, position): Promise<number>

Parameters

NameType
richTextRichTextInterface
positionnumber

Returns

Promise<number>


length

length(richText): Promise<number>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<number>


normalize

normalize(richText): Promise<RichTextInterface>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<RichTextInterface>


parseAndInsertHtml

parseAndInsertHtml(html, rem): Promise<void>

Parameters

NameTypeDescription
htmlstring
remstring | Rem

Returns

Promise<void>


parseFromMarkdown

parseFromMarkdown(markdown): Promise<RichTextInterface>

Parameters

NameType
markdownstring

Returns

Promise<RichTextInterface>


removeTextFormatFromRange

removeTextFormatFromRange(text, start, end, format): Promise<RichTextInterface>

Parameters

NameType
textRichTextInterface
startnumber
endnumber
formatRichTextFormatName

Returns

Promise<RichTextInterface>


replaceAllRichText

replaceAllRichText(richText, findText, replacementText): Promise<RichTextInterface>

Parameters

NameType
richTextRichTextInterface
findTextRichTextInterface
replacementTextRichTextInterface

Returns

Promise<RichTextInterface>


split

split(richText, separationCharacter): Promise<RichTextInterface>

Parameters

NameType
richTextRichTextInterface
separationCharacterstring

Returns

Promise<RichTextInterface>


splitRichText

splitRichText(richText, splitText): Promise<RichTextInterface>

Parameters

NameType
richTextRichTextInterface
splitTextRichTextInterface

Returns

Promise<RichTextInterface>


substring

substring(richText, start, end?): Promise<RichTextInterface>

Parameters

NameType
richTextRichTextInterface
startnumber
end?number

Returns

Promise<RichTextInterface>


toHTML

toHTML(richText): Promise<string>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<string>


toMarkdown

toMarkdown(richText): Promise<string>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<string>


toString

toString(richText): Promise<string>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<string>


toggleTextFormatOnRange

toggleTextFormatOnRange(text, start, end, format): Promise<RichTextInterface>

Parameters

NameType
textRichTextInterface
startnumber
endnumber
formatRichTextFormatName

Returns

Promise<RichTextInterface>


trim

trim(richText): Promise<RichTextInterface>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<RichTextInterface>


trimEnd

trimEnd(richText): Promise<RichTextInterface>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<RichTextInterface>


trimStart

trimStart(richText): Promise<RichTextInterface>

Parameters

NameType
richTextRichTextInterface

Returns

Promise<RichTextInterface>