/**
 * @license
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { StyledLine } from '../styled-line.js';
import { type RenderLine } from './terminal-writer.js';
export type Rect = {
    x: number;
    y: number;
    w: number;
    h: number;
};
/**
 * A 2D drawing surface for terminal characters.
 * Handles clipping and bounds checking.
 */
export declare class Canvas {
    readonly width: number;
    readonly height: number;
    private readonly lines;
    /**
     * Creates a new Canvas from a set of lines.
     */
    static fromLines(width: number, height: number, lines: RenderLine[]): Canvas;
    /**
     * Creates an empty Canvas with the given dimensions.
     */
    static create(width: number, height: number, tainted?: boolean): Canvas;
    constructor(width: number, height: number, lines: RenderLine[]);
    /**
     * Returns the character at the given coordinates.
     */
    getChar(x: number, y: number): {
        bgColor?: string;
    } | undefined;
    /**
     * Sets a character at the given coordinates, respecting clipping.
     */
    setChar(x: number, y: number, value: string, formatFlags: number, fgColor?: string, bgColor?: string, link?: string, clip?: Rect): void;
    /**
     * Draws a sequence of characters starting at (x, y).
     */
    drawStyledChars(x: number, y: number, chars: StyledLine, clip?: Rect): void;
    /**
     * Returns the underlying lines.
     */
    getLines(): RenderLine[];
}
