import type { ImportDiagnostic } from '@flighthq/importdiagnostics/contract'; import type { DisplayObject } from '@flighthq/scene2d/contract'; import type { RichText } from '@flighthq/text/contract'; import type { RiveArtboardGraph, RiveArtboardImportContext, RiveImportRegistry } from './contract.scene2d-formats-types.ts'; /** * Builds a rich text node from a Rive text drawable. * * The words live in the drawable's **value runs**, each naming a style, and a style's colour comes * from a paint child of its own — the same shape a fill takes on a shape. `styleId` indexes the * artboard's component numbering, the same space `parentId` uses, rather than indexing styles in * declaration order. * * Runs are joined in file order and **each run contributes one `TextFormatRange`** over the span it * occupies in the joined string, which is what carries a drawable whose runs differ in style. One * range per run rather than one only where the style changes: a run is the unit the file authored, so * a consumer reads back the structure that was written rather than a coalesced version of it. * * A text drawable always becomes a `RichText`, never a `TextLabel`, even when a single run means the * ranges are redundant with the format. `TextFormatRange` lives only on `RichTextData`, so the kind * would otherwise depend on the *contents* of the file — a caller that registered a renderer for one * kind would silently lose every multi-run text. One Rive concept maps to one Flight kind. */ export declare function createRiveRichText(artboard: Readonly, index: number, fontNames: readonly string[], diagnostics?: ImportDiagnostic[]): RichText; /** A text drawable becomes a rich text node; its runs and styles are read as part of building it. */ export declare function importRiveTextComponent(context: RiveArtboardImportContext, index: number): DisplayObject | null; /** * Registers text: the `Text` drawable, the value runs that carry its words, and the styles and * variable-font axes those runs name. * * A run and a style are data belonging to the drawable above them, so only the drawable becomes a * node. Without this family a text drawable imports as an empty container that still holds its name, * transform and children — the shape survives and only the words are missing. */ export declare function registerRiveTextHandlers(registry: RiveImportRegistry): void; //# sourceMappingURL=riveText.d.ts.map