interface State { isLoading: boolean; permissions?: Permissions; error?: Error; } /** * Hook for getting user permissions * * Calls the authProvider.getPermissions() method asynchronously. * If the authProvider returns a rejected promise, returns empty permissions. * * The return value updates according to the request state: * * - start: { isLoading: true } * - success: { permissions: [any], isLoading: false } * - error: { error: [error from provider], isLoading: false } * * Useful to enable features based on user permissions * * @param {Object} params Any params you want to pass to the authProvider * * @returns The current auth check state. Destructure as { permissions, error, isLoading }. * * @example * import { usePermissions } from 'react-admin'; * * const PostDetail = props => { * const { isLoading, permissions } = usePermissions(); * if (!isLoading && permissions == 'editor') { * return * } else { * return * } * }; */ declare const usePermissions: (params?: {}) => State; export default usePermissions; //# sourceMappingURL=usePermissions.d.ts.map