import { type ComputedRef, type Ref } from "vue"; import type { FetchStatus, Nullable, ResponseBody } from "../typings/common"; import type { Scopes } from "../typings/user"; export type ResourceRef = { data: Ref; meta: Ref; loading: ComputedRef; errorMessage: Ref>; /** * Holds whatever was thrown, so `unknown` would be the accurate type. * Exported hooks downstream re-declare it as `Ref>`, * so narrowing it is a major-release change. */ error: Ref; status: Ref; }; export type ResourceHookReturnType = [ RequestParams extends undefined ? () => Promise : (params: RequestParams) => Promise, ResourceRef ]; export declare function useResource(params: { fetchResource: RequestParams extends undefined ? () => Promise> : (params: RequestParams) => Promise>; initialValue: Data; resourceName?: string | undefined; scopes?: Scopes; }): ResourceHookReturnType;