fix: 启动失败 报错 ColorDiff

This commit is contained in:
dhb52
2026-04-01 10:30:17 +08:00
committed by GitHub
parent 76d21ddf33
commit b88a334e35
+32 -6
View File
@@ -1,19 +1,45 @@
export type SyntaxTheme = {
name: string;
theme: string;
source: string | null;
};
export class ColorDiff {
format(input: string): string {
return input;
private hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] };
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 {
format(input: string): string {
return input;
private code: string;
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 {
return { name: themeName };
return { theme: themeName, source: null };
}