import { buildHashPayload } from './skr.posting.js'; import type { TSKRType } from './skr.types.js'; export interface IChainVerificationResult { valid: boolean; entriesChecked: number; issues: string[]; headHash: string | null; } /** The persisted fields of one journal entry the chain verification reads. */ export interface IChainedEntryDocument extends Omit[0], 'sequenceNumber' | 'postedAt'> { sequenceNumber?: number | null; prevHash?: string | null; entryHash?: string | null; postedAt?: Date | null; } /** * Checks one chain from the documents alone: `docs` are the schemaVersion-2 * entries of (skrType, fiscalYear) sorted by sequence number, `state` the * stored counter and head. Gaplessness, every entry hash, every link and the * head are compared; nothing is read or written. */ export declare function verifyChainDocuments(skrType: TSKRType, fiscalYear: number, docs: readonly IChainedEntryDocument[], state: { value: number; headHash: string; } | null): IChainVerificationResult; /** * Walk sequence 1..N for (skrType, fiscalYear): check gaplessness, recompute * every entry hash from the persisted payload, verify the chain links, and * compare the final hash against the stored chain head. */ export declare function verifyHashChain(skrType: TSKRType, fiscalYear: number): Promise;