import type { CursorSelection } from '@blockeditor/block-std'; import type { SurfaceSelection } from '@blockeditor/block-std'; import { DisposableGroup, Slot } from '@blockeditor/global/utils'; import { GroupElementModel, type SurfaceBlockModel } from '../../../surface-block/index.js'; import type { EdgelessPageService } from '../edgeless-page-service.js'; import type { EdgelessModel } from '../type.js'; export interface EdgelessSelectionState { /** * The selected elements. Could be blocks or canvas elements */ elements: string[]; /** * Indicate whether the selected element is in editing mode */ editing: boolean; } export interface CursorSelectionState { x: number; y: number; } export declare class EdgelessSelectionManager { service: EdgelessPageService; surfaceModel: SurfaceBlockModel; disposable: DisposableGroup; slots: { updated: Slot; remoteUpdated: Slot; cursorUpdated: Slot; remoteCursorUpdated: Slot; }; lastState: SurfaceSelection[]; selections: SurfaceSelection[]; cursor: CursorSelection | null; remoteCursor: Map; remoteSelection: Map; private _activeGroup; private _selected; private _selectedIds; private _remoteSelected; get empty(): boolean; get activeGroup(): GroupElementModel | null; get editing(): boolean; /** * ids of the selected elements */ get selectedIds(): string[]; /** * models of the selected elements */ get elements(): EdgelessModel[]; get firstElement(): EdgelessModel; get selectedBound(): import("../../../surface-block/index.js").Bound; private get _selection(); constructor(service: EdgelessPageService); private _setState; private _setCursor; isEmpty(selections: SurfaceSelection[]): boolean; equals(selection: SurfaceSelection[]): boolean; mount(): void; /** * check if element is selected by remote peers * @param element */ hasRemote(element: string): boolean; /** * check if the element is selected in local * @param element */ has(element: string): boolean; set(selection: EdgelessSelectionState | SurfaceSelection[]): void; setCursor(cursor: CursorSelection | CursorSelectionState): void; clear(): void; dispose(): void; } //# sourceMappingURL=selection-manager.d.ts.map