export interface WordUnit { /** The visible word, with the punctuation that clings to it. */ text: string; /** Whitespace after it, rendered outside the animated element. */ ws: string; } /** * Splits text into the units a stream reveals one at a time. Words come from * `Intl.Segmenter` (so Chinese splits into words, not characters); whitespace * rides on the word before it so layout never waits on a bare space; closing * punctuation (`,` `.` `”` `)`) stays with the word it follows and opening * punctuation (`“` `(` `《`) with the word it precedes, so a line never starts * or ends on a lone mark; anything else that is not a word, such as an emoji, * is a unit of its own. */ export declare function segmentWords(text: string, locale?: string): WordUnit[];