Skip to content

Commit be5898d

Browse files
committed
add doc ts
1 parent c738c52 commit be5898d

1 file changed

Lines changed: 91 additions & 0 deletions

File tree

docs/ts-github-models.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# GitHub Integration Types (TypeScript)
2+
3+
## Core Types
4+
5+
interface GitHubConfig {
6+
githubUsername: string;
7+
githubToken?: string;
8+
}
9+
10+
interface Repository {
11+
id: number;
12+
name: string;
13+
full_name: string;
14+
private: boolean;
15+
html_url: string;
16+
description: string | null;
17+
language: string | null;
18+
stargazers_count: number;
19+
forks_count: number;
20+
updated_at: string;
21+
}
22+
23+
interface FormattedRepo {
24+
name: string;
25+
description: string;
26+
language: string;
27+
stars: number;
28+
forks: number;
29+
updatedAt: string;
30+
url: string;
31+
}
32+
33+
## Activity Types
34+
35+
type ActivityType =
36+
| 'PushEvent'
37+
| 'CreateEvent'
38+
| 'PullRequestEvent'
39+
| 'IssuesEvent';
40+
41+
interface Activity {
42+
id: string;
43+
type: ActivityType;
44+
repo: {
45+
name: string;
46+
};
47+
created_at: string;
48+
payload: {
49+
action?: string;
50+
ref?: string;
51+
};
52+
}
53+
54+
interface FormattedActivity {
55+
text: string;
56+
icon: string;
57+
date: string;
58+
}
59+
60+
## User Types
61+
62+
interface UserProfile {
63+
login: string;
64+
name: string | null;
65+
bio: string | null;
66+
public_repos: number;
67+
followers: number;
68+
following: number;
69+
}
70+
71+
interface FormattedProfile {
72+
avatarUrl: string;
73+
name: string;
74+
bio: string;
75+
followers: number;
76+
following: number;
77+
publicRepos: number;
78+
}
79+
80+
## Utility Types
81+
82+
interface Helpers {
83+
getAuthHeaders(token?: string | null): Record<string, string>;
84+
formatFileSize(bytes: number): string;
85+
formatDate(date: Date | string): string;
86+
}
87+
88+
interface Formatters {
89+
formatCommitMessage(message: string): string;
90+
formatDateTime(date: Date | string): string;
91+
}

0 commit comments

Comments
 (0)