import { ChatSession, DocumentChunk, UserPreferences } from './types/index.js';
export interface Document {
    id: string;
    filename: string;
    title?: string;
    content?: string;
    fileType?: 'pdf' | 'txt';
    size?: number;
    sessionId?: string;
    uploadedAt: number;
    createdAt?: number;
    metadata?: Record<string, unknown>;
}
export interface User {
    id: string;
    username: string;
    email?: string;
    password_hash: string;
    role: string;
    avatar?: string | null;
    created_at: number;
    updated_at: number;
}
declare class StorageService {
    private useSQLite;
    private sessionsFile;
    private preferencesFile;
    private documentsFile;
    private documentChunksFile;
    constructor();
    createUser(username: string, email: string | undefined, password: string, role?: string): Promise<User>;
    getUser(userId: string): User | undefined;
    getUserByUsername(username: string): User | undefined;
    getAllSessions(userId?: string): ChatSession[];
    getSession(sessionId: string, userId?: string): ChatSession | undefined;
    saveSession(session: ChatSession, userId?: string): void;
    deleteSession(sessionId: string, userId?: string): boolean;
    clearAllSessions(userId?: string): number;
    /**
     * Safely decrypt and parse a preference value with proper error handling
     * Returns null for corrupted data (which will be cleaned up)
     */
    private safeDecryptPreference;
    /**
     * Delete a corrupted preference from the database
     */
    private deleteCorruptedPreference;
    getPreferences(userId?: string): UserPreferences | null;
    savePreferences(preferences: UserPreferences, userId?: string): void;
    getAllDocuments(userId?: string): Document[];
    getDocument(documentId: string, userId?: string): Document | undefined;
    saveDocument(document: Document, userId?: string): void;
    deleteDocument(documentId: string, userId?: string): boolean;
    getDocumentChunks(documentId: string): DocumentChunk[];
    saveDocumentChunks(documentId: string, chunks: DocumentChunk[]): void;
    deleteDocumentChunks(documentId: string): boolean;
}
declare const storageService: StorageService;
export default storageService;
//# sourceMappingURL=storage.d.ts.map