@mieweb/ui 0.10.0-dev.10 → 0.10.0-dev.12

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.
Files changed (113) hide show
  1. package/dist/Input-yN516s5_.d.cts +3 -0
  2. package/dist/Input-yN516s5_.d.ts +3 -0
  3. package/dist/ag-grid.d.cts +142 -1
  4. package/dist/ag-grid.d.ts +142 -1
  5. package/dist/components/Alert/index.d.cts +1 -1
  6. package/dist/components/Alert/index.d.ts +1 -1
  7. package/dist/components/AlertDialog/index.d.cts +28 -3
  8. package/dist/components/AlertDialog/index.d.ts +28 -3
  9. package/dist/components/AudioRecorder/index.d.cts +2 -2
  10. package/dist/components/AudioRecorder/index.d.ts +2 -2
  11. package/dist/components/Autocomplete/index.d.cts +8 -2
  12. package/dist/components/Autocomplete/index.d.ts +8 -2
  13. package/dist/components/Avatar/index.d.cts +1 -1
  14. package/dist/components/Avatar/index.d.ts +1 -1
  15. package/dist/components/Badge/index.d.cts +1 -1
  16. package/dist/components/Badge/index.d.ts +1 -1
  17. package/dist/components/BoardView/index.d.cts +91 -4
  18. package/dist/components/BoardView/index.d.ts +91 -4
  19. package/dist/components/Button/index.d.cts +1 -1
  20. package/dist/components/Button/index.d.ts +1 -1
  21. package/dist/components/CalendarView/index.d.cts +1 -2
  22. package/dist/components/CalendarView/index.d.ts +1 -2
  23. package/dist/components/Card/index.d.cts +3 -3
  24. package/dist/components/Card/index.d.ts +3 -3
  25. package/dist/components/Dropdown/index.d.cts +2 -1
  26. package/dist/components/Dropdown/index.d.ts +2 -1
  27. package/dist/components/GanttView/index.d.cts +1 -2
  28. package/dist/components/GanttView/index.d.ts +1 -2
  29. package/dist/components/ListView/index.d.cts +2 -3
  30. package/dist/components/ListView/index.d.ts +2 -3
  31. package/dist/components/MediaEditor/index.d.cts +91 -2
  32. package/dist/components/MediaEditor/index.d.ts +91 -2
  33. package/dist/components/MediaPlayer/index.d.cts +1 -1
  34. package/dist/components/MediaPlayer/index.d.ts +1 -1
  35. package/dist/components/Pagination/index.d.cts +1 -1
  36. package/dist/components/Pagination/index.d.ts +1 -1
  37. package/dist/components/PhoneInput/index.d.cts +36 -3
  38. package/dist/components/PhoneInput/index.d.ts +36 -3
  39. package/dist/components/Progress/index.d.cts +1 -1
  40. package/dist/components/Progress/index.d.ts +1 -1
  41. package/dist/components/Q/index.d.cts +2 -2
  42. package/dist/components/Q/index.d.ts +2 -2
  43. package/dist/components/QuickAction/index.d.cts +1 -1
  44. package/dist/components/QuickAction/index.d.ts +1 -1
  45. package/dist/components/RecordButton/index.d.cts +1 -1
  46. package/dist/components/RecordButton/index.d.ts +1 -1
  47. package/dist/components/RichTextEditor/index.d.cts +7 -2
  48. package/dist/components/RichTextEditor/index.d.ts +7 -2
  49. package/dist/components/ScrollArea/index.d.cts +1 -1
  50. package/dist/components/ScrollArea/index.d.ts +1 -1
  51. package/dist/components/Select/index.d.cts +1 -2
  52. package/dist/components/Select/index.d.ts +1 -2
  53. package/dist/components/Skeleton/index.d.cts +1 -1
  54. package/dist/components/Skeleton/index.d.ts +1 -1
  55. package/dist/components/Slider/index.d.cts +2 -2
  56. package/dist/components/Slider/index.d.ts +2 -2
  57. package/dist/components/Spinner/index.d.cts +2 -2
  58. package/dist/components/Spinner/index.d.ts +2 -2
  59. package/dist/components/SuperChat/index.d.cts +2 -4
  60. package/dist/components/SuperChat/index.d.ts +2 -4
  61. package/dist/components/SuperChat/plugins/index.d.cts +2 -3
  62. package/dist/components/SuperChat/plugins/index.d.ts +2 -3
  63. package/dist/components/Text/index.d.cts +3 -3
  64. package/dist/components/Text/index.d.ts +3 -3
  65. package/dist/components/Textarea/index.d.cts +1 -2
  66. package/dist/components/Textarea/index.d.ts +1 -2
  67. package/dist/components/ThemeProvider/index.d.cts +3 -1
  68. package/dist/components/ThemeProvider/index.d.ts +3 -1
  69. package/dist/components/TranscriptView/index.d.cts +85 -4
  70. package/dist/components/TranscriptView/index.d.ts +85 -4
  71. package/dist/components/ViewSet/index.d.cts +120 -9
  72. package/dist/components/ViewSet/index.d.ts +120 -9
  73. package/dist/components/ViewSwitcher/index.d.cts +4 -40
  74. package/dist/components/ViewSwitcher/index.d.ts +4 -40
  75. package/dist/datavis.d.cts +167 -13
  76. package/dist/datavis.d.ts +167 -13
  77. package/dist/esheet.d.cts +183 -1
  78. package/dist/esheet.d.ts +183 -1
  79. package/dist/hooks/index.d.cts +383 -31
  80. package/dist/hooks/index.d.ts +383 -31
  81. package/dist/index-DoYYWsNc.d.cts +127 -0
  82. package/dist/index-DoYYWsNc.d.ts +127 -0
  83. package/dist/index.d.cts +7592 -414
  84. package/dist/index.d.ts +7592 -414
  85. package/dist/motion.d.cts +186 -2
  86. package/dist/motion.d.ts +186 -2
  87. package/dist/q.d.cts +25 -3
  88. package/dist/q.d.ts +25 -3
  89. package/dist/{types-B97JNRNQ.d.cts → types-DOxdTwmq.d.cts} +170 -2
  90. package/dist/{types-gZXrfLj6.d.ts → types-DOxdTwmq.d.ts} +170 -2
  91. package/dist/{types-CbWXIKbe.d.cts → types-DsdZvEI1.d.cts} +1 -28
  92. package/dist/{types-CbWXIKbe.d.ts → types-DsdZvEI1.d.ts} +1 -28
  93. package/dist/utils/index.d.cts +13 -2
  94. package/dist/utils/index.d.ts +13 -2
  95. package/package.json +3 -2
  96. package/dist/Animated-XmH6k8pZ.d.cts +0 -188
  97. package/dist/Animated-XmH6k8pZ.d.ts +0 -188
  98. package/dist/MedicationEditor-Bp4NLy7y.d.cts +0 -352
  99. package/dist/MedicationEditor-Bp4NLy7y.d.ts +0 -352
  100. package/dist/html-MdxqSzjD.d.cts +0 -13
  101. package/dist/html-MdxqSzjD.d.ts +0 -13
  102. package/dist/orderRows-BUJYgSc7.d.cts +0 -221
  103. package/dist/orderRows-BUJYgSc7.d.ts +0 -221
  104. package/dist/transcript-Cg7uSW-C.d.cts +0 -84
  105. package/dist/transcript-Cg7uSW-C.d.ts +0 -84
  106. package/dist/types-CnPEwzlp.d.cts +0 -254
  107. package/dist/types-CnPEwzlp.d.ts +0 -254
  108. package/dist/useAnchoredPosition-CKwLSQW8.d.cts +0 -76
  109. package/dist/useAnchoredPosition-CKwLSQW8.d.ts +0 -76
  110. package/dist/useTheme-B9SWu6ui.d.cts +0 -24
  111. package/dist/useTheme-B9SWu6ui.d.ts +0 -24
  112. package/dist/useTranscriptEdits-CGzlemHT.d.cts +0 -182
  113. package/dist/useTranscriptEdits-D32bLs0l.d.ts +0 -182
