react-advanced-odontogram 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,132 +1,284 @@
1
+ import { Bundle } from 'fhir/r4';
1
2
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
+ import { ReactNode } from 'react';
4
+ import { Resource } from 'fhir/r4';
2
5
 
3
6
  /** User accepted the divergence: run the deferred edit (status only — the plan
4
7
  * stays as planned), then notify (post-edit refresh + close the modal). No-op
5
8
  * when nothing is pending. */
6
9
  export declare function acceptDualStateConfirm(): void;
7
10
 
8
- declare type Any = any;
11
+ export declare type ActiveCaries = {
12
+ surfaces: ActiveCariesSurface[];
13
+ subcrownChecked: boolean;
14
+ subcrownDisabled: boolean;
15
+ subcrownLabel: string;
16
+ cariesActiveDepth: number;
17
+ rootCariesDisplay: string;
18
+ cariesDepthVisible: boolean;
19
+ rootCariesVisible: boolean;
20
+ cariesSectionVisible: boolean;
21
+ };
9
22
 
10
- declare function App({ language, onLanguageChange, numberingSystem, onNumberingChange, darkMode, onDarkModeChange, themeConfig, plugins, readOnly: readOnlyProp, enableNotes, enableIcdas, pulpDetailLevel, secondaryCariesMode, rootCariesMode, radiographicDepthMode, cariesDepthEnabled, wearDetailLevel, discolorationDetailLevel, surfaceNotation, showStatusCard: showStatusCardProp, showOrthoCard: showOrthoCardProp, }: AppProps): JSX_2.Element;
11
- export { App as OdontogramShell }
12
- export default App;
23
+ /** One caries surface-cross cell's fully-resolved render state. */
24
+ export declare type ActiveCariesSurface = {
25
+ value: string;
26
+ surface: string;
27
+ pos: string;
28
+ letter: string;
29
+ label: string;
30
+ checked: boolean;
31
+ disabled: boolean;
32
+ depth: string;
33
+ icdas: number;
34
+ isIcdas: boolean;
35
+ radio: string | null;
36
+ };
37
+
38
+ /** The active-tooth diagnoses card view-model (return shape of
39
+ * {@link getActiveDiagnoses}). */
40
+ export declare type ActiveDiagnoses = {
41
+ visible: boolean;
42
+ rows: ActiveDiagnosisRow[];
43
+ addableKeys: {
44
+ key: string;
45
+ icd10: string;
46
+ }[];
47
+ };
48
+
49
+ /** One row in the active-tooth diagnoses card: a RAW rule-derived key (whether
50
+ * or not it's currently suppressed) or a key the user explicitly ADDED that no
51
+ * rule would have derived. */
52
+ export declare type ActiveDiagnosisRow = {
53
+ key: string;
54
+ icd10: string;
55
+ source: "derived" | "added";
56
+ suppressed: boolean;
57
+ };
58
+
59
+ export declare type ActiveFillings = {
60
+ surfaces: ActiveFillingSurface[];
61
+ fillingMaterial: string;
62
+ fillingOptions: {
63
+ value: string;
64
+ label: string;
65
+ }[];
66
+ surfaceGridVisible: boolean;
67
+ defectDisabled: boolean;
68
+ simpleMode: boolean;
69
+ simpleRowVisible: boolean;
70
+ simpleToggleChecked: boolean;
71
+ simpleDefectRowVisible: boolean;
72
+ simpleDefectValue: string;
73
+ simpleDefectOptions: {
74
+ value: string;
75
+ label: string;
76
+ }[];
77
+ fissureSealing: boolean;
78
+ fissureRowVisible: boolean;
79
+ fillingSectionVisible: boolean;
80
+ subcariesSummary: string;
81
+ defectSummary: string;
82
+ };
83
+
84
+ /** One filling-surface cell's fully-resolved render state (mirrors the DOM the
85
+ * imperative `buildSurfaceCross` + `syncFillingSubcariesIndicator` +
86
+ * `syncFillingDefectIndicator` produced for `#fillingSurfaceChecks`). */
87
+ export declare type ActiveFillingSurface = {
88
+ value: string;
89
+ surface: string;
90
+ pos: string;
91
+ letter: string;
92
+ label: string;
93
+ labelId: string;
94
+ checked: boolean;
95
+ material: string;
96
+ hasSubcaries: boolean;
97
+ subDepth: string;
98
+ subIcdas: number;
99
+ isIcdas: boolean;
100
+ hasDefect: boolean;
101
+ defectValue: string | null;
102
+ };
103
+
104
+ export declare type ActiveOrtho = {
105
+ appliance: string;
106
+ drift: string;
107
+ vertical: string;
108
+ rotation: boolean;
109
+ visible: boolean;
110
+ };
111
+
112
+ export declare type ActiveRootPerio = {
113
+ sectionVisible: boolean;
114
+ rootBlockVisible: boolean;
115
+ perioBlockVisible: boolean;
116
+ pulpEndoValue: string;
117
+ pulpEndoNoneOption: RootPerioOption | null;
118
+ pulpEndoGroups: RootPerioOptGroup[];
119
+ pulpEndoDisabled: boolean;
120
+ apicalDxValue: string;
121
+ apicalDxOptions: RootPerioOption[];
122
+ apicalDxDisabled: boolean;
123
+ apicalDxRowVisible: boolean;
124
+ periapicalTypeValue: string;
125
+ periapicalTypeOptions: RootPerioOption[];
126
+ periapicalRowVisible: boolean;
127
+ resorptionValue: string;
128
+ resorptionOptions: RootPerioOption[];
129
+ resorptionDisabled: boolean;
130
+ resorptionRowVisible: boolean;
131
+ endoResectionChecked: boolean;
132
+ endoResectionDisabled: boolean;
133
+ parapulpalPinChecked: boolean;
134
+ parapulpalPinDisabled: boolean;
135
+ mobilityValue: string;
136
+ mobilityOptions: RootPerioOption[];
137
+ mobilityDisabled: boolean;
138
+ mobilityRowVisible: boolean;
139
+ perioRowVisible: boolean;
140
+ mods: ActiveRootPerioMod[];
141
+ calculusChecked: boolean;
142
+ calculusRowVisible: boolean;
143
+ periImplantValue: string;
144
+ periImplantOptions: RootPerioOption[];
145
+ periImplantRowVisible: boolean;
146
+ };
147
+
148
+ /** One `#modsChecks` checkbox's fully-resolved render state. `hiddenClass`
149
+ * reproduces the `.hidden` class the sub-syncs toggled on the wrapping
150
+ * `<label>`; `styleHidden` reproduces the `style.display:none` the
151
+ * `setDisabled()`→`syncControlLabelVisibility()` path applied. */
152
+ export declare type ActiveRootPerioMod = {
153
+ value: string;
154
+ label: string;
155
+ checked: boolean;
156
+ disabled: boolean;
157
+ hiddenClass: boolean;
158
+ styleHidden: boolean;
159
+ };
160
+
161
+ export declare type ActiveToothDetails = {
162
+ toothSelectValue: string;
163
+ toothSelectOptions: ToothDetailsOption[];
164
+ substrateValue: string;
165
+ substrateOptions: ToothDetailsOption[];
166
+ substrateRowVisible: boolean;
167
+ extractionWoundChecked: boolean;
168
+ extractionRowVisible: boolean;
169
+ missingClosedChecked: boolean;
170
+ missingClosedRowVisible: boolean;
171
+ restorationValue: string;
172
+ restorationOptions: ToothDetailsOption[];
173
+ restorationRowVisible: boolean;
174
+ crownLeakageChecked: boolean;
175
+ crownLeakageRowVisible: boolean;
176
+ brokenMesialChecked: boolean;
177
+ brokenIncisalChecked: boolean;
178
+ brokenDistalChecked: boolean;
179
+ brokenCrownRowVisible: boolean;
180
+ contactMesialChecked: boolean;
181
+ contactDistalChecked: boolean;
182
+ contactPointRowVisible: boolean;
183
+ bruxismRowVisible: boolean;
184
+ wearSimple: boolean;
185
+ wearEdgeValue: string;
186
+ wearEdgeOptions: ToothDetailsOption[];
187
+ wearEdgeToggleChecked: boolean;
188
+ wearCervicalValue: string;
189
+ wearCervicalOptions: ToothDetailsOption[];
190
+ wearCervicalToggleChecked: boolean;
191
+ discolorationRowVisible: boolean;
192
+ discoSimple: boolean;
193
+ discolorationValue: string;
194
+ discolorationOptions: ToothDetailsOption[];
195
+ discolorationToggleChecked: boolean;
196
+ crownActionsRowVisible: boolean;
197
+ bridgePillarChecked: boolean;
198
+ bridgePillarRowVisible: boolean;
199
+ extractionPlanChecked: boolean;
200
+ extractionPlanRowVisible: boolean;
201
+ extractionPlanParent: ExtractionPlanParent;
202
+ crownReplaceChecked: boolean;
203
+ crownReplaceRowVisible: boolean;
204
+ crownNeededChecked: boolean;
205
+ crownNeededRowVisible: boolean;
206
+ };
207
+
208
+ /** Add a tooth-level diagnosis by writing its chart axis on the selection — a
209
+ * real finding (glyph + derived + exported), through the same DS-1-gated,
210
+ * repainting path as the clinical controls. Prototype-safe key guard; a
211
+ * non-reverse-mappable key (e.g. `caries`) is a silent no-op. */
212
+ export declare function addDiagnosisToSelection(key: string): void;
213
+
214
+ declare type Any = any;
13
215
 
