import { OAuthClient, OAuthTokens } from './shortcode';
import { IRequester } from './util';
/**
 * IUser is the minimal user structure stored in the profile.
 */
export interface IUser {
    id: number;
    username: string;
    channel: number;
}
/**
 * IGrantNotifier prompts the user to enter the granting code.
 */
export interface IGrantNotifier {
    /**
     * Tells the user to enter the code on mixer.com/go
     */
    prompt(code: string): void;
    /**
     * Whether we should cancel lookup up the code.
     */
    isCancelled(): boolean;
}
/**
 * Thrown once the GrantNotifier says the the grant is cancelled,
 * in Profile.grant().
 */
export declare class GrantCancelledError extends Error {
}
/**
 * Profile represents a user profile for miix, stored in the .miixrc file.
 */
export declare class Profile {
    readonly file: string;
    private readonly oauthClient;
    private readonly requester;
    private readonly host;
    static necessaryScopes: string[];
    private tokensObj;
    private profile;
    private readonly hostProfile;
    constructor(file: string, oauthClient?: OAuthClient, requester?: IRequester, host?: string);
    /**
     * Returns valid OAuth tokens for the session. It will prompt the user to
     * grant access if the tokens don't exist or are expired.
     */
    tokens(): Promise<OAuthTokens>;
    /**
     * Returns data about the currently authenticated user.
     */
    user(): Promise<IUser>;
    /**
     * Returns whether the user currently has valid credentials.
     */
    hasAuthenticated(): Promise<boolean>;
    /**
     * Logs out of the current session, if the user is authenticated.
     */
    logout(): Promise<void>;
    /**
     * Prompts the user to grant the tokens anew, and saves the profile.
     */
    grant(notifier: IGrantNotifier): Promise<OAuthTokens>;
    /**
     * Ensures that the profile exists and has valid grants.
     */
    private ensureProfile();
    /**
     * Persists the saved tokens to disk.
     */
    private save();
    /**
     * Refreshes the token grants and saves the profile.
     */
    private refresh();
    /**
     * Attempts to load existing data from the profile file, returning whether
     * it was able to do so successfully.
     */
    private tryLoadFile();
}
