diff options
author | Christoph Cullmann <cullmann@kde.org> | 2024-04-28 17:33:09 +0200 |
---|---|---|
committer | Christoph Cullmann <cullmann@kde.org> | 2024-04-28 17:33:09 +0200 |
commit | e77051ccc4b47951bfa4fde2be436b1bb2fb113b (patch) | |
tree | f0b75ee3521da9c8cd39dac4359212348f70e4e8 /themes/blowfish/assets/lib/mermaid/rendering-util/splitText.d.ts | |
parent | 4b355837824ac2422d371acef790f0f4249255c7 (diff) |
use https://github.com/nunocoracao/blowfish.git
Diffstat (limited to 'themes/blowfish/assets/lib/mermaid/rendering-util/splitText.d.ts')
-rw-r--r-- | themes/blowfish/assets/lib/mermaid/rendering-util/splitText.d.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/themes/blowfish/assets/lib/mermaid/rendering-util/splitText.d.ts b/themes/blowfish/assets/lib/mermaid/rendering-util/splitText.d.ts new file mode 100644 index 0000000..289ab65 --- /dev/null +++ b/themes/blowfish/assets/lib/mermaid/rendering-util/splitText.d.ts @@ -0,0 +1,24 @@ +import type { CheckFitFunction, MarkdownLine, MarkdownWord } from './types.js'; +/** + * Splits a string into graphemes if available, otherwise characters. + */ +export declare function splitTextToChars(text: string): string[]; +/** + * Splits a string into words by using `Intl.Segmenter` if available, or splitting by ' '. + * `Intl.Segmenter` uses the default locale, which might be different across browsers. + */ +export declare function splitLineToWords(text: string): string[]; +/** + * Splits a word into two parts, the first part fits the width and the remaining part. + * @param checkFit - Function to check if word fits + * @param word - Word to split + * @returns [first part of word that fits, rest of word] + */ +export declare function splitWordToFitWidth(checkFit: CheckFitFunction, word: MarkdownWord): [MarkdownWord, MarkdownWord]; +/** + * Splits a line into multiple lines that satisfy the checkFit function. + * @param line - Line to split + * @param checkFit - Function to check if line fits + * @returns Array of lines that fit + */ +export declare function splitLineToFitWidth(line: MarkdownLine, checkFit: CheckFitFunction): MarkdownLine[]; |