import { JSONObject, XID } from '../types';
export type StorageType = 'localStorage' | 'sessionStorage' | 'memoryStorage';
export interface StorageItem<T = any> {
    value: T;
    timestamp: number;
    expires?: number;
    version?: string;
}
export interface StorageConfig {
    type: StorageType;
    prefix: string;
    encryption?: boolean;
    compression?: boolean;
    ttl?: number;
}
export interface StorageEvent<T = any> {
    key: string;
    oldValue: T | null;
    newValue: T | null;
    timestamp: number;
}
export interface StorageAdapter {
    get<T = any>(key: string): T | null;
    set<T = any>(key: string, value: T, options?: {
        ttl?: number;
    }): void;
    remove(key: string): void;
    clear(): void;
    keys(): string[];
    size(): number;
    exists(key: string): boolean;
}
export declare class StorageManager implements StorageAdapter {
    private storage;
    private config;
    private eventListeners;
    constructor(config?: Partial<StorageConfig>);
    private createKey;
    private handleStorageChange;
    private serialize;
    private deserialize;
    private compress;
    private decompress;
    private encrypt;
    private decrypt;
    private emitEvent;
    get<T = any>(key: string): T | null;
    set<T = any>(key: string, value: T, options?: {
        ttl?: number;
    }): void;
    remove(key: string): void;
    clear(): void;
    keys(): string[];
    size(): number;
    exists(key: string): boolean;
    on(key: string, listener: (event: StorageEvent) => void): () => void;
    off(key: string, listener: (event: StorageEvent) => void): void;
    getObject<T extends JSONObject>(key: string): T | null;
    setObject<T extends JSONObject>(key: string, value: T, options?: {
        ttl?: number;
    }): void;
    getString(key: string): string | null;
    setString(key: string, value: string, options?: {
        ttl?: number;
    }): void;
    getNumber(key: string): number | null;
    setNumber(key: string, value: number, options?: {
        ttl?: number;
    }): void;
    getBoolean(key: string): boolean | null;
    setBoolean(key: string, value: boolean, options?: {
        ttl?: number;
    }): void;
    setMultiple(items: Record<string, any>, options?: {
        ttl?: number;
    }): void;
    getMultiple<T = any>(keys: string[]): Record<string, T | null>;
    removeMultiple(keys: string[]): void;
    cleanup(): number;
    export(): Record<string, any>;
    import(data: Record<string, any>, options?: {
        ttl?: number;
        merge?: boolean;
    }): void;
}
export declare const defaultStorage: StorageManager;
export declare const sessionStorage: StorageManager;
export declare const memoryStorage: StorageManager;
export declare const createStorageKey: (key: string, organizationId?: XID) => string;
export declare const parseStorageKey: (storageKey: string) => {
    key: string;
    organizationId?: XID;
};
export declare const isStorageAvailable: (type: StorageType) => boolean;
export declare const getStorageSize: (type: StorageType) => number;
export declare const clearExpiredItems: (storage: StorageManager) => number;
export declare const createStorageHook: (storage: StorageManager) => <T>(key: string, defaultValue?: T) => [T | null, (value: T | null) => void];
export declare const AuthStorage: {
    getAccessToken(): string | null;
    setAccessToken(token: string, ttl?: number): void;
    removeAccessToken(): void;
    getRefreshToken(): string | null;
    setRefreshToken(token: string): void;
    removeRefreshToken(): void;
    getSessionId(): XID | null;
    setSessionId(sessionId: XID): void;
    removeSessionId(): void;
    getUserData(): any | null;
    setUserData(userData: any): void;
    removeUserData(): void;
    getOrganizationId(): XID | null;
    setOrganizationId(organizationId: XID): void;
    removeOrganizationId(): void;
    clearAll(): void;
    getDeviceFingerprint(): string | null;
    setDeviceFingerprint(fingerprint: string): void;
    getRememberMe(): boolean;
    setRememberMe(remember: boolean): void;
};
//# sourceMappingURL=storage.d.ts.map