export type DueDateMethod = 'lmp' | 'conception' | 'ivf'; /** Embryo age at transfer, in days (cleavage vs blastocyst). */ export type EmbryoAge = 3 | 5; export type Trimester = 'preconception' | 'first' | 'second' | 'third' | 'postterm'; /** Number of fetuses. Drives surveillance schedule and planned-birth timing. */ export type Plurality = 'singleton' | 'twin' | 'triplet'; /** * Placentation of a multiple pregnancy. `unknown` is the safe default — managed * as monochorionic (the higher-risk assumption) until proven otherwise, per * NICE QS46. Only meaningful when `plurality !== 'singleton'`. */ export type Chorionicity = 'dichorionic-diamniotic' | 'monochorionic-diamniotic' | 'monochorionic-monoamniotic' | 'unknown'; /** Naegele's rule: a term pregnancy is 280 days from the LMP. */ export declare const GESTATION_DAYS = 280; /** Ovulation/conception sits ~14 days after the LMP in a 28-day cycle. */ export declare const CONCEPTION_OFFSET_DAYS = 14; /** A term pregnancy is 266 days from conception. */ export declare const TERM_FROM_CONCEPTION_DAYS = 266; /** Standard menstrual-cycle length Naegele assumes. */ export declare const DEFAULT_CYCLE_LENGTH = 28; export interface DueDateInput { method: DueDateMethod; /** The reference date for the chosen method (LMP / conception / transfer). */ date: Date; /** LMP only — average cycle length in days. Defaults to 28. */ cycleLength?: number; /** IVF only — embryo age at transfer in days. Defaults to 5 (blastocyst). */ embryoAge?: EmbryoAge; } export interface GestationalAge { weeks: number; days: number; totalDays: number; } export interface DueDateResult { /** Estimated date of delivery. */ dueDate: Date; /** GA day-0 anchor (notional LMP) the trimester maths counts from. */ gestationalStart: Date; /** Gestational age as of `today`; `null` before conception. */ gestationalAge: GestationalAge | null; trimester: Trimester; } /** Classify gestational age (in completed weeks) into a trimester. */ export declare function trimesterForWeeks(totalDays: number): Trimester; /** * Resolve the gestational start (notional LMP) and due date for a method. * `cycleLength` shifts a longer/shorter cycle's ovulation, moving the due * date while GA stays counted from the LMP — the standard convention. */ export declare function computeDueDate(input: DueDateInput, today: Date): DueDateResult; /** Gestational weeks at which clinically notable milestones fall. */ export declare const MILESTONE_WEEKS: readonly [12, 24, 28, 37, 40]; export interface GestationalMilestone { /** Stable key (`w12`, `w24`, …) for i18n lookup. */ key: string; /** Completed gestational weeks. */ week: number; /** Calendar date the milestone is reached. */ date: Date; } /** * Project the standard milestone dates from a gestational start (notional * LMP / GA day 0): end of first trimester (12w), viability (24w), third * trimester (28w), term (37w) and the 40-week due date. */ export declare function gestationalMilestones(gestationalStart: Date): GestationalMilestone[]; /** Badge `variant` names used for trimesters (the Badge component's union). */ export type TrimesterBadgeVariant = 'neutral' | 'info' | 'success' | 'warning' | 'error'; /** Trimester → on-screen Badge variant. */ export declare const TRIMESTER_BADGE_VARIANT: Record; /** * DS token NAME backing each trimester's result-card chip — the solid-fill * companion of `TRIMESTER_BADGE_VARIANT` (Badge `error` fills `--destructive`; * `neutral` fills `--muted`). Passed as the card's `highlightToken` so the * inserted PNG chip matches the on-screen trimester badge; `InsertButton` * resolves the name to a concrete colour at raster time. * * `third` resolves to `--warning-readable`, which the result card's colour * probe resolves in the live themed DOM: orange-600 in light, non-accessible * mode (where bare `--warning` yellow only reaches ~3.2:1 on the white card) * and `--warning` elsewhere, whose deepened ramp already clears contrast. * Resolving the token NAME at the card means the choice tracks the live theme * regardless of where the theme class lives. */ export declare const TRIMESTER_HIGHLIGHT_TOKEN: Record; /** The DS token name for a trimester's result-card chip. */ export declare function trimesterHighlightToken(trimester: Trimester): string; /** Which body's planned-birth timing to use for multiples. */ export type BirthGuideline = 'nice' | 'acog'; /** Planned-birth window as GA days (week*7 + day), inclusive, with source. */ export interface BirthWindow { startDay: number; endDay: number; source: string; } /** * Recommended planned-birth window for a multiple pregnancy, by chorionicity. * Singletons return `null` (use the 40-week EDD instead). `unknown` * chorionicity is managed as monochorionic-diamniotic — the higher-risk * default (NICE QS46). */ export declare function plannedBirthWindow(plurality: Plurality, chorionicity?: Chorionicity, guideline?: BirthGuideline): BirthWindow | null; /** Robinson–Fleming dating is validated for CRL 45–84 mm. */ export declare const CRL_DATING_MIN_MM = 45; export declare const CRL_DATING_MAX_MM = 84; /** Gestational age in days from a crown-rump length (mm), Robinson–Fleming. */ export declare function crlToGestationalAgeDays(crlMm: number): number; /** * ACOG CO 700 redating threshold (in days) for a given GA-by-LMP: re-date the * EDD to the ultrasound estimate only when the discrepancy EXCEEDS this. */ export declare function redatingThresholdDays(gaByLmpDays: number): number; export interface CrlRedatingInput { /** Reported first day of the last menstrual period. */ lmp: Date; /** Date the ultrasound CRL was measured. */ scanDate: Date; /** Crown-rump length, mm. */ crlMm: number; } export interface CrlRedatingResult { /** Notional LMP (GA day 0) after the rule — the ultrasound's or the original. */ gestationalStart: Date; /** Whether the ultrasound estimate replaced the LMP dating. */ redated: boolean; /** |GA-by-LMP − GA-by-CRL| at the scan, in days. */ discrepancyDays: number; /** The ACOG CO 700 threshold (days) that applied. */ thresholdDays: number; /** CRL − LMP dating, in days (+ = fetus ahead of dates). Server `eco_diff_days`. */ ecoDiffDays: number; /** Whether the CRL is within the 45–84 mm dating-validity window. */ crlInRange: boolean; } /** Apply the ACOG CO 700 CRL-redating rule to an LMP. */ export declare function redateByCrl(input: CrlRedatingInput): CrlRedatingResult; //# sourceMappingURL=obstetrics.d.ts.map