UNPKG

1.31 kBTypeScriptView Raw
1import { Editor, Location, Point, Range } from '../../index';
2import { MoveUnit, SelectionEdge } from '../../types/types';
3export interface SelectionCollapseOptions {
4 edge?: SelectionEdge;
5}
6export interface SelectionMoveOptions {
7 distance?: number;
8 unit?: MoveUnit;
9 reverse?: boolean;
10 edge?: SelectionEdge;
11}
12export interface SelectionSetPointOptions {
13 edge?: SelectionEdge;
14}
15export interface SelectionTransforms {
16 /**
17 * Collapse the selection.
18 */
19 collapse: (editor: Editor, options?: SelectionCollapseOptions) => void;
20 /**
21 * Unset the selection.
22 */
23 deselect: (editor: Editor) => void;
24 /**
25 * Move the selection's point forward or backward.
26 */
27 move: (editor: Editor, options?: SelectionMoveOptions) => void;
28 /**
29 * Set the selection to a new value.
30 */
31 select: (editor: Editor, target: Location) => void;
32 /**
33 * Set new properties on one of the selection's points.
34 */
35 setPoint: (editor: Editor, props: Partial<Point>, options?: SelectionSetPointOptions) => void;
36 /**
37 * Set new properties on the selection.
38 */
39 setSelection: (editor: Editor, props: Partial<Range>) => void;
40}
41export declare const SelectionTransforms: SelectionTransforms;
42//# sourceMappingURL=selection.d.ts.map
\No newline at end of file