Files
gites/src/lib/types.ts
T
szaman 58268c4015
ci / check (push) Successful in 4m13s
release / release (push) Successful in 9m54s
Commit preview panel at the bottom; open other repositories from a recent list or a folder picker
2026-10-15 00:00:12 +02:00

84 lines
1.8 KiB
TypeScript

export interface Commit {
hash: string;
short: string;
parents: string[];
author: string;
time: number;
subject: string;
}
export interface Ref {
/** Full name, e.g. `refs/heads/main`. */
name: string;
target: string;
}
export interface RepoData {
root: string;
commits: Commit[];
refs: Ref[];
head_ref: string | null;
head: string | null;
}
export type RefKind = "local" | "remote" | "tag";
export interface FilterRule {
pattern: string;
/** `hide` hides matching refs; `only` shows only refs that match some `only` rule. */
mode: "hide" | "only";
}
export interface FilterState {
/** Full ref names hidden with the eye toggle. */
hidden: string[];
rules: FilterRule[];
}
/** A commit as shown on screen, with its parent edges after collapsing. */
export interface DisplayRow {
commit: Commit;
parents: { hash: string; dotted: boolean }[];
/** Set on the first row of a collapsed run: how many commits are hidden below it. */
hiddenCount?: number;
}
export interface Segment {
/** Column numbers; y is 0 (row top), 0.5 (row middle) or 1 (row bottom). */
x1: number;
y1: number;
x2: number;
y2: number;
color: number;
dotted: boolean;
}
export interface LaidOutRow {
col: number;
color: number;
segments: Segment[];
}
export interface ChangedFile {
/** One letter: A added, M modified, D deleted, R renamed, C copied, T type changed. */
status: string;
path: string;
old_path: string | null;
/** Line counts; null for binary files. */
added: number | null;
deleted: number | null;
}
export interface CommitDetails {
hash: string;
author: string;
author_email: string;
author_time: number;
committer: string;
committer_email: string;
commit_time: number;
parents: string[];
message: string;
files: ChangedFile[];
}