UNPKG

@adonis-agora/authkit-react

Version:

Frontend ergonomics over AuthKit for AdonisJS + Inertia + React apps: a typed useAuth() hook, role-gating hooks and gating components.

14 lines (13 loc) 515 B
export interface UseCanResult { allowed: boolean; loading: boolean; error?: Error; } export declare const canCache: { resolved: Map<string, boolean>; inflight: Map<string, Promise<boolean>>; clear(): void; }; export declare function invalidateCanCache(): void; export declare function checkCan(path: string, permission: string, resource?: string, csrfToken?: string, principal?: string): Promise<boolean>; export declare function useCan(permission: string, resource?: string): UseCanResult;