14
216
  /**
15
- * Props for the main Odontogram application component.
217
+ * Root React component for the Odontogram Editor (aka `OdontogramShell`).
16
218
  *
17
- * All props are optional — when omitted, the component operates in
18
- * **standalone** mode with internal state. When provided, the component
19
- * operates in **controlled** mode and delegates state to the parent.
219
+ * Renders the full dental chart UI: top bar with language/numbering/dark-mode
220
+ * controls, the SVG tooth grid, and the right-hand control panel for setting
221
+ * tooth states (caries, fillings, crowns, endo, inflammation, etc.).
222
+ *
223
+ * Since the composable-UI refactor (design/composable-ui.md, Tier 1) this is a
224
+ * THIN composition: it mounts {@link OdontogramProvider} (which owns all state,
225
+ * effects and handlers) and lays out the four surface components + the
226
+ * shell-managed perio bits and modals in the default arrangement. The default
227
+ * composition renders byte-identical DOM to the pre-refactor shell (frozen by
228
+ * `src/__tests__/parity/shell-dom.test.tsx`). A host can instead compose the
229
+ * exported surfaces under its own wrappers inside an `OdontogramProvider`.
230
+ *
231
+ * @example
232
+ * ```tsx
233
+ * // Standalone usage
234
+ * <App />
235
+ *
236
+ * // Controlled by a host application
237
+ * <App
238
+ * language="en"
239
+ * onLanguageChange={setLang}
240
+ * numberingSystem="FDI"
241
+ * onNumberingChange={setNumbering}
242
+ * darkMode={isDark}
243
+ * onDarkModeChange={setDark}
244
+ * />
245
+ * ```
20
246
  */
21
- declare type AppProps = {
22
- /** Override the UI language (controlled mode). */
23
- language?: Language;
24
- /** Callback when the user changes the language. */
25
- onLanguageChange?: (lang: Language) => void;
26
- /** Override the tooth numbering system (controlled mode). */
27
- numberingSystem?: NumberingSystem;
28
- /** Callback when the user changes the numbering system. */
29
- onNumberingChange?: (system: NumberingSystem) => void;
30
- /** Override dark mode state (controlled mode). */
31
- darkMode?: boolean;
32
- /** Callback when the user toggles dark mode. */
33
- onDarkModeChange?: (dark: boolean) => void;
34
- /**
35
- * Custom theme configuration. Overrides the default color palette via
36
- * CSS custom properties (`--odon-*`). See {@link OdontogramThemeConfig}.
37
- */
38
- themeConfig?: OdontogramThemeConfig;
39
- /**
40
- * Custom SVG plugins for extending the odontogram with additional visual
41
- * overlays and per-tooth custom state. See {@link OdontogramPlugin}.
42
- */
43
- plugins?: OdontogramPlugin[];
44
- /**
45
- * When true, disables all interactions (click, touch, keyboard).
46
- * Useful for print/report/view modes.
47
- */
48
- readOnly?: boolean;
49
- /**
50
- * When true, enables per-tooth notes. Double-click a tooth to add/edit a note.
51
- * Notes are shown in hover tooltips and included in JSON export/import.
52
- */
53
- enableNotes?: boolean;
54
- /**
55
- * Enable ICDAS II per-surface caries scoring (0–6). When enabled, the depth
56
- * selector/popup expose ICDAS codes 1–6 and the surface indicator shows a
57
- * numeric badge; otherwise the 3-level scale is used.
58
- */
59
- enableIcdas?: boolean;
60
- /**
61
- * Pulp-diagnosis detail level for the pulp control:
62
- * `"simple"` (healthy / pulpitis), `"aae"` (4 AAE pulp diagnoses, default) or
63
- * `"latin"` (9 practical-Latin subtypes). A stored value round-trips at every
64
- * level; the level only governs how the pulp control presents it.
65
- */
66
- pulpDetailLevel?: PulpDetailLevel;
67
- /**
68
- * Secondary-caries (CARS) granularity for the per-surface score picker:
69
- * `"simple"` ([0,3]), `"standard"` ([0,1,3,6], default) or `"full"` ([0..6]).
70
- * A stored score round-trips at every mode; the mode only governs the offered
71
- * option list. (The mode UI lives in the Settings modal; this prop is the
72
- * controlled entry point.)
73
- */
74
- secondaryCariesMode?: SecondaryCariesMode;
75
- /**
76
- * Root-caries granularity for the per-tooth picker: `"simple"` (none /
77
- * present, default) or `"severity"` (the full none/active/arrested/
78
- * active-cavitated enum). Non-collapsing across modes.
79
- */
80
- rootCariesMode?: RootCariesMode;
81
- /**
82
- * Radiographic-depth granularity for the per-surface picker: `"off"`
83
- * (hidden, default), `"threeLevel"` (superficial/middle/deep) or `"detailed"`
84
- * (E1..D3). When off, the per-surface radiographic badge is not shown.
85
- */
86
- radiographicDepthMode?: RadiographicDepthMode;
87
- /**
88
- * Whether the visual caries-depth encoding (per-surface depth picker + the
89
- * opacity/contour depth tier in the render) is active. Default `true`; set
90
- * `false` to render caried surfaces at the SVG default with no depth tier.
91
- */
92
- cariesDepthEnabled?: boolean;
93
- /**
94
- * Detail level for the per-tooth wear control: `"simple"` (yes/no toggle for
95
- * attrition) or `"complex"` (wear type per edge and cervix, default).
96
- */
97
- wearDetailLevel?: ToothDetailLevel;
98
- /**
99
- * Detail level for the per-tooth discoloration control: `"simple"` (yes/no
100
- * toggle) or `"complex"` (choose the discoloration cause, default).
101
- */
102
- discolorationDetailLevel?: ToothDetailLevel;
103
- /**
104
- * Surface-notation mode for caries/filling surface letters + captions:
105
- * `"full"` (default) makes them position-aware (incisal on an anterior
106
- * tooth, labial on an anterior buccal surface, palatal on an upper lingual
107
- * surface) or `"simple"` (always the tooth-independent B/O/L set).
108
- */
109
- surfaceNotation?: SurfaceNotation;
110
- /**
111
- * Whether the Statuses panel (`#statusCard`) is shown. Default `true`. The
112
- * panel visibility is a settings-driven wrapper around the section — the
113
- * section's own imperative collapse/expand behavior is unaffected.
114
- */
115
- showStatusCard?: boolean;
116
- /**
117
- * Whether the Orthodontics panel (`#orthoCard`) is shown. Default `true`.
118
- * Composes with the panel's own imperative ortho-eligibility gate (hidden
119
- * when no selected tooth is ortho-eligible) — both must be satisfied for
120
- * the panel to render.
121
- */
122
- showOrthoCard?: boolean;
123
- };
247
+ declare function App(props: Omit<OdontogramProviderProps, "children">): JSX_2.Element;
248
+ export { App as OdontogramShell }
249
+ export default App;
250
+
251
+ /** Apply the MIXED dentition preset — see {@link applyPrimaryDentition}; gated
252
+ * STRUCTURAL edit with per-tooth no-op signaling and the `edentulous` flip
253
+ * inside the gated closure. */
254
+ export declare function applyMixedDentition(): void;
255
+
256
+ /** Apply the PRIMARY (deciduous) dentition preset — a STRUCTURAL
257
+ * interactive edit (not a reset), routed through the batch gate. `targetFor`
258
+ * is the state each tooth ends up in; only teeth that actually change are
259
+ * passed to the gate so unchanged teeth are not marked plan-edited / mirrored
260
+ * (per-tooth no-op signaling). Uninitialized plan stays a pure passthrough.
261
+ * The `edentulous` flip + button state live INSIDE the gated closure so on the
262
+ * deferred-confirm path they take effect only on Accept — otherwise Cancel
263
+ * would leave `edentulous` flipped while every tooth
264
+ * is untouched (flag/teeth mismatch). `notifyStateChange()` moves inside too so
265
+ * the whole-mouth refresh fires when the batch actually applies. */
266
+ export declare function applyPrimaryDentition(): void;
267
+
268
+ export declare function applyStatusExtra(option: Any): void;
124
269
 
125
270
  /** User cancelled: do NOT apply the edit; re-sync the active tooth's controls
126
271
  * from stored state so the control the user just changed snaps back (no stale
127
272
  * UI), then notify (refresh + close the modal). No-op when nothing is pending. */
128
273
  export declare function cancelDualStateConfirm(): void;
129
274
 
