/** * Notification Store * * Persists toast notifications to disk for history viewing. * Data stored in ~/.pluginator/notifications.json * * ## Design note: sync + swallow is intentional * * Unlike PluginManager / RegistryService / SourcesService (which use async+throw * convergence), NotificationStore deliberately uses sync I/O with swallowed errors: * * - It is accessed from React render paths (useNotifications, NotificationHistoryView) * where async getters would cascade re-renders or require effect-based loading. * - Notifications are non-critical UI metadata. A corrupt or missing notifications.json * must NOT crash the UI or block higher-priority operations. * - `writeFileAtomicSync` provides durable writes; transient failures are logged-as-debug * and dropped because the next save will retry the full state. * * If you find yourself wanting async+throw semantics here, reconsider whether the call * site really needs them — the alternative is converging the entire UI render tree to * deferred loading, which is a much larger surface change. * * Tracked in the v2.11 service-lifecycle convergence audit; deliberately kept as-is. * * @since v2.9.1 */ import type { NotificationFilter, NotificationRecord } from './notification-types.js'; export declare class NotificationStore { private records; private storePath; private loaded; constructor(storePath?: string); /** Load records from disk */ load(): void; /** Add a notification to the store and persist */ add(type: NotificationRecord['type'], message: string, source?: string): void; /** Get notifications, newest first, with optional filtering */ getAll(filter?: NotificationFilter): NotificationRecord[]; /** Remove notifications older than MAX_AGE_MS. Returns count removed. */ prune(): number; /** Clear all notifications */ clear(): void; /** Get total count */ count(): number; private save; } export declare function getNotificationStore(): NotificationStore; export declare function resetNotificationStore(): void; //# sourceMappingURL=notification-store.d.ts.map