import type { BranchSummary, CommitSummary, TagSummary, TreeEntrySummary } from "$lib/api/repo";

export type { BranchSummary, CommitSummary, TagSummary, TreeEntrySummary };

export interface RepoInfo {
	uri: string;
	rkey: string;
	name: string;
	ownerDid: string;
	ownerHandle: string;
	repoDid?: string;
	knot: string;
	spindle?: string;
	description?: string;
	website?: string;
	topics?: string[];
	source?: RepoSource;
	defaultBranch: string;
}

/** the repo this one was forked from */
export interface RepoSource {
	ownerHandle: string;
	name: string;
}

export interface RepoCounts {
	stars: number;
	/** open only, same as the appview's tabs. drop the filter for the total */
	issues: number;
	/** open only, so neither merged nor closed */
	pulls: number;
	forks: number;
}

export interface LanguageSlice {
	name: string;
	percentage: number;
	share: number;
}

export interface IssueSummary {
	id: number;
	title: string;
	state: "open" | "closed";
	authorHandle: string;
	authorDid: string;
	createdAt: string;
	commentCount: number;
}
