import { AppCacheGroupAxis, AppCacheGroupBy, CacheCategory, CategoryBreakdownEntry, SafetyTier } from "../types"; /** * Minimal view shape shared by full CacheCategory objects (the `categories` * command) and the lighter CategoryBreakdownEntry rows carried on a * ClearResult (the `clean` command). Both render through one code path so the * two surfaces can never drift apart. */ export interface CategoryViewItem { id: string; name: string; size: number; safety: SafetyTier; appKey?: string; ageInDays?: number; } export interface CategoryViewOptions { /** A single axis, "none", or an ordered hierarchy (e.g. ["tier","kind","app"]). */ groupBy: AppCacheGroupBy | AppCacheGroupAxis[]; useColor: boolean; emojiMode: "on" | "off" | "minimal"; /** Leading indent applied to every emitted line. */ indent?: string; /** Print each category's id on a dim sub-line (for `categories`, so ids can * be copied into --categories / --allow-manual). */ showId?: boolean; } /** Resolve a full CacheCategory to the minimal view shape (resolving tier). */ export declare function categoryToViewItem(category: CacheCategory): CategoryViewItem; /** Breakdown rows already carry a resolved tier; pass through. */ export declare function breakdownToViewItem(entry: CategoryBreakdownEntry): CategoryViewItem; /** Colored, text-labelled tier badge e.g. [SAFE] / [MANUAL]. The text label is * the primary signal so the badge still reads under --no-color / screen * readers; color is only a secondary cue. */ export declare function tierBadge(tier: SafetyTier, useColor: boolean): string; export interface CategoryGroup { key: string; label: string; tier?: SafetyTier; items: CategoryViewItem[]; total: number; } /** * Group items by a single axis. Items within a group are sorted largest-first; * tier groups order by safety severity (so the riskiest surface up front), * every other axis orders groups largest-first. */ export declare function groupByAxis(items: CategoryViewItem[], axis: AppCacheGroupAxis): CategoryGroup[]; /** * Single-level grouping by a single axis (or "none" = one flat bucket sorted by * size). Kept for callers/tests that group on one axis; multi-level nesting is * handled by renderCategoryTree. */ export declare function groupCategories(items: CategoryViewItem[], groupBy: AppCacheGroupBy): CategoryGroup[]; /** * Render a grouped, indented tree of categories as lines of text. Pure: returns * strings instead of printing, so clean, categories, and tests all share one * renderer. `groupBy` may be a single axis, "none", or an ordered hierarchy * (e.g. ["tier","kind","app"]) which nests each level. Emoji gated on * emojiMode; color on useColor. */ export declare function renderCategoryTree(items: CategoryViewItem[], options: CategoryViewOptions): string[]; /** * One-line collapsed summary of an app-cache breakdown: total, cache count, * app count, and the largest topN apps inline (sizes are already computed, so * this is free). Used as the default `clean` line so the breakdown is * discoverable without expanding it. */ export declare function summarizeAppCaches(items: CategoryViewItem[], options: { topN: number; useColor: boolean; verboseHint?: boolean; action?: string; }): string; //# sourceMappingURL=categoryView.d.ts.map