import { AppleSignInCredentials, AppleUserRetrievedData } from '../types'; export declare class AppleAuthHandler { private readonly credentials; private clientSecret?; private static publicKeys; constructor(credentials: AppleSignInCredentials); /** * Initialize the handler by updating the public keys and client secret. * @returns {Promise} */ initialize(): Promise; /** * Update the client secret used for communication with Apple's server. * @returns {Promise} The client secret as a JWT. */ updateClientSecret(): Promise; /** * Retrieve the public key from Apple's server by 'kid'. * @param {string} kid - Key ID to find the correct public key. * @returns {Promise} The public key for verifying the token. */ private static getPublicKey; /** * Fetch and update Apple's public keys used for verifying token signatures. * @returns {Promise} Array of JSON Web Keys (JWK). */ private static updatePublicKeys; /** * Retrieve token from Apple server by exchanging the authorization code. * @param {string} authorizationCode - The authorization code received from Apple. * @returns {Promise} The token response from Apple. */ private retrieveToken; /** * Decode and validate the given ID token using Apple's public key. * @param {string} idToken - ID token received from Apple. * @returns {Promise} The decoded token payload. */ private static decodeIdToken; /** * Validate user credentials by verifying the authorization code with Apple's server. * @param {object} params - Parameters containing the authorization code. * @param {string} params.authorizationCode - The authorization code from Apple. * @returns {Promise} The user data retrieved from the decoded ID token. */ validateUserCredentials({ authorizationCode, clientNonce, }: { authorizationCode: string; clientNonce?: string; }): Promise; /** * Validate the token properties. * @param {string} iss - Issuer of the token. * @param {string} aud - Audience of the token. * @param {string} sub - Subject of the token. * @param {string} nonce - Subject of the token. * @param {string} clientNonce - Receive from you clients or their session. * @param {boolean} emailVerified - Whether the email is verified. * @throws {AppleAuthError} If any of the properties are invalid. */ private validateTokenProperties; }