/**
 * Healthcare supply-chain audit trail — tamper-evident, hash-chained logging
 * middleware and service for Hono HTTP handlers.
 */
import type { MiddlewareHandler } from 'hono';
export interface AuditRecord {
    id: string;
    sequence_number: number;
    timestamp: string;
    correlation_id: string;
    actor: string;
    action: string;
    entity_type: string;
    entity_id: string | null;
    phase: 'before' | 'after';
    request_body: unknown;
    response_body: unknown;
    response_status: number | null;
    duration_ms: number | null;
    success: boolean | null;
    erp_wire_format: unknown;
    checksum: string;
    previous_checksum: string;
}
export interface DbClient {
    query(sql: string, params: unknown[]): Promise<unknown[]>;
    execute(sql: string, params: unknown[]): Promise<void>;
}
export declare function deriveEntityType(path: string): string;
export declare class AuditTrailService {
    private readonly db;
    private lastChecksum;
    private sequenceNumber;
    constructor(db: DbClient);
    computeChecksum(record: Omit<AuditRecord, 'checksum'>): string;
    recordBefore(correlationId: string, actor: string, action: string, entityType: string, requestBody: unknown, erpWireFormat?: unknown): Promise<AuditRecord>;
    recordAfter(correlationId: string, actor: string, action: string, entityType: string, entityId: string | null, responseBody: unknown, responseStatus: number, durationMs: number, success: boolean, erpWireFormat?: unknown): Promise<AuditRecord>;
    getByCorrelationId(correlationId: string): Promise<AuditRecord[]>;
    verifyChainIntegrity(): Promise<{
        valid: boolean;
        brokenAt?: number;
    }>;
    private persist;
}
export declare function createAuditMiddleware(auditService: AuditTrailService): MiddlewareHandler;
//# sourceMappingURL=audit-trail.d.ts.map