/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ 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: (asyncFunc: () => Promise) => AsyncComposableResult; /** * The result of the `useAsync` composable. */ export type AsyncComposableResult = { /** * Whether the async function is currently loading. */ loading: ComputedRef; /** * The data returned by the async function. */ data: Ref; /** * The error thrown by the async function. */ error: Ref; };