/** * Storage statistics queries for the dashboard diagnostics endpoint. */ import { CoalesceCache } from './coalesce_cache.js'; import type { Knex } from 'knex'; /** * Get the file sizes of the SQLite database and its WAL file. */ export declare function getFileSizes(dbFilePath: string): Promise<[number, number]>; /** * Count rows in all dashboard tables within a single transaction. */ export declare function countAllTables(db: Knex): Promise>; export interface StorageStatsResult { ready: boolean; dbPath: string; fileSizeMb: number; walSizeMb: number; retentionDays: number; /** Configured live-data size cap in MB; `0` means the cap is disabled. */ maxDbSizeMb: number; tables: Array<{ name: string; rowCount: number; }>; lastCleanupAt: number | null; } /** The not-ready result returned before the SQLite connection exists. */ export declare function emptyStorageStats(dbPath: string, retentionDays: number, maxDbSizeMb: number): StorageStatsResult; export interface StorageStatsOpts { db: Knex; cache: CoalesceCache; dbFilePath: string; dbPath: string; retentionDays: number; maxDbSizeMb: number; lastCleanupAt: number | null; onResult: (stats: StorageStatsResult) => void; } /** * Build storage stats by querying file sizes and table row counts. */ export declare function fetchStorageStats(opts: StorageStatsOpts): Promise;