-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtypes.ts
More file actions
52 lines (47 loc) · 1.04 KB
/
types.ts
File metadata and controls
52 lines (47 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { SimulationNodeDatum, SimulationLinkDatum } from 'd3';
export interface RepoNode extends SimulationNodeDatum {
id: string;
name: string;
type: 'blob' | 'tree'; // blob = file, tree = directory
path: string;
size?: number;
extension?: string;
parentId?: string | null;
children?: RepoNode[]; // For hierarchical layouts
// D3 Simulation properties (optional but good for TS correctness)
x?: number;
y?: number;
fx?: number | null;
fy?: number | null;
}
export interface RepoLink extends SimulationLinkDatum<RepoNode> {
source: string | RepoNode;
target: string | RepoNode;
}
export interface RepoData {
nodes: RepoNode[];
links: RepoLink[];
}
export interface RepoInfo {
name: string;
fullName: string;
description: string;
stars: number;
forks: number;
language: string;
defaultBranch: string;
url: string;
owner: {
login: string;
avatar: string;
};
}
export interface TreeItem {
path: string;
mode: string;
type: 'blob' | 'tree';
sha: string;
size?: number;
url: string;
}
}