/**
 * OAuth2 Utilities
 * Common utilities for OAuth2 providers
 */
/**
 * Generate a random state parameter for OAuth
 */
export declare function generateState(): string;
/**
 * Generate a code verifier for PKCE
 */
export declare function generateCodeVerifier(): string;
/**
 * Generate a code challenge from a verifier (for PKCE)
 */
export declare function generateCodeChallenge(verifier: string): Promise<string>;
/**
 * Create an authorization URL with common parameters
 */
export declare function createAuthorizationURL(params: {
    authorizationEndpoint: string;
    clientId: string;
    redirectURI: string;
    state: string;
    scopes?: string[];
    codeVerifier?: string;
    responseType?: string;
    prompt?: string;
    accessType?: string;
    display?: string;
    loginHint?: string;
    additionalParams?: Record<string, string>;
}): Promise<URL>;
/**
 * Validate an authorization code and exchange it for tokens
 */
export declare function validateAuthorizationCode(params: {
    tokenEndpoint: string;
    code: string;
    clientId: string;
    clientSecret: string;
    redirectURI: string;
    codeVerifier?: string;
}): Promise<{
    accessToken: string;
    refreshToken?: string;
    idToken?: string;
    tokenType: string;
    expiresIn?: number;
    scope?: string;
    raw: Record<string, any>;
}>;
/**
 * Refresh an access token
 */
export declare function refreshAccessToken(params: {
    tokenEndpoint: string;
    clientId: string;
    clientSecret: string;
    refreshToken: string;
}): Promise<{
    accessToken: string;
    refreshToken?: string;
    tokenType: string;
    expiresIn?: number;
    raw: Record<string, any>;
}>;
/**
 * Parse OAuth2 tokens from raw response
 */
export declare function parseOAuth2Tokens(raw: Record<string, any>): {
    accessToken?: string;
    refreshToken?: string;
    idToken?: string;
    tokenType?: string;
    accessTokenExpiresAt?: Date;
    refreshTokenExpiresAt?: Date;
    scopes?: string[];
};
declare const _default: {
    generateState: typeof generateState;
    generateCodeVerifier: typeof generateCodeVerifier;
    generateCodeChallenge: typeof generateCodeChallenge;
    createAuthorizationURL: typeof createAuthorizationURL;
    validateAuthorizationCode: typeof validateAuthorizationCode;
    refreshAccessToken: typeof refreshAccessToken;
    parseOAuth2Tokens: typeof parseOAuth2Tokens;
};
export default _default;
//# sourceMappingURL=utils.d.ts.map