import '../page-block/edgeless/components/block-portal/edgeless-block-portal.js';
import { BlockElement } from '@blockeditor/lit';
import type { BlockProps } from '@blockeditor/store';
import type { BlockModel } from '@blockeditor/store';
import { nothing } from 'lit';
import { type EdgelessElement, type TopLevelBlockModel } from '../_common/utils/index.js';
import type { EdgelessBlockPortalContainer } from '../page-block/edgeless/components/block-portal/edgeless-block-portal.js';
import { EdgelessConnectorManager } from '../page-block/edgeless/connector-manager.js';
import type { EdgelessPageBlockComponent } from '../page-block/edgeless/edgeless-page-block.js';
import { EdgelessFrameManager } from '../page-block/edgeless/frame-manager.js';
import { EdgelessSnapManager } from '../page-block/edgeless/utils/snap-manager.js';
import { type IBound } from './consts.js';
import { type EdgelessElementType } from './edgeless-types.js';
import { type HitTestOptions, type ICanvasElementType, type IElementCreateProps, type IElementUpdateProps } from './elements/edgeless-element.js';
import type { SurfaceElement } from './elements/surface-element.js';
import type { EdgelessBlockType } from './index.js';
import { type CanvasElementType, type IVec } from './index.js';
import { compare, EdgelessGroupManager, getGroupParent, setGroupParent } from './managers/group-manager.js';
import { LayerManager } from './managers/layer-manager.js';
import { Renderer } from './renderer.js';
import type { SurfaceBlockModel } from './surface-model.js';
import type { SurfaceService } from './surface-service.js';
import { Bound } from './utils/bound.js';
type id = string;
export type IndexedCanvasUpdateEvent = CustomEvent<{
    content: HTMLCanvasElement[];
}>;
export declare class SurfaceBlockComponent extends BlockElement<SurfaceBlockModel, SurfaceService> {
    static styles: import("lit").CSSResult;
    private _renderer;
    private _yContainer;
    private _elements;
    indexedCanvases: HTMLCanvasElement[];
    snap: EdgelessSnapManager;
    connector: EdgelessConnectorManager;
    frame: EdgelessFrameManager;
    group: EdgelessGroupManager;
    layer: LayerManager;
    compare: typeof compare;
    getGroupParent: typeof getGroupParent;
    setGroupParent: typeof setGroupParent;
    private _lastTime;
    private _cachedViewport;
    private readonly _themeObserver;
    portal: EdgelessBlockPortalContainer;
    get renderer(): Renderer;
    get edgeless(): EdgelessPageBlockComponent;
    private get _isEdgeless();
    get service(): SurfaceService;
    getBlocks<T extends EdgelessBlockType>(flavours: T[] | T | RegExp): TopLevelBlockModel[];
    getSortedBlocks<T extends EdgelessBlockType>(flavour: T | T[]): TopLevelBlockModel[];
    get blocks(): TopLevelBlockModel[];
    get sortedBlocks(): TopLevelBlockModel[];
    private _surfaceContainer;
    connectedCallback(): void;
    getCSSPropertyValue: (value: string) => string;
    private _initEvents;
    private _initThemeObserver;
    private _getSortedSameGroupElements;
    getIndexes(element: EdgelessElement, type: 'before' | 'after', number?: number): string[];
    private _reorder;
    private _updateIndexCanvases;
    renderCanvas(): HTMLCanvasElement[];
    render(): import("lit").TemplateResult<1> | typeof nothing;
    firstUpdated(): void;
    updated(): void;
    private _initResizeEffect;
    init(): void;
    get viewport(): Renderer;
    private _syncFromExistingContainer;
    private _createElementFromYMap;
    private _onYContainer;
    private _onYEvent;
    transact(callback: () => void): void;
    refresh(): void;
    updateIndexes(keys: string[], elements: EdgelessElement[], callback?: (keys: string[]) => void): void;
    attach(container: HTMLElement): void;
    onResize(): void;
    getElementsBound(): IBound | null;
    addElement<T extends CanvasElementType>(type: T, properties: IElementCreateProps<T>): id;
    addElement<K extends EdgelessElementType>(type: K, properties: Partial<BlockProps & Omit<BlockProps, 'flavour'>>, parent?: BlockModel | string | null, parentIndex?: number): id;
    updateElement<T extends CanvasElementType>(id: id, properties: IElementUpdateProps<T>): void;
    updateElement(id: id, properties: Partial<BlockProps>): void;
    setElementBound(id: string, bound: IBound): void;
    removeElement(id: string): void;
    fitToViewport(bound: Bound): void;
    hasElement(id: string): boolean;
    toModelCoord(viewX: number, viewY: number): [number, number];
    toViewCoord(modelX: number, modelY: number): [number, number];
    pickById(id: string): EdgelessElement | null;
    pickTop(x: number, y: number, options: {
        all: true;
    }): EdgelessElement[] | null;
    pickTop(x: number, y: number, options?: {
        all: false;
    }): EdgelessElement | null;
    pickTopWithGroup(point: IVec, options?: HitTestOptions): import("../models.js").NoteBlockModel | import("../models.js").FrameBlockModel | import("../models.js").BookmarkBlockModel | import("../index.js").EmbedFigmaModel | import("../models.js").ImageBlockModel | import("../index.js").EmbedYoutubeModel | import("../index.js").EmbedGithubModel | import("../index.js").EmbedLinkedDocModel | SurfaceElement<import("./elements/surface-element.js").ISurfaceElement> | null;
    pickByBound(bound: Bound): EdgelessElement[];
    dispose(): void;
    /** @internal Only for testing */
    initDefaultGestureHandler(): void;
    getElements(): SurfaceElement<import("./elements/surface-element.js").ISurfaceElement>[];
    getElementsByType<T extends keyof ICanvasElementType>(type: T): ICanvasElementType[T][];
}
declare global {
    interface HTMLElementTagNameMap {
        'affine-surface': SurfaceBlockComponent;
    }
}
export {};
//# sourceMappingURL=surface-block.d.ts.map