import type { As, Component, Props, Options } from 'ariakit-react-utils';
import React, { Fragment } from 'react';
import { KeyringContextState, KeyringContextActions } from './providers/Keyring';
export type AuthenticatorContextState = KeyringContextState & {
    /**
     * email to be used to "log in"
     */
    email?: string;
    /**
     * has the authentication form been submitted?
     */
    submitted: boolean;
    /**
     * A callback that can be passed to an `onSubmit` handler to
     * register a new space or log in using `email`
     */
    handleRegisterSubmit?: (e: React.FormEvent<HTMLFormElement>) => Promise<void>;
};
export type AuthenticatorContextActions = KeyringContextActions & {
    /**
     * Set an email to be used to log in or register.
     */
    setEmail: React.Dispatch<React.SetStateAction<string>>;
};
export type AuthenticatorContextValue = [
    state: AuthenticatorContextState,
    actions: AuthenticatorContextActions
];
export declare const AuthenticatorContext: React.Context<AuthenticatorContextValue>;
export declare const AgentLoader: ({ children }: {
    children: JSX.Element;
}) => JSX.Element;
export type AuthenticatorRootOptions<T extends As = typeof Fragment> = Options<T>;
export type AuthenticatorRootProps<T extends As = typeof Fragment> = Props<AuthenticatorRootOptions<T>>;
/**
 * Top level component of the headless Authenticator.
 *
 * Must be used inside a KeyringProvider.
 *
 * Designed to be used by Authenticator.Form, Authenticator.EmailInput
 * and others to make it easy to implement authentication UI.
 */
export declare const AuthenticatorRoot: Component<AuthenticatorRootProps>;
export type FormOptions<T extends As = 'form'> = Options<T>;
export type FormProps<T extends As = 'form'> = Props<FormOptions<T>>;
/**
 * Form component for the headless Authenticator.
 *
 * A `form` designed to work with `Authenticator`. Any passed props will
 * be passed along to the `form` component.
 */
export declare const Form: Component<FormProps>;
export type EmailInputOptions<T extends As = 'input'> = Options<T>;
export type EmailInputProps<T extends As = 'input'> = Props<EmailInputOptions<T>>;
/**
 * Input component for the headless Uploader.
 *
 * An email `input` designed to work with `Authenticator.Form`. Any passed props will
 * be passed along to the `input` component.
 */
export declare const EmailInput: Component<EmailInputProps>;
export type CancelButtonOptions<T extends As = 'button'> = Options<T>;
export type CancelButtonProps<T extends As = 'button'> = Props<CancelButtonOptions<T>>;
/**
 * A button that will cancel space registration.
 *
 * A `button` designed to work with `Authenticator.Form`. Any passed props will
 * be passed along to the `button` component.
 */
export declare const CancelButton: Component<CancelButtonProps>;
/**
 * Use the scoped authenticator context state from a parent `Authenticator`.
 */
export declare function useAuthenticator(): AuthenticatorContextValue;
export declare const Authenticator: Component<AuthenticatorRootProps<React.ExoticComponent<{
    children?: React.ReactNode;
}>>> & {
    Form: Component<FormProps<"form">>;
    EmailInput: Component<EmailInputProps<"input">>;
    CancelButton: Component<CancelButtonProps<"button">>;
};
