import { BufferFlags, ClusterLevel, Direction, type GlyphInfo } from "../types.ts"; /** * Input buffer for text to be shaped. * Holds Unicode codepoints with associated properties. */ export declare class UnicodeBuffer { private _direction; private _script; private _language; private _clusterLevel; private _flags; /** Codepoints to shape */ readonly codepoints: number[]; /** Cluster indices (maps each codepoint to its cluster) */ readonly clusters: number[]; /** Pre-context (text before the buffer for contextual shaping) */ preContext: number[]; /** Post-context (text after the buffer for contextual shaping) */ postContext: number[]; /** Add a string to the buffer */ addStr(text: string, startCluster?: number): this; /** Append to existing buffer (slower path) */ private _addStrAppend; /** Add codepoints directly */ addCodepoints(codepoints: number[], startCluster?: number): this; /** Add a single codepoint */ addCodepoint(codepoint: number, cluster?: number): this; /** Set text direction */ setDirection(direction: Direction): this; /** Set script (ISO 15924 tag, e.g., 'Latn', 'Arab') */ setScript(script: string): this; /** Set language (BCP 47 tag, e.g., 'en', 'ar') */ setLanguage(language: string | null): this; /** Set cluster level */ setClusterLevel(level: ClusterLevel): this; /** Set buffer flags */ setFlags(flags: BufferFlags): this; /** Set pre-context string */ setPreContext(text: string): this; /** Set post-context string */ setPostContext(text: string): this; /** Clear the buffer */ clear(): this; /** Number of codepoints */ get length(): number; get direction(): Direction; get script(): string; get language(): string | null; get clusterLevel(): ClusterLevel; get flags(): BufferFlags; /** Convert to initial glyph infos (codepoint = glyphId initially) */ toGlyphInfos(): GlyphInfo[]; }