import { Worktree, Session } from '../types/index.js'; /** * One menu row: worktree metadata plus optional session (for multi-session worktrees). */ export interface SessionItem { worktree: Worktree; session?: Session; baseLabel: string; fileChanges: string; aheadBehind: string; parentBranch: string; lastCommitDate: string; error?: string; lengths: { base: number; fileChanges: number; aheadBehind: number; parentBranch: number; lastCommitDate: number; }; } /** * Format a date as a relative time string (e.g., "2h ago", "3d ago"). */ export declare function formatRelativeDate(date: Date): string; export declare function truncateString(str: string, maxLength: number): string; export declare function generateWorktreeDirectory(projectPath: string, branchName: string, pattern?: string): string; export declare function extractBranchParts(branchName: string): { prefix?: string; name: string; }; /** * Prepares session items for display. * Supports multiple sessions per worktree. * When sortByLastSession is true, worktrees are sorted by the most recent * session lastAccessedAt timestamp (descending), and sessions within each * worktree are also sorted by lastAccessedAt. */ export declare function prepareSessionItems(worktrees: Worktree[], sessions: Session[], options?: { sortByLastSession?: boolean; }): SessionItem[]; /** * Calculates column positions based on content widths. */ export declare function calculateColumnPositions(items: SessionItem[]): { fileChanges: number; aheadBehind: number; parentBranch: number; lastCommitDate: number; }; /** * Assembles the final worktree label with proper column alignment */ export declare function assembleSessionLabel(item: SessionItem, columns: ReturnType): string;