export interface LoginResult {
    user_id: string;
    email: string | undefined;
    machine_key: string;
}
/** Result from exchanging an OAuth code via Gateway. */
export interface CodeExchangeResult {
    access_token: string;
    refresh_token: string;
    expires_at: number;
    user: {
        id: string;
        email: string | undefined;
    };
}
/** Set the code exchange implementation (called during daemon startup). */
export declare function setExchangeCodeFn(fn: (code: string) => Promise<CodeExchangeResult>): void;
/** Set the OAuth URL provider implementation (called during daemon startup). */
export declare function setGetOAuthUrlFn(fn: (redirectTo: string) => Promise<string>): void;
/**
 * Override the browser opener function (for testing).
 */
export declare function setOpenBrowser(fn: (url: string) => void): void;
/**
 * Reset the browser opener to the default (for testing).
 */
export declare function resetOpenBrowser(): void;
/** Override the manual code entry function (for testing). */
export declare function setManualCodeEntryFn(fn: (authUrl: string) => Promise<string>): void;
/** Reset the manual code entry function to the default (for testing). */
export declare function resetManualCodeEntryFn(): void;
/**
 * Orchestrate the complete login flow:
 * 1. Try to start temporary OAuth callback server
 * 2. If server starts: open browser and wait for callback
 * 3. If server fails: fall back to manual code entry
 * 4. Exchange code for tokens via Gateway (if code flow) or use tokens directly (if implicit flow)
 * 5. Preserve or generate machineKey (UUID v4)
 * 6. Save complete auth data to auth.json
 * 7. Return success with user info
 */
export declare function login(): Promise<LoginResult>;
//# sourceMappingURL=login.d.ts.map