import { Renderable, type RenderableOptions } from "../Renderable";
import { Selection, type LocalSelectionBounds } from "../lib/selection";
import { TextBuffer, type TextChunk } from "../text-buffer";
import { RGBA } from "../lib/RGBA";
import { type RenderContext } from "../types";
import type { OptimizedBuffer } from "../buffer";
import type { LineInfo } from "../zig";
export interface TextBufferOptions extends RenderableOptions<TextBufferRenderable> {
    fg?: string | RGBA;
    bg?: string | RGBA;
    selectionBg?: string | RGBA;
    selectionFg?: string | RGBA;
    selectable?: boolean;
    attributes?: number;
    wrap?: boolean;
    wrapMode?: "char" | "word";
}
export declare abstract class TextBufferRenderable extends Renderable {
    selectable: boolean;
    protected _defaultFg: RGBA;
    protected _defaultBg: RGBA;
    protected _defaultAttributes: number;
    protected _selectionBg: RGBA | undefined;
    protected _selectionFg: RGBA | undefined;
    protected _wrap: boolean;
    protected _wrapMode: "char" | "word";
    protected lastLocalSelection: LocalSelectionBounds | null;
    protected textBuffer: TextBuffer;
    protected _lineInfo: LineInfo;
    protected _defaultOptions: {
        fg: RGBA;
        bg: RGBA;
        selectionBg: undefined;
        selectionFg: undefined;
        selectable: true;
        attributes: number;
        wrap: true;
        wrapMode: "char" | "word";
    };
    constructor(ctx: RenderContext, options: TextBufferOptions);
    get plainText(): string;
    get textLength(): number;
    get fg(): RGBA;
    set fg(value: RGBA | string | undefined);
    get selectionBg(): RGBA | undefined;
    set selectionBg(value: RGBA | string | undefined);
    get selectionFg(): RGBA | undefined;
    set selectionFg(value: RGBA | string | undefined);
    get bg(): RGBA;
    set bg(value: RGBA | string | undefined);
    get attributes(): number;
    set attributes(value: number);
    get wrap(): boolean;
    set wrap(value: boolean);
    get wrapMode(): "char" | "word";
    set wrapMode(value: "char" | "word");
    protected onResize(width: number, height: number): void;
    protected refreshLocalSelection(): boolean;
    private updateLocalSelection;
    protected updateTextInfo(): void;
    private updateLineInfo;
    private updateWrapWidth;
    private setupMeasureFunc;
    insertChunk(chunk: TextChunk, index?: number): void;
    removeChunk(index: number): void;
    replaceChunk(index: number, chunk: TextChunk): void;
    shouldStartSelection(x: number, y: number): boolean;
    onSelectionChanged(selection: Selection | null): boolean;
    getSelectedText(): string;
    hasSelection(): boolean;
    getSelection(): {
        start: number;
        end: number;
    } | null;
    render(buffer: OptimizedBuffer, deltaTime: number): void;
    protected renderSelf(buffer: OptimizedBuffer): void;
    destroy(): void;
    protected onFgChanged(newColor: RGBA): void;
    protected onBgChanged(newColor: RGBA): void;
    protected onAttributesChanged(newAttributes: number): void;
}
