/**
 * Trust V1 record service — domain validation layer.
 *
 * Validates trust records (schema, prev-link, signature envelope)
 * and delegates persistence to TrustChainPort. No encoding, no
 * Git object construction, no I/O beyond port calls.
 *
 * @module domain/trust/TrustRecordService
 * @see docs/specs/TRUST_CRYPTO_ALGORITHM.md Section 7
 */
import type TrustChainPort from '../../ports/TrustChainPort.ts';
import type { TrustRecord } from './TrustRecord.ts';
type AppendOptions = {
    readonly skipSignatureVerify?: boolean;
};
type RetryOptions = {
    readonly maxRetries?: number;
    readonly resign?: ((record: TrustRecord) => Promise<TrustRecord>) | null;
    readonly skipSignatureVerify?: boolean;
};
declare class TrustRecordService {
    private readonly _chain;
    constructor(chain: TrustChainPort);
    /**
     * Appends a signed trust record to the chain.
     *
     * Validates:
     * 1. Signature envelope completeness (alg + sig fields present)
     * 2. Prev-link consistency (must match current tip's recordId)
     *
     * RecordId integrity and schema validation are handled at the
     * adapter boundary (TrustRecord.fromDecoded + hash verification).
     */
    appendRecord(graphName: string, record: TrustRecord, options?: AppendOptions): Promise<{
        commitSha: string;
    }>;
    /**
     * Appends with automatic retry on CAS conflict.
     *
     * On E_TRUST_CAS_CONFLICT, reads the fresh tip recordId, updates
     * the record's prev pointer, optionally re-signs, and retries.
     */
    appendRecordWithRetry(graphName: string, record: TrustRecord, options?: RetryOptions): Promise<{
        commitSha: string;
        attempts: number;
    }>;
    /**
     * Streams trust records from the chain, oldest first.
     * Delegates directly to the port — domain adds no logic here.
     */
    readRecords(graphName: string, tip?: string): AsyncIterable<TrustRecord>;
    /**
     * Reads the chain tip (commit SHA + recordId).
     */
    readTip(graphName: string): Promise<{
        tipSha: string;
        recordId: string | null;
    } | null>;
}
export { TrustRecordService };
export type { AppendOptions, RetryOptions };
