import * as React from 'react'; import React__default, { PropsWithChildren } from 'react'; import { AxiosError } from 'axios'; import { FirebaseApp } from 'firebase/app'; import { User } from 'firebase/auth'; import * as _firebase_auth from '@firebase/auth'; declare const Footer: React__default.FC; interface HeaderProps { children: React__default.ReactNode[] | React__default.ReactNode; rightItem?: React__default.ReactNode[] | React__default.ReactNode; rightItemMobile?: React__default.ReactNode[] | React__default.ReactNode; } declare const Header: React__default.FC; interface HeaderItemProps extends React__default.ComponentProps<"div"> { } declare const HeaderItem: React__default.FC>; interface ErrorScreenProps { error: Error | undefined; } declare const ErrorScreen: React.FC; declare const NotFoundScreen: React.FC; declare const LoadingScreen: React__default.FC; interface SearchableTableColumn { key: React__default.Key; header: React__default.ReactNode; accessor: (row: any) => React__default.ReactNode; } interface SearchableTableProps { title: string; data?: any[]; columns: SearchableTableColumn[]; searchText: string; onSearchTextChange: React__default.ChangeEventHandler; onPreviousClicked?: () => void; onNextClicked?: () => void; /** Offset number for results */ offset?: number; /** Total number of results */ total?: number; } declare const SearchableTable: React__default.FC; declare enum Service { USERS = "USERS", HEXATHONS = "HEXATHONS", NOTIFICATIONS = "NOTIFICATIONS", REGISTRATION = "REGISTRATION", FILES = "FILES", AUTH = "AUTH", EXPO = "EXPO", HARDWARE = "HARDWARE", FINANCE = "FINANCE" } /** * Gets the request URL for a given service and path based on the api environment. * This is used to query the development or production API. * @param service The service to get the URL for * @param path The relative path URl for the service * @returns The complete request URL */ declare const apiUrl: (service: Service, path: string) => string; /** * Handles displaying an error message to the user when making an axios request. * It will handle normal and axios errors appropriately by displaying a toast message * and logging the error to the console. * @param error the error to handle */ declare const handleAxiosError: (error: Error | AxiosError) => void; /** * This is the main login hook that logs a user into an application. It takes * in the Firebase app and retrieves a custom token from the api auth service. It * also handles a callback from the login frontend through the idToken search * parameter. * @param app the Firebase app to use for authentication * @returns an array with the first element being a boolean if the user status * is current loading, and another boolean if the user is logged in or not */ declare const useLogin: (app: FirebaseApp) => [loading: boolean, loggedIn: boolean]; declare const AuthContext: React__default.Context<{ user: User | null; loading: boolean; }>; interface AuthProviderProps { app: FirebaseApp; } /** * Main auth provider that handles the user state and loading state. It subscribes * to a Firebase auth observer that will update the current user value on login/logout. * Use this provider to provide user state to the rest of the application. * @param app the Firebase app to use for authentication * @returns the auth provider */ declare const AuthProvider: React__default.FC>; /** * This hook providers the current user's authentication state and loading state. * It will update when user logs in or out depending on their Firebase auth state. * @returns an object with the current user data (if logged in) and a boolean * denoting the loading state */ declare const useAuth: () => { user: _firebase_auth.User | null; loading: boolean; }; export { AuthContext, AuthProvider, ErrorScreen, Footer, Header, HeaderItem, LoadingScreen, NotFoundScreen, SearchableTable, Service, apiUrl, handleAxiosError, useAuth, useLogin };