/** * useStats Hook * * Manages plugin statistics state and data loading. * * @since v1.23.0 */ import { type HealthFactors, type PluginStats, type RecentError, type ServerStats, type SourceStats, type StatsService, type UpdateEvent } from '../../core/stats/index.js'; import type { PluginSourceType } from '../../core/types/index.js'; /** * Stats state returned by the hook */ export interface StatsState { /** Server-wide statistics */ serverStats: ServerStats; /** Per-source statistics */ sourceStats: SourceStats[]; /** All plugin statistics */ pluginStats: PluginStats[]; /** Recent update events */ recentUpdates: Array; /** Recent errors */ recentErrors: RecentError[]; /** Health score breakdown */ healthFactors: HealthFactors; /** Whether data is loading */ loading: boolean; /** Error message if any */ error: string | null; /** Reload statistics */ reload: () => Promise; /** Record an update check */ recordCheck: (pluginName: string, source: PluginSourceType, responseTimeMs?: number) => Promise; /** Record an update download */ recordDownload: (pluginName: string, event: Omit) => Promise; /** Record an error */ recordError: (pluginName: string, error: string) => Promise; /** Update server stats */ updateServerStats: (stats: Partial) => Promise; } /** * Hook for managing plugin statistics */ export declare function useStats(statsService?: StatsService): StatsState; //# sourceMappingURL=useStats.d.ts.map