import { type VariantProps } from 'class-variance-authority'; import { type InsertPayload, type InsertVariant, type InsertMode } from '../_shared/insert-result'; import { type Trimester, type GestationalAge, type Plurality, type Chorionicity } from '../_shared/obstetrics'; import { type AntenatalScheduleOptions, type GdmRisk } from '../_shared/antenatal-schedule'; declare const rootVariants: (props?: ({ width?: "auto" | "full" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; /** Whether the entered date is the last period (`lmp`) or the due date (`edd`). */ export type GestationalAgeMethod = 'lmp' | 'edd'; export interface GestationalAgeResult { gestationalAge: GestationalAge | null; trimester: Trimester; dueDate: Date; } /** The dating inputs as entered. */ export interface GestationalAgeInputsSnapshot { /** Whether the reference date is a last period or a due date. */ method: GestationalAgeMethod; /** The reference date (`yyyy-MM-dd`), or null when unset. */ referenceDate: string | null; /** The date gestational age and trimester are evaluated against. */ asOfDate: string; } /** `GestationalAgeResult` projected onto the agent boundary — ISO dates. */ export interface GestationalAgeSnapshot { /** Gestational age as of the evaluation date; null before conception. */ gestationalAge: { weeks: number; days: number; totalDays: number; } | null; /** Trimester band as of the evaluation date. */ trimester: Trimester; /** Estimated date of delivery, `yyyy-MM-dd`. */ dueDate: string; } /** * Curated imperative handle for agent / external automation. Reads the dating * inputs and the computed gestational age, and drives the inputs the way a * user would. Never exposes patient identity — only structural dates and * numbers. Consumed by `gestational-age-calculator.agent.ts`; the public `ref` * stays the root DOM element. */ export interface GestationalAgeCalculatorHandle { /** The dating inputs as entered. */ getInputs: () => GestationalAgeInputsSnapshot; /** Computed gestational age, trimester and due date, or null until a reference date is set. */ getResult: () => GestationalAgeSnapshot | null; /** Switch between dating from a last period and dating from a known due date. */ setMethod: (method: GestationalAgeMethod) => boolean; /** Set the reference date (`yyyy-MM-dd`); a last period may not be in the future. */ setReferenceDate: (isoDate: string | null) => boolean; /** Set the date gestational age and trimester are evaluated against. */ setAsOfDate: (isoDate: string) => boolean; } export interface GestationalAgeCalculatorProps extends VariantProps { /** Whether the input date is the last period (`lmp`) or the due date (`edd`). */ defaultMethod?: GestationalAgeMethod; /** Pre-fill the reference date (e.g. a known LMP from the patient record). */ defaultReferenceDate?: Date; /** Fires whenever a result can be computed (and `null` when it can't). */ onResultChange?: (result: GestationalAgeResult | null) => void; /** When provided, shows the result-action buttons that emit / copy the result. */ onInsert?: (payload: InsertPayload) => void; /** * Which verb the result button performs. Defaults to `'insert'`. * Use `'copy'` in an app-shell surface (no editor to insert into) — the * button writes the result to the clipboard as a multi-format `ClipboardItem`. */ insertVariant?: InsertVariant; /** `copy` variant only — fired after a successful clipboard write. */ onCopy?: (mode: InsertMode) => void; /** `copy` variant only — fired if the clipboard write can't proceed. */ onError?: (error: unknown) => void; /** * Brand wordmark printed in the inserted/copied result-card footer. * Omitted → no brand line (and no footer hairline); a string → that custom * brand; `false` → no brand line. Brand is opt-in. */ insertBrand?: string | false; /** * Append the antenatal exam schedule (the time-sensitive screening windows) * below the result, dated from the computed gestational start, and reveal the * plurality / chorionicity inputs that drive it. */ showSchedule?: boolean; /** `showSchedule` only — initial number of babies. Defaults to `'singleton'`. */ defaultPlurality?: Plurality; /** `showSchedule` only — initial chorionicity for multiples. Defaults to `'unknown'`. */ defaultChorionicity?: Chorionicity; /** `showSchedule` only — initial Rh-negative state (surfaces anti-D). */ defaultRhNegative?: boolean; /** `showSchedule` only — initial gestational-diabetes risk tier (surfaces OGTT). */ defaultGdmRisk?: GdmRisk; /** * Passthrough options for the appended schedule (national `schedule`, * `includeOnIndication`, `birthGuideline`). `today`, `plurality`, * `chorionicity`, `rhNegative` and `gdmRisk` come from the component's own * inputs. Ignored unless `showSchedule` is set. */ scheduleOptions?: Omit; /** Opaque instance id, emitted as `data-component-id`. */ id?: string; /** Extra class names on the wrapper. */ className?: string; } /** * @deprecated Superseded by `PregnancyDating`, which unifies the due-date and * gestational-age calculators (any anchor → both EDD and current GA) and adds a * manual ±days dating adjustment. This component will be removed in a future * release; migrate to `PregnancyDating` (`defaultMethod="edd"` for the * date-back-from-EDD flow). */ export declare const GestationalAgeCalculator: import("react").ForwardRefExoticComponent>; export {}; //# sourceMappingURL=gestational-age-calculator.d.ts.map