import type { DataState, RequestConfig } from '@sisense/sdk-ui-preact'; import { type ToRefs } from 'vue'; import type { MaybeRef, MaybeRefOrWithRefs } from '../types'; /** * The options for the `useFetch` composable function. */ export type UseFetchOptions = { /** The request configuration object. */ requestConfig?: RequestConfig; /** A boolean indicating whether the fetch operation is enabled. */ enabled?: boolean; }; /** * A Vue composable function `useFetch` that allows to make authorized fetch request to any Sisense API. * * @param path - The endpoint path to fetch data from. This should be a relative path like '/api/v1/endpoint' * @param init - The request init object * @param options - The additional request options * * @example * How to use `useFetch` within a Vue component to fetch and display widget information: * ```vue * * ``` * * The composable returns an object with reactive properties that represent the state of the data fetch operation: * - `data`: The fetched data, which is `undefined` until the operation is successfully completed. * - `isLoading`: A boolean indicating whether the fetch operation is currently in progress. * - `isError`: A boolean indicating whether an error occurred during the fetch operation. * - `isSuccess`: A boolean indicating whether the fetch operation was successfully completed without any errors. * - `error`: An error object containing details about any errors that occurred during the fetch operation. * * @group Fusion Assets * @fusionEmbed */ export declare const useFetch: (path: MaybeRef, init?: MaybeRefOrWithRefs, options?: MaybeRefOrWithRefs) => ToRefs>;