@@ -1,221 +0,0 @@
1
- /**
2
- * Patient history — the minimal longitudinal facts the health-surveillance
3
- * due engine needs: who the patient is (age, sex) and what has been done or
4
- * is in flight (orders with status, observations, procedures, immunizations),
5
- * plus problem-list context (conditions) and allergies for display/interop.
6
- *
7
- * All clinical entries are keyed by `CODETYPE|FULLCODE` — the same keys used
8
- * by programs.json order sets and the codify shards — so the due engine can
9
- * match history against a program's satisfying orders with plain string
10
- * equality.
11
- */
12
- /** ISO date string (YYYY-MM-DD or full ISO timestamp). */
13
- type IsoDate = string;
14
- interface HistoryOrder {
15
- /** CODETYPE|FULLCODE, e.g. "Quest Order|3058" or "HCPCS|92551" */
16
- key: string;
17
- /** Display label (optional; the due list falls back to the key) */
18
- label?: string;
19
- status: 'completed' | 'pending';
20
- /** Completion date for completed orders; order date for pending ones */
21
- date: IsoDate;
22
- /** Ordering/performing provider display name (e.g. "Dr. Patel") */
23
- provider?: string;
24
- /** Requisition the order was bundled into — the document routing a batch
25
- * of encounter orders to a provider/referral (e.g. "REQ-2024-0117") */
26
- requisitionId?: string;
27
- /** Encounter (visit) the order was placed in (e.g. "ENC-2024-0117") */
28
- encounterId?: string;
29
- }
30
- interface HistoryObservation {
31
- /** CODETYPE|FULLCODE, e.g. "LOINC|4548-4" (HbA1c) */
32
- key: string;
33
- label?: string;
34
- /** Display value with units, e.g. "7.2 %" or "38 ug/dL" */
35
- value?: string;
36
- date: IsoDate;
37
- }
38
- interface HistoryProcedure {
39
- key: string;
40
- label?: string;
41
- date: IsoDate;
42
- }
43
- interface HistoryImmunization {
44
- /** CODETYPE|FULLCODE, e.g. "CVX|88" */
45
- key: string;
46
- label?: string;
47
- date: IsoDate;
48
- }
49
- interface HistoryCondition {
50
- key: string;
51
- label?: string;
52
- onset?: IsoDate;
53
- }
54
- interface HistoryAllergy {
55
- /** Allergen key when coded (e.g. "RxNORM|7980"), else omit */
56
- key?: string;
57
- label: string;
58
- reaction?: string;
59
- severity?: 'mild' | 'moderate' | 'severe';
60
- }
61
- interface HistoryMedication {
62
- key?: string;
63
- label: string;
64
- /** Sig / dose display, e.g. "10 mg daily" */
65
- detail?: string;
66
- }
67
- interface PatientHistory {
68
- /** Age in years */
69
- age: number;
70
- sex: 'M' | 'F';
71
- /** Past + in-flight orders (completion drives the due engine) */
72
- orders: HistoryOrder[];
73
- observations?: HistoryObservation[];
74
- procedures?: HistoryProcedure[];
75
- immunizations?: HistoryImmunization[];
76
- conditions?: HistoryCondition[];
77
- allergies?: HistoryAllergy[];
78
- medications?: HistoryMedication[];
79
- }
80
-
81
- /**
82
- * Due-evaluation engine — the "knowledge" layer of health surveillance.
83
- * Given a patient's history and the program metadata (programs.json from
84
- * mieweb/codify, or a deployment's own), decides which programs/measures are
85
- * due, overdue, pending, or satisfied. Pure functions, no I/O — the metadata
86
- * is small, so this runs on the main thread.
87
- */
88
-
89
- /**
90
- * One entry in a program's order set:
91
- * - `"CODETYPE|FULLCODE"` — a plain required order
92
- * - `{ alt: [a, b] }` — mutually exclusive alternatives (one-of): a
93
- * colonoscopy OR a FIT satisfies colorectal screening
94
- * - `{ key, after: […] }` — depends on completed prerequisites (Gantt edge):
95
- * the RMO's fitness-for-duty determination needs the panel results first,
96
- * and a program may carry several determinations (per panel / per SEG)
97
- */
98
- type ProgramOrder = string | {
99
- key?: string;
100
- alt?: string[];
101
- after?: string[];
102
- };
103
- /** Program metadata — mirrors programs.json (see mieweb/codify). */
104
- interface ProgramMeta {
105
- kind?: 'surveillance' | 'fitness' | 'credential' | 'quality';
106
- /** Omitted = one-time / event-driven (satisfied forever once done) */
107
- periodicityMonths?: number;
108
- ageMin?: number;
109
- ageMax?: number;
110
- sex?: 'M' | 'F';
111
- /** Satisfying orders — plain keys, one-of alternatives, or dependent
112
- * entries (see ProgramOrder) */
113
- orders?: ProgramOrder[];
114
- }
115
- type ProgramsMap = Record<string, ProgramMeta>;
116
- type DueStatus = 'due' | 'overdue' | 'pending' | 'satisfied' | 'not-applicable';
117
- interface DueItem {
118
- /** Program key, CODETYPE|FULLCODE (e.g. "OSHA|1910.95", "eCQM|CMS125") */
119
- key: string;
120
- program: ProgramMeta;
121
- status: DueStatus;
122
- /** Most recent completion date of any satisfying order */
123
- lastCompleted?: string;
124
- /** When the current/last satisfaction lapses (satisfied/overdue only) */
125
- dueDate?: string;
126
- /** Satisfying orders currently pending */
127
- pendingKeys: string[];
128
- }
129
- /** Is the patient inside the program's age/sex gates? */
130
- declare function isApplicable(history: Pick<PatientHistory, 'age' | 'sex'>, program: ProgramMeta): boolean;
131
- /**
132
- * Evaluate one program against the history.
133
- * `now` defaults to today; injectable for tests.
134
- */
135
- declare function evaluateProgram(key: string, program: ProgramMeta, history: PatientHistory, now?: Date): DueItem;
136
- /**
137
- * Evaluate a set of programs against the history, most actionable first
138
- * (overdue → due → pending → satisfied; not-applicable omitted unless
139
- * `includeNotApplicable`).
140
- *
141
- * `enrolledKeys` restricts occupational programs to the patient's actual
142
- * enrollments (a clerk isn't due for cadmium surveillance just because the
143
- * program exists); quality measures apply to everyone passing their gates.
144
- */
145
- declare function evaluateDue(history: PatientHistory, programs: ProgramsMap, options?: {
146
- enrolledKeys?: string[];
147
- includeNotApplicable?: boolean;
148
- now?: Date;
149
- }): DueItem[];
150
- /**
151
- * Ordering-time prompt: is this order key part of a due/overdue program?
152
- * Returns the matching due items so the UI can badge "due for OSHA 1910.95"
153
- * or warn "already satisfied" while the clinician is ordering.
154
- */
155
- declare function dueForOrder(orderKey: string, dueItems: DueItem[]): DueItem[];
156
-
157
- /**
158
- * Order-row builders — flatten the order history and the due-evaluation
159
- * output into grid-friendly rows (one row per encounter order) for the
160
- * NITRO-backed ChartOrdersGrid / EncounterOrdersGrid.
161
- *
162
- * Pure functions, no I/O. Every field is a flat string so the DataVis engine
163
- * can group/filter/aggregate on any of them (reason, provider, requisition,
164
- * status, kind, date).
165
- */
166
-
167
- /** Per-order status — finer grained than the program-level DueStatus. */
168
- type OrderRowStatus = 'completed' | 'pending' | 'available' | 'blocked';
169
- /** One encounter order as a flat grid row. */
170
- interface OrderRow {
171
- /** CODETYPE|FULLCODE of the order */
172
- orderKey: string;
173
- /** Order display label */
174
- order: string;
175
- /** Reason/concern — the surveillance program or quality measure label */
176
- reason: string;
177
- /** Program key (CODETYPE|FULLCODE); '' when no program matches */
178
- reasonKey: string;
179
- /** Program kind label ('surveillance', 'quality measure', …) */
180
- kind: string;
181
- status: OrderRowStatus;
182
- /** Completion date (completed) or order date (pending); '' otherwise */
183
- date: string;
184
- /** Program due date, when known */
185
- dueDate: string;
186
- /** Ordering/performing provider; '' when unknown */
187
- provider: string;
188
- /** Requisition the order is bundled into; '' = unprocessed */
189
- requisitionId: string;
190
- /** Encounter the order was placed in; '' for not-yet-placed rows */
191
- encounterId: string;
192
- /** Unmet prerequisite labels, comma-joined ('' when unblocked) */
193
- blockedBy: string;
194
- }
195
- interface OrderRowsOptions {
196
- /** Occupational enrollments; quality measures apply to everyone in-gate */
197
- enrolledKeys?: string[];
198
- /** Evaluation clock (defaults to today; inject for determinism) */
199
- now?: Date;
200
- /** Display labels for program keys (falls back to the key) */
201
- programLabels?: Record<string, string>;
202
- /** Display labels for order keys (falls back to history labels, then key) */
203
- orderLabels?: Record<string, string>;
204
- /** Include not-yet-placed due-list orders as available/blocked rows
205
- * (default true) */
206
- includeDue?: boolean;
207
- }
208
- /**
209
- * Chart-wide rows: every past + in-flight order in the history, plus (by
210
- * default) the actionable due-list orders that haven't been placed yet
211
- * (`available`, or `blocked` while prerequisites are incomplete).
212
- */
213
- declare function buildChartOrderRows(history: PatientHistory, programs: ProgramsMap, options?: OrderRowsOptions): OrderRow[];
214
- /**
215
- * Current-encounter rows: the encounter's own orders (pending unprocessed
216
- * ones are the mass-operation targets) plus the actionable due-list orders
217
- * available to place this visit.
218
- */
219
- declare function buildEncounterOrderRows(history: PatientHistory, programs: ProgramsMap, encounterId: string, options?: OrderRowsOptions): OrderRow[];
220
-
221
- export { type DueItem as D, type HistoryAllergy as H, type IsoDate as I, type OrderRow as O, type PatientHistory as P, type ProgramsMap as a, type DueStatus as b, type HistoryCondition as c, type HistoryImmunization as d, type HistoryMedication as e, type HistoryObservation as f, type HistoryOrder as g, type HistoryProcedure as h, type OrderRowStatus as i, type OrderRowsOptions as j, type ProgramMeta as k, buildChartOrderRows as l, buildEncounterOrderRows as m, dueForOrder as n, evaluateDue as o, evaluateProgram as p, isApplicable as q };
@@ -1,84 +0,0 @@
1
- /**
2
- * Transcript schema for @mieweb/ui media components.
3
- *
4
- * Provider-agnostic and persistence-agnostic. Canonical time unit is
5
- * **milliseconds** (consumers with seconds-based data, e.g. osheet, adapt
6
- * at the boundary).
7
- *
8
- * Shared by TranscriptView, MediaEditor, and useTranscriptEdits.
9
- */
10
- /** Type of transcript word - 'word' for spoken content, 'silence' for detected gaps, 'silence-newline' for longer pauses */
11
- type WordType = 'word' | 'silence' | 'silence-newline';
12
- interface TranscriptWord {
13
- text: string;
14
- startMs: number;
15
- endMs: number;
16
- /** References Speaker.id when diarization is available */
17
- speakerId?: string;
18
- confidence?: number;
19
- /** Type of word: 'word' for spoken content, 'silence' for detected gaps. Defaults to 'word' */
20
- wordType?: WordType;
21
- }
22
- /** A diarized segment of contiguous speech (osheet-style granularity) */
23
- interface TranscriptSegment {
24
- text: string;
25
- startMs: number;
26
- endMs: number;
27
- /** References Speaker.id when diarization is available */
28
- speakerId?: string;
29
- words: TranscriptWord[];
30
- }
31
- interface Speaker {
32
- id: string;
33
- /** Display name (e.g. 'Clinician', 'Patient'). Hosts may remap via speakerLabels props. */
34
- name?: string;
35
- }
36
- interface Transcript {
37
- durationMs: number;
38
- speakers?: Speaker[];
39
- words: TranscriptWord[];
40
- segments?: TranscriptSegment[];
41
- }
42
- /**
43
- * An editable word that references the original transcript word.
44
- * Used in the edited timeline to track deletions and reordering.
45
- */
46
- interface EditableWord {
47
- /** Index into the SILENCE-INSERTED baseline timeline (transcript.words
48
- * with detected silence pseudo-words interleaved) — NOT into
49
- * transcript.words. -1 for split/inserted entries with no baseline slot.
50
- * Consumers persisting edits should key by this timeline. */
51
- originalIndex: number;
52
- /** The word data (from original transcript) */
53
- word: TranscriptWord;
54
- /** Whether this word is marked as deleted */
55
- deleted: boolean;
56
- /** Whether this word was inserted (pasted from clipboard) */
57
- inserted?: boolean;
58
- }
59
- /**
60
- * Represents a contiguous segment of playback from the original media.
61
- * Used when playing back an edited timeline with potentially reordered/deleted words.
62
- */
63
- interface PlaybackSegment {
64
- startMs: number;
65
- endMs: number;
66
- /** Indices into the editedWords array that this segment covers */
67
- editedIndices: number[];
68
- }
69
- /** Available playback speed multipliers */
70
- type PlaybackSpeed = 0.5 | 0.75 | 1 | 1.25 | 1.5 | 1.75 | 2;
71
- /** Array of all available speed options for dropdowns */
72
- declare const PLAYBACK_SPEEDS: PlaybackSpeed[];
73
- /**
74
- * A speed marker applied to a word in the transcript.
75
- * The speed applies from this word until the next speed marker or end of transcript.
76
- */
77
- interface SpeedMarker {
78
- /** Index in the editedWords array where the speed marker is placed */
79
- wordIndex: number;
80
- /** The playback speed multiplier */
81
- speed: PlaybackSpeed;
82
- }
83
-
84
- export { type EditableWord as E, type PlaybackSpeed as P, type SpeedMarker as S, type Transcript as T, type WordType as W, type PlaybackSegment as a, type TranscriptWord as b, PLAYBACK_SPEEDS as c, type Speaker as d, type TranscriptSegment as e };
@@ -1,84 +0,0 @@
1
- /**
2
- * Transcript schema for @mieweb/ui media components.
3
- *
4
- * Provider-agnostic and persistence-agnostic. Canonical time unit is
5
- * **milliseconds** (consumers with seconds-based data, e.g. osheet, adapt
6
- * at the boundary).
7
- *
8
- * Shared by TranscriptView, MediaEditor, and useTranscriptEdits.
9
- */
10
- /** Type of transcript word - 'word' for spoken content, 'silence' for detected gaps, 'silence-newline' for longer pauses */
11
- type WordType = 'word' | 'silence' | 'silence-newline';
12
- interface TranscriptWord {
13
- text: string;
14
- startMs: number;
15
- endMs: number;
16
- /** References Speaker.id when diarization is available */
17
- speakerId?: string;
18
- confidence?: number;
19
- /** Type of word: 'word' for spoken content, 'silence' for detected gaps. Defaults to 'word' */
20
- wordType?: WordType;
21
- }
22
- /** A diarized segment of contiguous speech (osheet-style granularity) */
23
- interface TranscriptSegment {
24
- text: string;
25
- startMs: number;
26
- endMs: number;
27
- /** References Speaker.id when diarization is available */
28
- speakerId?: string;
29
- words: TranscriptWord[];
30
- }
31
- interface Speaker {
32
- id: string;
33
- /** Display name (e.g. 'Clinician', 'Patient'). Hosts may remap via speakerLabels props. */
34
- name?: string;
35
- }
36
- interface Transcript {
37
- durationMs: number;
38
- speakers?: Speaker[];
39
- words: TranscriptWord[];
40
- segments?: TranscriptSegment[];
41
- }
42
- /**
43
- * An editable word that references the original transcript word.
44
- * Used in the edited timeline to track deletions and reordering.
45
- */
46
- interface EditableWord {
47
- /** Index into the SILENCE-INSERTED baseline timeline (transcript.words
48
- * with detected silence pseudo-words interleaved) — NOT into
49
- * transcript.words. -1 for split/inserted entries with no baseline slot.
50
- * Consumers persisting edits should key by this timeline. */
51
- originalIndex: number;
52
- /** The word data (from original transcript) */
53
- word: TranscriptWord;
54
- /** Whether this word is marked as deleted */
55
- deleted: boolean;
56
- /** Whether this word was inserted (pasted from clipboard) */
57
- inserted?: boolean;
58
- }
59
- /**
60
- * Represents a contiguous segment of playback from the original media.
61
- * Used when playing back an edited timeline with potentially reordered/deleted words.
62
- */
63
- interface PlaybackSegment {
64
- startMs: number;
65
- endMs: number;
66
- /** Indices into the editedWords array that this segment covers */
67
- editedIndices: number[];
68
- }
69
- /** Available playback speed multipliers */
70
- type PlaybackSpeed = 0.5 | 0.75 | 1 | 1.25 | 1.5 | 1.75 | 2;
71
- /** Array of all available speed options for dropdowns */
72
- declare const PLAYBACK_SPEEDS: PlaybackSpeed[];
73
- /**
74
- * A speed marker applied to a word in the transcript.
75
- * The speed applies from this word until the next speed marker or end of transcript.
76
- */
77
- interface SpeedMarker {
78
- /** Index in the editedWords array where the speed marker is placed */
79
- wordIndex: number;
80
- /** The playback speed multiplier */
81
- speed: PlaybackSpeed;
82
- }
83
-
84
- export { type EditableWord as E, type PlaybackSpeed as P, type SpeedMarker as S, type Transcript as T, type WordType as W, type PlaybackSegment as a, type TranscriptWord as b, PLAYBACK_SPEEDS as c, type Speaker as d, type TranscriptSegment as e };
@@ -1,254 +0,0 @@
1
- import * as React from 'react';
2
-
3
- /**
4
- * AI Component Types
5
- *
6
- * Type definitions for AI-related components including MCP (Model Context Protocol)
7
- * interactions, tool calls, and chat messages.
8
- */
9
-
10
- /**
11
- * Status of an MCP tool invocation
12
- */
13
- type MCPToolStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled';
14
- /**
15
- * MCP Tool parameter definition
16
- */
17
- interface MCPToolParameter {
18
- name: string;
19
- type: string;
20
- value: unknown;
21
- description?: string;
22
- }
23
- /**
24
- * MCP Tool invocation
25
- */
26
- interface MCPToolCall {
27
- /** Unique identifier for this tool call */
28
- id: string;
29
- /** Name of the tool being invoked */
30
- toolName: string;
31
- /** Human-readable description of what the tool does */
32
- description?: string;
33
- /** Parameters passed to the tool */
34
- parameters: MCPToolParameter[];
35
- /** Current status of the tool execution */
36
- status: MCPToolStatus;
37
- /** Timestamp when tool was invoked */
38
- startedAt: Date | string;
39
- /** Timestamp when tool completed */
40
- completedAt?: Date | string;
41
- /** Duration in milliseconds */
42
- duration?: number;
43
- /** Result data if successful */
44
- result?: MCPToolResult;
45
- /** Error message if failed */
46
- error?: string;
47
- }
48
- /**
49
- * Result from an MCP tool execution
50
- */
51
- interface MCPToolResult {
52
- /** Type of result data */
53
- type: 'text' | 'json' | 'link' | 'resource' | 'error';
54
- /** The result data */
55
- data: unknown;
56
- /** Human-readable summary of the result */
57
- summary?: string;
58
- /** Link to a resource (for link type) */
59
- link?: MCPResourceLink;
60
- /** Resources created or modified */
61
- resources?: MCPResource[];
62
- }
63
- /**
64
- * Link to a resource
65
- */
66
- interface MCPResourceLink {
67
- /** URL or path to the resource */
68
- href: string;
69
- /** Display text for the link */
70
- label: string;
71
- /** Type of resource */
72
- type?: 'patient' | 'document' | 'appointment' | 'order' | 'provider' | 'external' | 'internal';
73
- /** Icon name or component */
74
- icon?: string;
75
- }
76
- /**
77
- * MCP Resource definition
78
- */
79
- interface MCPResource {
80
- /** Unique identifier */
81
- id: string;
82
- /** Resource type (e.g., 'patient', 'appointment', 'document') */
83
- type: string;
84
- /** Display name */
85
- name: string;
86
- /** URL to access the resource */
87
- uri?: string;
88
- /** Brief description */
89
- description?: string;
90
- /** Additional metadata */
91
- metadata?: Record<string, unknown>;
92
- }
93
- /**
94
- * Role of the message sender
95
- */
96
- type AIMessageRole = 'user' | 'assistant' | 'system' | 'tool';
97
- /**
98
- * Status of an AI message
99
- */
100
- type AIMessageStatus = 'pending' | 'streaming' | 'complete' | 'error';
101
- /**
102
- * Content block within a message
103
- */
104
- interface AIMessageContent {
105
- /** Type of content */
106
- type: 'text' | 'tool_use' | 'tool_result' | 'thinking' | 'code' | 'image' | 'file' | 'audio' | 'video';
107
- /** Text content (also used as the label for `audio` and `video` blocks) */
108
- text?: string;
109
- /** Tool call reference */
110
- toolCall?: MCPToolCall;
111
- /** Language for code blocks */
112
- language?: string;
113
- /** Whether this content is collapsed by default */
114
- collapsed?: boolean;
115
- /** Image source URL (for `image` blocks) */
116
- imageUrl?: string;
117
- /** Alt text / file name (for `image` and `file` blocks) */
118
- name?: string;
119
- /** File size in bytes (for `file` blocks) */
120
- fileSize?: number;
121
- /** MIME type (for `file`, `audio`, and `video` blocks) */
122
- mimeType?: string;
123
- /** Download/open URL (for `file` blocks) */
124
- fileUrl?: string;
125
- /** Source URL for `audio` blocks */
126
- audioUrl?: string;
127
- /** Source URL for `video` blocks */
128
- videoUrl?: string;
129
- /** Duration in seconds for `audio` blocks */
130
- duration?: number;
131
- }
132
- /**
133
- * AI Chat Message
134
- */
135
- interface AIMessage {
136
- /** Unique identifier */
137
- id: string;
138
- /** Role of sender */
139
- role: AIMessageRole;
140
- /** Message content blocks */
141
- content: AIMessageContent[];
142
- /** Timestamp */
143
- timestamp: Date | string;
144
- /** Current status */
145
- status: AIMessageStatus;
146
- /** Model used (for assistant messages) */
147
- model?: string;
148
- /** Token usage info */
149
- usage?: {
150
- promptTokens?: number;
151
- completionTokens?: number;
152
- totalTokens?: number;
153
- };
154
- /** Custom metadata */
155
- metadata?: Record<string, unknown>;
156
- }
157
- /** Context passed to a custom text content renderer. */
158
- interface AITextRenderContext {
159
- /** id of the parent message (useful as a render cache key) */
160
- messageId: string;
161
- /** true while the message is still streaming */
162
- streaming: boolean;
163
- /** role of the parent message */
164
- role: AIMessage['role'];
165
- }
166
- /**
167
- * Render-prop for customizing `text` content blocks. Host is responsible
168
- * for sanitizing untrusted input.
169
- */
170
- type AIRenderTextContent = (text: string, ctx: AITextRenderContext) => React.ReactNode;
171
- /** Render-prop for appending custom content below a message bubble. */
172
- type AIRenderMessageFooter = (message: AIMessage) => React.ReactNode;
173
- /**
174
- * Suggested action/prompt
175
- */
176
- interface AISuggestedAction {
177
- /** Unique identifier */
178
- id: string;
179
- /** Display label */
180
- label: string;
181
- /** Full prompt text */
182
- prompt: string;
183
- /** Icon name */
184
- icon?: string;
185
- /** Category for grouping */
186
- category?: string;
187
- }
188
- /**
189
- * AI Chat session
190
- */
191
- interface AIChatSession {
192
- /** Unique session identifier */
193
- id: string;
194
- /** Session title */
195
- title?: string;
196
- /** Messages in the session */
197
- messages: AIMessage[];
198
- /** Available tools */
199
- availableTools?: MCPToolInfo[];
200
- /** Created timestamp */
201
- createdAt: Date | string;
202
- /** Last updated timestamp */
203
- updatedAt: Date | string;
204
- /** Whether the assistant is currently generating */
205
- isGenerating: boolean;
206
- /** Context information */
207
- context?: {
208
- /** Current page/location */
209
- page?: string;
210
- /** Selected entity */
211
- entity?: MCPResource;
212
- /** Additional context */
213
- custom?: Record<string, unknown>;
214
- };
215
- }
216
- /**
217
- * Information about an available MCP tool
218
- */
219
- interface MCPToolInfo {
220
- /** Tool name */
221
- name: string;
222
- /** Human-readable description */
223
- description: string;
224
- /** Input schema */
225
- inputSchema?: Record<string, unknown>;
226
- /** Category for grouping */
227
- category?: string;
228
- /** Whether the tool is enabled */
229
- enabled?: boolean;
230
- }
231
- interface AIChatCallbacks {
232
- /**
233
- * Called when user sends a message. When attachments are enabled via
234
- * `composerProps`, the staged files arrive as the second argument
235
- * (attachment-only sends invoke this with an empty string).
236
- */
237
- onSendMessage?: (message: string, attachments?: File[]) => void | Promise<void>;
238
- /** Called when a tool call is initiated */
239
- onToolCall?: (toolCall: MCPToolCall) => void | Promise<void>;
240
- /** Called when a tool call completes */
241
- onToolComplete?: (toolCall: MCPToolCall, result: MCPToolResult) => void;
242
- /** Called when user clicks a resource link */
243
- onResourceClick?: (resource: MCPResource | MCPResourceLink) => void;
244
- /** Called when user selects a suggested action */
245
- onSuggestedAction?: (action: AISuggestedAction) => void;
246
- /** Called when user wants to cancel generation */
247
- onCancel?: () => void;
248
- /** Called when user wants to retry */
249
- onRetry?: () => void;
250
- /** Called when session is cleared */
251
- onClear?: () => void;
252
- }
253
-
254
- export type { AIMessageContent as A, MCPResourceLink as M, AIMessageStatus as a, AIRenderTextContent as b, AITextRenderContext as c, MCPToolCall as d, MCPToolStatus as e, AIMessage as f, AIRenderMessageFooter as g, AIChatCallbacks as h, AIChatSession as i, AISuggestedAction as j, AIMessageRole as k, MCPResource as l, MCPToolInfo as m, MCPToolParameter as n, MCPToolResult as o };