275
+ export declare function CariesCard(): JSX_2.Element;
276
+
277
+ /** Case-level (whole-mouth / regional) dental diagnosis identifiers — authored
278
+ * on the case, not derived from a tooth. Separate from the tooth-level
279
+ * `DiagnosisKey`/`DX_CODES`. */
280
+ declare type CaseConditionKey = "jawSizeAnomaly" | "jawBaseAnomaly" | "archRelationAnomaly" | "toothPositionAnomaly" | "malocclusionUnspecified" | "dentofacialFunctional" | "tmjDisorder" | "odontogenicCyst" | "nonOdontogenicCyst" | "jawCystOther" | "oralCystOther" | "salivaryAtrophy" | "salivaryHypertrophy" | "sialadenitis" | "salivaryAbscess" | "salivaryFistula" | "sialolithiasis" | "mucocele" | "salivarySecretion" | "recurrentAphthae" | "stomatitisOther" | "oralCellulitis" | "oralMucositis" | "anodontia" | "hereditaryStructure" | "lipDisease" | "leukoplakia" | "mucosalLesionOther";
281
+
130
282
  declare type ChartMode = "status" | "plan";
131
283
 
132
284
  /** Remove the stored entry for the active (or default) key. */
@@ -141,6 +293,28 @@ export declare function clearSelection(): void;
141
293
  /** Close the perio-chart overlay. No-op (still notifies) if already closed. */
142
294
  export declare function closePerioOverlay(): void;
143
295
 
296
+ /**
297
+ * A national code overlay. `translation` packs keep the WHO codes and only
298
+ * localize the display (cheap: BNO-10, MKCH-10, and the dental chapter of
299
+ * ICD-10-GM/CIM-10). `modification` packs remap the code itself (US ICD-10-CM,
300
+ * added in DX-5).
301
+ */
302
+ declare interface CodingPack {
303
+ id: string;
304
+ system: string;
305
+ kind: "translation" | "modification";
306
+ displays?: Partial<Record<DiagnosisKey, string>>;
307
+ caseDisplays?: Partial<Record<CaseConditionKey, string>>;
308
+ codes?: Partial<Record<DiagnosisKey, {
309
+ code: string;
310
+ display: string;
311
+ }>>;
312
+ caseCodes?: Partial<Record<CaseConditionKey, {
313
+ code: string;
314
+ display: string;
315
+ }>>;
316
+ }
317
+
144
318
  /**
145
319
  * Tear down the odontogram engine: clear all DOM elements built by the engine,
146
320
  * unsubscribe from i18n changes, and reset internal state. After this call,
@@ -148,6 +322,11 @@ export declare function closePerioOverlay(): void;
148
322
  */
149
323
  export declare function destroyOdontogram(): void;
150
324
 
325
+ export declare function DiagnosesCard(): JSX_2.Element;
326
+
327
+ /** Internal dental-diagnosis identifiers. Extended per DX sub-project. */
328
+ declare type DiagnosisKey = "caries" | "periodontitis" | "gingivitis" | "cariesCementum" | "cariesArrested" | "pulpitis" | "pulpNecrosis" | "apicalPeriodontitisAcute" | "apicalPeriodontitisChronic" | "radicularCyst" | "periapicalAbscess" | "periapicalAbscessSinus" | "condensingOsteitis" | "resorption" | "attrition" | "abrasion" | "erosion" | "abfraction" | "calculus" | "fluorosis" | "tetracyclineStain" | "postEruptiveColour" | "toothLoss" | "retainedRoot" | "toothFracture" | "periImplantMucositis" | "periImplantitis";
329
+
151
330
  /** Stop persisting. The stored entry is left in place (see clearPersistedState).
152
331
  * A pending debounced save is flushed first so the last edit isn't lost. */
153
332
  export declare function disablePersistence(): void;
@@ -164,7 +343,7 @@ export declare function enablePersistence(options?: PersistenceOptions): void;
164
343
  * @param options - Optional subject reference (e.g. "Patient/123"); when
165
344
  * omitted a placeholder Patient is embedded.
166
345
  */
167
- export declare function exportFhir(options?: FhirExportOptions): void;
346
+ export declare function exportFhir(options?: FhirExportOptions): Bundle<Resource>;
168
347
 
169
348
  /**
170
349
  * Export the odontogram as PNG or JPG. Renders the serialized SVG via the
@@ -201,6 +380,8 @@ export declare function exportStatus(): void;
201
380
 
202
381
  export declare function exportSvg(): Promise<void>;
203
382
 
383
+ export declare type ExtractionPlanParent = "brokenCrownRow" | "bruxismRow" | "crownActionsRow";
384
+
204
385
  /** Options for buildFhirBundle / exportFhir. */
205
386
  export declare interface FhirExportOptions {
206
387
  /**
@@ -209,8 +390,25 @@ export declare interface FhirExportOptions {
209
390
  * referenced by every Observation.
210
391
  */
211
392
  subject?: string;
393
+ /** Active national diagnosis coding pack (adds a second coding to each
394
+ * Condition). Resolved and passed by the export entry point. */
395
+ codingPack?: CodingPack;
396
+ /** Emit a SNOMED CT coding on each Condition when true (DX-6 overlay). Set
397
+ * from the `snomedEnabled` session flag by the export entry point. */
398
+ snomed?: boolean;
399
+ /** Embed the engine's own `CodeSystem` resource in the Bundle (default `true`)
400
+ * so validators can resolve the LOCAL_SYSTEM codes from the Bundle itself.
401
+ * Pass `false` for a leaner Bundle when the consumer already hosts the
402
+ * published `fhir/CodeSystem-odontogram.json`. */
403
+ includeCodeSystem?: boolean;
212
404
  }
213
405
 
406
+ /** Fillings card complexity — "complex" = per-surface grid (default), "simple"
407
+ * = one filled/not-filled toggle for the whole tooth. */
408
+ export declare type FillingComplexity = "complex" | "simple";
409
+
410
+ export declare function FillingsCard(): JSX_2.Element;
411
+
214
412
  /** Formats a tooth number for display using the active numbering system AND
215
413
  * the milktooth display-remap ({@link getDisplayedToothNumber}) — the exact
216
414
  * same formatting {@link getOdontogramSummary} uses for every tooth number
@@ -219,13 +417,49 @@ export declare interface FhirExportOptions {
219
417
  * identically, without duplicating the numbering/milktooth logic. */
220
418
  export declare function formatToothLabel(toothNo: number): string;
221
419
 
420
+ export declare function getActiveCaries(): ActiveCaries;
421
+
422
+ /** The active-tooth diagnoses card view-model — mirrors `getActiveRootPerio`'s
423
+ * active-tooth guard shape. `rows` covers the RAW derived set (each tagged
424
+ * `suppressed` per the tooth's `dxOverrides`) plus any `add`-mode override key
425
+ * that no rule derived; `addableKeys` is every other tooth-level diagnosis key
426
+ * not already covered by a row, for an "add a diagnosis" picker. Localized
427
+ * labels are resolved by the CARD via `t("dx."+key)` — this returns raw keys +
428
+ * codes only. `visible` is false (empty rows/addableKeys) with no active tooth
429
+ * or on a tooth that isn't naturally present (missing/implant/under-gum/
430
+ * extraction-socket — the same gate `deriveDentalDiagnoses` itself applies). */
431
+ export declare function getActiveDiagnoses(): ActiveDiagnoses;
432
+
433
+ export declare function getActiveFillings(): ActiveFillings;
434
+
435
+ export declare function getActiveOrtho(): ActiveOrtho | null;
436
+
437
+ export declare function getActiveRootPerio(): ActiveRootPerio;
438
+
439
+ export declare function getActiveToothDetails(): ActiveToothDetails;
440
+
222
441
  export declare function getCariesDepthEnabled(): boolean;
223
442
 
443
+ export declare function getCariesDepthOptions(): Array<{
444
+ value: number;
445
+ label: string;
446
+ title?: string;
447
+ }>;
448
+
224
449
  /** Current active chart mode ("status" | "plan"). */
225
450
  export declare function getChartMode(): ChartMode;
226
451
 
452
+ export declare function getDiagnosisCodingPack(): string;
453
+
227
454
  export declare function getDiscolorationDetailLevel(): ToothDetailLevel;
228
455
 
456
+ /** Read the whole-mouth edentulous flag. Backs the declarative Statuses card's
457
+ * `#btnEdentulous` `aria-pressed` via `useEngineState(getEdentulous)`, replacing
458
+ * the former imperative `setToggleButton($("#btnEdentulous"), …)` syncs — every
459
+ * path that flips `edentulous` fires `notifyStateChange()`, so the React button
460
+ * re-reads this and re-renders. */
461
+ export declare function getEdentulous(): boolean;
462
+
229
463
  export declare function getFillingComplexity(): "complex" | "simple";
230
464
 
231
465
  export declare function getFillingDefectEnabled(): boolean;
@@ -301,14 +535,72 @@ export declare function getRootCariesMode(): RootCariesMode;
301
535
 
