import type { H3Event } from 'h3';
import type { OAuthProvider, OnError } from '#auth-utils';
export declare function getOAuthRedirectURL(event: H3Event): string;
/**
 * Request an access token body.
 *
 * @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3
 */
export interface RequestAccessTokenBody {
    grant_type: 'authorization_code';
    code: string;
    redirect_uri: string;
    client_id: string;
    client_secret?: string;
    [key: string]: string | undefined;
}
interface RequestAccessTokenOptions {
    body?: RequestAccessTokenBody;
    params?: Record<string, string | undefined>;
    headers?: Record<string, string>;
}
/**
 * Request an access token from the OAuth provider.
 *
 * When an error occurs, only the error data is returned.
 *
 * @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3
 */
export declare function requestAccessToken(url: string, options: RequestAccessTokenOptions): Promise<any>;
/**
 * Handle OAuth access token error response
 *
 * @see https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
 */
export declare function handleAccessTokenErrorResponse(event: H3Event, oauthProvider: OAuthProvider, oauthError: any, onError?: OnError): void | Promise<void>;
export declare function handleMissingConfiguration(event: H3Event, provider: OAuthProvider, missingKeys: string[], onError?: OnError): void | Promise<void>;
export {};
