/**
 * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */
import { type ComputedRef, type Ref } from 'vue';
/**
 * A composable that executes an async function and provides the result.
 *
 * @param asyncFunc The async function to execute.
 * @returns The result of the async function.
 * @example
 *
 * ```ts
 * const { loading, data, error } = useAsync( async () => {
 * 	const response = await fetch( 'https://api.example.com/data' );
 * 	return response.json();
 * } );
 * ```
 */
export declare const useAsync: <R>(asyncFunc: () => Promise<R>) => AsyncComposableResult<R>;
/**
 * The result of the `useAsync` composable.
 */
export type AsyncComposableResult<R> = {
    /**
     * Whether the async function is currently loading.
     */
    loading: ComputedRef<boolean>;
    /**
     * 	The data returned by the async function.
     */
    data: Ref<R | null>;
    /**
     * The error thrown by the async function.
     */
    error: Ref<Error | null>;
};
