import { IRettiwtConfig } from '../../types/RettiwtConfig'; import { FetcherService } from './FetcherService'; /** * The services that handles authentication. * * @public */ export declare class AuthService extends FetcherService { /** * @param config - The config object for configuring the `Rettiwt` instance. * * @internal */ constructor(config?: IRettiwtConfig); /** * Decodes the encoded cookie string. * * @param encodedCookies - The encoded cookie string to decode. * @returns The decoded cookie string. */ static decodeCookie(encodedCookies: string): string; /** * Encodes the given cookie string. * * @param cookieString - The cookie string to encode. * @returns The encoded cookie string. */ static encodeCookie(cookieString: string): string; /** * Gets the user's id from the given API key. * * @param apiKey - The API key. * @returns The user id associated with the API key. */ static getUserId(apiKey: string): string; /** * Login to twitter as guest. * * @returns A new guest key. * * @example * ``` * import { Rettiwt } from 'rettiwt-api'; * * // Creating a new Rettiwt instance * const rettiwt = new Rettiwt(); * * // Logging in an getting a new guest key * rettiwt.auth.guest() * .then(guestKey => { * // Use the guest key * ... * }) * .catch(err => { * console.log(err); * }); * ``` */ guest(): Promise; /** * Login to twitter using account credentials. * * @param email - The email id associated with the Twitter account. * @param userName - The username associated with the Twitter account. * @param password - The password to the Twitter account. * * @returns The `API_KEY` for the Twitter account. * * @example * ``` * import { Rettiwt } from 'rettiwt-api'; * * // Creating a new Rettiwt instance * const rettiwt = new Rettiwt(); * * // Logging in an getting the API_KEY * rettiwt.auth.login("email@domain.com", "username", "password") * .then(apiKey => { * // Use the API_KEY * ... * }) * .catch(err => { * console.log(err); * }); * ``` * * @remarks * Interchanging `email` and `userName` works too. */ login(email: string, userName: string, password: string): Promise; }