import type { Ref } from '@stacksjs/stx'; /** * Create an async computed ref. * * Returns a ref whose value is the result of an asynchronous evaluation function. * Since STX async computations use explicit dependencies, you can * provide an optional array of dependency refs. When any dependency changes, * the evaluation callback is re-run. * * @param evaluationCallback - An async function that returns the computed value * @param initialState - The initial value before the first evaluation completes * @param deps - Optional array of reactive refs to watch for re-evaluation * @returns A ref containing the async computed value * * @example * ```ts * const userId = ref(1) * const user = computedAsync( * async () => { * const response = await fetch(`/api/users/${userId.value}`) * return response.json() * }, * null, * [userId], * ) * ``` */ export declare function computedAsync(evaluationCallback: () => Promise, initialState: T, deps?: Ref[]): Ref;