UNPKG

git-tweezers

Version:

Advanced git staging tool with hunk and line-level control

47 lines (46 loc) 1.17 kB
import type { HunkInfo } from '../types/hunk-info.js'; interface HistoryEntry { id: string; timestamp: number; patch: string; files: string[]; selectors: Array<string | number>; description?: string; } export declare class HunkCacheService { private cachePath; private git; private cacheData; constructor(cwd?: string); private loadCache; private saveCache; /** * Get or create stable ID mapping for hunks */ mapHunks(filePath: string, hunks: HunkInfo[]): HunkInfo[]; /** * Find hunk by ID or index */ findHunk(hunks: HunkInfo[], selector: string | number): HunkInfo | undefined; /** * Clear the cache */ clearCache(): void; /** * Add a staging history entry */ addHistory(entry: Omit<HistoryEntry, 'id' | 'timestamp'>): void; /** * Get history entries */ getHistory(): HistoryEntry[]; /** * Get specific history entry by index (0 = most recent) */ getHistoryEntry(index: number): HistoryEntry | undefined; /** * Remove a history entry */ removeHistoryEntry(index: number): void; } export {};