import { UserSession } from './userSession';
import { GaiaHubConfig } from '../storage/hub';
export interface UserData {
    username: string;
    email?: string;
    decentralizedID: string;
    identityAddress: string;
    appPrivateKey: string;
    hubUrl: string;
    authResponseToken: string;
    coreSessionToken?: string;
    gaiaAssociationToken?: string;
    associationToken?: string;
    profile: any;
    gaiaHubConfig?: GaiaHubConfig;
}
/**
 * Check if a user is currently signed in.
 * @method isUserSignedIn
 * @return {Boolean} `true` if the user is signed in, `false` if not.
 */
export declare function isUserSignedIn(): boolean;
/**
 * Generates an authentication request and redirects the user to the Blockstack
 * browser to approve the sign in request.
 *
 * Please note that this requires that the web browser properly handles the
 * `blockstack:` URL protocol handler.
 *
 * Most applications should use this
 * method for sign in unless they require more fine grained control over how the
 * authentication request is generated. If your app falls into this category,
 * use `makeAuthRequest` and `redirectToSignInWithAuthRequest` to build your own sign in process.
 *
 * @param {String} [redirectURI=`${window.location.origin}/`]
 * The location to which the identity provider will redirect the user after
 * the user approves sign in.
 * @param  {String} [manifestURI=`${window.location.origin}/manifest.json`]
 * Location of the manifest file.
 * @param  {Array} [scopes=DEFAULT_SCOPE] Defaults to requesting write access to
 * this app's data store.
 * An array of strings indicating which permissions this app is requesting.
 * @return {void}
 */
export declare function redirectToSignIn(redirectURI?: string, manifestURI?: string, scopes?: string[]): void;
/**
 * Check if there is a authentication request that hasn't been handled.
 * Also checks for a protocol echo reply (which if detected then the page
 * will be automatically redirected after this call).
 * @return {Boolean} `true` if there is a pending sign in, otherwise `false`
 */
export declare function isSignInPending(): boolean;
/**
 * Retrieve the authentication token from the URL query
 * @return {String} the authentication token if it exists otherwise `null`
 */
export declare function getAuthResponseToken(): string;
/**
 * Retrieves the user data object. The user's profile is stored in the key `profile`.
 * @return {Object} User data object.
 */
export declare function loadUserData(): UserData;
/**
 * Sign the user out and optionally redirect to given location.
 * @param  redirectURL
 * Location to redirect user to after sign out.
 * Only used in environments with `window` available
 */
export declare function signUserOut(redirectURL?: string, caller?: UserSession): void;
/**
 * Redirects the user to the Blockstack browser to approve the sign in request
 * given.
 *
 * The user is redirected to the `blockstackIDHost` if the `blockstack:`
 * protocol handler is not detected. Please note that the protocol handler detection
 * does not work on all browsers.
 * @param  {String} authRequest - the authentication request generated by `makeAuthRequest`
 * @param  {String} blockstackIDHost - the URL to redirect the user to if the blockstack
 *                                     protocol handler is not detected
 * @return {void}
 */
export declare function redirectToSignInWithAuthRequest(authRequest?: string, blockstackIDHost?: string): void;
/**
 * Try to process any pending sign in request by returning a `Promise` that resolves
 * to the user data object if the sign in succeeds.
 *
 * @param {String} nameLookupURL - the endpoint against which to verify public
 * keys match claimed username
 * @param {String} authResponseToken - the signed authentication response token
 * @param {String} transitKey - the transit private key that corresponds to the transit public key
 * that was provided in the authentication request
 * @return {Promise} that resolves to the user data object if successful and rejects
 * if handling the sign in request fails or there was no pending sign in request.
 */
export declare function handlePendingSignIn(nameLookupURL?: string, authResponseToken?: string, transitKey?: string, caller?: UserSession): Promise<UserData>;
