import type { UITextSpan } from "../../miscellaneous/text-span/UITextSpan"; import type { UITextChunk } from "./UIText.Interfaces"; /** * Detects the directional class used to order a chunk among its neighbours. * Digit only chunks are ordered left to right in both paragraph directions. * @param text Chunk text * @returns Directional class of the chunk */ export declare function detectBidiClass(text: string): number; /** * Detects the paragraph direction of the content. * Implements a simplified UAX#9 P2/P3: the first strong character of the content wins. * @param textSpans Text spans in logical order * @returns Whether the paragraph reads right to left */ export declare function detectIsRTL(textSpans: UITextSpan[]): boolean; /** * Reorders chunks from logical order into visual left to right order. * Implements UAX#9 L2 at chunk granularity with simplified neutral resolution (N1/N2). * Shaping and bidi inside a single chunk are handled by the canvas itself. * @param textChunks Chunks of a single line in logical order * @param isRTL Whether the paragraph reads right to left * @returns Chunks in visual order, or the same array when reordering is not needed */ export declare function reorderChunksVisually(textChunks: UITextChunk[], isRTL: boolean): UITextChunk[];