@refinedev/core
Version:
Refine is a React meta-framework for building enterprise-level, data-intensive applications rapidly with support for modern UI libraries and headless integrations.
20 lines • 1.26 kB
Source Map (JSON)
import { type UseQueryOptions, type UseQueryResult } from "@tanstack/react-query";
import type { CanParams, CanReturnType } from "../../../contexts/accessControl/types";
export type UseCanProps = CanParams & {
/**
* TansSack Query's [useQuery](https://tanstack.com/query/latest/docs/framework/react/reference/useQuery) options
*/
queryOptions?: Omit<UseQueryOptions<CanReturnType>, "queryKey"> & {
queryKey?: UseQueryOptions<CanReturnType>["queryKey"];
};
};
/**
* `useCan` uses the `can` as the query function for `react-query`'s {@link https://tanstack.com/query/v5/docs/framework/react/guides/queries `useQuery`}. It takes the parameters that `can` takes. It can also be configured with `queryOptions` for `useQuery`. Returns the result of `useQuery`.
* @see {@link https://refine.dev/docs/api-reference/core/hooks/accessControl/useCan} for more details.
*
* @typeParam CanParams {@link https://refine.dev/docs/core/interfaceReferences#canparams}
* @typeParam CanReturnType {@link https://refine.dev/docs/core/interfaceReferences#canreturntype}
*
*/
export declare const useCan: ({ action, resource, params, queryOptions: hookQueryOptions, }: UseCanProps) => UseQueryResult<CanReturnType>;
//# sourceMappingURL=index.d.ts.map