/**
 * Shared utilities for Google OAuth providers (Gemini CLI and Antigravity).
 *
 * NOTE: This module uses Node.js http.createServer for the OAuth callback.
 * It is only intended for CLI use, not browser environments.
 */
import type { Server } from "node:http";
import type { OAuthCredentials } from "./types.js";
export type CallbackServerInfo = {
    server: Server;
    cancelWait: () => void;
    waitForCode: () => Promise<{
        code: string;
        state: string;
    } | null>;
};
/**
 * Start a local HTTP server to receive the OAuth callback.
 *
 * @param port - The port to listen on (e.g. 8085, 51121)
 * @param callbackPath - The URL path for the callback (e.g. "/oauth2callback", "/oauth-callback")
 * @param providerName - Human-readable provider name for error messages
 */
export declare function startCallbackServer(port: number, callbackPath: string, providerName: string): Promise<CallbackServerInfo>;
/**
 * Parse a redirect URL to extract the authorization code and state parameters.
 */
export declare function parseRedirectUrl(input: string): {
    code?: string;
    state?: string;
};
/**
 * Get the user's email address from a Google OAuth access token.
 */
export declare function getGoogleUserEmail(accessToken: string): Promise<string | undefined>;
/**
 * Refresh a Google OAuth token using the standard Google token endpoint.
 *
 * @param refreshToken - The refresh token
 * @param clientId - The OAuth client ID
 * @param clientSecret - The OAuth client secret
 * @param providerName - Human-readable provider name for error messages
 * @param extraFields - Additional fields to include in the returned credentials
 */
export declare function refreshGoogleOAuthToken(refreshToken: string, clientId: string, clientSecret: string, providerName: string, extraFields?: Record<string, unknown>): Promise<OAuthCredentials>;
//# sourceMappingURL=google-oauth-utils.d.ts.map