/**
 * Trust V1 state builder.
 *
 * Pure function that walks an ordered sequence of trust records and
 * accumulates the trust state: active/revoked keys and writer bindings.
 *
 * No I/O, no side effects, no infrastructure imports.
 * Accepts sync arrays or async streams (from TrustChainPort).
 *
 * @module domain/trust/TrustStateBuilder
 * @see docs/specs/TRUST_CRYPTO_ALGORITHM.md Section 11
 */
import { type TrustRecord } from './TrustRecord.ts';
import TrustReadonlyMap from './TrustReadonlyMap.ts';
type ActiveKeyInfo = {
    readonly publicKey: string;
    readonly addedAt: string;
};
type RevokedKeyInfo = {
    readonly publicKey: string;
    readonly revokedAt: string;
    readonly reasonCode: string;
};
type BindingInfo = {
    readonly keyId: string;
    readonly boundAt: string;
};
type RevokedBindingInfo = {
    readonly keyId: string;
    readonly revokedAt: string;
    readonly reasonCode: string;
};
type BuildError = {
    readonly recordId: string;
    readonly error: string;
};
declare class TrustState {
    readonly activeKeys: TrustReadonlyMap<string, ActiveKeyInfo>;
    readonly revokedKeys: TrustReadonlyMap<string, RevokedKeyInfo>;
    readonly writerBindings: TrustReadonlyMap<string, BindingInfo>;
    readonly revokedBindings: TrustReadonlyMap<string, RevokedBindingInfo>;
    readonly errors: readonly BuildError[];
    readonly recordsProcessed: number;
    constructor(fields: {
        activeKeys: Map<string, ActiveKeyInfo>;
        revokedKeys: Map<string, RevokedKeyInfo>;
        writerBindings: Map<string, BindingInfo>;
        revokedBindings: Map<string, RevokedBindingInfo>;
        errors: BuildError[];
        recordsProcessed: number;
    });
    hasActiveKey(keyId: string): boolean;
    getBindingsForWriter(writerId: string): readonly BindingInfo[];
    hasRevokedBindingsForWriter(writerId: string): boolean;
}
type TrustBuildOptions = {
    readonly signatureVerifier?: (record: TrustRecord, publicKeyBase64: string) => boolean;
    readonly computeKeyFingerprint?: (publicKeyBase64: string) => string;
};
/** Input can be a sync array (tests) or async stream (port). */
type RecordSource = readonly TrustRecord[] | Iterable<TrustRecord> | AsyncIterable<TrustRecord>;
/**
 * Builds trust state from an ordered sequence of trust records.
 *
 * Records MUST be in chain order (oldest first). The builder enforces:
 * - Monotonic revocation: once a key is revoked, it cannot be re-added
 * - Binding validity: WRITER_BIND_ADD requires the referenced key to be active
 * - Cryptographic verification (when signatureVerifier is provided)
 *
 * Records are already validated by TrustRecord.fromDecoded() at the
 * adapter boundary. No Zod, no schema re-validation here.
 */
declare function buildState(records: RecordSource, options?: TrustBuildOptions): Promise<TrustState>;
export { TrustState, buildState };
export type { TrustBuildOptions, ActiveKeyInfo, RevokedKeyInfo, BindingInfo, RevokedBindingInfo, BuildError };
