@youtyan/code-viewer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,86 @@
1
+ import type { GdpExpandLogic } from './expand-logic';
2
+
3
+ export type FileMeta = {
4
+ order?: number;
5
+ key?: string;
6
+ path: string;
7
+ old_path?: string;
8
+ display_path?: string;
9
+ status?: string;
10
+ additions?: number;
11
+ deletions?: number;
12
+ binary?: boolean;
13
+ media_kind?: string | null;
14
+ size_class?: string;
15
+ force_layout?: string;
16
+ highlight?: boolean;
17
+ load_url: string;
18
+ preview_url?: string | null;
19
+ estimated_height_px?: number;
20
+ untracked?: boolean;
21
+ };
22
+
23
+ export type DiffMeta = {
24
+ files: FileMeta[];
25
+ totals?: {
26
+ files: number;
27
+ additions: number;
28
+ deletions: number;
29
+ };
30
+ range?: string;
31
+ branch?: string;
32
+ project?: string;
33
+ generation?: number;
34
+ };
35
+
36
+ export type FileDiffResponse = {
37
+ path: string;
38
+ old_path?: string;
39
+ status?: string;
40
+ mode?: string;
41
+ diff: string;
42
+ hunk_count?: number;
43
+ rendered_hunk_count?: number;
44
+ truncated?: boolean;
45
+ binary?: boolean;
46
+ generation?: number;
47
+ };
48
+
49
+ export type FileRangeResponse = {
50
+ path: string;
51
+ ref: string;
52
+ start: number;
53
+ end: number;
54
+ lines: string[];
55
+ total: number;
56
+ generation?: number;
57
+ };
58
+
59
+ export type DiffCardElement = HTMLElement & {
60
+ _diffData?: FileDiffResponse | null;
61
+ _file?: FileMeta | null;
62
+ };
63
+
64
+ export type RefResponse = {
65
+ branches?: string[];
66
+ tags?: string[];
67
+ commits?: string[];
68
+ current?: string;
69
+ };
70
+
71
+ export type AssetVersionResponse = {
72
+ version?: number;
73
+ };
74
+
75
+ declare global {
76
+ interface Window {
77
+ Diff2HtmlUI: any;
78
+ hljs: any;
79
+ GdpExpandLogic: typeof GdpExpandLogic;
80
+ _lastMeta?: DiffMeta;
81
+ __gdpScrollSpy?: EventListener;
82
+ __gdpSidebarTouchedAt?: number;
83
+ }
84
+
85
+ const Diff2HtmlUI: any;
86
+ }