import { IAuthConfig } from './types/AuthConfig'; import { AuthCredential } from './models/data/AuthCredential'; import { AccountCredential } from './models/data/AccountCredential'; /** * This class deals with authenticating against Twitter API. */ export declare class Auth { /** The HTTPS Agent to use for requests to Twitter API. */ private readonly httpsAgent; /** The order in which the login subtasks must be executed. */ private subtasks; /** * @param config - The config object. */ constructor(config?: IAuthConfig); /** * @param subtask - The name of the subtask. * @param flowToken - The flow token for the subtask. * @param accCred - The account credentials to the Twitter account. * * @returns The appropriate payload for the given subtask. */ private getSubtaskPayload; /** * Executes the given login subtask. * * @param url - The URL against which the subtask is to be executed. * @param payload - The payload to be sent. * * @returns The response received from executing the subtask. */ private executeSubtask; /** * Parses the incoming authentication error from Twitter API into a simplified message. * * @param error - The incoming error. * @param flowName - The flow that was executed, which raised this error. * * @returns The simplified error message. */ private parseAuthError; /** * @returns A new 'guest' credential. */ getGuestCredential(): Promise; /** * @param accCred - The credentials (email, username and password) to the Twitter account. * * @returns The 'user' credentials for the given Twitter account. */ getUserCredential(accCred: AccountCredential): Promise; }