import { XSignInCredentials, XUserRetrievedData } from '../types'; /** * Class to handle authentication via Google's OAuth flow. * It handles exchanging the authorization code for tokens and * retrieving user information from the X API. */ export declare class XAuthHandler { private readonly credentials; private readonly _accessToken; /** * Constructor to initialize the class with client credentials. * The credentials are base64 encoded and stored as `_accessToken`. * @param credentials - The client credentials (client ID, client secret, etc.) */ constructor(credentials: XSignInCredentials); /** * Exchanges the authorization code for an access token and refresh token. * Makes a POST request to the token exchange endpoint. * @param authorizationCode - The authorization code received from the user * @returns Promise resolving to the exchange data containing the access token, refresh token, and scope * @throws XAuthError if the token exchange fails */ private exchangeAuthorizationCode; /** * Retrieves user information from the X API using the provided access token. * @param accessToken - The access token obtained from the token exchange * @returns Promise resolving to the user's information including ID, name, and username * @throws XAuthError if user information retrieval fails */ private retrieveUserInfo; /** * Validates the user's credentials by exchanging the authorization code * and retrieving the user's information. * @param authorizationCode - The authorization code received from the user * @returns Promise resolving to the user's information if validation is successful * @throws XAuthError if validation fails or required scopes are not granted */ validateUserCredentials({ authorizationCode }: { authorizationCode: string; }): Promise; }