/**
 * Optimistic Mutation Error Classes
 * Defines error types for optimistic UI updates with rollback support
 */
/**
 * Base optimistic error interface
 */
export interface OptimisticError {
    type: "mutation" | "rollback" | "queue" | "network";
    message: string;
    originalData?: unknown;
    rollbackData?: unknown;
    retryable: boolean;
}
/**
 * Mutation error - occurs when the server rejects the mutation
 * Retryable: Depends on error type (network yes, validation no)
 */
export declare class MutationError extends Error implements OptimisticError {
    retryable: boolean;
    originalData?: unknown | undefined;
    rollbackData?: unknown | undefined;
    details?: unknown | undefined;
    type: "mutation";
    constructor(message: string, retryable?: boolean, originalData?: unknown | undefined, rollbackData?: unknown | undefined, details?: unknown | undefined);
}
/**
 * Rollback error - occurs when attempting to rollback optimistic state fails
 * Retryable: No (indicates a serious state corruption issue)
 */
export declare class RollbackError extends Error implements OptimisticError {
    originalData?: unknown | undefined;
    rollbackData?: unknown | undefined;
    details?: unknown | undefined;
    type: "rollback";
    retryable: boolean;
    constructor(message: string, originalData?: unknown | undefined, rollbackData?: unknown | undefined, details?: unknown | undefined);
}
/**
 * Queue error - occurs when action queue operations fail
 * Retryable: Yes (queue operations can be retried)
 */
export declare class QueueError extends Error implements OptimisticError {
    actionId?: string | undefined;
    details?: unknown | undefined;
    type: "queue";
    retryable: boolean;
    constructor(message: string, actionId?: string | undefined, details?: unknown | undefined);
    originalData: undefined;
    rollbackData: undefined;
}
/**
 * Network error for optimistic operations - typically connection issues
 * Retryable: Yes
 */
export declare class OptimisticNetworkError extends Error implements OptimisticError {
    originalData?: unknown | undefined;
    rollbackData?: unknown | undefined;
    details?: unknown | undefined;
    type: "network";
    retryable: boolean;
    constructor(message: string, originalData?: unknown | undefined, rollbackData?: unknown | undefined, details?: unknown | undefined);
}
/**
 * Normalize any error into an OptimisticError
 * Used to convert unknown errors into typed optimistic errors
 *
 * @param error - Any error object
 * @param context - Optional context for rollback (originalData, rollbackData)
 * @returns Normalized OptimisticError
 */
export declare const normalizeOptimisticError: (error: unknown, context?: {
    originalData?: unknown;
    rollbackData?: unknown;
}) => OptimisticError;
/**
 * Check if an error is an OptimisticError
 */
export declare const isOptimisticError: (error: unknown) => error is OptimisticError;
