UNPKG

@fluido/react-profile-manager

Version:
30 lines (29 loc) 1.15 kB
/// <reference types="react" /> import { FirebaseApp } from 'firebase/app'; import { User } from 'firebase/auth'; declare type FCMTokenStateType = 'loading' | 'error' | 'required' | 'ready'; interface TypedMap<T = any> { [key: string]: T; } export interface ProfileProps { ready: boolean; logged: boolean; user: User | null; token: string | null; FCMToken: string | null; FCMState: FCMTokenStateType | null; claims: TypedMap<string | string[]>; } export interface ProfileManagerProps { firebaseApp: FirebaseApp; refreshTokenTime?: number; pathname?: string; FCMKey?: string; onCallRedirectToPublic?: VoidFunction; onCallRedirectToAuthenticated?: VoidFunction; unauthenticatedRoutes?: string[]; authenticatedRoutes?: string[]; } export declare const useProfile: () => ProfileProps; export default function ProfileProvider({ children, firebaseApp, refreshTokenTime, pathname, FCMKey, onCallRedirectToPublic, onCallRedirectToAuthenticated, unauthenticatedRoutes, authenticatedRoutes, }: React.PropsWithChildren<ProfileManagerProps>): JSX.Element; export {};