import { TextParagraph } from "./TextParagraph";
import { TextProps } from "../graphics";
import { IRect, Point } from "../common";
import { IPoint } from "../idl";
import { TextCursorPosition } from "./editInfo/TextCursorPosition";
import { RichTextHelper } from "./richText/RichTextHelper";
import { RichTextParagraph } from "./richText/RichTextParagraph";
import { TextBlockMeasureWorker } from "./measure/TextBlockMeasureWorker";
import { TextBlock } from "./TextBlock";
import { ITextBlock } from "./richText/ITextBlock";
import { TypesettingCtx } from "./TypesettingCtx";
import { TextCursorMoveWorker } from "./cursor/TextCursorMoveWorker";
import { ITextParagraphProps } from "../idl/capInfo/ITextParagraphProps";
import { PrefixDrawer } from "./paraStyle/PrefixDrawer";
import { TextQuoteLineWorker } from "./paraStyle/TextQuoteLineWorker";
import { ITextParagraphQuoteProps } from "../idl/capInfo/ITextParagraphQuoteProps";
export declare class RenderText {
    paragraphs: TextParagraph[];
    x: number;
    y: number;
    width: number;
    height: number;
    textProps: TextProps;
    paragraphProps: ITextParagraphProps;
    paragraphQuoteProps: ITextParagraphQuoteProps;
    rect: IRect;
    prefixDrawer: PrefixDrawer;
    textBlockMeasureWorker: TextBlockMeasureWorker;
    richTextHelper: RichTextHelper;
    cursorMoveWorker: TextCursorMoveWorker;
    textQuoteLineWorker: TextQuoteLineWorker;
    /**
     * 绘制
     * @param glCtx
     * @param pos
     * @param alpha
     */
    draw(glCtx: CanvasRenderingContext2D, pos: Point, alpha?: number): void;
    contains(point: IPoint): boolean;
    detect(point: IPoint): TextCursorPosition;
    headTextCursorPosition(): TextCursorPosition;
    tailTextCursorPosition(): TextCursorPosition;
    private getBoundaryCursorByY;
    protected addParagraph(paragraph: TextParagraph): void;
    /**
     * 字符位置，
     * 返回参数为相对该段的坐标
     * @param paraIndex
     */
    getParagraph(paraIndex: number): TextParagraph | null;
    /**
     * 根据光标位置获取相对节点的位置
     * @param cursorPosition
     */
    getPosByCursorPosition(cursorPosition: TextCursorPosition): {
        relativePos: Point;
        height: number;
    };
    /**
     * 获取光标前方字符的字体颜色，用于光标着色。
     * 光标位于行首（charIndex === -1）时，取当前行第一个 block 的颜色；
     * 否则取 charIndex 对应字符所在 block 的颜色。
     * 找不到任何字符时返回 null，由调用方使用默认颜色。
     */
    getFontColorByCursorPosition(cursorPosition: TextCursorPosition): string | null;
    reset(): void;
    private computeParagraphMap;
    private computeParagraphQuoteMap;
    /**
     * 排版
     */
    typesetting(glCtx: CanvasRenderingContext2D, textProps: TextProps | undefined, rect: IRect, paragraphProps?: ITextParagraphProps, paragraphQuoteProps?: ITextParagraphQuoteProps): void;
    protected typesettingParagraph(glCtx: CanvasRenderingContext2D, textParagraph: RichTextParagraph, width: number, autoWidth: boolean): TextParagraph;
    lineAddTextBlock(textBlock: TextBlock, iNextTextBlock: ITextBlock | null, width: number, autoWidth: boolean, ctx: TypesettingCtx): void;
    protected alignVertical(rect: IRect): void;
    protected alignHorizon(rect: IRect): void;
    /**
     * 判断光标位置是否在视窗范围外，需要修正显示内容
     * @param rect
     * @param cursor
     */
    modifyPosInEditing(rect: IRect, cursor: TextCursorPosition): boolean;
    /**
     * 从编辑状态中恢复
     */
    resetFromEditing(rect: IRect): void;
    isEmptyText(): boolean;
    toRichTextXML(): string;
    toString(): string;
    prevParagraphToXML(paraIndex: number): string;
    nextParagraphToXML(paraIndex: number): string;
    nextCursorPos(textCursorPosition: TextCursorPosition, step: number): TextCursorPosition;
    prevCursorPos(textCursorPosition: TextCursorPosition, step: number): TextCursorPosition;
    getTextCursorPosByIndex(index: number): TextCursorPosition;
    /**
     * 根据TextCursorPosition获取对应的字符索引
     * @param renderText
     * @param textCursor
     * @returns 字符在整个文本中的索引位置
     */
    getIndexByTextCursorPos(textCursor: TextCursorPosition): number;
}
//# sourceMappingURL=RenderText.d.ts.map