From b88a334e3579e23bc12215d77ab7cb5ac933fabf Mon Sep 17 00:00:00 2001 From: dhb52 Date: Wed, 1 Apr 2026 10:30:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=AF=E5=8A=A8=E5=A4=B1=E8=B4=A5=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20ColorDiff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stubs/color-diff-napi.ts | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/stubs/color-diff-napi.ts b/stubs/color-diff-napi.ts index b0b6fd1..ad1fbfd 100644 --- a/stubs/color-diff-napi.ts +++ b/stubs/color-diff-napi.ts @@ -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 }; }