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.

12 lines (11 loc) 351 B
export interface ResourceState<T> { data: T | null; loading: boolean; error: Error | null; } export declare function jsonRequest<T>(url: string, init?: RequestInit & { csrfToken?: string; }): Promise<T>; export declare function useResource<T>(url: string, csrfToken?: string): ResourceState<T> & { refetch: () => Promise<void>; };