/**
 * Postgres-backed Raft state persistence.
 *
 * Stores the minimal Raft persistent state (currentTerm, votedFor, leaderId)
 * in the raft_state table. One row per cluster (default cluster_id = 'default').
 * State is loaded on node startup and saved on term/vote/leader transitions.
 */
import type { Kysely } from 'kysely';
import type { Database } from '../db/types.js';
export interface RaftPersistentState {
    currentTerm: number;
    votedFor: string | null;
    leaderId: string | null;
}
export declare class RaftStateStore {
    private readonly db;
    private readonly clusterId;
    constructor(deps: {
        db: Kysely<Database>;
        clusterId?: string;
    });
    /**
     * Load persisted Raft state from the DB.
     * Returns defaults (term=0, votedFor=null, leaderId=null) if no row exists.
     */
    load(): Promise<RaftPersistentState>;
    /**
     * Upsert full Raft state into the DB.
     */
    save(state: RaftPersistentState): Promise<void>;
    /**
     * Update just the leader and term fields (lightweight update for heartbeat acceptance).
     */
    updateLeader(leaderId: string, term: number): Promise<void>;
}
//# sourceMappingURL=raft-state.d.ts.map