import { AuthenticationType } from '../../enums/Authentication'; import { IAuthCookie } from '../../types/auth/AuthCookie'; import { IAuthCredential } from '../../types/auth/AuthCredential'; import { BrowserRettiwtConfig } from '../config/BrowserRettiwtConfig'; /** * Browser-compatible AuthCredential that doesn't depend on cookiejar. * * @internal */ export declare class BrowserAuthCredential implements IAuthCredential { authToken?: string; authenticationType?: AuthenticationType; cookies?: string; csrfToken?: string; guestToken?: string; /** * Creates a new BrowserAuthCredential from IAuthCookie. * * @param cookies - The authentication cookies from browser * @param guestToken - Optional guest token for guest authentication */ constructor(cookies?: IAuthCookie, guestToken?: string); /** * Converts the credentials to HTTP headers. * * @returns The headers object for axios requests */ toHeader(): Record; } /** * Browser-compatible authentication service. * Uses atob/btoa instead of Node.js Buffer. * * @internal */ export declare class BrowserAuthService { /** The config object. */ private readonly _config; /** * @param config - The browser config for Rettiwt. */ constructor(config: BrowserRettiwtConfig); /** * Decodes the encoded cookie string using browser-native atob. * * @param encodedCookies - The encoded cookie string to decode. * @returns The decoded cookie string. */ static decodeCookie(encodedCookies: string): string; /** * Encodes the given cookie string using browser-native btoa. * * @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 (base64 encoded cookie string). * @returns The user id associated with the API key. */ static getUserId(apiKey: string): string | undefined; /** * Gets the user's id from the twid cookie value. * * @param twid - The twid cookie value. * @returns The user id. */ static getUserIdFromTwid(twid: string): string | undefined; /** * Login to twitter as guest. * * @returns A new guest credential. */ guest(): Promise; }