import { Slot } from '@blocksuite/global/utils'; import * as Y from 'yjs'; import { Batch } from './batch.js'; import type { IBound } from './consts.js'; import { type IElementCreateProps, type IElementUpdateProps, type IPhasorElementLocalRecord, type IPhasorElementType, type PhasorElement } from './elements/index.js'; import type { ComputedValue, HitTestOptions, SurfaceElement } from './elements/surface-element.js'; import { Renderer } from './renderer.js'; type id = string; export declare class SurfaceManager { private _renderer; private _yContainer; private _elements; private _elementLocalRecords; private _computedValue; private _defaultBatch; private _batches; private _isReadonly; slots: { elementUpdated: Slot<{ id: id; props: { [index: string]: { old: unknown; new: unknown; }; }; }>; elementAdded: Slot; elementRemoved: Slot<{ id: id; element: SurfaceElement; }>; }; constructor(yContainer: Y.Map, computedValue?: ComputedValue, getReadonlyState?: () => boolean); init(): void; get viewport(): Renderer; get defaultBatch(): string; getBatch(id: string): Batch>; private _addToBatch; private _removeFromBatch; private _syncFromExistingContainer; private _createElementFromYMap; private _onYContainer; private _onYEvent; private _transact; refresh(): void; updateIndexes(keys: string[], elements: PhasorElement[], callback?: (keys: string[]) => void): void; attach(container: HTMLElement): void; onResize(): void; getElementsBound(): IBound | null; addElement(type: T, properties: IElementCreateProps): PhasorElement['id']; updateElement(id: string, properties: IElementUpdateProps): void; setElementBound(id: string, bound: IBound): void; setDefaultBatch(batch: string): void; removeElement(id: string): void; hasElement(id: string): boolean; toModelCoord(viewX: number, viewY: number): [number, number]; toViewCoord(modelX: number, modelY: number): [number, number]; pickById(id: string): SurfaceElement | undefined; pickByPoint(x: number, y: number, options?: HitTestOptions): SurfaceElement[]; pickTop(x: number, y: number, options?: HitTestOptions): SurfaceElement | null; pickByBound(bound: IBound): SurfaceElement[]; getSortedElementsWithViewportBounds(): SurfaceElement[]; dispose(): void; /** @internal Only for testing */ initDefaultGestureHandler(): void; getElements(): SurfaceElement[]; getElementsByType(type: T): IPhasorElementType[T][]; updateElementLocalRecord(id: id, records: IPhasorElementLocalRecord[T]): void; getElementLocalRecord(id: id): IPhasorElementLocalRecord[T] | undefined; deleteElementLocalRecord(id: id): void; } export {}; //# sourceMappingURL=surface.d.ts.map