302
536
  export declare function getSecondaryCariesMode(): SecondaryCariesMode;
303
537
 
538
+ export declare function getSnomedEnabled(): boolean;
539
+
304
540
  /**
305
541
  * Export the STATUS chart's payload — identical to exportStatus()'s JSON
306
542
  * (status-primary; unaffected by the current chart mode).
307
543
  */
308
544
  export declare function getStatusChart(): Any;
309
545
 
546
+ export declare function getStatusExtras(): ({
547
+ label: string;
548
+ id: string;
549
+ labelKey: string;
550
+ type: string;
551
+ teeth: number[];
552
+ material: string;
553
+ arch?: undefined;
554
+ missingMaterial?: undefined;
555
+ implants?: undefined;
556
+ missing?: undefined;
557
+ } | {
558
+ label: string;
559
+ id: string;
560
+ labelKey: string;
561
+ type: string;
562
+ arch: string;
563
+ material: string;
564
+ missingMaterial: string;
565
+ teeth?: undefined;
566
+ implants?: undefined;
567
+ missing?: undefined;
568
+ } | {
569
+ label: string;
570
+ id: string;
571
+ labelKey: string;
572
+ type: string;
573
+ arch: string;
574
+ teeth?: undefined;
575
+ material?: undefined;
576
+ missingMaterial?: undefined;
577
+ implants?: undefined;
578
+ missing?: undefined;
579
+ } | {
580
+ label: string;
581
+ id: string;
582
+ labelKey: string;
583
+ type: string;
584
+ arch: string;
585
+ implants: number[];
586
+ missing: number[];
587
+ teeth?: undefined;
588
+ material?: undefined;
589
+ missingMaterial?: undefined;
590
+ })[];
591
+
310
592
  export declare function getSurfaceNotation(): SurfaceNotation;
311
593
 
594
+ /** Current tooth-anatomy profile selector. Defaults to `"classic"`. */
595
+ export declare function getToothAnatomy(): ToothAnatomy;
596
+
597
+ /** A tooth's EFFECTIVE coded diagnoses (derived − suppressed + added), reused
598
+ * by both the tooltip ({@link getStateSummary}) and the whole-mouth summary
599
+ * ({@link getOdontogramSummary}). Reads the ACTIVE chart's tooth state (so
600
+ * it's transparently Status/Plan dual-state aware, like every other per-tooth
601
+ * getter). A tooth with no state (never touched) has no diagnoses. */
602
+ export declare function getToothDiagnoses(toothNo: number): ToothDiagnosis[];
603
+
312
604
  /**
313
605
  * Get a human-readable summary of all active states for a tooth.
314
606
  * Useful for building custom tooltip or info-panel UIs.
@@ -372,6 +664,8 @@ declare type Language = "hu" | "en" | "de" | "es" | "it" | "sk" | "pl" | "ru" |
372
664
  */
373
665
  declare type NumberingSystem = "FDI" | "UNIVERSAL" | "PALMER";
374
666
 
667
+ export declare function OdontogramChartSurface(): JSX_2.Element;
668
+
375
669
  /**
376
670
  * Custom SVG plugin definition for the Odontogram engine.
377
671
  *
@@ -419,6 +713,173 @@ export declare type OdontogramPlugin = {
419
713
  panelSection?: "custom";
420
714
  };
421
715
 
716
+ /**
717
+ * Owns all odontogram shell state, effects, and handlers and provides them to
718
+ * composed surfaces + modals. Renders only the `.odontogram-root` wrapper around
719
+ * `children` — no extra DOM node.
720
+ */
721
+ export declare function OdontogramProvider({ children, language, onLanguageChange, numberingSystem, onNumberingChange, darkMode, onDarkModeChange, themeConfig, plugins, readOnly: readOnlyProp, enableNotes, enableIcdas, pulpDetailLevel, secondaryCariesMode, rootCariesMode, radiographicDepthMode, cariesDepthEnabled, wearDetailLevel, discolorationDetailLevel, surfaceNotation, showStatusCard: showStatusCardProp, showOrthoCard: showOrthoCardProp, fillingComplexity, onFillingComplexityChange, fillingDefectEnabled: fillingDefectEnabledProp, onFillingDefectEnabledChange, fillingMaterialAvailability, onFillingMaterialAvailabilityChange, fissureSealingEnabled: fissureSealingEnabledProp, onFissureSealingEnabledChange, }: OdontogramProviderProps): JSX_2.Element;
722
+
723
+ /**
724
+ * Props for {@link OdontogramProvider} — the full former `OdontogramShell`
725
+ * (`App`) props surface plus the composed `children`. All state/behavior props
726
+ * are optional: when omitted the provider operates in **standalone** mode with
727
+ * internal state; when provided it operates in **controlled** mode and delegates
728
+ * state to the parent.
729
+ */
730
+ declare type OdontogramProviderProps = {
731
+ /** Override the UI language (controlled mode). */
732
+ language?: Language;
733
+ /** Callback when the user changes the language. */
734
+ onLanguageChange?: (lang: Language) => void;
735
+ /** Override the tooth numbering system (controlled mode). */
736
+ numberingSystem?: NumberingSystem;
737
+ /** Callback when the user changes the numbering system. */
738
+ onNumberingChange?: (system: NumberingSystem) => void;
739
+ /** Override dark mode state (controlled mode). */
740
+ darkMode?: boolean;
741
+ /** Callback when the user toggles dark mode. */
742
+ onDarkModeChange?: (dark: boolean) => void;
743
+ /**
744
+ * Custom theme configuration. Overrides the default color palette via
745
+ * CSS custom properties (`--odon-*`). See {@link OdontogramThemeConfig}.
746
+ */
747
+ themeConfig?: OdontogramThemeConfig;
748
+ /**
749
+ * Custom SVG plugins for extending the odontogram with additional visual
750
+ * overlays and per-tooth custom state. See {@link OdontogramPlugin}.
751
+ */
752
+ plugins?: OdontogramPlugin[];
753
+ /**
754
+ * When true, disables all interactions (click, touch, keyboard).
755
+ * Useful for print/report/view modes.
756
+ */
757
+ readOnly?: boolean;
758
+ /**
759
+ * When true, enables per-tooth notes. Double-click a tooth to add/edit a note.
760
+ * Notes are shown in hover tooltips and included in JSON export/import.
761
+ */
762
+ enableNotes?: boolean;
763
+ /**
764
+ * Enable ICDAS II per-surface caries scoring (0–6). When enabled, the depth
765
+ * selector/popup expose ICDAS codes 1–6 and the surface indicator shows a
766
+ * numeric badge; otherwise the 3-level scale is used.
767
+ */
768
+ enableIcdas?: boolean;
769
+ /**
770
+ * Pulp-diagnosis detail level for the pulp control:
771
+ * `"simple"` (healthy / pulpitis), `"aae"` (4 AAE pulp diagnoses, default) or
772
+ * `"latin"` (9 practical-Latin subtypes). A stored value round-trips at every
773
+ * level; the level only governs how the pulp control presents it.
774
+ */
775
+ pulpDetailLevel?: PulpDetailLevel;
776
+ /**
777
+ * Secondary-caries (CARS) granularity for the per-surface score picker:
778
+ * `"simple"` ([0,3]), `"standard"` ([0,1,3,6], default) or `"full"` ([0..6]).
779
+ * A stored score round-trips at every mode; the mode only governs the offered
780
+ * option list. (The mode UI lives in the Settings modal; this prop is the
781
+ * controlled entry point.)
782
+ */
783
+ secondaryCariesMode?: SecondaryCariesMode;
784
+ /**
785
+ * Root-caries granularity for the per-tooth picker: `"simple"` (none /
786
+ * present, default) or `"severity"` (the full none/active/arrested/
787
+ * active-cavitated enum). Non-collapsing across modes.
788
+ */
789
+ rootCariesMode?: RootCariesMode;
790
+ /**
791
+ * Radiographic-depth granularity for the per-surface picker: `"off"`
792
+ * (hidden, default), `"threeLevel"` (superficial/middle/deep) or `"detailed"`
793
+ * (E1..D3). When off, the per-surface radiographic badge is not shown.
794
+ */
795
+ radiographicDepthMode?: RadiographicDepthMode;
796
+ /**
797
+ * Whether the visual caries-depth encoding (per-surface depth picker + the
798
+ * opacity/contour depth tier in the render) is active. Default `true`; set
799
+ * `false` to render caried surfaces at the SVG default with no depth tier.
800
+ */
801
+ cariesDepthEnabled?: boolean;
802
+ /**
803
+ * Detail level for the per-tooth wear control: `"simple"` (yes/no toggle for
804
+ * attrition) or `"complex"` (wear type per edge and cervix, default).
805
+ */
806
+ wearDetailLevel?: ToothDetailLevel;
807
+ /**
808
+ * Detail level for the per-tooth discoloration control: `"simple"` (yes/no
809
+ * toggle) or `"complex"` (choose the discoloration cause, default).
810
+ */
811
+ discolorationDetailLevel?: ToothDetailLevel;
812
+ /**
813
+ * Surface-notation mode for caries/filling surface letters + captions:
814
+ * `"full"` (default) makes them position-aware (incisal on an anterior
815
+ * tooth, labial on an anterior buccal surface, palatal on an upper lingual
816
+ * surface) or `"simple"` (always the tooth-independent B/O/L set).
817
+ */
818
+ surfaceNotation?: SurfaceNotation;
819
+ /**
820
+ * Whether the Statuses panel (`#statusCard`) is shown. Default `true`. The
821
+ * panel visibility is a settings-driven wrapper around the section — the
822
+ * section's own imperative collapse/expand behavior is unaffected.
823
+ */
824
+ showStatusCard?: boolean;
825
+ /**
826
+ * Whether the Orthodontics panel (`#orthoCard`) is shown. Default `true`.
827
+ * Composes with the panel's own imperative ortho-eligibility gate (hidden
828
+ * when no selected tooth is ortho-eligible) — both must be satisfied for
829
+ * the panel to render.
830
+ */
831
+ showOrthoCard?: boolean;
832
+ /**
833
+ * Filling-complexity level for the Fillings card: `"simple"` (one material
834
+ * per tooth, no per-surface picker) or `"complex"` (per-surface materials,
835
+ * default). Contrast with {@link settings.panels} — this one mirrors the
836
+ * `fillingComplexity` engine flag (Settings → Fillings). When provided, the
837
+ * value overrides the engine/UI default; when omitted, whatever the engine
838
+ * holds (module default or a prior `setFillingComplexity` call) stays put.
839
+ */
840
+ fillingComplexity?: FillingComplexity;
841
+ /**
842
+ * Called after the user changes the filling-complexity level in the
843
+ * Settings modal: `(value: FillingComplexity) => void`. Not fired for
844
+ * prop-driven restores. The write-back counterpart of {@link fillingComplexity}.
845
+ */
846
+ onFillingComplexityChange?: (value: FillingComplexity) => void;
847
+ /**
848
+ * Whether filling-defect findings are enabled on the Fillings card. Default
849
+ * `true`. Mirrors the `fillingDefectEnabled` engine flag (Settings →
850
+ * Fillings); same controlled/standalone contract as {@link fillingComplexity}.
851
+ */
852
+ fillingDefectEnabled?: boolean;
853
+ /** See {@link onFillingComplexityChange} — the defect toggle's counterpart. */
854
+ onFillingDefectEnabledChange?: (enabled: boolean) => void;
855
+ /**
856
+ * Available filling materials as a `Record<material, boolean>` over
857
+ * `"amalgam" | "composite" | "gic" | "temporary"` (unknown keys are
858
+ * ignored). Default: all four available. Mirrors the `fillingMaterialAvail`
859
+ * engine map (Settings → Fillings). Hosts may pass an inline literal — the
860
+ * sync effect keys on a canonical serialized form, so re-renders with
861
+ * identical content do not re-fire.
862
+ */
863
+ fillingMaterialAvailability?: Record<string, boolean>;
864
+ /**
865
+ * Called after the user toggles a material in the Settings modal:
866
+ * `(material: string, enabled: boolean) => void` — per-material, mirroring
867
+ * the engine's `setFillingMaterialAvailability` setter (no whole-record
868
+ * change ever happens). Not fired for prop-driven restores.
869
+ */
870
+ onFillingMaterialAvailabilityChange?: (material: string, enabled: boolean) => void;
871
+ /**
872
+ * Whether fissure-sealing is offered on the Fillings card. Default `true`.
873
+ * Mirrors the `fissureSealingEnabled` engine flag (Settings → Fillings);
874
+ * same controlled/standalone contract as {@link fillingComplexity}.
875
+ */
876
+ fissureSealingEnabled?: boolean;
877
+ /** See {@link onFillingComplexityChange} — the fissure-sealing toggle's counterpart. */
878
+ onFissureSealingEnabledChange?: (enabled: boolean) => void;
879
+ /** The composed UI (surfaces + shell layout). */
880
+ children?: ReactNode;
881
+ };
882
+
422
883
  /** Structured, already-localized textual summary of the whole odontogram. */
