color-diff-napi.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. export type SyntaxTheme = {
  2. theme: string;
  3. source: string | null;
  4. };
  5. export class ColorDiff {
  6. private hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] };
  7. private filePath: string;
  8. private firstLine: string | null;
  9. private prefixContent: string | null;
  10. constructor(
  11. hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] },
  12. firstLine: string | null,
  13. filePath: string,
  14. prefixContent?: string | null,
  15. ) {
  16. this.hunk = hunk;
  17. this.filePath = filePath;
  18. this.firstLine = firstLine;
  19. this.prefixContent = prefixContent ?? null;
  20. }
  21. render(themeName: string, width: number, dim: boolean): string[] | null {
  22. return null;
  23. }
  24. }
  25. export class ColorFile {
  26. private code: string;
  27. private filePath: string;
  28. constructor(code: string, filePath: string) {
  29. this.code = code;
  30. this.filePath = filePath;
  31. }
  32. render(themeName: string, width: number, dim: boolean): string[] | null {
  33. return null;
  34. }
  35. }
  36. export function getSyntaxTheme(themeName: string): SyntaxTheme {
  37. return { theme: themeName, source: null };
  38. }