import { Aioha } from '@aioha/aioha'; import type { HiveAuthResult, LoggedInUser } from '../types/auth'; /** * Programmatic authentication service for developers * Provides easy-to-use methods for programmatic login without UI components */ export declare class ProgrammaticAuth { private aioha; constructor(aioha: Aioha); /** * Login with a private posting key programmatically * This method validates the key, authenticates with Hive, and updates the auth store * * @param username - The Hive username * @param privatePostingKey - The private posting key * @param serverCallback - Optional callback to your server for additional validation * @returns Promise - The logged-in user object * * @example * ```typescript * import { ProgrammaticAuth } from 'hive-authentication'; * * const programmaticAuth = new ProgrammaticAuth(aioha); * * try { * const user = await programmaticAuth.loginWithPrivateKey( * 'username', * '5J...', // private posting key * async (hiveResult) => { * // Your server validation * const response = await fetch('/api/validate', { * method: 'POST', * body: JSON.stringify(hiveResult) * }); * return response.json(); * } * ); * console.log('User logged in:', user.username); * } catch (error) { * console.error('Login failed:', error.message); * } * ``` */ loginWithPrivateKey(username: string, privatePostingKey: string, serverCallback?: (hiveResult: HiveAuthResult) => Promise): Promise; }