423
884
  export declare type OdontogramSummary = {
424
885
  overview: string;
@@ -523,6 +984,56 @@ declare interface OdontogramToothTable {
523
984
  legend: string;
524
985
  }
525
986
 
987
+ export declare function OdontogramTopbar(): JSX_2.Element;
988
+
989
+ /**
990
+ * Everything the surface components and shell-managed modals consume. Cross-cutting
991
+ * state read across ≥2 regions/modals lives here; strictly region-local state
992
+ * (the header dropdown open flags + outside-click effect) stays inside its surface.
993
+ */
994
+ export declare type OdontogramUiContextValue = {
995
+ t: TranslateFn;
996
+ lang: Language;
997
+ setLang: (lang: Language) => void;
998
+ isDark: boolean;
999
+ toggleDark: () => void;
1000
+ currentNumbering: NumberingSystem;
1001
+ setNumbering: (next: NumberingSystem) => void;
1002
+ viewMode: PerioViewMode;
1003
+ activeView: "odontogram" | "dentalChart";
1004
+ setActiveView: (view: "odontogram" | "dentalChart") => void;
1005
+ isPerioView: boolean;
1006
+ perioChartAvailable: boolean;
1007
+ perioOpen: boolean;
1008
+ confirmOpen: boolean;
1009
+ hasPerio: boolean;
1010
+ exportPngOn: boolean;
1011
+ exportJpgOn: boolean;
1012
+ exportSvgOn: boolean;
1013
+ exportPdfOn: boolean;
1014
+ importStatusOn: boolean;
1015
+ importFhirOn: boolean;
1016
+ summary: OdontogramSummary | null;
1017
+ toothInfoOn: boolean;
1018
+ screenSpacing: ScreenToothSpacing;
1019
+ screenNumberSize: ScreenToothNumberSize;
1020
+ selectionColor: string;
1021
+ selectionBorderStyle: SelectionBorderStyle;
1022
+ toothAnatomy: ToothAnatomy;
1023
+ planModeAvailable: boolean;
1024
+ showStatusCard: boolean;
1025
+ showOrthoCard: boolean;
1026
+ settingsState: SettingsState;
1027
+ settingsOpen: boolean;
1028
+ setSettingsOpen: (open: boolean) => void;
1029
+ pdfOpen: boolean;
1030
+ setPdfOpen: (open: boolean) => void;
1031
+ creditsOpen: boolean;
1032
+ setCreditsOpen: (open: boolean) => void;
1033
+ caseDxOpen: boolean;
1034
+ setCaseDxOpen: (open: boolean) => void;
1035
+ };
1036
+
526
1037
  /**
527
1038
  * Subscribe to odontogram state changes. The callback runs after any tooth
528
1039
  * state edit, the edentulous toggle, or an import.
@@ -532,9 +1043,29 @@ declare interface OdontogramToothTable {
532
1043
  */
533
1044
  export declare function onStateChange(cb: () => void): () => void;
534
1045
 
1046
+ /** Public entry point for the declarative `CariesCard`'s per-surface `.surf-depth`
1047
+ * indicator click: opens the contextual severity popup for `surface`, anchored
1048
+ * to `anchor`, on the currently-active tooth — the exact call `wireControls()`
1049
+ * made (`showCariesDepthPopup(surface, ind, activeTooth)`). Kept as a thin
1050
+ * wrapper so the popup overlay itself stays imperative (module-private state:
1051
+ * `activeTooth` / `applyToSelected`). */
1052
+ export declare function openCariesDepthPopup(surface: string, anchor: HTMLElement): void;
1053
+
1054
+ /** Public entry point for the declarative `FillingsCard`'s per-surface LEFT-side
1055
+ * `.surf-defect` indicator click: opens the contextual filling-defect popup for
1056
+ * `surface`, anchored to `anchor`, on the currently-active tooth — the exact
1057
+ * call `wireControls()` made (`showFillingDefectPopup(surface, ind,
1058
+ * activeTooth)`). Thin wrapper so the popup itself stays imperative. */
1059
+ export declare function openFillingDefectPopup(surface: string, anchor: HTMLElement): void;
1060
+
535
1061
  /** Open the perio-chart overlay. No-op (still notifies) if already open. */
536
1062
  export declare function openPerioOverlay(): void;
537
1063
 
1064
+ export declare function OrthodonticsCard(): JSX_2.Element;
1065
+
1066
+ /** Parameter map for template placeholders (`{{key}}`). */
1067
+ declare type Params = Record<string, string | number>;
1068
+
538
1069
  declare type PdfBorderThickness = "thin" | "medium" | "thick";
539
1070
 
540
1071
  /** Selectable report colour themes — the default is "blue"; the other three are
@@ -700,6 +1231,15 @@ export declare type PulpDetailLevel = "simple" | "aae" | "latin";
700
1231
 
701
1232
  export declare type RadiographicDepthMode = "off" | "threeLevel" | "detailed";
702
1233
 
1234
+ /**
1235
+ * Rebuild the SVG tooth grid after the chart column remounts (composable-UI
1236
+ * Tier 2). Preserves the current selection/active tooth across buildGrid()'s
1237
+ * internal reset, clears+rebuilds the four grid element maps, and bumps
1238
+ * `initToken` so any in-flight/toggle-spam build supersedes cleanly. No-op
1239
+ * before init or if a newer build/teardown supersedes this one mid-await.
1240
+ */
1241
+ export declare function rebuildGrid(): Promise<void>;
1242
+
703
1243
  /**
704
1244
  * Register one or more custom SVG plugins. Plugins can inject visual overlays
705
1245
  * into the tooth SVG and maintain per-tooth custom state included in export/import.
@@ -708,12 +1248,108 @@ export declare type RadiographicDepthMode = "off" | "threeLevel" | "detailed";
708
1248
  */
709
1249
  export declare function registerPlugins(plugins: OdontogramPlugin[]): void;
710
1250
 
1251
+ /** Remove a tooth-level diagnosis from the current selection: clears the
1252
+ * underlying chart axis (so the glyph disappears too, through the repainting
1253
+ * apply path) AND drops any coded-layer override (add/suppress) for the key.
1254
+ * The card's delete (×) uses this — the full inverse of
1255
+ * {@link addDiagnosisToSelection}, extended to `caries` (clears the surfaces)
1256
+ * so every listed diagnosis is fully removable. Prototype-safe key guard. */
1257
+ export declare function removeDiagnosisFromSelection(key: string): void;
1258
+
1259
+ /** Reset the WHOLE mouth to a blank slate — the exact closure the imperative
1260
+ * `#btnResetAll` handler used, now called directly from the declarative Statuses
1261
+ * card's onClick. Clears the edentulous flag + case-level metadata, resets every
1262
+ * tooth to `defaultState()`, re-syncs the active tooth's controls, and notifies
1263
+ * once at the end so the mounted case-metadata/Statuses subscribers re-read the
1264
+ * cleared state. */
1265
+ export declare function resetMouth(): void;
1266
+
1267
+ /** Reset the whole current selection to `defaultState()` — the exact closure the
1268
+ * imperative `#btnResetTooth` handler used, now called from the declarative card
1269
+ * title button's onClick. */
1270
+ export declare function resetTooth(): void;
1271
+
1272
+ /**
1273
+ * Re-run control wiring after a controls surface remounts (composable-UI Tier 2).
1274
+ * `wireControls()` is idempotent per-element (bindOnce + populated-container
1275
+ * guards), so this wires ONLY the freshly-mounted nodes and leaves still-mounted
1276
+ * ones untouched; the trailing syncControlsFromState() re-derives the active
1277
+ * tooth's per-tooth option lists/values on the (possibly new) select nodes.
1278
+ * No-op before init (the provider's own init effect does the first wiring).
1279
+ */
1280
+ export declare function rewireControls(): void;
1281
+
711
1282
  export declare type RootCariesMode = "simple" | "severity";
712
1283
 
1284
+ /** Root-caries options at a given mode (defaults to the module setting).
1285
+ * simple -> none / present (present writes the canonical "active-cavitated"
1286
+ * enum — the most-severe value, so simple-mode "present" renders at full
1287
+ * opacity); severity -> the full rootCaries enum. Pure. */
1288
+ export declare function rootCariesOptions(mode?: RootCariesMode): {
1289
+ value: string;
1290
+ label: string;
1291
+ }[];
1292
+
1293
+ export declare function RootPeriodontiumCard(): JSX_2.Element;
1294
+
1295
+ export declare type RootPerioOptGroup = {
1296
+ label: string;
1297
+ options: RootPerioOption[];
1298
+ };
1299
+
1300
+ export declare type RootPerioOption = {
1301
+ value: string;
1302
+ label: string;
1303
+ };
1304
+
1305
+ declare type ScreenToothNumberSize = "small" | "normal" | "xlarge";
1306
+
1307
+ /**
1308
+ * The full set of live setting values + change handlers the modal drives.
1309
+ *
1310
+ * Every field maps 1:1 to an existing App-level piece of state / module
1311
+ * accessor — the modal never owns behavior, it only surfaces the controls.
1312
+ * New settings are added here and wired into a tab's `render()`.
1313
+ */
1314
+ /** On-screen odontogram layout controls (distinct from the PDF/export
1315
+ * equivalents). Spacing = inter-tooth gap in the live grid; number size = the
1316
+ * tooth-number font size. Session-only, pure CSS via data-attributes on the
1317
+ * grid. */
1318
+ declare type ScreenToothSpacing = "wide" | "normal" | "close";
1319
+
713
1320
  export declare type SecondaryCariesMode = "simple" | "standard" | "full";
714
1321
 
1322
+ /** Selection-ring border style (default dashed). */
1323
+ declare type SelectionBorderStyle = "solid" | "dashed" | "dotted";
1324
+
1325
+ /** Apical (AAE) diagnosis on the current selection — clears the periapical
1326
+ * lesion subtype unless the diagnosis is (a)symptomatic apical periodontitis. */
1327
+ export declare function setApicalDxForSelection(value: string): void;
1328
+
1329
+ /** Bridge-abutment toggle on the current selection. */
1330
+ export declare function setBridgePillarForSelection(on: boolean): void;
1331
+
1332
+ /** Broken distal corner toggle on the current selection. */
1333
+ export declare function setBrokenDistalForSelection(on: boolean): void;
1334
+
1335
+ /** Broken incisal corner toggle on the current selection. */
1336
+ export declare function setBrokenIncisalForSelection(on: boolean): void;
1337
+
1338
+ /** Broken mesial corner toggle on the current selection. */
1339
+ export declare function setBrokenMesialForSelection(on: boolean): void;
1340
+
1341
+ /** Calculus toggle on the current selection. */
1342
+ export declare function setCalculusForSelection(on: boolean): void;
1343
+
1344
+ /** Set the default (active) caries depth for newly-tapped surfaces. */
1345
+ export declare function setCariesActiveDepthForSelection(value: number): void;
1346
+
715
1347
  export declare function setCariesDepthEnabled(value: boolean): void;
716
1348
 
1349
+ /** Toggle one caries surface (or the subcrown) on the current selection —
1350
+ * wraps the exact `cariesOnToggle` closure `wireControls()` bound. */
1351
+ export declare function setCariesSurfaceForSelection(id: string, on: boolean): void;
1352
+
717
1353
  /**
718
1354
  * Switch the active chart between "status" (current findings) and "plan"
719
1355
  * (proposed treatment). The first time "plan" is entered, it is deep-cloned
@@ -728,16 +1364,79 @@ export declare function setCariesDepthEnabled(value: boolean): void;
728
1364
  */
729
1365
  export declare function setChartMode(mode: ChartMode): void;
730
1366
 
1367
+ /** Distal contact-loss toggle on the current selection. */
1368
+ export declare function setContactDistalForSelection(on: boolean): void;
1369
+
1370
+ /** Mesial contact-loss toggle on the current selection. */
1371
+ export declare function setContactMesialForSelection(on: boolean): void;
1372
+
1373
+ /** Crown marginal-leakage toggle on the current selection. */
1374
+ export declare function setCrownLeakageForSelection(on: boolean): void;
1375
+
1376
+ /** Crown-needed toggle on the current selection. */
1377
+ export declare function setCrownNeededForSelection(on: boolean): void;
1378
+
1379
+ /** Crown-replacement toggle on the current selection. */
1380
+ export declare function setCrownReplaceForSelection(on: boolean): void;
1381
+
1382
+ export declare function setDiagnosisCodingPack(id: string): void;
1383
+
731
1384
  export declare function setDiscolorationDetailLevel(value: ToothDetailLevel): void;
732
1385
 
1386
+ /** Discoloration cause on the current selection (complex-mode select). */
1387
+ export declare function setDiscolorationForSelection(value: string): void;
1388
+
1389
+ /** Discoloration simple-mode toggle (other / none) on the selection. */
1390
+ export declare function setDiscolorationToggleForSelection(on: boolean): void;
1391
+
1392
+ /** Add/suppress/clear one coded diagnosis on the current selection —
1393
+ * validates `key` against {@link TOOTH_LEVEL_DX_KEYS} and `mode` against
1394
+ * {@link VALID_DX_OVERRIDE_VALUE} (or `null`, which clears any existing
1395
+ * override for `key`); anything else is a silent no-op. Routed through
1396
+ * {@link gateToothEditBatch} directly (not `applyToSelected`) since
1397
+ * `dxOverrides` has no SVG/DOM side effect to re-render per tooth. */
1398
+ export declare function setDxOverrideForSelection(key: string, mode: "add" | "suppress" | null): void;
1399
+
1400
+ export declare function setEdentulous(on: Any): void;
1401
+
1402
+ /** Apicoectomy (resected tooth) toggle on the current selection. */
1403
+ export declare function setEndoResectionForSelection(on: boolean): void;
1404
+
1405
+ /** Planned-extraction toggle on the current selection. */
1406
+ export declare function setExtractionPlanForSelection(on: boolean): void;
1407
+
1408
+ /** Extraction-wound toggle on the current selection. */
1409
+ export declare function setExtractionWoundForSelection(on: boolean): void;
1410
+
733
1411
  export declare function setFillingComplexity(v: "complex" | "simple"): void;
734
1412
 
735
1413
  export declare function setFillingDefectEnabled(v: boolean): void;
736
1414
 
737
1415
  export declare function setFillingMaterialAvailability(material: string, v: boolean): void;
738
1416
 
1417
+ /** Set the active filling material on the current selection — wraps the exact
1418
+ * `#fillingSelect` closure `wireControls()` bound (clearing "none" removes any
1419
+ * orphaned per-surface fillings). */
1420
+ export declare function setFillingMaterialForSelection(mat: string): void;
1421
+
1422
+ /** Simple-mode filling-defect select — applies a defect to EVERY filled surface.
1423
+ * Wraps the `#fillingSimpleDefectSelect` closure. */
1424
+ export declare function setFillingSimpleDefectForSelection(value: string): void;
1425
+
1426
+ /** Simple-mode filled/not-filled toggle — applies the current material to ALL
1427
+ * surfaces (or clears them). Wraps the `#fillingSimpleToggle` closure. */
1428
+ export declare function setFillingSimpleToggleForSelection(on: boolean): void;
1429
+
1430
+ /** Toggle one filling surface on the current selection — wraps the exact
1431
+ * `buildSurfaceCross($("#fillingSurfaceChecks"), …)` closure. */
1432
+ export declare function setFillingSurfaceForSelection(surf: string, on: boolean): void;
1433
+
739
1434
  export declare function setFissureSealingEnabled(v: boolean): void;
740
1435
 
1436
+ /** Fissure-sealing toggle on the current selection. Wraps the `#fissureSealing`
1437
+ * closure. */
1438
+ export declare function setFissureSealingForSelection(on: boolean): void;
1439
+
741
1440
  /** Toggle visibility of the healthy-pulp layer on all teeth. */
742
1441
  export declare function setHealthyPulpVisible(on: Any): void;
743
1442
 
@@ -746,6 +1445,16 @@ export declare function setIcdasEnabled(value: boolean): void;
746
1445
  /** Set which parser the next file import uses. Defaults back to "status" after each import. */
747
1446
  export declare function setImportFormat(format: "status" | "fhir"): void;
748
1447
 
1448
+ /** Closed-gap toggle on the current selection. */
1449
+ export declare function setMissingClosedForSelection(on: boolean): void;
1450
+
1451
+ /** Tooth mobility grade on the current selection. */
1452
+ export declare function setMobilityForSelection(value: string): void;
1453
+
1454
+ /** Toggle one `#modsChecks` modifier (parodontal / inflammation) on the current
1455
+ * selection — wraps the exact set add/delete closure `wireControls()` bound. */
1456
+ export declare function setModForSelection(id: string, on: boolean): void;
1457
+
749
1458
  /**
750
1459
  * Enable or disable per-tooth notes. When enabled, double-clicking a tooth
751
1460
  * opens a note editor popover, and notes are shown in hover tooltips with
@@ -764,8 +1473,25 @@ export declare function setNumberingSystem(system: NumberingSystem): void;
764
1473
  /** Toggle visibility of occlusal-view tiles (premolars and molars). */
765
1474
  export declare function setOcclusalVisible(on: Any): void;
766
1475
 
1476
+ export declare function setOrthoApplianceForSelection(value: string): void;
1477
+
1478
+ export declare function setOrthoDriftForSelection(value: string): void;
1479
+
1480
+ export declare function setOrthoRotationForSelection(on: boolean): void;
1481
+
1482
+ export declare function setOrthoVerticalForSelection(value: string): void;
1483
+
1484
+ /** Parapulpal pin toggle on the current selection. */
1485
+ export declare function setParapulpalPinForSelection(on: boolean): void;
1486
+
767
1487
  export declare function setPdfSettings(patch: Partial<PdfSettings>): void;
768
1488
 
1489
+ /** Periapical lesion subtype on the current selection. */
1490
+ export declare function setPeriapicalTypeForSelection(value: string): void;
1491
+
1492
+ /** Peri-implant status on the current selection. */
1493
+ export declare function setPeriImplantForSelection(value: string): void;
1494
+
769
1495
  /** Switch the perio index-name display mode. No-op (does not notify) if unchanged. */
770
1496
  export declare function setPerioIndexNameMode(mode: PerioIndexNameMode): void;
771
1497
 
@@ -797,6 +1523,11 @@ export declare function setPluginState(toothNo: number, pluginId: string, value:
797
1523
 
798
1524
  export declare function setPulpDetailLevel(value: PulpDetailLevel): void;
799
1525
 
1526
+ /** Merged pulp/endo selection on the current selection — wraps the exact
1527
+ * `pulpEndoOnSelect` closure `wireControls()` bound (incl. the endo↔pulpDx
1528
+ * mutual-exclusion normalization). */
1529
+ export declare function setPulpEndoForSelection(value: string): void;
1530
+
800
1531
  export declare function setRadiographicDepthMode(value: RadiographicDepthMode): void;
801
1532
 
802
1533
  /**
@@ -808,6 +1539,19 @@ export declare function setRadiographicDepthMode(value: RadiographicDepthMode):
808
1539
  */
809
1540
  export declare function setReadOnly(value: boolean): void;
810
1541
 
1542
+ /** Root resorption type on the current selection. */
1543
+ export declare function setResorptionForSelection(value: string): void;
1544
+
1545
+ /** Combined restoration dropdown on the current selection — wraps the exact
1546
+ * `#restorationSelect` closure (`applyRestorationSelection` decode of
1547
+ * `${type}|${material}` / `prosthesis|<value>` + the trailing
1548
+ * `setEdentulous(false)`). */
1549
+ export declare function setRestorationForSelection(value: string): void;
1550
+
1551
+ /** Set the per-tooth root-caries value (the picker already emits the canonical
1552
+ * enum value; simple-mode "present" maps to "active-cavitated"). */
1553
+ export declare function setRootCariesForSelection(value: string): void;
1554
+
811
1555
  export declare function setRootCariesMode(value: RootCariesMode): void;
812
1556
 
813
1557
  export declare function setSecondaryCariesMode(value: SecondaryCariesMode): void;
@@ -815,20 +1559,190 @@ export declare function setSecondaryCariesMode(value: SecondaryCariesMode): void
815
1559
  /** Toggle visibility of the bone/gum base layer on all teeth. */
816
1560
  export declare function setShowBase(on: Any): void;
817
1561
 
1562
+ export declare function setSnomedEnabled(v: boolean): void;
1563
+
1564
+ /** Substrate (natural / radix / broken / crown-prep) on the current selection —
1565
+ * wraps the exact `#substrateSelect` closure (broken-part + crown-needed clears
1566
+ * and the trailing `setEdentulous(false)`). */
1567
+ export declare function setSubstrateForSelection(value: string): void;
1568
+
818
1569
  export declare function setSurfaceNotation(value: SurfaceNotation): void;
819
1570
 
1571
+ declare type SettingsState = {
1572
+ numbering: NumberingSystem;
1573
+ onNumbering: (value: NumberingSystem) => void;
1574
+ language: Language;
1575
+ onLanguage: (value: Language) => void;
1576
+ isDark: boolean;
1577
+ onToggleDark: () => void;
1578
+ toothInfo: boolean;
1579
+ onToothInfo: (value: boolean) => void;
1580
+ exportPng: boolean;
1581
+ onExportPng: (value: boolean) => void;
1582
+ exportJpg: boolean;
1583
+ onExportJpg: (value: boolean) => void;
1584
+ exportSvg: boolean;
1585
+ onExportSvg: (value: boolean) => void;
1586
+ exportPdf: boolean;
1587
+ onExportPdf: (value: boolean) => void;
1588
+ importStatus: boolean;
1589
+ onImportStatus: (value: boolean) => void;
1590
+ importFhir: boolean;
1591
+ onImportFhir: (value: boolean) => void;
1592
+ codingPack: string;
1593
+ onDiagnosisCodingPack: (value: string) => void;
1594
+ snomedEnabled: boolean;
1595
+ onSnomedEnabled: (value: boolean) => void;
1596
+ secondaryCariesMode: SecondaryCariesMode;
1597
+ onSecondaryCariesMode: (value: SecondaryCariesMode) => void;
1598
+ icdas: boolean;
1599
+ onIcdas: (value: boolean) => void;
1600
+ cariesDepth: boolean;
1601
+ onCariesDepth: (value: boolean) => void;
1602
+ rootCariesMode: RootCariesMode;
1603
+ onRootCariesMode: (value: RootCariesMode) => void;
1604
+ radiographicDepthMode: RadiographicDepthMode;
1605
+ onRadiographicDepthMode: (value: RadiographicDepthMode) => void;
1606
+ selectionColor: string;
1607
+ onSelectionColor: (value: string) => void;
1608
+ selectionBorderStyle: SelectionBorderStyle;
1609
+ onSelectionBorderStyle: (value: SelectionBorderStyle) => void;
1610
+ pulpLevel: PulpDetailLevel;
1611
+ onPulpLevel: (value: PulpDetailLevel) => void;
1612
+ wearDetailLevel: ToothDetailLevel;
1613
+ onWearDetailLevel: (value: ToothDetailLevel) => void;
1614
+ discolorationDetailLevel: ToothDetailLevel;
1615
+ onDiscolorationDetailLevel: (value: ToothDetailLevel) => void;
1616
+ surfaceNotation: SurfaceNotation;
1617
+ onSurfaceNotation: (value: SurfaceNotation) => void;
1618
+ notes: boolean;
1619
+ onNotes: (value: boolean) => void;
1620
+ planModeAvailable: boolean;
1621
+ onPlanModeAvailable: (value: boolean) => void;
1622
+ screenToothSpacing: ScreenToothSpacing;
1623
+ onScreenToothSpacing: (value: ScreenToothSpacing) => void;
1624
+ screenToothNumberSize: ScreenToothNumberSize;
1625
+ onScreenToothNumberSize: (value: ScreenToothNumberSize) => void;
1626
+ toothAnatomy: ToothAnatomy;
1627
+ onToothAnatomy: (value: ToothAnatomy) => void;
1628
+ showStatusCard: boolean;
1629
+ onShowStatusCard: (value: boolean) => void;
1630
+ showOrthoCard: boolean;
1631
+ onShowOrthoCard: (value: boolean) => void;
1632
+ perioChartAvailable: boolean;
1633
+ onPerioChartAvailable: (value: boolean) => void;
1634
+ perioViewMode: PerioViewMode;
1635
+ onPerioViewMode: (value: PerioViewMode) => void;
1636
+ perioRowVisibility: Record<PerioRowId, boolean>;
1637
+ onPerioRowVisibility: (id: PerioRowId, visible: boolean) => void;
1638
+ perioIndexNameMode: PerioIndexNameMode;
1639
+ onPerioIndexNameMode: (value: PerioIndexNameMode) => void;
1640
+ fillingDefectEnabled: boolean;
1641
+ onFillingDefectEnabled: (value: boolean) => void;
1642
+ fillingComplexity: FillingComplexity;
1643
+ onFillingComplexity: (value: FillingComplexity) => void;
1644
+ fillingMaterials: Record<string, boolean>;
1645
+ onFillingMaterial: (material: string, value: boolean) => void;
1646
+ fissureSealingEnabled: boolean;
1647
+ onFissureSealingEnabled: (value: boolean) => void;
1648
+ pdfSettings: PdfSettings;
1649
+ onPdfSettings: (patch: Partial<PdfSettings>) => void;
1650
+ };
1651
+
1652
+ /** Switch the tooth-anatomy profile. No-op (does not notify) if unchanged.
1653
+ * Invalidates the perio-chart template cache so that chart re-parses the new
1654
+ * profile's templates on its next load (the odontogram grid is rebuilt by the
1655
+ * caller via `rebuildGrid()`). */
1656
+ export declare function setToothAnatomy(v: ToothAnatomy): void;
1657
+
1658
+ /** Base tooth picker on the current selection — wraps the exact `#toothSelect`
1659
+ * closure `wireControls()` bound (the `defaultState()` reset with the milk-block
1660
+ * guard + the extraction/caries/endo/filling clears, and the trailing
1661
+ * `setEdentulous(false)` when the base is not "none"). */
1662
+ export declare function setToothSelectionForSelection(value: string): void;
1663
+
1664
+ /** Cervical wear type on the current selection (complex-mode select). */
1665
+ export declare function setWearCervicalForSelection(value: string): void;
1666
+
1667
+ /** Cervical wear simple-mode toggle (abrasion / none) on the selection. */
1668
+ export declare function setWearCervicalToggleForSelection(on: boolean): void;
1669
+
820
1670
  export declare function setWearDetailLevel(value: ToothDetailLevel): void;
821
1671
 
1672
+ /** Incisal/occlusal wear type on the current selection (complex-mode select). */
1673
+ export declare function setWearEdgeForSelection(value: string): void;
1674
+
1675
+ /** Incisal/occlusal wear simple-mode toggle (attrition / none) on the selection. */
1676
+ export declare function setWearEdgeToggleForSelection(on: boolean): void;
1677
+
822
1678
  /** Toggle visibility of wisdom teeth (18, 28, 38, 48). */
823
1679
  export declare function setWisdomVisible(on: Any): void;
824
1680
 
825
- /** Start the 12-step interactive intro tour. */
1681
+ /** Start the interactive intro tour. */
826
1682
  export declare function startIntroTour(): void;
827
1683
 
1684
+ export declare function StatusesCard(): JSX_2.Element;
1685
+
1686
+ /** One surface-cross cell's fully-resolved render state. */
1687
+ export declare type SurfaceCell = {
1688
+ value: string;
1689
+ pos: string;
1690
+ letter: string;
1691
+ label: string;
1692
+ labelId: string;
1693
+ checked: boolean;
1694
+ disabled: boolean;
1695
+ onToggle: (checked: boolean) => void;
1696
+ indicators?: SurfaceIndicator[];
1697
+ attrs?: Record<string, string>;
1698
+ };
1699
+
1700
+ export declare function SurfaceCross({ cells }: {
1701
+ cells: SurfaceCell[];
1702
+ }): JSX_2.Element;
1703
+
1704
+ /** One injected per-cell indicator span (e.g. the `.surf-depth` severity popup
1705
+ * affordance). `side` decides whether it renders before the checkbox (left) or
1706
+ * after the caption (right), matching the imperative insert order. */
1707
+ export declare type SurfaceIndicator = {
1708
+ key: string;
1709
+ className: string;
1710
+ title: string;
1711
+ side: "left" | "right";
1712
+ attrs?: Record<string, string>;
1713
+ children?: ReactNode;
1714
+ onClick?: (anchor: HTMLElement) => void;
1715
+ };
1716
+
828
1717
  export declare type SurfaceNotation = "simple" | "full";
829
1718
 
1719
+ /** Selectable tooth-anatomy profiles. Stage A: only `classic` is realized;
1720
+ * `measured` is accepted but falls back to the classic profile (harmless). */
1721
+ export declare type ToothAnatomy = "classic" | "measured";
1722
+
1723
+ export declare function ToothControlsSurface(): JSX_2.Element;
1724
+
830
1725
  export declare type ToothDetailLevel = "simple" | "complex";
831
1726
 
1727
+ export declare function ToothDetailsCard(): JSX_2.Element;
1728
+
1729
+ export declare type ToothDetailsOption = {
1730
+ value: string;
1731
+ label: string;
1732
+ disabled?: boolean;
1733
+ };
1734
+
1735
+ /** One EFFECTIVE coded diagnosis on a tooth (after `dxOverrides` are applied):
1736
+ * a rule-derived finding not suppressed, or an explicitly added one. */
1737
+ export declare type ToothDiagnosis = {
1738
+ key: DiagnosisKey;
1739
+ icd10: string | null;
1740
+ icd10Display: string;
1741
+ source: "derived" | "added";
1742
+ };
1743
+
1744
+ export declare function ToothInfoSurface(): JSX_2.Element;
1745
+
832
1746
  declare interface ToothTableCell {
833
1747
  toothNo: number;
834
1748
  label: string;
@@ -841,4 +1755,33 @@ declare interface ToothTableCell {
841
1755
  * shown bold-italic in a warning colour). */
842
1756
  declare type ToothTableStatus = "empty" | "content" | "problem";
843
1757
 
1758
+ /** The translate function surfaced by {@link useI18n}. */
1759
+ declare type TranslateFn = ReturnType<typeof useI18n>["t"];
1760
+
1761
+ export declare function useEngineState<T>(read: () => T): T;
1762
+
1763
+ /**
1764
+ * React hook for i18n. Supports both **controlled** mode (parent provides
1765
+ * `language` prop) and **standalone** mode (internal state).
1766
+ *
1767
+ * @param options - Optional controlled-mode props.
1768
+ * @returns `{ lang, setLang, t }` — current language, setter, and scoped translate function.
1769
+ */
1770
+ declare function useI18n(options?: UseI18nOptions): {
1771
+ lang: Language;
1772
+ setLang: (next: Language) => void;
1773
+ t: (key: string, params?: Params) => string;
1774
+ };
1775
+
1776
+ declare type UseI18nOptions = {
1777
+ language?: Language;
1778
+ onLanguageChange?: (lang: Language) => void;
1779
+ };
1780
+
1781
+ /**
1782
+ * Read the shared odontogram UI context. Throws when used outside an
1783
+ * {@link OdontogramProvider}, so a misplaced surface fails loudly at mount.
1784
+ */
1785
+ export declare function useOdontogramUi(): OdontogramUiContextValue;
1786
+
844
1787
  export { }