import { default as ContentBlock } from '../block/base/content'; import type Format from '../block/base/format'; import Muya from '../index'; import type { ImageToken } from '../inlineRenderer/types'; import { Cursor, NodeOffset, TSelection } from './types'; declare class Selection { muya: Muya; /** * topOffset is the line counts above cursor, and bottomOffset is line counts bellow cursor. * @param {*} paragraph */ static getCursorYOffset(paragraph: HTMLElement): { topOffset: number; bottomOffset: number; }; static getCursorCoords(): DOMRect | null; static getSelectionStart(): Node | null; get scrollPage(): import("../types").Nullable; get isCollapsed(): boolean; get isSelectionInSameBlock(): boolean; get direction(): "none" | "forward" | "backward"; get type(): "None" | "Caret" | "Range"; doc: Document; anchorPath: (string | number)[]; anchorBlock: ContentBlock | null; focusPath: (string | number)[]; focusBlock: ContentBlock | null; anchor: NodeOffset | null; focus: NodeOffset | null; selectedImage: { token: ImageToken; imageId: string; block: Format; } | null; private selectInfo; constructor(muya: Muya); selectAll(): void; /** * Return the current selection of doc or null if has no selection. * @returns */ getSelection(): TSelection | null; setSelection({ anchor, focus, block, path, anchorBlock, anchorPath, focusBlock, focusPath, }: Cursor): void; private listenSelectActions; private handleClickInlineImage; private selectRange; private select; private setFocus; private setCursor; } export default Selection;