/** * Precise terminal-cell width measurement — the single authority every * budget, wrap, and truncation path shares. The previous heuristic * (`codePoint > 0x2e7f ? 2 : 1)) mis-sized Hangul Jamo (narrow), high * non-CJK code points (wide), and emoji: text-default glyphs like ✳ ⚠ ❤ * counted 2 while terminals draw 1, and VS16 sequences counted 1 while * terminals draw 2 — the exact drift class the community dsh-TUI string * engine documents (a spinner glyph drifting one column per frame). This * module adapts that engine's rules without its Ink-fork renderer: an ASCII * fast path, grapheme-cluster iteration via Intl.Segmenter (code-point * fallback), a merged East-Asian-Wide/Fullwidth + Emoji_Presentation range * table, text-default emoji = 1, VS16 = 2, marks/selectors/ZWJ = 0. * @module @deepseek-ai/dsh-code/render/width */ /** Split text into grapheme clusters (code points when Segmenter is absent). */ export declare function splitGraphemes(text: string): string[]; /** Terminal-cell width of one grapheme cluster. */ export declare function graphemeWidth(cluster: string): number; /** Terminal-cell width of one code point (surrogate pairs must stay paired). */ export declare function codePointWidth(char: string): number; /** * Terminal-cell width of a string: an ASCII fast path avoids the segmenter * for the overwhelmingly common case; everything else sums grapheme clusters. * Control characters occupy no cells (display sanitization makes them * visible escapes before they ever reach a budget). * @param text - display-safe or raw text to measure. * @returns the column count the terminal will draw. */ export declare function stringWidth(text: string): number;