-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
68 lines (62 loc) · 2.01 KB
/
index.d.ts
File metadata and controls
68 lines (62 loc) · 2.01 KB
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
/**
* mdtail - Terminal markdown viewer with live refresh
*/
declare module 'mdtail' {
/**
* Display class for handling terminal UI operations
*/
export class Display {
constructor();
clearScreen(): void;
hideCursor(): void;
showCursor(): void;
getTerminalWidth(): number;
renderTabs(files: string[], currentIndex: number): string;
formatContent(content: string, filename: string): string;
renderNavigation(currentIndex: number, totalFiles: number): string;
render(content: string, filename: string, files: string[], currentIndex: number): void;
showFileList(fileCount: number): void;
}
/**
* FileManager class for handling file operations
*/
export class FileManager {
files: string[];
watchInterval: number;
defaultFile: string;
constructor();
expandFiles(args: string[], currentDir?: string): Promise<string[]>;
validateFiles(files: string[]): boolean;
readFile(filePath: string): Promise<string>;
startWatching(files: string[], onFileChange: (index: number) => void): void;
stopWatching(files: string[]): void;
getFiles(): string[];
}
/**
* Main MdTail class
*/
export class MdTail {
display: Display;
fileManager: FileManager;
files: string[];
currentTabIndex: number;
constructor();
parseArguments(args: string[]): { showHelp: boolean };
expandFiles(args: string[], currentDir?: string): Promise<string[]>;
validateFiles(files: string[]): boolean;
clearScreen(): void;
hideCursor(): void;
showCursor(): void;
renderTabs(files: string[], currentIndex: number, width?: number): string;
formatContent(content: string, filename: string, width?: number): string;
displayCurrentFile(): Promise<void>;
getHelpText(): string;
navigateTab(direction: 'left' | 'right'): boolean;
setupKeyboardNavigation(): void;
startWatching(): Promise<void>;
stopWatching(): void;
cleanup(): Promise<void>;
run(args: string[]): Promise<void>;
}
export = MdTail;
}