/**
 * Sync client — callboard-side API for the key exchange protocol.
 *
 * Usage:
 *   const exchange = startKeyExchange({ remoteUrl, inviteCode, encryptionKey, callerAlias });
 *   // Display exchange.confirmCode to the user
 *   // User enters confirmCode into drawlatch
 *   const result = await exchange.complete();
 *   // Keys exchanged, remote public keys saved locally
 */
import type { SerializedPublicKeys } from '../crypto/keys.js';
import { type SyncErrorCode } from './sync.js';
export interface KeyExchangeInit {
    /** Display this code to the user — they enter it into drawlatch. */
    confirmCode: string;
    /** The caller's public keys (already generated). */
    publicKeys: SerializedPublicKeys;
    /** Call after the user has entered the confirm code into drawlatch. */
    complete(): Promise<SyncResult>;
}
export interface SyncResult {
    remotePublicKeys: SerializedPublicKeys;
    callerAlias: string;
    fingerprint: string;
}
export declare class SyncClientError extends Error {
    readonly code: SyncErrorCode;
    readonly statusCode?: number | undefined;
    constructor(message: string, code: SyncErrorCode, statusCode?: number | undefined);
}
export interface StartKeyExchangeOpts {
    /** Drawlatch remote server URL (e.g., "http://host:9999"). */
    remoteUrl: string;
    /** Invite code from drawlatch sync output. */
    inviteCode: string;
    /** AES-256-GCM encryption key from drawlatch sync output (base64). */
    encryptionKey: string;
    /** Desired caller alias on the remote server. */
    callerAlias: string;
    /** Override config directory (default: ~/.drawlatch). */
    configDir?: string;
}
/**
 * Start the key exchange from callboard's side.
 *
 * 1. Creates caller keys if they don't exist yet
 * 2. Generates a confirm code
 * 3. Returns the confirm code + a `complete()` function
 * 4. `complete()` encrypts and sends POST /sync, decrypts response, saves remote keys
 */
export declare function startKeyExchange(opts: StartKeyExchangeOpts): KeyExchangeInit;
//# sourceMappingURL=sync-client.d.ts.map