reviewit
Version:
A lightweight command-line tool that spins up a local web server to display Git commit diffs in a GitHub-like Files changed view
50 lines (49 loc) • 1.1 kB
TypeScript
export interface DiffFile {
path: string;
oldPath?: string;
status: 'modified' | 'added' | 'deleted' | 'renamed';
additions: number;
deletions: number;
chunks: DiffChunk[];
}
export interface FileDiff {
path: string;
status: 'A' | 'M' | 'D';
diff: string;
additions: number;
deletions: number;
}
export interface DiffChunk {
header: string;
oldStart: number;
oldLines: number;
newStart: number;
newLines: number;
lines: DiffLine[];
}
export interface DiffLine {
type: 'add' | 'delete' | 'normal' | 'hunk' | 'remove' | 'context' | 'header';
content: string;
oldLineNumber?: number;
newLineNumber?: number;
}
export interface ParsedDiff {
chunks: DiffChunk[];
}
export interface DiffResponse {
commit: string;
files: DiffFile[];
ignoreWhitespace?: boolean;
isEmpty?: boolean;
mode?: string;
baseCommitish?: string;
targetCommitish?: string;
}
export interface Comment {
id: string;
file: string;
line: number;
body: string;
timestamp: string;
codeContent?: string;
}