/** * Splits `fullText` into segments no longer than `maxLength` characters, trying to * split at whitespace (spaces, tabs, line breaks) so words are preserved across * segments. Words longer than `maxLength` are emitted on their own (the function * never breaks a word in half). * * Whitespace at split points is collapsed: emitted segments never start or end with * whitespace. Whitespace inside a segment is preserved as-is. * * @throws RangeError if `maxLength` is not a finite number >= 1. */ export declare function splitTextPreserveWords(fullText: string, maxLength: number): string[]; /** * Returns a single slice of `fullText` starting at `startPos` (default 0), at most * `sliceSize` characters long, ending at a whitespace boundary when possible. Words * longer than `sliceSize` are returned on their own. * * Leading whitespace at `startPos` is skipped, so `startPos` may point either at the * first character of a word or at the whitespace that precedes it. If it lands * mid-word, the returned slice starts mid-word too: this function does not snap * forward to the next word boundary. To iterate over a whole text use * {@link splitTextPreserveWords}, which tracks positions for you. * * @throws RangeError if `sliceSize` is not a finite number >= 1. */ export declare function getSlicePreserveWords(fullText: string, sliceSize: number, _startPos?: number): string;