/**
 * Types for the FieldAudit module.
 *
 * FieldAudit records per-field value changes inside a form session and
 * exposes them as a clickable history panel next to each field row. It
 * pairs with the `field_action_components` slot machinery — `FieldAuditIcon`
 * goes into `row_end` and `FieldAuditPanel` into `row_below`.
 */
/**
 * Origin of an audit entry.
 *
 * - `manual` — Direct user edit picked up by the auto-watcher.
 * - `clarification` — A clarification flow resolved into a value update.
 *   The clarification handler must call `record_change()` explicitly so the
 *   auto-watcher's manual entry gets reclassified (see dedup below).
 */
export type AuditSource = 'manual' | 'clarification';
/**
 * A single entry in the per-field audit history.
 */
export interface AuditEntry {
    /** Unique id (used as React key). */
    id: string;
    /** The field that changed. */
    field_id: string;
    /** Where the change came from. */
    source: AuditSource;
    /** Wall-clock timestamp (ms since epoch) at the moment the entry was recorded. */
    at: number;
    /** Value immediately before the change. */
    prev_value: unknown;
    /** Value immediately after the change. */
    new_value: unknown;
    /** Optional human-readable label for the actor that made the change. */
    user?: string;
}
/**
 * Input shape for `record_change()`.
 */
export interface RecordChangeInput {
    field_id: string;
    source: AuditSource;
    new_value: unknown;
    /** Falls back to the most recent recorded value if omitted. */
    prev_value?: unknown;
    user?: string;
    /**
     * Dedup window in ms. If the most-recent entry for this field has the
     * same new value within the window, the call is treated as a duplicate
     * of the existing entry.
     *
     * When the call carries a more specific source (`'clarification'`) than
     * the existing entry (`'manual'` from the auto-watcher), the existing
     * entry is reclassified instead of duplicated.
     */
    dedup_window_ms?: number;
}
/**
 * Context value exposed by `<FieldAuditProvider>`.
 */
export interface FieldAuditContextValue {
    /** Per-field history, most-recent-first. */
    entries: Map<string, AuditEntry[]>;
    /** Field ids whose history panel is currently expanded. */
    expanded: Set<string>;
    /** Record a change. Auto-watcher uses this with `source='manual'`. */
    record_change: (input: RecordChangeInput) => void;
    /** Toggle the row_below history panel for one field. */
    toggle_expanded: (field_id: string) => void;
    /** Drop history for one field (and collapse it). */
    clear_field: (field_id: string) => void;
    /** Drop history for every field. */
    clear_all: () => void;
}
//# sourceMappingURL=types.d.ts.map