import { Slot } from '@blockeditor/global/utils';
import { type IBound } from './consts.js';
import type { SurfaceElement } from './elements/surface-element.js';
import { GridManager } from './grid.js';
import type { LayerManager } from './managers/layer-manager.js';
import { RoughCanvas } from './rough/canvas.js';
import { Bound } from './utils/bound.js';
import { type IPoint } from './utils/point.js';
import { type IVec } from './utils/vec.js';
export interface SurfaceViewport {
    readonly left: number;
    readonly top: number;
    readonly width: number;
    readonly height: number;
    readonly center: IPoint;
    readonly centerX: number;
    readonly centerY: number;
    readonly zoom: number;
    readonly viewportX: number;
    readonly viewportY: number;
    readonly viewportMinXY: IPoint;
    readonly viewportMaxXY: IPoint;
    readonly viewportBounds: Bound;
    readonly boundingClientRect: DOMRect;
    toModelCoord(viewX: number, viewY: number): [number, number];
    toViewCoord(logicalX: number, logicalY: number): [number, number];
    setCenter(centerX: number, centerY: number): void;
    setZoom(zoom: number, focusPoint?: IPoint): void;
    applyDeltaCenter(deltaX: number, deltaY: number): void;
    isInViewport(bound: Bound): boolean;
    addOverlay(overlay: Overlay): void;
    removeOverlay(overlay: Overlay): void;
    getCanvasByBound(bound: IBound, surfaceElements?: SurfaceElement[]): HTMLCanvasElement;
}
/**
 * An overlay is a layer covered on top of elements,
 * can be used for rendering non-CRDT state indicators.
 */
export declare abstract class Overlay {
    abstract render(ctx: CanvasRenderingContext2D, rc: RoughCanvas): void;
}
export declare class Renderer implements SurfaceViewport {
    canvas: HTMLCanvasElement;
    ctx: CanvasRenderingContext2D;
    rc: RoughCanvas;
    gridManager: GridManager<SurfaceElement<import("./elements/surface-element.js").ISurfaceElement>>;
    indexedCanvases: HTMLCanvasElement[];
    layerManager: LayerManager;
    slots: {
        viewportUpdated: Slot<{
            zoom: number;
            center: IVec;
        }>;
    };
    private _overlays;
    private _container;
    private _left;
    private _top;
    private _width;
    private _height;
    private _zoom;
    private _center;
    private _shouldUpdate;
    private _rafId;
    constructor(options: {
        layerManager: LayerManager;
    });
    private _emitViewportUpdatedSlot;
    get left(): number;
    get top(): number;
    get width(): number;
    get height(): number;
    get zoom(): number;
    get centerX(): number;
    get centerY(): number;
    get center(): {
        x: number;
        y: number;
    };
    get viewportX(): number;
    get viewportY(): number;
    get translateX(): number;
    get translateY(): number;
    get viewportMinXY(): {
        x: number;
        y: number;
    };
    get viewportMaxXY(): {
        x: number;
        y: number;
    };
    get viewportBounds(): Bound;
    get boundingClientRect(): DOMRect;
    isInViewport(bound: Bound): boolean;
    toModelCoord(viewX: number, viewY: number): [number, number];
    toViewCoord(modelX: number, modelY: number): [number, number];
    setCenter(centerX: number, centerY: number): void;
    /**
     *
     * @param zoom zoom
     * @param focusPoint canvas coordinate
     */
    setZoom(zoom: number, focusPoint?: IPoint): void;
    setViewport(newZoom: number, newCenter?: number[], smooth?: boolean): void;
    setViewportByBound(bound: Bound, padding?: [number, number, number, number], smooth?: boolean): void;
    smoothZoom(zoom: number, focusPoint?: IPoint): void;
    smoothTranslate(x: number, y: number): void;
    applyDeltaCenter: (deltaX: number, deltaY: number) => void;
    addElement(element: SurfaceElement): void;
    removeElement(element: SurfaceElement): void;
    load(elements: SurfaceElement[]): void;
    refresh(): void;
    /**
     * Used to attach main canvas, main canvas will always exist
     * @param container
     */
    attach(container: HTMLElement): void;
    onResize(): void;
    setIndexedCanvas(canvases: HTMLCanvasElement[]): void;
    private _resetSize;
    private _loop;
    private _render;
    private _renderByBound;
    getCanvasByBound(bound?: IBound, surfaceElements?: SurfaceElement[], canvas?: HTMLCanvasElement, clearBeforeDrawing?: boolean, withZoom?: boolean): HTMLCanvasElement;
    addOverlay(overlay: Overlay): void;
    removeOverlay(overlay: Overlay): void;
}
//# sourceMappingURL=renderer.d.ts.map