type AdminAccessMethod = 'session' | 'toolbar'; interface SessionUser { id: string; email: string; role?: string; } interface SessionData { authenticated?: boolean; user: SessionUser; } interface UseAdminAccessOptions { /** * 'session' — uses the consumer-supplied `checkSession` function and treats * `role === 'admin' | 'owner'` as admin. Mirrors the laureate-laureate demo. * * 'toolbar' — uses the consumer-supplied `checkToolbarAccess` function which * returns a boolean. Mirrors all the other demos and templates. */ method?: AdminAccessMethod; /** Required when method === 'session' */ checkSession?: () => Promise; /** Required when method === 'toolbar' */ checkToolbarAccess?: () => Promise; } interface UseAdminAccessResult { isAdmin: boolean; ready: boolean; } /** * Centralizes the two existing admin-detection patterns used across the demos * and templates. Returns `isAdmin: false` until the underlying check resolves; * `ready: true` once the resolution completes (whether admin or not). */ declare function useAdminAccess(opts: UseAdminAccessOptions): UseAdminAccessResult; export { type AdminAccessMethod, type SessionData, type SessionUser, type UseAdminAccessOptions, type UseAdminAccessResult, useAdminAccess };