/** * useAsyncOperation Hook * * Eliminates duplicate async error handling patterns across hooks. * Handles isMountedRef + try-catch-finally + loading/error state management. * * Based on the useAsyncData pattern from useDeviceInfo.ts but generalized * for broader use cases. * * @example * ```typescript * // Simple usage (like useAsyncData) * const { data, isLoading, error, execute } = useAsyncOperation( * async () => await fetchData(), * { immediate: true } * ); * * // Manual execution (like useMedia) * const { execute, isLoading, error } = useAsyncOperation( * async (uri: string) => await pickImage(uri), * { immediate: false } * ); * const result = await execute('file://...'); * * // With custom error handling * const { data, error } = useAsyncOperation( * async () => await riskyOperation(), * { * errorHandler: (err) => err instanceof Error ? err.message : 'Failed', * onError: (err) => console.error('Operation failed:', err), * } * ); * ``` */ import type { AsyncOperationOptions, AsyncOperationReturn } from './types/AsyncOperationTypes'; export declare function useAsyncOperation(operation: (...args: any[]) => Promise, options?: AsyncOperationOptions): AsyncOperationReturn;