/**
 * History Service
 *
 * Manages session history and audit logging.
 *
 * @since v1.30.0
 */
import { type ActionDetails, type ActionType, type ExportFormat, type HistoryEntry, type HistoryQuery, type HistoryStore, type RecordOptions, type Session } from './history-types.js';
/**
 * History service for tracking actions and sessions
 */
export declare class HistoryService {
    private store;
    private currentSession;
    private filePath;
    constructor(initialStore?: HistoryStore);
    /**
     * Set the file path for persistence
     */
    setFilePath(path: string): void;
    /**
     * Get the current file path
     */
    getFilePath(): string | null;
    /**
     * Start a new session
     */
    startSession(environment?: string, version?: string): Session;
    /**
     * End the current session
     */
    endSession(): Session | null;
    /**
     * Get the current session
     */
    getCurrentSession(): Session | null;
    /**
     * Check if a session is active
     */
    hasActiveSession(): boolean;
    /**
     * Record an action
     */
    record(action: ActionType, details: ActionDetails, options?: RecordOptions): HistoryEntry;
    /**
     * Record a successful action
     */
    recordSuccess(action: ActionType, details: ActionDetails, duration?: number): HistoryEntry;
    /**
     * Record a failed action
     */
    recordFailure(action: ActionType, details: ActionDetails, error: string, duration?: number): HistoryEntry;
    /**
     * Get recent entries
     */
    getRecentEntries(limit?: number): HistoryEntry[];
    /**
     * Get entries by action type
     */
    getEntriesByAction(action: ActionType): HistoryEntry[];
    /**
     * Get entries for a plugin
     */
    getEntriesByPlugin(pluginName: string): HistoryEntry[];
    /**
     * Get entries for a session
     */
    getEntriesBySession(sessionId: string): HistoryEntry[];
    /**
     * Get entries by date range
     */
    getEntriesByDateRange(startDate: string, endDate: string): HistoryEntry[];
    /**
     * Query entries with filters
     */
    query(options: HistoryQuery): HistoryEntry[];
    /**
     * Get sessions
     */
    getSessions(limit?: number): Session[];
    /**
     * Get a session by ID
     */
    getSession(sessionId: string): Session | null;
    /**
     * Search entries by text
     */
    search(query: string): HistoryEntry[];
    /**
     * Get entry count
     */
    getEntryCount(): number;
    /**
     * Get session count
     */
    getSessionCount(): number;
    /**
     * Get action counts by type
     */
    getActionCounts(): Map<ActionType, number>;
    /**
     * Get success/failure counts
     */
    getSuccessRate(): {
        success: number;
        failure: number;
        rate: number;
    };
    /**
     * Clean up old entries based on retention policy
     */
    cleanup(retentionDays?: number): number;
    /**
     * Enforce maximum entries limit
     */
    private enforceMaxEntries;
    /**
     * Set retention days
     */
    setRetentionDays(days: number): void;
    /**
     * Get retention days
     */
    getRetentionDays(): number;
    /**
     * Export history to specified format
     */
    export(format: ExportFormat): string;
    /**
     * Export as JSON
     */
    private exportJSON;
    /**
     * Export as CSV
     */
    private exportCSV;
    /**
     * Summarize details for display
     */
    private summarizeDetails;
    /**
     * Serialize for persistence
     */
    serialize(): string;
    /**
     * Load from serialized data
     */
    static fromSerialized(data: string): HistoryService;
    /**
     * Get the raw store
     */
    getStore(): HistoryStore;
    /**
     * Reset the service
     */
    reset(): void;
}
/**
 * Get the singleton history service
 */
export declare function getHistoryService(): HistoryService;
/**
 * Reset the singleton
 */
export declare function resetHistoryService(): void;
/**
 * Wrap an operation with history recording
 */
export declare function withHistory<T>(service: HistoryService, action: ActionType, getDetails: (result: T | null) => ActionDetails, operation: () => Promise<T>): Promise<T>;
//# sourceMappingURL=history-service.d.ts.map