/// import EventEmitter from "events"; import { TextModel } from "./text-model"; export interface SelectionCustom { anchor: number; focus: number; } export declare class SelectionModel extends EventEmitter { static EVENT_TYPE: { SELECTION_CHANGE: string; }; protected textModel_: TextModel; protected selection_: SelectionCustom | null; protected eventTimer_: number | null; protected selectionChangeEmit_: () => void; constructor(textModel: TextModel); /** 判断两个选区模型是否是同一块区域 */ static isEqual(selection1: SelectionCustom, selection2: SelectionCustom): boolean; getSelection(): SelectionCustom; setSelection(selection: SelectionCustom | null): void; isCollapsed(): boolean | null; isBackward(): boolean | null; /** 折叠选区, toStart 表示以视觉上的开始点为准,而不是以 focus 为准 */ /** 移动光标位置,负数为后退,正数为前进 */ move(n: number): void; } export default SelectionModel;