import type { Y } from '@blockeditor/store';
import type { EdgelessElement } from '../../_common/types.js';
import type { EdgelessSelectionManager } from '../../page-block/edgeless/services/selection-manager.js';
import type { GroupElement } from '../index.js';
import type { Renderer } from '../renderer.js';
import type { RoughCanvas } from '../rough/canvas.js';
import { Bound } from '../utils/bound.js';
import { type PointLocation } from '../utils/point-location.js';
import type { IVec } from '../utils/vec.js';
import { type SerializedXYWH, type XYWH } from '../utils/xywh.js';
import type { CanvasElementType, HitTestOptions, IEdgelessElement } from './edgeless-element.js';
export interface ISurfaceElement {
    id: string;
    type: CanvasElementType;
    xywh: SerializedXYWH;
    index: string;
    seed: number;
    rotate: number;
    batch: string | null;
}
export type ComputedValue = (value: string) => string;
export declare abstract class SurfaceElement<T extends ISurfaceElement = ISurfaceElement> implements IEdgelessElement {
    containedByBounds(_: Bound): boolean;
    getNearestPoint(_: IVec): IVec;
    intersectWithLine(_: IVec, _1: IVec): PointLocation[] | null;
    getRelativePointLocation(_: IVec): PointLocation;
    boxSelect(bound: Bound): boolean;
    yMap: Y.Map<unknown>;
    protected options: {
        onElementUpdated: (update: {
            id: string;
            props: Record<string, unknown>;
        }) => void;
        pickById: (id: string) => EdgelessElement | null;
        getGroupParent: (element: string | EdgelessElement) => GroupElement;
        setGroupParent: (element: string, group: GroupElement) => void;
        removeElement: (id: string) => void;
        selectionManager?: EdgelessSelectionManager;
    };
    protected renderer: Renderer | null;
    protected _connectable: boolean;
    protected _stashedValues: Map<string, unknown>;
    protected _localProps: string[];
    computedValue: ComputedValue;
    constructor(yMap: Y.Map<unknown>, options: SurfaceElement['options'], data?: Partial<T>);
    init(): void;
    get display(): boolean;
    set display(val: boolean);
    get opacity(): number;
    set opacity(val: number);
    get id(): T["id"];
    get index(): T["index"];
    get type(): T["type"];
    get xywh(): T["xywh"];
    get seed(): T["seed"];
    get rotate(): T["rotate"];
    get batch(): NonNullable<T["batch"]> | null;
    get elementBound(): Bound;
    get x(): number;
    get y(): number;
    get w(): number;
    get h(): number;
    get connectable(): boolean;
    applyUpdate(updates: Partial<T>): void;
    deserializeXYWH(): XYWH;
    serialize(): T;
    hitTest(x: number, y: number, _options?: HitTestOptions): boolean;
    private _onMap;
    mount(renderer: Renderer): void;
    unmount(): void;
    render(_ctx: CanvasRenderingContext2D, _matrix: DOMMatrix, _rc: RoughCanvas): void;
    stash(key: string): void;
    pop(key: string): void;
}
//# sourceMappingURL=surface-element.d.ts.map