/** * Represents a single comparative year entry within a year range. * * Each entry defines what "Set A" and "Set B" are for a comparative definition: * - Bounded: year vs year-1 (e.g., 2026 vs 2025) * - Unbounded: year vs all prior records (e.g., 2023 vs Prior) */ export type ComparativeYearEntry = { /** The target year (Set A: records created in this year) */ readonly year: number; /** When true, Set B is "all records before year" instead of "year - 1" */ readonly unbounded: boolean; }; /** * A resolved year range for comparative profiling definitions. * * Contains the ordered list of comparative year entries derived from user input * (flags like --year, --depth, --from, --to, --use-prior). * * Default behavior: * - comparative method: depth=1 (current year only) * - full method: depth=3 (current year + 2 prior years) * - --use-prior replaces the last entry with an unbounded comparison */ export type YearRange = { /** Ordered list of comparative years (most recent first) */ readonly entries: readonly ComparativeYearEntry[]; }; /** * Raw flag inputs for year range resolution. * Mirrors the CLI flags before validation and resolution. */ export type YearRangeInput = { /** Single year or comma-delimited years (e.g., 2026 or "2026,2025,2024") */ year?: number | number[]; /** Number of years to include (counting back from year) */ depth?: number; /** Start year of explicit range (inclusive) */ from?: number; /** End year of explicit range (inclusive) */ to?: number; /** Replace last comparison with unbounded "vs Prior" */ usePrior?: boolean; /** Profiling method — determines default depth */ method?: 'metadata' | 'historical' | 'comparative' | 'recordtype' | 'outcome' | 'full'; }; /** * Resolves CLI flag inputs into a validated YearRange. * * Resolution priority: * 1. --from/--to: explicit range (inclusive, most recent first) * 2. --year (array): comma-delimited years * 3. --year + --depth: single year with lookback depth * 4. --year alone: single year with method-default depth * 5. No flags: current year with method-default depth * * @param input - Raw flag inputs * @returns Resolved YearRange * @throws Error if inputs are invalid or conflicting */ export declare function resolveYearRange(input?: YearRangeInput): YearRange; /** * Returns the default depth for a given profiling method. * * - comparative: 1 (current year only) * - outcome: 1 (no year dimension — uses filterJson) * - full: 3 (current year + 2 prior) * - recordtype: 3 (same as full) */ export declare function getDefaultDepth(method: string): number; /** * Formats a ComparativeYearEntry as a human-readable string. * * @example * formatYearEntry({ year: 2026, unbounded: false }) // "2026 vs 2025" * formatYearEntry({ year: 2023, unbounded: true }) // "2023 vs Prior" */ export declare function formatYearEntry(entry: ComparativeYearEntry): string;