import { IAuthCookie } from '../../types/auth/AuthCookie'; import { IErrorHandler } from '../../types/ErrorHandler'; /** * The default headers for browser requests. * * @internal */ declare const DefaultHeaders: { Authority: string; 'Accept-Language': string; 'Cache-Control': string; Referer: string; 'X-Twitter-Active-User': string; 'X-Twitter-Client-Language': string; }; /** * Configuration options for BrowserRettiwt. * * @public */ export interface IBrowserRettiwtConfig { /** The max wait time (in milli-seconds) for a response. */ timeout?: number; /** Whether to write logs to console or not. */ logging?: boolean; /** Optional custom error handler. */ errorHandler?: IErrorHandler; /** Optional custom HTTP headers. */ headers?: { [key: string]: string; }; /** The delay (in ms) between concurrent requests. */ delay?: number | (() => number | Promise); /** The maximum number of retries. */ maxRetries?: number; } /** * Browser-specific configuration for Rettiwt. * Does not include proxy agent (not applicable in browser). * * @public */ export declare class BrowserRettiwtConfig { private _userId?; private _cookies?; private _csrfToken?; private _headers; private _initialized; readonly delay?: number | (() => number | Promise); readonly errorHandler?: IErrorHandler; readonly logging?: boolean; readonly maxRetries: number; readonly timeout?: number; /** * Creates a new BrowserRettiwtConfig instance. * * @param config - The configuration options */ constructor(config?: IBrowserRettiwtConfig); /** * Initializes the config with cookies obtained from the browser. * * @param cookies - The authentication cookies */ initializeWithCookies(cookies: IAuthCookie): void; /** * Whether the config has been initialized with cookies. */ get isInitialized(): boolean; /** * The ID of the authenticated user. */ get userId(): string | undefined; /** * The HTTP headers to use for requests. */ get headers(): { [key: string]: string; }; /** * The cookie string for authentication. */ get cookies(): string | undefined; /** * The CSRF token for the session. */ get csrfToken(): string | undefined; /** * The HTTPS agent (undefined in browser - not applicable). */ get httpsAgent(): undefined; /** * The API key (returns undefined - browser uses cookies directly). */ get apiKey(): undefined; /** * Sets custom headers. */ set headers(headers: { [key: string]: string; } | undefined); } export { DefaultHeaders as DefaultBrowserRettiwtHeaders };