Merge pull request #2 from dhb52/patch-1

fix: startup error ColorDiff
This commit is contained in:
程序员阿江-Relakkes
2026-04-01 11:46:26 +08:00
committed by GitHub
+32 -6
View File
@@ -1,19 +1,45 @@
export type SyntaxTheme = { export type SyntaxTheme = {
name: string; theme: string;
source: string | null;
}; };
export class ColorDiff { export class ColorDiff {
format(input: string): string { private hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] };
return input; private filePath: string;
private firstLine: string | null;
private prefixContent: string | null;
constructor(
hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] },
firstLine: string | null,
filePath: string,
prefixContent?: string | null,
) {
this.hunk = hunk;
this.filePath = filePath;
this.firstLine = firstLine;
this.prefixContent = prefixContent ?? null;
}
render(themeName: string, width: number, dim: boolean): string[] | null {
return null;
} }
} }
export class ColorFile { export class ColorFile {
format(input: string): string { private code: string;
return input; private filePath: string;
constructor(code: string, filePath: string) {
this.code = code;
this.filePath = filePath;
}
render(themeName: string, width: number, dim: boolean): string[] | null {
return null;
} }
} }
export function getSyntaxTheme(themeName: string): SyntaxTheme { export function getSyntaxTheme(themeName: string): SyntaxTheme {
return { name: themeName }; return { theme: themeName, source: null };
} }