import { PERMANENT_TEETH, PRIMARY_TEETH, type Arch, type ConditionDefinition, type ConditionId, type ToothSymbol, type ViewMode, type Dentition, type FdiId, type Numbering, type Radiograph, type Surface, type ToothChart, type ToothCondition, type ToothMode } from './tooth-data'; export interface ToothSchemeProps { /** Opaque instance id — emitted as `data-component-id` for the agent registry. */ id?: string; /** Which teeth to render. Default `'permanent'`. */ dentition?: Dentition; /** Numbering system shown on each tooth label. Default `'fdi'`. */ numbering?: Numbering; /** `'interactive'` enables selection + keyboard nav; `'display'` is read-only. Default `'interactive'`. */ mode?: ToothMode; /** * `'side'` shows the facial view (whole-tooth findings); `'plan'` shows the * occlusal view (per-surface caries / fillings); `'both'` lays the two facial * rows on the outside with the two occlusal rows between them (upper side → * upper occlusal → lower occlusal → lower side), bracketed by tooth numbers * above and below. Default `'side'`. */ projection?: ViewMode; /** * Show the selectable special-element slots (quadrants, sextants, arches, * whole-mouth) to the inline-end of each arch row. When unset, they show in * `both` view and hide in the single side / plan views; pass `true` / `false` * to force it. They share the chart data and emit `onSelect` like a tooth. */ specialElements?: boolean; /** Controlled chart state — the full `Record`. */ value?: ToothChart; /** Uncontrolled initial chart state. */ defaultValue?: ToothChart; /** Fired whenever the chart changes — always emits FDI ids. */ onChange?: (next: ToothChart) => void; /** * Fired when a tooth OR special element is focused / clicked. Special * elements emit their id (`Q1`, `S3`, `AS`, `general`, …). */ onSelect?: (toothId: FdiId) => void; /** Shortcut for pre-populating conditions: `{ '16': ['caries'], '36': ['filled'] }`. */ conditions?: Partial>; /** * Per-tooth radiographs (x-rays / *endorali*), keyed by FDI id — mirrors the * `conditions` shape. Teeth carrying at least one radiograph get a corner * count badge; in `radiographDisplay="thumbnail"` the most-recent film also * fills the slot. Image urls are opaque / consumer-hosted — never bundle real * scans (PHI). */ radiographs?: Partial>; /** * How a tooth carrying radiographs is marked. `'badge'` (default) keeps the * photoreal tooth render and adds a corner count badge; `'thumbnail'` shows * the most-recent radiograph inset in the slot (still badged). */ radiographDisplay?: 'badge' | 'thumbnail'; /** * Fired when a tooth's radiograph archive is opened — i.e. a tooth is * activated (click / Enter / Space) in `mode="display"`. Wire this to a * Sheet/Dialog that manages the tooth's films. Setting this makes display-mode * teeth focusable buttons; it is mutually exclusive with interactive * findings-editing (`mode="interactive"` / `activeCondition`). * * EVERY tooth becomes an open-archive button — including unfilmed teeth, so the * user can add the first film to an empty tooth (matching a real imaging hub). * Filmed teeth are distinguished by the radiograph count folded into their * accessible name and tooltip. */ onOpenRadiographs?: (toothId: FdiId) => void; /** * The finding a tooth-click applies in interactive mode (the selected * tool in a Findings / "Stato dentale" panel). Clicking a tooth toggles * this condition. When unset, clicking cycles caries on/off. * * A surface-part tool (caries / filled) drills into the tooth's surfaces in * the occlusal view; a root-part tool (root canal, post, apicectomy) drills * into the roots of a multi-rooted tooth in the facial view. Accepts a * `conditionRegistry` id as well as a built-in. */ activeCondition?: ConditionId; /** * Practice-defined findings, resolved AHEAD of the built-in vocabulary field * by field — so an entry may re-tint or re-label a shipped finding without * losing its artwork, or add a wholly new one. An entry with no artwork * renders its `glyph` badge, which is the seam that lets a practice chart a * finding before a designer draws it. Labels are already-translated text: * the consuming app owns custom-condition copy, not the kit. */ conditionRegistry?: ConditionDefinition[]; /** * Base URL the photoreal tooth renders are served from. Resolves to * `${assetBaseUrl}/{side|plan}/{symbol}/{top|bottom}/{fdi}.webp`. Defaults * to the kit's bundled static path; host the `toothscheme/teeth` set * elsewhere (CDN) by overriding this. Trusted developer-controlled value — * interpolated into an SVG `` (which cannot execute scripts), * not user input; intentionally not runtime-validated. */ assetBaseUrl?: string; /** * Show the finding-colour legend below the chart. Default `false` — findings * render as distinct symbol glyphs (self-describing) + tooltips, so the * colour key is opt-in; a consuming "Stato dentale" surface uses a * finding-type panel as its key instead. */ legend?: boolean; /** * Render a built-in options affordance: a gear button that opens a menu * letting the END USER toggle the legend + special elements and switch * dentition / numbering / projection. Opt-in — when on, those become * user-overridable (seeded from the props); when off, the props drive the * chart directly. Default `false`. */ controls?: boolean; /** * Where to render the `controls` gear. `undefined` (default) renders it * inline at the top-end of the chart. Pass a DOM element (e.g. a ref'd slot in * your card header) to portal the gear + its menu into that slot instead, * so the chart options can sit on the title line. While the slot is mounting * the prop will be `null`; the gear renders nothing until the element exists, * so it never flashes inline first. No effect unless `controls` is on. */ controlsContainer?: HTMLElement | null; /** Accessible label override for the chart region. */ ariaLabel?: string; /** Extra class names on the wrapper. */ className?: string; } /** Number-label placement for a sub-chart. */ type NumbersPosition = 'between' | 'above' | 'below' | 'none'; /** * Internal-only props (prefixed `_`) used when the component composes itself * into the four-row `both` view — never part of the public API. */ interface ToothSchemeInternalProps { /** Render a single arch (the `both` view stacks one arch per sub-chart). */ _arch?: Arch; /** Number-label placement for this sub-chart. */ _numbersPosition?: NumbersPosition; /** Render only the `` (no region wrapper, controls, legend, or chrome). */ _inner?: boolean; /** * Force the SVG content width (the `both` view shares one width across all * four sub-charts so they scale identically and stay column-aligned — * otherwise rows with fewer special-element columns would scale up larger). */ _contentWidth?: number; } export interface ToothSchemeHandle { /** Programmatically focus a tooth by FDI id. */ focusTooth: (id: FdiId) => void; /** Read the current chart state. */ getChart: () => ToothChart; /** * Read the built-in findings recorded on one tooth (empty array if none). * Registry ids are omitted — use `getSymbols` for the full list. */ getTooth: (id: FdiId) => ToothCondition[]; /** Read the findings on one tooth as symbols, with surfaces, roots and status. */ getSymbols: (id: FdiId) => ToothSymbol[]; /** Read the FDI ids of every tooth carrying a given finding. */ teethWith: (condition: ToothCondition) => FdiId[]; /** As `teethWith`, but open to a `conditionRegistry` id. */ teethWithSymbol: (condition: ConditionId) => FdiId[]; /** Add a finding to a tooth (no-op if already present). Optionally mark surfaces. */ setFinding: (id: FdiId, condition: ToothCondition, surfaces?: Surface[]) => void; /** * Add or replace one symbol on a tooth — the surface-, root- and * status-aware form of `setFinding`. Matched by `symbol.id` when the symbol * carries provenance, else by its condition. */ setSymbol: (id: FdiId, symbol: ToothSymbol) => void; /** Remove a finding from a tooth (no-op if absent). */ removeFinding: (id: FdiId, condition: ToothCondition) => void; /** Clear every finding from a tooth. */ clearTooth: (id: FdiId) => void; /** Read the radiographs attached to one tooth (empty array if none). */ getRadiographs: (id: FdiId) => Radiograph[]; /** Read the FDI ids of every tooth carrying at least one radiograph. */ teethWithRadiographs: () => FdiId[]; /** Focus a tooth and open its radiograph archive (fires `onOpenRadiographs`). */ openRadiographs: (id: FdiId) => void; } declare const rootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string; export declare const ToothScheme: import("react").ForwardRefExoticComponent>; export { rootVariants as toothSchemeVariants, PERMANENT_TEETH, PRIMARY_TEETH }; export type { Dentition, FdiId, Numbering, SpecialElement, ToothChart, ToothCondition, ToothMode, ToothState, } from './tooth-data'; //# sourceMappingURL=tooth-scheme.d.ts.map