-
Notifications
You must be signed in to change notification settings - Fork 0
/
Navigator.ts
69 lines (57 loc) · 1.49 KB
/
Navigator.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { Block } from './Block';
/**
* Interface for handling default functionality for moving around the screen
*/
export interface Navigator {
content: string;
navigationBlocks: Block[];
selectedBlockIdx: number;
/**
* Set the navigational content
* @param content original unparsed content for display
* @param blocks for navigation handling
*/
setContent(content: string, blocks: Block[]): void;
/**
* Start up the program and interface
* @param command array of command line arguments for git command to run
* @return content of run command used to parse for navigation
*/
key(keys: string[], listener: () => void): void;
/**
* @return the currently selected block
*/
getSelectedBlock(): Block;
/**
* Navigate to the next block index relative to the selection
*/
navigateNext(count?: number): void;
/**
* Navigate to the previous block index relative to the selection
*/
navigatePrev(count?: number): void;
/**
* Navigate to the selected block index
*/
navigateTo(blockIdx: number): void;
/**
* Changes the validity of the selected block
*/
changeSelectedBlockValidity(validity: boolean): void;
/**
* Removes the specified block
*/
removeBlock(block: number): void;
/**
* Create a textbox for specifying search input for navigation
*/
displaySearchInput(): void;
/**
* Create a text prompt
*/
ask(text: string, cb: Function): void;
/**
* Clear the screen
*/
clear(): void;
}