/**
 * Action Queue for Offline Support
 * Manages queued mutations when the user is offline
 */
/**
 * Queued action interface
 */
export interface QueuedAction<T = unknown> {
    /** Unique identifier for the action */
    id: string;
    /** Function to execute when online */
    action: () => Promise<T>;
    /** Timestamp when action was queued */
    timestamp: number;
    /** Number of retry attempts */
    retryCount: number;
    /** Maximum retry attempts */
    maxRetries: number;
    /** Optional metadata for display */
    metadata?: {
        label?: string;
        description?: string;
    };
}
/**
 * Configuration options for ActionQueue
 */
export interface ActionQueueOptions {
    /** Maximum number of retry attempts (default: 3) */
    maxRetries?: number;
    /** Key for localStorage persistence (default: 'flikkui-action-queue') */
    storageKey?: string;
    /** Whether to persist queue to localStorage (default: true) */
    persist?: boolean;
    /** Called when an action is processed successfully */
    onActionSuccess?: <T>(action: QueuedAction<T>, result: T) => void;
    /** Called when an action fails after all retries */
    onActionFailed?: <T>(action: QueuedAction<T>, error: Error) => void;
    /** Called when queue changes */
    onQueueChange?: (queue: QueuedAction[]) => void;
}
/**
 * Options for adding an action to the queue
 */
export interface AddActionOptions {
    /** Maximum retry attempts for this specific action */
    maxRetries?: number;
    /** Label for the action (shown in OfflineIndicator) */
    label?: string;
    /** Description for the action */
    description?: string;
}
/**
 * ActionQueue class for managing offline mutations
 */
export declare class ActionQueue {
    private queue;
    private isProcessing;
    private options;
    constructor(options?: ActionQueueOptions);
    /**
     * Generate a unique ID for an action
     */
    private generateId;
    /**
     * Save queue to localStorage
     */
    private saveToStorage;
    /**
     * Load queue from localStorage
     * Note: Actions (functions) cannot be persisted, only metadata
     */
    private loadFromStorage;
    /**
     * Notify listeners of queue changes
     */
    private notifyChange;
    /**
     * Add an action to the queue
     * @returns The action ID
     */
    add<T>(action: () => Promise<T>, options?: AddActionOptions): string;
    /**
     * Remove an action from the queue
     */
    remove(id: string): boolean;
    /**
     * Get all queued actions
     */
    getAll(): QueuedAction[];
    /**
     * Get the number of queued actions
     */
    get size(): number;
    /**
     * Check if queue is currently processing
     */
    get processing(): boolean;
    /**
     * Clear all queued actions
     */
    clear(): void;
    /**
     * Process all queued actions
     * Call this when the user comes back online
     */
    process(): Promise<void>;
}
/**
 * Create an ActionQueue instance
 */
export declare const createActionQueue: (options?: ActionQueueOptions) => ActionQueue;
export declare const getDefaultQueue: () => ActionQueue;
