MCPcopy Create free account
hub / github.com/CatMuse/HiNote / IHighlightRepository

Interface IHighlightRepository

src/repositories/IHighlightRepository.ts:8–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 * 负责高亮数据的访问和缓存管理
7 */
8export interface IHighlightRepository {
9 /**
10 * 初始化仓储
11 */
12 initialize(): Promise<void>;
13
14 /**
15 * 获取文件的所有高亮
16 * @param filePath 文件路径
17 * @returns 高亮数组
18 */
19 getFileHighlights(filePath: string): Promise<HiNote[]>;
20
21 /**
22 * 保存文件的高亮
23 * @param filePath 文件路径
24 * @param highlights 高亮数组
25 */
26 saveFileHighlights(filePath: string, highlights: HiNote[]): Promise<void>;
27
28 /**
29 * 删除文件的所有高亮
30 * @param filePath 文件路径
31 */
32 deleteFileHighlights(filePath: string): Promise<void>;
33
34 /**
35 * 处理文件重命名
36 * @param oldPath 旧路径
37 * @param newPath 新路径
38 */
39 handleFileRename(oldPath: string, newPath: string): Promise<void>;
40
41 /**
42 * 获取所有包含高亮的文件路径
43 */
44 getAllHighlightFiles(): Promise<string[]>;
45
46 /**
47 * 从缓存获取文件高亮(不触发加载)
48 * @param filePath 文件路径
49 * @returns 高亮数组,如果未缓存则返回 null
50 */
51 getCachedHighlights(filePath: string): HiNote[] | null;
52
53 /**
54 * 使缓存失效
55 * @param filePath 文件路径
56 */
57 invalidateCache(filePath: string): void;
58
59 /**
60 * 获取所有缓存的高亮数据
61 */
62 getAllCachedHighlights(): Map<string, HiNote[]>;
63
64 /**
65 * 根据高亮 ID 查找高亮

Callers 37

renderHighlightsMethod · 0.65
initializeMethod · 0.65
initializeMethod · 0.65
initializeMethod · 0.65
addHighlightMethod · 0.65
removeHighlightMethod · 0.65
getFileHighlightsMethod · 0.65
findHighlightsMethod · 0.65
loadHighlightsByPathMethod · 0.65
loadAllHighlightsMethod · 0.65

Implementers 1

HighlightRepositorysrc/repositories/HighlightRepository.t

Calls

no outgoing calls

Tested by

no test coverage detected