1 | type MoveFunction1 = (n?: number) => string;
|
2 | type MoveFunction2 = (x?: number, y?: number) => string;
|
3 |
|
4 | /**
|
5 | * Move around functions
|
6 | */
|
7 | interface Move {
|
8 | /**
|
9 | * Move cursor x columns and y rows away. Values can be positive or negative
|
10 | */
|
11 | (x?: number, y?: number): string;
|
12 | /**
|
13 | * Move cursor up n rows
|
14 | */
|
15 | readonly up: MoveFunction1;
|
16 | /**
|
17 | * Move cursor down n rows
|
18 | */
|
19 | readonly down: MoveFunction1;
|
20 | /**
|
21 | * Move cursor right n columns
|
22 | */
|
23 | readonly right: MoveFunction1;
|
24 | /**
|
25 | * Move cursor left n columns
|
26 | */
|
27 | readonly left: MoveFunction1;
|
28 | /**
|
29 | * Absolute move. Sets cursor position at x column and y row
|
30 | */
|
31 | readonly to: MoveFunction2;
|
32 | /**
|
33 | * Move cursor n lines forward if n is positive, otherwise n lines backward, and place it at line beginning
|
34 | */
|
35 | readonly lines: MoveFunction1;
|
36 | /**
|
37 | * Move cursor to top of a screen
|
38 | */
|
39 | readonly top: string;
|
40 | /**
|
41 | * Move cursor to bottom of a screen
|
42 | */
|
43 | readonly bottom: string;
|
44 | /**
|
45 | * Move cursor to begin of a line
|
46 | */
|
47 | readonly lineBegin: string;
|
48 | /**
|
49 | * Move cursor to end of a line
|
50 | */
|
51 | readonly lineEnd: string;
|
52 | }
|
53 |
|
54 | declare const move: Move;
|
55 | export = move;
|