/** * Pure logic of the ledger (growth record) view: the time-window filter and * report options the view asks the controller for, the archive-style * timestamp parts, the one-line payload summary of one event, and the report * file name for the Markdown download. DOM-free so it is unit-testable. * @module dsh-client-ui-mimir/client/ledger-view */ import type { EventRecord, LedgerActorKind, ResearchEventFilter, ResearchProgressReportOptions } from 'dsh-mimir/types'; /** One selectable time window of the ledger view. */ export type LedgerWindow = '7d' | '30d' | '90d' | 'all'; /** The time windows in the control row's order. */ export declare const LEDGER_WINDOWS: readonly LedgerWindow[]; /** The ledger view's event cap (the list's newest-first window). */ export declare const LEDGER_LIST_LIMIT = 200; /** Days covered by one window; `all` means no lower bound. */ export declare function windowDays(window: LedgerWindow): number | null; /** * The `listEvents` filter of one window + scope: ISO bounds (`since` * inclusive, `until` exclusive = now), the project scope when one is * selected, newest first, capped. * @param window - the selected time window. * @param projectId - the project scope, or null for all projects. * @param nowMs - the wall clock (injectable for tests). * @returns the filter for one `listEvents` call. */ export declare function ledgerWindowFilter(window: LedgerWindow, projectId: string | null, nowMs: number): ResearchEventFilter; /** * The `generateProgressReport` options of one window + scope: the same ISO * bounds and project filter as {@link ledgerWindowFilter}, without the list * fields the report does not take. * @param window - the selected time window. * @param projectId - the project scope, or null for all projects. * @param nowMs - the wall clock (injectable for tests). * @returns the options for one `generateProgressReport` call. */ export declare function reportWindowOptions(window: LedgerWindow, projectId: string | null, nowMs: number): ResearchProgressReportOptions; /** The archive-microtext timestamp of one event (local time, compact). */ export interface LedgerTimeParts { /** `08-24`, or `2026-08-24` when the event is outside the current year. */ readonly date: string; /** `14:32` (local time). */ readonly time: string; /** Whether the date part includes the year. */ readonly hasYear: boolean; } /** * Parse one ISO timestamp into the timeline's two-line microtext form. An * unparseable timestamp yields empty parts (the row falls back to raw text). * @param iso - the event's ISO-8601 timestamp. * @param nowMs - the wall clock for the year-omission rule (injectable). * @returns the date/time parts, or null when the timestamp is invalid. */ export declare function ledgerTimeParts(iso: string, nowMs: number): LedgerTimeParts | null; /** * The one-line summary of an event's payload: up to three `key=value` pairs * from the priority keys (or, when none match, the first scalar fields in * insertion order). Arrays and nulls are skipped — the row stays one quiet * line, the full payload stays on the event. * @param event - the ledger event to summarize. * @returns the summary line, or '' when the payload carries no scalars. */ export declare function ledgerPayloadLine(event: Pick): string; /** Whether one event is marked destructive in its payload. */ export declare function ledgerIsDestructive(event: Pick): boolean; /** Locale key of one actor kind label. */ export declare const ACTOR_KEYS: Record; /** * The Markdown download file name of one report: dated from the report's * `generatedAt` (falling back to now), so a week of reports keep separate * files. * @param generatedAt - the report's ISO timestamp, or null before one settles. * @param nowMs - the wall clock fallback (injectable for tests). * @returns e.g. `mimir-progress-2026-08-24.md`. */ export declare function reportFileName(generatedAt: string | null, nowMs: number): string; //# sourceMappingURL=ledger-view.d.ts.map