@moontra/moonui-pro
Version:
Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components
148 lines (133 loc) • 3.4 kB
text/typescript
export interface GitHubRepository {
id: number
name: string
full_name: string
description: string | null
html_url: string
homepage: string | null
stargazers_count: number
watchers_count: number
forks_count: number
language: string | null
topics: string[]
created_at: string
updated_at: string
pushed_at: string
size: number
open_issues_count: number
license: {
key: string
name: string
spdx_id: string
url: string
} | null
owner: {
login: string
avatar_url: string
html_url: string
type: string
}
private: boolean
// Extended properties
contributors_count?: number
commits_count?: number
releases_count?: number
}
export interface GitHubStats {
totalStars: number
totalForks: number
totalWatchers: number
totalIssues: number
avgStarsPerRepo: number
mostStarredRepo: GitHubRepository | null
recentActivity: GitHubActivity[]
languages: LanguageStats[]
}
export interface GitHubActivity {
type: "star" | "fork" | "issue" | "pr" | "release"
repository: string
timestamp: string
actor?: string
description?: string
}
export interface LanguageStats {
language: string
count: number
percentage: number
color: string
}
export interface StarHistory {
date: string
count: number
repository?: string
}
export interface Milestone {
count: number
reached: boolean
date?: string
celebration?: boolean
}
export type DisplayVariant = "compact" | "full" | "minimal" | "detailed" | "card"
export type AnimationOption = "bounce" | "pulse" | "fade" | "scale" | "slide" | "none"
export type SortOption = "stars" | "forks" | "updated" | "created" | "name" | "issues"
export type LayoutOption = "grid" | "list" | "masonry" | "carousel"
export interface GitHubStarsProps {
// Basic props
username?: string
repository?: string // For single repo mode
repositories?: string[] // For multiple repos
token?: string // GitHub token for higher rate limits
useMockData?: boolean // Force mock data instead of API requests
// Display options
variant?: DisplayVariant
layout?: LayoutOption
showDescription?: boolean
showTopics?: boolean
showStats?: boolean
showOwner?: boolean
showLanguage?: boolean
showActivity?: boolean
showTrending?: boolean
showMilestones?: boolean
showComparison?: boolean
showHistory?: boolean
// Behavior options
sortBy?: SortOption
maxItems?: number
autoRefresh?: boolean
refreshInterval?: number
enableNotifications?: boolean
enableExport?: boolean
enableAnalytics?: boolean
cacheEnabled?: boolean
cacheDuration?: number
// Animation options
animation?: AnimationOption
animationDuration?: number
staggerDelay?: number
// Milestone configuration
milestones?: number[]
celebrateAt?: number[]
// Callbacks
onRepositoryClick?: (repo: GitHubRepository) => void
onStarClick?: (repo: GitHubRepository) => void
onMilestoneReached?: (milestone: Milestone) => void
onDataUpdate?: (stats: GitHubStats) => void
onError?: (error: Error) => void
// Styling
className?: string
theme?: "light" | "dark" | "auto"
size?: "sm" | "md" | "lg" | "xl"
customColors?: Record<string, string>
}
export interface CacheEntry {
data: any
timestamp: number
expiresAt: number
}
export interface RateLimitInfo {
limit: number
remaining: number
reset: number
used: number
}