import type { RefObject } from 'react'; import type { TFunction } from 'i18next'; import { type AlertAnnounce } from '../../components/alert'; import type { IntakeAnswer, IntakeSectionDef, PatientSex } from './anamnesis-types'; /** How one digest group is built. Phase 3 adds a group by adding an entry * here — the renderer switches on `kind` and never on a group id. */ export type DigestGroupKind = 'prose' | 'facts' | 'flags'; export type DigestGroupDef = { id: string; kind: 'prose'; fieldKeys: readonly string[]; } | { id: string; kind: 'facts'; fieldKeys: readonly string[]; } | { id: string; kind: 'flags'; }; /** Reading order for a clinician with the patient in the room: why they came, * what they already carry, what they report, what they do every day. */ export declare const DIGEST_GROUPS: readonly DigestGroupDef[]; /** Reads one answer by field key. Both surfaces hold their answers in a * different shape (a working map vs `Sourced`), so the digest * takes a reader rather than either shape. */ export type AnswerReader = (key: string) => IntakeAnswer | undefined; export interface DigestItem { key: string; label: string; /** Already display-ready. Absent numerics are an em dash, never "NaN". */ value: string; } export interface DigestGroup { id: string; kind: DigestGroupKind; items: DigestItem[]; } export interface IntakeDigest { /** Only groups that have something to say. */ groups: DigestGroup[]; answered: number; total: number; } export interface MissingAnswer { key: string; sectionKey: string; label: string; } /** The whole digest. Pure apart from `t`; safe on an absent questionnaire, a * half-answered one, and a practice that archived half the form. */ export declare function buildIntakeDigest(sections: readonly IntakeSectionDef[], read: AnswerReader, sex: PatientSex, t: TFunction): IntakeDigest; /** Mandatory questions the patient has not answered, in questionnaire order. * "Not sure" counts as unanswered — provisional, and flagged in the `.mdx`. */ export declare function missingMandatoryAnswers(sections: readonly IntakeSectionDef[], read: AnswerReader, sex: PatientSex, t: TFunction): MissingAnswer[]; /** Jump-to-field seam. The caller opens whatever disclosures hide the target * (on compile that is BOTH the section block and the answer review), then asks * for the jump; this waits for the reveal to mount before moving focus. */ export declare function useFieldJump(): { containerRef: RefObject; requestJump: (key: string) => void; }; export interface AnamnesisMissingAnswersProps { missing: readonly MissingAnswer[]; t: TFunction; /** Reveals the first missing answer and moves focus to it. */ onJump: (missing: MissingAnswer) => void; /** How loudly this is announced. Pass `'off'` where the list RECOMPUTES as * the user types — a live region re-announces its whole content on every * change, so a per-keystroke summary is noise, not help. Default `'polite'` * suits a list fixed at mount. */ announce?: AlertAnnounce; /** Label for the jump action. Override where the jump LEAVES the surface — * a button that changes tab has to say so before it moves focus. */ jumpKey?: string; } /** Guidance, not an interruption. Tint and urgency are independent in the kit, * so the `info` tint here is a visual choice, separate from `announce`. */ export declare function AnamnesisMissingAnswers({ missing, t, onJump, announce, jumpKey, }: AnamnesisMissingAnswersProps): import("react/jsx-runtime").JSX.Element | null; export interface AnamnesisDigestProps { digest: IntakeDigest; t: TFunction; } export declare function AnamnesisDigest({ digest, t }: AnamnesisDigestProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=anamnesis-digest.d.ts.map