Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions docs/ts-github-models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# GitHub Integration Types (TypeScript)

## Core Types

interface GitHubConfig {
githubUsername: string;
githubToken?: string;
}

interface Repository {
id: number;
name: string;
full_name: string;
private: boolean;
html_url: string;
description: string | null;
language: string | null;
stargazers_count: number;
forks_count: number;
updated_at: string;
}

interface FormattedRepo {
name: string;
description: string;
language: string;
stars: number;
forks: number;
updatedAt: string;
url: string;
}

## Activity Types

type ActivityType =
| 'PushEvent'
| 'CreateEvent'
| 'PullRequestEvent'
| 'IssuesEvent';

interface Activity {
id: string;
type: ActivityType;
repo: {
name: string;
};
created_at: string;
payload: {
action?: string;
ref?: string;
};
}

interface FormattedActivity {
text: string;
icon: string;
date: string;
}

## User Types

interface UserProfile {
login: string;
name: string | null;
bio: string | null;
public_repos: number;
followers: number;
following: number;
}

interface FormattedProfile {
avatarUrl: string;
name: string;
bio: string;
followers: number;
following: number;
publicRepos: number;
}

## Utility Types

interface Helpers {
getAuthHeaders(token?: string | null): Record<string, string>;
formatFileSize(bytes: number): string;
formatDate(date: Date | string): string;
}

interface Formatters {
formatCommitMessage(message: string): string;
formatDateTime(date: Date | string): string;
}
15 changes: 15 additions & 0 deletions examples/example_01/public/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* @license
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* GitHub Dashboard - Frontend Application
*
Expand Down
15 changes: 15 additions & 0 deletions examples/example_01/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* @license
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* GitHub API Explorer Server
*
Expand Down
Loading