-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
207 lines (184 loc) · 4.84 KB
/
Copy pathtypes.ts
File metadata and controls
207 lines (184 loc) · 4.84 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
import type { TocEntry } from "./toc.js";
export type ProjectRef = string | number;
export interface ProjectInfoData {
id: number;
path: string;
name: string;
/** Project description rendered to sanitized HTML (markdown + emoji); "" when absent. */
descriptionHtml: string;
webUrl: string;
starCount: number;
forksCount: number;
topics: string[];
createdAt: string;
lastActivityAt: string;
avatarUrl: string | null;
releases?: ReleaseData[];
commits?: CommitData[];
issues?: IssueData[];
openIssuesCount?: number;
commitCount?: number;
repositorySize?: number;
contributorsCount?: number;
}
export interface ReleaseAsset {
name: string;
url: string;
}
export interface ReleaseData {
name: string;
tagName: string;
releasedAt: string;
descriptionHtml: string;
upcomingRelease: boolean;
assets: ReleaseAsset[];
/** Release page URL (GitLab `_links.self`); absent if the API omits it. */
webUrl?: string;
}
export interface IssueData {
iid: number;
title: string;
state: string;
webUrl: string;
labels: string[];
authorName: string;
authorWebUrl: string;
createdAt: string;
}
export interface CommitData {
shortId: string;
title: string;
webUrl: string;
authorName: string;
createdAt: string;
}
export interface ReadmeData {
ref: string;
html: string;
toc?: TocEntry[];
}
export interface FileMarkdownData {
kind: "markdown";
html: string;
ref: string;
path: string;
}
export interface FileCodeData {
kind: "code";
code: string;
language: string;
ref: string;
path: string;
}
export type FileData = FileMarkdownData | FileCodeData;
export interface FetchError {
message: string;
project: string;
}
/** What every component receives: exactly one of these is set. */
export interface ComponentPayload<T> {
data?: T;
error?: FetchError;
}
export interface TopicData {
name: string;
title: string;
totalProjectsCount: number;
webUrl: string;
}
export interface LabelData {
name: string;
color: string;
textColor: string;
description: string | null;
webUrl: string;
}
export interface GroupProjectData {
id: number;
name: string;
path: string;
/** Full namespace path, e.g. "mygroup/team-x/acme-mobile". */
pathWithNamespace: string;
/** Path relative to the queried group root, e.g. "team-x/acme-mobile". Used
* as both the generated file path and the card link target. */
slug: string;
description: string | null;
webUrl: string;
starCount: number;
defaultBranch: string | null;
topics: string[];
}
export interface UserData {
id: number;
username: string;
name: string;
webUrl: string;
/** Localized via AssetManager; null when the user has no avatar. */
avatarUrl: string | null;
/** Role name (e.g. "developer"); set only for members lists. */
role?: string;
// Profile fields — null when not enriched or absent on the profile.
jobTitle: string | null;
organization: string | null;
location: string | null;
bio: string | null;
followers: number | null;
following: number | null;
createdAt: string | null;
}
/** A GitLab label reduced to what the roadmap renders. */
export interface LabelRef {
name: string;
color: string;
textColor: string;
}
export type RoadmapSource = "epics" | "milestones";
export type RoadmapState = "opened" | "closed";
export type RoadmapScale = "quarters" | "months" | "weeks";
/** One epic/milestone normalized from the GitLab API. */
export interface RoadmapItemData {
id: number;
iid: number;
title: string;
state: RoadmapState;
/** ISO `YYYY-MM-DD`, or null when the source has no such date. */
startDate: string | null;
dueDate: string | null;
webUrl: string;
/** Epic color (e.g. `#1f75cb`); absent for milestones. */
color?: string;
/** Completion 0..100; epics only, null when not derivable. */
progress?: number | null;
parentId?: number | null;
parentTitle?: string | null;
labels: LabelRef[];
}
/** An item after geometry: same fields plus its bar placement. */
export interface RoadmapPositionedItem extends RoadmapItemData {
/** Bar left edge as a percentage of the timeline window (0..100). */
offsetPct: number;
/** Bar width as a percentage of the window (>0). */
widthPct: number;
}
export interface ScaleTick {
label: string;
/** Tick position as a percentage of the window (0..100). */
offsetPct: number;
/** ISO `YYYY-MM-DD` of the tick boundary; lets a layout relabel/coarsen ticks. */
date?: string;
}
export interface RoadmapGroup {
key: string;
/** Section heading; null for the single ungrouped bucket. */
title: string | null;
items: RoadmapPositionedItem[];
}
/** The fully positioned model the component renders — no math in React. */
export interface RoadmapData {
source: RoadmapSource;
scale: RoadmapScale;
rangeStart: string; // ISO YYYY-MM-DD
rangeEnd: string;
ticks: ScaleTick[];
groups: RoadmapGroup[];
}