/** * Grapheme boundaries and terminal column widths, in one place. * * A user-perceived character can be several code points — a combining mark, a * variation selector, a ZWJ emoji sequence — and every part of a terminal * editor has to agree on where one ends: the caret must not stop inside one, * Backspace must remove all of it, and the renderer must draw it as the single * cell the terminal gives it. Splitting that logic across modules is what makes * a caret land half-way into an emoji. * * Widths come from `string-width`, the package Ink itself measures with, so the * wrapping computed here and the layout Ink performs agree by construction * rather than by a hand-rolled approximation. */ /** The user-perceived characters of `text`, in order. */ export declare function segmentGraphemes(text: string): string[]; /** Offset just past the grapheme that starts at or contains `index`. */ export declare function nextGraphemeEnd(text: string, index: number): number; /** Offset where the grapheme ending at `index` starts. */ export declare function previousGraphemeStart(text: string, index: number): number; /** * Terminal columns `text` occupies. Zero-width marks cost nothing, an emoji * cluster costs two, and East Asian wide characters cost two — the same rules * Ink applies when it lays a frame out. */ export declare function measureWidth(text: string): number; //# sourceMappingURL=grapheme.d.ts.map