import { UseMutateAsyncFunction, QueryObserverResult, RefetchOptions } from '@tanstack/react-query';
import React from 'react';
import { AuthUser } from '../features/auth';
export interface AuthProviderConfig<User extends AuthUser | null | undefined = AuthUser, Error = unknown> {
    key?: string;
    loadUser: (data: any) => Promise<User>;
    loginFn: (data: any) => Promise<User>;
    login2faFn: (data: any) => Promise<User>;
    registerFn: (data: any) => Promise<User>;
    logoutFn: (data: any) => Promise<any>;
    waitInitial?: boolean;
    LoaderComponent?: () => JSX.Element;
    NotLoggedInComponent?: () => JSX.Element;
    NotLoggedInEnabled?: false;
    ErrorComponent?: ({ error }: {
        error: Error | null;
    }) => JSX.Element;
}
export interface AuthContextValue<User extends AuthUser | null | undefined = AuthUser, Error = unknown, LoginCredentials = unknown, Login2faCredentials = unknown, RegisterCredentials = unknown> {
    user: User | undefined;
    login: UseMutateAsyncFunction<User, any, LoginCredentials>;
    login2fa: UseMutateAsyncFunction<User, any, Login2faCredentials>;
    logout: UseMutateAsyncFunction<any, any, void, any>;
    register: UseMutateAsyncFunction<User, any, RegisterCredentials>;
    isLoggingIn: boolean;
    isLoggedIn: boolean;
    isLoggingOut: boolean;
    isRegistering: boolean;
    refetchUser: (options?: RefetchOptions | undefined) => Promise<QueryObserverResult<User, Error>>;
    error: Error | null;
}
export interface AuthProviderProps {
    children: React.ReactNode;
}
export declare function initReactQueryAuth<User extends AuthUser | null | undefined = AuthUser, Error = unknown, LoginCredentials = unknown, Login2faCredentials = unknown, RegisterCredentials = unknown>(config: AuthProviderConfig<User, Error>): {
    AuthProvider: ({ children }: AuthProviderProps) => JSX.Element;
    AuthConsumer: React.Consumer<AuthContextValue<User, Error, LoginCredentials, Login2faCredentials, RegisterCredentials> | null>;
    useAuth: () => AuthContextValue<User, Error, LoginCredentials, Login2faCredentials, RegisterCredentials>;
};
//# sourceMappingURL=AuthProvider.d.ts.map