/**
 * useAsyncOperation Hook
 *
 * Generic hook for managing async operation state (loading, error)
 * Consolidates repeated try-catch patterns across hooks
 */
export interface AsyncOperationState {
    loading: boolean;
    error: string | null;
}
export interface UseAsyncOperationReturn<T> extends AsyncOperationState {
    execute: (operation: () => Promise<T>, errorMessage?: string) => Promise<T | undefined>;
    clearError: () => void;
    setLoading: (loading: boolean) => void;
    setError: (error: string | null) => void;
}
/**
 * Hook for managing async operation state
 *
 * @param defaultErrorMessage - Default error message when error is not an Error instance
 * @returns State and methods for managing async operations
 *
 * @example
 * ```tsx
 * const { loading, error, execute } = useAsyncOperation<Plugin[]>('Failed to load plugins');
 *
 * const loadPlugins = useCallback(async () => {
 *   const result = await execute(async () => {
 *     return await fetchPlugins();
 *   });
 *   if (result) {
 *     setPlugins(result);
 *   }
 * }, [execute]);
 * ```
 */
export declare function useAsyncOperation<T>(defaultErrorMessage?: string): UseAsyncOperationReturn<T>;
//# sourceMappingURL=useAsyncOperation.d.ts.map